A gate for a Quantum Computer

ϕψ    ψϕ\ket{\phi} \otimes \ket{\psi} \;\longmapsto\; \ket{\psi} \otimes \ket{\phi}

i.e.,

SWAP=CNOT12CNOT21CNOT12SWAP = CNOT_{1\rightarrow 2}CNOT_{2\rightarrow 1}CNOT_{1\rightarrow 2} SWAP=(1000001001000001)SWAP=\begin{pmatrix} 1&0&0&0 \\ 0&0&1&0 \\ 0&1&0&0 \\ 0&0&0&1 \end{pmatrix}