ES98D · Course contents

1. Equilibrium is a probability measure

A particle in a potential well does not sit forever at the minimum when its surroundings are warm. It fluctuates. If we could take a photograph at a randomly chosen equilibrium time, where would we expect to find it? The answer requires both an energy model and a rule for assigning probability to configurations. Those are separate choices: the same interaction energy can be studied at fixed energy, fixed temperature or fixed pressure.

We will use this separation throughout ES98D. First identify the physical degrees of freedom and the probability measure they should follow. Then construct a trajectory or a sampling algorithm that preserves that measure. Finally ask how much information a finite simulation contains. An attractive trajectory alone answers none of these questions.

1.1 Count the states we do not simulate

Let a small system have a particular microstate xx with energy E(x)E(x). Put it in weak thermal contact with a much larger bath, while keeping their combined energy EtotE_{\mathrm{tot}} fixed. Weak coupling means that the interaction energy can be neglected in the energy bookkeeping. If all accessible microstates of the isolated composite are equally weighted, the probability of xx is proportional to the number of compatible bath states:

Pr⁡(x)∝ΩB(Etot−E(x)).\Pr(x)\propto\Omega_B(E_{\mathrm{tot}}-E(x)).

The bath has fewer states available when the system takes more energy. To quantify that tradeoff, introduce its entropy SB(E)=kBlog⁡ΩB(E)S_B(E)=k_B\log\Omega_B(E). Taylor expansion gives

SB(Etot−E(x))=SB(Etot)−E(x)T+⋯ ,∂SB∂E=1T.S_B(E_{\mathrm{tot}}-E(x)) =S_B(E_{\mathrm{tot}})-\frac{E(x)}{T}+\cdots, \qquad \frac{\partial S_B}{\partial E}=\frac1T.

The bath is large enough that this energy exchange barely changes its temperature. More precisely, its quadratic term is −E(x)2/(2T2CB)-E(x)^2/(2T^2C_B) when expanded at the reference bath energy, so a large heat capacity CBC_B controls the approximation. Exponentiating the linear term yields the Boltzmann weight

Pr⁡(x)∝e−βE(x),β=1kBT.\Pr(x)\propto e^{-\beta E(x)},\qquad \beta=\frac{1}{k_BT}.

This is a statement about a microstate. It is not generally the probability of an energy value. If there are g(E)g(E) states of energy EE, then Pr⁡(E)∝g(E)e−βE\Pr(E)\propto g(E)e^{-\beta E}; for continuous energies, gg is a density of states relative to an energy measure.

Suppose there is one state at energy zero and four distinct states at energy Δ\Delta. Each excited state is less probable than the ground state, but the excited level can still be more probable. Compare the probability bars before reading the calculation.

Energy competes with multiplicity

Warmer: βΔ = log 2

energy leveltotal probability010.3330 (1 state)0.667Δ (4 states)

The level probability includes all four excited microstates; bar heights share the same zero-to-one scale.

Colder: βΔ = log 8

energy leveltotal probability010.6670 (1 state)0.333Δ (4 states)

The level probability includes all four excited microstates; bar heights share the same zero-to-one scale.

Exactly one ground state and four excited states. These bars sum probabilities within each level; they are not per-microstate weights. ↗

At βΔ=log⁡2\beta\Delta=\log2, every excited microstate has half the ground-state weight. The partition sum is Z=1+4/2=3Z=1+4/2=3, so the total excited probability is 2/32/3. At βΔ=log⁡8\beta\Delta=\log8, it is instead (4/8)/(1+4/8)=1/3(4/8)/(1+4/8)=1/3. Energy favours the ground state; multiplicity favours the excited level. Free energy will eventually combine precisely these two effects.

Start with every system excited. Can you see why the populations stop changing before the upward and downward transitions stop?

Watch equilibrium emerge from probability flow
Probability mass changes level
excited level: four microstatesground level: one microstateΔ
Opposing fluxes reach balance
excited probabilitystochastic time02001p* = 0.497

