With a little trickery, yes.

A normal evaluate=False does not help in this case, otherwise
Mul(x,x,evaluate=False) might work. Perhaps issue 1966 could fix this.
But in the meantime, realizing that variables with distinct
assumptions are distinct variables you can create two variables with
the same name that will look (to the user) like the same thing:

>>> from sympy import *
>>> x1=Symbol('x', i=1) # i=1 is a meaningless flag but it is accepted by sympy
>>> x2=Symbol('x', i=2) # ...and with i=2 x1 and x2 are distinct
>>> x1*x2
x*x
>>> _.subs(x2, x1)
x**2
>>> x1+x2
x + x
>>> _.subs(x2,x1)
2*x
>>>

Perhaps that will help?

Note that evaluate=False will work for expressions like Mul(x+1,x
+2,evaluate=False)....search these discussions for "evaluate" to see
similar discussions from the past.

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

Reply via email to