separating real and imaginary part of a symbolic expression

84 views
Skip to first unread message

Max Winkler

unread,
Jan 28, 2018, 10:33:49 AM1/28/18
to symengine
Hey there,

I am considering to move from sympy to symengine, because of the way better performance. Currently I'm working on a project, where I need to calculate the imaginary and real part of a complex expression including symbolic values. In sympy this calculation are to slow for the aim of the program. Is there any possibility to extract the the real and imaginary part of a expression, if I know that the symbolic value is itself real?

Thanks,
Max

Isuru Fernando

unread,
Jan 28, 2018, 8:57:34 PM1/28/18
to symengine
Hi,

SymEngine doesn't have assumptions yet, but maybe you can replace "x" with "Abs(x)" so that assumptions are unneeded. (Abs is currently unimplemented, but should be easy to fix. https://github.com/symengine/symengine/issues/1381)

Also "as_real_imag" is not wrapped in python, so can't use it from python yet. (I've opened an issue at https://github.com/symengine/symengine.py/issues/210)


Isuru

--
You received this message because you are subscribed to the Google Groups "symengine" group.
To unsubscribe from this group and stop receiving emails from it, send an email to symengine+unsubscribe@googlegroups.com.
To post to this group, send email to syme...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/symengine/13760726-3e65-4fd4-8a07-4d594ec82324%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply all
Reply to author
Forward
0 new messages