# Canonicalizing with independent indices mixes up raised/lowered

+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.

I confirm the behaviour!

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

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.