Something I do not understand...

from sympy import Symbol
t=Symbol("t",commutative=True)
A=Symbol("A",commutative=False)
B=Symbol("B",commutative=False)

So, now, I do:

ee=(t*t/2)*(A+B)*(A+B)
ee.expand()

gives:

t**2*A*B/2 + t**2*A**2/2 + t**2*B*A/2 + t**2*B**2/2

which is what I was waiting for...

Now, do:
ee=1+t*(A+B)+(t*t/2)*(A+B)*(A+B)
I get:

1/2*A^2*t^2 + A*B*t^2 + 1/2*B^2*t^2 + A*t + B*t + 1

Which is not what I was waiting for!

It looks like if A*B is considered as B*A in the second case!

My Sage version is : 5.9.

t.d.

--
You received this message because you are subscribed to the Google Groups 
"sage-support" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-support+unsubscr...@googlegroups.com.
To post to this group, send email to sage-support@googlegroups.com.
Visit this group at http://groups.google.com/group/sage-support.
For more options, visit https://groups.google.com/groups/opt_out.

<<attachment: tdumont.vcf>>

Reply via email to