How to move a particle in a VMC calculation

Click For Summary
SUMMARY

This discussion focuses on implementing a particle movement algorithm in a Variational Monte Carlo (VMC) calculation using Python. The provided code demonstrates how to update particle positions, calculate wavefunction ratios, and determine acceptance based on a random threshold. The acceptance ratio is crucial for assessing the efficiency of the algorithm, with the user reporting poor acceptance rates. The tutorial referenced for further guidance is available at the University of Illinois' CMS site.

PREREQUISITES
  • Understanding of Variational Monte Carlo methods
  • Familiarity with Python programming, specifically numpy library
  • Knowledge of wavefunction and local energy calculations
  • Basic concepts of random number generation in computational simulations
NEXT STEPS
  • Review the VMC tutorial at CMS VMC Tutorial
  • Explore techniques for improving acceptance ratios in Monte Carlo simulations
  • Learn about advanced wavefunction optimization methods
  • Investigate the impact of different move algorithms on simulation efficiency
USEFUL FOR

Researchers and students in computational physics, particularly those working with quantum Monte Carlo methods, as well as developers implementing particle simulations in Python.

Mechdude
Messages
108
Reaction score
1

Homework Statement



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

Homework Equations


Here is my code:
Code:
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.
 
Physics news on Phys.org
The Attempt at a SolutionI think the idea of the move algorithm is to pick a random displacement for the particle (which in this case is a vector in 3D space) and then calculate the ratio between the new wavefunction and the old wavefunction. If the ratio is greater than a randomly chosen number (rander) then the move is accepted, otherwise it is rejected.
 

Similar threads

  • · Replies 1 ·
Replies
1
Views
5K
  • · Replies 2 ·
Replies
2
Views
2K