Solution (source code)

= Solution

If $Au=\lambda u$ and $Av=\mu v$, the <Hermitian matrix> identity gives
$$
\lambda\langle u,v\rangle=\langle Au,v\rangle=\langle u,Av\rangle=\mu\langle u,v\rangle,
$$
because both <eigenvalues> are real. Thus <eigenvectors> belonging to \b[distinct eigenvalues are automatically orthogonal]. A <simple spectrum> guarantees this for an arbitrary choice of one <eigenvector> per <eigenvalue>.

Within a degenerate <eigenspace>, arbitrary independent <eigenvectors> need not be orthogonal. The <Gram-Schmidt process> always supplies an <orthonormal basis> of that <eigenspace>. Accordingly the existence of an <orthonormal eigenbasis> requires no additional condition, whereas automatic orthogonality of arbitrary independent <eigenvectors> is ensured by distinct <eigenvalues>. Scalar multiples of the same nonzero <eigenvector> are of course not mutually orthogonal.