HomeArticlesStatistical Mechanics

The Classical Heisenberg Model: Spins, Temperature and Magnetic Order

Three-component unit vectors on a lattice, nudged by Metropolis Monte Carlo, spontaneously align into magnetic domains as the system cools.

mysimulator teamUpdated June 2026≈ 8 min read▶ Open the simulation

A spin as an arrow, not a bit

The Ising model, the workhorse of statistical mechanics, gives every lattice site a spin that can only point up or down — a single bit. The classical Heisenberg model relaxes that restriction: each site carries a continuous three-dimensional unit vector, free to point anywhere on a sphere. That extra freedom makes it a much closer classical stand-in for a real quantum magnetic moment, at the cost of a far larger configuration space to sample.

The exchange energy

Neighbouring spins interact through an exchange coupling J that rewards alignment. The total energy sums a dot product over every pair of nearest neighbours on the lattice:

H = -J · Σ<i,j> (S_i · S_j)

  J > 0  →  ferromagnetic  (aligned neighbours lower the energy)
  J < 0  →  antiferromagnetic  (anti-aligned neighbours lower the energy)

Because S_i · S_j depends on the angle between two unit vectors rather than just their sign, the energy landscape is smooth and continuous, unlike Ising's discrete four-way sum. Any small rotation of a spin changes the energy a little; there is no minimum step.

Metropolis Monte Carlo

Nobody solves this system analytically for a large lattice, so it is sampled: pick a random site, propose a new random orientation for its spin, compute the resulting energy change ΔE, and accept the move outright if ΔE ≤ 0. If the move would raise the energy, accept it anyway with probability exp(-ΔE / k_B T) — otherwise reject it and keep the old orientation. Repeated over millions of attempted moves, this Metropolis rule provably samples configurations according to the correct thermal (Boltzmann) distribution at temperature T.

Order from noise: domains and the ordering temperature

Start the lattice fully random and run it hot: neighbouring spins point every which way, and the average magnetisation of the whole lattice hovers near zero — a disordered, paramagnetic state. Lower the temperature and the exchange coupling starts to win against thermal noise: patches of neighbouring spins begin pointing the same general direction, and those patches — magnetic domains — grow and coarsen as T keeps falling, exactly what the live simulation renders as regions of matching colour.

live demo · a spin lattice ordering into domains as it cools● LIVE

Why this differs from the Ising model

Ising's spins have a discrete two-state (Z2) symmetry, and the 2D Ising model famously has an exact solution (Onsager, 1944) with a genuine phase transition at a finite critical temperature. The Heisenberg model's spins instead have continuous rotational (O(3)) symmetry, and the Mermin-Wagner theorem forbids that continuous symmetry from spontaneously breaking into true long-range order in one or two dimensions at any nonzero temperature, in the idealised infinite-lattice limit. Real simulated lattices are finite, though, so they still visibly develop short-range correlated domains that grow as temperature drops — a strong finite-size echo of ordering even where strict long-range order is mathematically forbidden.

Frequently asked questions

What's the difference between the Ising and Heisenberg models?

The Ising model restricts each spin to two discrete states, up or down. The Heisenberg model gives each spin a continuous 3D unit vector that can point anywhere on a sphere. That continuous rotational symmetry makes the Heisenberg model a closer classical analogue of real quantum spins, but it also changes which phase transitions are allowed compared to Ising's simpler discrete symmetry.

Why does the Metropolis algorithm sometimes accept an energy-increasing move?

Always rejecting uphill moves would make the simulation a pure energy-minimiser, not a sampler of the thermal (Boltzmann) distribution at temperature T. Accepting energy-increasing moves with probability exp(-ΔE/kT) lets the system escape local energy traps and correctly reproduces thermal fluctuations — including the disordered, high-entropy configurations that dominate above the ordering temperature.

Does a 2D Heisenberg lattice really have a phase transition?

In the strict infinite-lattice limit, the Mermin-Wagner theorem forbids true long-range magnetic order for a continuous-symmetry model like Heisenberg in one or two dimensions at any nonzero temperature. Finite simulated lattices are not infinite, though, so they still show visible short-range order and slowly growing correlated domains as temperature drops — which is what the live demo displays.

Try it live

Everything above runs in your browser — open Heisenberg Spin Model and change the parameters while it is running. Nothing is installed, nothing is uploaded, the whole model lives in one tab.

▶ Open Heisenberg Spin Model simulation

What did you find?

Add reproduction steps (optional)