Extrapolating the canonical partition function

Cumulant generating functions, energy fluctuations, and Taylor expansions.

Posted by Matt Witman on August 22, 2018

Note: Appreciating the "why" of this post may require a background in statistical mechanics, but understanding the math should not.


In statistical mechanics, the classical canonical partition function represents the volume of phase space of an N particle system occupying a box of volume V at thermodynamic temperature, . In other words, it consists of an integral over all degrees of freedom of all particles in the system. There are 3N configurational degrees of freedom corresponding to each particle's position and 3N kinetic degrees of freedom corresponding to each particle's momentum . In a classical system we can analytically integrate out the kinetic degrees of freedom. What we can't easily calculate is the configurational part of the canonical partition function, which is shown below:

Here is microstate defined by the 3N dimensional vector of scaled coordinates, and is the potential energy as a function of the particle coordinates. I won't elaborate much more on the physical importance of the partition function, but will just say that it serves as the normalization term for the microstate probabilities.

Typically one uses Monte Carlo simulations to avoid dealing with this high-dimensional integral that is impossibly complex to directly compute for all but the simplest toy systems. However, there are simulation techniques that yield the value of without directly evaluating this integral (DOI: coming soon), even though its numerical value is impossibly large to comprehend. In these types of studies where (or ) is determined for a given system, it is useful to approximate its temperature dependence via Taylor expansion:

Now, let's look what happens if we take the natural log of the partition function, followed by the derivative with respect to .

We can see that our expression evaluates to the expectation value of the system's potential energy, or the first order moment of its potential energy distribution. So why is all of this useful? We can run a Monte Carlo (MC) simulation in the canonical ensemble, obtain the average potential energy, and then we know to a first order approximation the slope of the canonical partition function as a function of . Now what happens if we take the second derivative with respect to ? Using the fact that:

you can work through the algebra and should end up with the following:

So the second derivative can be related to the first and second moments of the potential energy distribution. Note that , such that the derivative can be expressed in terms of either the central rather non-central moments. With many steps of algebra, one can continue taking higher order derivatives:

The evaluation of these derivatives shows the natural log of the partition function is a cumulant generating function. See the Wikipedia entry for more math details on the relationship between cumulants, moments, central-moments, etc., but the fact that the canonical partition function is cumulant generating means we can determine its curvature with respect to by computing the moments of the potential energy distribution as sampled during an MC simulation. One can use either the central or non-central moments to evaluate these derivatives, but in practice it saves an enormous amount of disk space to use the non-central moments since on can simply accumulate throughout the course of the simulation. Now the partition function can be estimated at a new temperature, provided the Taylor expansion is valid over the extrapolation range and enough statistics have been accumulated to accurately estimate the moments of the energy distribution.