FunKit is a Mathematica package for all tasks related to the derivation of functional equations in Quantum Field Theory (QFT).
The Idea of FunKit is to be a one-stop solution to this end, starting with the definition of the QFT and truncation prescriptions, and ending with either the analytical equations, or automatically generated code to solve them numerically.
If you use the package for your research, please cite the corresponding publication:
@article{Sattler:2026FunKit,
author = "Sattler, Franz R.",
title = "{FunKit: A computer algebra toolkit for functional approaches}",
year = "2026",
month = "5",
eprint = "2605.28935",
archivePrefix = "arXiv",
primaryClass = "hep-ph"
}
After you have installed the package, you can open a new notebook and call
Needs["FunKit`"]to load the package. To get started, the first command you may want to use is
FInfo[]or more specifically,
FInfo["FEDeriK"]which will give you an overview of how to use the package.
For example, you may want to have the general expression for the most general flow of a two-point function from the Wetterich equation:
FSetAutoSimplify[False];
FTakeDerivatives[FEmptySetup, WetterichEquation, {AnyField[i1],AnyField[i2]}];
FPrint[FEmptySetup, %];We have turned off automatic simplification here to show the raw output, which reads
For a scalar field theory, one can get a more explicit expression as follows:
fields = <|"Commuting"->{Phi[p]}|>;
truncation = <|GammaN->Table[Table[Phi, {i}], {i, 1, 4}],
S->{{Phi, Phi}, {Phi, Phi, Phi, Phi}},
Propagator->{{Phi, Phi}},
Rdot->{{Phi, Phi}}|>;
FSetGlobalSetup[<|"FieldSpace"->fields, "Truncation"->truncation|>];
FSetTexStyles[Phi->"\\phi"];
FTakeDerivatives[WetterichEquation, {Phi[i1], Phi[i2]}]//FTruncate//FPrint;which yields the output
For the same theory, we can also derive the Dyson-Schwinger equation for the same two-point function:
FTakeDerivatives[FMakeDSE[Phi[i1]], {Phi[i2]}]//FTruncate//FPrint;which gives
If you wish to wish to remove the remaining fields (i.e. go to the symmetric regime), you can add the line
...
Field->{},
...to the truncation definition above.
You can of course define arbitrary master equations besides the pre-defined WetterichEquation and FMakeDSE ones (among others), see the documentation for details.
For large derivations, FunKit ships a C++ engine (cpplib/, module CoBra) that runs the whole FTakeDerivatives // FTruncate // FSimplify pipeline in a single, highly optimized external process. It is on by default: the first pipeline call of a session activates it, compiling the engine once with CMake and running its test suite (later sessions re-use the build). If the toolchain is missing or the build fails, FunKit warns once and uses the pure-Mathematica implementation instead.
Requirements: CMake ≥ 3.20, a C++20 compiler with OpenMP (plus network access on the first build to fetch the test framework). FSetBackendCpp[] runs the activation explicitly — useful to control the build ("Rebuild", "RunTests", "Jobs" options) or to see why an automatic activation failed.
With the backend active, FTakeDerivatives returns a lightweight deferred handle instead of the (potentially huge) intermediate expression; passing it to FTruncate, FSimplify or FEvaluate runs one fused C++ call — derivatives, truncation and simplification together, so the untruncated intermediate never materializes:
FSetGlobalSetup[setup];
flow = WetterichEquation // FTakeDerivatives[#, {Phi[i1], Phi[i2]}]& // FTruncate
(* identical in shape and (exact, rational) coefficients to the pure-Mathematica result *)FMakeDSE and further derivatives of DSEs route through the engine automatically. Results are cached on disk keyed by their full input (see FClearCppCache, FSetCppCacheDirectory).
The backend covers the standard object types (including Phidot-style objects with pinned legs), source fields, and index-free symbolic prefactors — couplings, Z-factors and I are stripped per term, run through the engine per group, and re-attached exactly. Input the engine genuinely cannot represent (custom FAddFDRule rules, routed/explicit indices, index-dependent coefficients) issues a FunKit::cppFallback warning and runs through the Mathematica implementation — results are always produced, and never silently different. Opt out globally with FSetBackendMathematica[] or per call via the "Backend" -> "Mathematica" option. FExportCppInput and FExportToml write stand-alone input files for the funkit executable (see cpplib/README.md).
To learn how to compute more complicated systems, you may want to see some typical examples on how to use FunKit to deal with common QFTs of interest.
You will find some showcases inside the examples/ folder:
-
examples/ScalarTheory.nbshows the derivation of DSEs and fRG flows in a scalar theory. -
examples/Yang-Mills.nbandexamples/Yang-Mills/derive the functional equations for an$SU(N)$ gauge theory and provide a numerical implementation usingDiFfRG. -
examples/Yukawa.nbdoes the same for a mixed fermion-boson theory. -
examples/mSTI-Yang-Mills.nbcalculates the modified Slavnov–Taylor identity for the gluon two-point function. -
examples/FlowingReparametrisation.nbderives fRG equations for an$O(N)$ theory with flowing field reparametrisation. -
examples/CompositeOperators.nbderives correlation functions of a two-fermion composite operator. -
examples/FunKitPaper.nbis a guided, runnable companion to the companion paper.
To install the FunKit package in Mathematica, simply open a new notebook or kernel and download the installation file:
Import["https://raw.githubusercontent.com/satfra/FunKit/main/FunKitInstaller.m"]The installer will automatically download the package and all basis definition files and their pre-built cache.
You can also use the CMake integration if your project uses FunKit as a dependency. In that case, you can install the package directly from your CMakeLists.txt:
include(FetchContent)
FetchContent_Declare(
FunKit
GIT_REPOSITORY "https://github.com/satfra/FunKit"
GIT_TAG "main"
)
FetchContent_MakeAvailable(FunKit)Alternatively, grab FunKit directly from the console:
$ git clone https://github.com/satfra/FunKit.git
$ mkdir FunKit/build
$ cd FunKit/build
$ cmake ..
$ make installTo run the test suite, you can either run
$ make testfrom the build directory (if you installed via CMake), or run the tests directly from a Mathematica notebook or kernel:
Get["FunKit`"]
FTest[]Running single tests is also possible:
$ make test-single FILE=FEDeriK/FunctionalDTests.mTo the end of deriving flow equations, other useful software already exists, in particular
FunKit depends on, and builds upon
-
to perform traces over group indices in the derived functional equations,
-
to handle tensor bases and projections. Version 1.3.0 or newer is required — from 1.3.0 on,
TBMakePropagatorexpands the inverse propagator with all momenta incoming, which is the conventionFMakeDiagrammaticRulesassumes. Older versions return every momentum-odd propagator dressing, such as the quark's$p!!!/$ dressing, with the wrong sign.
These two packages are automatically installed when you import FunKit for the first time in a Mathematica notebook or session.