Open rtoy opened 3 days ago
Imported from SourceForge on 2024-07-03 21:25:50 Created by macrakis on 2003-08-04 15:26:55 Original: https://sourceforge.net/p/maxima/bugs/174/#3a49
Logged In: YES user_id=588346
For commutative terms, there is a simple canonical form in Maxima. But there is no canonical form for non-commutative terms. I wonder if by default the simplifer should canonicalize them.
Currently, for example, (a.b.a^^-1)^^2 and a.b^^2 .a^^-1
(which are equivalent): both currently simplify to themselves.
But if we canonicalize to the second one (following the rule
that all possible cancellations have been carried out), we lose
the structure shown in the first case.
Imported from SourceForge on 2024-07-03 21:25:53 Created by robert_dodier on 2006-07-01 02:56:45 Original: https://sourceforge.net/p/maxima/bugs/174/#0b6c
Imported from SourceForge on 2024-07-03 21:25:57 Created by robert_dodier on 2006-09-09 14:51:51 Original: https://sourceforge.net/p/maxima/bugs/174/#a72d
Imported from SourceForge on 2024-07-03 21:25:49 Created by macrakis on 2002-10-28 08:24:30 Original: https://sourceforge.net/p/maxima/bugs/174
x^^-1 . x . y . x . y
simplifies to
x^^-1 . (x . y)^^2
instead of
y . x . y
But the following work correctly:
x^^-1 . x . y . x . y . y => y . x . y^^2
(x^^-1 . x . y) . x . y => y . x . y
y . x . y . x . x^^-1 ------------------------------------------------
A consequence of the above (this was the original problem I ran into):
x^^-1 . (x . y)^^2
expand(%) returns it unchanged. OK expand(%), dotexptsimp:false returns
x^^-1 . x . y . x . y
and now expand(%) gives
x^^-1 . (x . y)^^2
instead of
y . x . y
Hmm. So how do I simplify this to y.x.y?
---------------------------------------------
Compare this to
x^^-1 . (x . y)^^2 . y^^-1 and (x . y . x^^-1)^^2 and y . (x . y)^^-1 and (x . y)^^-1 . x
for all of which the sequence expand/dotexptsimp:false then expand performs the expected cancellation.
----------------------------------------
The problem is that simpnct simplifies from right to left, so that by the time it sees x^^-1 . x . y...., that has already become x^^-1 . (x . y)^^2, which it doesn't currently simplify.
The quick fix is to special-case this in simpnct, but it's a bit messy....