Spins on a grid
The Ising model, proposed by Wilhelm Lenz in 1920 and solved in one dimension by his student Ernst Ising in 1925, places a discrete variable — a spin, s = +1 or −1 — on every site of a lattice. Each spin only interacts with its immediate neighbours, and the total energy of a configuration is:
E = -J * sum_over_neighbour_pairs(s_i * s_j) - B * sum_over_all_sites(s_i) J > 0 → neighbours prefer to align (ferromagnetic) J < 0 → neighbours prefer to anti-align (antiferromagnetic) B → external magnetic field, biases spins toward +1 or -1
That is the entire model: no quantum mechanics, no continuous fields, just discrete spins and their nearest neighbours. What makes it remarkable is that this extremely stripped-down rule set is enough to reproduce a real, sharp phase transition.
The Metropolis algorithm
Exactly enumerating every spin configuration is impossible for any realistic lattice size — a 20x20 grid alone has 2^400 configurations. Instead, the model is sampled with the Metropolis-Hastings algorithm (1953): repeatedly propose flipping one randomly chosen spin, compute the resulting energy change ΔE, and accept or reject the flip probabilistically.
pick a random site i
dE = energy_change_if_we_flip(i) // only depends on i's 4 neighbours
if dE <= 0:
flip(i) // always accept a move that lowers energy
else:
accept with probability exp(-dE / (k_B * T)) // sometimes accept a rise
repeat millions of times → the lattice settles into the Boltzmann
distribution at temperature T
This one-spin-at-a-time rule is essential: it satisfies detailed balance, the mathematical condition that guarantees the simulation converges to the correct thermal equilibrium distribution rather than some other, unphysical steady state. Flipping many spins from the same snapshot at once would break that guarantee.
The critical temperature and spontaneous magnetisation
At high temperature, thermal noise dominates: spins flip randomly regardless of their neighbours, and the net magnetisation averages to zero. At low temperature, the coupling J dominates: neighbouring spins align into large aligned domains, and the lattice develops a nonzero spontaneous magnetisation even with no external field. Lars Onsager solved the 2D square-lattice Ising model exactly in 1944 and found a sharp transition at a precise critical temperature, k_B T_c / J = 2 / ln(1 + √2) ≈ 2.269. Right at T_c the correlation length between spins diverges — a patch of aligned spins can span the entire lattice — which is the hallmark of a genuine continuous (second-order) phase transition.
Why physicists still care about this toy model
The Ising model's real value is not describing real magnets precisely — it is being one of the very few interacting statistical models solvable exactly, which makes it the benchmark against which every approximation method (mean-field theory, renormalization group, Monte Carlo techniques themselves) is validated. Its universality class — the specific way physical quantities scale near the critical point — turns out to describe an enormous range of unrelated physical systems near their own critical points, from binary fluid mixtures separating into two phases to some models of neural activity, because near a continuous phase transition the microscopic details of a system stop mattering and only its dimensionality and symmetry determine the critical behaviour.
Frequently asked questions
What does the Ising model actually represent physically?
A simplified model of a ferromagnet: each lattice site is an atomic spin that points either up or down, and neighbouring spins prefer to align. It captures the essential physics of how microscopic magnetic interactions produce macroscopic magnetism, without needing the full quantum mechanics of real electron spins.
Why is the 2D Ising model special?
Lars Onsager solved it exactly in 1944, making it one of the only nontrivial interacting statistical models with a known analytical solution, including the exact critical temperature. The 1D Ising chain has no phase transition at all, while the 3D model has never been solved exactly, so the 2D case sits at a mathematically special sweet spot.
Why does the simulation flip spins one at a time instead of all at once?
The Metropolis algorithm needs detailed balance to sample the correct equilibrium (Boltzmann) distribution, and updating spins one at a time using the current configuration guarantees this. Flipping many spins simultaneously from the same snapshot breaks the acceptance-probability math and no longer samples the physically correct distribution.
Try it live
Everything above runs in your browser — open Ising Model and change the parameters while it is running. Nothing is installed, nothing is uploaded, the whole model lives in one tab.
▶ Open Ising Model simulation