QiLing Tools

🧊Ising Model Simulator - 2D Phase Transition, Onsager Solution, Wolff Cluster

Run the Ising model live on a periodic square lattice from 32×32 up to 256×256 and watch the spins: random noise at high temperature, fractal-looking clusters near the critical point and large domains below it. The tool measures energy, magnetisation, specific heat, susceptibility and the Binder cumulant, and compares them with Onsager's exact solution. It also scans temperature, traces hysteresis loops in a field, shows domain coarsening after a quench and supports antiferromagnetic coupling.

Free · No sign-up · Runs in your browserLast updated:

Loading tool...

How to use Ising Model Simulator

  1. 1Pick the lattice size, the algorithm (Metropolis or Wolff) and ferro- or antiferromagnetic coupling, then press Run
  2. 2Drag the temperature slider or press T = T_c and watch the domains and the running averages
  3. 3On the Temperature scan tab set a range and sweeps per point to plot ⟨|m|⟩, C, χ and e against T with the exact curves
  4. 4Use the Hysteresis tab to sweep the field h at low T and read the coercive field and remanence, or quench and watch domains coarsen as ℓ ∝ t^{1/2}

FAQ

Why is the critical temperature 2.269?
For the 2D square-lattice Ising model with nearest-neighbour coupling, Onsager solved the free energy exactly in 1944. The transition satisfies sinh(2J/k_BT_c) = 1, so k_BT_c/J = 2/ln(1+√2) ≈ 2.269. Above it thermal fluctuations win and the spontaneous magnetisation is zero; below it m = (1 − sinh⁻⁴(2J/k_BT))^{1/8}. The exponent β = 1/8, far from the mean-field value 1/2, is what made the 2D Ising model famous.
What is the difference between Metropolis and Wolff?
Metropolis tries to flip one spin at a time and accepts with min(1, e^{−ΔE/T}). It mimics real local dynamics, which is why the quench and coarsening demo uses it. Near T_c, though, clusters become huge and the correlation time grows like L^{2.17} (critical slowing down). Wolff grows a cluster of aligned neighbours, adding each with probability p = 1 − e^{−2J/T}, and flips it as a whole. That almost removes critical slowing down, so temperature scans get much smaller error bars for the same number of sweeps, but its 'time' is not physical dynamics.
Why is the simulated magnetisation non-zero above T_c, and the specific heat peak lower than exact?
Finite-size effects. The exact solution is for an infinite lattice. On an L×L lattice the correlation length near T_c is cut off by the system size, so ⟨|m|⟩ stays around 1/√N even at high T, and the divergences in C and χ are rounded into finite peaks that sit slightly above T_c. Larger lattices and longer runs approach the exact curves; the crossing point of the Binder cumulant U₄ for different L gives an accurate estimate of T_c.
How are the specific heat and susceptibility computed?
From fluctuations: C = N(⟨e²⟩ − ⟨e⟩²)/T² and χ = N(⟨m²⟩ − ⟨|m|⟩²)/T, where e and m are energy and magnetisation per spin and the brackets are running averages over many sweeps. Changing T, h or J clears the averages, and the first 20 sweeps after a change are discarded to let the system equilibrate.
What do the antiferromagnet and field options show?
With J < 0 neighbours prefer to point opposite ways and the ground state is a checkerboard. In zero field this maps exactly onto the ferromagnet by flipping every other site, so the order parameter becomes the staggered magnetisation m_s, which follows the same Onsager curve; the staggered colouring option makes antiferromagnetic domains visible. A field h breaks the up/down symmetry: sweeping h below T_c traces a hysteresis loop, which gets wider at lower temperatures and faster sweeps, a direct view of metastability and nucleation.

Features

  • Switch between Metropolis single-spin flips and Wolff cluster moves, with the last cluster highlighted
  • Live e, |m|, C, χ and Binder U₄ next to Onsager's exact m(T), u(T) and C(T)
  • Automatic temperature scans with equilibration, marking T_c ≈ 2.269
  • Hysteresis loops in an external field, quench coarsening with a log–log slope fit, and slow annealing
  • Antiferromagnet J < 0 with staggered magnetisation and staggered colouring
  • Paint spins directly on the lattice to set up your own initial state