---
title: Loop Library in Perturbative QFT
url: https://www.emergentmind.com/topics/loop-library
type: topic
---

# Loop Library in Perturbative QFT

Searching arXiv for the specified loop-library papers to ground the article in the primary sources.
A loop library is a numerical software library for evaluating the scalar integrals, tensor form factors, and related special functions that enter loop amplitudes in perturbative quantum field theory. In the one-loop setting, representative libraries include QCDLoop, golem95C, and COLLIER, each of which provides implementations of master integrals such as $A_0$, $B_0$, $C_0$, and $D_0$, together with support for complex masses, divergent configurations, and interfaces to larger NLO tool chains [1605.03181]. Closely related packages extend the notion of a loop library in two directions: amplitude-level frameworks such as NGluon and BlackHat, which reconstruct complete one-loop amplitudes using generalized unitarity, and special-function back ends such as FastGPL, which target generalized polylogarithms appearing in multi-loop master integrals [1011.2900].

## 1. Terminological scope and representative libraries

In perturbative relativistic quantum field theory, the term “loop library” is used for software that evaluates loop integrals or provides loop-amplitude building blocks. QCDLoop is presented as “a comprehensive framework for one-loop scalar integrals,” with a modern object-oriented C++ design, extensions to complex masses, simultaneous double and quadruple precision, caching, and interfaces to Monte Carlo programs [1605.03181]. golem95C is a Fortran95 library for the numerical evaluation of one-loop scalar integrals and tensor form factors, including arbitrary complex internal masses and tensor ranks exceeding the number of propagators in its later extension [1101.5595]. COLLIER is a Fortran-based “Complex One-Loop LIbrary in Extended Regularizations” for scalar and tensor integrals up to $N=6$, with complex masses and both dimensional and mass regularization for infrared singularities [1604.06792].

A broader classification is useful because some libraries operate one level above the master-integral layer. NGluon is a C++ library for the numerical evaluation of colour-ordered one-loop amplitudes with an arbitrary number $n$ of external gluons in massless Yang–Mills theory, using $D$-dimensional generalized unitarity and interfacing to QCDLoop or FF for scalar integrals [1011.2900]. BlackHat likewise targets one-loop amplitudes through on-shell unitarity and generalized cuts, while delegating phase-space sampling and subtraction to SHERPA and related components [1310.2808]. At still higher loop order, FastGPL is a header-only C++ library for fast numerical evaluation of generalized polylogarithms up to weight $4$, together with $\operatorname{Li}_n$, Nielsen’s $S_{2,2}$, and the complete elliptic integrals $K$ and $E$, explicitly for multi-loop Feynman-integral and Monte Carlo applications [2112.04122].

| Library | Primary focus | Notable features stated in the sources |
|---|---|---|
| QCDLoop | One-loop scalar integrals | complex masses, double/quad precision, LRU cache, C/Fortran/Python wrappers |
| golem95C | One-loop scalar integrals and tensor form factors | complex masses, higher ranks, one-dimensional fallback for small Gram determinants |
| COLLIER | One-loop scalar and tensor integrals | complex masses, dimensional and mass regularization, independent back-ends |
| NGluon | Colour-ordered one-loop multi-gluon amplitudes | generalized unitarity, QCDLoop/FF interface, optional extended precision |
| BlackHat | One-loop amplitudes in NLO QCD workflows | generalized cuts, on-shell recursion or $D$-dimensional unitarity, ROOT n-tuples |
| FastGPL | Generalized polylogarithms for multi-loop integrals | hard-coded decomposition, overflow protection, weight $\le 4$ |

This landscape suggests that “loop library” is not restricted to a single software architecture. In practice, the phrase spans master-integral libraries, tensor-reduction libraries, amplitude providers, and special-function engines that are coupled into NLO or NNLO computational pipelines.

## 2. Mathematical objects and regularization conventions

