Skip to content
QFT.org

Search QFT.org

Enter a word or phrase.

    You can also browse the main navigation and chapter contents.

    Designing a Numerical Field-Theory Calculation

    A free particle of energy 0.37 produces a spectral line inside a detector’s energy window from 0 to 1. A numerical integral reports zero weight, zero error and a successful exit. How would we find out what went wrong? We can derive the true answer before running the calculation. Moving one edge of the detector across the line then exposes a second error that even exact integration cannot repair.

    Preparation. Use the harmonic-oscillator vacuum, a Gaussian density and elementary Fourier modes. The experiment takes place in a free real scalar field in one spatial dimension with periodic length LL, continuous time and c=ℏ=1c=\hbar=1. Energies below are in units of the window’s upper edge.

    Give the calculation a measured quantity

    Take the spatial Fourier mode with p=2π/Lp=2\pi/L, normalized by L−1/2L^{-1/2}. In the oscillator vacuum,

    E=m2+p2,⟨ϕp(t)ϕ−p(0)⟩=e−iEt2E.\begin{aligned} E&=\sqrt{m^2+p^2},\\ \langle\phi_p(t)\phi_{-p}(0)\rangle&=\frac{e^{-iEt}}{2E}. \end{aligned}

    The forward time transform uses eiωte^{i\omega t}. Acting with the field creates one quantum, so the greater correlator has one positive-frequency line of area 1/(2E)1/(2E) in the measure dω/(2π)d\omega/(2\pi). The free scalar spectral representation gives the two thermal lines and their zero-temperature limit. Laine and Vuorinen, §8.1, Eqs. (8.30)–(8.36)

    Suppose the instrument reports an energy xx with density

    gσ(x−E)=e−[(x−E)/σ]2π σ.g_\sigma(x-E)=\frac{e^{-[(x-E)/\sigma]^2}}{\sqrt\pi\,\sigma}.

    Its standard deviation is σ/2\sigma/\sqrt2. It has unit integral, so the measured line retains the original area. Set m=0.30m=0.30, choose p=0.372−m2p=\sqrt{0.37^2-m^2} so E=0.37E=0.37, and use σ=0.002\sigma=0.002. Multiply the measured greater-correlator weight in a bin [l,u][l,u] by the fixed continuum factor 2E2E to define W(l,u)W(l,u). For this field and instrument the answer is

    W(l,u)=∫lugσ(x−E) dx,=12[erf⁡(zu)−erf⁡(zl)],zb=(b−E)/σ.\begin{aligned} W(l,u)&=\int_l^u g_\sigma(x-E)\,dx,\\ &=\tfrac12[\operatorname{erf}(z_u)-\operatorname{erf}(z_l)],\\ z_b&=(b-E)/\sigma. \end{aligned}

    This independent reference follows by a change of variable. For [0,1][0,1] it equals one to binary64 precision. For the bin [0,E][0,E] the upper edge divides the Gaussian in half and the lower edge is 185 widths below the line. Its weight is one half to the same precision. The intrinsic particle is stable in this model. A decay width or a continuum of multiparticle states would enter the field spectrum before convolution with the detector.

    Make a missed line fail a known test

    The integrand for the wide bin is exactly the narrow Gaussian in the adaptive quadrature calculation. Its pair of three- and five-point Gauss rules samples the interval eight times. All those values round to zero. The two rules therefore agree on zero and the algorithm stops. Reuse the same rules and tolerance, but start with boundaries at E−8σE-8\sigma, EE and E+8σE+8\sigma as well as the two bin edges.

    Starting intervalsWeightError indicatorEvaluations
    Whole bin008
    Split about the line1.00000000000000029.67×10−119.67\times10^{-11}1,280

    The split calculation passes the absolute error target 10−1010^{-10} when checked against the error function. To decide how much of a Gaussian may safely be dropped, the stronger statement is analytic: the probability outside eight widths on both sides is erfc⁡(8)<1.13×10−29\operatorname{erfc}(8)<1.13\times10^{-29}. A real measurement can have a different instrument response, which would change this bound.

    Hold the instrument fixed while refining the field

    Represent the spatial field by NN sites of spacing a=L/Na=L/N, with the nearest-neighbor gradient. This specifies a regulator with maximum spatial momentum π/a\pi/a. On the plane wave eipjae^{ipja} the periodic negative second difference has eigenvalue p^2\widehat p^2. It follows that

    p^=2asin⁡(pa/2),Ea=m2+p^2.\begin{aligned} \widehat p&=\frac{2}{a}\sin(pa/2),\\ E_a&=\sqrt{m^2+\widehat p^2}. \end{aligned}

    Time and frequency are still continuous. The regulated mode has weight 1/(2Ea)1/(2E_a). Keep the continuum normalization 2E2E, the physical bin edge EE and the detector width fixed. Call its shifted detector density ga(x)=gσ(x−Ea)g_a(x)=g_\sigma(x-E_a). The exact answer on this lattice is now

    Ia=∫0Ega(x) dx,Wa(0,E)=EEaIa.\begin{aligned} I_a&=\int_0^E g_a(x)\,dx,\\ W_a(0,E)&=\frac{E}{E_a}I_a . \end{aligned}

    The lattice line lies slightly lower in the bin, increasing its accepted fraction. The companion verifies the dispersion by applying the actual periodic difference matrix to the selected wave. It then evaluates the bin integral with the error function, eliminating the quadrature error from this comparison.

    Sites NNEaE_aFixed-bin weight
    240.3696390.601421
    480.3699100.525629
    960.3699770.506412
    1920.3699940.501603

    Once ∣Ea−E∣≪σ|E_a-E|\ll\sigma, doubling NN reduces the excess above 1/21/2 by about four. The correction arises because p^=p−p3a2/24+O(a4)\widehat p=p-p^3a^2/24+O(a^4). At 384 sites the weight is 0.5004010.500401, meeting an absolute target of 10−310^{-3} for the stated model. Moving the bin edge to EaE_a at every spacing would center the cut on each displaced line and hide its leading acceptance error. The calculation holds LL and its chosen mode fixed. A general interacting finite-volume measurement would require a separate volume study.

    Two resolved Gaussian lines at a fixed bin edge. The dashed 12-site lattice peak is shifted left, increasing its accepted area above the continuum value of one half.
    The shaded region is the energy accepted below the same bin edge. The coarse 12-site field gives weight 0.848608 there. The solid continuum peak gives 0.5. Both use the same detector width.

    Count samples and guard the last digits

    One can sample the instrument instead of integrating its density. Draw x=E+(σ/2)Zx=E+(\sigma/\sqrt2)Z with ZZ standard normal and average the indicator of 0≤x≤E0\le x\le E. Independent measurements then give variance W(1−W)/nW(1-W)/n. For 65,536 draws the standard error is 0.0019530.001953. In 32 seeded repetitions the first fraction was 0.4996800.499680 and the root-mean-square error was 0.0019170.001917. The standard error describes repeated sampling at fixed field and instrument. A biased lattice pole position shifts the mean of those repetitions.

    For a far-tail bin from E+6σE+6\sigma to E+7σE+7\sigma, subtracting the two binary64 error functions gives zero: both have rounded to one. Using complementary tails gives

    Wtail=12[erfc⁡(6)−erfc⁡(7)]=1.07598×10−17.\begin{aligned} W_{\rm tail}&=\tfrac12[\operatorname{erfc}(6)-\operatorname{erfc}(7)]\\ &=1.07598\times10^{-17}. \end{aligned}

    Here the analytic distribution is the same in both evaluations. More samples cannot restore digits lost by that subtraction. Direct counting also becomes impractical because the expected number of accepted events is only nWnW.

    Choose the next calculation

    Exercises

    1. How many independent observations are needed? Choose a one-standard-error target of 10−310^{-3} for the half-line bin in the continuum model. Compare it with the deterministic lattice error at 192 sites.

    Solution

    Here W=1/2W=1/2 to the stated precision, so W(1−W)/n≤10−3\sqrt{W(1-W)/n}\le10^{-3} requires at least 250,000 independent draws. The lattice bias at 192 sites is about 0.0016030.001603, larger than that target. Taking more draws on this particular lattice reduces the sampling error around the wrong continuum mean. Refining to 384 sites brings the deterministic bias to about 0.0004010.000401.

    2. Why does the bin edge amplify a small dispersion error? Expand the regulated half-bin about Ea=E+δE_a=E+\delta to first order, neglecting the lower Gaussian tail. Which term is largest here?

    Solution

    The upper standardized limit is −δ/σ-\delta/\sigma and the lower limit may be replaced by −∞-\infty. Expanding the accepted fraction and the fixed normalization gives

    Wa−12=−Cδ+O(δ2),C=1π σ+12E\begin{aligned} W_a-\tfrac12&=-C\delta+O(\delta^2),\\ C&=\frac{1}{\sqrt\pi\,\sigma}+\frac{1}{2E} \end{aligned}

    at fixed positive E,σE,\sigma. The pole shifts down, so δ<0\delta<0 and both terms increase the weight. The acceptance term is larger by 2E/(π σ)≃2092E/(\sqrt\pi\,\sigma)\simeq209. This explains why the observed bin error need not be comparable to the relative eigenvalue error.

    References and reproducibility

    • Mikko Laine and Aleksi Vuorinen, Basics of Thermal Field Theory, §8.1, Eqs. (8.30)–(8.36). Take the zero-temperature greater correlator, with the forward time transform specified above.
    • The original G3/G5 rule and its missed Gaussian live in examples/computational-qft/numerical-integration/adaptive_quadrature.py. The adjacent smeared_scalar_line.py reuses this rule and records the exact bin weights, lattice refinements, seeded samples and tail subtraction.

    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.