- Home
- Library
- Lattice and Hamiltonian Field Theory
- Generating and Testing Lattice Ensembles
- Metropolis, Heat-Bath, and Overrelaxation Updates
Metropolis, Heat-Bath, and Overrelaxation Updates
A scalar-field simulation changes one number at a time, but its output is an ensemble of entire fields. A good local update must preserve the desired joint distribution and move through it efficiently. Accepting nearly every proposal answers neither question by itself: arbitrarily small changes have excellent acceptance and poor decorrelation.
Preparation: the finite scalar action and its first Metropolis simulation. All fields and couplings below are dimensionless lattice quantities. We compare algorithms for a fixed finite lattice; the Markov update number is not Euclidean or physical time.
One conditional distribution determines the update
On a periodic two-dimensional lattice, take
Here is the dimensionless bare mass squared, not a measured gap. Our calculation uses , or , and an lattice. More generally the following Gaussian proposal needs , and the full target must be normalizable. For example , suffices.
Hold every field except fixed, and define its neighbor sum
Collecting the four adjacent bonds gives the conditional density, with respect to ,
Thus for the complete action change is local:
Both forward and backward bonds contribute to . Counting only the bonds written with origin would give the wrong diagonal coefficient. On a periodic extent of two, the same neighboring site occurs twice, corresponding to the two distinct terms in the action.
Metropolis acceptance and the role of rejected moves
For a general proposal density , accept with probability
The accepted probability flux in either direction is the smaller of and . This proves conditional detailed balance. Integration over the fixed neighbors proves invariance of the full measure. The proposal ratio cannot be omitted just because only one field changes.
Our random-walk proposal is with uniform on . It is symmetric, so . A rejection records the old configuration as the next sample. Recording accepted configurations alone changes the relative residence times and generally biases the measure. The symmetric-proposal construction and composition of invariant steps are discussed in Kennedy, §§2.5–2.6, printed pp. 9–10, PDF.
We update all even sites and then all odd sites, where parity is . On an even periodic lattice, no bond connects sites in the same half-sweep. Their conditionals therefore factorize while the opposite parity is fixed. Neighbor sums must be recomputed between half-sweeps. An odd periodic extent has a wrapping bond between equal parities; this parallel update would then be invalid.
Each half-sweep preserves the target. Their ordered product also preserves it, although the full even-then-odd sweep need not satisfy detailed balance: its reverse has the opposite order. Invariance, convergence from an initial state, and the rate of decorrelation are different properties. With a positive normalizable density and nonzero-width random proposals, repeated local moves can reach every open region; finite warmup and finite sampling errors still require diagnostics.
Gaussian heat bath and its interacting correction
At , complete the square:
Drawing
is an exact conditional heat bath. Conditional on the neighbors it forgets entirely. Successive whole fields remain correlated because their neighbors evolve through the same chain. “Heat bath” does not mean an independent draw from the full field distribution.
For , use the same Gaussian as an independent proposal . Its quadratic exponent cancels the quadratic part of the target in the Hastings ratio:
This is a Gaussian-proposal Metropolis update, not an exact interacting heat bath. The full interacting conditional could instead be sampled by a valid rejection sampler or another exact conditional method. Simply omitting the displayed correction returns the free Gaussian conditional and the wrong theory.
Overrelaxation moves along a conditional contour
Reflect about the Gaussian conditional mean:
The transformation is an involution with absolute Jacobian one, and . It therefore preserves the free conditional density without rejection. At it becomes a deterministic proposal with the same quartic acceptance factor as above. Its reverse uses the same fixed neighbors.
The free reflection conserves the full action at each update. An entire deterministic sequence remains on its initial action surface, so it cannot by itself sample the canonical distribution of action values. It may nevertheless move collective disturbances more effectively when interleaved with an ergodic stochastic update. Since each constituent preserves the target, any fixed sequence or field-independent random mixture does too. A field-dependent decision to apply different kernels needs its own balance argument. Our measured comparison below uses the two stochastic local methods; it does not assign an empirical speedup to overrelaxation without running that comparison.
Compact-link heat bath includes Haar measure
For a forward U(1) link , use the chapter's endpoint convention . Write the adjacent plaquette angles as
The Wilson action contributes
This definition fixes the staple phase without relying on a backward-link convention. Put and . Relative to normalized Haar measure , the conditional weight is
Relative to ordinary , the density has an additional . A von Mises draw centered at with concentration is the heat bath. If , the conditional is uniform and its phase is immaterial. A symmetric angular Metropolis proposal instead accepts using the local cosine-action difference. Angles wrap modulo ; the measure is not an unconstrained Cartesian measure on the complex link.
The distinction becomes especially visible for SU(2). Writing with , the Haar marginal of is . Even a conditional action proportional to therefore does not give a flat-measure exponential on . The Haar integration calculation supplies this normalization.
A one-square comparison with an exact answer
Take four independent Haar links on one open square, with plaquette angle . There is no periodic constraint. Integrating three link combinations leaves
The retained link_updates.py actually updates all four links sequentially. At , it compares angular Metropolis half-width one with the conditional von Mises heat bath, using 16 random streams, 1024 discarded sweeps and 8192 retained sweeps. Half start at plaquette zero and half at . Both methods receive retained link-update calls.
| Update | Acceptance | Mean | Replica standard error |
|---|---|---|---|
| Angular Metropolis | 0.64494 | 0.863538 | 0.000724 |
| Conditional heat bath | 1 | 0.863134 | 0.000600 |
| Exact Haar integral | — | 0.863523 | — |
Errors are the scatter of the 16 independent stream means divided by four; they include within-stream correlations rather than treating all stored fields as independent. Blocking at 16, 64 and 256 sweeps and the two start groups are retained as additional diagnostics. A heat-bath link update makes this particular plaquette independent of its previous angle, so the exact model explains its decorrelation. On a larger lattice, one link participates in several plaquettes and does not independently refresh them all.
A link-call count is a useful declared work proxy, not equal processor cost. The von Mises generator itself uses rejection sampling; the program counts distribution calls and reports measured kernel time, rather than claiming knowledge of its internal random-draw count. The observed error reduction is modest and noisy at 16 replicas. It is a controlled one-square comparison, not a performance claim for non-Abelian gauge theory.
Compare scalar errors at equal work
The shared run_scalar.py compares random-walk and Gaussian-proposal sweeps with HMC. For each action and algorithm it uses 16 separately seeded PCG64 streams, half starting at zero and half at constant . The local runs discard 2048 sweeps and keep 8192. Seeds and settings were fixed before production. Every observable record, including warmup and repeated rejected fields, is saved once for the chapter's common analysis.
Define the field average and axis-averaged correlator by
These average source positions and axes; they are not the spatially projected correlators also retained for the later fit. At , the exact mode sum gives , and .
For each observable, first average within each retained stream, obtaining , and then average the stream means. The reported standard error is
Independence is between streams, not successive fields within one stream. This estimator incorporates each stream's autocorrelation through the variance of its mean, but only 16 stream means make the error estimate itself noisy. It also cannot remove a common initialization bias. The two starting groups, fixed prefixes and the window/block analysis supply additional diagnostics.
| Update | Acceptance | |||
|---|---|---|---|---|
| 0 | Random walk | 0.59530 | ||
| 0 | Gaussian heat bath | 1 | ||
| 2 | Random walk | 0.59002 | ||
| 2 | Gaussian proposal + MH | 0.98814 |
Both local kernels perform one conditional/proposal evaluation per site, so each receives retained site evaluations per stream. The implementation also recomputes all neighbor sums twice per sweep; those counts, normal/uniform distribution draws and elapsed kernel times are recorded separately. Measurements and their cost are kept separate from the update timings.
At the same target budget of 524288 site-kernel evaluations per stream, the conditional Gaussian proposal gives smaller estimated errors for these four observables. HMC counts its actual gradient and action evaluations, so it contributes fewer stored trajectories at this budget. Each ratio uses errors estimated from 16 independent stream means; uncertainty in the error estimates is not shown. Lines connect discrete observables only as a reading aid. Parameters are , , and the indicated ; this is a finite massive model, not a critical-scaling comparison.
HMC is included in the figure with its actual force/action work; its acceptance near 0.974 does not make it the best sampler here. The chosen Gaussian conditional is unusually well matched to this weak quartic perturbation. At fixed work its estimated error is about one half of the random-walk error, while the gain for is different. On this implementation the measured kernel-time comparison gives the same preference for the Gaussian proposal on these observables. Neither ranking is a universal statement about interacting theories or optimized implementations.
As normalization checks, free runs reproduce the finite-lattice covariance, and the exact Gaussian moments. For both actions, integration by parts gives the Ward identity
The boundary term vanishes for this confining finite-dimensional action. All six main runs agree with their applicable exact means or identities within 1.64 reported standard errors, and their largest start-group difference is 2.40 combined standard errors. These are observed diagnostics, not guaranteed coverage or an equilibration theorem. In particular, a separate fixed-length HMC study exposes a warmup failure despite high acceptance.
What to carry forward
Derive an update from its conditional distribution, including the proposal ratio and base measure. Preserve rejections, distinguish an invariant sweep from a reversible sweep, and measure the error of the observable of interest at a stated cost. Hybrid Monte Carlo changes the whole field using fictitious dynamics; the error-analysis article uses these same retained scalar histories to examine autocorrelation windows, blocking and correlated fits.
Exercises
The bias from dropping the quartic correction
At a site whose neighbors sum to zero, assume . Derive the first correction to the conditional variance under . Compare with the uncorrected Gaussian proposal.
Solution
Expand both numerator and normalization about the centered Gaussian:
The moments are , and . Consequently
The positive quartic interaction suppresses large fields. An always-accepted Gaussian draw gives and misses this first correction. This is a conditional calculation at fixed neighbors; it is not the full interacting lattice variance, whose neighbor distribution also changes.
A compact reflection and its limitation
For a nonzero fixed U(1) staple , show that modulo is an invariant deterministic local update. Explain why a lattice sweep made only of these reflections need not sample the canonical ensemble, and how to combine them with a heat bath without changing the target.
Solution
The shifted angle changes sign: . Thus the local action is unchanged. Reflection is its own inverse and preserves circle Haar measure, establishing invariance for fixed neighboring links. Since all remaining action terms are unaffected, each link reflection conserves the complete Wilson action. A deterministic sweep therefore cannot generate the canonical distribution of action values from a field with one fixed action. This is an explicit obstruction to ergodicity, even if some observables vary along the orbit.
Insert, for example, one full conditional heat-bath sweep after a fixed number of reflection sweeps. Each factor preserves the same measure, so the composition is invariant. This establishes the target distribution; the improved or worsened error per unit work must still be measured. The number of reflection sweeps should not be chosen as an arbitrary function of the current field without rechecking invariance.
References
- A. D. Kennedy, Algorithms for Dynamical Fermions, lectures revised in 2012, arXiv:hep-lat/0607038v2, §§2.5–2.6 and 2.8.2. Detailed balance, composition, and autocorrelation variance; the scalar and compact-link calculations above are worked specializations.
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.