Back to Symbolic Math (SymEngine)
sym.as_real_imag
Extracts the real and imaginary parts of a complex expression.
Syntax
sym.as_real_imag(expr)
Description
Extracts the real and imaginary parts of a complex expression. Separates a complex expression into its real and imaginary components, returning both as separate expressions.
Parameters
| Name | Description |
|---|---|
| expr | - The complex expression to decompose. |
Returns
{ real: Expr; imag: Expr; }