From a1fd68d4f22eb849165163a5fa48ec12ac6e3045 Mon Sep 17 00:00:00 2001 From: Vladyslav Shtabovenko Date: Sun, 17 Apr 2022 13:14:51 +0200 Subject: [PATCH] Fixed a bug in DOTSimplify related to the separation of Dirac and color structures (Issue #168, thanks to QSSRHelper) --- FeynCalc/NonCommAlgebra/DotSimplify.m | 31 +++++++++++++++++++++------ Tests/Dirac/DiracSimplify.test | 23 +++++++++++++++++++- Tests/NonCommAlgebra/DotSimplify.test | 28 +++++++++++++++++++++++- Tests/SUN/SUNTrace.test | 8 ++++++- 4 files changed, 80 insertions(+), 10 deletions(-) diff --git a/FeynCalc/NonCommAlgebra/DotSimplify.m b/FeynCalc/NonCommAlgebra/DotSimplify.m index 8f82d495a..2f175ece7 100755 --- a/FeynCalc/NonCommAlgebra/DotSimplify.m +++ b/FeynCalc/NonCommAlgebra/DotSimplify.m @@ -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] ]; diff --git a/Tests/Dirac/DiracSimplify.test b/Tests/Dirac/DiracSimplify.test index 0c88b94a7..e964b5258 100644 --- a/Tests/Dirac/DiracSimplify.test +++ b/Tests/Dirac/DiracSimplify.test @@ -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]"} }; diff --git a/Tests/NonCommAlgebra/DotSimplify.test b/Tests/NonCommAlgebra/DotSimplify.test index babb3b90f..e0b05d30c 100644 --- a/Tests/NonCommAlgebra/DotSimplify.test +++ b/Tests/NonCommAlgebra/DotSimplify.test @@ -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]]"} + + } diff --git a/Tests/SUN/SUNTrace.test b/Tests/SUN/SUNTrace.test index da0a5a0ba..3eb1360fe 100644 --- a/Tests/SUN/SUNTrace.test +++ b/Tests/SUN/SUNTrace.test @@ -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"} };