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 ;
\partial{#}::Derivative;
X_{a}::Depends(\partial{#});
foo1 := \partial{X_{b}} \partial{X_{a}} + X_{b} X_{a};
canonicalise(foo1);
foo2 := \partial{X_{b}} \partial{X_{a}} + X_{b} X_{a};
sort_product(foo2);
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?