<s>[INST] Hamiltonian matrix written in a certain basis If I have a matrix H=$\left( \begin{array}{cc}
0 & b  \\
d & 0  \\ \end{array} \right)$ writen in the basis |1>=$\left( \begin{array}{c}
\frac{1}{\sqrt{2}}    \\
-\frac{1}{\sqrt{2}}   \\ \end{array} \right)$ and |2>=$\left( \begin{array}{c}
\frac{1}{\sqrt{2}}    \\
\frac{1}{\sqrt{2}}   \\ \end{array} \right)$ shouldn't the following be true: <1|H|1>=0 and <2|H|2>=0? Since they are the matrix elements. But if i calculate them directly by matrices multiplication i get the other element b and d. Where am i wrong? Thank you in advance.
 [/INST] It appears you don't understand the concept of coordinates being based on the basis you choose. And also the H you gave is ambiguous. Is it in the "f" basis, or the "e" basis? (see below)
$|1>_{f}$ = $ \begin{pmatrix} \frac{1}{\sqrt{2}}\\  \frac{-1}{\sqrt{2}} \end{pmatrix}_{e} $ and not $|1>_{f}$ = $ \begin{pmatrix} 1 \\  0 \end{pmatrix}_{e} $
So, assuming that your H is in the "e" basis:
<1|H|1> = $ \begin{pmatrix} \frac{1}{\sqrt{2}}  \frac{-1}{\sqrt{2}} \end{pmatrix}_{e} $ $  \begin{pmatrix} 0 & b\\ d & 0 \end{pmatrix}_{e} $$ \begin{pmatrix} \frac{1}{\sqrt{2}}\\  \frac{-1}{\sqrt{2}} \end{pmatrix}_{e} =  $ ... do at least this part yourself
Similarly, 
<2|H|2> = $ \begin{pmatrix} \frac{1}{\sqrt{2}}  \frac{1}{\sqrt{2}} \end{pmatrix}_{e} $ $  \begin{pmatrix} 0 & b\\ d & 0 \end{pmatrix}_{e} $$ \begin{pmatrix} \frac{1}{\sqrt{2}}\\  \frac{1}{\sqrt{2}} \end{pmatrix}_{e} $ = ... do at least this part yourself

Note:
<1|H|2> = $ \begin{pmatrix} \frac{1}{\sqrt{2}}  \frac{-1}{\sqrt{2}} \end{pmatrix}_{e} $ $  \begin{pmatrix} 0 & b\\ d & 0 \end{pmatrix}_{e} $$ \begin{pmatrix} \frac{1}{\sqrt{2}}\\  \frac{1}{\sqrt{2}} \end{pmatrix}_{e} $
and you can figure out <2|H|1> similarly.

Otherwise, if you gave H in the "f" basis, then yes, <1|H|1> = 0.
</s>