The first step in obtaining a closed expression for virial coefficients is a
cluster expansion of the
grand canonical partition function : \Xi = \sum_{n}{\lambda^{n}Q_{n}} = e^{\left(pV\right)/\left(k_\text{B}T\right)} Here p is the pressure, V is the volume of the vessel containing the particles, k_\text{B} is the
Boltzmann constant, T is the absolute temperature, \lambda =\exp[\mu/(k_\text{B}T)] is the
fugacity, with \mu the
chemical potential. The quantity Q_n is the
canonical partition function of a subsystem of n particles: : Q_n = \operatorname{tr} [ e^{- H(1,2,\ldots,n)/(k_\text{B} T)} ]. Here H(1,2,\ldots,n) is the Hamiltonian (energy operator) of a subsystem of n particles. The Hamiltonian is a sum of the
kinetic energies of the particles and the total n-particle
potential energy (interaction energy). The latter includes pair interactions and possibly 3-body and higher-body interactions. The
grand partition function \Xi can be expanded in a sum of contributions from one-body, two-body, etc. clusters. The virial expansion is obtained from this expansion by observing that \ln \Xi equals p V / (k_B T ). In this manner one derives : B_2 = V \left(\frac{1}{2}-\frac{Q_2}{Q_1^2}\right) : B_3 = V^2 \left[ \frac{2Q_2}{Q_1^2}\Big( \frac{2Q_2}{Q_1^2}-1\Big) -\frac{1}{3}\Big(\frac{6Q_3}{Q_1^3}-1\Big) \right] . These are quantum-statistical expressions containing kinetic energies. Note that the one-particle partition function Q_1 contains only a kinetic energy term. In the
classical limit \hbar = 0 the kinetic energy operators
commute with the potential operators and the kinetic energies in numerator and denominator cancel mutually. The
trace (tr) becomes an integral over the configuration space. It follows that classical virial coefficients depend on the interactions between the particles only and are given as integrals over the particle coordinates. The derivation of higher than B_3 virial coefficients becomes quickly a complex combinatorial problem. Making the classical approximation and neglecting non-additive interactions (if present), the combinatorics can be handled graphically as first shown by
Joseph E. Mayer and
Maria Goeppert-Mayer. They introduced what is now known as the
Mayer function: : f(1,2) = \exp\left[- \frac{u(|\vec{r}_1- \vec{r}_2|)}{k_B T}\right] - 1 and wrote the cluster expansion in terms of these functions. Here u(|\vec{r}_1- \vec{r}_2|) is the interaction potential between particle 1 and 2 (which are assumed to be identical particles). == Definition in terms of graphs ==