I am wanting to hand off a holomorphic function to an external library, but the library only works with real numbers (operations with C++ doubles). Thus I wish to have Sage compute functions u and v for which f(x+i y) = u(x,y) + i v(x,y) such that u and v are expressed only in terms of operations on real numbers, i.e., without the imaginary unit i. I am impressed by how far I can get by simply calling f(x+i y).real_part(), but abs(x+I*y) is not rewritten as sqrt(x+I*y). A simple example session to illustrate:
sage: y, z = var('y, z') sage: assume(x, 'real') sage: assume(y, 'real') sage: abs(x+I*y) abs(x + I*y) sage: abs(x+I*y).real_part() abs(x + I*y) sage: norm(x+I*y) x^2 + y^2 sage: log(x+I*y).real_part() log(abs(x + I*y)) sage: sin(x+I*y).real_part() cosh(y)*sin(x) Is there a simple way to do what I am trying to do? Perhaps by asking Sage to replace abs(z) with sqrt(norm(z))? Best, Robert -- You received this message because you are subscribed to the Google Groups "sage-support" group. To unsubscribe from this group and stop receiving emails from it, send an email to sage-support+unsubscr...@googlegroups.com. To post to this group, send email to sage-support@googlegroups.com. Visit this group at https://groups.google.com/group/sage-support. For more options, visit https://groups.google.com/d/optout.