Skip to content

Commit

Permalink
Fixed a bug in DOTSimplify related to the separation
Browse files Browse the repository at this point in the history
of Dirac and color structures (Issue #168, thanks to QSSRHelper)
  • Loading branch information
vsht committed Apr 17, 2022
1 parent 93bf601 commit a1fd68d
Show file tree
Hide file tree
Showing 4 changed files with 80 additions and 10 deletions.
31 changes: 24 additions & 7 deletions FeynCalc/NonCommAlgebra/DotSimplify.m
Original file line number Diff line number Diff line change
Expand Up @@ -383,24 +383,41 @@ numerators of fermionic propagators like (GS[p]+m) that appear in \
(* Dirac, Pauli and SU(N) matrices commute with each other, so they need to be properly separated*)
If[ !FreeQ2[x, {SUNT,PauliSigma,PauliEta,PauliXi}],
time=AbsoluteTime[];
FCPrint[1, "DotSimplify: Pulling out SU(N) matrices", FCDoControl->dsVerbose];
x = x /. DOT->holdDOT;
(* Notice that here we are checking heads, so this will not break a possibly complicated nested structure *)
(*
Notice that even though we are checking heads here, one could still possibly mess up
some complicated nested structure. This could happend if the option Expanding has been
set to False so that we have DOTs inside DOTs.
x = x //. holdDOT[zzz__] :> (holdDOTColor@@Select[{zzz}, (Head[#] === SUNT) &])(holdDOTRest1@@Select[{zzz}, (Head[#] =!= SUNT) &]);
FCPrint[1, "DotSimplify: Pulling out Dirac matrices", FCDoControl->dsVerbose];
To avoid this situation, DOTs with nested must be left untouched. Otherwise, something like
GAD[mu] . SUNT[a] . (SUNT[cola, colb] . GAD[nu]) . (SUNT[colc] . GAD[rho] . GSD[x] + SUNT[colc] . GSD[y] . GAD[rho] . GAD[lorf])
turns into
GAD[mu] . GAD[nu] . (GAD[rho] . GSD[x] SUNT[colc] + GSD[y] . GAD[rho] . GAD[lorf] SUNT[colc]) SUNT[a] . SUNT[cola] . SUNT[colb]
where the color structure gets messed up!
*)
FCPrint[1, "DotSimplify: Pulling out SU(N) matrices", FCDoControl->dsVerbose];
x = x //. holdDOT[zzz__]/; FreeQ2[{zzz}, {holdDOT, holdDOTColor}] :>
(holdDOTColor@@Select[{zzz}, (Head[#] === SUNT) &])(holdDOTRest1@@Select[{zzz}, (Head[#] =!= SUNT) &]);
FCPrint[3, "DotSimplify: After pulling out SU(N) matrices:", x, FCDoControl->dsVerbose];

FCPrint[1, "DotSimplify: Pulling out Dirac matrices", FCDoControl->dsVerbose];
x = x //. holdDOTRest1[zzz__] :> (holdDOTDirac@@Select[{zzz}, !FreeQ2[{#},{DiracGamma,Spinor}]& ])*
(holdDOTRest2@@Select[{zzz}, FreeQ2[{#},{DiracGamma,Spinor}]& ]);
FCPrint[1, "DotSimplify: Pulling out Pauli matrices", FCDoControl->dsVerbose];
FCPrint[3, "DotSimplify: After pulling out Dirac matrices: ", x, FCDoControl->dsVerbose];

FCPrint[1, "DotSimplify: Pulling out Pauli matrices", FCDoControl->dsVerbose];
x = x //. holdDOTRest2[zzz__] :> (holdDOTPauli@@Select[{zzz}, !FreeQ2[{#},{PauliSigma,PauliEta,PauliXi}]& ])*
(holdDOTRest3@@Select[{zzz}, FreeQ2[{#},{PauliSigma,PauliEta,PauliXi}]&]);
FCPrint[3, "DotSimplify: After pulling out Pauli matrices: ", x, FCDoControl->dsVerbose];

(* SUNT's and PauliSigma's in a DiracTrace are pulled out but NOT summed over *)
x = x //. DiracTrace[f_ g :(_holdDOTColor | _holdDOTPauli ) ] :> g DiracTrace[f]/.
(holdDOTColor|holdDOTDirac|holdDOTPauli|holdDOTRest1|holdDOTRest2|holdDOTRest3)[] -> 1 /.
holdDOTColor|holdDOTDirac|holdDOTPauli|holdDOTRest1|holdDOTRest2|holdDOTRest3 -> DOT;
(holdDOT|holdDOTColor|holdDOTDirac|holdDOTPauli|holdDOTRest1|holdDOTRest2|holdDOTRest3)[] -> 1 /.
holdDOT|holdDOTColor|holdDOTDirac|holdDOTPauli|holdDOTRest1|holdDOTRest2|holdDOTRest3 -> DOT;
FCPrint[1, "DotSimplify: Done pulling out all matrices, timing: ", N[AbsoluteTime[] - time, 4], FCDoControl->dsVerbose];
FCPrint[3, "DotSimplify: After pulling out all matrices: ", x, FCDoControl->dsVerbose]
];
Expand Down
23 changes: 22 additions & 1 deletion Tests/Dirac/DiracSimplify.test
Original file line number Diff line number Diff line change
Expand Up @@ -227,7 +227,28 @@ Spinor[-Momentum[p1, D], mb, 1].GAD[i1].GAD[i2].GAD[i3].GAD[i4].GAD[
"{GA[mu] SP[p, p], 2 FV[p, mu] GS[p] - GA[mu] SP[p, p]}"},
{"fcstDiracSimplify-ID46",
"DiracSimplify[GAD[mu].(GSD[p + q] + m).GAD[mu],FCE->True]",
"D m + 2 GSD[p] - D GSD[p] + 2 GSD[q] - D GSD[q]"}
"D m + 2 GSD[p] - D GSD[p] + 2 GSD[q] - D GSD[q]"},

{"fcstDiracSimplify-ID49",
"DiracTrace[
GAD[\[Mu]] . GA[5] . SUNT[a] . SUNT[cola, colb] . GAD[lorc] .
GSD[x] . GAD[lord] . GAD[\[Nu]] .
GA[5] . (SUNT[colc] . FVD[x, lore] . GAD[lorf] +
SUNT[colc] . GAD[lore] . GAD[lorf] . GSD[x]) MTD[lorc,
lore] MTD[lord, lorf] SUNF[cola, colb, colc]] //
DiracSimplify[#, FCE -> True] &",
"64 SUNT[a] . SUNT[cola] . SUNT[colb] . SUNT[colc] FVD[x, \[Mu]] FVD[
x, \[Nu]] SUNF[cola, colb, colc] -
48 D SUNT[a] . SUNT[cola] . SUNT[colb] . SUNT[colc] FVD[
x, \[Mu]] FVD[x, \[Nu]] SUNF[cola, colb, colc] +
8 D^2 SUNT[a] . SUNT[cola] . SUNT[colb] . SUNT[colc] FVD[
x, \[Mu]] FVD[x, \[Nu]] SUNF[cola, colb, colc] -
40 SUNT[a] . SUNT[cola] . SUNT[colb] .
SUNT[colc] MTD[\[Mu], \[Nu]] SPD[x, x] SUNF[cola, colb, colc] +
28 D SUNT[a] . SUNT[cola] . SUNT[colb] .
SUNT[colc] MTD[\[Mu], \[Nu]] SPD[x, x] SUNF[cola, colb, colc] -
4 D^2 SUNT[a] . SUNT[cola] . SUNT[colb] .
SUNT[colc] MTD[\[Mu], \[Nu]] SPD[x, x] SUNF[cola, colb, colc]"}
};


Expand Down
28 changes: 27 additions & 1 deletion Tests/NonCommAlgebra/DotSimplify.test
Original file line number Diff line number Diff line change
Expand Up @@ -121,5 +121,31 @@ DotSimplify[ExpandPartialD[QuantumField[A1].QuantumField[A1].LeftPartialD[nu]]]"
{"fcstDotSimplify-ID24","AntiCommutator[QuantumField[FCPartialD[LorentzIndex[xxx_]], A2], QuantumField[A2]] = 0;
DotSimplify[ExpandPartialD[QuantumField[A2].QuantumField[A2].LeftPartialD[nu]]]","0"},
{"fcstDotSimplify-ID25","DotSimplify[DCHN[GA[mu].(x GS[p]).GA[nu], i, j], FCE -> True]",
"x DCHN[GA[mu].GS[p].GA[nu], i, j]"}
"x DCHN[GA[mu].GS[p].GA[nu], i, j]"},
{"fcstDotSimplify-ID26","DotSimplify[
GAD[mu] . SUNT[a] . (SUNT[cola, colb] . GAD[nu]) . (SUNT[colc] . GAD[rho] . GSD[x] +
SUNT[colc] . GSD[y] . GAD[rho] . GAD[lorf]), Expanding -> False,
FCE -> True]",
"GAD[mu] . SUNT[a] . SUNT[cola] . SUNT[colb] .
GAD[nu] . (GAD[rho] . GSD[x] SUNT[colc] +
GSD[y] . GAD[rho] . GAD[lorf] SUNT[colc])"},

{"fcstDotSimplify-ID27","DotSimplify[
DiracGammaCombine[
DiracTrace[
MTD[lord, lorf] MTD[lorc, lore] SUNF[cola, colb,
colc] GAD[\[Mu]] . GA[5] .
SUNT[a] . (SUNT[cola, colb] . GAD[lorc] . GSD[x] . GAD[lord]) .
GAD[\[Nu]] .
GA[5] . (SUNT[colc] . GAD[lore, lorf] . GSD[x] +
SUNT[colc] . FVD[x, lore] . GAD[lorf])]], Expanding -> False,
FCE -> True]",
"DiracTrace[
GAD[\[Mu]] . GA[5] . SUNT[a] . SUNT[cola] . SUNT[colb] . GAD[lorc] .
GSD[x] . GAD[lord] . GAD[\[Nu]] .
GA[5] . (GAD[lore] . GAD[lorf] . GSD[x] SUNT[colc] +
FVD[x, lore] GAD[lorf] SUNT[colc]) MTD[lorc, lore] MTD[lord,
lorf] SUNF[cola, colb, colc]]"}


}
8 changes: 7 additions & 1 deletion Tests/SUN/SUNTrace.test
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,12 @@ Tests`SUN`fcstSUNTraceColorTraces = {
{"fcstSUNTraceColorTraces-ID8","SUNTrace[SUNF[a, r, s] SUNF[b, r, s]] // SUNSimplify",
"CA^2*SUNDelta[SUNIndex[a], SUNIndex[b]]"},
{"fcstSUNTraceColorTraces-ID9","SUNTrace[SUNT[a, b, c, a, b, c]]",
"-(1/(8 SUNN^2)) + SUNN^2/8"}
"-(1/(8 SUNN^2)) + SUNN^2/8"},
{"fcstSUNTraceColorTraces-ID10","SUNTrace[GAD[\[Mu]] . GA[5] . SUNT[a] . SUNT[cola, colb] .
GAD[lorc] . GSD[x] . GAD[lord] . GAD[\[Nu]] .
GA[5] . (SUNT[colc] . FVD[x, lore] . GAD[lorf] +
SUNT[colc] . GAD[lore] . GAD[lorf] . GSD[x]) MTD[lorc, lore] MTD[
lord, lorf] SUNF[cola, colb, colc]]",
"0"}
};

0 comments on commit a1fd68d

Please sign in to comment.