Statistical Mechanics Partition Function Calculator
Calculate partition function Z for quantum oscillators and two-level systems.
Returns average energy, heat capacity, entropy, and free energy.
What Is the Partition Function? The canonical partition function Z is the central object of statistical mechanics: Z = Σ exp(−Eᵢ / kT) = Σ exp(−βEᵢ) where the sum runs over all quantum states i, β = 1/(kT), k = Boltzmann constant, T = temperature. Everything in equilibrium thermodynamics follows from Z: energy, entropy, heat capacity, free energy.
Why Z Matters Helmholtz free energy: F = −kT ln Z Average energy: ⟨E⟩ = −∂(ln Z)/∂β = kT² ∂(ln Z)/∂T Heat capacity: Cv = ∂⟨E⟩/∂T Entropy: S = (⟨E⟩ − F)/T = k[ln Z + β⟨E⟩] All thermodynamic properties follow from a single function Z.
Quantum Harmonic Oscillator Energy levels: Eₙ = ℏω(n + 1/2), n = 0, 1, 2, … Z = Σ exp(−β ℏω(n+1/2)) = exp(−βℏω/2) / (1 − exp(−βℏω)) Average energy: ⟨E⟩ = ℏω[1/2 + 1/(exp(βℏω) − 1)] At high T (classical limit): ⟨E⟩ → kT (equipartition theorem). At low T: ⟨E⟩ → ℏω/2 (zero-point energy).
Einstein Model of Solids A solid with N atoms has 3N independent harmonic oscillators. Einstein heat capacity: Cv = 3Nk(βℏω)² exp(βℏω) / (exp(βℏω)−1)² At high T: Cv → 3Nk (Dulong-Petit law, classical result). At low T: Cv → 0 exponentially (quantum suppression). Observed by Einstein (Switzerland, 1907) — explained why Cv drops at low temperature.
Two-Level System Energy levels: 0 and ε (e.g., spin-1/2 in magnetic field, or two-state molecule). Z₂ = 1 + exp(−βε) ⟨E⟩ = ε / (exp(βε) + 1) — Fermi-Dirac-like distribution Heat capacity shows a Schottky anomaly — a peak at kT ≈ 0.42ε. This peak in Cv is diagnostic of a two-level system.
Boltzmann Factor and Occupation Probability Probability of state with energy E: P(E) = exp(−βE) / Z Ratio of populations: N₁/N₀ = exp(−Δε/kT) At T → 0: only the ground state is populated. At T → ∞: all states equally populated.
Physical Constants Used k (Boltzmann): 1.380649 × 10⁻²³ J/K = 8.617333 × 10⁻⁵ eV/K. ℏ (reduced Planck): 1.054572 × 10⁻³⁴ J·s. A frequency of 1 THz corresponds to ℏω = 0.00414 eV (quantum effects matter below ~50 K).
How we build and check this calculator
This calculator runs entirely in your browser, so the numbers you enter stay on your device. The math behind it is written by hand and tested against worked examples and standard references before the page goes live.
SuperGlobalCalculator is independently built and maintained. See how we build and verify our calculators.