Perhaps we should implement a keyword argument to subs that would let you do simultaneous substitution (it would basically do the Dummy substitution for you).
If you are interested in implementing this, that would be great. We can help you with the details of submitting a patch, etc. Aaron Meurer On Thu, Jul 21, 2011 at 11:56 AM, Mike Hansen <[email protected]> wrote: > On Jul 20, 1:23 pm, Ondrej Certik <[email protected]> wrote: >> On Wed, Jul 20, 2011 at 11:59 AM, Aaron Meurer <[email protected]> wrote: >> > First off, if you want an explicit order of substitution, you should >> > not use a dictionary. Subs also allows the [(old, new), ...] syntax, >> > which lets you define a specific order. >> >> > But even in this case, it will perform the substitution iteratively. >> > This is actually a useful feature. For example, you can take the >> > output of cse() and back-substituted it all in one step, even though >> > the various substitutions depend on each other. > > For what it's worth, in Sage, the substitution is done simultaneously: > > sage: var('x,y,a,b') > (x, y, a, b) > sage: (x**2+y**3).subs({x: a*x+b*y, y: b*x-a*y}) > -(a*y - b*x)^3 + (a*x + b*y)^2 > > --Mike > > -- > You received this message because you are subscribed to the Google Groups > "sympy" 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?hl=en. > > -- You received this message because you are subscribed to the Google Groups "sympy" 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?hl=en.
