Maxima Function
rename (expr)
rename(expr,count)
Returns an expression equivalent to expr but with the dummy indices
in each term chosen from the set [%1, %2,...]
, if the optional second
argument is omitted. Otherwise, the dummy indices are indexed
beginning at the value of count. Each dummy index in a product
will be different. For a sum, rename
will operate upon each term in
the sum resetting the counter with each term. In this way rename
can
serve as a tensorial simplifier. In addition, the indices will be
sorted alphanumerically (if allsym
is true
) with respect to
covariant or contravariant indices depending upon the value of flipflag
.
If flipflag
is false
then the indices will be renamed according
to the order of the contravariant indices. If flipflag
is true
the renaming will occur according to the order of the covariant
indices. It often happens that the combined effect of the two renamings will
reduce an expression more than either one by itself.
(%i1) load(itensor); (%o1) /share/tensor/itensor.lisp (%i2) allsym:true; (%o2) true (%i3) g([],[%4,%5])*g([],[%6,%7])*ichr2([%1,%4],[%3])* ichr2([%2,%3],[u])*ichr2([%5,%6],[%1])*ichr2([%7,r],[%2])- g([],[%4,%5])*g([],[%6,%7])*ichr2([%1,%2],[u])* ichr2([%3,%5],[%1])*ichr2([%4,%6],[%3])*ichr2([%7,r],[%2]),noeval$ (%i4) expr:ishow(%)$ %4 %5 %6 %7 %3 u %1 %2 (%t4) g g ichr2 ichr2 ichr2 ichr2 %1 %4 %2 %3 %5 %6 %7 r %4 %5 %6 %7 u %1 %3 %2 - g g ichr2 ichr2 ichr2 ichr2 %1 %2 %3 %5 %4 %6 %7 r (%i5) flipflag:true; (%o5) true (%i6) ishow(rename(expr))$ %2 %5 %6 %7 %4 u %1 %3 (%t6) g g ichr2 ichr2 ichr2 ichr2 %1 %2 %3 %4 %5 %6 %7 r %4 %5 %6 %7 u %1 %3 %2 - g g ichr2 ichr2 ichr2 ichr2 %1 %2 %3 %4 %5 %6 %7 r (%i7) flipflag:false; (%o7) false (%i8) rename(%th(2)); (%o8) 0 (%i9) ishow(rename(expr))$ %1 %2 %3 %4 %5 %6 %7 u (%t9) g g ichr2 ichr2 ichr2 ichr2 %1 %6 %2 %3 %4 r %5 %7 %1 %2 %3 %4 %6 %5 %7 u - g g ichr2 ichr2 ichr2 ichr2 %1 %3 %2 %6 %4 r %5 %7