- Home
- Library
- Computational Quantum Field Theory
- Integrating a Field-Theory Observable
- Multidimensional and Quasi-Monte Carlo Integration
Multidimensional and Quasi-Monte Carlo Integration
A two-parameter loop integral can be smooth and still concentrate most of its variation along a thin strip. A tensor quadrature resolves every coordinate at the same order; adaptive cubature concentrates cells where a local indicator is large; Monte Carlo and randomized low-discrepancy rules distribute samples differently again. Which method earns its precision depends on the integrand and on how all its evaluations are counted.
We compare these choices on a correlated Gaussian and a positive Euclidean bubble integral. Both have independently computed references. This is a controlled two-dimensional example, not a demonstration that one method wins in every dimension. Familiarity with adaptive quadrature and the elementary variance of a sample mean is sufficient.
Four ways to spend an evaluation budget
Let
A tensor Gauss rule of order in each coordinate uses points. Polynomial exactness is powerful for a smooth low-dimensional integrand, but the cost grows exponentially with . Our two-dimensional comparison reports the order- result and uses the difference from order as an indicator. Both rules count toward the budget; their difference is not a statistical error bar.
The adaptive method uses products of three- and five-point Gauss rules on each rectangle. Its local value and indicator are
One cell costs evaluations. Bisect the longest side of the cell with the largest ; ties choose the first coordinate. Replace it by two children and repeat until the next split would exceed the budget. The value is and the indicator is . This intentionally simple algorithm is implemented in the companion; it is not an invocation of a newer SciPy cubature interface. The tested SciPy version is 1.13.1.
For ordinary Monte Carlo, independent uniform points give
provided the integrand has finite variance. There is no exponent here, but dimension can still make the variance or the cost of one evaluation very large. Geometry matters through the distribution of .
A Sobol rule instead places points to cover the cube with low discrepancy. Its points are deliberately dependent. A single deterministic Sobol estimate has no independent-sample standard error obtained by inserting its point values into the Monte Carlo formula.
Randomize the rule, then estimate variation between rules
For replicate , independently scramble a complete Sobol point set of size , obtaining
The samples within are dependent. The independently randomized replicate estimates are the observations used for uncertainty:
Under the ideal uniform randomization, each replicate integrates without bias, while dependence within a replicate can reduce its variance. Finite digital precision and floating-point evaluation are additional numerical effects, not part of this replicate standard error. A Student interval using degrees of freedom is a useful approximation when the replicate means are reasonably regular; a small number of replicates does not certify its coverage.
The implementation uses SciPy's linear matrix scramble followed by a digital shift, with bits=52. Every replicate uses a power-of-two prefix; no points are skipped or thinned. These choices follow the tested Sobol documentation, “Notes” and “Warning.” The qmc_quad documentation, “Notes,” explains the same distinction between point sets and independent integral estimates. The companion uses an explicit replicate loop so every seed and replicate mean is retained.
Here . Ordinary Monte Carlo is also organized into twenty independent groups, with the same formula for the uncertainty of their average. For each method, larger budgets reuse complete prefixes of each group's stream. The rows at different budgets are consequently correlated refinement observations, not independent repetitions of the whole experiment.
A narrow correlated Gaussian on a square
Take a bivariate normal density restricted to the unit square. Its parameters are
Writing and , the density is
The integral over the square is a probability, not automatically . A reference reduces the problem to a different one-dimensional calculation. Conditional on ,
If is the standard normal cumulative distribution and the marginal density, then
Gauss orders 128 and 256 each differ by less than from the adaptive one-dimensional reference
That agreement limits how meaningfully we interpret a two-dimensional result already at the level. It is not an interval-arithmetic enclosure.
A transformed Feynman-parameter integral
For the same dimensionless bubble as the preceding article,
Introduce a second parameter through the exact identity
Thus the positive two-dimensional representation is
This is an auxiliary-parameter representation of the subtracted one-loop bubble; it is not a two-loop graph. At , variation near makes a useful numerical test. Because , set
The endpoints remain and . The transformed integrand is
Near the most rapidly varying region, the map gives more of the parameter interval to small . The Jacobian is essential: dropping it changes the integral rather than improving its evaluation.
At the declared , direct one-dimensional logarithmic integration and the independently implemented analytic bubble give
This reference is outside the compared evaluation budgets. The positive Euclidean denominator avoids the threshold and branch problems treated in contour deformation.
Equal caps, explicit counts, and retained outcomes
The three caps are , , and scalar integrand evaluations. Tensor fine orders , , and , together with their half-order comparisons, exactly use those caps. Monte Carlo and scrambled Sobol use twenty groups of respectively , , and points.
The adaptive rule cannot consume arbitrary counts in its 68-evaluation split increments. Its actual counts are , , and . They share the same caps, but are slightly smaller; no dummy evaluations are added. References and separate correctness checks are not included in the competing production budgets.
At the middle cap, the comparison is:
| Integrand | Method | Absolute error | Indicator or replicate SE |
|---|---|---|---|
| Gaussian | Tensor | indicator | |
| Gaussian | Adaptive | indicator | |
| Gaussian | MC | SE | |
| Gaussian | Sobol | SE | |
| Mapped bubble | Tensor | indicator | |
| Mapped bubble | Adaptive | indicator | |
| Mapped bubble | MC | SE | |
| Mapped bubble | Sobol | SE |
The tensor rule is excellent for these smooth two-dimensional examples. The deliberately low-order adaptive indicator is conservative here, although the preceding article shows that such indicators can also fail completely. Neither indicator should be read as a Gaussian standard deviation.
The variable change helps the randomized bubble estimates as well. At the largest cap, the MC SE decreases from for the raw representation to for the mapped one; the Sobol SE decreases from to . Each uncertainty estimate uses separate seeds.
Actual absolute errors are measured against the independent references; these curves are not uncertainty intervals. Each randomized point includes all twenty replicas. Tensor errors near are at the scale of reference and binary64 agreement. Larger prefixes need not reduce the realized random error monotonically.
For example, the largest Gaussian Sobol estimate lies about estimated standard errors above the reference. This result is retained. Three correlated budget rows and twenty scrambles per row do not establish coverage, a universal convergence exponent, or performance in high-dimensional singular integrals. Importance sampling, analytic subtraction, and suitable variable changes can change the comparison substantially.
Reproduction
Run python3 examples/computational-qft/numerical-integration/multidimensional_rules.py to regenerate cubature-results.json. Seeds are SeedSequence([881025, method, case, replica]), with method for MC and for Sobol, and cases for Gaussian, raw bubble, and mapped bubble. The output retains all replica means, exact evaluation counts, reference refinements, and rectangular normalization checks.
For general integrals, choose a representation before choosing a sampling engine. Tensor rules exploit low dimension and smoothness. Adaptive cubature exploits localized variation when its indicators see it. Randomized methods become especially useful when a tensor grid is too expensive, but still require variance control and honest accounting of independent replicates.
Exercises
1. Verify the bubble map and its normalization
Derive the two-parameter representation from , show that the transformed endpoints are correct, and evaluate the integral at fixed . What happens as ?
Solution
For ,
With this proves the representation. Since , the proposed map gives and . Its derivative is positive, so it is one-to-one. Direct substitution gives
As , and . The transformed and original integrands approach , and . At exactly , use this limiting map rather than dividing two zeros in its formula.
2. Count the independent observations
Twenty independently scrambled rules each use points. Derive the standard error of their average from their twenty integral estimates. Explain why taking the sample standard deviation of all point values and dividing by gives a different, generally unjustified answer.
Solution
If the replicate estimates have common variance and are independent, their average has variance . The unbiased estimator of is
Consequently
Within one scrambled rule,
The terms with generally do not vanish. A pointwise iid formula discards precisely the dependence that makes the rule useful. The twenty randomizations cost evaluations in total. With only one deterministic rule, even the between-replicate variance is unavailable.
Summary
Compare methods at declared total costs and compare like quantities. Deterministic refinement indicators, realized errors against a reference, and randomized standard errors answer different questions. The transformed bubble shows why preserving a Jacobian and improving an integrand's geometry can matter as much as changing the integration algorithm.
References
- SciPy developers, SciPy 1.13.1 Manual,
scipy.integrate.qmc_quad, parametersn_estimatesandn_pointsand the replicate-error discussion in “Notes.” - SciPy developers, SciPy 1.13.1 Manual,
scipy.stats.qmc.Sobol, scrambling,seed,random_base2, and the warnings about skipped or thinned sequences.
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.