Watch the 2D Ising model undergo a second-order phase transition at the critical temperature Tc ≈ 2.269 J/kB (Onsager, 1944). Below Tc the lattice spontaneously magnetises into large aligned domains; above it spins are thermally scrambled into a paramagnet. Right at Tc fluctuations span all scales — a spectacular fractal pattern called critical opalescence.
E = −J Σ_(⟨i,j⟩) sᵢ sⱼ − H Σᵢ sᵢ
P(flip) = min(1, exp(−ΔE / kT))
m = |Σ sᵢ| / N²
χ = N² · (⟨m²⟩ − ⟨m⟩²) / kT
Tc = 2J / (kB · ln(1+√2)) ≈ 2.2692 J/kB
Lars Onsager's 1944 exact solution of the 2D Ising model is considered one of the greatest achievements of theoretical physics. The critical exponents he derived — β = 1/8, γ = 7/4 — reveal a universality shared by real phase transitions in fluids, liquid crystals, and even certain cosmological models. At exactly Tc, the correlation length diverges to infinity; that's why the domain pattern looks statistically identical at every zoom level.
A phase transition is an abrupt change in the macroscopic state of a system — such as solid to liquid, or ferromagnet to paramagnet — driven by a control parameter like temperature. In the 2D Ising model the transition separates the ordered ferromagnetic phase (T < Tc) from the disordered paramagnetic phase (T > Tc).
The order parameter is the spontaneous magnetisation per spin, m = (1/N²)|Σ sᵢ|. It equals 1 in a perfectly aligned ground state and drops to 0 above the critical temperature Tc, serving as a quantitative measure of the degree of order in the system.
Lars Onsager solved the 2D square-lattice Ising model exactly in 1944, obtaining Tc = 2J / (kB ln(1 + √2)) ≈ 2.2692 J/kB. This is the only exact critical temperature known for any non-trivial interacting statistical-mechanics model in two dimensions.
In each Monte Carlo step a spin is chosen at random. The energy change ΔE = 2J sᵢ Σⱼ sⱼ is computed. If ΔE ≤ 0 the flip is accepted unconditionally. Otherwise it is accepted with probability exp(−ΔE / kBT), which satisfies detailed balance and ensures convergence to the Boltzmann distribution.
Susceptibility χ = N(⟨m²⟩ − ⟨|m|⟩²) / kBT measures how strongly the magnetisation responds to a small applied field. At the critical point fluctuations span all length scales, so χ diverges as |T − Tc|^(−γ) with γ = 7/4 in two dimensions. This divergence is the hallmark of a second-order phase transition.
The correlation length ξ characterises the typical size of spin clusters that fluctuate together. Away from Tc it is finite; at Tc it diverges as ξ ~ |T − Tc|^(−ν) with ν = 1 for the 2D Ising model. This divergence produces scale-free domain patterns visible in the simulation.
Critical exponents describe how thermodynamic quantities diverge or vanish as the critical point is approached. For the 2D Ising model: β = 1/8 (magnetisation), γ = 7/4 (susceptibility), ν = 1 (correlation length), α = 0 (logarithmic heat-capacity divergence). These exponents are universal — shared by all systems in the same universality class.
Universality is the remarkable fact that systems with very different microscopic constituents share identical critical exponents if they have the same spatial dimension and symmetry of their order parameter. For example, the liquid–gas critical point and the uniaxial magnet both belong to the 3D Ising universality class.
Periodic boundary conditions connect left to right and top to bottom, placing the lattice on a torus. This eliminates surface effects that suppress ordering and shift the apparent Tc, letting a modest grid approximate an infinite system far more faithfully than open boundaries.
An external field H breaks the up–down symmetry. For H ≠ 0 there is no sharp phase transition — magnetisation changes smoothly with temperature. A true second-order transition exists only along the H = 0 axis below Tc, terminating at the critical point (Tc, H = 0).