# Monte Carlo simulation of the Ising model: Metropolis, Swendsen-Wang, and Wolff algorithms

### Ising model on a square lattice

We plot the local magnetization (up or down) as a color block in the square lattice. Here, the system size is $$L=96$$. We update the spin configuration with one click for 100 MCS in the case of Metropolis or Swendsen-Wang algorithm and 100 steps in the case of Wolff algorithm. The vertical position of the clicked pointer controls the value of parameter $$z (\equiv \exp(2J/T) - 1)$$. The horizontal position also selects the Monte Carlo algorithm. The left, center, and right cases are Metropolis, Swendsen-Wang, and Wolff algorithms, respectively.

When environment, such as temperature, changes, the system which consists of many interacting elements may shift to the state where the law of a micro level is broken.

For example, if a hot metal is cooled, the magnetization will appear spontaneously. Then, the local magnetization of each atom points to the specific direction. Since the small magnetization of each atom does not necessary like a specific direction with the law of a micro level, the spontaneous magnetization is a specific character for many atoms which interact each other.

In the Ising model, each atom is in a lattice site and the magnetization takes only two opposite states like north or south. And each atom only interacts with the nearest neighbor sites so that the direction of their magnetizations become equal when the temperature falls. However, the direction of either is not necessarily preferred.

Although it is in fact a simple model, the phenomenon that the whole atoms take a same direction occurs at a certain temperature. This corresponds to the appearance of the spontaneous magnetization. Thus, the Ising model is very well researched as a fundamental model in such the phenomenon.

In the present demonstration, we can see the state of the Ising model on the two-dimensional square lattice at a temperature $$T$$. At low temperature ($$z \ge \sqrt{2}$$), the big island appears rapidly. It corresponds to the spontaneous magnetization.

In this Markov Chain Monte Carlo (MCMC) simulation, we can change algorithms (Metropolis, Swendsen-Wang, and Wolff ) which generates the states. Especially Swendsen-Wang or Wolff algorithm can sample various states at a small step. These algorithms are often used in the recent MCMC simulations of Ising model.