Monte Carlo Methods in Statistical Physics

Lecture notes, program listings, and other things can be downloaded by following the links below.

§ Announcements

Weekly lecture, every Thursday, 10:00 c.t. in room SR4 (Theoretische Physik, Nord Uni).

Important information for Master students:

  • Spoken exam, 30 minutes, official date: 18 February 2011.

  • You can register for the exam using Flexnow, after 17 November 2010, but no later than one week before the official exam date.

GGNB students only need to attend the lectures in order to qualify for credits.

§ The book

I mostly use the book: “Monte Carlo Methods in Statistical Physics”, by MEJ Newman and GT Barkema because it totally rocks [click me].

§ Note on compiling

The example programs that I use throughout the lectures are written in C, and most use a makefile to do the compiling. They are offered as compressed tar files, which can be unpacked with the command: ”tar xvfz file.tgz” (on Linux based systems at least). It also helps to have gnuplot installed! If you are using windows, you can try your luck with this compiler.

§ Lecture 1: Introduction and some historical background

  • Monte Carlo program to calculate \pi by selecting points randomly in a square, and to count how often these points fall inside a circle placed in the center of the square [click me].

  • Program that Monte Carlo integrates the function f(x)=x^{2} from x=0 to x=1 using ITMAX Monte Carlo steps. The outcome is collected in a graph showing the value of the integral versus the number of Monte Carlo steps, and then repeated [click me].

  • Program that Monte Carlo integrates the function f(x)=x^{2} from x=0 to x=1, but it does so many (ITMAX) times. It then computes the root-mean-square error \sigma between different simulation runs as function of the number of Monte Carlo iterations. The idea is to show that \sigma\propto 1/\sqrt{N}, with N the number of Monte Carlo iterations [click me].

§ Lecture 2: Importance Sampling

This Lecture is mostly based on Chapters 2 and 3 of the Newman/Barkema book. You may also be interested in my notes, although the book is probably more pleasant to read.

  • Program to calculate the average energy of the 1D Ising model using the inefficient implementation whereby each spin state is generated randomly. For high temperature, or for small system sizes, this approach works quite well, but it breaks down for large systems in the low-temperature limit [click me].

  • Program to calculate the average energy of the 1D Ising model using the Metropolis algorithm. Here we use the ideas of Importance Sampling, leading to much better performance [click me].

§ Lectures 3 and 4: 2D lattice gas

In these lectures the two-dimensional lattice gas was introduced, and two Monte Carlo algorithms were proposed to simulate this model in the (NVT)-ensemble (i.e. constant volume V, temperature T, and particle number N, but fluctuating energy). This is already sufficient to study a wealth of physical phenomena (interface fluctuations and capillary waves, droplets, spinodal decomposition, critical behavior). Here are the lecture notes and some slides.

  • (NVT)-ensemble simulation of the 2D lattice gas using small particle steps [click me].

  • (NVT)-ensemble simulation of the 2D lattice gas using large particle steps [click me].

If one is brave, one can also include static (aka: quenched) obstacles into the system. This gives rise to an even richer behavior; see the program below.

  • (NVT)-ensemble simulation of the 2D lattice gas using large particle steps and with quenched obstacles [click me].

§ Lecture 5: Histogram reweighting

In this lecture we use histogram reweighting to obtain data over a range of temperatures, but by performing only a single simulation at one temperature. The lecture notes are available here.

  • Here is the same (NVT)-ensemble simulation of the 2D lattice gas of last week – using LARGE particle steps – slightly modified to also hold the energy distribution [click me].

  • And here is the code to do the actual histogram reweighting [click me].

§ Lecture 6: Wang-Landau sampling

In this lecture we solve the problem that, in “standard” Boltzmann sampling, the energy range visited by the simulation is small. By using Wang-Landau sampling, the simulation performs a random-walk in energy over a range in energy we can specify. Here are the lecture notes. In this Letter the method was first described. However, I recommend the subsequent paper.

  • Here is the (NVT)-ensemble implementation of Wang-Landau sampling for the 2D lattice gas [click me].

§ Lectures 7 and 8: Grand Canonical Monte Carlo + Wang-Landau sampling

In these lectures the grand canonical ensemble was discussed, and two Monte Carlo moves that one can use to simulate in this ensemble were presented. I also discussed how one can study the liquid-gas transition in the grand canonical ensemble, and how to combine grand canonical Monte Carlo with Wang-Landau sampling. By using Wang-Landau sampling, one can obtain the full probability distribution of the particle density. The shape of this distribution was shown to be related to interface formation, which can be used to obtain the interface tension. Finally, I discussed how one can measure the efficiency of a Monte Carlo simulation by means of the decay of the auto-correlation function. Here are the lecture notes.

  • Lecture 7: Here is a simple implementation of grand canonical Monte Carlo for the 2D lattice gas. This code uses the insert/remove variant, which is the one that most easily generalizes to off-lattice fluids also [click me].

  • Lecture 8: The problem with the above “simple” implementation is that one “gets stuck” in one of the phases. This “getting stuck” becomes worse the lower the temperature is, or the larger the size of the system. However, we can overcome this problem if we combine the GC method with the Wang-Landau approach. The simulation code that demonstrates this can be found here.

§ Lectures 9 and 10.5: The transition matrix, liquid crystals and Wang-Landau sampling again

  • First some general theoretical background about the transition matrix (notes). See also this paper.

  • Here are the notes on how to simulate liquid crystals using Wang-Landau sampling and the transition matrix. See also this paper.

§ Lectures 10.5 and 11: X-mas trees, forest fires, and percolation

§ Lectures 12 and 13: Grand canonical Monte Carlo simulations of colloid-polymer demixing and interfaces