212 CHAPTER 12. QUANTUM MONTE CARLO METHODS
However, for the hydrogen atom we have , while for the harmonic oscillator we have
.
This has important consequences for the way we generate random positions. For the hydro-
gen atom we have a random position given by e.g.,
which ensures that , while for the harmonic oscillator we have
in order to have . This is however not implemented in the program below. There,
importance sampling is not included. We simulate points in the
, and directions using
random numbers generated by the uniform distribution and multiplied by the step length. Note
that we haveto define a step length in our calculations. Here one has to play around with different
values for the step and as a rule of thumb (one of the golden Monte Carlo rules), the step length
should be chosen so that roughly 50% of all new moves are accepted. In the program at the end
of this section we have also scaled the random position with the variational parameter
. The
reason for this particular choice is that we have an external loop over the variational parameter.
Different variational parameters will obviously yield different acceptance rates if we use the
same step length. An alternative to the code below is to perform the Monte Carlo sampling with
just one variational parameter, and play around with different step lengths in order to achieve a
reasonable acceptance ratio. Another possibility is to include a more advanced test which restarts
the Monte Carlo sampling with a new step length if the specific variational parameter and chosen
step length lead to a too low acceptance ratio.
In Figs. 12.1 and 12.2 we plot the ground state energies for the one-dimensional harmonic
oscillator and the hydrogen atom, respectively, as functions of the variational parameter
. These
results are also displayed in Tables 12.1 and 12.2. In these tables we list the variance and the
standard deviation as well. We note that at
we obtain the exact result, and the variance is
zero, as it should. The reason is that we then have the exact wave function, and the action of the
hamiltionan on the wave function
yields just a constant. The integral which defines various expectation values involving moments
of the hamiltonian becomes then
(12.39)
This explains why the variance is zero for . However, the hydrogen atom and the harmonic
oscillator are some of the few cases where we can use a trial wave function proportional to the
exact one. These two systems are also some of the few examples of cases where we can find
an exact solution to the problem. In most cases of interest, we do not know a priori the exact
wave function, or how to make a good trial wave function. In essentially all real problems a large
amount of CPU time and numerical experimenting is needed in order to ascertain the validity of
a Monte Carlo estimate. The next examples deal with such problems.