Classical 2D Ising Model on the Square Lattice
Overview
The two-dimensional Ising model on the square lattice is arguably the most studied model in statistical physics. It was the first model to exhibit a rigorous second-order phase transition (Onsager, 1944) and remains the benchmark for critical phenomena.
\[H = -J \sum_{\langle i,j \rangle} \sigma_i \sigma_j, \qquad \sigma_i \in \{-1, +1\}\]
Parameters: Ising coupling $J > 0$ (ferromagnetic).
Universality: The critical point belongs to the 2D Ising universality class with central charge $c = 1/2$.
Partition Function (Transfer Matrix)
Statement
For an $L_x \times L_y$ square lattice with periodic boundary conditions in both directions:
\[Z(L_x, L_y, \beta, J) = \mathrm{Tr}(T^{L_x})\]
where $T$ is the $2^{L_y} \times 2^{L_y}$ symmetric transfer matrix. The matrix elements are
\[T_{\sigma, \sigma'} = e^{\beta J E_h(\sigma)/2} \cdot e^{\beta J E_v(\sigma, \sigma')} \cdot e^{\beta J E_h(\sigma')/2}\]
with $E_h(\sigma) = \sum_{j=1}^{L_y} \sigma_j \sigma_{(j \bmod L_y)+1}$ (horizontal bonds within a row, PBC) and $E_v(\sigma, \sigma') = \sum_{j=1}^{L_y} \sigma_j \sigma'_j$ (vertical bonds between rows).
Physical Context
- Valid for any finite $L_x \times L_y$ with PBC
\[\beta = 0\]
: $Z = 2^{L_x L_y}$ (all configurations equally weighted)\[J = 0\]
: $Z = 2^{L_x L_y}$ (no interactions)
Derivation
The transfer matrix formulation rewrites the partition function as a product of row-to-row Boltzmann weights. Each "transfer" from row $\sigma$ to row $\sigma'$ includes the vertical bonds between the two rows and half of the horizontal bonds within each row (symmetric split).
The computation uses $Z = \mathrm{tr}(T^{L_x})$ via matrix exponentiation rather than eigendecomposition, to support automatic differentiation with ForwardDiff.Dual numbers.
Full derivation of the symmetric transfer matrix from the row-by-row factorisation: Transfer matrix: symmetric split construction .
Full derivation of the AD path from $\ln Z$ to thermodynamic observables ($F$, $\langle E\rangle$, $C_v$, $S$, …) via forward-mode dual numbers: Thermodynamic quantities from $\partial \ln Z$ via AD .
References
- L. Onsager, "Crystal Statistics. I. A Two-Dimensional Model with an Order-Disorder Transition", Phys. Rev. 65, 117 (1944).
- B. M. McCoy and T. T. Wu, The Two-Dimensional Ising Model, Harvard University Press (1973), Ch. 2.
QAtlas API
Z = QAtlas.fetch(IsingSquare(), PartitionFunction();
Lx=4, Ly=4, β=0.44, J=1.0)Verification
| Test file | Method | What is checked |
|---|---|---|
test_ising_2x2_classical.jl | Brute-force $2^N$ enumeration | $Z_{\text{TM}} \approx Z_{\text{BF}}$ for $2\times2$, $2\times3$, $3\times3$ |
test_ising_ad_thermodynamics.jl | ForwardDiff | $\langle E \rangle = -\partial(\ln Z)/\partial\beta$, $C_v = \beta^2 \partial^2(\ln Z)/\partial\beta^2$ |
test_ising_square_pfaffian.jl | Special values | $\beta = 0 \Rightarrow Z = 2^N$, monotonicity, $L_x \leftrightarrow L_y$ symmetry |
Critical Temperature (Onsager)
Statement
\[T_c = \frac{2J}{\ln(1 + \sqrt{2})} \approx 2.269\,J\]
Equivalently, the critical reduced coupling $K_c = J / T_c$ satisfies
\[\sinh(2K_c) = 1\]
which is the self-dual point of the Kramers-Wannier duality.
Derivation
The Kramers-Wannier duality maps the high-temperature expansion of $Z$ to the low-temperature expansion of the dual partition function. The critical point is the unique fixed point of this duality:
\[e^{-2K_c} = \tanh K_c \quad \Longleftrightarrow \quad \sinh(2K_c) = 1\]
Solving: $K_c = \frac{1}{2}\mathrm{arcsinh}(1) = \frac{1}{2}\ln(1 + \sqrt{2})$.
Full derivation of the Kramers–Wannier duality (classical + TFIM operator form) and the self-dual fixed point: Kramers–Wannier duality .
References
- H. A. Kramers, G. H. Wannier, "Statistics of the Two-Dimensional Ferromagnet. Part I", Phys. Rev. 60, 252 (1941) — duality.
- L. Onsager, Phys. Rev. 65, 117 (1944) — exact solution confirming the duality prediction.
QAtlas API
Tc = QAtlas.fetch(IsingSquare(), CriticalTemperature(); J=1.0)Verification
| Test file | Method | What is checked |
|---|---|---|
test_ising_onsager_yang.jl | Numerical value | $T_c \approx 2.2692$ |
test_ising_onsager_yang.jl | Duality identity | $\sinh(2\beta_c J) = 1$ |
test_universality_cross_check.jl | Yang $M(T_c) = 0$ | Phase boundary consistency |
Spontaneous Magnetization (Yang)
Statement
\[M(T) = \begin{cases} \left(1 - \sinh^{-4}(2\beta J)\right)^{1/8} & T < T_c \\ 0 & T \geq T_c \end{cases}\]
The exponent $1/8$ directly gives the order parameter critical exponent $\beta = 1/8$ of the Ising universality class.
Derivation
Yang's calculation (1952) uses the Pfaffian method to evaluate the spontaneous magnetization of the infinite square lattice. The key step is computing $\langle \sigma_0 \rangle$ as a Toeplitz determinant, which in the thermodynamic limit gives the closed-form expression above.
Full derivation of the Toeplitz-determinant reduction, the strong Szegő-theorem evaluation, and the emergence of the exponent $1/8$ from the Wiener–Hopf $1/2$ × Szegő $1/4$ × correlator $1/2$ factor chain: Yang's spontaneous magnetization via Toeplitz determinant .
Physical Context
\[T = 0\]
($\beta \to \infty$): $M = 1$ (fully ordered)\[T \to T_c^-\]
: $M \sim (T_c - T)^{1/8}$ (critical exponent $\beta = 1/8$)\[T \geq T_c\]
: $M = 0$ (disordered)
The exponent $1/8$ is very small, meaning the magnetization vanishes slowly: $M \approx 0.7$ even at 1% below $T_c$.
References
- C. N. Yang, "The spontaneous magnetization of a two-dimensional Ising model", Phys. Rev. 85, 808 (1952).
QAtlas API
M = QAtlas.fetch(IsingSquare(), SpontaneousMagnetization();
β=0.5, J=1.0)Verification
| Test file | Method | What is checked |
|---|---|---|
test_ising_onsager_yang.jl | Special values | $M(\beta \to \infty) = 1$, $M(T_c) = 0$ |
test_ising_onsager_yang.jl | Monotonicity | $M$ increases as $T \to 0$ |
test_ising_onsager_yang.jl | $\beta$ extraction | log-log slope $\to 1/8$ near $T_c$ |
test_universality_cross_check.jl | Cross-check | Extracted $\beta$ matches Universality(:Ising).β |
Connections
- Universality: Ising universality class — $\beta = 1/8$, $\nu = 1$, $c = 1/2$.
- Quantum counterpart: TFIM — the 2D classical Ising model maps to the 1+1D TFIM via quantum-classical correspondence.
- Transfer matrix method: Methods — computational details of the $\mathrm{tr}(T^{L_x})$ evaluation.
- AD verification: Automatic Differentiation — thermodynamic quantities from $\partial(\ln Z)/\partial\beta$.
Underlying derivations
Every stored value on this page is backed by a step-by-step derivation note under docs/src/calc/:
- Partition function →
transfer-matrix-symmetric-split(row-by-row factorisation, symmetric-split construction of $T$, $Z = \mathrm{Tr}(T^{L_x})$). - Thermodynamic quantities from $Z$ →
ad-thermodynamics-from-z(derivatives of $\ln Z$ via ForwardDiff, fluctuation-dissipation identity). - Critical temperature →
kramers-wannier-duality(self-dual fixed point $\sinh(2K_c) = 1$). - Spontaneous magnetisation →
yang-magnetization-toeplitz(Toeplitz determinant + strong Szegő theorem → $\beta = 1/8$). - Critical exponents from CFT →
ising-cft-primary-operators(Kac table of $\mathcal{M}(3, 4)$; three primaries and their scaling dimensions). - Scaling relations among exponents →
ising-scaling-relations(Rushbrooke, Widom, Fisher, Josephson — all four from the Widom scaling form).
<!– ATLAS:HUBS:START – auto-generated by docs/atlas/generate.jl. Do not edit by hand; edits between these markers are overwritten on next regen. –>
Verified hubs
In the Verified Atlas, this model registers 13 hubs (quantity / BC pair). The badge column shows the R1 assurance level; click a hub link to see the exact verify(...) calls, references, and corroboration mechanism.
| Quantity | BC | Assurance | Cards |
|---|---|---|---|
CriticalExponents | Infinite | 🟠 uncorroborated-but-feasible | 0 |
CriticalTemperature | Infinite | 🟢 corroborated-at-p | 6 |
Energy | Infinite | 🔵 coherent | 1 |
Energy | PBC | 🟢 corroborated-at-p | 4 |
FreeEnergy | Infinite | 🟠 uncorroborated-but-feasible | 0 |
FreeEnergy | PBC | 🟢 corroborated-at-p | 2 |
PartitionFunction | PBC | 🟢 corroborated-at-p | 24 |
SpecificHeat | Infinite | 🟠 uncorroborated-but-feasible | 0 |
SpecificHeat | PBC | 🟢 corroborated-at-p | 4 |
SpontaneousMagnetization | Infinite | 🟢 corroborated-at-p | 4 |
ThermalEntropy | Infinite | 🔵 coherent | 1 |
ThermalEntropy | PBC | 🟢 corroborated-at-p | 4 |
UniversalityClass | Infinite | 🟠 uncorroborated-but-feasible | 0 |
<!– ATLAS:HUBS:END –>
<!– ATLAS:DOCS:START – auto-generated by docs/atlas/generate.jl. Do not edit by hand; edits between these markers are overwritten on next regen. –>
API
Every fetch(::Model, …) method registered for this model — together with the model struct(s) and exported helpers — generated directly from the source (in lock-step with @register):
QAtlas.CriticalTemperature — Type
CriticalTemperature() <: AbstractQuantityExact critical temperature of a classical model.
QAtlas.IsingSquare — Type
IsingSquare(; J::Real = 1.0, Lx::Int = 0, Ly::Int = 0) <: AbstractQAtlasModelClassical 2D Ising model on a square lattice with periodic boundary conditions (PBC) in both directions.
Hamiltonian: H = -J Σ_{⟨i,j⟩} σᵢ σⱼ, σᵢ ∈ {-1, +1}.
Physics parameters are carried as typed struct fields:
J— Ising coupling (default1.0,J > 0ferromagnetic).Lx,Ly— lattice extents.0is a legacy sentinel meaning "thermodynamic limit / unspecified"; finite-size quantities likePartitionFunctionrequire both to be positive.
For backward compatibility the fetch methods accept Lx, Ly, J, β as kwargs too — kwargs override the struct fields when both are supplied.
See also: PartitionFunction, CriticalTemperature, SpontaneousMagnetization.
QAtlas.PartitionFunction — Type
PartitionFunction() <: AbstractQuantityCanonical partition function Z = Σ_σ exp(-β H(σ)).
QAtlas.SpontaneousMagnetization — Type
SpontaneousMagnetization() <: AbstractQuantitySpontaneous magnetization of a classical model as a function of temperature. Retained under this name for backward compatibility with the classical-Ising literature; new code may prefer the axis-explicit MagnetizationZ together with a T < T_c context.
QAtlas.fetch — Method
fetch(::IsingSquare, ::CriticalExponents, ::Infinite; kwargs...) -> NamedTupleOnsager 1944 critical exponents of the 2D square-lattice Ising model at T_c (= 2J / log(1 + √2)):
α = 0, β = 1/8, γ = 7/4, δ = 15, ν = 1, η = 1/4.Delegated to the existing Universality(:Ising) infrastructure at d = 2. Rushbrooke (α + 2β + γ = 2), Widom (γ = β(δ − 1)), and Fisher (η = 2 − γ/ν) hyperscaling relations all check out.
The returned NamedTuple also carries the central charge c = 1//2 inherited from the CFT minimal model M(3,4) — same payload as fetch(Universality(:Ising), CriticalExponents(); d=2).
References
- L. Onsager, Phys. Rev. 65, 117 (1944) — exact 2D Ising solution.
QAtlas.fetch — Method
fetch(::IsingSquare, ::CriticalTemperature; J=1.0) -> Float64Exact critical temperature of the 2D Ising model on the square lattice:
T_c = 2J / ln(1 + √2) ≈ 2.269 JEquivalently, the critical reduced coupling is Kc = J/Tc = ln(1+√2)/2, or sinh(2K_c) = 1.
References
L. Onsager, "Crystal Statistics. I.", Phys. Rev. 65, 117 (1944).QAtlas.fetch — Method
fetch(::IsingSquare, ::PartitionFunction; Lx, Ly, β, J=1.0) -> RealExact partition function Z = Tr(T^Lx) for the classical 2D Ising model on an Lx × Ly square lattice with periodic boundary conditions in both directions.
The transfer matrix T acts along the Lx direction (row-to-row transfer), with each row containing Ly spins and PBC along the Ly direction.
Bond-counting convention
The transfer-matrix sum double-counts bonds along any dimension of length 2 (PBC wraparound of a length-2 ring produces the factor σ_1 σ_2 + σ_2 σ_1 = 2 σ_1 σ_2). The brute-force enumeration in test/util/classical_partition.jl is built under the same PBC convention so that Z_transfer-matrix == Z_bruteforce exactly for every (Lx, Ly, β, J). For Lx ≥ 3 and Ly ≥ 3 each physical bond is enumerated exactly once and the result coincides with the standard physical Z of a PBC lattice.
Special values
- β = 0 (any Lx, Ly, J): Z = 2^(Lx·Ly) — all configurations equally weighted
- J = 0 (any β, Lx, Ly): Z = 2^(Lx·Ly) — no interactions, same as β = 0
Automatic differentiation
fetch is generic in β and J so that ForwardDiff.Dual numbers propagate through it. This allows macroscopic thermodynamic quantities to be recovered from Z by differentiation — e.g.
⟨E⟩ = -∂(log Z)/∂β
C_v = β² · ∂²(log Z)/∂β²See test/verification/test_ising_ad_thermodynamics.jl for a cross-check against direct ensemble averages.
Arguments
Lx::Int: number of rows (transfer direction)Ly::Int: number of columns (row length, PBC)β::Real: inverse temperature (β = 1/(k_B T))J::Real: Ising coupling constant (default 1.0; J > 0 ferromagnetic)
References
L. Onsager, Phys. Rev. 65, 117 (1944).
B. M. McCoy and T. T. Wu, "The Two-Dimensional Ising Model" (1973).QAtlas.fetch — Method
fetch(::IsingSquare, ::SpontaneousMagnetization; β, J=1.0) -> Float64Exact spontaneous magnetization of the 2D Ising model on the infinite square lattice:
M(T) = (1 − sinh⁻⁴(2βJ))^{1/8} for T < T_c (i.e. sinh(2βJ) > 1)
M(T) = 0 for T ≥ T_cThe critical exponent β = 1/8 is visible in the approach M → 0 as T → T_c⁻.
Special values:
- T = 0 (β → ∞): M = 1 (fully ordered)
- T = T_c: M = 0 (onset of disorder)
Arguments
β::Real: inverse temperature (β = 1/(k_B T))J::Real: Ising coupling constant (default 1.0; J > 0 ferromagnetic)
References
C. N. Yang, "The spontaneous magnetization of a two-dimensional Ising
model", Phys. Rev. 85, 808 (1952).QAtlas.fetch — Method
fetch(m::IsingSquare, ::Energy{:per_site}, ::Infinite; beta, J=m.J) -> Float64Per-site thermal energy ε(β) = -∂(log Z / N)/∂β from the Onsager closed form via ForwardDiff. At low T (β → ∞) ε → -2J — the ferromagnetic ground state has every spin aligned, contributing -J per bond and 2 bonds per site.
QAtlas.fetch — Method
fetch(m::IsingSquare, ::Energy{:per_site}, ::PBC; beta, Lx, Ly, J) -> Float64Per-site thermal energy ε(β) = -∂(log Z)/∂β / (Lx · Ly) for the finite torus, via ForwardDiff over the transfer-matrix log Z.
QAtlas.fetch — Method
fetch(m::IsingSquare, ::FreeEnergy, ::Infinite; beta, J=m.J) -> Float64Per-site Helmholtz free energy f(β) = -β⁻¹ · log Z / N of the classical 2D Ising model on the infinite square lattice (Onsager 1944).
QAtlas.fetch — Method
fetch(m::IsingSquare, ::FreeEnergy, ::PBC; beta, Lx=m.Lx, Ly=m.Ly, J=m.J) -> Float64Per-site Helmholtz free energy f(β) = -log Z / (β · Lx · Ly) for the Lx × Ly torus. Builds the 2^Ly × 2^Ly transfer matrix and trace-cubes; cost is O(2^{3 Ly}), so practical Ly ≤ 10–12.
QAtlas.fetch — Method
fetch(m::IsingSquare, ::SpecificHeat, ::Infinite; beta, J=m.J) -> Float64Per-site specific heat c_v(β) = β² · ∂²(log Z / N)/∂β² via ForwardDiff (twice). Diverges logarithmically at the Onsager critical point K_c = ln(1+√2)/2 (i.e. T_c = 2J/ln(1+√2)). Caller is responsible for staying off that slice; finite values everywhere else.
QAtlas.fetch — Method
fetch(m::IsingSquare, ::SpecificHeat, ::PBC; beta, Lx, Ly, J) -> Float64Per-site specific heat c_v(β) = β² · Var(H) / (Lx · Ly) for the finite torus, via ForwardDiff (twice) on log Z.
QAtlas.fetch — Method
fetch(m::IsingSquare, ::ThermalEntropy, ::Infinite; beta, J=m.J) -> Float64Per-site Gibbs entropy s(β) = β · (ε − f) from the Onsager free-energy and energy paths.
QAtlas.fetch — Method
fetch(m::IsingSquare, ::ThermalEntropy, ::PBC; beta, Lx, Ly, J) -> Float64Per-site Gibbs entropy s(β) = β · (ε − f) for the finite torus.
<!– ATLAS:DOCS:END –>