Status: Accepted
Owner: smichr
Labels: Type-Defect Priority-Medium

New issue 2039 by smichr: Mul.eval_subs problems
http://code.google.com/p/sympy/issues/detail?id=2039

Issue 2022 identified a problem with handling of non-commutative terms in a Mul substitution. There are a couple of other problems it has:

1) it is protecting against removal of ele from comms_final but then removes the terms from comm_self; this can cause it to fail when trying to remove an element that is not there:

{lower case commutative, upper case non-commutative}
(a*A*B).subs(a**2*A,1)
.
.
.
ValueError: list.remove(x): x not in list

2) It doesn't handle rational powers:

var('x y')
(x, y)
(x**2*y**(3*x/2)).subs(x*y**(x/2),2)
x**2*y**(3*x/2)

It should have returned 4*y**(x/2).

3) It doesn't handle exp(); it should treat it like a power:

(x*exp(x*2)).subs(x*exp(x),2)
x*exp(2*x)

Should have been 2*exp(x).

Point 2 and 3 have working parallels when the power is an integer:

(x*y**2).subs(x*y,2)
2*y

And the current behavior would allow exp(3*x/2).subs(exp(x/2), y) -> y**3 as long as the exp(3*x/2) isn't in a Mul.

--
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.

Reply via email to