# Partition function

The partition function of a system is given by

${\displaystyle \left.Z\right.={\mathrm {Tr} }\{e^{-\beta H}\}}$

where H is the Hamiltonian. The symbol Z is from the German Zustandssumme meaning "sum over states". The canonical ensemble partition function of a system in contact with a thermal bath at temperature ${\displaystyle T}$ is the normalization constant of the Boltzmann distribution function, and therefore its expression is given by

${\displaystyle Z(T)=\int \Omega (E)\exp(-E/k_{B}T)\,dE}$,

where ${\displaystyle \Omega (E)}$ is the density of states with energy ${\displaystyle E}$ and ${\displaystyle k_{B}}$ the Boltzmann constant.

In classical statistical mechanics, there is a close connection between the partition function and the configuration integral, which has played an important role in many applications (e.g., drug design).

## Helmholtz energy function

The partition function of a system is related to the Helmholtz energy function through the formula

${\displaystyle \left.A\right.=-k_{B}T\log Z.}$

This connection can be derived from the fact that ${\displaystyle k_{B}\log \Omega (E)}$ is the entropy of a system with total energy ${\displaystyle E}$. This is an extensive magnitude in the sense that, for large systems (i.e. in the thermodynamic limit, when the number of particles ${\displaystyle N\to \infty }$ or the volume ${\displaystyle V\to \infty }$), it is proportional to ${\displaystyle N}$ or ${\displaystyle V}$. In other words, if we assume ${\displaystyle N}$ large, then

${\displaystyle \left.k_{B}\right.\log \Omega (E)=Ns(e),}$

where ${\displaystyle s(e)}$ is the entropy per particle in the thermodynamic limit, which is a function of the energy per particle ${\displaystyle e=E/N}$. We can therefore write

${\displaystyle \left.Z(T)\right.=N\int \exp\{N(s(e)-e/T)/k_{B}\}\,de.}$

Since ${\displaystyle N}$ is large, this integral can be performed through steepest descent, and we obtain

${\displaystyle \left.Z(T)\right.=N\exp\{N(s(e_{0})-e_{0}/k_{B}T)\}}$,

where ${\displaystyle e_{0}}$ is the value that maximizes the argument in the exponential; in other words, the solution to

${\displaystyle \left.s'(e_{0})\right.=1/T.}$

This is the thermodynamic formula for the inverse temperature provided ${\displaystyle e_{0}}$ is the mean energy per particle of the system. On the other hand, the argument in the exponential is

${\displaystyle {\frac {1}{k_{B}T}}(TS(E_{0})-E_{0})=-{\frac {A}{k_{B}T}}}$

the thermodynamic definition of the Helmholtz energy function. Thus, when ${\displaystyle N}$ is large,

${\displaystyle \left.A\right.=-k_{B}T\log Z(T).}$

## Connection with thermodynamics

We have the aforementioned Helmholtz energy function,

${\displaystyle \left.A\right.=-k_{B}T\log Z(T)}$

we also have the internal energy, which is given by

${\displaystyle U=k_{B}T^{2}\left.{\frac {\partial \log Z(T)}{\partial T}}\right\vert _{N,V}}$

and the pressure, which is given by

${\displaystyle p=k_{B}T\left.{\frac {\partial \log Z(T)}{\partial V}}\right\vert _{N,T}}$.

These equations provide a link between classical thermodynamics and statistical mechanics