1. Not finding help here? Sign up for a free 30min tutor trial with Chegg Tutors
    Dismiss Notice
Dismiss Notice
Join Physics Forums Today!
The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

How to move a particle in a VMC calculation

  1. Sep 27, 2012 #1
    1. The problem statement, all variables and given/known data

    im trying to get concept of moving a particle in a Variational Monte Carlo calcualation and i still havent a clue on how to do that, all i get are really bad acceptance ratios

    2. Relevant equations
    Here is my code:
    Code (Text):

    def VMC(WF,numSteps):
            EnergyList=[]  ####
            R=numpy.zeros((2,3),float)   ### positions of two particles
            movesAttempted=0.0
            movesAccepted=0.0
            print "num-steps: ",numSteps
            for i in range(numSteps):  #####
                    OldPos= R.copy()
                    oldWfc= WF.WaveFunction(R)
                    for ptcl in xrange(0,len(R)):                    #### looping over the partices
                            R[ptcl] = numpy.add( R[ptcl],numpy.random.rand(3)*1.5) ## new pos?
                    newWfc= WF.WaveFunction(R)            
                    ratio = (newWfc**2/oldWfc**2)
                    rander = numpy.random.rand(1)
                    if ratio > rander:
                            Eloc = WF.LocalEnergy(R)
                            EnergyList.append(Eloc)
                            movesAttempted+=1
                            movesAccepted+=1
                    else:
                            movesAttempted+=1
                            R = OldPos                       # restore old R , we rejected a move here
            print "movesAcepted: ",  movesAccepted, ",   movesAttempted: ", movesAttempted
            print "Acceptance Ratio", movesAccepted/movesAttempted
            return EnergyList


     
    How is the move algorith done? i'm trying to follow the school here:
    http://cms.mcc.uiuc.edu/pimcpp/index.php/VMC_Tutorial

    Thanks.
     
  2. jcsd
Know someone interested in this topic? Share this thread via Reddit, Google+, Twitter, or Facebook

Can you offer guidance or do you also need help?