FormTracer Showcase

This notebook tries to provide helpful examples and to show how the FormTracer works. Furthermore, it aims to demonstrate the capabilities of the FormTracer. Note that the FormTracer is documented in Mathematica’s Documentation Center. You can simply select a command and press F1 to obtain help.

Installing and Updating

FormTracer

Load or install FormTracer and FORM if they are not installed already:

formTracerInstalled=Quiet[Needs["FormTracer`"]];

If[formTracerInstalled===$Failed,
Import["https://raw.githubusercontent.com/FormTracer/FormTracer/master/src/FormTracerInstaller.m"]
]

If you have already installed the FormTracer you can simply load the package with:

Needs["FormTracer`"]

If it is already installed, you check for updates, read the change log and update the existing FormTracer installation with the following commands:

CheckForFormTracerUpdates[]

ShowFormTracerChangeLog[]

UpdateFormTracer[]

FORM

When the FormTracer package is loaded, it tries to locate FORM. If a message such as
Using FORM 4.1 (Jul 28 2016, v4.1) 64-bits.
is printed, the FormTracer has successfully located your FORM installation.

If FORM is not installed on your computer you, can install it with

InstallFORM[]

InstallFORM[] downloads the FORM executable from http://www.nikhef.nl/~form/ and copies it into your FormTracer directory.

More Details

By default, the FormTracer tries to call FORM with the following commands:

- ~/.Mathematica/Applications/FormTracer/form
- form
- /usr/bin/form
- /opt/bin/form
- ~/.Mathematica/Applications/FormLink/bin/<operating system>/form

If the FORM binary lies in any of the paths above, the FormTracer will find it.
If you have installed FORM somewhere else or you want to use a different FORM version
temporarily, you can use DefineFormExecutable[path to executable] to set a different path.

If you have FORM not yet installed, you can install it automatically as shown above or you can obtain it from
1.) http://www.nikhef.nl/~form/ (recommended)
or from
2.) https://github.com/vermaseren/form (in this case, follow the instructions provided at github).

If you download the binary from http://www.nikhef.nl/~form/ ,
copy it either into one of your paths for binaries (e.g. /opt/bin/ 
or /usr/bin/) or into the FormTracer folder, which you find at
~/.Mathematica/Applications/FormTracer.

If you want to use a FORM executable from a different location, or if you want to use tfrom, you can do so with

DefineFormExecutable["/home/user/path to my custom FORM location"]

Basic Usage and Notation

Load package

Load the FormTracer (if you use any other packages like, e.g., DoFun, ensure that you load them beforehand):

Needs["FormTracer`"]

Lorentz and Dirac Tracing

Define your tensor notation with

?DefineLorentzTensors

DefineLorentzTensors[deltaLorentz[mu,nu],vec[p,mu],sp[p,q],eps[],deltaDirac[i,j],gamma[mu,i,j],gamma5[i,j]]

and set the dimensions with

?DefineLorentzDimensions

DefineLorentzDimensions[dim,4]

and start tracing:

FormTrace[vec[2 p,mu]deltaLorentz[mu,nu]vec[p+r,nu]+sp[s,t]deltaLorentz[mu,nu]deltaLorentz[nu,mu]]

Tracing Lie Groups

You can view all the available groups from

?ShowGroupTemplates

ShowGroupTemplates[]

Define the groups with

?DefineGroupTensors

DefineGroupTensors[{
{SUNfund,{color,3},deltaAdjCol[a,b],structureConstantCol[a,b,c],deltaFundCol[i,j],generatorCol[a,i,j]},
{SUNfund,{flavor,Nf},deltaAdj[a,b],structureConstant[a,b,c],deltaFund[i,j],generator[a,i,j]},
{GenericGroup,testing,generalAdjDelta[a,b],generalStructureConstant[a,b,c],generalDeltaFund[i,j],generalGenerator[a,i,j]}
}]

Check the definitions with:

?ShowGroupConstants

ShowGroupConstants[]

and start tracing:

FormTrace[-deltaFundCol[i,k]generatorCol[a,i,j]deltaAdjCol[a,b]generatorCol[b,j,k]*generalStructureConstant[aa,bb,cc]generalStructureConstant[bb,aa,cc]]

More Variables

Every variable needs to be defined in FORM. Therefore, you need to teach the FormTracer which variables you use.

?AddExtraVars

and

?DefineExtraVars

let you define the variables:

DefineExtraVars[{alpha,Λ,ϵ}]

FormTrace[(alpha/Λ)^(2-ϵ)vec[p+q,mu]vec[r,mu]deltaFundCol[i,k]generatorCol[a,i,j]deltaAdjCol[a,b]generatorCol[b,j,k]]

If you have accidentally defined a variable, you can clear the extra variables with

?ClearExtraVars

If you have many extra variable starting with the same prefix, you might use

?DefineFormAutoDeclareFunctions

but it should be use with great care. Example:

DefineFormAutoDeclareFunctions[{myFunctionPrefix,Z,myArg}];

FormTrace[ZquarkGluonVertex[p,myArgQuarkGluonVertex]ZquarkProp[myArgQuark] vec[p+q,mu]vec[r,mu] /Λ]

Advanced Setup and Options

Combined Lorentz Tensors

You can optionally define abbreviations for Lorentz tensors with

