|ψ⟩
Itachi Quantum Studio
|ψ⟩ = α|0⟩ + β|1⟩  •  iℏ ∂|ψ⟩/∂t = Ĥ|ψ⟩
dim(ℋ) = 2ᴺ COMPLEX AMPLITUDES | C++20 SIMD KERNEL | COHERENCE 100%
INITIALIZING HILBERT SPACE & C++20 ENGINE...

SWAP Gate | Quantum State Exchange & Routing

Quick Technical Answer: The SWAP gate exchanges the quantum states of two qubits: SWAP|a, b⟩ = |b, a⟩. It decomposes into three alternating CNOT gates: CX(a, b) · CX(b, a) · CX(a, b) and is vital for routing circuits on non-all-to-all chip topologies.
Formula / Unitary: SWAP = \begin{pmatrix} 1 & 0 & 0 & 0 \\ 0 & 0 & 1 & 0 \\ 0 & 1 & 0 & 0 \\ 0 & 0 & 0 & 1 \end{pmatrix} = CX_{0,1} \cdot CX_{1,0} \cdot CX_{0,1}
Simulate this in Itachi Quantum Studio
Inspect state amplitudes, 3D Bloch sphere vector, and OpenQASM code live.
Open Circuit Builder →

Frequently Asked Questions

Why does SWAP add significant overhead in quantum circuits?

Because SWAP decomposes into three 2-qubit CNOT gates, excessive SWAP insertion on constrained hardware topologies drastically increases circuit depth and decoherence noise.

Related Topics & Quantum Guides:

CNOT Gate (CX)Quantum Chip Topologies