Simulation of the 2D Ising model
One of the most interesting phenomena in nature is ferromagnetism. A FM material exhibits a non-zero spontaneous magnetization in the absence of an applied magnetic field. This occurs below a well-defined critical temperature known as the Curie temperature. For the magnetization vanishes. Hence separates two phases, a disordered one for , and a ferromagnetic one for .
Although the Ising model is too simple, it already contains much of the physics of the FM phase transition. In order to explore the properties of this model, we need to calculate some physical quantities of interest, including the mean energy , the mean magnetization , the heat capacity , and the magnetic susceptibility .
The Ising model
Consider a lattice with sites, where each site can assume two possible states , or spin “up” and spin “down”. A particular configuration or microstate of the lattice is specified by the set of variables for all lattice sites.
Now we need to know the dependence of the energy of a given microstate, according to the configuration of spins. The total energy in the presence of a uniform magnetic field is given by the “Ising model”: where the first summation is over all nearest neighbor pairs and the second summation is over all the spins of the lattice. The “exchange constant” is a measure of the strength of the interaction between nearest neighbor spins. If , the states with the spins aligned and are energetically favored, while for the configurations with the spins antiparallel and are the ones that are preferred. In the first case, we expect that the state with lower energy is “ferromagnetic”, while in the second case, we expect it to be “antiferromagnetic”. If we subject the system to a uniform magnetic field directed upward, the spins and possess and additional energy and respectively. Note that we chose the units of such that the magnetic moment per spin is unity.
Instead of obeying Newton’s laws, the dynamics of the Ising model corresponds to “spin flip” processes: a spin is chosen randomly, and the trial change corresponds to a flip of the spin or .
Physical quantities
The net magnetic moment or "magnetization" is given by Usually we are interested in the average and the fluctuations as a function of the temperature of the system and the applied magnetic field. Notice that in the absence of a magnetic field, the value of should average zero. This is because the system is as likely to be found with all the spins pointing up or down. Therefore, one typically measures or , which is always a positive quantity.
The heat capacity
One way to measure the heat capacity at constant external field id from the definition: Another way is to use the statistical fluctuations for the total energy in the canonical ensemble:
The magnetic susceptibility
The magnetic susceptibility is an example of a “response function ”, since it measures the ability of a spin to “respond” or flip with a change in the external magnetic field. The zero isothermal magnetic susceptibility is defined by the thermodynamic derivative The zero field susceptibility can be related to the magnetization fluctuations in the system: where and are zero field values.
Metropolis algorithm
Moves
One typically picks a random spin and it is flipped or not by calculating the energy difference between the considered spin and its 4 nearest neighbors using the formula:
The energy change is . The spin then directly flips if . Otherwise, it only flips if a randomly chosen number between 0 or 1 is smaller than the Boltzmann factor .
Notice that the sum in brackets can run from -4 to +4, so we can easily store the values for all the possible configurations in lookup tables.
Boundary conditions
Since we are interested in the properties of an infinite system, we have to consider the boundary conditions. The simplest case corresponds to “free boundary condition”. In a 1D chain, the spins at sites and are open ends and have one interaction each. In general a better choice is periodic boundary conditions, where sites 1 and interact with each other closing a loop. In this situation, the chain has the topology of a ring, and all the spins have the same number of interactions. We also say that there is translational invariance, since the origin can be picked arbitrarily.
As discussed earlier, the use of PBC minimizes the finite size effects. However, a disadvantage is that they reduce the minimum separation between two spins to half the length of the system. In a 2D system we need to account for the periodicity on both the and directions, and our system will have the topology of a torus.
Initial conditions and equilibration
We can pick a random initial configuration. However, as we shall see, in some simulations the equilibration process can account for a substantial fraction of the total computer time. The most practical choice of an initial condition is an “equilibrium” configuration of a previous run which is at a temperature close to the desired temperature.
Tricks
It is convenient that we store all the transition probabilities in lookup tables, so we do not have to calculate them at each step. Another trick consists of storing all the positions of the spins and their neighbors to avoid calculating many random numbers. If you need to perform several runs for different values of the temperature , you can do it at the same time using the same random numbers.
Exercise 11.2: Equilibration of the 2D Ising model
Run your simulation with and and choose the initial spins to be all up. Plot the variation of the energy and the magnetization with time. How much time is necessary for the system to reach equilibrium?
Visually inspect several “equilibrium” configurations. Is the system ordered or disordered?
Run the program with and chose the same initial configuration with all the spins up. How long does it take for the system to reach equilibrium?
Visually inspect several equilibrium configurations with . Are they more or less ordered than those in part 2?
Is the acceptance ratio and increasing or decreasing function of ? Does the Metropolis algorithm become more or less efficient at low temperatures?
Challenge 11.2
Modify the code to calculate the correlation function
Plot the correlations along the direction across the phase transition and describe its behavior.