Skip to content

Wrong sign in SUNSimplify #368

Open
Open

Description

@eriks245

The following calculation gives a wrong result

In[2]:= SUNSimplify[SUNF[g0, b, c] SUNF[b, e, d] SUNF[e, g1, h] SUNF[h, c, d]]

Out[2]= -(1/2) Subsuperscript[C, A, 2] \[Delta]^(g0g1)

In[3]:= SUNSimplify[SUNF[g2, b, c] SUNF[b, e, d] SUNF[e, g1, h] SUNF[h, c, d]]

Out[3]= 1/2 Subsuperscript[C, A, 2] \[Delta]^(g1g2)

I would expect that SUNSimplify gives the exact same result, since only one label changed (g0 -> g2).

Activity

  1. wuwphy commented on Nov 25, 2026

    @wuwphy

    I independently reproduced this issue in the official FeynCalc 10.2.1 release and traced it to a duplicated pattern in SUN/SUNSimplify.m.

    Environment: Mathematica 13.3, macOS ARM64. I tested untouched official release archives in fresh kernels using -noinit, without loading other packages. The same defect is present in 10.1.0.

    Likely cause

    In Release-10_2_1, lines 728–734, these two definitions have identical left-hand sides but opposite signs:

    (* 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___]
    ] := SUNN/2 (-1)^(Length[{r2}])
           colorSimplifyGeneric[rest sunf[b, d, r2, r3, r1]];

    The second SetDelayed therefore overwrites the first rule. Its sunf2 pattern appears intended to be sunf2[b_, c_SUNIndex, a_SUNIndex, d_], matching the bcad ordering in its comment.

    Proposed one-line correction

    Change only the second pattern:

    -  rest_. sunf2[b_, a_SUNIndex, c_SUNIndex, d_]
    +  rest_. sunf2[b_, c_SUNIndex, a_SUNIndex, d_]

    The second comment should also have a positive sign. With
    f2[a,b,c,d] = Sum[f[x,a,b] f[x,c,d], x], the two contractions are

    f2[b,a,c,d] f[a,c,e] = -CA/2 f[b,d,e]
    f2[b,c,a,d] f[a,c,e] = +CA/2 f[b,d,e]
    

    The second identity follows from the first by exchanging the summed indices a and c and using antisymmetry of f. The second rule's existing RHS is consistent with that positive sign; it is the LHS ordering that needs correction.

    Verification

    Using exactly the two expressions in this issue, unmodified 10.2.1 gives respectively -SUNN^2/2 and +SUNN^2/2 times the corresponding external delta. In a separate temporary official 10.2.1 copy, changing just that pattern makes both results +SUNN^2/2 times the delta. This sign agrees with an independent direct SU(2) Levi-Civita sum.

    I initially encountered the same defect in a five-structure-constant network. Rule-specific instrumentation confirmed that it fires the overwritten contraction. For 58 five-f argument-permutation/index-relabeling tests, unmodified 10.2.1 passes 17 and fails 41; the one-line correction passes all 58. All 144 simpler three-f controls (24 f2 slot orders times 6 third-f argument orders), checked against direct SU(2) sums, pass both before and after the correction.

    Could you please confirm this diagnosis and the intended pattern?

  2. vsht commented on Nov 25, 2026

    @vsht
    Member

    Thank you for the detailed report! 🙏

    Summary

    This issue is already fixed in the current stable version of FeynCalc. The behaviour you describe comes from the outdated 10.2.1 release archive, not from the current code.

    Status

    ✅ The fix has been on the hotfix-stable branch since September 2026, in commit 3efe5eca ("fix colorSimplifyGeneric"). It is also in master.

    That commit corrected the colorSimplifyGeneric contraction rules for sunf2 × sunf in SUN/SUNSimplify.m:

    • f_2^bcad f^ace rule: now uses sunf2[b_, c_SUNIndex, a_SUNIndex, d_], so it no longer clashes with the f_2^bacd f^ace rule.
    • f_2^abcd f^cde / f_2^abdc f^cde rules: their index slots were swapped; this is corrected as well.
    • Comment signs: the comments of the cbda, bcad and badc rules now state the correct sign +N/2.

    Why 10.2.1 still shows the bug

    The release archives (e.g. 10.2.1) are frozen snapshots kept for reference; they are not updated after release. All bug fixes go to the hotfix-stable branch, so testing against a release archive will reproduce bugs that have long been fixed.

    How to get the fix

    Please install the latest stable version from the hotfix-stable branch, either

    1. via the automatic installer, or
    2. manually, by downloading the hotfix-stable branch from GitHub.

    After updating, both expressions from the original report should give the same result.

    If you still see wrong signs with the current hotfix-stable version, please let us know and post the expression. Thanks again! 🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions