- Home
- Reference
- Sources and Software
- Scientific Software for QFT
Scientific Software for QFT
Choose software for a specified calculation and keep its conventions visible. A useful result consists of the expression or number and the assumptions, parameter definitions and reproducible inputs that produced it.
Match the tool to the calculation
| Task | Tool and principal check |
|---|---|
| Exact scalar or matrix algebra | SymPy: use exact rationals and explicit assumptions; compare a small identity by hand. |
| Numerical integration and linear algebra | SciPy: inspect algorithm conditions and error estimates; vary resolution or tolerances and compare a benchmark. |
| Dirac, color and perturbative algebra | FeynCalc: match the metric, dimension, trace and prescription before importing an amplitude. |
| Dimensionally regulated parametric integrals | pySecDec: match loop measures, regulator dimension and prefactors as well as kinematics. |
| Model-based scattering generation | MadGraph model tools: verify the chosen model, parameter restrictions, perturbative order and process definition. |
A loop integral normalized with differs from one normalized with . A package name is not a convention specification. See dimensional integrals before comparing finite coefficients.
Benchmark a subtracted loop integral
A program can return the correct precision for an integral and still lose most of it when two results are subtracted. A useful test is the equal-mass scalar bubble at spacelike momentum. With , the finite difference in the one-loop convention is , where
Two reference values follow without any choice of loop regulator. The substitution and integration by parts give , with . Expanding the logarithm under the integral gives . The positive leading term means that the subtracted spacelike bubble is negative in the stated convention.
from math import atanh, log1p, sqrt
from scipy.integrate import quad
for t in (1.0, 1e-12):
a = sqrt(1 + 4/t)
closed = 2 * (a * atanh(1/a) - 1)
direct, error = quad(lambda x: log1p(t*x*(1-x)), 0, 1,
epsabs=0, epsrel=1e-12)
print(t, closed, direct, direct/t)
At both forms give . At , the ratio should approach . The quadrature with log1p gives on the checked run. The closed form subtracts two numbers near one and had a relative error of about in that run. Estimate the loss by comparing with the series at the same . The quadrature error estimate covers the integral supplied to the program. SciPy quadrature options · Loop integral and threshold derivation.
For symbolic work, keep rationals exact and state parameter domains before simplification. The handbook example uses in an exponential integral. In SymPy, Rational(1, 3) preserves an exact third. SymPy exact numbers and assumptions.
Preserve the physical and numerical problem
A small useful record includes the program and package versions, input parameters with units, gauge and regulator choices, random seed when relevant, precision and tolerances, and the script or notebook that generates the selected output. For Monte Carlo data also retain sampling and autocorrelation information; a seed does not determine the statistical error by itself.
Check a physical identity before scaling up: current conservation for an amplitude, a free spectrum for a lattice operator, a known integral for quadrature, or probability conservation for time evolution. Then vary the numerical control independently of physical approximations. Increasing arithmetic precision does not remove a finite-volume effect or repair an incorrect operator basis.
Use the package authors' installation and citation instructions for the version selected. For the scientific error analysis continue to numerical convergence and Monte Carlo errors.
Documentation
- SymPy. Exact numbers and assumptions.
- SciPy. One-dimensional adaptive quadrature.
- FeynCalc. Official description and documentation links.
- pySecDec. Reference guide and integral-normalization FAQ.
- MadGraph. Model documentation.
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.