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
<p>The <b>Ising model</b> is the canonical lattice model of magnetism. Each site carries a spin <code>s = +1</code> (up) or <code>s = -1</code> (down). The energy is <code>E = -J Σ<ij> s_i s_j - H Σ s_i</code>, summed over nearest-neighbour pairs, and the lattice is evolved with the <b>Metropolis Monte Carlo</b> algorithm.</p><p><b>Lattices</b>: 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.</p><p><b>Controls</b></p><ul><li><b>T</b> — temperature (units of J/k_B). At <b>T = 0</b> the dynamics only lower the energy; raising T adds thermal flips.</li><li><b>J</b> — coupling. <code>J > 0</code> is ferromagnetic (neighbours align); <code>J < 0</code> is antiferromagnetic (neighbours anti-align, checkerboard order).</li><li><b>H</b> — external field biasing spins up (H>0) or down (H<0).</li><li><b>Speed</b> — Monte-Carlo sweeps per animation frame (one sweep = N flip attempts).</li><li><b>Reset</b> — re-randomise the lattice (hot start).</li><li><b>Presets</b> set T, J and H for interesting regimes.</li></ul><p><b>Metropolis rule</b>: flip a random spin with probability <code>min(1, e^(-ΔE/T))</code>. <b>Phase transition</b>: for H = 0 the spins spontaneously order below a critical temperature (square lattice <code>Tc ≈ 2.269</code>); near Tc you see domains on all scales, and the magnetization |M| jumps from 0 to ~1 as you cool through it.</p><p><b>Readouts</b>: magnetization per spin |M|, energy per spin, sweep count and acceptance ratio. <b>3D controls</b>: drag to rotate, Ctrl+wheel to zoom, right-drag to pan; only up-spins are drawn so domain shapes are visible. <b>Limitations</b>: single-spin Metropolis dynamics show critical slowing-down near Tc; this is an educational simulation, not a high-precision estimator of critical exponents.</p>