Thank you. Is there a way to create a non-commutative expression
*directly* from a string? To be specific, if I write something like
ex1 = sympify('x1*x2*x1**-1')
I get 'x2' because sympy automatically assumes that the symbols are
commutative.
Akin
On Feb 15, 4:37 am, Chris Smith <[email protected]> wrote:
> When symbols are non-commutative they will always appear with negative
> exponent:
>
> >>> var('A B', commutative=False)
> >>> 1/A/B
>
> A**(-1)*B**(-1)
>
> Beyond this, I'm not sure of an option other than symbol-trickery (or
> writing your won printer):
>
> >>> a=symbols('(-1)')
> >>> y**a
>
> y**(-1)
>
> .c
--
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.