# How to evaluate the trace of a product of sums of gamma matrices

I have a large expression of a sum of gamma matrices which resulted from using Casimir's Trick. It is quite tedious to evaluate so I thought about using Mathematica. However, I have no idea how, especially, when the contraction of Lorentz indices is involved.

I'm looking to evaluate an expression of the following form:

$(\gamma^\mu \moveright 6pt /p_a \gamma^\nu + \gamma^0 \moveright 6pt / p_b \gamma^\nu \gamma^\mu)(\gamma_\nu +p_\nu)(\moveright 6pt / p_c+m)$

You could use FeynCalc ( I leave out the \gamma^0, but you could add GA[0] ):

Import["https://raw.githubusercontent.com/FeynCalc/feyncalc/master/\
install.m"]
InstallFeynCalc[]

TR[(GA[\[Mu]].GS[Subscript[p, a]].GA[\[Nu]] +
GS[Subscript[p, b]].GA[\[Nu]].GA[\[Mu]]).(GA[\[Nu]] +
FV[p, \[Nu]]).(GS[Subscript[p, c]] + m)]


resulting in

• Ah, wow. That is exactly what I needed. Thank you! – infinitezero Dec 29 '17 at 18:47
• You are welcome. There is a slight potential problem: After installation of the current stable FeynCalc version you will see all output cells having TraditionalForm. You can reset this by CurrentValue[$FrontEnd, {CommonDefaultFormatTypes, "Output"}] = StandardForm. I was too lazy to fix it myself, but at least added an issue. – Rolf Mertig Dec 29 '17 at 20:59 May I also advertise Package-X, which I wrote? (Is this allowed by rules of this forum?) You can use the function Spur which takes traces of Dirac matrices in$d=4-2\epsilon\$ dimensions.

Copy and paste into your notebook, and select "Yes" to interpret the text below:

Cell[BoxData[
RowBox[{
RowBox[{"Contract", "[",
RowBox[{"Spur", "[",
RowBox[{
RowBox[{
RowBox[{"DiracMatrix", "[",
RowBox[{
SubscriptBox["\[Gamma]", "\[Mu]"], ",",
RowBox[{"pa", ".", "\[Gamma]"}], ",",
SubscriptBox["\[Gamma]", "\[Nu]"]}], "]"}], "+",
RowBox[{"DiracMatrix", "[",
RowBox[{
SubscriptBox["\[Gamma]", "\[Alpha]"], ",",
RowBox[{"pb", ".", "\[Gamma]"}], ",",
SubscriptBox["\[Gamma]", "\[Nu]"], ",",
SubscriptBox["\[Gamma]", "\[Mu]"]}], "]"}]}], ",",
RowBox[{
SubscriptBox["\[Gamma]", "\[Nu]"], "+",
RowBox[{
SubscriptBox["p", "\[Nu]"], "\[DoubleStruckOne]"}]}], ",",
RowBox[{
RowBox[{"pc", ".", "\[Gamma]"}], "+",
RowBox[{"m", " ", "\[DoubleStruckOne]"}]}]}], "]"}], "]"}], "/.",
RowBox[{"\[Alpha]", "->", "0"}]}]], "Input"]