I have a question. It's very simple to understand, yet it doesn't make sense to me.
Say we have a system with a 2D orthonormal basis $|1⟩$, $|2⟩$. For this system, the energy operator (Hamiltonian) is:
$$ \hat{H} = E\left[|1⟩⟨1| − |2⟩⟨2| + |1⟩⟨2| + |2⟩⟨1|\right] $$
I want to find the matrix of $\hat{H}$, the eigenvalues of $\hat{H}$ and the normalised eigenvectors of $\hat{H}$.
I know that to find the elements of an operator in a matrix, firstly for a space with $m$ eigenvectors, the matrix is $m\times m$. So in this example, the matrix must be $2\times2$.
The way to find the ith and jth element of the matrix is by using this:
$$ \hat{H}_{i,j} = ⟨\psi_i|\hat{H}|\psi_j⟩ $$
My problem is that for my $\hat{H}$ in the question, doesn't it just go to 0? Because $|1⟩⟨2| = |2⟩⟨1| = 0$ due to orthonormality, and $|1⟩⟨1|=|2⟩⟨2|=1$, hence $\hat{H}$?
Or have I missed something completely here? Also what is $E$? Once I get the matrix, what steps shall I take to find the eigenvalues of $\hat{H}$? To find the eigenfunction, I presume I just apply $\hat{H}$ it to each vector.
I'm really struggling with this, any suggestions would be welcomed.