The core one-loop objects are the scalar master integrals in dimensional regularization. QCDLoop defines, in $D=4-2\epsilon$ using the Bjorken–Drell metric and omitting the universal factor $r_\Gamma$, the tadpole, bubble, triangle, and box integrals as
$$
A_0(m^2)=(2\pi\mu)^{4-D}\int \frac{d^Dq}{i\pi^{D/2}}\cdot \frac{1}{q^2-m^2+i\,0},
$$
$$
B_0(p^2;m_1^2,m_2^2)=(2\pi\mu)^{4-D}\int \frac{d^Dq}{i\pi^{D/2}}\cdot \frac{1}{[(q^2-m_1^2+i\,0)((q+p)^2-m_2^2+i\,0)]},
$$
with analogous definitions for $C_0$ and $D_0$ in terms of shifted loop momenta and invariants such as $s_{ij}=(p_i+p_j)^2$ [1605.03181]. COLLIER defines the general $n$-point scalar function in dimensional regularization with ’t Hooft scale $\mu$ and uses a covariant decomposition of rank-$R$ tensor integrals into external momenta and metric tensors, returning either coefficient functions or tensor components [1604.06792].

Tensor libraries generalize these scalar bases through form-factor formalisms. golem95C defines
$$
I_N^{D,\mu_1\ldots\mu_r}(a_1,\ldots,a_r)
= \int d^Dq\,
\frac{q_{a_1}^{\mu_1}\ldots q_{a_r}^{\mu_r}}
{\prod_{i=1}^N (q_i^2-m_i^2+i\delta)},
$$
and decomposes the result into Lorentz structures built from shift-invariant vectors $\Delta_{ij}^\mu=r_i^\mu-r_j^\mu$ and $g^{\mu\nu}$, with scalar form factors $A^{N,r}$, $B^{N,r}$, $C^{N,r}$, and related objects [1312.3887]. The same library implements closed-form expressions for poles and finite parts of integrals with additional $(\tilde k^2)^\alpha$ numerators up to $\alpha=3$, thereby accounting for rational terms associated with the $(D-4)$-dimensional loop-momentum components [1312.3887].

Regularization is a defining differentiator among loop libraries. QCDLoop and golem95C are framed in dimensional regularization and return Laurent coefficients corresponding to the finite part, $1/\epsilon$, and $1/\epsilon^2$ poles [1605.03181]. COLLIER explicitly isolates UV and IR poles via coefficients multiplying combinations of $1/\epsilon$, $1/\epsilon^2$, and logarithms of user-defined scales $\mu_{\rm UV}$ and $\mu_{\rm IR}$, while also supporting mass regularization for soft and collinear singularities through a list of small regulator masses [1604.06792]. This suggests that loop libraries are not merely numerical evaluators of special functions; they encode a particular regularization and analytic-continuation convention, and downstream amplitude codes depend on those conventions being stable and explicit.

## 3. Software architecture and programming interfaces

QCDLoop exemplifies a modern templated architecture. All components live in the namespace `ql`, and three template parameters—`TOutput`, `TMass`, and `TScale`—enforce at compile time which combinations of real or complex arithmetic and double or quadruple precision are allowed [1605.03181]. Its core base classes are `Topology<TOutput,TMass,TScale>`, which defines the `integral(...)` interface and common argument checking; `Tools<TOutput,TMass,TScale>`, which supplies type-dependent constants and helper functions; and `LRUCache<Key,Value>`, which implements a generic least-recently-used cache for stored integral results [1605.03181]. Specializations include `TadPole`, `Bubble`, `Triangle`, and `Box`, while the high-level front end `QCDLoop<TOutput,TMass,TScale>` inspects argument lengths, selects the correct topology, and dispatches the call [1605.03181].

Fortran-oriented libraries use a different organizational style. In golem95C, a small set of modules hides the core routines: `precision_golem`, `matrice_s`, `form_factor_type`, `parametre`, `form_factor_Np`, and `ktilde` [1312.3887]. The typical call sequence is `initgolem95(N)`, population of the kinematic matrix $S$, `preparesmatrix()`, evaluation of form factors, and `exitgolem95()` [1312.3887]. COLLIER similarly exposes a global Fortran95 module, `COLLIER`, with initialization routines such as `Init_cll(Nmax,Rmax,...)`, per-event reset through `InitEvent_cll()`, and coefficient or tensor calls such as `C_cll`, `TN_cll`, and `Dten_cll` [1604.06792]. Its architecture includes two independent back-ends, `COLI` and `DD`, and a `TENSORS` submodule for full tensor construction and direct tensor-level reduction for $N\ge 6$ [1604.06792].

