By my calculations, it looks like the SWAP gate is a Clifford Gate. See the following table:enter image description here

I follow the same method as in this paper for showing a gate is a Clifford Gate. I got the above table by performing calculations in Qiskit. How would I express the SWAP gate in terms of the generators of the Clifford group? The generators are the $H$ gate, the $S$ gate and the $CNOT$ gate.


It's well known that you can make a swap out of three CNOTs.

enter image description here

For reference, Stim's gate documentation includes H+S+CX decompositions of a lot of Clifford gates including the swap:

Stabilizer Generators:

X_ -> +_X
Z_ -> +_Z
_X -> +X_
_Z -> +Z_

Unitary Matrix:

[+1  ,     ,     ,     ]
[    ,     , +1  ,     ]
[    , +1  ,     ,     ]
[    ,     ,     , +1  ]

Decomposition (into H, S, CX, M, R):

# The following circuit is equivalent (up to global phase) to `SWAP 0 1`
CNOT 0 1
CNOT 1 0
CNOT 0 1
  • $\begingroup$ thank you for the answer :) I saw before the the $C_{2}NOT_{1}$ and $C_{1}NOT_{2}$ gates can be used to make a $SWAP$ gate. My question then is: how is the $C_{2}NOT_{1}$ generated using the generators of the Clifford group? $\endgroup$ Nov 11 at 18:24
  • 1
    $\begingroup$ $C_2NOT_1=(H\otimes H)\circ C_1NOT_2\circ(H\otimes H)$ $\endgroup$ Nov 11 at 18:26
  • 1
    $\begingroup$ @QuantumGuy123 That gate is considered to be in the gate set. But if you really want to go out of your way you can just surround a CNOT with Hs instead of switching the target and control roles. $\endgroup$ Nov 11 at 18:26
  • $\begingroup$ hey @CraigGidney, do you (or perhaps someone you know) know the answer to my other question on Cliffords?: quantumcomputing.stackexchange.com/questions/21993/… $\endgroup$ Nov 19 at 22:14

Yes, SWAP is a Clifford gate.

Your proof is correct. By definition, an $n$-qubit gate $U$ is Clifford if $UPU^\dagger\in G_n$ for all $P\in G_n$ where $G_n$ is the $n$-qubit Pauli group. However, it is easy to see that we only need to check that $UQU^\dagger\in G_n$ for $Q$ that are generators of $G_n$. Moreover, $G_n$ is generated by $\{i, Z_k, X_k\,|\,k=1,\dots,n\}$ where $X_k$ denotes the tensor product of Pauli $X$ on the $k$th qubit and identity applied to all other qubits and similarly for $Z_k$. Since $UiU^\dagger=iI\in G_n$ for all $U$, we only have to check that $UX_kU^\dagger\in G_n$ and $UZ_kU^\dagger\in G_n$ for $k=1,\dots,n$. This is exactly what the table in the question accomplishes.

It is easy to check that

$$ \text{SWAP} = C_1NOT_2 \circ C_2NOT_1 \circ C_1NOT_2\tag1 $$

where $C_iNOT_j$ denotes the CNOT gate with qubit $i$ as control and $j$ as the target, e.g. by applying both sides of $(1)$ to the computational basis states.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.