Ising Model (2D & 3D)

Metropolis Monte Carlo of the Ising model on square, triangular, cubic and BCC lattices; watch domains and the phase transition, in 2D and interactive 3D.

About this tool

The Ising model is the canonical lattice model of magnetism. Each site carries a spin s = +1 (up) or s = -1 (down). The energy is E = -J Σ<ij> s_i s_j - H Σ s_i, summed over nearest-neighbour pairs, and the lattice is evolved with the Metropolis Monte Carlo algorithm.

Lattices: square (2D, 4 neighbours), triangular (2D, 6), simple cubic (3D, 6) and the body-centred / truncated-octahedron lattice (3D, 14). 2D lattices draw on a flat grid; 3D lattices render the up-spins as a rotatable instanced mesh.

Controls

  • T — temperature (units of J/k_B). At T = 0 the dynamics only lower the energy; raising T adds thermal flips.
  • J — coupling. J > 0 is ferromagnetic (neighbours align); J < 0 is antiferromagnetic (neighbours anti-align, checkerboard order).
  • H — external field biasing spins up (H>0) or down (H<0).
  • Speed — Monte-Carlo sweeps per animation frame (one sweep = N flip attempts).
  • Reset — re-randomise the lattice (hot start).
  • Presets set T, J and H for interesting regimes.

Metropolis rule: flip a random spin with probability min(1, e^(-ΔE/T)). Phase transition: for H = 0 the spins spontaneously order below a critical temperature (square lattice Tc ≈ 2.269); near Tc you see domains on all scales, and the magnetization |M| jumps from 0 to ~1 as you cool through it.

Readouts: magnetization per spin |M|, energy per spin, sweep count and acceptance ratio. 3D controls: drag to rotate, Ctrl+wheel to zoom, right-drag to pan; only up-spins are drawn so domain shapes are visible. Limitations: single-spin Metropolis dynamics show critical slowing-down near Tc; this is an educational simulation, not a high-precision estimator of critical exponents.