# Find the maximum of the set of square moduli of eigenvalues of a family of matrices

Let $A$ and $B$ be two $n\times n$ Hermitian matrices. Let $U$ denote a $n\times n$ unitary matrix. Consider the following family of matrices, parametrized by $U$, $$M_U= U A U^\dagger + iB\;.$$ For each $M_U$, consider the set of $$\mathcal S(M_U)=\{| \lambda_i|^2,\,\lambda_i\in\text{eigen}(M_U)\}\;,$$ where $\text{eigen}(M_U)$ is the set of eigenvalues of $M_U$. Therefore $\mathcal S(M_U)$ is the set of the square moduli of the eigenvalues of $M_U$.

Question: given $A$, $B$, find the maximum of $\mathcal S(M_U)$, over the set of all unitary matrices $U$, i.e. $$\underset{U}{\text{max}}\; \text{max}\; \mathcal S(M_U)$$

Suppose $H_1,H_2$ are two Hermitian matrices and $v$ is a unit vector. Then $|v^\ast H_kv|\le\rho(H_k)$ for each $k$. Hence the modulus of the complex number $v^\ast (H_1v+iH_2)v$ is at most $|\rho(H_1)+i\rho(H_2)|$.
It follows that $|v^\ast (UAU^\ast+iB)v|\le|\rho(UAU^\ast)+i\rho(B)|=|\rho(A)+i\rho(B)|$. In particular, if $v$ is a unit eigenvector corresponding to the dominant eigenvalue of $U^\ast AU+iB$, we get $\rho(UAU^\ast+iB)\le|\rho(A)+i\rho(B)|$. That is, $$\rho(UAU^\ast+iB)^2\le\rho(A)^2+\rho(B)^2.\tag{1}$$ Therefore, when equality holds, $U$ must be a global maximiser of the LHS.
Now the answer to your question is obvious. Let $A=Q_1D_1Q_1^\ast$ and $B=Q_2D_2Q_2^\ast$ be two unitary diagonalisations such that the first diagonal entries in $D_1$ and $D_2$ are the dominant eigenvalues of respectively $A$ and $B$. Take $U=Q_2Q_1^\ast$ and the global maximum value $\rho(A)^2+\rho(B)^2$ is attained.