Monte Carlo simulations on Ising/Potts model

Demonstration

In the demonstration below, we simulate a 10-state (Q = 10) Potts model. For Ising model, set Q = 2. Potts.class

Download: Java source code.

Monte Carlo simulation on Ising model

The principles of Monte Carlo simulations are best illustrated on the two-dimensional Ising/Potts model.

The system is set up on a L×L lattice. Each site has a spin, and each spin si at site i can assume one of the two values 1 or −1. Each spin can only interact with the four neighbors. The Hamiltonian (energy function) H is defined as

H = − ∑i, j J si sj,
where, i, j denotes a pair of nearest neighbors, and J is a coupling constant between spins. We simplicity, we assume J = 1 here.

Source code in C

The code is2.c, gives a minimalist example for a simulation of 2D Ising model. It outputs energy and heat capacity.
Exact value for the internal energy and heat capacity are Eav = −1133.866661, C = 907.072, respectively, computed from is2exact.c.

Random number generators (RNG)

The above Monte Carlo simulation requires many random numbers for selecting spins and for deciding whether or not to accept a move. Here are some commonly-used options.

Generalization -- Potts model (Java)

Below we demonstrate a generalization of the Ising model, called Potts model. Here the spin on each site can now assume Q, instead of two, different values (shown by different colors).

The Hamiltonian becomes:

H = − ∑i, j J δ(si, sj),
where δ(si, sj) gives 1 if si and sj are identical, or 0 otherwise.

The model is demonstrated at the beginning of the web page.