N=4 Gaussian Wilson loop
Before this lesson: Evaluate the circular Wilson loop at finite N.
Can a direct matrix calculation reproduce an exact field-theory observable, including its finite-color correction? This laboratory samples the Gaussian integral for the normalized fundamental half-BPS circle. You will compare its mean with the exact finite polynomial, remove the central mode, and measure the difference from the planar answer.
Prepare with the finite-rank Wilson loop, which owns the analytic derivation. The later planar comparison also uses the planar limit and strong coupling. This code evaluates the already localized integral. Sampling agreement tests that integral’s implementation; the localization argument is separate.
The parent is massless four-dimensional N=4 SYM, with sixteen real Poincaré supercharges in flat space. The physical non-Abelian target here is , , of gauge rank . We first sample a Hermitian matrix and then remove its trace. Neither the number of random matrices nor their computational precision counts supercharges or gauge rank.
Fix the distribution and insertion
Section titled “Fix the distribution and insertion”All sampled variables are dimensionless. Keep and , where is the sphere radius and the dimensionful localization coordinate. For ,
The contour is the full space of Hermitian matrices. The trace is the ordinary fundamental trace, divided by only in the insertion. At zero coupling the distribution collapses to and the continuous answer is one.
The formula and finite polynomial agree with Drukker–Gross (2.25)–(2.27). That paper’s Gaussian proposal and Pestun’s later localization proof have different logical roles. The prerequisite explains the theory and contour translation before this numerical calculation.
Set . A diagonal entry has variance . Each real and imaginary part of an off-diagonal entry has variance : the trace square contains twice its absolute square. Draw independent real standard-normal matrices , put , and form
For example, , while for its real part is . The two terms are independent, giving variance . Different independent entries remain independent. This constructs the required measure without a Markov chain, equilibration time or autocorrelation correction.
The eigenvalues are not sampled independently. Their repulsion is already generated by diagonalizing the full random matrix. Multiplying these samples by another squared Vandermonde would count that measure factor twice.
Translate matrices into measurements
Section titled “Translate matrices into measurements”If are the eigenvalues of one sample, calculate
Subtracting projects the matrix to its traceless part; it does not require a second diagonalization. The same Gaussian action induces the desired measure on that subspace. Keep the original while projecting.
| Mathematical quantity | Code name |
|---|---|
| Color number | n |
| ‘t Hooft coupling | coupling |
| Independent sample count | count or --samples |
| Hermitian matrices and eigenvalues | matrices, eigenvalues |
| Central coordinate | centers |
| One normalized insertion | u, su |
| Precision of analytic calculations | --dps |
The complete sampling core is short:
a = rng.standard_normal((size,n,n)) + 1j*rng.standard_normal((size,n,n))matrices = (a + a.conj().swapaxes(1,2)) * (math.sqrt(v)/2)centers = np.trace(matrices, axis1=1, axis2=2).real/neigenvalues = np.linalg.eigvalsh(matrices)u = np.exp(eigenvalues).mean(axis=1)su = np.exp(eigenvalues-centers[:,None]).mean(axis=1)The released script processes batches of 2,048 matrices and retains scalar measurements. Its random generator is explicitly PCG64 with seed 20261020 in the default run. The seed makes the calculation reproducible; it does not turn a random estimate into an exact result.
Download and reproduce
Section titled “Download and reproduce”Download the complete lab (ZIP) with the program, pinned dependencies, reference output and run instructions.
Save the editable calculation, pinned requirements, and expected output in one folder. The tested environment is Python 3.13.7, NumPy 2.1.2 and mpmath 1.3.0. The calculation needs no network after installation and no external data file.
In PowerShell, run from that folder:
python -m venv .venv.venv/Scripts/python.exe -m pip install -r requirements.txt.venv/Scripts/python.exe wilson_loop.pyOn macOS or Linux, create the environment with python3 -m venv .venv and replace the interpreter path in the other commands by .venv/bin/python. The default run uses , , and independent matrices. Use --help to see the input controls. The full_matrix_targets values are computed at the requested precision and formatted as decimal strings, with 25 significant digits for the loop values. The sampling entries, including their target copies, use ordinary double precision. Minor last-digit differences can occur between numerical libraries and platforms.
The recorded run gives:
| Observable | Sample mean | Estimated standard error | Exact target |
|---|---|---|---|
| loop | 1.59426797 | 0.00188056 | 1.59422774 |
| loop | 1.54544235 | 0.00094836 | 1.54517851 |
| 0.06254535 | 0.00034244 | 0.0625 | |
| 1.00031549 | 0.00137948 | 1 |
The loop discrepancies are about and estimated standard errors. The exact targets therefore agree well with this run. The extra digits in the exact column do not imply that many digits of sampling accuracy.
Attach an uncertainty to the mean
Section titled “Attach an uncertainty to the mean”For independent sample values , the script uses
This estimates the random error of the mean, rather than the spread of individual values. Under an adequate central-limit approximation, roughly twice this standard error gives a useful approximate interval. It is not a rigorous enclosure, and no particular run is guaranteed to lie within it. Exponentials amplify rare large eigenvalues; at stronger coupling a small sample can underestimate its own variance. Check additional seeds and sample sizes before trusting a small error estimate there.
The default output also reports its first 16,384 samples. Their standard error is , approximately twice the final error, as the law predicts. Their mean is . Individual discrepancies need not decrease monotonically, and nested prefixes are correlated; they are not independent replications.
The central-mode relation is
It follows from the independent Gaussian coordinate , of variance , as in Drukker–Gross (5.1). To test it on correlated samples, form before computing its standard error. The default mean is with error , consistent with zero. Adding two error estimates as if the measurements came from separate samples would discard their covariance. A fit of to these data would also be a different test from using its independently predicted value.
Check the implementation by another method
Section titled “Check the implementation by another method”The exact evaluator uses a positive finite sum. Start and update
All terms are nonnegative for the stated coupling. This avoids cancellation between alternating polynomial terms. Multiplication by gives the exact target. The script repeats the sum with twenty extra decimal digits as a precision probe. Raising --dps improves this part of the calculation; it does not change the double-precision random matrices or reduce their sampling noise.
An independent deterministic check uses a traceless two-by-two matrix . Its eigenvalues are and . The full three-dimensional Gaussian therefore reduces to
The script integrates the numerator and denominator separately, and independently integrates the center. It compares these results with the finite sum at . The Abelian answer and zero-coupling limits provide further checks. A traceless one-by-one matrix is identically zero; its unit insertion is a mathematical check, not a claim of interacting gauge theory.
All 24 analytic comparisons pass at 60 decimal digits, with maximum scaled residual about against a tolerance. This is observed high-precision agreement, not an interval-arithmetic quadrature proof. These checks have different errors from random sampling.
Planar comparison
Section titled “Planar comparison”The planar lesson gives after taking at fixed . At , . The deterministic finite-rank differences are:
| 4 | 0.00225751 | -0.02857871 |
| 8 | 0.00056407 | -0.00722238 |
The central subtraction is appreciably larger than the genus correction at this coupling. Their signs need not match. The approximately fourfold improvement on doubling is consistent with the fixed-coupling expansion.
These numbers use exact formulas and contain no sampling noise. Raising the sample count reduces uncertainty around a fixed finite-rank target. Raising changes that target and its difference from the planar answer. Increasing arithmetic precision changes neither physical effect. Strong coupling is a further approximation and is not needed for this comparison.
Change one input
Section titled “Change one input”1. Double the color number
Section titled “1. Double the color number”Run wilson_loop.py --n 8, leaving the coupling and sample count at their defaults. Predict which coupling parameter changes and which error is expected to improve. Is this the same as keeping fixed?
Hint 1
Use . The number of samples is a separate input.
Hint 2
Compare the exact finite-rank ratios in the table before assessing a random estimate.
Solution
changes from one to one-half. The prescribed experiment keeps , as required for the stated planar comparison. Holding fixed instead would double and compare different entries of the planar function.
The recorded run gives and , where the uncertainties are estimated standard errors. The exact values are and . Their deviations are about and standard errors. The deterministic planar error improves as shown above. The sampling variance also changes with the distribution, so equal sample counts do not require equal standard errors.
2. Remove the off-diagonal entries
Section titled “2. Remove the off-diagonal entries”Run wilson_loop.py --diagonal-only. This deliberately samples a different measure. Predict its loop and its normalized trace-square mean. Can the central-factor test alone detect the error?
Hint 1
Each retained diagonal entry is an independent normal variable of variance . Its exponential mean is .
Hint 2
The mean of the diagonal entries still has variance . Projecting that Gaussian vector removes one independent direction.
Solution
The wrong full-matrix model gives and . At the default inputs its loop is , compared with the correct . The recorded negative-control sample gives , close to its own incorrect-model prediction.
After subtracting the mean diagonal entry, each remaining component has variance , so its loop is . The ratio of these two incorrect answers is still . Thus the central-factor test passes even though the non-Abelian fluctuations are absent. A useful verification combines the trace-square normalization, an independent finite-rank answer and the center test. One successful identity does not certify the whole implementation.
This laboratory establishes a reproducible computation of a specified matrix observable, with distinct arithmetic, statistical and approximation checks. It does not infer a full field-theory spectrum from one loop or replace the supersymmetry argument that selected the integral.