The Molecular Partition Function

Imagine a flask of gas at room temperature, every molecule bouncing between translational, rotational, and vibrational states. How do we count which states matter without tracking 102310^{23} individual molecules? The molecular partition function qq answers exactly this question. It packages the Boltzmann distribution into one number that tells us how many states are thermally accessible at a given temperature. This idea matters because qq is the bridge between quantum mechanical energy levels and bulk thermodynamic properties. Once you know qq, you can compute internal energy, entropy, heat capacity, and equilibrium constants — all without ever solving the Schrödinger equation for the whole system. It is the single most useful quantity in statistical thermodynamics. This article defines qq rigorously as a sum over states. It shows why qq is really a normalization constant hiding inside the Boltzmann distribution. It works two full numerical examples: a two-level system and a real vibrational mode. It closes with limiting cases, a historical note, and a compact exam sheet.

Key takeaways
  • The molecular partition function is q=∑igie−εi/kBTq = \sum_i g_i e^{-\varepsilon_i/k_BT}, summing Boltzmann factors over all energy levels.
  • qq is the normalization constant that makes the Boltzmann populations pip_i sum to one.
  • At T→0T \to 0, q→g0q \to g_0 (only the ground state matters); as T→∞T \to \infty, q→∞q \to \infty (all states become accessible).
  • qq depends only on the energy level spacings relative to kBTk_BT, not on absolute energy zero conventions, provided you are consistent.
  • Degeneracy gig_i must be included explicitly — forgetting it is the most common computational error.
  • Key idea: qq counts the number of states effectively "switched on" at temperature TT, and it is the denominator that turns raw Boltzmann factors into true probabilities.
The core insight

The molecular partition function qq is defined as the sum of Boltzmann factors over every accessible quantum state of a single molecule; it is simultaneously the normalization constant required to make the Boltzmann distribution a genuine probability distribution and a running tally of how many states are thermally "in play" at temperature TT.

The physical picture

Recall the Boltzmann distribution: the probability of finding a molecule in a state with energy εi\varepsilon_i is proportional to e−εi/kBTe^{-\varepsilon_i/k_BT}. But "proportional to" is not a probability — probabilities must sum to one. Something has to divide the exponential term so that the total comes out right. That something is the molecular partition function, qq. Think of qq as a weighted head-count of states. Each state contributes a Boltzmann factor e−εi/kBTe^{-\varepsilon_i/k_BT}, which equals 1 for the ground state (taking ε0=0\varepsilon_0 = 0) and shrinks toward zero for states far above kBTk_BT in energy. Summing these contributions over all states gives a number that behaves like an effective count of "how many states a molecule can realistically occupy" at that temperature. If q≈1q \approx 1, essentially only the ground state is populated. If q≈1000q \approx 1000, roughly a thousand states are thermally competitive. Crucially, qq is defined for a single molecule's set of quantum states — translational, rotational, vibrational, electronic — before we worry about how those degrees of freedom combine. The levels can be non-degenerate or degenerate; degeneracy gig_i simply means several distinct quantum states share the same energy εi\varepsilon_i, and each must be counted.

Figure
Boltzmann factors stacking into the partition function q
energy ε ε₀ = 0, g₀ = 1, Boltzmann factor = 1 ε₁, g₁ = 2, factor = 2e^(−ε₁/kT) ε₂, g₂ = 1, factor = e^(−ε₂/kT) ε₃, g₃ = 3, factor ≈ 0 at low T q = Σᵢ gᵢ e^(−εᵢ/kT) sum of every rung's weighted factor

The second useful picture is how qq grows with temperature for a simple two-level system, since this is the case you can compute by hand and check against intuition.

Figure
q rising with temperature for a two-level system
temperature T (K) q 0 2000 q → 2 as T → ∞ (both states equally likely) q → 1 as T → 0 (only ground state)

The core relations

q=∑igi e−εi/kBTq = \sum_{i} g_i\, e^{-\varepsilon_i / k_BT}

