Just trying to figure out why this is true:
$$A=UDU^H \quad\Leftrightarrow\quad A= \lambda_1u_1u_1^H + \lambda_2u_2u_2^H$$
$U$ is a unitary matrix composed of the eigenvectors of hermitian matrix A.
$$Au_1=\lambda_1u_1$$ $$Au_2=\lambda_2u_2$$
So
$$Au_1u_1^H+Au_2u_2^H = \lambda_1u_1u_1^H + \lambda_2u_2u_2^H$$
So why is
$$Au_1u_1^H+Au_2u_2^H = A$$
????
EDIT:
Let $u_i=(a_i,b_i)^T$ $$u_i^Hu_i=\overline{a_i}a_i+\overline{b_i}b_i=1$$ $$u_iu_i^H+u_ju_j^H=\pmatrix{a_i\overline{a_i}&a_i\overline{b_i}\\b_i\overline{a_i}&b_i\overline{b_i}}+\pmatrix{a_j\overline{a_j}&a_j\overline{b_j}\\b_j\overline{a_j}&b_j\overline{b_j}}$$
So now how to arrive from the above statement to identity?
The easiest way to see this is with block-matrix multiplication.
Let $u_1,u_2$ denote the columns of $U$. We have $$ UDU^H = \\ \pmatrix{u_1 & u_2} \pmatrix{\lambda_1\\&\lambda_2} \pmatrix{u_1^H\\u_2^H} = \\ \pmatrix{u_1 & u_2} \pmatrix{\lambda_1u_1^H\\ \lambda_2u_2^H} = \\ u_1(\lambda_1 u_1^H) + u_2(\lambda_2 u_2^H) = \\ \lambda_1 u_1 u_1^H + \lambda_2 u_2 u_2^H $$