Comment #8 on issue 2022 by smichr: inconsistent behaviour of subs when using non-commutative symbols
http://code.google.com/p/sympy/issues/detail?id=2022

But in that case you really aren't eliminating anything as you have x*y as the result (though it appears as y**(3/2). This is where the overlapping (present) behavior of subs is causing problems. The user should have done a subs(x, sqrt(y)) if that is what they wanted.

This is where I would lobby for a subs syntax to handle an explicit u-substitution, something like eq.subs([x], Eq(x**2, y)) to mean "replace x with what you get when you solve x**2 = y". (There are two solutions, perhaps two results should be returned and the user can pick which one they want.)

Has anyone suggested a filter option to subs where you can tell it what sort of expression to make the substitution in? so, for example

(x + x**3).subs([x], Eq(x**2, y), filter = lambda w: w.is_Pow) => x + y**(3/2)

But except for the proof of concept that such a replacement is possible, would anyone ever want to do such a thing?

--
You received this message because you are subscribed to the Google Groups 
"sympy-issues" group.
To post to this group, send email to sympy-iss...@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