dp₁/dt = (1 − p₁)e⁻ᵝ − p₁/4

Excited probability 0.581; equilibrium 0.497; upward flux 0.103, downward flux 0.145.

Paused. Play the sequence, step through it, or drag the position slider.

Two-level master equation with rates up = exp(−β), down = 1/4, Δ = 1. Time is an illustrative stochastic clock. Marker movement is a visual transport of mass, not a molecular trajectory.

Play the relaxation, then change inverse temperature β. The coloured markers track stratified probability mass; the curve gives the exact excited-level probability, including its fourfold degeneracy. ↗

1.2 From a microstate to a particle distribution

For NN classical particles in dd dimensions, write positions r=(r1,…,rN)r=(r_1,\ldots,r_N), momenta p=(p1,…,pN)p=(p_1,\ldots,p_N) and Hamiltonian

H(r,p)=K(p)+U(r),K(p)=∑i=1N∣pi∣22mi.H(r,p)=K(p)+U(r),\qquad K(p)=\sum_{i=1}^N\frac{|p_i|^2}{2m_i}.

The force is −∇iU-\nabla_iU, rather than ∇iU\nabla_iU. Let the particles occupy a finite domain or let UU confine them strongly enough that the partition function is finite. With respect to the classical reference measure

dμ=dr dpN!hPdN,Q=∫e−βH dμ,d\mu=\frac{dr\,dp}{N!h_{\mathrm P}^{dN}}, \qquad Q=\int e^{-\beta H}\,d\mu,

the canonical measure is Q−1e−βHdμQ^{-1}e^{-\beta H}d\mu. Here hPh_{\mathrm P} is Planck's constant, used to make the classical state count dimensionless, and N!N! applies to identical particles; mixtures require species factorials. These constants cancel in fixed-composition averages, but must be consistent in absolute free energies. A probability density written with respect to dr dpdr\,dp has the corresponding constants absorbed into its normalisation.

Because kinetic and potential energies separate, so does the Boltzmann factor. Integrating the Gaussian momenta leaves

π(r)=e−βU(r)Z,Z=∫e−βU(r)dr.\pi(r)=\frac{e^{-\beta U(r)}}{Z},\qquad Z=\int e^{-\beta U(r)}dr.

Each unconstrained Cartesian velocity component is Gaussian with mean zero and variance kBT/mik_BT/m_i. This Maxwell–Boltzmann law will supply initial velocities in the dynamics chapter. The configurational partition function ZZ and full phase-space partition function QQ are different objects.

For an observable AA, an equilibrium prediction is an expectation:

⟨A⟩=∫A(r,p) Q−1e−βH(r,p)dμ.\langle A\rangle=\int A(r,p)\,Q^{-1}e^{-\beta H(r,p)}d\mu.

If AA depends only on positions, we can use ∫A(r)π(r)dr\int A(r)\pi(r)dr. Sampling methods turn these integrals into averages of representative states. They do not replace the modelling decision contained in UU.

1.3 What is held fixed changes the measure

An ensemble specifies macroscopic constraints and the resulting statistical weighting of microstates. Thermodynamics describes those constraints through state variables; statistical mechanics supplies the measure underneath them.

In an isolated microcanonical system, N,V,EN,V,E are fixed. The phase-space measure is proportional to

δ(E−H(r,p))dμ,Ω(E)=∫δ(E−H) dμ.\delta(E-H(r,p))d\mu, \qquad \Omega(E)=\int\delta(E-H)\,d\mu.

One may define entropy from a thin energy shell, S=kBlog⁡[Ω(E) δE]S=k_B\log[\Omega(E)\,\delta E], with the shell-width convention stated. The delta distribution does not mean uniform Euclidean surface area: integrating over the energy surface introduces the factor 1/∣∇H∣1/|\nabla H| where it is regular. Hamiltonian dynamics preserves this measure and the energy, but preservation alone does not prove that a single trajectory samples every relevant region.

In the canonical ensemble, N,V,TN,V,T are fixed and energy fluctuates. Its thermodynamic potential is the Helmholtz free energy

