Hello Robert,
I wonder why you want to use the "abs()" function, when the "absolute
value" function has no meaning for complex numbers.
How you define the 'greater than' (>) operator in complex numbers ?
It is hazardous to mix symbolic computing (var, sqrt,..language) and field
operators....because off the scene, symbolic expressions have their own
operators.
Yes : if you take norm(z) where z is a complex field element you get a real
number...and then you can use abs() function (because ordered field).
Dominique
On Monday, 1 May 2017 20:43:32 UTC+2, Robert Jacobson wrote:
>
> 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 [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/sage-support.
For more options, visit https://groups.google.com/d/optout.