Technopedia

The technologist’s encyclopedia

Canonical Ensemble

The canonical ensemble is the probability measure for a system in contact with a heat bath at fixed temperature TT, with fixed volume VV and particle number NN. Energy EE is random. It is the right tool for equilibrium properties at a specified temperature: a gas in a thermostat, a solid in an oven, or any system where TT is controlled but energy fluctuates. It is the most commonly used ensemble in chemistry and condensed matter.

Authoritative sources

Boltzmann factor

Each microstate α\alpha with energy EαE_\alpha has probability

P(α)=e−βEαZ,β=1kBTP(\alpha) = \frac{e^{-\beta E_\alpha}}{Z}, \qquad \beta = \frac{1}{k_B T}

where ZZ is the partition function (normalization):

Z(T,V,N)=∑αe−βEαZ(T,V,N) = \sum_\alpha e^{-\beta E_\alpha}
Details

Derivation from the microcanonical reservoir. Imagine a small system SS (the “system”) in contact with a very large reservoir RR (the “heat bath”), with total energy EtotE_{\text{tot}} fixed. The combined system is isolated, so it is described by the microcanonical ensemble: every microstate of S+RS+R with energy EtotE_{\text{tot}} is equally likely.

If SS is in microstate α\alpha with energy EαE_\alpha, the reservoir must have energy Etot−EαE_{\text{tot}} - E_\alpha. The number of reservoir microstates compatible with this is ΩR(Etot−Eα)\Omega_R(E_{\text{tot}} - E_\alpha). The probability of α\alpha is therefore proportional to this count:

P(α)∝ΩR(Etot−Eα)P(\alpha) \propto \Omega_R(E_{\text{tot}} - E_\alpha)

Since Eα≪EtotE_\alpha \ll E_{\text{tot}}, expand the reservoir entropy SR=kBln⁡ΩRS_R = k_B \ln \Omega_R to first order:

SR(Etot−Eα)≈SR(Etot)−Eα(∂SR∂E) ⁣EtotS_R(E_{\text{tot}} - E_\alpha) \approx S_R(E_{\text{tot}}) - E_\alpha \left(\frac{\partial S_R}{\partial E}\right)_{\!E_{\text{tot}}}

The slope (1/kB)(∂SR/∂E)=1/(kBT)=β(1/k_B)(\partial S_R/\partial E) = 1/(k_B T) = \beta defines the temperature of the reservoir. Exponentiating:

P(α)∝e−βEαP(\alpha) \propto e^{-\beta E_\alpha}

The normalization constant is the partition function Z=∑αe−βEαZ = \sum_\alpha e^{-\beta E_\alpha}.

Two-level example. Consider a single spin in a magnetic field with energies E0=0E_0 = 0 (spin down) and E1=εE_1 = \varepsilon (spin up):

Z=1+e−βε,P0=11+e−βε,P1=e−βε1+e−βεZ = 1 + e^{-\beta\varepsilon}, \qquad P_0 = \frac{1}{1+e^{-\beta\varepsilon}}, \qquad P_1 = \frac{e^{-\beta\varepsilon}}{1+e^{-\beta\varepsilon}}

At low temperature (βε≫1\beta\varepsilon \gg 1), the system is almost certainly in the ground state. At high temperature (βε≪1\beta\varepsilon \ll 1), both states are equally likely.

E E₀ = 0 E₁ = ε ε P₀ (low T: ≈1) P₁ (low T: ≈0) P₁/P₀ = e^{-βε}

Partition function as a Laplace transform. For a continuous density of states Ω(E)\Omega(E):

Z=∫0∞Ω(E) e−βE dEZ = \int_0^{\infty} \Omega(E)\, e^{-\beta E}\, dE

This is the Laplace transform of Ω(E)\Omega(E) with parameter β\beta. At low temperature, only states near the ground state contribute; at high temperature, the integral samples the full density of states.

Factorization for non-interacting particles. If the total energy is a sum of single-particle energies E=∑iεniE = \sum_i \varepsilon_{n_i}, the partition function factorizes:

ZN=1N!(∑ne−βεn)NZ_N = \frac{1}{N!}\left(\sum_n e^{-\beta \varepsilon_n}\right)^N

