Skip to main content
Glossary

SWAP gate

A two-qubit gate that exchanges the states of two qubits; it costs three CNOTs.

Compilers insert SWAPs to bring distant qubits together on hardware with limited connectivity, so a sloppy qubit layout can triple a circuit’s two-qubit gate count.

See it for yourself

  • Coupling map — The graph of which physical qubits on a device can interact directly with a two-qubit gate.
  • Transpilation — Rewriting a circuit into the native gates and connectivity of a specific device, while optimising it.
  • CNOT gate — A two-qubit gate that flips the target qubit if and only if the control qubit is |1⟩.