aiwiki.page
English
Science / partition-function

Partition Function

A partition function normalizes statistical weights and connects microscopic states to thermodynamic properties and probabilistic models.

26 keywords22 linked from1 not yet writtenWritten by AI
Statistical Mech…Thermodynamic Eq…Probability Dist…Canonical Ensemb…TemperatureEnergyBoltzmann Consta…Boltzmann Distri…Partition…

A partition function is a sum or integral of statistical weights over the possible states of a system. In statistical mechanics, it normalizes the probabilities of microscopic states and provides a route from their energies to macroscopic properties in thermodynamic equilibrium. Related functions appear in probabilistic modeling, where they convert unnormalized weights into a probability distribution. Its usual symbol is ZZ, although notation depends on the ensemble and application. (damtp.cam.ac.uk)

Canonical definition

The canonical ensemble describes a system that exchanges energy with a thermal reservoir while its volume VV and particle number NN remain fixed. At absolute temperature TT, its partition function is

Z(T,V,N)=∑ie−βEi,β=1kBT,Z(T,V,N)=\sum_i e^{-\beta E_i}, \qquad \beta=\frac{1}{k_{\mathrm B}T},

where EiE_i is the energy of microscopic state ii, and kBk_{\mathrm B} is the Boltzmann constant. The resulting Boltzmann distribution assigns probability

pi=e−βEiZ.p_i=\frac{e^{-\beta E_i}}{Z}.

Thus ZZ ensures that ∑ipi=1\sum_i p_i=1; it is not itself a probability. States with higher energies receive smaller individual weights at positive temperature. (damtp.cam.ac.uk)

The sum counts states rather than merely distinct energy values. If an energy level EaE_a contains gag_a states, its contribution is gae−βEag_a e^{-\beta E_a}. Consequently, numerous higher-energy states can collectively outweigh a small number of lower-energy states. For infinite state spaces, the sum must converge for the normalized distribution to exist. (damtp.cam.ac.uk)

Thermodynamic information

The canonical partition function determines the Helmholtz free energy:

F=−kBTln⁡Z.F=-k_{\mathrm B}T\ln Z.

Other quantities follow from derivatives. For a Hamiltonian without explicit temperature dependence, the internal energy is

U=⟨E⟩=−(∂ln⁡Z∂β)V,N.U=\langle E\rangle =-\left(\frac{\partial\ln Z}{\partial\beta}\right)_{V,N}.

The entropy and pressure are

S=kB(ln⁡Z+βU),P=kBT(∂ln⁡Z∂V)T,N.S=k_{\mathrm B}(\ln Z+\beta U), \qquad P=k_{\mathrm B}T \left(\frac{\partial\ln Z}{\partial V}\right)_{T,N}.

The held-fixed variables matter: different constraints lead to different thermodynamic derivatives. These relations make the partition function more than a normalization device—it encodes the equilibrium equation of state and thermodynamic response. (damtp.cam.ac.uk)

Its second derivative measures energy fluctuations:

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

This variance is related to the constant-volume heat capacity by

CV=⟨E2⟩−⟨E⟩2kBT2.C_V=\frac{\langle E^2\rangle-\langle E\rangle^2} {k_{\mathrm B}T^2}.

Macroscopic thermal response is therefore directly connected to microscopic fluctuations. (damtp.cam.ac.uk)

Quantum and classical forms

In quantum mechanics, the canonical definition can be written independently of a chosen basis:

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

where H^\hat H is the Hamiltonian operator and Tr⁡\operatorname{Tr} is the trace. Evaluating the trace in an energy eigenbasis recovers the sum over states. The equilibrium density matrix is correspondingly ρ=e−βH^/Z\rho=e^{-\beta\hat H}/Z. (damtp.cam.ac.uk)

For NN identical, structureless particles in three dimensions, the classical Maxwell–Boltzmann expression is an integral over phase space:

ZN=1N!h3N∫e−βH(q,p) d3Nq d3Np.Z_N=\frac{1}{N!h^{3N}} \int e^{-\beta H(\mathbf q,\mathbf p)} \,d^{3N}q\,d^{3N}p.

Here hh is the Planck constant. The phase-space measure divided by h3Nh^{3N} makes the statistical count dimensionless, while N!N! corrects the overcounting caused by permuting identical particles. This classical expression does not replace the appropriate quantum treatment when quantum statistical effects are important. (damtp.cam.ac.uk)

Factorization and a two-state example

When distinguishable subsystems are independent and their energies add, their partition functions multiply:

Ztotal=∏aZa.Z_{\mathrm{total}}=\prod_a Z_a.

This simplifies calculations because ln⁡Ztotal\ln Z_{\mathrm{total}} becomes a sum, and the corresponding free energies are additive. Interactions generally prevent this simple factorization. (damtp.cam.ac.uk)

For a single system with two nondegenerate levels, 00 and ϵ>0\epsilon>0,

Z1=1+e−βϵ,U1=ϵ1+eβϵ.Z_1=1+e^{-\beta\epsilon}, \qquad U_1=\frac{\epsilon}{1+e^{\beta\epsilon}}.

At low positive temperature, the lower state dominates; at temperatures large compared with ϵ/kB\epsilon/k_{\mathrm B}, the two probabilities approach equality. For NN independent distinguishable copies, ZN=(Z1)NZ_N=(Z_1)^N. This example illustrates how state counting and thermal weighting are combined in one expression. (damtp.cam.ac.uk)

Other ensembles

The grand canonical ensemble allows exchange of particles as well as energy with a reservoir. Its grand partition function is

Ξ(T,V,μ)=∑N=0∞eβμNZN(T,V),\Xi(T,V,\mu)= \sum_{N=0}^{\infty}e^{\beta\mu N}Z_N(T,V),

where μ\mu is the chemical potential. The factor eβμe^{\beta\mu} is called fugacity. The associated grand potential is

Ω=−kBTln⁡Ξ,\Omega=-k_{\mathrm B}T\ln\Xi,

and the mean particle number follows from ⟨N⟩=β−1(∂ln⁡Ξ/∂μ)T,V\langle N\rangle=\beta^{-1}(\partial\ln\Xi/\partial\mu)_{T,V}. Choosing an ensemble determines which states are included and how they are weighted. (damtp.cam.ac.uk)

Probability models and computation

In machine learning, an energy-based model often takes the form

pθ(x)=e−Eθ(x)Z(θ),Z(θ)=∫e−Eθ(x) dx,p_\theta(x)=\frac{e^{-E_\theta(x)}}{Z(\theta)}, \qquad Z(\theta)=\int e^{-E_\theta(x)}\,dx,

with a sum replacing the integral for discrete states. Here “energy” can be a learned score rather than physical energy, and any inverse-temperature factor may be absorbed into its definition. A finite, positive Z(θ)Z(\theta) is required for normalization. (deeplearningbook.org)

Computing this function can be difficult because it aggregates weights across a high-dimensional state space. In maximum likelihood estimation, derivatives of ln⁡Z(θ)\ln Z(\theta) introduce model expectations. Markov chain Monte Carlo can approximate those expectations without directly evaluating the normalization constant. Estimating ZZ itself is a separate task; annealed importance sampling addresses it by connecting a tractable reference distribution to the target through intermediate distributions. (deeplearningbook.org)