What's the difference between $|z|^2$ and $z^2$, where $z$ is a complex number? I know that $|z|^2=zz^*$ but what is $z^2$? Is it simply $z^2=(a+ib)^2$?

If $z=a+ib$, then
\begin{align*}
z^2=&\,z\times z=(a+ib)\times(a+ib),\\
\left|z\right|^2=&\,z\times\overline z=(a+ib)\times(a-ib).
\end{align*}
Note that $\left|z\right|^2$ is always real and non-negative, whereas $z^2$ is, in general, complex.