Interoperability is central. QCDLoop provides Fortran77/90 and C wrappers via `qlinit()`, `qlI1`, `qlI2`, `qlI3`, `qlI4`, together with complex-mass and quadruple-precision variants, and a Cython-built Python interface `qcdloop.QCDLoop` with an `.integral(mu2, mlist, plist)` method [1605.03181]. NGluon wraps scalar-integral back ends in `LoopIntegrals.{h,cpp}` and can be built against QCDLoop or FF, with optional extended precision through the QD library [1011.2900]. BlackHat integrates at the workflow level with SHERPA, COMIX, FastJet, and ROOT, and stores per-event data in ROOT `TTree` n-tuples containing momenta, helicities, and the partial weights $B$, $V$, $I$, and $R$ [1310.2808]. The common pattern is a separation between numerically delicate loop building blocks and the orchestration layers that handle phase-space generation, subtraction, and analysis.

## 4. Numerical stability, precision control, and caching

Numerical stability is one of the central technical problems addressed by loop libraries. In the Passarino–Veltman framework, tensor reduction introduces inverse Gram determinants, and small Gram determinants lead to ill-conditioned linear systems and large cancellations in floating-point arithmetic [1407.0087]. COLLIER addresses this by applying default Passarino–Veltman reduction for $N=3,4$ and switching near small Gram determinants to dedicated iterative expansions due to Denner and Dittmaier; for $N=5,6$ it uses direct algebraic reduction to lower-point and lower-rank integrals without inverse Gram determinants, and for $N\ge 7$ generalizes the 6-point algorithm [1604.06792]. golem95C takes a related approach: when $\|{\rm Gram}\|<{\tt PARAM\_EPS\_GRAM}$, it automatically triggers a one-dimensional numerical integration of the relevant Feynman-parameter integral, thereby ensuring stability in exceptional kinematics [1312.3887]. In the earlier golem95C formulation, reduction stops when $\hat B$ falls below the default threshold $\hat B_{\rm cut}=5\times 10^{-3}$, and the code switches to direct numerical evaluation of the basis integral via a one-dimensional parameter integral [1101.5595].

Complex masses are another stability device as well as a physical feature. QCDLoop allows all topologies to accept $m_i^2$ as complex variables so that propagators with $m_i-i\,\Gamma_i/2$ are handled automatically with the correct analytic continuation [1605.03181]. golem95C states that internally all $m_i^2$ may be complex and that no changes to reduction or numerical routines are required [1312.3887]. COLLIER and golem95C both emphasize that complex masses support the complex-mass scheme for unstable particles and regulate kinematic singularities associated with on-shell loops [1101.5595].

Precision management is implemented explicitly rather than implicitly assumed. QCDLoop supports simultaneous double and quadruple precision through its type system and reports that quadruple precision is on average approximately $1.8$–$3\times$ slower than double, depending on topology [1605.03181]. Its benchmarks also record an approximately $50\%$ overhead for divergent integrals when complex masses are used, with smaller effects for finite ones [1605.03181]. FastGPL uses `std::complex<double>` with an optional long-double fallback, sums series terms until the incremental term is below $10^{-(p+2)}$ with $p\approx 14$, and temporarily upgrades to long double when intermediate terms may overflow double precision [2112.04122]. This suggests a general design principle: high-performance loop libraries increasingly use adaptive precision only where analytically or numerically necessary, rather than globally promoting all evaluations to a slower format.

Caching is a further layer of numerical engineering. QCDLoop implements a default LU cache of size $1$, storing only the last result, and an LRU cache of user-defined size via `setCacheSize(N)` with Murmur hashing and `unordered_map` lookup [1605.03181]. COLLIER provides an optional global cache system and requires a per-event reset when that cache is used in Monte Carlo loops [1604.06792]. NGluon caches Berends–Giele currents to improve the scaling of tree-amplitude subcomputations from naive $O(n^4)$ to $O(n^3)$ [1011.2900]. In all three cases, the relevant optimization is not abstract memoization but the repeated occurrence of identical or nearly identical subproblems across cuts, reduction identities, or event-generator calls.

## 5. Performance characteristics and benchmark data

