Skip to content
QFT.org

Search QFT.org

Enter a word or phrase.

    You can also browse the main navigation and chapter contents.

    Control Variates from Field Identities

    An exact field identity can improve a noisy measurement even when it does not solve the theory. If a fluctuating quantity has a known mean, subtracting a suitable multiple of its fluctuation leaves the desired expectation unchanged. The practical question is how to construct that quantity and choose its coefficient without introducing an unnoticed bias.

    We will use integration by parts to reduce the error in a quartic moment, then repeat the calculation for four coupled scalar variables. Both examples use positive, dimensionless Euclidean weights e−Se^{-S} at a fixed finite regulator.

    Preparation: Expectations, covariance, and a Gaussian integral. No functional-integral notation is needed for the derivation below.

    Build a zero-mean observable

    For x∈Rdx\in\mathbb R^d, let π(x)=e−S(x)/Z\pi(x)=e^{-S(x)}/Z. A differentiable vector function vi(x)v_i(x) obeys

    ∫Ωddx ∂i(vie−S)=∫∂Ωe−Sv⋅n dΣ\int_\Omega\mathrm d^d x\,\partial_i(v_i e^{-S}) =\int_{\partial\Omega} e^{-S}v\cdot n\,\mathrm d\Sigma

    on a finite domain Ω\Omega, with summation over ii. If the boundary flux vanishes in the infinite-domain limit, then

    ⟨Gv⟩=0,Gv=∑i(∂ivi−vi∂iS).\langle G_v\rangle=0,\qquad G_v=\sum_i\left(\partial_i v_i-v_i\partial_i S\right).

    Sufficient decay and integrability are part of this identity. Periodic variables instead require compatible periodic functions and cancellation at the identified boundary. Field-space constraints or a nontrivial measure can change the derivative term.

    For any fixed coefficient cc, the modified observable

    Oc=O−cGvO_c=O-cG_v

    has the same mean as OO. Its variance is

    Var⁡(Oc)=Var⁡(O)−2cCov⁡(O,Gv)+c2Var⁡(Gv).\operatorname{Var}(O_c)=\operatorname{Var}(O) -2c\operatorname{Cov}(O,G_v)+c^2\operatorname{Var}(G_v).

    Provided Var⁡(Gv)>0\operatorname{Var}(G_v)>0, minimization gives

    c∗=Cov⁡(O,Gv)Var⁡(Gv),Var⁡(Oc∗)=Var⁡(O)(1−ρ2),c_* =\frac{\operatorname{Cov}(O,G_v)}{\operatorname{Var}(G_v)}, \qquad \operatorname{Var}(O_{c_*})=\operatorname{Var}(O)(1-\rho^2),

    where ρ\rho is their correlation coefficient. A strongly correlated control is useful even if its own mean is zero. Multiple controls replace the scalar denominator by their covariance matrix; nearly dependent controls require care because fitting can become unstable.

    The same finite-dimensional integration-by-parts construction underlies lattice field controls; see Bedaque and Oh, §IIA. Our examples use a simple polynomial control rather than a trained neural function.

    Solve a quartic example

    Take

    S(x)=x22+λx44,λ=1,O=x2.S(x)=\frac{x^2}{2}+\frac{\lambda x^4}{4},\qquad \lambda=1,\qquad O=x^2.

    This local definition uses λ/4\lambda/4, not the λ/4!\lambda/4! normalization often used for a field vertex. With v=xv=x,

    G=1−x2−λx4,⟨x2+λx4⟩=1.G=1-x^2-\lambda x^4, \qquad \langle x^2+\lambda x^4\rangle=1.

    The boundary flux xe−Sxe^{-S} vanishes at both ends. Large x2x^2 tends to accompany negative GG, so the optimal coefficient is negative. For the Gaussian limit λ=0\lambda=0, c=−1c=-1 gives Oc=x2+(1−x2)=1O_c=x^2+(1-x^2)=1 exactly: the variance disappears. At nonzero coupling, the quartic term prevents this complete cancellation but still gives a useful control.

    Direct one-dimensional quadrature at λ=1\lambda=1 gives

    ⟨x2⟩=0.467919916974.\langle x^2\rangle=0.467919916974.

    The numerical experiment first draws 2,048 independent samples to fit cc, then a separate 8,192 samples to evaluate both the raw and controlled means. It repeats this procedure 256 times. Exact rejection sampling uses a standard Gaussian proposal and acceptance e−λx4/4e^{-\lambda x^4/4}, so these measurements contain no Markov-chain autocorrelation. They do include pilot-fit randomness.

    The average fitted coefficient is −0.30624-0.30624. The standard deviation of the estimated mean across runs falls from 0.0061230.006123 to 0.0016690.001669, a variance reduction of 13.45 at the same evaluation sample count. The controlled average over the runs is 0.467934950.46793495, consistent with quadrature at the measured repeated-run precision.

    The fit costs samples too. Counting a pilot plus evaluation as 10,240 accepted samples, versus 8,192 for the raw baseline, changes the corresponding sample-cost gain to about 13.45/1.25=10.7613.45/1.25=10.76. This count omits the small additional arithmetic of evaluating the control and fitting the coefficient.

    Couple four field variables

    Let ϕ4=ϕ0\phi_4=\phi_0 and define the periodic Euclidean action

    S(ϕ)=12∑i=03[(ϕi+1−ϕi)2+ϕi2]+λ4∑i=03ϕi4,O(ϕ)=14∑i=03ϕi2,λ=0.5.\begin{aligned} S(\phi)&=\frac12\sum_{i=0}^{3} \left[(\phi_{i+1}-\phi_i)^2+\phi_i^2\right] +\frac\lambda4\sum_{i=0}^{3}\phi_i^4,\\ O(\phi)&=\frac14\sum_{i=0}^{3}\phi_i^2, \qquad \lambda=0.5. \end{aligned}

    Write the quadratic part as ϕTKϕ/2\phi^TK\phi/2, with Kii=3K_{ii}=3 and nearest-neighbor entries −1-1. Choosing vi=ϕi/4v_i=\phi_i/4 gives

    G=1−14(ϕTKϕ+λ∑iϕi4).G=1-\frac14\left(\phi^TK\phi+ \lambda\sum_i\phi_i^4\right).

    The field identity includes the coupling between sites: replacing ϕTKϕ\phi^TK\phi by ∑iϕi2\sum_i\phi_i^2 would give a nonzero-mean control and bias the answer.

    Gaussian-coordinate quadrature with 32 and 40 nodes per coordinate changes ⟨O⟩\langle O\rangle by 3.4×10−103.4\times10^{-10}, giving 0.3570188046200.357018804620 at the finer order. This is a numerical convergence comparison, not a rigorous quadrature error bound. The independent sampling calculation uses the covariance K−1K^{-1} as its Gaussian proposal and accepts with exp⁡[−λ∑iϕi4/4]\exp[-\lambda\sum_i\phi_i^4/4].

    Quantity, 256 runsRaw mean estimatorControlled estimator
    Average estimate0.356798280.35699358
    Standard deviation across runs0.00295740.0013559
    Variance ratio, raw/controlled4.76

    The pilot and evaluation sizes are the same as in the one-variable example. With the pilot included, the accepted-sample cost gain is approximately 3.81 before extra arithmetic. The nonzero statistical estimates of ⟨G⟩\langle G\rangle are also checked against zero over repeated runs; setting them to zero by hand would conceal a possible implementation error.

    Keep fitting separate from evaluation

    If cc is fitted on independent pilot data, then conditional on that fit,

    E[O^c∣c]=⟨O⟩.\mathbb E[\widehat O_c\mid c]=\langle O\rangle.

    Averaging over pilot fits preserves unbiasedness. If the same measurements fit cc and evaluate O^c\widehat O_c, cc is correlated with their mean control; the cancellation need not hold. This is a finite-sample issue even when the field identity is exact. Overfitting is especially relevant for flexible controls; Bedaque and Oh, §IIB discuss training and evaluation in this setting.

    For independent data, one can cross-fit: train on one subset and evaluate on another, then interchange their roles. The combined uncertainty must account for the dependence between fitted estimates. A split in one correlated Markov chain is not automatically an independent split; use independent chains or justify the separation.

    For Markov samples, minimizing the single-configuration variance need not minimize the variance of the sample mean. The latter depends on all time-lag covariances. A control that cancels rapid fluctuations can leave the slowest mode untouched. Check the autocorrelation of OcO_c itself and include fitting cost in any efficiency comparison.

    Summary

    A vanishing field-space boundary term supplies a zero-mean control. The covariance with the target observable determines the best fixed coefficient. Independent fitting preserves the estimator's expectation; independent quadrature and repeated runs test both the target and the measured variance reduction in the examples above.

    Exercises

    A finite boundary matters

    Restrict the unit Gaussian to [−L,L][-L,L] with normalization ZL=∫−LLe−x2/2 dxZ_L=\int_{-L}^{L}e^{-x^2/2}\,\mathrm dx. Is G=1−x2G=1-x^2 still a zero-mean control?

    Solution

    Integrating ∂x(xe−x2/2)\partial_x(xe^{-x^2/2}) yields

    ⟨G⟩L=2Le−L2/2ZL>0.\langle G\rangle_L=\frac{2Le^{-L^2/2}}{Z_L}>0.

    The boundary flux is not zero. Using O−cGO-cG would shift the expectation by −c⟨G⟩L-c\langle G\rangle_L. One can subtract the known mean from GG, or choose a function vv whose boundary values make the flux vanish. The infinite-domain identity follows only as L→∞L\to\infty.

    A fitted coefficient can create bias

    Let X∼N(0,1)X\sim N(0,1), O=X2O=X^2, and G=XG=X. Every fixed-coefficient estimator O−cGO-cG has expectation one. What happens if a single observation is used to choose c=Xc=X?

    Solution

    Using the same draw gives X2−X⋅X=0X^2-X\cdot X=0. With an independent pilot YY and c=Yc=Y, E(X2−YX)=1\mathbb E(X^2-YX)=1 because E(YX)=0\mathbb E(YX)=0. A zero-mean control guarantees unchanged expectation for fixed or independently fitted coefficients; efficiency still needs a variance check.

    References

    • P. F. Bedaque and H. Oh, “Leveraging neural control variates for enhanced precision in lattice field theory,” Physical Review D 109, 094519 (2024), doi:10.1103/PhysRevD.109.094519, §§IIA–IIB.

    Reproducible calculations: examples/computational-qft/monte-carlo-methods/README.md.

    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.