where: the sum runs over all distinct energy levels εi\varepsilon_i, gig_i is the degeneracy of level ii, kBk_B is Boltzmann's constant, and TT is absolute temperature.

q=∑all states je−εj/kBTq = \sum_{\text{all states } j} e^{-\varepsilon_j / k_BT}

where: this equivalent form sums over every individual quantum state jj (rather than levels), automatically including degeneracy by repetition.

pi=gi e−εi/kBTqp_i = \frac{g_i\, e^{-\varepsilon_i/k_BT}}{q}

where: pip_i is the fraction of molecules in level ii at equilibrium — the Boltzmann distribution, now correctly normalized by qq.

q(T→0)=g0,q(T→∞)=∑igiq(T\to 0) = g_0, \qquad q(T\to\infty) = \sum_i g_i

where: these are the two limiting values of qq, ground-state degeneracy at low TT and the total number of states (possibly infinite) at high TT.

Derivation Aq as the normalization constant of the Boltzmann distribution

Goal. Show that requiring ∑ipi=1\sum_i p_i = 1 forces the denominator of the Boltzmann distribution to be exactly qq, and thereby derive the definition of qq from first principles.

Step 1. The Boltzmann distribution (established from the dominant-configuration argument applied to a large collection of molecules) states that the population ratio between two levels depends only on their energy gap:

pipj=gigj e−(εi−εj)/kBT\frac{p_i}{p_j} = \frac{g_i}{g_j}\, e^{-(\varepsilon_i - \varepsilon_j)/k_BT}

This tells us relative populations but not absolute ones.

Step 2. To fix absolute values, write each population as proportional to its Boltzmann factor,

pi=C gi e−εi/kBTp_i = C\, g_i\, e^{-\varepsilon_i/k_BT}

for some constant CC that is the same for every level (it must be, since it cancels in the Step 1 ratio).

Step 3. Populations must be genuine probabilities, so they are required to sum to unity over all levels of the molecule:

∑ipi=C∑igi e−εi/kBT=1\sum_i p_i = C \sum_i g_i\, e^{-\varepsilon_i/k_BT} = 1

Step 4. Solve for CC by isolating it algebraically:

C=1∑igi e−εi/kBTC = \frac{1}{\displaystyle\sum_i g_i\, e^{-\varepsilon_i/k_BT}}

Define the denominator as the molecular partition function,

q≡∑igi e−εi/kBTq \equiv \sum_i g_i\, e^{-\varepsilon_i/k_BT}

so that C=1/qC = 1/q.

Step 5. Substitute back into Step 2 to obtain the fully normalized distribution:

pi=gi e−εi/kBTqp_i = \frac{g_i\, e^{-\varepsilon_i/k_BT}}{q}

Boxed result.

q=∑igie−εi/kBT,pi=gie−εi/kBTq\boxed{q = \sum_i g_i e^{-\varepsilon_i/k_BT}, \quad p_i = \frac{g_i e^{-\varepsilon_i/k_BT}}{q}}

The partition function is not an extra assumption bolted onto the Boltzmann distribution — it is forced into existence by the requirement that probabilities sum to one.

Worked examples

Example 1 — A two-level system (foundational). Consider a hypothetical molecule with only two non-degenerate states: a ground state at ε0=0\varepsilon_0 = 0 and an excited state at ε1=2.0×10−21 J\varepsilon_1 = 2.0 \times 10^{-21}\ \text{J} (a gap comparable to kBTk_BT at room temperature). Take g0=g1=1g_0 = g_1 = 1. Find qq and the populations at T=298 KT = 298\ \text{K}. Step 1: compute kBTk_BT.

kBT=(1.381×10−23 J K−1)(298 K)=4.116×10−21 Jk_BT = (1.381\times 10^{-23}\ \text{J K}^{-1})(298\ \text{K}) = 4.116\times 10^{-21}\ \text{J}

Step 2: compute the exponent.

ε1kBT=2.0×10−214.116×10−21=0.486\frac{\varepsilon_1}{k_BT} = \frac{2.0\times 10^{-21}}{4.116\times10^{-21}} = 0.486