The benchmark literature shows that loop-library performance depends strongly on the object being evaluated. For QCDLoop 2.0, benchmarks on an i7-6500U at $2.5$ GHz with `-O2` report that, in double precision with real masses and $10^7$ calls, the new version is approximately $20$–$30\%$ faster than 1.96 on $A_0$, $B_0$, and $C_0$, and approximately $70\%$ faster on finite $D_0$ boxes because version 1.96 used `ff`; for boxes it is comparable to OneLoop [1605.03181]. With LU caching of size $1$, the new cache is again approximately $20$–$30\%$ faster on “lumps” and approximately $70\%$ faster on boxes than 1.96, while an LRU cache with size $10$ yields up to a $40\times$ speedup on expensive repeated box calls compared to the uncached case [1605.03181].

golem95C and COLLIER provide timing information for tensor objects rather than only scalar masters. The golem95 extension reports that a single call to a rank-6, five-point form factor with real masses takes approximately $1\times 10^{-3}\,{\rm s}$ on an Intel Core i7-3770 at $3.4$ GHz [1312.3887]. The earlier golem95C paper quotes approximately $0.06\,{\rm s}$ for a single call to a rank-6 six-point form factor with complex masses on an Intel Core2 Q9450 at $2.66$ GHz, with default relative accuracy in the direct numerical integrals of $10^{-8}$ and failures logged in `error.txt` [1101.5595]. COLLIER lists typical timings on a $2.5$ GHz Intel Xeon of approximately $0.1$–$0.5\,\mu{\rm s}$ for $A_0/B_0$, $1$–$2\,\mu{\rm s}$ for $C_0$, $5$–$10\,\mu{\rm s}$ for $D_0$, $50$–$200\,\mu{\rm s}$ for rank-4 tensor $D$, and up to approximately $1\,{\rm ms}$ in worst cases for higher $N$ or rank, with typical numerical precision $10^{-12}\ldots 10^{-14}$ in standard double precision [1604.06792].

Amplitude-level libraries have a different performance profile. NGluon reports approximately $0.5\,{\rm ms}$ per phase-space point for $4$ gluons, approximately $10\,{\rm ms}$ for $10$ gluons, and approximately $1\,{\rm s}$ for $14$ gluons, with runtime scaling approximately as $n^6$ for $n\le 20$ and asymptotically as $n^8$ [1011.2900]. In double precision, it yields reliable results up to $n=14$ gluons, while only a few percent of points require reevaluation in extended precision; its internal scale test can flag such points automatically [1011.2900]. BlackHat’s process-level benchmark for $W+5j$ at NLO reports generation of approximately $200\,000$ phase-space points at NLO in $O(10^5)$ CPU-hours on a modern farm, with per-point loop time of order $100\,{\rm ms}$ for the virtual part [1310.2808]. FastGPL, although not a one-loop integral library in the narrow sense, gives useful context for multi-loop back ends: on an Intel Xeon E5-1680v3 with gcc 9.4 under Ubuntu 18.04, generic weight-4 GPLs take $0.2\ldots 0.5\,{\rm ms}$ each versus $4\ldots 11\,{\rm ms}$ for handyG, corresponding to an approximately $20\times$ speedup, and “pathological” GPLs can show an approximately $200\times$ speedup in worst cases [2112.04122].

## 6. Integration into NLO and NNLO phenomenology

Loop libraries are designed to be embedded in automated perturbative workflows rather than used in isolation. QCDLoop 2.0 is explicitly demonstrated in MCFM 7.x by replacing the linked library through the Makefile while preserving backward compatibility through its Fortran wrapper [1605.03181]. For the processes $WW$ (`nproc=61`), $ZZ$ (`81`), and $\gamma\gamma\gamma\gamma$ (`289`) at $13$ TeV with NNPDF3.0 NLO, inclusive cross-sections and differential distributions agree at sub-per-mille level, and CPU time improves by approximately $5$–$10\%$ [1605.03181]. The same source describes a complex-mass workflow in Sherpa 2.2 in which Ninja’s one-loop reduction calls QCDLoop for master integrals through Ninja $\rightarrow$ GoSam $\rightarrow$ Sherpa; for $pp\to H+2\,{\rm jets}$ at NLO and $13$ TeV, the inclusive cross section agrees to $0.02$ pb ($0.2\%$) between OneLoop 3.6 and QCDLoop 2.0, differential shapes are identical within statistical error, and the overall CPU time is approximately $10$ h [1605.03181].

