The 2D Ising model is the canonical lattice model of ferromagnetism: a square grid of spins, each ±1, interacting only with their four nearest neighbours. It is the textbook example of a phase transition and one of the very few interacting models solved exactly (Onsager, 1944), giving the critical temperature Tc = 2J / (kB ln(1+√2)) ≈ 2.269 J/kB.
Each Metropolis step picks a random spin, computes ΔE from its four neighbours and the field h, and flips it if ΔE ≤ 0, or with probability exp(−ΔE/T) otherwise. Many such attempts per frame drive the lattice toward thermal equilibrium at the chosen temperature.
Below Tc the spins spontaneously align into large pink/blue domains — a ferromagnet. Above Tc thermal noise wins and the lattice looks like static — a paramagnet.