Step 3: compute the Boltzmann factor.

e−0.486=0.615e^{-0.486} = 0.615

Step 4: sum for qq.

q=g0e0+g1e−0.486=1+0.615=1.615q = g_0 e^{0} + g_1 e^{-0.486} = 1 + 0.615 = 1.615

Step 5: populations.

p0=11.615=0.619,p1=0.6151.615=0.381p_0 = \frac{1}{1.615} = 0.619, \qquad p_1 = \frac{0.615}{1.615} = 0.381

Check: p0+p1=1.000p_0 + p_1 = 1.000 ✓. Sanity check: since ε1\varepsilon_1 is comparable to kBTk_BT, we expect substantial (not negligible, not dominant) population in the excited state — 38% is physically reasonable, and q=1.615q = 1.615 sits between the two limits (11 at T=0T=0 and 22 at T=∞T=\infty), as it must.

Example 2 — Vibrational partition function of CO (applied, harder). The fundamental vibrational wavenumber of carbon monoxide is ν~=2170 cm−1\tilde\nu = 2170\ \text{cm}^{-1}. Treating the vibration as a harmonic oscillator with evenly spaced levels εv=vhcν~\varepsilon_v = v h c \tilde\nu (v=0,1,2,…v = 0, 1, 2,\dots, each non-degenerate, energies measured from the v=0v=0 level), find the vibrational partition function qvibq_{\text{vib}} at (a) 298 K and (b) 1000 K, and comment on what this reveals about CO's vibrational activity. Step 1: convert ν~\tilde\nu to an energy quantum.

ε=hcν~=(6.626×10−34 J s)(2.998×1010 cm s−1)(2170 cm−1)\varepsilon = hc\tilde\nu = (6.626\times10^{-34}\ \text{J s})(2.998\times10^{10}\ \text{cm s}^{-1})(2170\ \text{cm}^{-1})
ε=4.311×10−20 J\varepsilon = 4.311\times10^{-20}\ \text{J}

Step 2: compute the dimensionless ratio θvib=ε/kB\theta_{\text{vib}} = \varepsilon/k_B, the vibrational temperature.

θvib=4.311×10−20 J1.381×10−23 J K−1=3122 K\theta_{\text{vib}} = \frac{4.311\times10^{-20}\ \text{J}}{1.381\times10^{-23}\ \text{J K}^{-1}} = 3122\ \text{K}

Step 3: use the closed-form geometric series for evenly spaced levels. Since εv=vε\varepsilon_v = v\varepsilon, the sum is geometric:

qvib=∑v=0∞e−vε/kBT=11−e−θvib/Tq_{\text{vib}} = \sum_{v=0}^{\infty} e^{-v\varepsilon/k_BT} = \frac{1}{1 - e^{-\theta_{\text{vib}}/T}}

Step 4a: evaluate at T=298 KT = 298\ \text{K}.

θvibT=3122298=10.48\frac{\theta_{\text{vib}}}{T} = \frac{3122}{298} = 10.48
e−10.48=2.81×10−5e^{-10.48} = 2.81\times10^{-5}
qvib=11−2.81×10−5=1.0000281≈1.00q_{\text{vib}} = \frac{1}{1 - 2.81\times10^{-5}} = 1.0000281 \approx 1.00

Step 4b: evaluate at T=1000 KT = 1000\ \text{K}.

θvibT=31221000=3.122\frac{\theta_{\text{vib}}}{T} = \frac{3122}{1000} = 3.122
e−3.122=0.0441e^{-3.122} = 0.0441
qvib=11−0.0441=10.9559=1.046q_{\text{vib}} = \frac{1}{1 - 0.0441} = \frac{1}{0.9559} = 1.046