The 1/N!1/N! (Gibbs factor) corrects for indistinguishability. See Statistical Foundations of Thermodynamics for the ideal-gas application.

Authoritative sources

Example problem

A three-level system has energies E0=0E_0 = 0, E1=εE_1 = \varepsilon, E2=3εE_2 = 3\varepsilon. Find ZZ, the probabilities, and the mean energy at βε=1\beta\varepsilon = 1.

Solution Z=1+e−1+e−3=1+0.3679+0.0498=1.4177Z = 1 + e^{-1} + e^{-3} = 1 + 0.3679 + 0.0498 = 1.4177 P0=11.4177=0.705,P1=0.36791.4177=0.260,P2=0.04981.4177=0.035P_0 = \frac{1}{1.4177} = 0.705, \quad P_1 = \frac{0.3679}{1.4177} = 0.260, \quad P_2 = \frac{0.0498}{1.4177} = 0.035 ⟨E⟩=0⋅1+ε⋅e−1+3ε⋅e−3Z=0.3679+0.14941.4177 ε=0.365 ε\langle E \rangle = \frac{0 \cdot 1 + \varepsilon \cdot e^{-1} + 3\varepsilon \cdot e^{-3}}{Z} = \frac{0.3679 + 0.1494}{1.4177}\,\varepsilon = 0.365\,\varepsilon

Additivity of partition functions

For two independent subsystems AA and BB (no interaction energy, no shared degrees of freedom), the total partition function is the product:

Ztot=ZA×ZBZ_{\text{tot}} = Z_A \times Z_B

More generally, for NN independent subsystems: Ztot=∏iZiZ_{\text{tot}} = \prod_i Z_i.

Details

Why the product? If AA is in state ii with energy EiAE_i^A and BB is in state jj with energy EjBE_j^B, the combined state $(i,j)$ has energy EiA+EjBE_i^A + E_j^B (additivity of energy for independent systems). The joint Boltzmann factor is:

e−β(EiA+EjB)=e−βEiA⋅e−βEjBe^{-\beta(E_i^A + E_j^B)} = e^{-\beta E_i^A} \cdot e^{-\beta E_j^B}

Summing over all joint states:

Ztot=∑i,je−βEiA e−βEjB=(∑ie−βEiA)(∑je−βEjB)=ZA⋅ZBZ_{\text{tot}} = \sum_{i,j} e^{-\beta E_i^A}\, e^{-\beta E_j^B} = \left(\sum_i e^{-\beta E_i^A}\right)\left(\sum_j e^{-\beta E_j^B}\right) = Z_A \cdot Z_B

Consequence: extensivity of free energy. Since F=−kBTln⁡ZF = -k_B T \ln Z:

Ftot=−kBTln⁡(ZAZB)=−kBT(ln⁡ZA+ln⁡ZB)=FA+FBF_{\text{tot}} = -k_B T \ln(Z_A Z_B) = -k_B T(\ln Z_A + \ln Z_B) = F_A + F_B

The Helmholtz free energy is extensive (additive) for independent subsystems. This is the statistical-mechanical origin of the extensivity of thermodynamic potentials.

Example: ideal gas as NN independent particles. For NN non-interacting, indistinguishable particles:

ZN=1N!(Z1)NZ_N = \frac{1}{N!}(Z_1)^N

where Z1Z_1 is the single-particle partition function. The 1/N!1/N! prevents overcounting of permutations (Gibbs paradox). Taking the logarithm: ln⁡ZN=Nln⁡Z1−ln⁡N!≈N(ln⁡Z1−ln⁡N+1)\ln Z_N = N \ln Z_1 - \ln N! \approx N(\ln Z_1 - \ln N + 1) (Stirling), which is extensive in NN.

A Z_A × B Z_B = Z_A·Z_B

Authoritative sources

Example problem

Two independent two-level systems (each with levels 00 and ε\varepsilon) are in a heat bath. Find ZtotZ_{\text{tot}} and the probability that both are in their excited states.

Solution

Each system has Z1=1+e−βεZ_1 = 1 + e^{-\beta\varepsilon}. By additivity:

