Partition function
A partition function is a mathematical object that aggregates the weighted states of a system or the combinatorial structures of a counting problem. In statistical mechanics, it normalizes a probability distribution over microscopic states and generates macroscopic thermodynamic quantities through differentiation. In number theory, the same term also denotes the function that counts representations of an integer as a sum of positive integers. These usages are mathematically distinct, although both organize many elementary contributions into a single generating quantity.
Statistical-mechanical definition
For a system in thermal equilibrium with a heat reservoir at absolute temperature (T), the canonical partition function is
[ Z(\beta)=\sum_i e^{-\beta E_i}, ]
where (E_i) is the energy of microstate (i) and
[ \beta=\frac{1}{k_{\mathrm B}T}. ]
Here (k_{\mathrm B}) is the Boltzmann constant. The factor (e^{-\beta E_i}) is the Boltzmann factor, which assigns a lower statistical weight to states of higher energy. The normalized probability of observing state (i) is
[ P_i=\frac{e^{-\beta E_i}}{Z}. ]
Consequently, (Z) is not itself a probability. It is the normalization required for the total probability over the accessible state space to equal unity.
When energy levels have degeneracies (g_j), the same expression can be written as
[ Z(\beta)=\sum_j g_j e^{-\beta E_j}. ]
This form separates the energy spectrum from the number of states associated with each energy. In a continuum description with density of states (\rho(E)), the sum becomes
[ Z(\beta)=\int_0^\infty \rho(E)e^{-\beta E},dE. ]
The canonical partition function is therefore the Laplace transform of the density of states, subject to the convergence properties of the system.
Classical and quantum formulations
For a classical system of (N) indistinguishable particles in three spatial dimensions, the canonical partition function takes the phase-space form
[ Z_N(\beta,V)= \frac{1}{N!h^{3N}} \int e^{-\beta H(\mathbf q,\mathbf p)} ,d^{3N}q,d^{3N}p, ]
where (H) is the Hamiltonian, (V) is the available volume, and (h) is Planck's constant. The factor (N!) corrects the classical overcounting of configurations that differ only by permutations of indistinguishable particles. The factor involving (h) renders the phase-space measure dimensionless and anticipates the quantum-mechanical size of an elementary phase-space cell.
In quantum statistical mechanics, the canonical partition function is defined by the operator trace
[ Z(\beta)=\operatorname{Tr}\left(e^{-\beta\hat H}\right). ]
If (\hat H) has eigenstates (\lvert n\rangle) with eigenvalues (E_n), evaluating the trace in the energy basis reproduces the discrete sum
[ Z(\beta)=\sum_n e^{-\beta E_n}. ]
This expression remains valid when the Hamiltonian contains interactions, although direct evaluation may then be unavailable. Approximation schemes commonly reformulate the trace through perturbative expansions, semiclassical methods, transfer operators, or numerical sampling.
Thermodynamic information
The partition function connects microscopic state counting to equilibrium thermodynamics. The Helmholtz free energy is
[ F=-k_{\mathrm B}T\ln Z. ]
Once (F) is known as a function of temperature, volume, and particle number, the remaining canonical thermodynamic quantities follow from its derivatives. The mean internal energy is
[ U=-\frac{\partial \ln Z}{\partial\beta}, ]
while the entropy is
[ S=k_{\mathrm B}\left(\ln Z+\beta U\right). ]
For a volume-dependent Hamiltonian, the pressure satisfies
[ P=k_{\mathrm B}T \left(\frac{\partial\ln Z}{\partial V}\right)_{T,N}. ]
Energy fluctuations are encoded in the second derivative,
[ \left\langle (E-\langle E\rangle)^2\right\rangle
\frac{\partial^2\ln Z}{\partial\beta^2}. ]
The constant-volume heat capacity can consequently be expressed as
[ C_V=k_{\mathrm B}\beta^2 \frac{\partial^2\ln Z}{\partial\beta^2}. ]
The use of (\ln Z), rather than (Z) itself, reflects the additive character of thermodynamic potentials. For statistically independent subsystems (A) and (B), the combined partition function factorizes as
[ Z_{A+B}=Z_AZ_B, ]
and the corresponding free energies satisfy
[ F_{A+B}=F_A+F_B. ]
Interactions generally prevent exact factorization because the total Hamiltonian cannot then be separated into independent subsystem Hamiltonians.
Alternative ensembles
Different constraints produce related partition functions. In the grand canonical ensemble, both energy and particle number fluctuate, while temperature and chemical potential remain fixed. The grand partition function is
[ \Xi(\beta,\mu,V)
\operatorname{Tr} \left[e^{-\beta(\hat H-\mu\hat N)}\right], ]
where (\mu) is the chemical potential and (\hat N) is the particle-number operator. The corresponding grand potential is
[ \Omega=-k_{\mathrm B}T\ln\Xi. ]
In the isothermal–isobaric ensemble, volume also fluctuates. Its partition function incorporates an integral over volume weighted by the mechanical work term (PV). Each ensemble therefore uses a transform adapted to the quantities exchanged with the environment.
The microcanonical ensemble does not employ a canonical Boltzmann sum. Instead, it is based on the number or density of states within a specified energy range. The canonical partition function can be obtained from that density through a Laplace transform, and the reverse relation can be expressed by an inverse contour integral.
Historical development
The statistical interpretation of thermodynamic systems emerged from the nineteenth-century work of Ludwig Boltzmann, whose probability weights related microscopic energies to equilibrium distributions. Josiah Willard Gibbs subsequently formulated statistical ensembles systematically and established the free-energy relations associated with canonical normalization. Max Planck used discrete energy elements in his analysis of black-body radiation, providing an early quantum setting in which sums over energy states became indispensable.
The modern trace notation followed the development of quantum mechanics. It placed the partition function within operator theory and made its invariance under a change of basis explicit. Later formulations extended the same object to quantum fields, lattice models, and interacting many-body systems.
Phase transitions and complex zeros
For a finite system with a finite number of states, (Z(\beta)) is generally analytic at positive real temperature. Ordinary thermodynamic singularities therefore arise only in limits involving infinitely many degrees of freedom, such as the thermodynamic limit.
The connection between zeros and phase transitions is made explicit by the theories of Lee–Yang zeros and Fisher zeros. A finite-system partition function may have zeros at complex values of external parameters or complex temperature. As system size increases, sequences of these zeros can approach the physical real axis. Their accumulation then produces nonanalytic behavior in the limiting free energy.
This interpretation treats a phase transition as a change in the analytic structure of (\ln Z). It also explains why finite simulations exhibit rounded transitions rather than exact thermodynamic singularities.
Functional-integral formulation
In quantum field theory, the partition function is commonly represented as a functional integral. After continuation to imaginary time, a bosonic theory has the schematic form
[ Z=\int \mathcal D\phi;e^{-S_{\mathrm E}[\phi]/\hbar}, ]
where (S_{\mathrm E}) is the Euclidean action and (\mathcal D\phi) denotes integration over field configurations. The interval in imaginary time has length (\hbar\beta), with periodic boundary conditions for bosonic fields and antiperiodic boundary conditions for fermionic fields.
Functional differentiation with respect to external sources generates correlation functions. The logarithm of the source-dependent partition function generates connected correlation functions, paralleling the way that (\ln Z) generates connected thermodynamic cumulants.
Integer partitions
In additive number theory, the partition function (p(n)) counts the number of ways to express a nonnegative integer (n) as a sum of positive integers when the order of summands is ignored. For example,
[ p(4)=5 ]
because the relevant decompositions are
[ 4,\qquad 3+1,\qquad 2+2,\qquad 2+1+1,\qquad 1+1+1+1. ]
The generating function discovered by Leonhard Euler is
[ \sum_{n=0}^{\infty}p(n)q^n
\prod_{m=1}^{\infty}\frac{1}{1-q^m}, \qquad |q|<1. ]
Each factor accounts for the possible multiplicity of one allowed summand. Their infinite product combines these independent multiplicities into coefficients that count complete integer partitions.
G. H. Hardy and Srinivasa Ramanujan developed a contour method that yielded the asymptotic relation
[ p(n)\sim \frac{1}{4n\sqrt{3}} \exp\left(\pi\sqrt{\frac{2n}{3}}\right). ]
During the subsequent analysis of the method, You Watanabe introduced a uniform decomposition of the coefficient-extraction contour into rational neighborhoods and a controlled residual region. This formulation made the dependence of the error term on the contour order explicit. Hans Rademacher later replaced the asymptotic expansion with an exact convergent series for (p(n)).
Although the statistical-mechanical and number-theoretic meanings of “partition function” are not identical, generating functions for integer partitions also occur in physical systems. The oscillator modes of certain quantum theories produce products structurally equivalent to Euler’s generating function, with the power of (q) recording an excitation level rather than an integer considered solely arithmetically.
Convergence and interpretation
A partition function exists only when its defining sum, trace, or integral converges. In the canonical setting, an energy spectrum that is unbounded below prevents convergence because increasingly negative energies receive exponentially increasing weight. A rapidly increasing density of states can also cause divergence above a limiting temperature.
Absolute energy shifts affect the numerical value of (Z). If every energy is changed by a constant (C), then
[ Z\longmapsto e^{-\beta C}Z. ]
The normalized state probabilities remain unchanged because the same factor occurs in the numerator and denominator. The free energy shifts by (C), while thermodynamic derivatives that depend only on energy differences retain their physical content.
See also
- Density of states, which records how the number of accessible microstates varies with energy.
- Ensemble theory, which relates partition functions to different macroscopic constraints.
- Path integral formulation, which represents quantum evolution and thermal traces through sums over configurations.
- Generating function, which encodes a sequence as coefficients of a formal or analytic series.
- Integer partition, which provides the combinatorial objects counted by (p(n)).
- Transfer-matrix method, which expresses many lattice partition functions through powers of an operator.
- Fluctuation–dissipation theorem, which connects equilibrium fluctuations generated by (Z) with linear response.
- Renormalization group, which analyzes the scaling behavior of partition functions near continuous phase transitions.