Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 8 additions & 8 deletions FeynCalc/SUN/SUNSimplify.m
Original file line number Diff line number Diff line change
Expand Up @@ -702,12 +702,12 @@ Introducing SU(N) structure constants, this must be the last operation, since an
SUNN (-1)^(Length[{r2}]+1) colorSimplifyGeneric[rest sunf[r2,r3,r1,c,d]];

(* f_2^abcd f^cde = N f^eab *)
colorSimplifyGeneric[rest_. sunf2[c_, d_, a_SUNIndex, b_SUNIndex] sunf[r1___,a_SUNIndex,r2___,b_SUNIndex,r3___]] :=
SUNN (-1)^(Length[{r2}]) colorSimplifyGeneric[rest sunf[r2,r3,r1,c,d]];
colorSimplifyGeneric[rest_. sunf2[a_, b_, c_SUNIndex, d_SUNIndex] sunf[r1___,c_SUNIndex,r2___,d_SUNIndex,r3___]] :=
SUNN (-1)^(Length[{r2}]) colorSimplifyGeneric[rest sunf[r2,r3,r1,a,b]];

(* f_2^abdc f^cde = - N f^eab *)
colorSimplifyGeneric[rest_. sunf2[c_, d_, b_SUNIndex, a_SUNIndex] sunf[r1___,a_SUNIndex,r2___,b_SUNIndex,r3___]] :=
SUNN (-1)^(Length[{r2}]+1) colorSimplifyGeneric[rest sunf[r2,r3,r1,c,d]];
colorSimplifyGeneric[rest_. sunf2[a_, b_, d_SUNIndex, c_SUNIndex] sunf[r1___,c_SUNIndex,r2___,d_SUNIndex,r3___]] :=
SUNN (-1)^(Length[{r2}]+1) colorSimplifyGeneric[rest sunf[r2,r3,r1,a,b]];

(* f_2^abcd f^ace = N/2 f^bde *)
colorSimplifyGeneric[rest_. sunf2[a_SUNIndex, b_, c_SUNIndex, d_] sunf[r1___,a_SUNIndex,r2___,c_SUNIndex,r3___]] :=
Expand All @@ -721,19 +721,19 @@ Introducing SU(N) structure constants, this must be the last operation, since an
colorSimplifyGeneric[rest_. sunf2[a_SUNIndex, b_, d_, c_SUNIndex] sunf[r1___,a_SUNIndex,r2___,c_SUNIndex,r3___]] :=
SUNN/2 (-1)^(Length[{r2}]+1) colorSimplifyGeneric[rest sunf[b,d,r2,r3,r1]];

(* f_2^cbda f^ace = - N/2 f^bde *)
(* f_2^cbda f^ace = N/2 f^bde *)
colorSimplifyGeneric[rest_. sunf2[c_SUNIndex, b_, d_, a_SUNIndex] sunf[r1___,a_SUNIndex,r2___,c_SUNIndex,r3___]] :=
SUNN/2 (-1)^(Length[{r2}]) colorSimplifyGeneric[rest sunf[b,d,r2,r3,r1]];

(* f_2^bacd f^ace = - N/2 f^bde *)
colorSimplifyGeneric[rest_. sunf2[b_, a_SUNIndex, c_SUNIndex, d_] sunf[r1___,a_SUNIndex,r2___,c_SUNIndex,r3___]] :=
SUNN/2 (-1)^(Length[{r2}]+1) colorSimplifyGeneric[rest sunf[b,d,r2,r3,r1]];

(* f_2^bcad f^ace = - N/2 f^bde *)
colorSimplifyGeneric[rest_. sunf2[b_, a_SUNIndex, c_SUNIndex, d_] sunf[r1___,a_SUNIndex,r2___,c_SUNIndex,r3___]] :=
(* f_2^bcad f^ace = N/2 f^bde *)
colorSimplifyGeneric[rest_. sunf2[b_, c_SUNIndex, a_SUNIndex, d_] sunf[r1___,a_SUNIndex,r2___,c_SUNIndex,r3___]] :=

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is the actual bug fix. Looks like a copy paste error from the case above. All other changes are just to sync the comment with the actual rule

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good. Can you please also add a couple of unit tests to

https://github.com/FeynCalc/feyncalc/blob/master/Tests/SUN/SUNSimplify.test

that cover this case?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure, I added some more unit tests. They should now cover every case at least once.

SUNN/2 (-1)^(Length[{r2}]) colorSimplifyGeneric[rest sunf[b,d,r2,r3,r1]];

(* f_2^badc f^ace = - N/2 f^bde *)
(* f_2^badc f^ace = N/2 f^bde *)
colorSimplifyGeneric[rest_. sunf2[b_, a_SUNIndex, d_, c_SUNIndex] sunf[r1___,a_SUNIndex,r2___,c_SUNIndex,r3___]] :=
SUNN/2 (-1)^(Length[{r2}]) colorSimplifyGeneric[rest sunf[b,d,r2,r3,r1]];

