(* Program to Calculate the Traces of Eq. 5.84 and 5.85 of QFT 

 Last Version: 06/12/2024
 Compatible with FeynCalc 10.1.0
 Author: Jorge C. Romao
 email: jorge.romao@tecnico.ulisboa.pt
*)


Remove["Global`*"]


prop[p_,m_]:=GS[p]+m
PR=(1 + GA[5])/2
PL=(1 - GA[5])/2


Line1:= GS[p3] . GA[mu] .  GS[p1] . GA[nu]  

Line2:= GS[p2] . GA[mu] .  GS[p4] . GA[nu]

Line3:= GS[p2] . GA[mu] .  GS[p1] . GA[nu]

Line4:= GS[p3] . GA[mu] .  GS[p4] . GA[nu]

Line5:= GS[p3] . GA[mu] .  GS[p1] . GA[nu] . GS[p2] . GA[mu] . GS[p4] . GA[nu] 



ans1= Simplify[Contract[TR[Line1] TR[Line2]]]

ans2= Simplify[Contract[TR[Line3] TR[Line4]]]

ans3= Simplify[Contract[TR[Line5]]]

ans=ans1/4/t^2+ans2/4/s^2-2*ans3/4/s/t //FCE


kin={SP[p1,p2]->s/2,SP[p3,p4]->s/2,SP[p1,p3]->-t/2,SP[p2,p4]->-t/2,SP[p1,p4]->(s+t)/2,SP[p2,p3]->(s+t)/2}



res= e^4 ans /. kin

Print["\!\(\*FractionBox[\(1\), \(4\)]\) \!\(\*UnderscriptBox[\(\[Sum]\), \(spins\)]\)|M\!\(\*SuperscriptBox[\(|\), \(2\)]\) = ",res]

(********************* End of Program **********************)
