(* Program to Calculate the Traces of Eq. 4.103 de TC 

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

Remove["Global`*"]

(* Definitions *)

prop[p_,m_]:=GS[p]+m


Line1:= prop[p2,-m] . GA[mu] .  prop[p1-k1,m] . GA[nu] . prop[p1,m] . GA[nu] . 
prop[p1-k1,m] . GA[mu]

Line2:= prop[p2,-m] . GA[mu] .  prop[p1-k2,m] . GA[nu] . prop[p1,m] . GA[nu] . 
prop[p1-k2,m] . GA[mu]

Line12:= prop[p2,-m] . GA[nu] .  prop[p1-k1,m] . GA[mu] . prop[p1,m] . GA[nu] .  prop[p1-k2,m] . GA[mu]

Line21:= prop[p2,-m] . GA[mu] .  prop[p1-k2,m] . GA[nu] . prop[p1,m] . GA[mu] .  prop[p1-k1,m] . GA[nu]


ans1= Simplify[Contract[TR[Line1]]/t^2]
ans2= Simplify[Contract[TR[Line2]]/u^2]
ans12= Simplify[Contract[TR[Line12]]/(t u)]
ans21= Simplify[Contract[TR[Line21]]/(t u)]


  ans= e^4 (ans1 + ans2 + ans12 + ans21) //FCE


onshell={SP[p1,p1]->m^2,SP[p2,p2]->m^2,SP[k1,k1]->0,SP[k2,k2]->0}


res = ans /. onshell 

res = res /. m->0

kin={SP[p1,p2]->s/2 ,SP[p1,k1]->-t/2 ,SP[p1,k2]->-u/2,SP[p2,k1]->-u/2,SP[p2,k2]->-t/2,SP[k1,k2]->s/2}

aux=Expand[res /. kin]

kin2={s->-u-t}

aux = Simplify[aux /. kin2]

final= aux;

Print[" \!\(\*UnderscriptBox[\(\[Sum]\), \(spins\)]\)|M\!\(\*SuperscriptBox[\(|\), \(2\)]\) = ",final]



(********************* Fim do Programa **********************)
