780.20: 1094 Session 14

Handouts: Excerpt on variational Monte Carlo, printouts of codes

In this session, we'll continue our survey of Monte Carlo computational methods with a look at autocorrelation and variational Monte Carlo applied to simple problems. The discussion is easily generalized to the more complex problems for which these approaches are well suited.

Autocorrelation

When evaluating an average over Monte Carlo configurations, we want to skip the first n1 steps and then use data taken every n0 Monte Carlo steps. How do we determine how large to take n0 and n1? We'll use a simple integration problem to explore these issues, by integrating x2e-x2 from 0 to 10 and dividing by the integral of e-x2 (so this is like < x2 > with a probability distribution proportional to e-x2).

  1. Calculate the (normalized) integral in Mathematica for reference. Answer:
  2. Consider first random sampling as a review/recap of our discussions.
  3. Next consider the Metropolis algorithm. There are three parameters for you to adjust (besides the total number of iterations): "max_step", "initial_skip" and "skip".


  4. To figure out a good value for "skip", we'll calculate the "autocorrelation function". This is defined in the Session notes as equation (14.2). For us, "A" is "x2". Your task is to generate a figure like the one in the notes.
  5. Now that the Metropolis results are reliable, repeat step 2. above, but now for the Metropolis sampling. What do you find?

Variational Monte Carlo

We'll do a simple example of variational Monte Carlo to illustrate the basic idea. Generalizing to more complex systems is straightforward (but takes a lot longer to run!).

  1. Take a look at the "variational_SHO.cpp" code and see how it implements variational Monte Carlo for a one-dimensional harmonic oscillator using the VariationalMC class. Compile, link, and run it (there is a makefile). What is the trial wave function? Why is this a reasonable one to use?



  2. You'll be asked to supply a range and step size for the variational parameter "a". This will require some experimentation to make sure the minimum with respect to "a" is in the interval you select.
  3. The variational_SHO.dat file is suitable for plotting in gnuplot. The plotfile "variational_SHO.plt" is provided to plot it with error bars. Try it out a few times each with 100, 1000, 10000 steps (attach a plot with a sample result). Does the graph make sense for a variational calculation? What about the error bars? How might you modify the code to find the minimum automatically (rather than graphically)?



  4. Does this code implement all the features explored in the "Autocorrelation" section? If not, how would you improve this code?




780.20: 1094 Session 14. Last modified: 08:22 am, February 21, 2011.
furnstahl.1@osu.edu