Expand Down
44 changes: 43 additions & 1 deletion Tests/SUN/SUNSimplify.test
Original file line number Diff line number Diff line change
Expand Up @@ -279,6 +279,48 @@ SUNFIndex[k], SUNFIndex[l]])/2"},
"(I/2)*CA^2*CF"},
{"fcstSUNSimplify-ID75",
"SUNSimplify[SUNF[a,b,c]SUNTF[{b,c},i,j]]",
"(I/2)*CA*SUNTF[{SUNIndex[a]}, SUNFIndex[i], SUNFIndex[j]]"}
"(I/2)*CA*SUNTF[{SUNIndex[a]}, SUNFIndex[i], SUNFIndex[j]]"},
{"fcstSUNSimplify-ID76",
"SUNSimplify[SUNF[g2,b,c] SUNF[b,e,d] SUNF[e,g1,h] SUNF[h,c,d]]",
"(1/2)*CA^2*SUNDelta[SUNIndex[g2], SUNIndex[g1]]"},
{"fcstSUNSimplify-ID77",
"SUNSimplify[SUNF[g0,b,c] SUNF[b,e,d] SUNF[e,g1,h] SUNF[h,c,d]]",
"(1/2)*CA^2*SUNDelta[SUNIndex[g0], SUNIndex[g1]]"},
{"fcstSUNSimplify-ID78",
"SUNSimplify[SUNF[a0,b,c] SUNF[b,e,d] SUNF[e,a1,h] SUNF[h,c,d]]",
"(1/2)*CA^2*SUNDelta[SUNIndex[a0], SUNIndex[a1]]"},
{"fcstSUNSimplify-ID79",
"SUNSimplify[SUNF[g0,b,d] SUNF[b,e,c] SUNF[e,g1,h] SUNF[h,d,c]]",
"(1/2)*CA^2*SUNDelta[SUNIndex[g0], SUNIndex[g1]]"},
{"fcstSUNSimplify-ID80",
"SUNSimplify[SUNF[g1,b,d] SUNF[b,e,c] SUNF[e,g1,h] SUNF[h,d,c]]",
"CA^3*CF"},
{"fcstSUNSimplify-ID81",
"SUNSimplify[SUNF[g1,b,c] SUNF[b,e,d] SUNF[e,g2,h] SUNF[h,c,d] SUNF[g2,i,j]]",
"1/2*CA^2*SUNF[SUNIndex[g1],SUNIndex[i],SUNIndex[j]]"},
{"fcstSUNSimplify-ID82",
"SUNSimplify[SUNF[g,b,c] SUNF[b,e,d] SUNF[e,a,d0] SUNF[d0,c,d] SUNF[g,i,j]]",
"1/2*CA^2*SUNF[SUNIndex[a],SUNIndex[i],SUNIndex[j]]"},
{"fcstSUNSimplify-ID83",
"SUNSimplify[SUNF[x03, x07, x01] SUNF[x06, x02, x11] SUNF[x06, x12, x04] SUNF[x08, \
x04, x05] SUNF[x08, x10, x01] SUNF[x10, x07, x09] SUNF[x11, x03, \
x05] SUNF[x12, x02, x09]]",
"-1/4*CA^5*CF"},
{"fcstSUNSimplify-ID84",
"SUNSimplify[SUNF[x01, x06, x09] SUNF[x01, x10, x08] SUNF[x05, x11, x03] SUNF[x06, \
x08, x05] SUNF[x07, x12, x04] SUNF[x09, x03, x12] SUNF[x10, x02, \
x04] SUNF[x11, x02, x07]]",
"1/4*CA^5*CF"},
{"fcstSUNSimplify-ID85",
"SUNSimplify[SUNF[x08, x12, x05] SUNF[x01, x10, x06] SUNF[x09, x10, x02] SUNF[x03, \
x11, x02] SUNF[x07, x12, x04] SUNF[x01, x05, x04] SUNF[x09, x11, \
x06] SUNF[x03, x07, x08]]",
"-1/2*CA^5*CF"},
{"fcstSUNSimplify-ID86",
"SUNSimplify[SUNF[x08, x14, x05] SUNF[x01, x12, x06] SUNF[x09, x12, x02] SUNF[x03, \
x13, x02] SUNF[x07, x14, x04] SUNF[x01, x10, x11] SUNF[x09, x13, \
x06] SUNF[x03, x07, x08], SUNIndexNames -> {z}]",
"1/4*CA^3*SUNF[SUNIndex[x04], SUNIndex[x05], SUNIndex[z]] SUNF[SUNIndex[x10], \
SUNIndex[x11], SUNIndex[z]]"}
};