Ztot=(1+e−βε)2Z_{\text{tot}} = (1 + e^{-\beta\varepsilon})^2

The probability that both are excited is the product of individual probabilities:

P(both excited)=(e−βε1+e−βε)2=e−2βε(1+e−βε)2P(\text{both excited}) = \left(\frac{e^{-\beta\varepsilon}}{1+e^{-\beta\varepsilon}}\right)^2 = \frac{e^{-2\beta\varepsilon}}{(1+e^{-\beta\varepsilon})^2}

This equals the Boltzmann weight of the joint state $(1,1)$ with energy 2ε2\varepsilon divided by ZtotZ_{\text{tot}}, confirming consistency.

Helmholtz free energy

The thermodynamic potential conjugate to (T,V,N)(T, V, N) is the Helmholtz free energy:

F(T,V,N)=−kBTln⁡ZF(T,V,N) = -k_B T \ln Z

All thermodynamic quantities are derivatives of FF:

S=−(∂F∂T)V,N,P=−(∂F∂V)T,N,μ=(∂F∂N)T,VS = -\left(\frac{\partial F}{\partial T}\right)_{V,N}, \qquad P = -\left(\frac{\partial F}{\partial V}\right)_{T,N}, \qquad \mu = \left(\frac{\partial F}{\partial N}\right)_{T,V}
Details

Why FF? The Helmholtz free energy F=U−TSF = U - TS is the Legendre transform of the internal energy U(S,V,N)U(S,V,N) that replaces the entropy variable SS with its conjugate T=(∂U/∂S)V,NT = (\partial U/\partial S)_{V,N}. At fixed T,V,NT, V, N, the equilibrium state minimizes FF. This is the statistical-mechanical statement of the second law for systems in a heat bath.

Derivation from ZZ. The mean energy is:

⟨E⟩=∑αEα e−βEαZ=−∂ln⁡Z∂β\langle E \rangle = \frac{\sum_\alpha E_\alpha\, e^{-\beta E_\alpha}}{Z} = -\frac{\partial \ln Z}{\partial \beta}

The Gibbs entropy of the canonical distribution is:

S=−kB∑αPαln⁡Pα=−kB∑αPα(−βEα−ln⁡Z)=kBβ⟨E⟩+kBln⁡ZS = -k_B \sum_\alpha P_\alpha \ln P_\alpha = -k_B \sum_\alpha P_\alpha(-\beta E_\alpha - \ln Z) = k_B \beta \langle E \rangle + k_B \ln Z

Substituting into F=⟨E⟩−TSF = \langle E \rangle - TS:

F=⟨E⟩−T(kBβ⟨E⟩+kBln⁡Z)=⟨E⟩−⟨E⟩−kBTln⁡Z=−kBTln⁡ZF = \langle E \rangle - T(k_B \beta \langle E \rangle + k_B \ln Z) = \langle E \rangle - \langle E \rangle - k_B T \ln Z = -k_B T \ln Z

Practical use. Once you compute Z(T,V,N)Z(T,V,N) from the microscopic Hamiltonian, every thermodynamic quantity follows by differentiation. This is the central workflow of equilibrium statistical mechanics.

Authoritative sources

Example problem

A single harmonic oscillator has energy levels En=ℏω(n+12)E_n = \hbar\omega(n + \tfrac{1}{2}), n=0,1,2,…n = 0, 1, 2, \ldots. Find ZZ, FF, and ⟨E⟩\langle E \rangle.

Solution Z=∑n=0∞e−βℏω(n+1/2)=e−βℏω/21−e−βℏωZ = \sum_{n=0}^{\infty} e^{-\beta\hbar\omega(n+1/2)} = \frac{e^{-\beta\hbar\omega/2}}{1 - e^{-\beta\hbar\omega}} F=−kBTln⁡Z=ℏω2+kBTln⁡(1−e−βℏω)F = -k_B T \ln Z = \frac{\hbar\omega}{2} + k_B T \ln(1 - e^{-\beta\hbar\omega}) ⟨E⟩=−∂ln⁡Z∂β=ℏω2+ℏωeβℏω−1\langle E \rangle = -\frac{\partial \ln Z}{\partial \beta} = \frac{\hbar\omega}{2} + \frac{\hbar\omega}{e^{\beta\hbar\omega} - 1}

