Fiveable

🎲Statistical Mechanics Unit 1 Review

QR code for Statistical Mechanics practice questions

1.7 Partition functions

1.7 Partition functions

Written by the Fiveable Content Team • Last updated August 2025
Written by the Fiveable Content Team • Last updated August 2025
🎲Statistical Mechanics
Unit & Topic Study Guides

Definition of partition function

The partition function encodes everything about a system in thermal equilibrium into a single mathematical object. Once you have it, you can extract nearly any thermodynamic quantity you need. That's why it sits at the center of statistical mechanics.

Think of it this way: a system can exist in many different microstates, each with its own energy. The partition function tells you how the system's probability is "partitioned" among those states. The name literally comes from this idea of dividing up probability.

Microscopic vs macroscopic states

A microstate is one specific configuration of all the particles in a system. For a gas, that means every particle's position and momentum pinned down exactly. A macrostate describes the bulk properties you can actually measure: temperature, pressure, volume.

Here's the key connection: many different microstates can correspond to the same macrostate. The partition function sums over all microstates, and from that sum you recover macroscopic properties. Boltzmann's entropy formula, S=klnΩS = k \ln \Omega, captures this directly: entropy depends on Ω\Omega, the number of microstates consistent with a given macrostate.

Boltzmann factor

The Boltzmann factor gives the relative probability of finding a system in a microstate with energy EiE_i:

eEi/kTe^{-E_i / kT}

where kk is Boltzmann's constant and TT is the absolute temperature.

  • At high TT, the exponential flattens out, so many states become roughly equally probable.
  • At low TT, the exponential drops steeply, so the system strongly favors low-energy states.

This factor is the building block of the entire partition function. Every thermodynamic average you compute in the canonical ensemble involves weighting by Boltzmann factors.

Normalization constant

The partition function itself is the normalization constant. To turn Boltzmann factors into actual probabilities, you need them to sum to 1. That sum is ZZ:

Z=ieEi/kTZ = \sum_i e^{-E_i / kT}

The probability of microstate ii is then:

Pi=eEi/kTZP_i = \frac{e^{-E_i / kT}}{Z}

ZZ depends on the system's parameters (temperature, volume, particle number), and its value changes as those parameters change. Despite being "just" a normalization constant, ZZ contains all the thermodynamic information about the system.

Properties of partition functions

Partition functions have mathematical properties that make complex systems tractable. The most important ones let you break a complicated system into simpler pieces.

Additivity

If a system can be in one of several mutually exclusive configurations (like a particle that can be in subsystem A or subsystem B, but not both), the partition functions add:

Ztotal=Z1+Z2++ZnZ_{\text{total}} = Z_1 + Z_2 + \cdots + Z_n

This applies when the subsystems represent alternative states of the same entity. It's less commonly used than multiplicativity, but it shows up when you're summing over distinct groups of microstates.

Multiplicativity

This is the property you'll use constantly. When a system consists of independent, distinguishable subsystems (where each subsystem's energy doesn't depend on the others), the total partition function is the product:

Ztotal=Z1×Z2××ZnZ_{\text{total}} = Z_1 \times Z_2 \times \cdots \times Z_n

For example, a diatomic molecule has translational, rotational, vibrational, and electronic degrees of freedom that are approximately independent. So you can write:

Zmolecule=ZtransZrotZvibZelecZ_{\text{molecule}} = Z_{\text{trans}} \cdot Z_{\text{rot}} \cdot Z_{\text{vib}} \cdot Z_{\text{elec}}

This factorization is what makes most partition function calculations feasible. Without it, you'd have to enumerate every combined state of the whole system.

Connection to thermodynamic quantities

Once you have ZZ, thermodynamic quantities follow from derivatives of lnZ\ln Z. Using β=1/kT\beta = 1/kT:

  • Helmholtz free energy: F=kTlnZF = -kT \ln Z
  • Internal energy: U=lnZβU = -\frac{\partial \ln Z}{\partial \beta}
  • Entropy: S=klnZ+UTS = k \ln Z + \frac{U}{T}
  • Pressure: P=kTlnZVP = kT \frac{\partial \ln Z}{\partial V}

