Ask Your Question

Jun's profile - activity

2021-09-27 09:27:34 +0200 received badge  Popular Question (source)
2020-07-01 11:06:26 +0200 received badge  Student (source)
2020-07-01 02:07:31 +0200 received badge  Editor (source)
2020-06-30 22:23:59 +0200 asked a question Simplifying symbolic complex norm

Sage's simplifier seems to have trouble expanding the square-absolute value of complex numbers:

sage: x,y = var('x,y', domain=RR)
sage: (x^2 + y^2 - abs(x + i*y)^2).simplify_full ()
x^2 + y^2 - abs(x + I*y)^2

How can I ensure sage expands the square-absolute value and simplify this down to zero? I'm aware that using (x + i*y).norm() instead of abs(x + i*y)^2 helps in this particular example, but that solution doesn't generalize. For instance, when I stick expressions involving x, y into vectors and compute the vector norm, the vector norm is expressed in terms of absolute values, so I still need a way to deal with the abs.