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

The below is likely a duplicate of this bug: Action of sort_product depends on the choice of index. I'm posting this separately because I can elaborate a bit on the original error, and I have simplified the minimal failing example. Tested on Cadabra 2.3.9 (build 2823). (It works fine in Cadabra v1.)

The following code should return zero but doesn't, instead just returning the input.

{a,b,c,d,e,f,g}::Indices(vector,position=independent).
ex := x_{a} x^{b} - x^{b} x_{a};
sort_product(_);

It appears to be a complicated error requiring three ingredients:

  • The flag position=independent must be set. It works fine with position=free.
  • The two tensors must have identical names. It works fine if they are different. The tensors must also have the same total number of indices. (If x^b becomes x^{b c}, it evaluates correctly.) Presumably this is related to them being nominally "identical".
  • The indices must be in opposite positions.
in Bug reports by (1.0k points)
edited by

1 Answer

+1 vote

Thanks for creating a minimal example! This issue should be fixed in 2.3.9.3, which is on the current github master branch.

by (82.5k points)
...