2  Statistical Mechanics Foundations

Atomistic simulations are grounded in statistical mechanics, which connects the microscopic world of atoms to macroscopic thermodynamic observables. This chapter reviews the key ideas we will use throughout the course.

2.1 Phase Space and Microstates

A classical system of \(N\) atoms is fully described at any instant by the phase space vector:

\[ \Gamma = (\mathbf{r}_1, \ldots, \mathbf{r}_N,\, \mathbf{p}_1, \ldots, \mathbf{p}_N) \tag{2.1}\]

where \(\mathbf{r}_i \in \mathbb{R}^3\) and \(\mathbf{p}_i \in \mathbb{R}^3\) are the position and momentum of atom \(i\). The phase space is therefore \(6N\)-dimensional.

The total energy (Hamiltonian) of the system is:

\[ \mathcal{H}(\Gamma) = \sum_{i=1}^{N} \frac{\mathbf{p}_i^2}{2m_i} + U(\mathbf{r}_1, \ldots, \mathbf{r}_N) \tag{2.2}\]

where the first term is the kinetic energy and \(U\) is the potential energy surface (PES).

2.2 Statistical Ensembles

A statistical ensemble is a collection of microstates consistent with given macroscopic constraints. The three ensembles most relevant to simulation are summarized in Table 2.1.

Table 2.1: The three main statistical ensembles used in atomistic simulation.
Ensemble Fixed variables Fluctuating
Microcanonical (NVE) \(N, V, E\) \(T, P\)
Canonical (NVT) \(N, V, T\) \(E, P\)
Isothermal-isobaric (NPT) \(N, P, T\) \(E, V\)

2.2.1 The Canonical Ensemble

In the canonical (NVT) ensemble, the system exchanges energy with a heat reservoir at temperature \(T\). The probability of finding the system in a microstate with energy \(E\) is given by the Boltzmann distribution:

\[ P(\Gamma) = \frac{1}{Z} \exp\!\left(-\frac{\mathcal{H}(\Gamma)}{k_B T}\right) \tag{2.3}\]

where \(k_B\) is the Boltzmann constant and \(Z\) is the canonical partition function:

\[ Z(N, V, T) = \frac{1}{h^{3N} N!} \int \exp\!\left(-\frac{\mathcal{H}(\Gamma)}{k_B T}\right) d\Gamma \tag{2.4}\]

The factor \(h^{3N} N!\) accounts for the quantum of action and the indistinguishability of identical particles.

2.3 Thermodynamic Averages

Any thermodynamic observable \(A\) is computed as an ensemble average:

\[ \langle A \rangle = \frac{1}{Z} \int A(\Gamma)\, \exp\!\left(-\frac{\mathcal{H}(\Gamma)}{k_B T}\right) d\Gamma \tag{2.5}\]

2.3.1 The Ergodic Hypothesis

For most systems of practical interest, ensemble averages equal time averages over a sufficiently long trajectory:

\[ \langle A \rangle_{\text{ensemble}} = \langle A \rangle_{\text{time}} = \lim_{\tau \to \infty} \frac{1}{\tau} \int_0^{\tau} A(\Gamma(t))\, dt \tag{2.6}\]

This is the ergodic hypothesis, and it is what justifies using molecular dynamics (time evolution) to compute equilibrium thermodynamic properties.

ImportantKey Point

The ergodic hypothesis is an assumption — not a theorem. It fails for systems with broken ergodicity (glasses, proteins in rugged energy landscapes). Always check for convergence in your simulations.

2.4 Free Energy

The Helmholtz free energy \(F\) is related to the partition function by:

\[ F(N, V, T) = -k_B T \ln Z \tag{2.7}\]

All thermodynamic quantities follow from derivatives of \(F\). For example, pressure and entropy are:

\[ P = -\left(\frac{\partial F}{\partial V}\right)_{N,T}, \qquad S = -\left(\frac{\partial F}{\partial T}\right)_{N,V} \tag{2.8}\]

NoteCross-reference example

Eq. 2.3 and Eq. 2.4 together define the NVT ensemble. Section 2.2 gives an overview of all three ensembles. We will return to free energy calculations in Chapter 3 when discussing force fields, and in Chapter 5 when discussing DFT total energies.

Exercises

  1. Starting from Eq. 2.4, derive the expression for the internal energy \(\langle E \rangle = -\partial \ln Z / \partial \beta\) where \(\beta = 1/k_BT\).

  2. Show that the heat capacity at constant volume is \(C_V = k_B \beta^2 \langle (\Delta E)^2 \rangle\), where \(\Delta E = E - \langle E \rangle\). This is an example of a fluctuation-dissipation relation.

  3. For an ideal gas of \(N\) particles, evaluate the partition function Eq. 2.4 analytically and recover the ideal gas law \(PV = Nk_BT\).