ABSTRACT (original article): Systematic expansion schemes in functional approaches require the inclusion of higher order vertices. These vertices are expanded in independent tensor bases with a rapidly increasing number of basis elements. Amongst the related tasks are the construction of bases and projection operators, the importance ordering of their elements, and the optimisation of such tensor bases, as well as an analysis of their regularity in momentum space. We present progress in all these directions and introduce the Mathematica package TensorBases designed for the aforementioned tasks. CITATION (original article): Jens Braun, Andreas Geißel, Jan M. Pawlowski, Franz R. Sattler, Nicolas Wink (2025), Juggling with Tensor Bases in Functional Approaches, arXiv:2503.05580. https://doi.org/10.48550/arXiv.2503.05580​
GitHub: https://github.com/satfra/TensorBases

Installation

Install the package first, if you did not do so yet!
In[]:=
Import["https://raw.githubusercontent.com/satfra/TensorBases/main/TensorBasesInstaller.m"]
Downloading TensorBases ...
Mathematica package TensorBases loaded​Authors: Andreas Geißel, Franz Richard Sattler​Version: 1.0​Year: 2025​For a list of available bases, call TBInfo​[​]. For further information on a particular basis, call TBInfo​[BasisName].​This package provides the methods TBGetBasisElement​, TBGetInnerProduct​, TBGetMetric​, TBGetInverseMetric​, TBGetProjector for every tensor basis available.For closer explanations, please call their usage messages, e.g. TBGetProjector::usage.​Other useful tools include TBBasisTransformation​, TBVertexTransformation​, TBGetIdentityMatrix​, TBGetBasisSize​,​ TBGetIndexSet​,​ TBMakePropagator.​To build or manipulate bases, please call TBInfo​[BaseBuilder].​To show information on the used notation, call TBInfo​[Notation].
FormTracer package loaded.
To see all (user-defined and package-defined) FormTracer definitions, call TBInfo​[FormTracer].Furthermore, TensorBases extends FormTracer. To see all extensions, call TBInfo​[Extensions]
To see all momentum transformations that can be performed by TensorBases​, call TBInfo​[Momenta].
Lorentz group undefined, using default names.
Group with name color undefined, using default names.
Group with name flavor undefined, using default names.
Installation was successful.
Otherwise, just load the package:
In[]:=
Needs["TensorBases`"]

Documentation & things you should know

You can skip over this section if you want to get directly to the examples below.
​
Otherwise, note that you can get the most relevant information from TensorBases always by using TBInfo[...] and usage messages. E.g. for building bases, you can investigate
In[]:=
TBInfo["BaseBuilder"]
TensorBases provides facilities for exporting and importing bases:​TBImportBasis and TBExportBasis allow for importing user-written basis definition files and automatic export of bases in memory to such definition files.​TBExportCache writes any basis data in memory to disk at a specified location.​TBUnregister allows to remove basis names from the registry, which allows one to overwrite bases by custom imports.​TBRestrictBasis creates a new basis from an old one by simple restriction.​TBConstructBasis creates a new basis from a set of primitive tensors. The method automatically takes tensor products of multiple given tensor spaces and reduces any overcomplete set using a given inner product to a minimal basis (a maximal linearly independent set).​For usage help with the aforementioned functions, please call their usage messages, e.g. TBConstructBasis::usage.
In[]:=
TBConstructBasis::usage
Out[]=
TBConstructBasis[options...]​Construct a new basis from a given set of Tensors.Example call:TBConstructBasis["Name"->"FourFermionBasis","Vertex"->{psibar,psi,psibar,psi},"VertexStructure"->2(Tensor[1,2,3,4]-Tensor[1,4,3,2]),"InnerProduct"->2Tensor1[1,2,3,4](Tensor2[2,1,4,3]-Tensor2[4,1,2,3]),"Indices"->{{p1,d1},{p2,d2},{p3,d3},{p4,d4}},"Tensors"->{{deltaDirac[d1,d2]deltaDirac[d3,d4],gamma[mu,d1,d2]gamma[mu,d3,d4],gamma5[d1,d2]gamma5[d3,d4],gamma[mu,d1,dint1]gamma5[dint1,d2]gamma[mu,d3,d3int]gamma5[d3int,d4],sigma[mu,nu,d1,d2]sigma[mu,nu,d3,d4]}}]For all possible options, see Options[TBConstructBasis]​
To see a list of all bases currently in memory (i.e. also user-specified ones), call TBinfo[]
In[]:=
TBInfo[]
Detailed info on a basis can be obtained likewise:
In[]:=
TBInfo["qbqFT"]
Indices:
q
: {​
p
1
​,​
d
1
​,​
A
1
​,​
F
1
​}​ q: {​
p
2
​,​
d
2
​,​
A
2
​,​
F
2
​}​We use the general form ℒ = 2π
d
)
δ(​
p
1
+
p
2
​)​
τ
i
​and the
τ
i
are listed in the following:
Tensor
1
δ
A
1
A
2
δ
F
1
F
2
​
γ
0
)
d
1
d
2
2
δ
A
1
A
2
δ
F
1
F
2
​
γ
i
p
i
)
d
1
d
2
δ
A
1
A
2
δ
F
1
F
2
δ
d
1
d
2
Some conventions can be shown:
In[]:=
TBInfo["Notation"]
TensorBases uses the following conventions and notation:For a given group,
a
T
denotes the generators of the group in the fundamental representation,
a
t
denotes the generators in the adjoint representation.​
ϵ
abc
is the fully anti-symmetric Levi-Civita symbol.The
a
T
are normalised as tr[​
a
T
b
T
​] =
1
2
δ
ab
.The
γ
μ​
denote Euclidean gamma matrices and accordingly
γ
5​
=
γ
0
γ
1
γ
2
γ
3
​
Let' s also see how the package can transform momenta using the built-in documentation
In[]:=
TBInfo["Momenta"]
Currently, the TensorBases package implements the following momentum transformations:​Projections:​​TBProjectToSymmetricPoint​,​TBProjectToSymmetricPointSpatial​​Three-Point functions:​​TB3PToS0S1SPhi​, TB3PToS0S1SPhi,TB3PFromS0as,TB3PToS0as,TB3PFromS0S1SPhiQk,TB3PToS0S1SPhiQk​
TensorBases expands some FormTracer functionality and gives a default notation (which you are of course free to change!)
In[]:=
TBInfo["Extensions"]
TensorBases defines the following functions in extension to FormTracer functionality.In order to get detailed information on each of those, please call their usage messages, e.g. GetFormTracerGroups::usage.​​GetFormTracerGroups​,​​FormTracerGroupExists​,​​GetFormTracerGroupList​,​​AddGroupTensors​,​​AddFormTracerGroup​,​​GetFormTracerGroupConstants​,​​GetFormTracerGroupConstant​,​​UseLorentzLinearitySP​,​​UseLorentzLinearityVec​,​​UseLorentzLinearity​,​​TBInsertCombinedLorentzTensors
The output of TBInfo[“FormTracer”] will always change according to the notation we have chosen.

