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

Indices marked as independent seem to implicitly assume a fixed upper/lower contraction when canonicalizing in some cases.

Consider the below example:

{a,b,c,d}::Indices(vector, position=independent).
$Y^{c} \Lambda_{b} \Lambda_{a} V_{c}^{a} X_{b}$;
canonicalise(_);

This returns

Y^{a} \Lambda_{b} \Lambda_{c} V_{a b} X^{c}

apparently shuffling the last indices on V and X (even though they are of independent types) because they are both contracted upon \Lambda's. This is fine if we always contract upper/lower but otherwise this is somewhat counterintuitive behavior.

Interestingly, this only happens when the additional tensor Y is present attached to the other index on V.

in Bug reports by (1.0k points)

I confirm the behaviour!

The independent position label differs from the result from free and fixed, but is not returning the expected result.

1 Answer

0 votes

The algorithm does funny things if you declare indices independent but then not stick to Einstein conventions of having only one upper and one lower index. In your example, the b index appears as subscript twice. It tried to keep those two bs as lower indices, but as a result, it had to raise the index on X.

I would classifyl this as undefined behaviour, though perhaps a warning would have been appropriate. I don't think I will spend time on 'fixing' this, especially because it isn't even clear what the right fix should do.

by (82.5k points)
...