SWAP from CNOTs
Warm-upCodingSWAPCNOTcircuit identities
Related module: Gates and circuits
Problem statement
The SWAP gate exchanges two qubits: .
- Show that SWAP = CNOT(1,2) · CNOT(2,1) · CNOT(1,2) where CNOT(i,j) has i as control, j as target.
- Implement this in Qiskit-style pseudocode.
Learn the foundations
The Quantum Computing track covers this topic and more in depth.