So basically I have a lot of objects like H:

a= sympy.Symbol('a', commutative=False)
beta= sympy.Symbol('beta',commutative=True)
gamma= sympy.Symbol('\gamma',commutative=True)
ad = sympy.Symbol('a^{\dagger}', commutative=False)
H=gamma*ad*a+beta*ad*a


and all I wanna do is rewrite it as H=(gamma+beta)ad*a but using collect 
throws the error

AttributeError: Can not collect noncommutative symbol

is there any way to do this ? 

-- 
You received this message because you are subscribed to the Google Groups 
"sympy" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/sympy/35871245-e4ee-444d-8700-6a78d70d1cb8n%40googlegroups.com.

Reply via email to