I want to write matrix representation of qubit swap algorithm, but I seem to be stuck.
Here is the circuit I am trying to calculate using linear algebra:
Initially $q_0 = |0\rangle$ or $\begin{pmatrix}1 & 0\end{pmatrix}^T$ while $q_1 = |1\rangle$ or $\begin{pmatrix}0 & 1\end{pmatrix}^T$ and at the end of measurement I should be getting opposite outcomes. I know that to apply first $CNOT$ gate I should first do Kronecker product on the two vectors and than multiply it by $CNOT$ matrix, but I cant figure out what needs to be done next, particularly how to apply second $CNOT$ to my quantum state (control bit $q_1$, target bit $q_0$).
Any help would be appreciated.