I'm attempting to implement some code that moves particles and then calculated the acceptance/rejection of the move, but I'm stuck in a rut. Here is my Python code: def VMC(WF,numSteps):     seed=5   ### my random number seed     EnergyList=[]       R=numpy.zeros((2,3),float)        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)):                R[ptcl] = numpy.add( R[ptcl], (numpy.random.rand(3) - 0.5)*3.0 )             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              print movesAcepted: ,movesAccepted         print   movesAttempted: , movesAttempted                  print Acceptance Ratio, movesAccepted/movesAttempted     return EnergyListHere is a pastebin of more of the code: http://pastebin.com/7nTLDesyI'm  getting a ridiculous value of the acceptance ratio, which makes me think I'm not getting the concept of how the electrons should be moved at all. Specifically: When I run this code I get an acceptance ratio of 0.478, while for VMC calculations, moving a particle in a box of length 1.5 (in each direction) around its current position (moving in 3d) the acceptance ratio is supposed to be   0.323.My problem is mainly to know how atoms are supposed to be moved in a VMC calculation and whether how I'm doing it is o.k.I've seen an implementation in Fortran (metropolis), and I was wondering how different mine is and how I can correct it to give better results.
How to move particles in a variational Monte Carlo simulation?
software;python