Yau Kwan Kiu wrote:
> 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.
>
> >
>
>
If you have a beta or git distribution of sympy you should compile the
documentation (python-sphinx and dvipng are required) and look at the
section on geometric algebra since geometric algebra is just a clifford
algebra over the reals (complex could be included by doubling the
dimension) and is intimately related to the special linear group. The
basic reduction formula for the geometric product is "a*b = 2(a.b)-b*a".
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---