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 with energy . Put it in weak thermal contact with a much larger bath, while keeping their combined energy 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 is proportional to the number of compatible bath states:
The bath has fewer states available when the system takes more energy. To quantify that tradeoff, introduce its entropy . Taylor expansion gives
The bath is large enough that this energy exchange barely changes its temperature. More precisely, its quadratic term is when expanded at the reference bath energy, so a large heat capacity controls the approximation. Exponentiating the linear term yields the Boltzmann weight
This is a statement about a microstate. It is not generally the probability of an energy value. If there are states of energy , then ; for continuous energies, is a density of states relative to an energy measure.
Suppose there is one state at energy zero and four distinct states at energy . 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.
Warmer: βΔ = log 2
The level probability includes all four excited microstates; bar heights share the same zero-to-one scale.
Colder: βΔ = log 8
The level probability includes all four excited microstates; bar heights share the same zero-to-one scale.
At , every excited microstate has half the ground-state weight. The partition sum is , so the total excited probability is . At , it is instead . 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?
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.
1.2 From a microstate to a particle distribution
For classical particles in dimensions, write positions , momenta and Hamiltonian
The force is , rather than . Let the particles occupy a finite domain or let confine them strongly enough that the partition function is finite. With respect to the classical reference measure
the canonical measure is . Here is Planck's constant, used to make the classical state count dimensionless, and 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 has the corresponding constants absorbed into its normalisation.
Because kinetic and potential energies separate, so does the Boltzmann factor. Integrating the Gaussian momenta leaves
Each unconstrained Cartesian velocity component is Gaussian with mean zero and variance . This Maxwell–Boltzmann law will supply initial velocities in the dynamics chapter. The configurational partition function and full phase-space partition function are different objects.
For an observable , an equilibrium prediction is an expectation:
If depends only on positions, we can use . Sampling methods turn these integrals into averages of representative states. They do not replace the modelling decision contained in .
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, are fixed. The phase-space measure is proportional to
One may define entropy from a thin energy shell, , with the shell-width convention stated. The delta distribution does not mean uniform Euclidean surface area: integrating over the energy surface introduces the factor 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, are fixed and energy fluctuates. Its thermodynamic potential is the Helmholtz free energy
We write to distinguish thermodynamic internal energy from the configuration function . 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 , volume fluctuates as well. The isothermal-isobaric partition function integrates canonical weights over , with an additional factor . 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 .
Why does a simulation formula often contain ? For an isotropically scaled cubic box, introduce fractional coordinates by . Then , and after momenta are integrated out,
The volume power is a coordinate Jacobian, not an extra energy. A proposal symmetric in , keeping fixed, therefore has acceptance
A proposal symmetric in has a different proposal ratio and gives an 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?
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.
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
- For the two-level example, find the temperature at which both levels have equal total probability. What changes if the excited level has multiplicity ?
- Integrate one momentum coordinate and verify its velocity variance .
- Derive the extra proposal factor for a move symmetric in . Explain why adding it twice would be an error.