Langevin sampling of scalar fields
Define a real scalar lattice measure and show explicitly how a stable time discretization can still sample the wrong stationary variance.
On this page
The question for today
What you’ll understand
- Declare the scalar-field integration measure and action normalization.
- Connect an additive-noise Langevin equation to its equilibrium density.
- Calculate Euler time-step bias independently of stability and finite sampling.
A continuous lattice field can be sampled by a stochastic differential equation whose stationary density is the desired Boltzmann weight. The stochastic time is an algorithmic coordinate unless a separate physical dynamical model has been specified. The continuum equation can have the correct stationary measure while its numerical discretization does not. We use a finite periodic lattice of real, dimensionless scalar variables with a real normalizable weight. A single Gaussian mode will expose the difference between stable trajectories, correct equilibrium variance, and small statistical error.
State the integration measure and the potential
At each site integrate the scalar over the real line with a fixed flat measure. A conventional constant normalization per integration cancels from normalized expectations, but field-dependent Jacobians would not. The lattice action contains forward nearest-neighbor differences, a quadratic coefficient r, and a quartic coefficient u normalized by four factorial. All are dimensionless in these lattice units. This action describes a Euclidean or classical statistical field, not an oscillatory real-time path-integral weight.
For a finite periodic lattice, positive quartic coupling makes this polynomial action confining even when r is negative. In the purely Gaussian case, positive r gives a normalizable measure; setting both quartic coupling and r to zero leaves an unconstrained constant mode. A force calculation must include contributions from neighbors on both sides of each difference term. Incorrectly omitting one side can still produce smooth stochastic trajectories while sampling a different quadratic kernel. Physical dimensions and lattice-spacing factors will be restored explicitly in the continuum-scaling lesson.
Drift and noise must obey the same normalization
Choose unit mobility in dimensionless stochastic time. The drift is minus the action gradient and the independent Wiener increments have variance equal to the time increment at each site. The square root of two multiplying the noise is essential: it sets the diffusion coefficient in the Fokker–Planck equation to one. Substituting the exponential of minus the action makes each probability-current component vanish, yielding the target stationary density when normalization and decay at field-space infinity justify the integration by parts.
This calculation establishes a stationary density for the exact diffusion. Convergence to it still requires appropriate ergodicity and regularity, and a finite trajectory retains warmup and correlation errors. Additive noise avoids an Itô-versus-Stratonovich drift ambiguity here; multiplicative noise requires a separate convention. A complex action cannot be inserted into the same real positive-density proof. Calling an algorithm Langevin does not establish correctness of complexified sampling or of a discretization that changes its noise covariance.
A finite time step creates an independent systematic error
For one Gaussian mode with action r times field squared over two, Euler discretization gives an autoregressive process. Its coefficient is one minus epsilon times r and its fresh noise variance is twice epsilon. The variance remains bounded only when the coefficient magnitude is below one. Solving its stationary variance equation shows a step-size-dependent excess over the target inverse r. Running this stable chain longer estimates its biased variance more precisely rather than correcting the bias.
One remedy is a controlled extrapolation in stochastic step size, separately from spatial-spacing and finite-volume studies. A Metropolis-adjusted Langevin proposal instead includes the forward/reverse Gaussian proposal-density ratio; it cannot use only the symmetric-proposal acceptance rule. For a Gaussian mode the exact Ornstein–Uhlenbeck transition is another useful benchmark, though a generic interacting field has no such closed-form update. The heat instrument below shows deterministic mode decay only; it supplies no fluctuation noise and no equilibrium field samples.
Work it through
Stable Euler sampling with a biased variance
For one mode with take r = 2 and Euler step epsilon = 1/4. Find the autoregressive coefficient, stationary variance, and relative variance bias.
The deterministic coefficient is , whose magnitude is below one. The noise variance is , so the numerical process is stable.
Its stationary variance solves , giving . The exact target with quadratic coefficient two instead has variance .
The relative excess is . Statistical averaging cannot remove this one-third time-step bias, even though every measured trajectory may appear well behaved.
The stable numerical mode has coefficient one half and stationary variance two thirds, one third above the correct target variance.
The living notebook
Explore the model
Interactive lab · heat
Inspect drift-like relaxation without noise
Reset and set spatial mode , diffusivity ; Step once to time 0.5 and predict amplitude . Repeat from Reset with both controls , and one Step; predict . This is the exact decay of one periodic heat mode, not a sampled scalar-field distribution. It contains no random forcing, stochastic-step bias, or Langevin trajectory.
- Current amplitude
- 1
- Spatial L² norm
- 1.772
- Decay rate · κn²
- 3.6 /s
The exact periodic heat-equation mode is u(x,t) = exp(−κn²t) sin(nx), on [0,2π]. Playback advances physical time. The initial sine is shown separately, and the unnormalized L² norm is √π exp(−κn²t). This analytic instrument does not run a finite-difference solver or test discretization stability. 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 forCorrect deterministic relaxation does not by itself establish the fluctuation amplitude required by an equilibrium measure.
Pause & reason
Check your understanding
Your turn
Try it yourself
For r = 2 use an exact Ornstein–Uhlenbeck transition over interval . Find its deterministic coefficient and required Gaussian noise variance, then verify its stationary variance.
Take a moment to make a prediction or work it out on paper. Open a hint when you need one.
Give me a hint
The exact coefficient is e^(−r epsilon); the noise variance is (1 − e^(−2r epsilon))/r.
Compare with the solution
The coefficient is . The independent noise variance is . Its invariant variance solves , yielding , exactly the target. The coefficient matches the Euler worked example but the noise variance differs, showing why a relaxation rate alone cannot identify the sampled equilibrium. This exact formula applies to the single Gaussian mode, not a general quartic interacting lattice.
Keep the idea
Take it with you
- The field measure, action, drift, and noise normalization must define one consistent target.
- Stochastic time is algorithmic unless physical dynamics is independently specified.
- Stability, time-step bias, sampling error, and spatial continuum error require separate controls.
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.