Hello. I want to write a function for reducing an expression for an element x \in sl2 into a sum in the Poincare Birkhoff Witt basis , that is,
e,f,h=symbols('efh',commutative=False) e*f |---> f*e+h I tried to use subs naively and it wouldn't work: >>>e,f,h=symbols('efh',commutative=False) >>> (e*f).subs(e*f,f*e+h) h + f*e >>> (e*f*e*f).subs(e*f,f*e+h) e*f*e*f I tried to check the help(Symbol) and I couldn't find anything useful. I would like to know if there is a good way to do it. Thank you very much. K. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "sympy" group. To post to this group, send email to sympy@googlegroups.com To unsubscribe from this group, send email to sympy+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/sympy?hl=en -~----------~----~----~----~------~----~------~--~---