Cadabra
a field theory motivated approach to computer algebra

rename_dummies

Rename dummy indices.
Rename the dummy indices in an expression. This can be necessary in order to make various terms in a sum use the same names for the indices, so that they can be collected.
{m,n,p,q,r,s}::Indices(vector); ex:=A_{m n} B_{m n} - A_{p q} B_{p q};
\(\displaystyle{}\text{Attached property Indices(position=free) to }\left(m, \mmlToken{mo}[linebreak="goodbreak"]{} n, \mmlToken{mo}[linebreak="goodbreak"]{} p, \mmlToken{mo}[linebreak="goodbreak"]{} q, \mmlToken{mo}[linebreak="goodbreak"]{} r, \mmlToken{mo}[linebreak="goodbreak"]{} s\right).\)
\(\displaystyle{}A_{m n} B_{m n}-A_{p q} B_{p q}\)
Using canonicalise does nothing here,
canonicalise(_);
\(\displaystyle{}A_{m n} B_{m n}-A_{p q} B_{p q}\)
However, renaming indices does the trick,
rename_dummies(_);
\(\displaystyle{}0\)
Note that the indices need to have been declared as being part of an index list, using the Indices property.
Copyright © 2001-2017 Kasper Peeters
Questions? info@cadabra.science