F=−kBTlog⁡Q=Eint−TS.F=-k_BT\log Q=E_{\mathrm{int}}-TS.

We write Eint=⟨H⟩E_{\mathrm{int}}=\langle H\rangle to distinguish thermodynamic internal energy from the configuration function U(r)U(r). Canonical sampling can use Metropolis moves or suitable thermostatted dynamics. Neither an arbitrary thermostat nor a finite numerical timestep automatically preserves the exact measure.

Allow the box to exchange volume

At fixed N,Pext,TN,P_{\mathrm{ext}},T, volume fluctuates as well. The isothermal-isobaric partition function integrates canonical weights over VV, with an additional factor e−βPextVe^{-\beta P_{\mathrm{ext}}V}. A reference volume can make this integral dimensionless; its convention affects the additive free-energy constant. The associated thermodynamic potential is the Gibbs free energy G=Eint−TS+PextVG=E_{\mathrm{int}}-TS+P_{\mathrm{ext}}V.

Why does a simulation formula often contain VNV^N? For an isotropically scaled cubic box, introduce fractional coordinates ai∈[0,1]da_i\in[0,1]^d by ri=V1/dair_i=V^{1/d}a_i. Then dr=VNdadr=V^N da, and after momenta are integrated out,

π(a,V) da dV∝VNe−β[U(V1/da)+PextV] da dV.\pi(a,V)\,da\,dV\propto V^N e^{-\beta[U(V^{1/d}a)+P_{\mathrm{ext}}V]}\,da\,dV.

The volume power is a coordinate Jacobian, not an extra energy. A proposal symmetric in VV, keeping aa fixed, therefore has acceptance

α=min⁡{1,exp⁡[−β(ΔU+PextΔV)+Nlog⁡V′V]}.\alpha=\min\left\{1, \exp\left[-\beta(\Delta U+P_{\mathrm{ext}}\Delta V) +N\log\frac{V'}V\right]\right\}.

A proposal symmetric in log⁡V\log V has a different proposal ratio and gives an (N+1)log⁡(V′/V)(N+1)\log(V'/V) term. Flexible cells require their own measure and proposal analysis. This is our first example of a general rule: an acceptance probability is meaningful only after both the target measure and the proposal coordinates are specified.

Both pictures obey the same harmonic equations. What changes when energy is fixed in one ensemble but allowed to fluctuate in the other?

One energy shell or a mixture of shells?
NVE: one radius
xpone radius; every energy equal
NVT: a distribution of radii
xpdifferent radii; energies fluctuate

H = (x² + p²)/2; p(E) = βe⁻ᵝᴱ

β = 1.00; fixed NVE energy 1.00; canonical mean energy 1.00.

Paused. Play the sequence, step through it, or drag the position slider.

Nondimensional harmonic oscillator, m = k = 1. Equal position and momentum scales. Canonical energies use fixed stratified exponential quantiles; these are representative markers, not a thermostatted simulation.

Follow a marked phase-space point through one revolution. Each orbit conserves its own energy. The canonical ensemble mixes orbit radii, while the microcanonical ensemble stays on a single circle. ↗

1.4 A target is not yet a simulation

Newtonian motion is a natural candidate for NVE; Langevin dynamics exchanges heat with a bath; Metropolis sampling can target configurational NVT; volume moves or a correctly constructed barostat add pressure coupling. Each method must be checked for invariance, ability to explore the support, and finite-computation error. We will develop these checks rather than infer them from an ensemble label.

Before constructing motion, we need to decide which interactions give the energy in these measures. The next chapter starts from the difficulty of evaluating the microscopic energy surface and builds models whose approximations remain visible.

Exercises

  1. For the two-level example, find the temperature at which both levels have equal total probability. What changes if the excited level has multiplicity gg?
  2. Integrate one momentum coordinate and verify its velocity variance 1/(βm)1/(\beta m).
  3. Derive the extra proposal factor for a move symmetric in log⁡V\log V. Explain why adding it twice would be an error.