From these you can derive heat capacities, equations of state, and other relations. The pattern is always the same: take appropriate derivatives of lnZ\ln Z.

Canonical partition function

The canonical ensemble describes a system with a fixed number of particles NN, fixed volume VV, and fixed temperature TT. The system exchanges energy (but not particles) with a large heat bath.

Derivation from microcanonical ensemble

The derivation proceeds in a few steps:

  1. Start with an isolated total system (system + heat bath) described by the microcanonical ensemble, where total energy is fixed.
  2. Allow the small subsystem to exchange energy with the much larger heat bath.
  3. The probability of the subsystem having energy EiE_i is proportional to the number of microstates available to the bath when the subsystem is in state ii. Since the bath is large, you can expand its entropy to first order, which yields the Boltzmann factor eEi/kTe^{-E_i / kT}.
  4. Sum over all microstates (including degeneracies) to get the canonical partition function:

Z=igieEi/kTZ = \sum_i g_i \, e^{-E_i / kT}

Here gig_i is the degeneracy of energy level ii (the number of distinct microstates sharing that energy).

Relation to Helmholtz free energy

The Helmholtz free energy is:

F=kTlnZF = -kT \ln Z

This is one of the most important equations in statistical mechanics. FF is the thermodynamic potential natural to the canonical ensemble (constant N,V,TN, V, T), and at equilibrium, FF is minimized. All other canonical thermodynamic quantities can be obtained by differentiating FF with respect to TT, VV, or NN.

Applications in statistical mechanics

The canonical ensemble is the workhorse of equilibrium statistical mechanics. Common applications include:

  • Ideal gases: Deriving the equation of state and energy distribution
  • Crystalline solids: Computing heat capacities (Einstein and Debye models)
  • Magnetic systems: Calculating magnetization and susceptibility of spin systems
  • Phase transitions: Analyzing order-disorder transitions and critical behavior

It also serves as the starting point for constructing other ensembles (grand canonical, isothermal-isobaric).

Microscopic vs macroscopic states, Statistical Interpretation of Entropy and the Second Law of Thermodynamics: The Underlying ...

Grand canonical partition function

The grand canonical ensemble describes an open system that exchanges both energy and particles with a reservoir. The system has fixed TT, VV, and chemical potential μ\mu, but NN and EE fluctuate.

The grand canonical partition function is:

Ξ=N=0ieβ(Ei(N)μN)\Xi = \sum_{N=0}^{\infty} \sum_i e^{-\beta(E_i(N) - \mu N)}

where the outer sum runs over all possible particle numbers and the inner sum runs over all microstates at each NN.

Chemical potential

The chemical potential μ\mu is the free energy cost of adding one particle to the system. It controls particle flow: particles move from regions of high μ\mu to regions of low μ\mu until equilibrium is reached.

  • In a system at equilibrium with a reservoir, μ\mu is set by the reservoir.
  • For multi-component systems, each species has its own chemical potential.
  • μ\mu plays the same role for particle number that TT plays for energy: it's the intensive variable conjugate to NN.

Relation to grand potential

The grand potential Ω\Omega is the natural thermodynamic potential for the grand canonical ensemble:

Ω=kTlnΞ\Omega = -kT \ln \Xi

This is analogous to F=kTlnZF = -kT \ln Z in the canonical ensemble. For a simple fluid, Ω=PV\Omega = -PV, which gives you the equation of state directly. Equilibrium in an open system corresponds to minimizing Ω\Omega at fixed TT, VV, and μ\mu.

Applications in open systems

The grand canonical ensemble is the natural choice whenever particle number isn't fixed:

  • Adsorption: Modeling gas molecules binding to surfaces (Langmuir isotherm)
  • Quantum gases: Deriving Fermi-Dirac and Bose-Einstein distributions (since occupation numbers fluctuate)
  • Chemical equilibria: Analyzing reactions where species are created and destroyed
  • Electrons in solids: Treating conduction electrons in metals and semiconductors

Partition functions for quantum systems

Quantum mechanics changes the rules for counting microstates. Energy levels are discrete, and identical particles are fundamentally indistinguishable. Both of these features directly affect how you construct partition functions.

Distinguishable vs indistinguishable particles

