Leviathan
The content on this page was written by AI under human supervision.
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 takes the Lee–Pomeransky polynomial of the diagram with the names of its kinematic parameters and integration variables. It returns the number of master integrals sector by sector, a list of candidate singularity polynomials, and a verdict on each candidate from an explicit test. The method is the Euler-characteristic-drop criterion of Chestnov, Crisanti and Giroux (arXiv:2606.29612); Leviathan is BootLoops' own Julia implementation, written from the papers and sharing no code with the authors' programs.
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. Knowing them in advance fixes where thresholds and branch points can sit and supplies the arguments of the logarithms (the symbol letters) from which the answer is built; Leviathan finds them 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 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; for a Feynman family it equals the number of master integrals, the finite basis to which every integral of the family reduces $\chi$, equal to the number of master integrals and constant at generic kinematics. The Landau singularities are exactly the loci where $\chi$ drops.
The landau pipeline has three steps. It counts $\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). Each count is done at a random kinematic point modulo a 31-bit prime, from a Gröbner basis (msolve's F4 algorithm, called through Oscar) and a count of standard monomials, and the report checks $\chi=\sum_S\chi_S$. It generates candidates exactly, over rational functions of the kinematic parameters. For each Feynman parameter it computes the monic minimal polynomial in the quotient ring of the critical-point ideal (the object of the SPQR method, arXiv:2511.14875); the irreducible factors of the denominators of its coefficients are the candidates. Every sector is treated twice, once at zero propagator powers and once with the regulated ideal, because only the regulated pass sees second-type singularities (those not attached to a set of on-shell propagators, such as $s=0$ for the bubble). It then verifies each candidate $\ell$ by recomputing $\chi$ at random points on $\ell=0$: genuine if $\chi$ falls below the generic value, spurious if not, unverified if no point on the locus was found modulo any of ten primes.
The four consistency checks of the paper's Appendix A are included, callable singly or together through diagnose, each returning pass or fail with evidence. They are: zero-dimensional sector ideals (type 1.1), a no-degeneracy test that flags singularities the zero-power pass can miss (type 1.2), $\chi$ additivity (type 2.1), and the drop test itself (type 2.2). Cut propagators are declared with a cut = line and handled throughout. For families where the exact Gröbner basis is out of reach, landau_reconstruct obtains the same minimal polynomials by sampling them at many (prime, kinematic point) pairs and reconstructing each coefficient as a rational function, then applies the same drop test. That route needs $G$ jointly homogeneous in the kinematic parameters with the one dimensionful scale listed last. It sets that scale to 1 while sampling and restores it by degree, so setting $m^2=1$ in the input yourself silently breaks the result. Sampling is serial inside a process, because the underlying Gröbner routines are not thread-safe; run several processes for parallelism.
Candidates from the exact route are exact polynomials. The $\chi$ counts and the verdicts are computed modulo primes at random parameter values, so they are correct with probability very close to one rather than proven. A positive-dimensional sector is reported Indeterminate and skipped with a warning. Three parts of the published method are not implemented (the SPQRDet route, the four-dimensional restriction, the FiniteFlow Macaulay-matrix reconstruction), and 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, including its expansion-by-regions completeness check (dipstick regions), reuses Leviathan's $\chi$ count.
Examples
The one-loop bubble from the command line. The input file examples/bubble.in that comes with the package is
# 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
and the full pipeline, run from the package directory, is
julia +1.10 --project=. leviathan.jl landau examples/bubble.in
which 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[]
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 confirmed by a $\chi$ drop. For an example this small, loading Oscar takes about as long as the computation itself, roughly half a minute each. Replace landau by chi for the counts alone, candidates for the candidate factors before verification, or diagnose for the four checks with their evidence; an optional integer third argument sets the random seed.
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)
r is a LandauResult: r.chi_sectors[[1, 2, 3]] is the top-sector count (4, with $7=4+1+1+1$ over all sectors) and r.genuine the verified singularities. The test requires these to be exactly s, mm, s - mm, s - 9mm, which include the pseudo-threshold $s=m^2$ and the three-particle threshold $s=9m^2$, with r.spurious empty. d maps each check name, type1.1_sector_dim through type2.2_candidate_verification, to a (pass, evidence) pair; all four pass here, while on the bubble type 1.2 fails by design and names $s$, the second-type singularity only the regulated pass finds. The drop test takes any polynomial: test_leviathan.jl calls diag_type22(fam, ["s - 17mm"]; rng=rng) on the bubble, a deliberately wrong input, and gets back false with s - 17*mm listed as spurious.
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))
Three primes, twenty sample points per prime, reconstructed degree at most 6, both passes. The test requires Set(rr.genuine) == Set(["mm","s","s - 4*mm"]), the answer of the exact route; mm, the dimensionful scale, is last in the kinematic list, as this route requires.
Routines
Command-line scripts
leviathan.jl <cmd> <input> [seed]—chi(sector and regulated $\chi$ with the additivity check),candidates(factors per sector and their union),diagnose(the four checks with evidence),landau(the full pipeline). Input: akey = valuefile withG(orUandF),kin,x, optionalcut.landau <input> <seed> --lane=reconstructruns the sampling route withLEV_NPRIMES,LEV_NPOINTS,LEV_DEGCAPandLEV_SAVEDIR(checkpoint directory) read from the environment. The seed must be given in that form, since the third argument is always parsed as one.chi_at.jl REQ.json— regulated $\chi$ at chosen kinematic points. The JSON request givesin_file,points(each a map from kinematic name to a rational string such as"1/3", ornullfor a random point), optionalseed, andmode("regulated", or"top"for the top sector only). The output is one JSON line per point withidx,chi,mode,wall_s,p,generic. Achibelow the generic value marks a point on a singular locus.builder.jl—family_from_graph(edges, nodes; internal_masses, external_masses, substitute, cut)builds aFamilyfrom a graph in PLD's conventions (sunrise:edges=[[1,2],[1,2],[1,2]],nodes=[1,2]); needs the external PLD package, withENV["PLD_PATH"]set to itssrc/PLD.jl.test_leviathan.jl [--full],test_smoke.jl,test_sunrise.jl,test_reconstruct.jl,test_staircase.jl— unit tests plus the bubble (and the sunrise with--full); the bubble alone with all evidence printed; the sunrise with a check of the elimination polynomials' leading coefficients; the sampling route against the exact one; the standard-monomial counter alone against a brute-force count and large closed-form cases, which needs plain Julia and no Oscar.
Julia module Leviathan (include("src/Leviathan.jl"))
family(G, kinnames, xnames; cut=Int[]),family_UF(U, F, kinnames, xnames; cut)— build aFamilyfrom polynomial strings.admissible_sectors(fam),sector_G(fam, S),nedges(fam)— the propagator subsets with nonzero contracted $G$, the contracted polynomial, the number of propagators.chi_sector(fam, S; p, kinvals, rng),chi_regulated(fam[, S]; p, kinvals, rng)— $\chi_S$ at zero powers and the regulated $\chi$, at random or supplied kinematic residues;nothingmeans positive-dimensional,0a vanishing sector.sector_candidates(fam, S; regulated, rng),all_candidates(fam; sectors, regulated, rng)— candidate factors for one sector, or for a list of sectors with their union.diag_type11(fam),nodegeneracy(fam),diag_type21(fam),diag_type22(fam, candidates; repeats=2)— the four checks, each returning(pass, evidence).landau(fam; p, rng, lanes, verify=true, repeats=2),report(r),diagnose(fam; rng, candidates)— the pipeline, returning aLandauResultwith fieldschi_generic,chi_sectors,candidates,genuine,spurious,unverified,by_sector; its text report; the four checks as a dictionary.landau_reconstruct(fam; nprimes=3, npoints=60, deg_cap=12, sectors, lanes, verify, seed0, savedir, tag, repeats)— the sampling route, same return type;savedirwrites a JSON checkpoint per sector and prime.- Lower-level exports:
point_on_locus,chi_regulated_constrained(a random point modulopon a locus and the regulated $\chi$ there);chi_of_ideal,lead_exps,staircase_count(Gröbner basis, leading exponents, standard-monomial count, exact for a staircase of any size and returned asInt128when it exceeds 64 bits);ff_ideal,elim_generators(the ideal over the rational function field and its per-variable minimal-polynomial data);sample_sector,reconstruct_sector,minpoly_modp,ratrec_multiprime(stages of the sampling route);default_p31,default_p29,P31,random_kinvals(prime pools and random residues; the no-degeneracy check uses Singular and needs primes below $2^{29}$, F4 takes 31-bit ones).
Used on this site
- Non-planar hexa-box — tested the proposed alphabet against the family's Landau singularities, confirming the six first-type letters as genuine.
- Non-planar $q\bar q\to W^+W^-$ — completed the singularity alphabet with four letters that two other scans had missed.
Requirements and source
Julia 1.10 with Oscar 1.7 (which brings msolve, Singular and FLINT) and the JSON package; nothing proprietary. The package directory carries a Project.toml: instantiate it once, then run every script with --project=.. Tests: julia +1.10 --project=. test_leviathan.jl (add --full for the sunrise), which ends with ALL TESTS PASSED, and julia +1.10 --project=. test_reconstruct.jl; test_smoke.jl runs the bubble alone, about half a minute after Oscar has loaded; julia test_staircase.jl tests the counter on plain Julia without Oscar and ends with STAIRCASE PASS. builder.jl also needs PLD by Fevola, Mizera and Telen (mathrepo.mis.mpg.de/PLD). Source: upgrades/leviathan/ in BootLoops' bootloops-dev repository (GitHub organization BootLoops-ai), released under the MIT license. PATCHES.md there states the relation to the papers (arXiv:2606.29612, arXiv:2511.14875) and to the authors' reference code, which carries no license and served only as documentation and as a source of published test values. Gröbner bases are computed by msolve (Berthomieu, Eder, Safey El Din) through Oscar.