Hello!
The function collectterms(exp,vars) in facexp can be used to simplify tensors
Maxima 5.9.0pre-cvs (with enhancements by W. Schelter).
Licensed under the GNU Public License (see file COPYING)
(C1) load(facexp);load(itensor);
(D1) /usr/local/share/maxima/5.9.0pre-cvs/share/simplification/facexp.mac(C2)
;; Loading file /usr/local/share/maxima/5.9.0pre-cvs/share/tensor/itensor.fas ...
;; Loading of file /usr/local/share/maxima/5.9.0pre-cvs/share/tensor/itensor.fas is finished.
(D2) /usr/local/share/maxima/5.9.0pre-cvs/share/tensor/itensor.fas
(C3) exp1: T([I,J])*P+T([I,J])*P^2+T([I,J])*F$
(C4) show(%)$
2
(D4) T P + T P + F T
I/J I/J I/J
(C5) show(collectterms(exp1,T([I,J],[])))$
2
(D5) T (P + P + F)
I/J
(C6) exp2:exp1+E([],[I,J])*P+E([],[I,J])*P^2+E([],[I,J])$
(C7) show(%)$
2 I J 2 I J I J
(D7) T P + E P + T P + E P + F T + E
I/J I/J I/J
(C8) collectterms(%,P)$
(C9) show(%)$
I J 2 I J I J
(D9) (T + E ) P + (T + E ) P + F T + E
I/J I/J I/J
(C10) collectterms(%,T([I,J],[])+E([],[I,J]))$
(C11) show(%)$
I J 2 I J
(D11) (T + E ) (P + P) + F T + E
I/J I/J
When I take the output of "tensor/ademo.dem". It can be also
simplified a little.
(C34) expp : CANTEN(RENAME(H8))
Evaluation took 0.12 seconds (0.12 elapsed) using 729.312 KB.
(C35) SHOW(%)
%1 %4 %2 %6 %3 %5 %7 U
(D35) 2 G G G G G G
%1/R,%2/%3 %6/%7,%4/%5
%1 %4 %2 %5 %3 %7 %6 U
- 2 G G G G G G
%1/R,%2/%3 %6/%7,%4/%5
%1 %6 %2 %4 %3 %7 %5 U
+ 2 G G G G G G
%1/R,%2/%3 %6/%7,%4/%5
%1 %6 %2 %7 %3 %5 %4 U
- 2 G G G G G G
%1/R,%2/%3 %6/%7,%4/%5
Evaluation took 0.00 seconds (0.01 elapsed) using 29.172 KB.
(C36) SHOW(COLLECTTERMSL(expp, [G([%1, R], [], %2, %3),G([%6, %7], [], %4, %5)]))$
%1 %4 %2 %6 %3 %5 %7 U %1 %4 %2 %5 %3 %7 %6 U
(D36) (2 G G G G - 2 G G G G
%1 %6 %2 %4 %3 %7 %5 U %1 %6 %2 %7 %3 %5 %4 U
+ 2 G G G G - 2 G G G G ) G
%1/R,%2/%3
G
%6/%7,%4/%5
Evaluation took 0.08 seconds (0.11 elapsed) using 55.906 KB.
(C37)
I used the clisp compiled maxima.
All the best,
Valerij