golem95C is structured to support both diagrammatic tensor reduction and unitarity-inspired workflows. It contains routines that accept a reconstructed numerator polynomial in $q^\mu$ at the integrand level, with coefficients $c_{\mu_1\ldots\mu_r}(S)$, and contracts these coefficients with the corresponding tensor form factors [1312.3887]. The paper describes this “tensorial reconstruction” as a rescue system for points where pure unitarity methods lose precision [1312.3887]. The earlier golem95C description likewise states two usage modes: an algebraic reduction approach and a unitarity-inspired integrand-reconstruction mode [1101.5595]. These features place the library at the interface between symbolic reduction and numerical sampling.

At the amplitude and event-generator level, BlackHat and NGluon illustrate two complementary integration models. NGluon is intended to be embedded in event generators such as Sherpa, MadGraph, or POWHEG by calling `NGluon::evalAmp()` and combining `getAtree()` and `getAfinite()` with subtraction frameworks [1011.2900]. BlackHat, by contrast, is presented in conjunction with SHERPA, COMIX, FastJet, and ROOT, with one pass devoted to generating weighted events and saving the Born, virtual, integrated-subtraction, and real-minus-subtraction weights, and a second pass devoted to analysis using ROOT macros [1310.2808]. A plausible implication is that loop libraries influence not only matrix-element evaluation time but also the reproducibility and reusability of collider analyses, especially when their outputs are packaged into portable formats such as ROOT n-tuples.

Multi-loop phenomenology introduces a further back-end layer. FastGPL is designed specifically for cases in which master integrals reduce to generalized polylogarithms up to weight $4$, and a demonstration application computes mixed QCD–EW two-loop corrections to $e^+e^-\to \nu_e\bar\nu_e H$ via $WW$ fusion at $\sqrt{s}=250,350,500$ GeV [2112.04122]. The two-loop amplitude contains approximately $8\,000$ GPLs of weight $\le 4$, and in a VEGAS integration with $10\,000$ points the wall-time per point is approximately $0.5\,{\rm ms}$ for FastGPL versus approximately $9\,{\rm ms}$ for handyG, corresponding to an $18\times$ speedup [2112.04122]. This suggests that the traditional one-loop integral library has a natural extension into a layered ecosystem of reduction libraries, amplitude providers, and transcendental-function engines.

## 7. Related methodological distinctions and common points of confusion

A common source of ambiguity is whether a loop library should be understood as a master-integral evaluator, a tensor-reduction engine, or a complete amplitude provider. The sources support all three usages. QCDLoop is restricted to one-loop scalar integrals [1605.03181]. golem95C and COLLIER add tensor form factors and full tensor components [1312.3887]. NGluon and BlackHat move beyond integrals to the reconstruction of full one-loop amplitudes from generalized cuts and rational terms [1011.2900]. For this reason, the term “loop library” is best understood as describing a functional role inside perturbative calculations rather than a single standardized API.

Another distinction concerns the analytic basis. Libraries such as QCDLoop, golem95C, and COLLIER are organized around scalar and tensor one-loop integrals in dimensional regularization [1605.03181]. FastGPL, by contrast, is organized around generalized polylogarithms, which “appear ubiquitously in the analytic evaluation of multi-loop Feynman integrals” and are evaluated through a hard-coded implementation of the Vollinga–Weinzierl algorithm up to weight $4$ [2112.04122]. The relation is complementary rather than competitive: one-loop libraries typically supply master integrals directly, whereas multi-loop codes often require special-function libraries after reduction to analytic expressions.

Finally, “loop library” can denote something unrelated to Feynman integrals in other research domains. The PyTorch package `higher` is a library for “Generalized Inner Loop Meta-Learning,” in which one differentiates through an unrolled inner optimization loop via `higher.innerloop_ctx`, `FunctionalModule`, and `DifferentiableOptimizer` abstractions [1910.01727]. This usage concerns nested optimization rather than loop amplitudes. The terminological overlap suggests that disciplinary context is essential: in high-energy phenomenology, a loop library ordinarily refers to one-loop or multi-loop integral and amplitude software; in machine learning, it may refer to tooling for differentiable inner-loop optimization.

Source: https://www.emergentmind.com/topics/loop-library