The expression for the energy expectation value of a particular
trial wavefunction,
, is,
The mean of the values of the ``local energy'',
In this project you are given a possible trial
wavefunction,
Before you start programming, you will need the analytic expressions for
the local energy.
This involves some nasty algebra, but the answer is,
The Monte Carlo moves
can be made by generating random numbers (use a library
routine to do this) and adding them to the electron coordinates.
I suggest that you update all six electron position coordinates
each move, and
so you will need six random numbers each time. The accepted lore
is that the Metropolis algorithm is most efficient when the step
size is chosen to keep the acceptance probability close to 0.5.
However, the method should work in principle no matter what the
step size and you should try a few different step sizes to
confirm that this is indeed the case.
The starting positions of the two electrons can be chosen
randomly, but remember that the Metropolis
algorithm only samples the probability distribution exactly
in the limit as the number of moves tends to infinity. You
will therefore have to throw away the results from the
moves near the beginning of the run and only start
accumulating the values of the local energy once things
have settled down. You should experiment to find out how
many moves you need to throw away.
The statistical errors in Monte Carlo calculations decrease like
, where
is the total number of moves after
the initial equilibration period. The errors
therefore improve only slowly as the length of the
run is increased. You will not be able (and should not
attempt) to attain great accuracy. However, you should
think hard about the magnitude of the statistical errors
involved. Calculating the variance of the values in the
list of energies accumulated during the random walk is easy
and you should certainly do it.