Skip to content

Commit

Permalink
Fixed a bug in FCFADiracChainJoin (issue #143, thanks to Turgon).
Browse files Browse the repository at this point in the history
  • Loading branch information
vsht committed Nov 1, 2021
1 parent b045838 commit d5daa37
Show file tree
Hide file tree
Showing 4 changed files with 27 additions and 6 deletions.
6 changes: 5 additions & 1 deletion FeynCalc/Dirac/FCChargeConjugateTransposed.m
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,7 @@
];

FCPrint[1, "FCChargeConjugateTransposed: Leaving.", FCDoControl->fcctVerbose];
FCPrint[3, "FCChargeConjugateTransposed: Leaving with", res, FCDoControl->fcctVerbose];
FCPrint[3, "FCChargeConjugateTransposed: Leaving with ", res, FCDoControl->fcctVerbose];

res

Expand Down Expand Up @@ -206,6 +206,10 @@
cctEvaluateSingle[c1_. d_DiracGamma + c2_:0]:=
(- c1 d + c2)/; NonCommFreeQ[{c1,c2}] && FreeQ[{c1,c2}, dotHold] && !MatchQ[d,DiracGamma[5|6|7]];

(*at this point we may fish out commutative prefactors*)
cctEvaluateSingle[c_ d_dotHold]:=
c cctEvaluateSingle[d]/; NonCommFreeQ[c];

cctEvaluateMultiple[dotHold[a_]]:=
cctEvaluateSingle[a];

Expand Down
6 changes: 3 additions & 3 deletions FeynCalc/Feynman/FCFADiracChainJoin.m
Original file line number Diff line number Diff line change
Expand Up @@ -166,11 +166,11 @@

(* A_ai B_bi -> (A. C B^T C^-1)_ab *)
diracChainEvalM[rest_. DiracChain[chain1_,a_DiracIndex,i_DiracIndex] DiracChain[chain2_,b_DiracIndex,i_DiracIndex]]:=
diracChainEvalM[rest DiracChain[DOT[chain1,FCCCT[chain2, Explicit->True, FCDiracIsolate->False, FCI->True]],a,b]]/; a=!=i && b=!=i;
diracChainEvalM[rest DiracChain[DOT[chain1,FCCCT[chain2, Explicit->True, FCDiracIsolate->True, FCI->True]],a,b]]/; a=!=i && b=!=i;

(* A_ia B_ib -> (C A^T C^-1)_ab *)
diracChainEvalM[rest_. DiracChain[chain1_,i_DiracIndex,a_DiracIndex] DiracChain[chain2_,i_DiracIndex,b_DiracIndex]]:=
diracChainEvalM[rest DiracChain[DOT[FCCCT[chain1, Explicit->True, FCDiracIsolate->False, FCI->True],chain2],a,b]]/; a=!=i && b=!=i;
diracChainEvalM[rest DiracChain[DOT[FCCCT[chain1, Explicit->True, FCDiracIsolate->True, FCI->True],chain2],a,b]]/; a=!=i && b=!=i;

(* A_ii -> Tr(A) *)
diracChainEvalM[rest_. DiracChain[chain_/;chain=!=1,i_DiracIndex,i_DiracIndex]]:=
Expand All @@ -197,7 +197,7 @@

(* u_i v_j A_ij -> ubar.A.v or vbar.A.u *)
diracChainEvalS[rest_. DiracChain[S: Spinor[_. m1_Momentum, ___], a_DiracIndex] DiracChain[z_, a_DiracIndex, b_DiracIndex] DiracChain[Spinor[s_. m2_Momentum, r___], b_DiracIndex]]:=
diracChainEvalS[rest ordering[First[m2],First[m1]]] FCCCT[DOT[S, z, Spinor[-s m2, r]], Explicit->True, FCDiracIsolate->False, FCI->True]/; MemberQ[optFirst, Spinor[s m2, r]];
diracChainEvalS[rest ordering[First[m2],First[m1]]] FCCCT[DOT[S, z, Spinor[-s m2, r]], Explicit->True, FCDiracIsolate->True, FCI->True]/; MemberQ[optFirst, Spinor[s m2, r]];

diracChainEvalS[rest_. ordering[a__] ordering[b__]]:=
diracChainEvalS[rest ordering[a,b]];
Expand Down
6 changes: 5 additions & 1 deletion Tests/Dirac/FCChargeConjugateTransposed.test
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,10 @@ Explicit -> False, FeynCalcExternal -> True]"},
{"fcstFCChargeConjugateTransposed-ID26","FCCCT[GA[i] == x, Explicit -> True, FCE -> True]",
"-GA[i] == x"},
{"fcstFCChargeConjugateTransposed-ID27","FCCCT[{GA[i], GS[p]}, Explicit -> True, FCE -> True]",
"{-GA[i], -GS[p]}"}
"{-GA[i], -GS[p]}"},
{"fcstFCChargeConjugateTransposed-ID28","FCChargeConjugateTransposed[-DiracGamma[7] .
DiracGamma[LorentzIndex[Lor1]], Explicit -> True,
FCDiracIsolate -> False, FCI -> True, FCE -> True]",
"GA[Lor1] . GA[7]"}
});

15 changes: 14 additions & 1 deletion Tests/Feynman/FCFADiracChainJoin.test
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,20 @@ Lor2] (C1 SDF[Col5, Col8] SDF[Col7, colInS] +
C2 SDF[Col5, Col7] SDF[Col8, colInS]) (C2 SDF[Col6, colOutS] SDF[
Col8, colOutB] +
C1 SDF[Col6, Col8] SDF[colOutB, colOutS]) SUNTF[{Glu5}, Col5,
Col6] SUNTF[{Glu5}, colInB, Col7]"}
Col6] SUNTF[{Glu5}, colInB, Col7]"},
{"fcstFCFADiracChainJoin-ID6","FCFADiracChainJoin[{DiracChain[Spinor[-Momentum[InMom1], mqu, 1],
DiracIndex[Dir1]] DiracChain[Spinor[-Momentum[InMom2], mqu, 1],
DiracIndex[Dir2]] DiracChain[
mqu + DiracGamma[Momentum[InMom2 - OutMom3]], DiracIndex[Dir5],
DiracIndex[Dir6]] DiracChain[
DiracGamma[Momentum[-OutMom1 - OutMom2]] .
DiracGamma[LorentzIndex[Lor2]] . DiracGamma[7], DiracIndex[Dir5],
DiracIndex[Dir1]] DiracChain[
DiracGamma[LorentzIndex[Lor1]] . DiracGamma[7], DiracIndex[Dir2],
DiracIndex[Dir6]]}, FCE -> True]",
"{Spinor[-Momentum[InMom2], mqu, 1] . GA[Lor1] .
GA[7] . (mqu - GS[InMom2 - OutMom3]) . GS[-OutMom1 - OutMom2] .
GA[Lor2] . GA[7] . Spinor[Momentum[InMom1], mqu, 1]}"}
};


Expand Down

0 comments on commit d5daa37

Please sign in to comment.