Classical statistical mechanics treats particles as distinguishable: swapping two particles creates a "new" microstate. Quantum mechanics says identical particles (two electrons, two photons, etc.) are truly indistinguishable: swapping them does not create a new state.

For NN indistinguishable, non-interacting particles, the naive classical partition function overcounts by N!N!, so you divide it out:

Zcorrected=Z1NN!Z_{\text{corrected}} = \frac{Z_1^N}{N!}

This is the origin of the Gibbs factor 1/N!1/N!. At low temperatures or high densities, even this correction isn't enough, and you need the full quantum treatment below.

Fermi-Dirac statistics

Fermions have half-integer spin (electrons, protons, neutrons) and obey the Pauli exclusion principle: at most one fermion per quantum state.

The mean occupation number of a single-particle state with energy ϵ\epsilon is:

f(ϵ)=1e(ϵμ)/kT+1f(\epsilon) = \frac{1}{e^{(\epsilon - \mu)/kT} + 1}

At T=0T = 0, this becomes a step function: all states below the Fermi energy μ0\mu_0 are filled, and all states above are empty. This explains why electrons in metals fill up energy levels from the bottom, producing a "Fermi sea." Fermi-Dirac statistics also governs electron degeneracy pressure in white dwarf stars.

Bose-Einstein statistics

Bosons have integer spin (photons, phonons, 4He^4\text{He} atoms) and have no restriction on how many can share a state.

The mean occupation number is:

f(ϵ)=1e(ϵμ)/kT1f(\epsilon) = \frac{1}{e^{(\epsilon - \mu)/kT} - 1}

Notice the only difference from Fermi-Dirac is the minus sign in the denominator. This allows macroscopic occupation of the ground state at low temperatures, leading to Bose-Einstein condensation. The same statistics describes the Planck distribution for blackbody radiation (where μ=0\mu = 0 for photons) and phonon contributions to heat capacity in solids.

Calculation techniques

Evaluating partition functions analytically is only possible for a handful of simple systems. For everything else, you need approximation methods.

Summation methods

When energy levels are discrete and manageable:

  • Direct summation works for systems with a small number of states (e.g., a spin-1/2 particle in a magnetic field has just two terms).
  • Geometric series apply when energy levels are equally spaced, as in the quantum harmonic oscillator: Z=n=0eβ(n+1/2)ωZ = \sum_{n=0}^{\infty} e^{-\beta(n+1/2)\hbar\omega} sums to a closed form.
  • Generating functions and recurrence relations help for more complex level structures or systems with degeneracies.

Integral approximations

When energy levels are closely spaced (high temperatures, large systems), you can replace the sum with an integral:

Zg(ϵ)eβϵdϵZ \approx \int g(\epsilon) \, e^{-\beta \epsilon} \, d\epsilon

where g(ϵ)g(\epsilon) is the density of states. This is how you derive the classical partition function for an ideal gas. The Euler-Maclaurin formula provides systematic corrections when the sum-to-integral conversion isn't exact.

Microscopic vs macroscopic states, Maxwell-Boltzmann Distribution in Solids

Saddle-point approximation

For large systems, partition function integrals often have the form eNf(x)dx\int e^{N f(x)} dx, where NN is huge. The integrand is sharply peaked, so you can expand f(x)f(x) to second order around its maximum (the "saddle point") and do a Gaussian integral.

This method:

  • Becomes exact in the thermodynamic limit (NN \to \infty)
  • Is equivalent to finding the most probable macrostate
  • Is the mathematical basis for why thermodynamic fluctuations are negligible in large systems

Applications of partition functions

Ideal gas

For NN non-interacting particles in a box of volume VV, the single-particle translational partition function is:

Z1=Vλ3Z_1 = \frac{V}{\lambda^3}

where λ=2π2mkT\lambda = \sqrt{\frac{2\pi\hbar^2}{mkT}} is the thermal de Broglie wavelength. For NN indistinguishable particles:

Z=Z1NN!=1N!(Vλ3)NZ = \frac{Z_1^N}{N!} = \frac{1}{N!}\left(\frac{V}{\lambda^3}\right)^N

