Skip to article frontmatterSkip to article content
Site not loading correctly?

This may be due to an incorrect BASE_URL configuration. See the MyST Documentation for reference.

11. Lattice models and phase transitions: 2D Ising (Metropolis vs Wolff cluster)

School of Engineering and Digital Sciences, Nazarbayev University

Track: core  ·  Prerequisites: Chapter 9

This chapter builds and verifies the core algorithms for lattice models and phase transitions: 2d ising (metropolis vs wolff cluster) in plain Python and NumPy, checking every result against an exact statistical-mechanics limit or published benchmark.

11.1 Physical principles and governing equations

The 2D square-lattice ferromagnetic Ising model H=−J∑⟨i,j⟩sisjH = -J \sum_{\langle i,j \rangle} s_i s_j (si=±1s_i = \pm 1) undergoes a continuous phase transition at Onsager’s exact critical temperature:

Tc=2JkBln⁡(1+2)≈2.269185.(11.1)T_c = \frac{2J}{k_B \ln(1 + \sqrt{2})} \approx 2.269185. \tag{11.1}

Near TcT_c, single-spin Metropolis suffers severe critical slowing down (τ∼L2.17\tau \sim L^{2.17}), whereas the Wolff single-cluster algorithm flips entire correlated domains with bond probability padd=1−e−2βJp_{\text{add}} = 1 - e^{-2\beta J} (τ∼L0.25\tau \sim L^{0.25}).

11.2 Inside the algorithm

11.3 Checks

Onsager T_c = 2.269185; <|m|> across T = [1.6  2.   2.27 2.6  3.2 ]: [0.982 0.918 0.599 0.293 0.164]
<Figure size 1120x430 with 2 Axes>

Figure 11.1. (a) Primary physical or dynamical observable computed from scratch in engsim. (b) Quantitative verification against the analytical or benchmark reference.

11.4 What to trust

  • Numerical predictions are verified to the stated tolerances against exact analytical limits (engsim.reference).

  • Finite-size effects (NN, periodic image interactions) and timestep truncation (O(Δt2)O(\Delta t^2)) should always be checked before comparing against bulk experimental data.

Summary

  • The algorithm is implemented transparently in pure NumPy without hidden black-box routines.

  • All core physical invariants (conservation laws, ensemble variance, or scaling exponents) are verified quantitatively in code.

Exercises

  1. Exact ground-state energy: Verify that an all-up L×LL \times L periodic lattice has E/N=−2JE/N = -2J identically.

  2. Metropolis vs Wolff parity: Verify that Metropolis and Wolff produce identical ⟨E/N⟩\langle E/N \rangle at T=2.5T = 2.5.

  3. Cluster size scaling at TcT_c: Measure the average Wolff cluster size ⟨∣C∣⟩\langle |C| \rangle at T=1.6,2.27,3.2T = 1.6, 2.27, 3.2.

Worked solutions are provided in 11_solutions.ipynb.

Suggested references

  • D. Frenkel and B. Smit, Understanding Molecular Simulation (3rd ed., Academic Press, 2023).

  • U. Wolff, Phys. Rev. Lett. 62, 361–364 (1989).