Solution (source code)

= Solution

For $Av=\lambda v$, $v^*Av=\lambda v^*v$ is real, so $\lambda$ is real. The spectral theorem writes positive definite $C=U\operatorname{diag}(\lambda_i)U^*$; taking positive square roots gives $B$. For $H$, <eigenvalues> are $1,3$ with normalized <eigenvectors> $( -i,1)/\sqrt2$ and $(i,1)/\sqrt2$, so these columns form a suitable $U$. Finally expand $v$ in an orthonormal eigenbasis: the Rayleigh quotient is a weighted average of <eigenvalues>, bounded above by $\lambda_{max}$ and attaining it on a top <eigenvector>.