Ok I think I've got it. The first part of my question is correct; the second one no. The big mistake is that I've tried to use eq 2.12 with the elements of vectors and not with the vectors themselves.
As I've done before, taking any basis, say $|v_{0}\rangle$ and $|v_{1}\rangle$, I'm looking for the matrix representation of the lineal operator $A$ such that $A |v_{0}\rangle = |v_{1}\rangle$ and $A |v_{1}\rangle = |v_{0}\rangle$. Applying eq. 2.12 we obtain:
$A |v_{0}\rangle = A_{00} |v_{0}\rangle + A_{10} |v_{1}\rangle = |v_{1}\rangle \Rightarrow A_{00} = 0; A_{10} = 1$
$A |v_{1}\rangle = A_{01} |v_{0}\rangle + A_{11} |v_{1}\rangle = |v_{0}\rangle \Rightarrow A_{01} = 0; A_{11} = 1$
$$A = \begin{pmatrix} 0 & 1 \\ 1 & 0 \end{pmatrix} $$
And now my mistake:
I said this works for computational basis $\begin{pmatrix} 0 \\ 1 \end{pmatrix}$ and $\begin{pmatrix} 1 \\ 0 \end{pmatrix}$ but not for $\frac{1}{\sqrt{2}} \begin{pmatrix} 1 \\ 1 \end{pmatrix}$ and $\frac{1}{\sqrt{2}} \begin{pmatrix} 1 \\ -1 \end{pmatrix}$ basis.
And I said that because I did these wrong calculations:
- With computational basis:
$ A |v_{0}\rangle = \begin{pmatrix} 0 & 1 \\ 1 & 0 \end{pmatrix} \begin{pmatrix} 0 \\ 1 \end{pmatrix} = \begin{pmatrix} 0 \times 0 + 1 \times 1 \\ 1 \times 0 + 0 \times 1 \end{pmatrix} = \begin{pmatrix} 1 \\ 0 \end{pmatrix} = |v_{1}\rangle $
$ A |v_{0}\rangle = \begin{pmatrix} 0 & 1 \\ 1 & 0 \end{pmatrix} \frac{1}{\sqrt{2}} \begin{pmatrix} 1 \\ 1 \end{pmatrix} = \frac{1}{\sqrt{2}} \begin{pmatrix} 0 \times 1 + 1 \times 1 \\ 1 \times 1 + 0 \times 1 \end{pmatrix} = \frac{1}{\sqrt{2}} \begin{pmatrix} 1 \\ 1 \end{pmatrix} \ne |v_{1}\rangle $
I used elements of the vectors and not vectors, so all these calculations are wrong.
Let's see how is the correct way:
- With computational basis:
$A |v_{0}\rangle = 0 \times |v_{0}\rangle + 1 \times |v_{1}\rangle = 0 \times \begin{pmatrix} 0 \\ 1 \end{pmatrix} + 1 \times \begin{pmatrix} 1 \\ 0 \end{pmatrix} = \begin{pmatrix} 1 \\ 0 \end{pmatrix} = |v_{1}\rangle $
$A |v_{1}\rangle = 1 \times |v_{0}\rangle + 0 \times |v_{1}\rangle = 1 \times \begin{pmatrix} 0 \\ 1 \end{pmatrix} + 0 \times \begin{pmatrix} 1 \\ 0 \end{pmatrix} = \begin{pmatrix} 0 \\ 1 \end{pmatrix} = |v_{0}\rangle $
$A |v_{0}\rangle = 0 \times |v_{0}\rangle + 1 \times |v_{1}\rangle = 0 \times \frac{1}{\sqrt{2}} \begin{pmatrix} 1 \\ 1 \end{pmatrix} + 1 \times \frac{1}{\sqrt{2}} \begin{pmatrix} 1 \\ -1 \end{pmatrix} = \frac{1}{\sqrt{2}} \begin{pmatrix} 1 \\ -1 \end{pmatrix} = |v_{1}\rangle $
$A |v_{1}\rangle = 1 \times |v_{0}\rangle + 0 \times |v_{1}\rangle = 1 \times \frac{1}{\sqrt{2}} \begin{pmatrix} 1 \\ 1 \end{pmatrix} + 0 \times \frac{1}{\sqrt{2}} \begin{pmatrix} 1 \\ -1 \end{pmatrix} = \frac{1}{\sqrt{2}} \begin{pmatrix} 1 \\ 1 \end{pmatrix} = |v_{0}\rangle $
I hope all become clear now. I couldn't explain my problem correctly before. I'm really sorry.
I have to thanks a lot to teclado from another forum web page.