From this you recover the ideal gas law PV=NkTPV = NkT, the internal energy U=32NkTU = \frac{3}{2}NkT, and the Sackur-Tetrode equation for entropy.

Paramagnetic systems

Consider NN non-interacting spin-1/2 particles in an external magnetic field BB. Each spin has two states with energies ±μBB\pm \mu_B B. The single-spin partition function is:

Z1=2cosh(μBBkT)Z_1 = 2\cosh\left(\frac{\mu_B B}{kT}\right)

This leads to the Curie law for magnetic susceptibility: χ=C/T\chi = C/T, where CC is the Curie constant. At high temperatures, thermal fluctuations randomize the spins and the magnetization drops. At low temperatures, spins align with the field.

Quantum harmonic oscillator

The energy levels are En=(n+12)ωE_n = (n + \frac{1}{2})\hbar\omega for n=0,1,2,n = 0, 1, 2, \ldots The partition function sums as a geometric series:

Z=eβω/21eβωZ = \frac{e^{-\beta\hbar\omega/2}}{1 - e^{-\beta\hbar\omega}}

This result is the foundation for the Einstein model of heat capacity in solids. At high TT, each oscillator contributes kTkT to the energy (recovering the classical equipartition result). At low TT, the energy and heat capacity drop toward zero because the quantum energy gap ω\hbar\omega becomes hard to excite thermally. The Debye model extends this by treating a solid as a collection of oscillators with a spectrum of frequencies.

Limitations and extensions

Non-equilibrium systems

The entire partition function framework assumes the system is in thermal equilibrium. For systems driven out of equilibrium (biological processes, turbulent flows, systems under external driving), ZZ as defined above doesn't apply. Active areas of research include:

  • Fluctuation theorems (Jarzynski equality, Crooks theorem) that relate non-equilibrium work to equilibrium free energy differences
  • Stochastic thermodynamics for small systems where fluctuations are significant
  • Time-dependent generalizations for systems in steady states

Interacting particles

Most real systems have interactions between particles, and these make the partition function extremely difficult to evaluate. The sum (or integral) no longer factorizes into single-particle contributions.

  • Cluster expansions and virial expansions systematically account for pair interactions, triple interactions, etc.
  • Mean-field theory replaces the effect of all other particles on a given particle with an average field, making the problem tractable at the cost of ignoring fluctuations.
  • Renormalization group methods handle the diverging correlation lengths near phase transitions, where mean-field theory breaks down.

Complex systems

Some systems push beyond standard statistical mechanics entirely:

  • Disordered systems (spin glasses) require replica methods or cavity methods to handle quenched randomness.
  • Systems with long-range interactions can violate extensivity, motivating generalized entropy measures like Tsallis entropy.
  • Network and information-theoretic approaches are being developed for systems where the standard energy-based framework is insufficient.

Computational methods

Monte Carlo simulations

Monte Carlo methods estimate thermodynamic averages by stochastic sampling rather than exhaustive enumeration.

  1. Start from some initial configuration.
  2. Propose a random change (e.g., flip a spin, move a particle).
  3. Accept or reject the change based on the Boltzmann weight (this is the Metropolis algorithm).
  4. Repeat many times; after equilibration, sample configurations represent the canonical distribution.

This approach scales well to large systems and handles interactions naturally. Advanced variants like parallel tempering (running simulations at multiple temperatures) and Wang-Landau sampling (estimating the density of states directly) improve sampling in systems with rough energy landscapes.

Molecular dynamics

Molecular dynamics (MD) solves Newton's equations of motion numerically for a system of interacting particles. Unlike Monte Carlo, MD gives you real-time dynamics, so you can compute time-dependent properties like diffusion coefficients and viscosities.

  • Classical MD uses empirical force fields.
  • Ab initio MD computes forces from electronic structure calculations at each time step.
  • Path integral MD incorporates quantum effects by representing each particle as a ring polymer of classical beads.

Density functional theory

Density functional theory (DFT) is a quantum mechanical method that determines electronic structure from the electron density rather than the full many-body wavefunction. While DFT is primarily a ground-state method, it provides the potential energy surfaces needed to construct partition functions for molecules and materials. It's the standard tool for computing molecular energies, geometries, and vibrational frequencies that feed into statistical mechanical calculations.