Interpretation and sanity check. At room temperature qvib≈1.00q_{\text{vib}} \approx 1.00, meaning CO molecules are overwhelmingly in v=0v=0; the vibrational mode is essentially "frozen out," consistent with CO's stiff triple bond and high vibrational temperature (3122 K) compared to 298 K. Even at 1000 K, still well below θvib\theta_{\text{vib}}, qvibq_{\text{vib}} has only crept up to 1.046 — about 4.4% excited-state population, matching e−3.122=0.044e^{-3.122} = 0.044 directly since p1/p0=e−θvib/Tp_1/p_0 = e^{-\theta_{\text{vib}}/T}. Both values properly satisfy qvib≥1q_{\text{vib}} \ge 1, as required since the ground state alone already contributes 1 to the sum.

Limiting cases & common traps

RegimeBehavior of qqPhysical meaning
T→0T \to 0q→g0q \to g_0Only the ground level populated
T→∞T \to \infty, finite levelsq→∑igiq \to \sum_i g_iAll levels equally populated
kBT≪k_BT \ll level spacingq≈g0q \approx g_0 (mode "frozen")Typical for vibrations at room T
kBT≫k_BT \gg level spacingqq large, grows smoothly with TTTypical for translation, rotation at room T
Degeneracy ignoredUndercounts qqCommon error — always include gig_i

The chemist behind it

The partition function's mathematical form traces to Ludwig Boltzmann's statistical treatment of energy distributions, but its systematic use for computing thermodynamic functions of real molecules — separating and evaluating translational, rotational, vibrational, and electronic contributions — was developed and popularized in the early twentieth century as spectroscopic data became precise enough to test statistical mechanics quantitatively. This synthesis of spectroscopy and statistical mechanics let chemists calculate entropies and equilibrium constants from molecular data alone, a program most closely associated with the tradition running through Josiah Willard Gibbs and refined by physical chemists applying quantum spectroscopic term values directly into qq.

Origins · 1 minLudwig Boltzmann and how this was discovered
LB
Ludwig Boltzmann
1844–1906 · Austrian physicist whose statistical interpretation of entropy and the Boltzmann factor underlie the exponential term inside every partition function

Ask the tutor: How does factorizing q into translational, rotational, vibrational, and electronic pieces let us build up a molecule's entire partition function from separate, independently computable parts?

Why is q called a "partition" function

The name reflects how qq describes the way molecules are partitioned, or distributed, among the available energy states at a given temperature. It is a translation of Boltzmann's original German term, and it captures the function's role: rather than partitioning matter in space, it partitions a population of molecules across energy levels according to the Boltzmann distribution. Once you know qq, you know exactly how the molecular population is divided.

Does q depend on where I set the zero of energy

The value of qq itself does depend on your energy origin, since it is built from absolute exponentials e−εi/kBTe^{-\varepsilon_i/k_BT}. However, physically measurable quantities like populations pip_i, internal energy differences, and equilibrium constants come out identical regardless of convention, provided you are consistent. The most common convention, used throughout this article, sets the ground state energy to zero, which keeps q≥1q \ge 1 always.

Can q ever be less than 1

Not if you use the convention ε0=0\varepsilon_0 = 0 for the ground state, since that state alone contributes g0≥1g_0 \ge 1 to the sum, and every other term adds a non-negative amount. If you instead measure energies from some other reference point, qq computed from the raw formula could look different, but the physically meaningful ratio q(T)/q(Tref)q(T)/q(T_{\text{ref}}) and all derived thermodynamic quantities remain unaffected.

How does q relate to entropy and heat capacity

Once qq is known as a function of TT, standard formulas convert it directly into thermodynamic functions: internal energy comes from U−U(0)=kBT2(∂ln⁡q/∂T)U - U(0) = k_BT^2 (\partial \ln q/\partial T), and entropy and heat capacity follow from further derivatives of ln⁡q\ln q. This article establishes the definition of qq; the derivative relations connecting qq to internal energy are developed in the next stage of this sequence.

Is q the same as the canonical partition function Q for a whole system

No — qq here is a single-molecule quantity, summing over the states available to one molecule. The system partition function QQ describes an entire assembly of NN molecules and, for distinguishable independent molecules, equals qNq^N; for indistinguishable gas-phase molecules it is Q=qN/N!Q = q^N/N!. This article focuses on qq; the assembly-level function builds directly on it.

Before this

Where this leads