Comment #3 on issue 642 by [email protected]: wrong answer from simplifying
non-commutative symbols
http://code.google.com/p/sympy/issues/detail?id=642
collect is the only one giving a wrong result; factoring fails because of
non-commutatives, but a nc factoring routine is available in pull
https://github.com/sympy/sympy/pull/422
>>> eq=A*B-B*A
>>> simplify(eq)
A*B - B*A
>>> radsimp(eq)
A*B - B*A
>>> collect(eq,A)
0
>>> collect(eq,B)
0
>>> factor(eq)
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "sympy\polys\polytools.py", line 5106, in factor
return _generic_factor(f, gens, args, method='factor')
File "sympy\polys\polytools.py", line 5017, in _generic_factor
return _symbolic_factor(sympify(expr), opt, method)
File "sympy\polys\polytools.py", line 4964, in _symbolic_factor
coeff, factors = _symbolic_factor_list(together(expr), opt, method)
File "sympy\polys\polytools.py", line 4927, in _symbolic_factor_list
poly, _ = _poly_from_expr(base, opt)
File "sympy\polys\polytools.py", line 3646, in _poly_from_expr
rep, opt = _dict_from_expr(expr, opt)
File "sympy\polys\polyutils.py", line 295, in _dict_from_expr
raise PolynomialError('non-commutative expressions are not
supported')
sympy.polys.polyerrors.PolynomialError: non-commutative expressions are
not supp
--
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.