At high temperature (kBT≫ℏωk_B T \gg \hbar\omega): ⟨E⟩≈kBT\langle E \rangle \approx k_B T (classical equipartition). At low temperature: ⟨E⟩≈ℏω/2\langle E \rangle \approx \hbar\omega/2 (zero-point energy).

Entropy in the canonical ensemble

The entropy of a system in the canonical ensemble is:

S=kB ⁣(ln⁡Z+β⟨E⟩)=⟨E⟩−FTS = k_B\!\left(\ln Z + \beta\langle E \rangle\right) = \frac{\langle E \rangle - F}{T}
Details

Derivation. Start from the Gibbs entropy formula applied to the canonical distribution Pα=e−βEα/ZP_\alpha = e^{-\beta E_\alpha}/Z:

S=−kB∑αPαln⁡PαS = -k_B \sum_\alpha P_\alpha \ln P_\alpha

Substitute ln⁡Pα=−βEα−ln⁡Z\ln P_\alpha = -\beta E_\alpha - \ln Z:

S=−kB∑αPα(−βEα−ln⁡Z)=kBβ∑αPαEα+kBln⁡Z∑αPαS = -k_B \sum_\alpha P_\alpha(-\beta E_\alpha - \ln Z) = k_B \beta \sum_\alpha P_\alpha E_\alpha + k_B \ln Z \sum_\alpha P_\alpha

Since ∑αPα=1\sum_\alpha P_\alpha = 1 and ∑αPαEα=⟨E⟩\sum_\alpha P_\alpha E_\alpha = \langle E \rangle:

S=kBβ⟨E⟩+kBln⁡ZS = k_B \beta \langle E \rangle + k_B \ln Z

Connection to thermodynamics. Using F=−kBTln⁡ZF = -k_B T \ln Z (so ln⁡Z=−F/(kBT)\ln Z = -F/(k_B T)):

S=kBβ⟨E⟩−FT=⟨E⟩T−FT=⟨E⟩−FTS = k_B \beta \langle E \rangle - \frac{F}{T} = \frac{\langle E \rangle}{T} - \frac{F}{T} = \frac{\langle E \rangle - F}{T}

This is exactly the thermodynamic identity F=U−TSF = U - TS rearranged: S=(U−F)/TS = (U - F)/T. The canonical ensemble reproduces the thermodynamic relation between internal energy, free energy, and entropy.

Physical interpretation. The two terms in S=kB(ln⁡Z+β⟨E⟩)S = k_B(\ln Z + \beta\langle E\rangle) have distinct meanings:

Example: two-level system. With Z=1+e−βεZ = 1 + e^{-\beta\varepsilon}:

S=kB ⁣[ln⁡(1+e−βε)+βεeβε+1]S = k_B\!\left[\ln(1+e^{-\beta\varepsilon}) + \frac{\beta\varepsilon}{e^{\beta\varepsilon}+1}\right]

At T→0T \to 0: S→0S \to 0 (third law — the system is in a unique ground state). At T→∞T \to \infty: S→kBln⁡2S \to k_B \ln 2 (maximum entropy — both states equally likely).

Authoritative sources

Example problem

Show that for the two-level system, S=(⟨E⟩−F)/TS = (\langle E \rangle - F)/T holds identically.

Solution

We have F=−kBTln⁡(1+e−βε)F = -k_B T \ln(1+e^{-\beta\varepsilon}) and ⟨E⟩=ε/(eβε+1)\langle E \rangle = \varepsilon/(e^{\beta\varepsilon}+1).

⟨E⟩−FT=εT(eβε+1)+kBln⁡(1+e−βε)\frac{\langle E \rangle - F}{T} = \frac{\varepsilon}{T(e^{\beta\varepsilon}+1)} + k_B \ln(1+e^{-\beta\varepsilon})

Since ε/T=kBβε\varepsilon/T = k_B \beta\varepsilon and ln⁡(1+e−βε)=ln⁡((eβε+1)/eβε)=ln⁡(eβε+1)−βε\ln(1+e^{-\beta\varepsilon}) = \ln((e^{\beta\varepsilon}+1)/e^{\beta\varepsilon}) = \ln(e^{\beta\varepsilon}+1) - \beta\varepsilon:

