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

Hello, the following two tensors with property 'Diagonal' show different behavior depending on whether their indices are linked to coordinates or not:

A_{a b}::Diagonal;
canonicalise($A_{t r}$);

Produces: A_{r t}. With integer valued indices the following code snippet returns 0 - as expected.

B_{c d}::Diagonal;
canonicalise($B_{1 2}$);

The code sample included in the help text for 'Diagonal' also does not work as expected: The non-diagonal parts of the expression are not removed by 'canonicalise'.

I am running Cadabra Version 2.3.6 (build 2680.636a232b66).

in Bug reports by

1 Answer

0 votes

Cadabra used to only handle Diagonal with numerical indices. I have just pushed a fix ( which also handles symbolic indices like in your first example.

by (65.1k points)