Mayer f-function (source code)

= Mayer f-function
{c}
{title2=$f(r)=e^{-u(r)/(k_BT)}-1$}

The <Mayer f-function> measures how a <pair potential> changes a pair's <Boltzmann factor> relative to the noninteracting value one:
$$
f(r)=e^{-\beta u(r)}-1,\qquad \beta=\frac{1}{k_BT}.
$$
It vanishes where $u=0$, lies between $-1$ and $0$ for repulsion, and is positive for attraction. Even an infinite hard-core <potential energy> produces the finite value $f=-1$. This is why expanding in <Mayer f-functions> handles a <hard-sphere gas> more naturally than a <Taylor series> in $u$. https://davidtong.org/teaching/statistical-physics/statmechhtml/S2#S2.S5.SS1[Tong, section 2.5.1, equation 2.72]{ref}

For pairwise-additive <potential energy> $U=\sum_{i<j}u(r_{ij})$, the exact identity
$$
e^{-\beta U}=\prod_{i<j}\bigl[1+f(r_{ij})\bigr]
$$
turns the configurational part of the <canonical partition function> into a sum of products associated with pairs. Drawing one edge for each chosen factor $f(r_{ij})$ gives the <graphs> used in the <cluster expansion>. The <second virial coefficient> uses just one pair's relative-position <integral>, $B_2=-\frac12\int f\,d^3\mathbf r$.

For the square-well toy <pair potential> in <second virial coefficient>, $f=-1$ in the core, $f=e^{1/T^*}-1$ in the attractive shell, and $f=0$ beyond it. Its positive plateau need not be small: low <number density>, rather than small $f$ at every separation, controls the dilute-gas approximation. The <integral> weights each plateau by spherical-shell <volume>; equal-looking unweighted areas on a plot of $f$ versus $r$ need not cancel in $B_2$.