# Mathematica is messing around with absolute values and sqrts of complex numbers?

I know that $$\begin{pmatrix}0&Z\\Z^*&0\end{pmatrix} \quad\text{has eigenvalues}\quad \lambda_\pm=\pm|Z|$$

but Mathematica gives me

Eigenvalues@{{0,z},{Conjugate[z],0}}
(* { -Sqrt[z]Sqrt[Conjugate[z]], Sqrt[z]Sqrt[Conjugate[z]] } *)


I think this is not right because we have $$\,\sqrt{ZZ^*}\neq\sqrt{Z}\sqrt{Z^*}$$.

e.g. For $$Z=-1$$ we have $$\sqrt{1}\neq (\sqrt{-1})^2\,$$.

So, given this, I wonder if there is a way to solve this and output the result as $$\pm|Z|$$, even for the cases where instead of Z we had a product, or a sum of products.

• I get that z0 = -1.; Sort@Eigenvalues[{{0, z}, {Conjugate[z], 0}} /. z -> z0] == Sort@(Eigenvalues@{{0, z}, {Conjugate[z], 0}} /. z -> z0) returns True. Is it the case that $\pm\,\sqrt{ZZ^*}=\pm\sqrt{Z}\sqrt{Z^*}$ in some order? Commented May 3, 2022 at 20:26
• @MichaelE2: I think you're onto something. With mat defined as the matrix above, Eigenvalues@(mat /. z -> -1) gives {-1,1} while (Eigenvalues@mat) /. z -> -1 gives {1, -1}. Commented May 3, 2022 at 20:32
• @MichaelSeifert I think the two expressions differ by a factor of E^((1/2)*I*(Arg[z] + Arg[Conjugate[z]])) and Arg[z] + Arg[Conjugate[z]] is either 0 or 2 Pi. Thus the factor is $\pm1$. Commented May 3, 2022 at 21:24
• m = {{0, x + I y}, {x - I y, 0}}; Eigenvalues[m] Commented May 5, 2022 at 6:31

Eigenvalues[