Updates:
        Labels: EasyToFix NeedsReview

Comment #3 on issue 1261 by asmeurer: incorrect exponentiation with  
non-commutative symbols
http://code.google.com/p/sympy/issues/detail?id=1261

This also holds true for exp(x)*exp(y).  powsimp cannot maintain  
commutativity of the arguments unless exp(x).is_commutative is the same as
x.is_commutative.  It looks like a lot of things are not doing this  
correctly.

>>> x.is_commutative
False
>>> exp(x).is_commutative
True
>>> sin(x).is_commutative
True

Not even addition gets it right:

>>> y.is_commutative
False
>>> x+y
x + y
>>> y+x
x + y

This should be easy to fix.  Add.py just needs to be refactored so that the  
noncommutative parts do not order (see Mul for how this is done).  To fix  
the
problem in the original post, I think Mul needs to be modified ((x*y/x)**2  
is a Mul).  I have attached a patch that fixes functions being commutative  
when the
arguments are not.

Attachments:
        0001-Made-Function-return-is_commutative-False-if-any.patch  1.6 KB

--
You received this message because you are listed in the owner
or CC fields of this issue, or because you starred this issue.
You may adjust your issue notification preferences at:
http://code.google.com/hosting/settings

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"sympy-issues" group.
To post to this group, send email to sympy-issues@googlegroups.com
To unsubscribe from this group, send email to 
sympy-issues+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/sympy-issues?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to