On Monday, 1 May 2017 15:31:12 UTC-4, Dominique Laurain wrote: > > I wonder why you want to use the "abs()" function, when the "absolute > value" function has no meaning for complex numbers. >
The modulus of a complex number z is often called the absolute value of z and is typeset as |z|. The definition of this operation is |z|=sqrt(x^2+y^2) which you will recognize as the Euclidean distance on the complex plane between the origin and z, or the L^2 norm of z viewed as a vector in R^2. This terminology and notation are standard in the subject. Observe that insofar as this definition goes, no reference is made to the field properties of the complex numbers as such (although see below). In computer algebra systems, the modulus of a complex number z is denoted almost universally using the same notation as the absolute value of a real number. > 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). > In the case of abs(z), z complex, there is a convenient connection between abs(z) and norm(z), but you have it backwards: it's the norm(z) function, defined as the field norm of z, that is defined in terms of the field properties of the complex numbers in Sage. The field norm of a complex number is just it's product with it's conjugate! So abs(z) = sqrt(norm(z)). In my particular problem, I'm not choosing abs(z). Rather, Sage sometimes produces abs(z) when I ask for the real part of an expression. Consider: sage: y = var('y') sage: assume(x, 'real') sage: assume(y, 'real') sage: log(x+I*y).real_part() log(abs(x + I*y)) 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.