⟨E⟩−FT=kBβεeβε+1+kBln⁡(eβε+1)−kBβε\frac{\langle E \rangle - F}{T} = \frac{k_B \beta\varepsilon}{e^{\beta\varepsilon}+1} + k_B\ln(e^{\beta\varepsilon}+1) - k_B\beta\varepsilon =kBln⁡(eβε+1)+kBβε ⁣(1eβε+1−1)=kBln⁡(eβε+1)−kBβε eβεeβε+1= k_B\ln(e^{\beta\varepsilon}+1) + k_B\beta\varepsilon\!\left(\frac{1}{e^{\beta\varepsilon}+1} - 1\right) = k_B\ln(e^{\beta\varepsilon}+1) - \frac{k_B\beta\varepsilon\, e^{\beta\varepsilon}}{e^{\beta\varepsilon}+1}

This equals kB[ln⁡(1+e−βε)+βε/(eβε+1)]k_B[\ln(1+e^{-\beta\varepsilon}) + \beta\varepsilon/(e^{\beta\varepsilon}+1)] after rewriting, confirming the identity. ∎

Pressure from the partition function

The pressure is obtained directly from the partition function:

P=kBT(∂ln⁡Z∂V)T,NP = k_B T \left(\frac{\partial \ln Z}{\partial V}\right)_{T,N}

This is equivalent to P=−(∂F/∂V)T,NP = -(\partial F/\partial V)_{T,N} since F=−kBTln⁡ZF = -k_B T \ln Z.

Details

Derivation. From F=−kBTln⁡ZF = -k_B T \ln Z, the thermodynamic relation P=−(∂F/∂V)T,NP = -(\partial F/\partial V)_{T,N} gives:

P=−∂∂V(−kBTln⁡Z)=kBT(∂ln⁡Z∂V)T,NP = -\frac{\partial}{\partial V}(-k_B T \ln Z) = k_B T \left(\frac{\partial \ln Z}{\partial V}\right)_{T,N}

Ideal gas law. For NN classical, non-interacting particles in volume VV:

ZN=1N!(VλT3)N,λT=h2πmkBTZ_N = \frac{1}{N!}\left(\frac{V}{\lambda_T^3}\right)^N, \qquad \lambda_T = \frac{h}{\sqrt{2\pi m k_B T}}

Taking the logarithm: ln⁡ZN=Nln⁡V−3Nln⁡λT−ln⁡N!\ln Z_N = N\ln V - 3N\ln\lambda_T - \ln N!. Differentiating with respect to VV at fixed T,NT, N:

P=kBT⋅NV⟹PV=NkBTP = k_B T \cdot \frac{N}{V} \quad \Longrightarrow \quad PV = Nk_B T

This recovers the ideal gas law directly from the partition function.

Microscopic interpretation. The volume dependence of ZZ comes from the number of available single-particle states in volume VV. Increasing VV increases ZZ (more states), and the system “pushes back” against the walls — this is pressure.

Authoritative sources

Example problem

A single particle is confined in a one-dimensional box of length LL with energy levels En=n2ℏ2/(8mL2)E_n = n^2\hbar^2/(8mL^2), n=1,2,3,…n = 1, 2, 3, \ldots. In the high-temperature limit, show that P=kBT/LP = k_B T/L.

Solution

In the high-temperature limit (kBT≫ℏ2/(8mL2)k_B T \gg \hbar^2/(8mL^2)), the sum over states becomes an integral:

Z1=∑n=1∞e−βn2ℏ2/(8mL2)≈∫0∞e−βn2ℏ2/(8mL2) dn=LλTZ_1 = \sum_{n=1}^{\infty} e^{-\beta n^2\hbar^2/(8mL^2)} \approx \int_0^{\infty} e^{-\beta n^2\hbar^2/(8mL^2)}\, dn = \frac{L}{\lambda_T}

where λT=h/2πmkBT\lambda_T = h/\sqrt{2\pi m k_B T} is the thermal de Broglie wavelength.