Deriving Flow equations

The corresponding expression, derived using FunKit (see https://github.com/satfra/FunKit ) , reads
To trace this out, we need to create some Diagrammatic rules.
​
For this example, we will utilize an orthogonal, transverse set of tensors for the three-gluon vertex (“AAAOrtho”, elements 1 through 4) and the full basis for the ghost-gluon vertex.
TensorBases allows us to easily perform this task:
In particular, using TBMakePropagator and TBGetVertex allows us to quickly define the full set of diagrammatic rules.
Before we trace, we make sure FormTracer knows all variable names.
We obtain the projectors onto the two tensor structures of the ghost-gluon vertex from TensorBases and perform the tracing.
Finally, TensorBases allows you to fully expand momentum scalar products (sp[. , .]) by using UseLorentzLinearity:

Building a four-fermion basis

Only Dirac Tensor structure

We construct a four-fermion basis from only the Dirac-space spanning basis elements:
TensorBases detects the over-completeness of this choice of tensors and reduces the corresponding set of basis elements to three:

Dirac+Color Tensor structure

Now for a less trivial example: Let’s add color structure. TensorBases will automatically take the cross-product of the given tensor spaces:

Doing basis transformations

Transforming dressings of basis elements

Consider now a transformation to a different basis ”FierzCompleteNf2Nc3Pheno”.
To obtain the dressings in this other basis we can use a built-in TensorBases method:

Transforming dressings of vertices

Next, let’s represent the classical Yang-Mills three-gluon vertex in two bases. Suppose we want to have only a classical coupling at an initial UV scale in a flow equation approach:
Consider now that we would like to calculate in a different, full Basis “AAAOrtho”.
The initial condition in this basis can be obtained by transforming the dressings. To shorten the presentation, we only show the limit of the symmetric point.

Investigating momentum singularities

We will focus on both a quark-gluon basis, as found in https://arxiv.org/pdf/1706.06326, equation (C2), as well as a sub-basis restricted to the elements 1,4,7.
To perform this restriction, we can use a TensorBasis function:
Now consider the projection operator onto the first tensor structure in the “AqbqSimple” basis:
One sees immeditaly the projection singularities, in particular in the limit of the angular variable S11.
Looking at the full InverseMetric, which is used to define the projections, one sees such singularities in most of the matrix elements:
We can isolate the singularities to the most important configurations of the symmetric point and the soft-gluon limit. In particular the latter one is not well-defined due to the singular projectors.
To resolve this issue, we can define an improved basis, as discussed in https://arxiv.org/abs/2503.05580
We first ensure the basis is not yet in memory, and FormTracer knows all variable names.
Then, we define a new basis “Aqbq147NonSingular” with modified elements.
This new basis has no projection singularities:
And, most importantly, the projectors are now free of singularities and further momentum dependencies. They read

CITE THIS NOTEBOOK

Juggling with tensor bases in functional approaches​
by Jens Braun, Andreas Geißel, Jan M. Pawlowski, Franz R. Sattler, Nicolas Wink
Wolfram Community, STAFF PICKS, October 16, 2025
​https://community.wolfram.com/groups/-/m/t/3562128