Hybrid Monte Carlo step size and acceptance
Construct an auxiliary Hamiltonian proposal with reversible volume-preserving integration and quantify the acceptance of a hand-worked trajectory.
On this page
The question for today
What you’ll understand
- Explain why Gaussian auxiliary momenta preserve the field marginal.
- Derive one leapfrog trajectory and its Metropolis acceptance.
- Distinguish integration stability, equilibrium correction, and sampling efficiency.
Hybrid Monte Carlo uses fictitious Hamiltonian motion to propose collective changes of continuous field variables. It combines a deterministic numerical trajectory with random auxiliary momenta and an acceptance decision. The trajectory is a proposal mechanism, not a claim to reproduce physical field dynamics. A finite integration step can preserve the exact target distribution after a valid Metropolis correction, while still yielding poor exploration or high computational cost. This lesson assumes a differentiable real action and unconstrained real fields; gauge groups and constrained manifolds require their own geometric update rules.
Augment the measure without changing the field marginal
Introduce one momentum per field variable with a centered Gaussian covariance given by a fixed positive-definite mass matrix. The augmented Hamiltonian is action plus the corresponding quadratic kinetic term. Integrating out the momenta contributes a field-independent normalization, so the desired field distribution is unchanged. Refreshing these momenta from their exact conditional Gaussian is one valid update. The matrix is an algorithmic tuning choice here and must not be confused with the physical mass parameter inside the field action.
The exact Hamiltonian flow conserves the augmented Hamiltonian and preserves phase-space volume. Its reversibility can be expressed through momentum reversal when the kinetic term is even. A numerical proposal need not conserve energy exactly, but the standard simple acceptance rule relies on retaining the appropriate reversible and volume-preserving structure. A generic adaptive or dissipative numerical trajectory cannot be substituted without checking its inverse map, proposal probabilities, and any Jacobian factors. Finite-precision force evaluations and solver tolerances also deserve explicit reversibility checks.
Leapfrog supplies a structured discrete proposal
Leapfrog first applies a half momentum kick from the action gradient, then a full coordinate drift, then another half kick at the new field. Each shear preserves phase-space volume, and the symmetric ordering makes the map reversible with momentum reversal. A trajectory is a fixed number of these steps followed, in an explicitly involutive proposal construction, by a momentum flip. The Metropolis test compares the complete augmented Hamiltonian at its two endpoints, including both kinetic and action changes.
Accept a negative energy change with probability one and a positive change with its negative exponential. If rejected, retain the old field; momentum bookkeeping must follow the selected valid HMC formulation. Under ideal exact arithmetic and a correctly reversible volume-preserving map, this correction removes the integration-step bias in equilibrium expectations. It does not remove finite-run errors or prove ergodicity. Nor does the correction guarantee acceptable efficiency when an unstable trajectory almost always gets rejected or explores only one part of the target.
Acceptance is a diagnostic, not the optimization objective
For a quadratic mode, leapfrog is stable only below a step-size threshold set by that mode’s frequency. A field contains many modes, so its fastest resolved mode can constrain epsilon. In a stable smooth problem at fixed trajectory length, leapfrog has a second-order global integration error, but the distribution of Hamiltonian errors and the acceptance dependence also involve dimension, mode spectrum, and trajectory length. There is no universal conversion of one observed acceptance rate into a guarantee of small autocorrelation.
Taking epsilon extremely small while keeping the step count fixed shrinks the trajectory length and can give near-unit acceptance with almost no field displacement. Longer trajectories can reduce random-walk behavior but cost more force evaluations and may encounter resonances. Compare cost per effective measurement of relevant observables, and record step count, mass matrix, refreshment rule, and warmup. Adaptation should be confined to a justified tuning stage or handled by a validated adaptive method. The oscillator instrument supplies an exact positive-stiffness flow only, without leapfrog error, momentum refreshment, or accept/reject decisions.
Work it through
One reversible Gaussian proposal
Use , unit algorithmic mass, initial q = 0 and p = 1, and one leapfrog step epsilon = 1. Find the proposal, Hamiltonian change, and acceptance. Include a final momentum reversal when describing the involution.
The first half kick leaves momentum at one because the initial force is zero. The full drift gives , and the second half kick gives .
The initial Hamiltonian is one half; the final value is . Thus and acceptance is .
The final reversal proposes momentum minus one half without changing its energy. Starting from (1,−1/2), the same leapfrog step reaches (0,−1), and the final reversal returns (0,1), verifying the proposal’s involution for these values.
The field proposal is q = 1, the flipped momentum is −1/2, and the positive Hamiltonian error 1/8 gives acceptance about 0.8825.
The living notebook
Explore the model
Interactive lab · oscillator
Exact Hamiltonian motion is a reference, not HMC
Reset and set damping , frequency ; Step once to time 0.5 and predict , , with energy . Repeat from Reset with both controls , and one Step; predict , , with energy . These are exact different harmonic models with fixed x(0)=1, v(0)=0, not numerical HMC proposals or acceptance readouts.
- Displacement x(t)
- 1
- Velocity v(t)
- 0
- Regime
- underdamped
Unit mass, x(0) = 1 and v(0) = 0. The analytic solution includes underdamped, critically damped and overdamped cases; time is measured in seconds. Parameter changes pause playback and recompute the model at the current elapsed time. Reset restores both parameters and returns time to zero. Playback starts paused. Adjust either parameter, then choose Play or Step.
Look forAn exact flow conserves its own Hamiltonian; discrete HMC proposals need a separately computed endpoint energy and valid correction.
Pause & reason
Check your understanding
Your turn
Try it yourself
For the same harmonic action and unit mass, show that one leapfrog step has matrix . Compute its determinant and derive the nondegenerate linear-stability interval.
Take a moment to make a prediction or work it out on paper. Open a hint when you need one.
Give me a hint
Multiply the two kick shears and the drift shear. Use determinant one and the trace to locate eigenvalues on the unit circle.
Compare with the solution
The kick-drift-kick product gives the stated matrix. Its determinant is . Its trace is ; distinct unit-modulus eigenvalues require absolute trace less than two, giving for positive steps. The endpoint at two is marginal in eigenvalue magnitude but has a defective map with unbounded iterates, so it is excluded. Unit determinant alone does not imply stability or exact energy conservation.
Keep the idea
Take it with you
- Auxiliary momenta change the proposal mechanism while preserving the field marginal.
- The complete Hamiltonian difference corrects a properly reversible volume-preserving trajectory.
- Integration stability, acceptance, mixing, and cost per effective measurement are distinct diagnostics.
Read further
Original sources and deeper explanations to follow at your own pace.
Optional progress, saved in this browser when available. Revisit any lesson at any time.
Lesson not marked complete.