PHYS 510 - Computational Physics I

Assignment 6: The Ising Model and the Metropolis Algorithm

Spring 2010

Date Assigned: March 16, 2010
Date Due: April 6, 2010

Assignment 6

The assignment is to design and write algorithms for the following problems. You may choose to use either a NT or a LINUX platform for this assignment. The code may be developed in either C/C++, Fortran, Java, or Matlab.

Additional Reading 1: Newman, M.E.J. and Barkema, G.T., Monte Carlo Methods in Statistical Physics, Ch1, Ch2, Ch3

Additional web resources on the Ising Model:

Additional web resources on the Metropolis Algorithm:


The Ising Model

The Ising model is one of the most studied model in statistical physics. It was first proposed as a model to explain the orgin of magnetism arising from bulk materials containing many interacting magnetic dipoles and/or spins. In this model, space is divided up into a discrete lattice with a magnetic spin on each site. An Ising spin is permitted to take just two value, +1 (up) or -1 (down). Each spin interacts with its nearest neighbors and an external magnetic field B through the following Hamiltonian,

where J>0 gives the spin-spin interaction strength and indicates the sum over all nearest neighbor pairs (i,j) on the lattice. (see the following picture)

In this 2D square lattice, the red site iteracts only with its four nearest neighbors indicated by the green circles. The lattice shown is a small 5x5 lattice with periodic boundary condition meaning that the leftmost sites are identified with the rightmost ones. Similarly, the top sites are identified with the bottom ones (symbolically indicated by the blue arrows). In general, one is interested in the statistical properties, such as the average total magnetization M or the internal energy U of this network in the limit when the system size is large. The different possible states of the Ising model are characterized by the different sets of spin values {si}. Since each spin can only take on two possible values [+1 (up) or -1 (down)], the total number of states (all combinations of up and down spins) possible for a model with N sites (e.g. a 5x5 2D model will have N=25 sites) is 2N. The Hamiltonian gives the total energy of the lattice with a particular spin configuration. With the sign chosen for J>0, the lowest energy state corresponds to the one with all the spins line up with each other and with the same direction as the magnetic field B (ferromagnetic case). [Note that the J<0 case corresponds to the anti-ferromagnetic case in which the spins will perfer to line up anti-parallel with each other.]

Using the standard machinery in statistical physics, the marcorscopic properties of the system is completely described by the partition function of the model,

where k is the Boltzman constant and T is the temperature of the system and the sum is over all possible configurations of spins for the system. For example, the expectation value of the total energy or the internal energy of the system U is given by

where b=1/kT and the specific heat of the system is given by
.
The exponential factor inside the partition function is called the Boltzman factor and all statistical averages at equilibrium is calculated with respect to this weighting factor. Thus, the average energy of the system can also be directly written as

where the sum is over all possible spin configurations and we use X as a label to denote a particular spin configuration of the system. (One can easily see that this expression is equivalent to the one given above.) Another important statistic average relevant to the Ising system is the average magnetization of the system defined by

The internal sum is over all sites for a particular configuration X and the external sum is again over all possible configurations. Often, it is rather the average magnetization per site that one will often use to characterize the macroscopic state of the system.

Note: The weighted averages defined in the previous two equations can be calculated as a simple mean of the relevant quantity f over the number of the Metropolis steps - M, i.e.,
.

One of the most dramatic effect for a magnetic system is the sudden emergence of coherence magnetic domains when the temperature of the system is lowered pass a critical value. The 2D Ising model is one of the simplest model that demonstrates this critical transition with Tc>0. Onsager in 1944, by pure analytical perseverance, proved this fact by providing the first exact solution to the 2D Ising model. While exact analytic solutions are important, numerical simultations of magnetic models like the 2D Ising model are also important and they are easily accessible by Monte Carlo methods.

For this problem, you need to do the following:

  1. Implement the Metropolis Algorithm for the 2D Ising model using the following system parameters: J=1 ,k=1, and B=0 (zero magnetic field). [see below for notes on hints.]
  2. Test your program with a relatively small lattice (5x5). You should calculate the average magnetization per site and the specific heat c of the system

    for temperatures from T=5 down to 0 with steps of 0.2. For good statistics, you should throw away the first 10000 iterations due to transient behavior and the averages should be taken over the next 450000 iterations. Compare them with the following graphs:
  3. For a bigger lattice (50x50), starting with a set of randomized spins, plot samples of the spins states of the system at time = 0, 1000, 3000, and 5000 units with temperature set at T=2.0. A time unit in a Metropolis simulation is typically measured in iterations per sites so that after 1 time unit (= N iterations), the whole lattice will on average be refreshed once. Describe the changes to the set of the initially randomized spins as time increases?
  4. Plot the instantaneous magnetization per site m vs. time (in time units per sites) up to t=10000 units. Again, use temperature T=2.0 here. The system should typically reach equilibrium (m will reach a plateau) sometime within this time range.
  5. Using the bigger lattice (50x50), recalculate and c as a function of temperature. You should wait for the system to come to equilibirum (~ 5000 time units) before your calculation of the system's statistics. For good statistical results, you should average your statistical quantities for at least another 5000 time units. Similar to the 5x5 case, you should observe a critical transition near T=2.3.
  6. This is an example of a critical phase transition. What happen to the magnetic spins before and after this transition? How should and c behave at Tc in the thermodynamic limit ()? Disscuss your results.

Hints:


Solution

My C implementation of this assignment is given here. Detailed notes about this program is given with the comments inline with the program.


The above panels are samples of the lattice at four different times when the system was equilibrated from T=infinty to T=2.0. The two different colors indicate the up and down states of the spins. At T=2.0, the system is below the critical temperature Tc and is in the ferromagnetic state so that as time increases, larger and larger clusters of aligned spins emerged from the random field. At the final frame, almost all spins are aligned in the same direction. However, due to finite thermal fluctuations, there remains a small percentage of spins which are not aligned with the population.

A quantative way to view this process in reaching equilibrium is to plot the magnetization per site as a function of time. This graph is plotted below:

For this particular run with T=2.0, we can see that the system starts with a set of randomized spins so that the averaged spin over all sites is nearly zero. It then slowly climbs toward its final equilibrium value near 1. For t>5000 (time units per site), the system is basically equilibrated and the value of m simply fluctuates around its mean value near 1. This is consistence with what we observed by plotting out the spin configurations as in our previous graph.


The above graph is a plot of the average magnetization per site and the specific heat of the system with the 50x50 lattice as we sweep the temperature. The theoretical critical transition is at Tc=2.3. One can see from this graph that the transition is much sharper than the one calculated for the much smaller lattice. In the infinite size lattice limit, both of these curves will be discontinuous at the transition point. While jump from an incoherence phase with =0 (all spin randomly aligned) to a coherence phase with all spin aligned, the specific heat diverges at Tc. Since the specific heat is a measure of the rate of change in the system's internal energy with respect to the temperature, the divergence of c indicates that the system at Tc has large fluctuations such that a small change in temperature induces a large change in the system's spin configurations. Large fluctuations are hallmarks of thermal systems including magnets, fluids, superconductors, etc. when they are near their critical transitions.