P=kBT∂ln⁡Z1∂L=kBT⋅1LP = k_B T \frac{\partial \ln Z_1}{\partial L} = k_B T \cdot \frac{1}{L}

This is the one-dimensional ideal gas law: PL=kBTPL = k_B T. ∎

Energy and fluctuations

The mean energy and its variance are

⟨E⟩=−∂ln⁡Z∂β,Var⁡(E)=∂2ln⁡Z∂β2=kBT2CV\langle E \rangle = -\frac{\partial \ln Z}{\partial \beta}, \qquad \operatorname{Var}(E) = \frac{\partial^2 \ln Z}{\partial \beta^2} = k_B T^2 C_V

The fluctuation–dissipation relation Var⁡(E)=kBT2CV\operatorname{Var}(E) = k_B T^2 C_V ties the energy variance to the heat capacity: a system with large CVC_V (readily absorbs heat) has large energy fluctuations.

Details

Derivation of the variance. The mean energy is:

⟨E⟩=∑αEα e−βEαZ=−1Z∂Z∂β=−∂ln⁡Z∂β\langle E \rangle = \frac{\sum_\alpha E_\alpha\, e^{-\beta E_\alpha}}{Z} = -\frac{1}{Z}\frac{\partial Z}{\partial \beta} = -\frac{\partial \ln Z}{\partial \beta}

The second moment:

⟨E2⟩=1Z∂2Z∂β2\langle E^2 \rangle = \frac{1}{Z}\frac{\partial^2 Z}{\partial \beta^2}

Therefore:

Var⁡(E)=⟨E2⟩−⟨E⟩2=∂2ln⁡Z∂β2\operatorname{Var}(E) = \langle E^2 \rangle - \langle E \rangle^2 = \frac{\partial^2 \ln Z}{\partial \beta^2}

Since CV=∂⟨E⟩/∂TC_V = \partial\langle E\rangle/\partial T and ∂/∂T=−(1/kBT2) ∂/∂β\partial/\partial T = -(1/k_B T^2)\,\partial/\partial\beta:

Var⁡(E)=−∂⟨E⟩∂β=kBT2∂⟨E⟩∂T=kBT2CV\operatorname{Var}(E) = -\frac{\partial \langle E \rangle}{\partial \beta} = k_B T^2 \frac{\partial \langle E \rangle}{\partial T} = k_B T^2 C_V

Thermodynamic limit. For a macroscopic system with N∼1023N \sim 10^{23} particles, the relative energy fluctuation is:

Var⁡(E)⟨E⟩∼1N≈10−12\frac{\sqrt{\operatorname{Var}(E)}}{\langle E \rangle} \sim \frac{1}{\sqrt{N}} \approx 10^{-12}

This is the key result behind the equivalence of ensembles: in the thermodynamic limit (N→∞N \to \infty, V→∞V \to \infty, N/VN/V fixed), the canonical ensemble gives the same macroscopic predictions as the microcanonical ensemble, because the energy distribution becomes a delta function. The canonical ensemble is the one used in the standard equivalence proof: the relative fluctuations ∼1/N→0\sim 1/\sqrt{N} \to 0 justify replacing the fluctuating energy by its mean. See Statistical Foundations of Thermodynamics for the full argument.

Small systems. For nanoparticles or single-molecule experiments (N∼102N \sim 10^2–10610^6), the relative fluctuations are significant and the deterministic thermodynamic description breaks down. See NonequilibriumStatisticalMechanics for fluctuation theorems.

Connection to the grand canonical ensemble. The canonical energy fluctuation Var⁡(E)=kBT2CV\operatorname{Var}(E) = k_B T^2 C_V is the analogue of the grand-canonical particle-number fluctuation Var⁡(N)=kBT ∂μ⟨N⟩\operatorname{Var}(N) = k_B T\, \partial_\mu \langle N\rangle. Both express the same principle: the variance of the conserved quantity exchanged with the reservoir is proportional to the corresponding response function. See GrandCanonicalEnsemble.

Authoritative sources

Example problem

For the two-level system (E0=0E_0 = 0, E1=εE_1 = \varepsilon), compute Var⁡(E)\operatorname{Var}(E) and verify that it equals kBT2CVk_B T^2 C_V.