?AddCombinedLorentzTensor

or

?DefineCombinedLorentzTensors

For example, you can define transverse and longitudinal projectors (requires the Lorentz tensor definitions from above):

DefineCombinedLorentzTensors[{
{transProj[p,mu,nu],deltaLorentz[mu,nu]-vec[p,mu]vec[p,nu]/sp[p,p]},
{longProj[p,mu,nu],vec[p,mu]vec[p,nu]/sp[p,p]}
}]

and use them in your traces:

FormTrace[transProj[p,mu,nu]vec[p,mu]vec[p,nu]]
FormTrace[longProj[p,mu,nu]vec[p,mu]vec[p,nu]]

FormTrace[transProj[p,mu,nu]longProj[p,mu,nu]]

FormTrace[transProj[p,mu,nu]^2]

In case of any problems you can delete them with:

?ClearCombinedLorentzTensors

Lorentz Tensor Identities

If you are dealing with really large expressions, you can define Lorentz tensor identities, that can help to speed up the tracing process. This functionality is available from

?AddLorentzTensorIdentity

or

?DefineLorentzTensorIdentities

For example, with the combined Lorentz tensors from the last section, you may define

DefineLorentzTensorIdentities[{
{transProj[p,mu,rho]transProj[p,rho,nu],transProj[p,mu,nu]},
{longProj[p,mu,rho]longProj[p,rho,nu],longProj[p,mu,nu]},
{transProj[p,mu,rho]longProj[p,rho,nu],0}
}]

FormTrace[transProj[p,mu,rho]longProj[p,rho,mu]]

Disentangle Lorentz Structures

You can enable/disable disentangling of Lorentz structures with

?DisentangleLorentzStructures

which may or may not, depending on your traces, yields a speed-up. More information can be found in the paper

DisentangleLorentzStructures[True]

DisentangleLorentzStructures[False]

Other Features

Partial Traces

By default, partial traces are forbidden and therefore yield an error message:

myTestTrace=vec[p,mu]deltaLorentz[mu,nu];

FormTrace[myTestTrace]

?PartialTrace

PartialTrace[True]

FormTrace[myTestTrace]

FormTrace[longProj[p,mu,nu]vec[p,mu]]
FormTrace[transProj[p,mu,nu]vec[p,mu]]

Finite Temperature Tracing

You can define spatial vectors and scalar products that allow you to break the vacuum O(dim) symmetry:

DefineLorentzTensors[deltaLorentz[mu,nu],vec[p,mu],sp[p,q],eps[],deltaDirac[i,j],gamma[mu,i,j],gamma5[i,j],vecs[p,mu],sps[p,q]]

Their zeroth component is always zero. Thus, they behave as follows

FormTrace[vec[p,mu]vec[q,mu]]
FormTrace[vec[p,mu]vecs[q,mu]]
FormTrace[vecs[p,mu]vecs[q,mu]]

You can also define combined Lorentz tensors with them

DefineCombinedLorentzTensors[{
(*zero temperature*)
{transProj[p,mu,nu],deltaLorentz[mu,nu]-vec[p,mu]vec[p,nu]/sp[p,p]},
{longProj[p,mu,nu],vec[p,mu]vec[p,nu]/sp[p,p]},
(*finite temperature*)
{transProjFiniteT[p,mu,nu],deltaLorentz[mu,nu]-vecs[p,mu]vecs[p,nu]/sps[p,p]-deltaLorentz[mu,0]*deltaLorentz[nu,0]},
{longProjFiniteT[p,mu,nu],deltaLorentz[mu,0] deltaLorentz[nu,0]-((vec[p,mu] vec[p,nu])/(sp[p,p]))+((vecs[p,mu] vecs[p,nu])/(sps[p,p]))}
}]

transProjFiniteT[p,mu,nu]transProjFiniteT[p,mu,nu]//FormTrace

Troubleshooting and Indices

Debugging Functions

A number of functions allow to perform additional checks. These are

?DebuggingMode

?AlwaysCheckTensorSums

?CheckTensorSums
?CheckLorentzTensorSums
?CheckDiracTensorSums
?CheckFundGroupTensorSums
?CheckAdjGroupTensorSums

CheckTensorSums[vec[p,mu]+1];

Indices Functions

The indices function below enable you to inspect your expressions.

Extracting all indices from an expression

?GetIndices
?GetLorentzIndices
?GetDiracIndices
?GetFundGroupIndices
?GetAdjGroupIndices

Extracting all open indices from an expression

?GetOpenIndices
?GetOpenLorentzIndices
?GetOpenDiracIndices
?GetOpenFundGroupIndices
?GetOpenAdjGroupIndices

Extracting all closed indices from an expression

?GetClosedIndices
?GetClosedLorentzIndices
?GetClosedDiracIndices
?GetClosedFundGroupIndices
?GetClosedAdjGroupIndices

Expert’s Functions

Some functions that are used by the FormTracer internally are accessible from outside. These are not intended to be used by the normal user as they almost certainly require FormTracer development knowledge. However, they are listed below just in case someone finds them useful:

?ConvertInput

?ExpandTerms
?ExpandLorentzStructures

?GenerateFormFile
?ImportFormResult
?GetExtraVarsSynonyms

?FiniteT

?LorentzFormRule
?PreambleFormRule