Ising Model in Two Dimensions
Setup
The Ising model is a simple model of magnetic materials describing interacting spins on a square lattice. Each lattice site \(i\) contains a spin \(\sigma_i = \pm 1\) that can point up (■) or down (□). Neighbouring spins interact with a ferromagnetic coupling \(J\), favouring alignment of spins and a magnetic field \(h\). The energy of a configuration is $$ E = -J \sum_{\langle ij \rangle} \sigma_i \sigma_j - h\sum_i \sigma_i $$ where the sum runs over nearest-neighbor pairs. At zero field and temperature \(T\) in the canonical ensemble the model exhibits a continuous phase transition at $$ T_c = 2J/\log(1+\sqrt{2}) \approx 2.269J $$ At low temperatures, spins align to minimize energy, producing an ordered ferromagnetic phase. At high temperatures, fluctuations dominate and the system becomes disordered.
Method
The simulation uses Monte Carlo with Metropolis-Hastings updates to sample states following Boltzmann statistics. A checkerboard decomposition allows parallel updates. For each spin the energy change \(\Delta E\) is computed, and the flip is accepted with probability \(\min(1, e^{-\Delta E/k_B T})\). One sweep consists of \(N\) attempted spin flips, where \(N\) is the total number of spins. The simulation tracks magnetization \(M = \sum_i \sigma_i\), energy \(E\), and heat capacity \(C = dE/dT\) (averaged over the last few hundred sweeps) showing a comparison to Onsager's exact solution at \(h=0\) and interpolated results at \(h \neq 0\).
← Back