Solution ⟨E⟩=εeβε+1,⟨E2⟩=ε2eβε+1\langle E \rangle = \frac{\varepsilon}{e^{\beta\varepsilon}+1}, \qquad \langle E^2 \rangle = \frac{\varepsilon^2}{e^{\beta\varepsilon}+1}

(since E2=ε2E^2 = \varepsilon^2 when excited and 00 when in the ground state, so ⟨E2⟩=ε2P1=ε2/(eβε+1)\langle E^2 \rangle = \varepsilon^2 P_1 = \varepsilon^2/(e^{\beta\varepsilon}+1)).

Var⁡(E)=ε2eβε+1−ε2(eβε+1)2=ε2 eβε(eβε+1)2\operatorname{Var}(E) = \frac{\varepsilon^2}{e^{\beta\varepsilon}+1} - \frac{\varepsilon^2}{(e^{\beta\varepsilon}+1)^2} = \frac{\varepsilon^2\, e^{\beta\varepsilon}}{(e^{\beta\varepsilon}+1)^2}

Now CV=kB(βε)2eβε/(eβε+1)2C_V = k_B(\beta\varepsilon)^2 e^{\beta\varepsilon}/(e^{\beta\varepsilon}+1)^2, so:

kBT2CV=kBT2⋅kBβ2ε2eβε(eβε+1)2=ε2 eβε(eβε+1)2=Var⁡(E)✓k_B T^2 C_V = k_B T^2 \cdot k_B \beta^2 \varepsilon^2 \frac{e^{\beta\varepsilon}}{(e^{\beta\varepsilon}+1)^2} = \frac{\varepsilon^2\, e^{\beta\varepsilon}}{(e^{\beta\varepsilon}+1)^2} = \operatorname{Var}(E) \quad \checkmark

Quantum density-matrix formulation

For quantum systems, the canonical ensemble is expressed using the density matrix:

ρ=e−βH^Z,Z=Tr⁡(e−βH^)\rho = \frac{e^{-\beta \hat{H}}}{Z}, \qquad Z = \operatorname{Tr}(e^{-\beta \hat{H}})

The expectation value of any observable A^\hat{A} is:

⟨A⟩=Tr⁡(ρ A^)\langle A \rangle = \operatorname{Tr}(\rho\, \hat{A})
Details

From classical to quantum. In the classical canonical ensemble, microstates are points in phase space and P(α)P(\alpha) is a probability density. In quantum mechanics, the state is a density operator ρ\rho on Hilbert space. The classical Boltzmann weight e−βEαe^{-\beta E_\alpha} becomes the operator e−βH^e^{-\beta \hat{H}} (defined by the spectral decomposition of H^\hat{H}):

If H^∣n⟩=En∣n⟩\hat{H}|n\rangle = E_n|n\rangle, then e−βH^∣n⟩=e−βEn∣n⟩e^{-\beta\hat{H}}|n\rangle = e^{-\beta E_n}|n\rangle, and:

ρ=∑ne−βEnZ ∣n⟩⟨n∣\rho = \sum_n \frac{e^{-\beta E_n}}{Z}\,|n\rangle\langle n|

Expectation values. For any observable A^\hat{A}:

⟨A⟩=Tr⁡(ρ A^)=∑ne−βEnZ ⟨n∣A^∣n⟩\langle A \rangle = \operatorname{Tr}(\rho\, \hat{A}) = \sum_n \frac{e^{-\beta E_n}}{Z}\, \langle n|\hat{A}|n\rangle

This generalizes the classical ∑αPαAα\sum_\alpha P_\alpha A_\alpha to the quantum setting. In particular:

⟨E⟩=Tr⁡(ρ H^)=−∂ln⁡Z∂β\langle E \rangle = \operatorname{Tr}(\rho\, \hat{H}) = -\frac{\partial \ln Z}{\partial \beta}

Entropy. The von Neumann entropy S=−kBTr⁡(ρln⁡ρ)S = -k_B \operatorname{Tr}(\rho \ln \rho) reduces to the Gibbs entropy in the classical limit and equals kB(ln⁡Z+β⟨E⟩)k_B(\ln Z + \beta\langle E\rangle) for the canonical state.

