Welcome to Cadabra Q&A, where you can ask questions and receive answers from other members of the community.
0 votes

This may be more of a feature than a bug report, but it has plagued me since Cadabra v1 (and still seems to be the case in Cadabra v2). The issue is that if I have a SelfAntiCommuting object (a fermion), and I hit it with a derivative, the new object will selfanticommute with sort_product (or prod_sort in v1) but not with canonicalise.

Compare the results of foo1 and foo2 below.

{a, b, c}::Indices(Vector, position=independent);
X_{a}::SelfAntiCommuting ;

foo1 := \partial{X_{b}} \partial{X_{a}} + X_{b} X_{a};

foo2 := \partial{X_{b}} \partial{X_{a}} + X_{b} X_{a};

foo2 gives a sign flip in both expressions when sorting to put X_{a} first. foo1 gives a sign flip only in the second expression. I'm calling this a bug report because one would expect the result to be the same (either the derivative inherits the SelfAntiCommuting property or not).

I have dealt with this by repeatedly defining \partial{X_{a}}::SelfAntiCommuting but this has grown cumbersome in a new project. (Lots of fermions, lots of different types of derivatives.)

Does anyone know a better solution or if this is a genuine bug?

in Bug reports by (510 points)

1 Answer

0 votes

This is a bug, thanks for reporting it. The code path for sort_product is different from the one for canonicalise; the latter is more complicated and contains a bug somewhere. I have opened an issue at https://github.com/kpeeters/cadabra2/issues/113 .

by (66.3k points)