research30 min studyLesson 948 in Physics

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

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.

H(ϕ,p)=S(ϕ)+12pTM−1p,p∼N(0,M),P(ϕ,p)∝e−H\mathcal H(\phi,p)=S(\phi)+\frac12p^{\mathsf T}\mathsf M^{-1}p,\qquad p\sim\mathcal N(0,\mathsf M),\qquad P(\phi,p)\propto e^{-\mathcal H}
All quantities are dimensionless under the lattice convention. The fixed algorithmic mass matrix M is symmetric positive definite and independent of the fields, so its Gaussian normalization does not alter the field marginal.↔ Scroll wide equations horizontally.

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.

p1/2=p−ϵ2∇S(ϕ),ϕ′=ϕ+ϵM−1p1/2,p′=p1/2−ϵ2∇S(ϕ′),A=min⁡(1,e−ΔH)p_{1/2}=p-\frac\epsilon2\nabla S(\phi),\quad \phi'=\phi+\epsilon\mathsf M^{-1}p_{1/2},\quad p'=p_{1/2}-\frac\epsilon2\nabla S(\phi'),\qquad A=\min(1,e^{-\Delta\mathcal H})
epsilon is the fictitious trajectory step, and Delta H is final minus initial augmented Hamiltonian. A final momentum reversal may make the proposal involutive; it leaves the even kinetic term and acceptance unchanged.↔ Scroll wide equations horizontally.

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.

0<ϵω<2for stable leapfrog on a single harmonic mode,cost per effective observation∼2τint,O×cost per trajectory0<\epsilon\omega<2\quad\text{for stable leapfrog on a single harmonic mode},\qquad \text{cost per effective observation}\sim2\tau_{\mathrm{int},O}\times\text{cost per trajectory}
omega is the fictitious harmonic frequency. The threshold is specific to standard leapfrog and a quadratic mode; the efficiency expression uses the earlier one-half autocorrelation convention and declared trajectory work.↔ Scroll wide equations horizontally.

One reversible Gaussian proposal

Use S(q)=q2/2S(q)=q^2/2, 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.

  1. The first half kick leaves momentum at one because the initial force is zero. The full drift gives q′=1q'=1, and the second half kick gives p′=1−1/2=1/2p'=1-1/2=1/2.

  2. The initial Hamiltonian is one half; the final value is (12+(1/2)2)/2=5/8(1^2+(1/2)^2)/2=5/8. Thus ΔH=1/8\Delta\mathcal H=1/8 and acceptance is e−1/8≃0.88250e^{-1/8}\simeq0.88250.

  3. 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 result

The field proposal is q = 1, the flipped momentum is −1/2, and the positive Hamiltonian error 1/8 gives acceptance about 0.8825.

Explore the model

Interactive lab

Interactive lab · oscillator

Exact Hamiltonian motion is a reference, not HMC

Reset and set damping ζ=0\zeta=0, frequency ω0=1\omega_0=1; Step once to time 0.5 and predict x=cos⁡0.5x=\cos0.5, v=−sin⁡0.5v=-\sin0.5, with energy (v2+x2)/2=1/2(v^2+x^2)/2=1/2. Repeat from Reset with both controls ζ=0\zeta=0, ω0=2\omega_0=2 and one Step; predict x=cos⁡1x=\cos1, v=−2sin⁡1v=-2\sin1, with energy (v2+4x2)/2=2(v^2+4x^2)/2=2. These are exact different harmonic models with fixed x(0)=1, v(0)=0, not numerical HMC proposals or acceptance readouts.

Exact Hamiltonian motion is a reference, not HMCUnit mass, x(0) = 1 and v(0) = 0. The analytic solution includes underdamped, critically damped and overdamped cases; time is measured in seconds. Current readings: Displacement x(t): 1; Velocity v(t): 0; Regime: underdamped. All parameters are adjustable with the labeled controls below.02.557.510−1.15−0.5700.571.15Time · sDisplacementunderdamped
Displacement x(t)Current time
Displacement x(t)
1
Velocity v(t)
0
Regime
underdamped
t = 0 s

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.

Check your understanding

Which properties justify the simple exp(−Delta H) acceptance for the stated deterministic HMC proposal?

Try it yourself

For the same harmonic action and unit mass, show that one leapfrog step has matrix Lϵ=(1−ϵ2/2ϵ−ϵ+ϵ3/41−ϵ2/2)L_\epsilon=\begin{pmatrix}1-\epsilon^2/2&\epsilon\\-\epsilon+\epsilon^3/4&1-\epsilon^2/2\end{pmatrix}. 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 (1−ϵ2/2)2−ϵ(−ϵ+ϵ3/4)=1(1-\epsilon^2/2)^2-\epsilon(-\epsilon+\epsilon^3/4)=1. Its trace is 2−ϵ22-\epsilon^2; distinct unit-modulus eigenvalues require absolute trace less than two, giving 0<ϵ<20<\epsilon<2 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.

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.