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

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

{t,r}::Coordinate;
{a,b}::Indices(values={t,r},position=fixed);
A_{a b}::Diagonal;
canonicalise($A_{t r}$);

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

{c,d}::Indices(position=fixed);
{c,d}::Integer(1..2);
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

+1 vote

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

by (83.1k points)
...