Status: Accepted
Owner: [email protected]
Labels: Type-Defect Priority-Medium
New issue 2568 by [email protected]: Not combining like non-commutative
terms if hidden behind numerical Muls
http://code.google.com/p/sympy/issues/detail?id=2568
a,b = symbols('a b', commutative=False)
a + b + 2*(a+b)
a + b + 2⋅(a + b)
in sympy/core/add.py Line 74
The following snippet stops the 2*(a+b) mul from expanding
elif o.is_Mul:
c, s = o.as_coeff_Mul()
# 3*...
if c.is_Number:
# unevaluated 2-arg Mul
if s.is_Add and s.is_commutative:
seq.extend([c*a for a in s.args])
continue
I think the s.is_commutative condition is unnecessary.
--
You received this message because you are subscribed to the Google Groups
"sympy-issues" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/sympy-issues?hl=en.