Real and imaginary parts of a symmetric unitary matrix (source code)

= Real and imaginary parts of a symmetric unitary matrix
{title2=$U=A+iB,\quad AB=BA,\quad A^2+B^2=I$}

Suppose a <unitary matrix> $U$ is symmetric under ordinary <transpose>, and write its entrywise real and imaginary parts as $A$ and $B$. They are real <symmetric matrices>. Expanding $U^\dagger U=I$ gives $A^2+B^2+i(AB-BA)=I$, proving the displayed identities. Commuting real <symmetric matrices> admit <simultaneous diagonalization>: diagonalize $A$, then diagonalize the restriction of $B$ to each invariant <eigenspace> of $A$. A common real orthonormal <eigenbasis> gives
$$
U=Q\operatorname{diag}(e^{i\theta_j})Q^T,\qquad A=Q\operatorname{diag}(\cos\theta_j)Q^T,\qquad B=Q\operatorname{diag}(\sin\theta_j)Q^T.
$$
If $A$ has <simple eigenvalues>, every <eigenvector> of $A$ is already an <eigenvector> of $B$, because its one-dimensional <eigenspace> is invariant. The <eigenvalues> of $A$ and $B$ are paired as the real and imaginary parts of the same <eigenvalue> of $U$.