- Home
- Library
- Lattice and Hamiltonian Field Theory
- Generating and Testing Lattice Ensembles
- Hybrid Monte Carlo for Lattice Actions
Hybrid Monte Carlo for Lattice Actions
A local random walk proposes changes without consulting the action's slope. Hybrid Monte Carlo uses that slope to move many field variables together. It follows an auxiliary classical trajectory, then corrects its integration error with one Metropolis test. The trajectory is a proposal mechanism; it is not real-time evolution of the quantum field.
Preparation: local lattice updates, Gaussian integrals and Hamilton's equations. The pseudofermion article adds suitable fermion determinants. We first work with a positive finite-dimensional scalar measure.
Extend the measure without changing the field theory
For real lattice variables with density , introduce independent real momenta and
Integrating out returns the original field measure exactly. Full momentum refresh draws each from and preserves this joint density. Between refreshes, Hamilton's equations in fictitious time are
For the chapter's dimensionless two-dimensional scalar action,
the derivative and force are
Varying both ends of every nearest-neighbor bond fixes the sign and factor in the Laplacian. Confusing with reverses the restoring force. For , the Fourier mode with momentum is an oscillator with
These are frequencies of the fictitious molecular dynamics. They are not the lattice transfer-matrix energies that govern Euclidean correlators.
Leapfrog is a composition of exact shears
For step size , one kick–drift–kick step is
Each kick holds the field fixed; each drift holds the momentum fixed. In order their Jacobians have the block-triangular forms
Both determinants are one, so any composition preserves phase-space volume. Let . A symmetric sequence of kicks and drifts satisfies , where denotes a complete trajectory. Thus is an involution, . This is the relevant reversibility property, not a claim that the numerical energy is exactly constant. These constructions are developed in Kennedy, §2.13, printed pp. 16–18, PDF.
For steps, neighboring half-kicks can be combined, requiring exactly gradient evaluations. The retained implementation does that. The field and momentum errors at fixed trajectory time are for a smooth trajectory on a bounded region where the derivatives controlling the error remain finite. Energy errors can grow disastrously outside a stable integration regime. A formal modified-Hamiltonian expansion is not a globally convergent theorem for every interacting field configuration.
The final test removes integration bias under its hypotheses
After a momentum refresh, apply and compute
Because preserves volume and is its own inverse,
The accepted fluxes balance. On rejection retain the old field; on acceptance retain the proposed field. Full momentum refresh on the next trajectory allows the final momentum to be discarded, but the momentum reversal remains part of the phase-space proof. The construction is described in Kennedy, §§2.9–2.11, printed pp. 14–15, PDF.
Consequently finite changes acceptance and autocorrelation, while the ideal reversible, volume-preserving Metropolis kernel has the desired stationary measure. In floating-point arithmetic reversibility is approximate. History-dependent or inconsistently evaluated forces can violate the proof's hypotheses, as can an incorrect final Hamiltonian. A deterministic position-only approximate force may instead lower acceptance while leaving correction to the exact target valid. A small mean alone does not test them. Nor does invariance prove efficient exploration: resonant trajectories provide a simple counterexample below.
A fresh field-independent distribution of step counts is allowed. Each fixed-length kernel preserves the same measure, so their mixture does too. Stopping a trajectory according to its current field or force requires a separate correctness argument; it is not automatically covered by this mixture statement.
A free oscillator exposes stability and resonances
For one mode with , the leapfrog step can be multiplied explicitly:
Its determinant is one and its trace is . For , its eigenvalues are a conjugate pair on the unit circle. Above two they become a real reciprocal pair and repeated steps amplify one direction. The endpoint is marginal and generally has a nontrivial Jordan block, so it is not a safe operating point. For the free lattice with , and the strict free stability condition is . The production value is . The interacting Hessian adds on its diagonal, so this free bound does not certify arbitrary interacting trajectories. Compare Kennedy, §2.13.1, printed pp. 18–19, PDF.
Even exact integration can be a poor sampler. With full momentum refresh and fixed time ,
In equilibrium and . For ,
But the centered quadratic observable has correlation and
At , the field changes sign each time and its square never changes. Acceptance is one, yet the chain cannot sample amplitudes. Random trajectory lengths reduce such exact resonances, although no universal efficiency follows. The chapter's slow-mode calculation develops this observable dependence further.
The general Hamiltonian proposal gives the reversibility and volume-preservation argument in canonical variables. Changing the variable from a scalar to a group-valued link changes which derivative enters that argument.
Gauge forces live in the Lie algebra
For U(1), pack forward-link angles into , and let be the oriented plaquette–link incidence matrix. The positive plaquette angle is , with signs along the oriented square. The action and force are
For a site gauge transformation , the link–site incidence satisfies . Hence : the force has no component along a gauge orbit. Angles are periodic; drifting by and then taking a representative modulo preserves the circle measure.
For SU(N), keep Hermitian generators normalized by . A forward link maps the start site to the end site . Vary it at the final endpoint by
Holding the other links fixed, rewrite every adjacent real plaquette trace in the form . Here is a sum of return-path products from to ; if the original loop contains , first use the conjugate trace and cyclicity. Then
The sign follows from . For and kinetic energy , the drift and kick are
The momentum and transform by conjugation at , consistently with the forward-link endpoint law. The group exponential stays on SU(N); adding a Cartesian matrix increment to would not. Left multiplication preserves Haar measure, and a momentum kick is a translation at fixed links, so symmetric group leapfrog has the corresponding volume and reversal properties. This formula concerns the Wilson gauge action; a fermion determinant contributes the additional pseudofermion force.
The retained tests compare U(1) directional derivatives on a periodic grid and all three SU(2) Lie derivatives of an arbitrary link with a three-path return sum. These tests distinguish the force sign, endpoint ordering and generator normalization.
Check the map before judging its acceptance
The companion scalar_checks.py uses fixed random fields and momenta, independently of the production streams. Its interacting directional derivative test compares
At , the absolute residuals for are approximately , , , and . The initial factor of 100 is the expected centered-difference truncation error; the eventual increase exposes roundoff. The free quadratic action has no centered-difference truncation error along a fixed direction, so its residual instead starts near roundoff.
The program also applies , reverses the momentum, applies the same again and reverses once more. It checks both returned fields and momenta for at and . The largest observed field-or-momentum return error is . This is the practical reversal test discussed in Kennedy, §2.16, printed p. 21, PDF, and is distinct from measuring on the forward path.
For time , the maximum field-or-momentum error against the exact free Fourier flow is:
| Number of steps | Maximum state error | |
|---|---|---|
| 0.2 | 5 | 0.0748323 |
| 0.1 | 10 | 0.0185516 |
| 0.05 | 20 | 0.00462823 |
| 0.025 | 40 | 0.00115645 |
Halving the step reduces the error by about four. An interacting comparison against a separate 4096-step trajectory gives the same second-order trend; that fine reference is a numerical comparison, not an analytic exact flow. A dense free covariance inverse versus Fourier sum, the one-step oscillator matrix, batched versus individual random streams, a forced rejected proposal and a tiny finite-difference Jacobian provide further checks. The Jacobian calculation checks the code; the shear argument above establishes volume preservation in exact arithmetic.
Measurements, trajectory choices and work
The main experiment uses the same lattice, and as the local-update comparison. Each action has 16 independent streams, half initialized at zero and half at constant . It discards 256 trajectories and retains 1024. Each trajectory refreshes all momenta, takes and independently chooses with equal probability. Accepted and rejected trajectories, their , step counts, warmup observables and all retained measurements are saved. Main acceptance is 0.97430 for the free action and 0.97394 for the interacting action.
One local sweep evaluates conditional/proposal kernels. Our HMC trajectory evaluates gradients and two actions, without reusing an action or gradient from the preceding trajectory. Its recorded proxy work is therefore
This counts evaluated site kernels, not equal FLOPs: gradients, actions and local proposals have different arithmetic and memory costs. The program separately records distribution draws, local neighbor sums and measured update time. Common measurements are excluded from kernel time; their measured cost is also retained. Equal allocation of a batched call's wall time among its replicas is a timing convention, not an independently timed serial run.
To compare at common work, choose each stream's largest completed-update prefix whose accumulated retained work does not exceed 524288. This leaves all 8192 local sweeps but 623–639 free HMC trajectories or 621–636 interacting HMC trajectories. No fields inside a prefix are thinned. Smaller fixed quarter- and half-budget prefixes are retained as well. The standard errors come from independent stream means, as derived in the local-update comparison.
For , the common-work results are:
| Algorithm | |||
|---|---|---|---|
| Random walk | |||
| Gaussian proposal + MH | |||
| HMC |
Here , and is the translation-and-axis average of . The measured means are consistent, while their errors depend on the observable. HMC's global move does not offset all its force cost in this massive, small scalar example. For , the measured kernel-time products are approximately , and in the table's order, with in seconds. These times depend on the machine, batching and implementation; the Gaussian proposal also wins that particular comparison. Warmup work is recorded but excluded from this retained-sampling comparison, so it is not an end-to-end cost for a fresh ensemble.
Vary the integrator and the trajectory separately
Before inspecting results, we also fixed five short studies for each action, using eight streams, 128 discarded trajectories and 512 retained ones. At , step sizes use . At fixed , trajectory times use . These deliberately modest runs illustrate parameter dependence; their errors and equilibration must still be assessed.
| at | Free RMS | Free acceptance | Interacting RMS | Interacting acceptance |
|---|---|---|---|---|
| 0.05 | 0.01616 | 0.99365 | 0.01577 | 0.99487 |
| 0.1 | 0.06724 | 0.97437 | 0.06314 | 0.97412 |
| 0.2 | 0.26587 | 0.89453 | 0.25845 | 0.89893 |
The energy-error scale decreases approximately as , consistent with the deterministic refinement test. Raising acceptance from about 0.974 to about 0.994 requires 21 rather than 11 gradient calls per trajectory. Whether that is worthwhile depends on observable error per work, not on the acceptance increase alone.
Left: measured RMS energy violation at fixed fictitious time one for the free and interacting scalar actions; the dashed curve is an guide. Right: free-field estimates of total retained site-kernel work times the variance of the sample mean, normalized to each observable's value at . The eight-stream estimates are noisy; their uncertainty is not plotted. A longer trajectory helps the squared zero-mode average in this sample while worsening . Fixed and times do not give a universal optimal trajectory. The interacting short run is excluded from this performance panel because its warmup failed.
The short interacting study is an instructive failure. Its retained acceptance was 0.96167, yet the hot initial fields were still relaxing after the 128-trajectory discard. One hot stream's first 128 retained records had average , while the main ensembles give about 0.0127. Those early records had acceptance 0.9375, so the transient cannot be dismissed as simply a run of rejected moves. The observed long-lived coherent amplitude is enough to reject this warmup choice; the histories alone do not identify a unique dynamical mechanism or a physical metastable phase.
We preserve that entire failed study. After diagnosing it, a separately seeded extension was fixed at eight streams, 2048 discarded trajectories and 1024 retained trajectories, with the same , . It gives and acceptance 0.96704. The gross hot-start transient is removed and the result is compatible with the main runs, while some other observables remain noisy. This additional run tests the hot-start transient separately from the original comparison. It illustrates why monitoring starts and observables matters even when acceptance looks satisfactory.
What the acceptance test does and does not establish
HMC combines a tractable auxiliary measure, a reversible volume-preserving proposal, and a final test with the actual target Hamiltonian. These ingredients establish an invariant ideal kernel. Trustworthy measurements additionally require equilibration, exploration of slow directions, accurate forces and action tests, and autocorrelation-aware errors. A higher acceptance can cost more force evaluations while reducing an observable's error less effectively. The shared statistical analysis examines the histories rather than inferring independence from the acceptance rate.
Exercises
A perfect-energy trajectory that never samples the amplitude
For the exact harmonic oscillator with full momentum refresh, take . Determine the transition of and . Then replace the fixed time by independent equal-probability choices and . Find the stationary lag coefficients and integrated autocorrelation times of and .
Solution
At the fixed half-period, because the refreshed momentum has coefficient . Thus is conserved, the chain is nonergodic, and perfect energy conservation gives acceptance one without correcting that defect.
For random times, the coefficient is zero or with equal probabilities. Conditional on the present , the linear observable obeys . Its stationary lag correlation is . For the centered square, Gaussian momentum refresh gives
Averaging over the independent time choice gives coefficient , so its lag correlation is . Summing the two geometric series yields
An integrated autocorrelation time below one half is possible for the odd observable because of negative lag correlations. It does not imply independent configurations or similarly small errors for every observable. The quarter-period update, which occurs with positive probability, refreshes the amplitude from the correct Gaussian.
Two oriented plaquettes fix a gauge-force sign
A U(1) link angle enters two plaquettes as and . Derive its force for . Show agreement with the staple derivative and find the force at , , .
Solution
Differentiation of both oriented terms gives
The corresponding return sum is , and the local action is plus a constant. Its derivative is , equal to the expression above. This is the Abelian form of with unit generator and ; it does not import the SU(N) coupling normalization.
At the stated angles , hence . Starting with zero momentum, the first half-kick makes negative and the drift decreases . The action decreases to first order, which checks the restoring-force sign. Adding the two plaquette sines without their opposite incidence signs would fail the general calculation.
References
- A. D. Kennedy, Algorithms for Dynamical Fermions, lectures revised in 2012, arXiv:hep-lat/0607038v2, §§2.9–2.13 and 2.16. Auxiliary momenta, Metropolis correction, symplectic integration, stability and numerical reversibility. The stated scalar and gauge-force calculations and retained finite-lattice experiments specialize these principles.
Scrollable formula. Use Left and Right arrow keys to reveal hidden content.
Scrollable table. Use Left and Right arrow keys to reveal hidden columns.
Scrollable figure. Use Left and Right arrow keys to reveal hidden content.