2.1 The canonical ensemble

A system in contact with a heat bath at temperature TT is found in configuration σ\sigma with the Boltzmann probability

P(σ)=e−βH(σ)Z,Z=∑σe−βH(σ),β=1kBT.(2)P(\sigma) = \frac{e^{-\beta H(\sigma)}}{Z}, \qquad Z = \sum_{\sigma} e^{-\beta H(\sigma)}, \qquad \beta = \frac{1}{k_B T}. \tag{2}

The partition function ZZ contains all the thermodynamics, through the free energy F=−kBTln⁡ZF = -k_B T \ln Z. The average of any observable AA is ⟨A⟩=∑σA(σ)P(σ)\left\langle A \right\rangle = \sum_\sigma A(\sigma) P(\sigma).

2.2 Thermodynamic quantities and fluctuations

The quantities we will compute are the energy and the magnetization,

E=⟨H⟩,M=⟨∑isi⟩,E = \left\langle H \right\rangle, \qquad M = \left\langle \textstyle\sum_i s_i \right\rangle,

and their responses: the specific heat C=∂E/∂TC = \partial E / \partial T and the magnetic susceptibility χ=∂M/∂h\chi = \partial M / \partial h. They are all derivatives of ln⁡Z\ln Z:

E=−∂ln⁡Z∂β,C=∂E∂T=⟨H2⟩−⟨H⟩2kBT2,(3)E = -\frac{\partial \ln Z}{\partial \beta}, \qquad C = \frac{\partial E}{\partial T} = \frac{\left\langle H^2 \right\rangle - \left\langle H \right\rangle^2}{k_B T^2}, \tag{3}
M=1β∂ln⁡Z∂h,χ=∂M∂h=⟨M2⟩−⟨M⟩2kBT,(4)M = \frac{1}{\beta}\frac{\partial \ln Z}{\partial h}, \qquad \chi = \frac{\partial M}{\partial h} = \frac{\left\langle \mathcal{M}^2 \right\rangle - \left\langle \mathcal{M} \right\rangle^2}{k_B T}, \tag{4}

where M=∑isi\mathcal{M} = \sum_i s_i. These fluctuation–dissipation relations are very useful in simulations: they give the responses CC and χ\chi from the fluctuations of HH and M\mathcal{M} at fixed temperature and field, without having to take numerical derivatives. Since EE, MM, CC and χ\chi are proportional to NN, we give their values per spin: e=E/Ne = E/N, m=M/Nm = M/N, c=C/Nc = C/N and χ/N\chi/N, which we still call χ\chi.

The difficulty is the number of terms in ZZ. A 10×1010 \times 10 lattice already has 2100≈1.3×10302^{100} \approx 1.3 \times 10^{30} configurations: summing over all of them, even at 10910^9 configurations per second, would take 4×10134 \times 10^{13} years. Exact results require mathematical tricks (Sections 3 and 5); otherwise we must sample the configurations (Section 6).

2.3 Symmetry and spontaneous symmetry breaking

At h=0h = 0, the energy (1) does not change when all the spins are flipped, si→−sis_i \to -s_i. For every configuration with magnetization M\mathcal{M} there is one with −M-\mathcal{M} and the same probability, so

⟨M⟩=0for any finite system at h=0.\left\langle \mathcal{M} \right\rangle = 0 \qquad \text{for any finite system at } h = 0 .

A finite system therefore never has a spontaneous magnetization in the strict sense. A phase transition can only occur in the thermodynamic limit N→∞N \to \infty. There, the spontaneous magnetization is defined by taking the limit of a small field in the right order,

m0(T)=lim⁡h→0+lim⁡N→∞MN.(5)m_0(T) = \lim_{h \to 0^+} \lim_{N \to \infty} \frac{M}{N} . \tag{5}

If m0≠0m_0 \neq 0, the system has chosen one of the two directions although the energy has no preferred one: the symmetry is spontaneously broken. The magnetization is the order parameter of the transition. Mathematically, a phase transition is a point where the free energy per spin, f=F/Nf = F/N in the limit N→∞N \to \infty, is not an analytic function of TT and hh. Since each finite ZZ is a finite sum of exponentials, the non-analyticity can only appear in the limit.

In a large but finite system below the transition, the magnetization does not vanish at a given moment: it fluctuates around +m0+m_0 or −m0-m_0, and very rarely jumps from one to the other. This is why simulations measure ⟨∣m∣⟩\left\langle |m| \right\rangle rather than ⟨m⟩\left\langle m \right\rangle. For the same reason, the 2D simulations at h=0h = 0 measure the fluctuations of ∣m∣|m|,

χ′=N(⟨m2⟩−⟨∣m∣⟩2)kBT,(6)\chi' = \frac{N\left(\left\langle m^2 \right\rangle - \left\langle |m| \right\rangle^2\right)}{k_B T}, \tag{6}

instead of Eq. (4), which in a finite system at h=0h = 0 reduces to N⟨m2⟩/kBTN\left\langle m^2 \right\rangle/k_BT and grows like NN below TcT_c because mm flips between ±m0\pm m_0. Below TcT_c, χ′\chi' measures the response within one ordered state; above TcT_c, where mm has Gaussian fluctuations, χ′=(1−2/π)χ\chi' = (1 - 2/\pi)\chi. Both diverge at TcT_c with the same exponent. All the 2D results at h=0h = 0 below use χ′\chi'; the 1D results, and all results in a field, use Eq. (4).

2.4 Warm-up: independent spins

Without interactions (J=0J = 0), the spins are independent:

Z=∏i=1N∑si=±1eβhsi=(2cosh⁡βh)N,m=tanh⁡(βh),χ∣h=0=1kBT.Z = \prod_{i=1}^N \sum_{s_i = \pm 1} e^{\beta h s_i} = \left(2\cosh \beta h\right)^N, \qquad m = \tanh(\beta h), \qquad \chi\big|_{h=0} = \frac{1}{k_B T}.

This is a paramagnet: the field aligns the spins against thermal agitation, and the susceptibility follows Curie's law χ∝1/T\chi \propto 1/T. There is no spontaneous magnetization. Interactions are needed for order.