Start with a system in a heat bath
A small system exchanges energy with a much larger reservoir at temperature T. The probability of microstate i with energy Eᵢ is
The exponential is the Boltzmann weight. The partition function sums those weights over every accessible microstate:
Why the logarithm matters
Independent subsystems multiply their partition functions, so logarithms turn composition into addition. That is exactly the behavior expected of extensive thermodynamic quantities. Two central results follow:
Once Z is known as a function of temperature, volume, and particle number, derivatives of the Helmholtz free energy produce entropy, pressure, response functions, and fluctuation measures.
A simple interpretation
Z is a temperature-weighted count of states. At low temperature, high-energy states are strongly suppressed. As temperature rises, more states contribute appreciably. Degeneracy matters because many states at the same energy contribute many copies of the same Boltzmann weight.
Where the shortcut stops
The canonical ensemble assumes equilibrium with a reservoir and weak enough coupling that the system’s energy levels are meaningful. Small systems, long-range interactions, or non-equilibrium dynamics can require more careful treatment. The partition function is powerful because its assumptions are precise—not because it is universal.