Loading the engineShared by all simulations, so the next one opens instantly.
The physics

Wilhelm Lenz proposed the model in 1920 and his student Ernst Ising solved it in one dimension in 1925: a row of magnetic moments, each pointing up or down and preferring to point like its neighbors. In one dimension it never orders. Lars Onsager’s exact solution of the two-dimensional model in 1944 showed that it does, below a sharp critical temperature, and gave the first proof that a phase transition can come out of nothing but statistical mechanics. Near that temperature the model behaves like a real magnet near its Curie point, a liquid near its critical point, and every other system in its universality class.

What you see

A 200 by 200 grid of spins with wrapping edges: white cells point up (s=+1), black cells point down (s=−1). The panel shows the magnetization |m|, the mean spin. For the antiferromagnet it shows the staggered magnetization instead, with the sign of every other spin flipped, which is the order parameter of a checkerboard.

Each frame runs two Metropolis sweeps, so a spin gets on average two chances per frame to flip.

Model

The energy of a configuration is

H=−J∑⟨i,j⟩sisj−h∑isi,

summed over nearest-neighbor pairs, with coupling J and external field h. A Metropolis step picks a random spin, computes the energy change ΔH of flipping it, and flips it with probability min⁡(1,e−ΔH/kBT). Repeated, this samples configurations with Boltzmann weight e−H/kBT. Onsager’s critical temperature is

Tc=2JkBln⁡(1+2)≈2.269J/kB,

and below it, without a field, the spontaneous magnetization is m=[1−sinh−4⁡(2J/kBT)]1/8.

Presets

Critical: T=Tc from random spins, also the default. Domains grow without limit, but ever more slowly: after 30 seconds the clusters are still coarsening, with blobs of every size inside blobs and fractal borders. On a finite grid the magnetization at Tc settles near 0.5 and keeps fluctuating; on an infinite one it would vanish.

Cold ferromagnet: T=Tc/2 from random spins. In equilibrium the magnetization would be 0.998, but a sudden quench does not get there: domains of both signs grow and straighten, and the grid often ends up in two bands that wrap around the torus and never merge. In two minutes the magnetization stayed near 0.23.

Antiferromagnet: J<0 at Tc, from random spins. Neighbors prefer to point opposite ways, so the ordered state is a checkerboard, which looks gray. On the square lattice flipping every other spin turns it into the ferromagnet, so it has the same critical temperature, and its staggered magnetization behaves exactly like the critical ferromagnet’s magnetization.

Field, below critical: T=0.95Tc, h=0.1J, from all spins down. The field favors up spins: islands of white nucleate, grow and take over, and within 10 seconds the magnetization reaches +0.9, against 0.83 without the field.

Parameters

Temperature: 0.1 to 5 in units of J/kB; the default is Tc.

Field h: −2 to 2 in units of J. Positive values favor up spins.

Ferromagnet: switches the coupling between J=+1 and the antiferromagnet’s J=−1.

Initial spins: random, or all down; applies on Reset.

Temperature, field and coupling apply immediately.