Leviathan (external)
Leviathan finds the Landau singularities of a family of Feynman integrals: the polynomial conditions on the external invariants and masses under which the integrals can become singular. It also counts the master integralsthe finite basis to which every integral of the family reduces of the family sector by sector. It is a partial Julia port of the method and program of Vsevolod Chestnov, Giulio Crisanti and Mathieu Giroux (arXiv:2606.29612), made so that the method runs without Mathematica alongside the other BootLoops tools.
Where it comes from
The method and the original program are by Chestnov, Crisanti and Giroux, with the SPQR method of Chestnov and Crisanti for the minimal polynomials of the candidate step. The port was written by Claude with the authors' Mathematica code open. Three of its routines are step-for-step translations of theirs.
| Part of the port | Source | Authors |
|---|---|---|
| Translated routine: the non-degeneracy test | landau_codes.m | Chestnov, Crisanti and Giroux |
| Translated routines: the locus point search and the cut-propagator ideal | euler_characteristic.m in the DiscKosky package | Crisanti, Lippstreu, McLeod and Polackova |
| Conventions and driver layout that follow their code | The same files, irreducible_monomials.m in DiscKosky, and SPQR | The same authors; Chestnov and Crisanti (SPQR) |
| New code for the objects defined in their papers: the candidate generation, the monomial count and the rational reconstruction | arXiv:2606.29612, arXiv:2511.14875 | Code by Claude |
Please cite the authors' papers when you use it. The port implements only part of the authors' program and is not affiliated with or endorsed by them.
What it does
A Feynman integral is analytic in its kinematic variables away from its Landau singularities, for example $s-4m^2=0$ for the one-loop bubble. Thresholds and branch points can occur only there. The symbol letters, the arguments of the logarithms in the answer, are built from the same polynomials. Together the letters form the alphabet of the family.
Leviathan finds the singularities by counting. Write the integral in Lee–Pomeransky forma representation with a single polynomial G = U + F in the Feynman parameters, U and F being the two Symanzik graph polynomials of the diagram with polynomial $G$. With generic, non-integer propagator powers and dimension (the regulated family), the critical-point equations of $G$ have finitely many solutions. Their number is the Euler characteristichere, the number of isolated solutions of the regulated critical-point equations of G $\chi$. It equals the number of master integrals and is constant at generic kinematics. The Landau singularities are the loci where $\chi$ drops.
The landau command counts, generates candidates and tests each one.
- Count. It computes $\chi$ of the regulated family and $\chi_S$ of every sector $S$ (a subset of propagators, the rest removed by setting their Feynman parameters to zero), and checks $\chi=\sum_S\chi_S$. Each count is made at a random kinematic point modulo a 31-bit prime, from a Gröbner basis and a count of standard monomials (the monomials not divisible by any leading term of the basis).
- Candidates. For each Feynman parameter it computes, exactly, the monic minimal polynomial in the quotient ring of the critical-point ideal (the object of the SPQR method). The candidates are the irreducible factors of the denominators of its coefficients. Every sector is treated twice, at zero propagator powers and with the regulated ideal. Second-type singularities (those not attached to a set of on-shell propagators, such as $s=0$ for the bubble) appear only in the regulated pass.
- Test. It recomputes $\chi$ at random points on each candidate locus $\ell=0$. The candidate is
genuineif $\chi$ falls below the generic value,spuriousif it does not, andunverifiedif no point on the locus was found modulo any of ten primes.
The diagnose command runs the four consistency checks of Appendix A of arXiv:2606.29612. They are zero-dimensional sector ideals (type 1.1), a non-degeneracy test that detects singularities the zero-power pass can miss (type 1.2), additivity of $\chi$ (type 2.1) and the drop test (type 2.2). Where the exact Gröbner basis is out of reach, landau_reconstruct samples the same minimal polynomials at many primes and kinematic points, reconstructs each coefficient as a rational function and applies the same drop test.
The port has these limits:
- Candidates of the exact route are exact polynomials. Counts and verdicts are computed modulo primes at random points, so they hold with probability very close to one and are not proofs.
- The reconstruction route needs $G$ jointly homogeneous in the kinematic parameters, with the one dimensionful scale listed last. It sets that scale to 1 itself, so setting $m^2=1$ in the input silently breaks the result.
- Sampling is serial inside a process, because the Gröbner routines are not thread-safe. Run several processes for parallelism.
- A positive-dimensional sector is reported
Indeterminateand skipped with a warning. - Not implemented: the SPQRDet route, the four-dimensional restriction and the FiniteFlow Macaulay-matrix reconstruction of the published method. Leviathan does not compute the integral or its differential equation.
PLD and SOFIA and Landau Alphabet reach the same locus by unrelated methods and serve as cross-checks. Dipstick uses Leviathan's $\chi$ count, including in its expansion-by-regions check (dipstick regions).
The examples below, the one-loop bubble and the two-loop sunrise, are the smallest cases, chosen so that the output can be checked by hand. They are far simpler than the diagrams for which Chestnov, Crisanti and Giroux developed the method, whose published singularity lists reach tens of megabytes for a single diagram.
The largest cases this port has been used on are the non-planar hexa-box and the non-planar $q\bar q\to W^+W^-$ double box. On the hexa-box it identified the quartic $Q_4$ with the Gram-determinant locus. On the double box it completed the family's 36-letter alphabet.
Examples
The one-loop bubble from the command line. The input file examples/bubble.in comes with the package:
# one-loop equal-mass bubble, Lee-Pomeransky G = U + F G = x1 + x2 + mm*(x1+x2)^2 - s*x1*x2 kin = s, mm x = x1, x2
With the package set up (see Requirements), run the full pipeline from the package directory upgrades/leviathan/:
julia +1.10 --project=. leviathan.jl landau examples/bubble.in
It prints:
chi (regulated, generic) = 3 chi_S [1] = 1 chi_S [2] = 1 chi_S [1, 2] = 1 sum over sectors = 3 [additivity OK] candidate factors: ["mm", "s", "s - 4*mm"] genuine : ["mm", "s", "s - 4*mm"] spurious : String[]
The bubble has three master integrals, one per sector, and three singularities: the vanishing mass, the second-type point $s=0$ and the normal threshold $s=4m^2$. Each is confirmed by a drop in $\chi$. When diagnose is run on the bubble, type 1.2 fails by design: it names $s$, the second-type singularity found only in the regulated pass.
The two-loop sunrise from Julia, with the checks. Condensed from test_sunrise.jl:
include(joinpath(@__DIR__, "src", "Leviathan.jl"))
using .Leviathan, Random
rng = MersenneTwister(20260630)
fam = family("x1*x2 + x1*x3 + x2*x3 + s*x1*x2*x3 - mm*(x1+x2+x3)*(x1*x2+x1*x3+x2*x3)",
["s", "mm"], ["x1", "x2", "x3"])
r = landau(fam; rng=rng)
print(report(r))
d = diagnose(fam; rng=rng, candidates=r.candidates)
The top sector has $\chi=4$, with $7=4+1+1+1$ over all sectors. r.genuine is s, mm, s - mm, s - 9*mm, which includes the pseudo-threshold $s=m^2$ and the three-particle threshold $s=9m^2$. All four checks in d pass.
The reconstruction route. From test_reconstruct.jl, the bubble by sampling instead of exact elimination:
fam = family("x1 + x2 + mm*(x1+x2)^2 - s*x1*x2", ["s","mm"], ["x1","x2"])
rr = landau_reconstruct(fam; nprimes=3, npoints=20, deg_cap=6, lanes=(:nu0,:regulated))
The call uses three primes, twenty points per prime, reconstructed degree at most 6 and both passes. rr.genuine holds the same three factors as the exact route: mm, s and s - 4*mm. The dimensionful scale mm is last in the kinematic list, as this route requires.
Routines
The command-line input is a key = value file with G (or U and F), kin, x and an optional cut (the cut propagators). [seed] is an optional integer random seed.
| Command | What it does |
|---|---|
leviathan.jl chi <input> [seed] | Sector and regulated $\chi$, with the additivity check |
leviathan.jl candidates <input> [seed] | Candidate factors per sector and their union |
leviathan.jl diagnose <input> [seed] | The four checks with their evidence |
leviathan.jl landau <input> [seed] | Count, candidates and test in one run |
leviathan.jl landau <input> <seed> --lane=reconstruct | The sampling route, configured by LEV_NPRIMES, LEV_NPOINTS, LEV_DEGCAP and LEV_SAVEDIR (checkpoint directory) in the environment; the seed is required |
chi_at.jl REQ.json | Regulated $\chi$ at chosen kinematic points, one JSON line per point |
builder.jl | Defines family_from_graph(edges, nodes; ...), which builds a Family from a graph in PLD's conventions |
The request file of chi_at.jl holds in_file, points and optional seed and mode ("regulated" or "top"). Each entry of points is a map from kinematic name to a rational string such as "1/3", or null for a random point. A chi below the generic value marks a singular point.
The Julia module is loaded with include("src/Leviathan.jl").
| Function | What it returns |
|---|---|
family(G, kinnames, xnames; cut), family_UF(U, F, kinnames, xnames; cut) | A Family from polynomial strings |
admissible_sectors(fam) | The sectors with nonzero $G$ |
chi_sector(fam, S), chi_regulated(fam[, S]) | $\chi_S$ at zero powers and the regulated $\chi$; nothing means positive-dimensional |
sector_candidates(fam, S), all_candidates(fam) | Candidate factors of one sector, or of all with their union |
diag_type11(fam), nodegeneracy(fam), diag_type21(fam), diag_type22(fam, candidates) | The four checks, each as (pass, evidence); the last accepts any list of polynomial strings |
diagnose(fam; rng, candidates) | The four checks as a dictionary keyed type1.1_sector_dim through type2.2_candidate_verification |
landau(fam; rng), report(r) | A LandauResult (fields chi_generic, chi_sectors, candidates, genuine, spurious, unverified, by_sector) and its text report |
landau_reconstruct(fam; nprimes, npoints, deg_cap, lanes, savedir) | The same result by sampling; savedir writes a JSON checkpoint per sector and prime |
The lower-level exports are listed in src/Leviathan.jl.
Used on this site
- Non-planar hexa-box: computed the Landau singularities of the family and identified the quartic $Q_4$ with the Gram-determinant locus.
- Non-planar $q\bar q\to W^+W^-$: completed the 36-letter alphabet of the family in $(x,y,z)$.
Requirements
- Runs on: Julia 1.10 with Oscar 1.7 (which brings msolve, Singular and FLINT) and the JSON package.
- Install: in the package directory run
julia +1.10 --project=. -e 'using Pkg; Pkg.instantiate()'once, then run every script with--project=.. The+1.10selector needs the juliaup launcher; with a plain Julia 1.10 leave it out. - Self-test:
julia +1.10 --project=. test_leviathan.jlends withALL TESTS PASSED. Add--fullto include the sunrise. - Sampling route:
julia +1.10 --project=. test_reconstruct.jlends withALL RECONSTRUCT TESTS PASSED. - Single examples:
test_smoke.jlruns the bubble alone andtest_sunrise.jlthe sunrise. - Counter alone:
julia test_staircase.jlneeds no Oscar and prints a line beginningSTAIRCASE PASS. - Optional:
builder.jlneeds PLD, withENV["PLD_PATH"]set to itssrc/PLD.jl.
Source and references
The code is upgrades/leviathan/ in the BootLoops repository. PATCHES.md there gives file and line on both sides for the parts that follow the authors' code.
| Reference | What it supplies |
|---|---|
| V. Chestnov, G. Crisanti and M. Giroux, "Landau's Leviathans", arXiv:2606.29612; code: Landau-s-Leviathans | The method and the four checks; landau_codes.m |
| V. Chestnov and G. Crisanti, SPQR, arXiv:2511.14875; code: SPQR | The minimal polynomial of the candidate step |
| G. Crisanti, L. Lippstreu, A. J. McLeod and M. Polackova, DiscKosky | euler_characteristic.m and irreducible_monomials.m |
| C. Fevola, S. Mizera and S. Telen, PLD, arXiv:2311.16219 | The graph polynomials for builder.jl |
| J. Berthomieu, C. Eder and M. Safey El Din, msolve, arXiv:2104.03572 | The Gröbner bases (F4 algorithm) |
| The OSCAR team, OSCAR, doi:10.1007/978-3-031-62127-7 | The computer algebra system the port runs on |