There is a matrix that can represent a swap gate-- a gate that essentially swaps two qubits. This matrix, $S$, is:
$$ \begin{bmatrix} 1 & 0 & 0 & 0 \\ 0 & 0 & 1 & 0 \\ 0 & 1 & 0 & 0 \\ 0 & 0 & 0 & 1 \end{bmatrix} $$
This will swap two single qubits. How would you go about swapping two qubit registers; i.e. two $2^N$ dimensional vectors. I tried doing a tensor product on two swap gates:
$$\begin{bmatrix} 1 & 0 & 0 & 0 \\ 0 & 0 & 1 & 0 \\ 0 & 1 & 0 & 0 \\ 0 & 0 & 0 & 1 \end{bmatrix} \otimes \begin{bmatrix} 1 & 0 & 0 & 0 \\ 0 & 0 & 1 & 0 \\ 0 & 1 & 0 & 0 \\ 0 & 0 & 0 & 1 \end{bmatrix}$$
Which I thought would work. To stress test this, I tested two length $4$ vectors:
$$\left ( \begin{bmatrix} 1 & 0 & 0 & 0 \\ 0 & 0 & 1 & 0 \\ 0 & 1 & 0 & 0 \\ 0 & 0 & 0 & 1 \end{bmatrix} \otimes \begin{bmatrix} 1 & 0 & 0 & 0 \\ 0 & 0 & 1 & 0 \\ 0 & 1 & 0 & 0 \\ 0 & 0 & 0 & 1 \end{bmatrix} \right ) \left ( \begin{bmatrix} 1 \\ 0 \\ 0 \\0 \end{bmatrix} \otimes \begin{bmatrix} 0 \\ 0 \\ 1 \\ 0 \end{bmatrix} \right )$$
I expected to see this:
$$ \begin{bmatrix} 9 \: zeros \\ \vdots \\ 1 \\ \vdots \\ 6 \: zeros \end{bmatrix} $$
But instead got this from calculation:
$$ \begin{bmatrix} 0 \\ 1 \\ \vdots \\ 14 \: zeros \end{bmatrix} $$
Anyone know how to implement this type of SWAP, or if I went wrong somewhere?