Hi,
I asked this question on sage mailing list already and it seems appropriate
to ask here as well. I wish to simplify some calculation that appear in
quantum mechanics. To begin we use non-commutative variables as -
sage: x, y = sympy.symbols('xy', commutative=False)
sage: sympy.expand((x+y)**3)
x**2*y + y**2*x + x*y**2 + y*x**2 + x**3 + y**3 + x*y*x + y*x*y
I want to impose the commutation relation [x,y]=1 and bring the expression
to normal form (i.e. in all terms y appears before x, e.g. x*y gets replaced
by y*x + 1). Is it possible to do this?
If not then can I get the expression such that x*y**2 appears as x*y*y?
Thanks in advance.
Regards,
Rajeev
--
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.