I'm working on a quantum information processing question but my question is purely maths based, it regards the spectral decomposition of the following matrix :
Note: I believe (though I may be wrong so correct me if I am) that spectral decomposition is a way to find a diagonalized version of a matrix
Say we have $H=\begin{pmatrix} \tfrac{1}{\sqrt{2}} &\tfrac{1}{\sqrt{2}} \\ \tfrac{1}{\sqrt{2}} & -\tfrac{1}{\sqrt{2}} \end{pmatrix}$.
Now spectral decomposition of this matrix will be $H=\sum_i \lambda_i|\psi_i\rangle \langle\psi_i|$, where $\lambda_i$ corresponds to an eigenvalue and $|\psi_i \rangle$ is its associated eigenvector.
First we find the eigenvalues :
$Det(H-\lambda I)=Det \begin{pmatrix} \tfrac{1}{\sqrt{2}}-\lambda &\tfrac{1}{\sqrt{2}} \\ \tfrac{1}{\sqrt{2}} & -\tfrac{1}{\sqrt{2}}-\lambda \end{pmatrix}=(\tfrac{1}{\sqrt{2}}-\lambda)(-\tfrac{1}{\sqrt{2}}-\lambda)-\tfrac{1}{2}=-\tfrac{1}{2}+\lambda^2-\tfrac{1}{2}=-1+\lambda^2\Rightarrow \lambda=^+_-1$
Now we find the eigenvectors:
$\lambda=1$:
$\begin{pmatrix} x\\y \end{pmatrix}=\begin{pmatrix} \tfrac{1}{\sqrt{2}} &\tfrac{1}{\sqrt{2}} \\ \tfrac{1}{\sqrt{2}} & -\tfrac{1}{\sqrt{2}} \end{pmatrix}\begin{pmatrix} x\\y \end{pmatrix}$
$\Rightarrow \tfrac{x+y}{\sqrt{2}}=x \Rightarrow (\sqrt{2}-1)x=y $
$ \tfrac{x-y}{\sqrt{2}}=y \Rightarrow (\sqrt{2}+1)y=x $
These equations give eigenvectors $v_1=\begin{pmatrix} 1 \\(\sqrt{2}-1) \end{pmatrix}, v_2=\begin{pmatrix} (\sqrt{2}+1)\\1 \end{pmatrix} $
The eigenvectors for $\lambda=-1$ are found, similarly, to be $v_3=\begin{pmatrix} 1 \\(-\sqrt{2}-1) \end{pmatrix}, v_4=\begin{pmatrix} (-\sqrt{2}+1)\\1 \end{pmatrix}$
But $H=-\begin{pmatrix} 1 \\(-\sqrt{2}-1) \end{pmatrix}\begin{pmatrix} 1 &(-\sqrt{2}-1) \end{pmatrix}- \begin{pmatrix} (-\sqrt{2}+1)\\1 \end{pmatrix}\begin{pmatrix} (-\sqrt{2}+1)&1 \end{pmatrix}+\begin{pmatrix} 1 \\(\sqrt{2}-1) \end{pmatrix}\begin{pmatrix} 1 &(\sqrt{2}-1) \end{pmatrix}+\begin{pmatrix} (\sqrt{2}+1)\\1 \end{pmatrix}\begin{pmatrix} (\sqrt{2}+1)&1 \end{pmatrix}$
Doesn't give me a diagonal matrix , where have I gone wrong ?