Note that internally, the expression actually is expressed this way:
In [54]: print S("x1^-1*x2^-1").args
(1/x1, 1/x2)
In [55]: srepr(S("x1^-1*x2^-1"))
Out[55]: Mul(Pow(Symbol('x1'), Integer(-1)), Pow(Symbol('x2'), Integer(-1)))
It's only the printer that represents it as 1/(x1*x2), which is done
for the sake of convenience. If you want it to print otherwise, you
can extend whichever printer you are using to do so.
http://docs.sympy.org/0.7.1/modules/printing.html can get you started.
Let us know if you need help.
Aaron Meurer
On Tue, Feb 14, 2012 at 8:28 AM, Akin <[email protected]> wrote:
> Hi,
>
> sympifying the expressions "x1^-1*x2^-1" gives "1/(x1*x2)" which is of
> course correct, but I was wondering whether one can tell sympify to
> write it as "x1**(-1)*x2**(-1). I am using the expression in a context
> where the latter form would be more appropriate.
>
> Best,
>
> Akin
>
> --
> 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.
>
--
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.