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).
This simulation runs a live 2D Ising model on an N×N lattice of ±1 spins, updated with the Metropolis Monte Carlo algorithm: a random spin's energy change ΔE = 2Jsi(Σⱼsⱼ + H) is computed, and the flip is accepted unconditionally if ΔE ≤ 0 or with probability exp(−ΔE/kBT) otherwise. Below the Onsager critical temperature Tc ≈ 2.269 J/kB the lattice spontaneously magnetises into large aligned domains; above it, thermal noise scrambles the spins into a disordered paramagnet. Live statistics track the magnetisation order parameter and the susceptibility, which diverges as the system approaches Tc.
A colour-coded spin lattice (blue = +1, orange = −1) evolving under Metropolis dynamics, alongside a live magnetisation-vs-temperature curve. Near Tc the domain pattern shows scale-free clusters at every zoom level — critical opalescence — because the correlation length diverges exactly at the transition.
Drag the Temperature slider slowly across Tc ≈ 2.269 to watch order collapse into disorder. Adjust Lattice size N for sharper transitions on bigger grids, Sweeps/frame to equilibrate faster, and External field H to break the up-down symmetry (which destroys the sharp transition). Use the Random/Align buttons or the Cold/Tc/Hot presets to jump straight to a given state, and Space or P to pause.
Lars Onsager's 1944 exact solution of the 2D Ising model — giving Tc = 2J/(kB·ln(1+√2)) ≈ 2.2692 J/kB — is considered one of the greatest achievements of theoretical physics, and remains the only exactly-solved non-trivial interacting model of its kind in two dimensions.
The order parameter is the spontaneous magnetisation per spin, m = (1/N²)|Σsᵢ|. It equals 1 in a perfectly aligned ground state at low temperature and drops toward 0 above the critical temperature Tc, giving a direct quantitative measure of how ordered the spin lattice is at any moment.
A spin is chosen at random and its energy change if flipped, ΔE = 2Jsi(Σⱼsⱼ + H), is computed from its four neighbours. If ΔE ≤ 0 the flip is accepted unconditionally because it lowers the system's energy; otherwise it is accepted with probability exp(−ΔE/kBT). This rule satisfies detailed balance and guarantees the lattice converges to the correct Boltzmann distribution at temperature T.
Susceptibility χ = N²(⟨m²⟩ − ⟨m⟩²)/kBT measures how strongly magnetisation fluctuates in response to a small field. Near Tc, spin correlations extend over the entire system, so fluctuations grow without bound and χ diverges as |T − Tc|^(−γ) with γ = 7/4 in two dimensions — the defining signature of a second-order (continuous) phase transition.
Critical exponents describe how quantities like magnetisation, susceptibility and correlation length diverge or vanish as temperature approaches Tc: β = 1/8 for magnetisation, γ = 7/4 for susceptibility, ν = 1 for correlation length in the 2D Ising model. Remarkably, systems with completely different microscopic physics — magnets, binary fluid mixtures, even certain cosmological models — share identical exponents whenever they have the same dimensionality and order-parameter symmetry, a phenomenon called universality.
A nonzero external field H breaks the up-down symmetry between the two magnetised states, so magnetisation then varies smoothly with temperature instead of jumping sharply at Tc. A true second-order phase transition exists only exactly at H = 0, terminating at the critical point (Tc, H = 0); for any H ≠ 0 there is no genuine discontinuity, only a crossover.