Connection to quantum statistics. When the system consists of many indistinguishable particles, the trace in Z=Tr⁡(e−βH^)Z = \operatorname{Tr}(e^{-\beta\hat{H}}) is over the appropriate (symmetrized or antisymmetrized) many-body Hilbert space. This is where Fermi–Dirac and Bose–Einstein statistics enter naturally. See GrandCanonicalEnsemble for the quantum ideal gas and occupation-number formalism.

Authoritative sources

Example problem

A spin-12\tfrac{1}{2} particle in a magnetic field Bz^B\hat{z} has Hamiltonian H^=−μB σ^z\hat{H} = -\mu B\, \hat{\sigma}_z with eigenvalues E±=∓μBE_\pm = \mp \mu B. Write ρ\rho explicitly and compute ⟨σz⟩\langle \sigma_z \rangle.

Solution Z=eβμB+e−βμB=2cosh⁡(βμB)Z = e^{\beta\mu B} + e^{-\beta\mu B} = 2\cosh(\beta\mu B) ρ=12cosh⁡(βμB)(eβμB00e−βμB)\rho = \frac{1}{2\cosh(\beta\mu B)}\begin{pmatrix} e^{\beta\mu B} & 0 \\ 0 & e^{-\beta\mu B} \end{pmatrix} ⟨σz⟩=Tr⁡(ρ σz)=eβμB−e−βμB2cosh⁡(βμB)=tanh⁡(βμB)\langle \sigma_z \rangle = \operatorname{Tr}(\rho\, \sigma_z) = \frac{e^{\beta\mu B} - e^{-\beta\mu B}}{2\cosh(\beta\mu B)} = \tanh(\beta\mu B)

At T→0T \to 0: ⟨σz⟩→1\langle\sigma_z\rangle \to 1 (fully polarized). At T→∞T \to \infty: ⟨σz⟩→0\langle\sigma_z\rangle \to 0 (unpolarized). This is the basis of nuclear magnetic resonance (NMR) thermodynamics.

Example problem

A two-level system has ground state energy E0=0E_0 = 0 and excited state energy E1=εE_1 = \varepsilon. It is in contact with a heat bath at temperature TT. Find the partition function, mean energy, and heat capacity, and identify the Schottky anomaly.

Solution

At T→0T \to 0: ⟨E⟩→0\langle E\rangle \to 0, CV→0C_V \to 0 (ground state frozen). At T→∞T \to \infty: ⟨E⟩→ε/2\langle E\rangle \to \varepsilon/2, CV→0C_V \to 0 (equipartition between two levels).

The Schottky anomaly: CVC_V peaks at T≈0.417 ε/kBT \approx 0.417\,\varepsilon/k_B (equivalently βε≈2.399\beta\varepsilon \approx 2.399), with peak value CVmax⁡≈0.439 kBC_V^{\max} \approx 0.439\, k_B. This is a hallmark of any system with a finite number of energy levels and is observed in real materials (e.g., paramagnetic salts, molecular crystals) as a characteristic bump in the low-temperature heat capacity.

How this fits together

The canonical ensemble is the microcanonical ensemble with a heat bath added: the reservoir fixes TT (the entropy slope), and the Boltzmann factor e−βEe^{-\beta E} weights microstates. The partition function ZZ is the generating function for all thermodynamic quantities: energy, entropy, pressure, and chemical potential all follow by differentiation.

Equivalence of ensembles. The canonical ensemble is the one used in the standard thermodynamic-limit equivalence proof: the relative energy fluctuations scale as 1/N→01/\sqrt{N} \to 0, so the canonical and microcanonical ensembles give identical macroscopic predictions for large systems. This justifies using the simpler canonical formalism (fixed TT rather than fixed EE) for all practical equilibrium calculations.

Adding particle exchange to the heat bath gives the grand canonical ensemble, where the partition function is replaced by the grand partition function Ξ\Xi. See MicrocanonicalEnsemble for the isolated limit, GrandCanonicalEnsemble for the open-system generalization, and PhaseTransitions for non-analyticities in FF at critical points.