quantum-gate-decomposition
Gate decomposition
Table of Contents
Gate decomposition
Gate decomposition breaks complex gates into simpler, more fundamental gates. Useful for implementing gates not native on specific hardware or for circuit optimization.
Single-Qubit decomposition
Any single-qubit unitary can be decomposed as:
This is the Z-X-Z decomposition. Alternative decompositions use different rotation axes.
(X-Z-X decomposition)
Two-Qubit decomposition
CNOT can decompose arbitrary two-qubit unitaries:
requires up to 3 CNOTs and 12 single-qubit gates. This is the KAK decomposition.
Common decompositions
Toffoli in terms of Hadamards, CNOTs, T gates (~6 CNOTs):
┌───┐
q_0: ┤ H ├──■───
└───┘┌─┴─┐
q_1: ─────┤ X ├
└───┘
(Simplified; full Toffoli decomposition is longer)
SWAP in terms of CNOTs (3 CNOTs):
q_0: ──■────────■──
┌─┴─┐┌────┐└─┬─┘
q_1: ┤ X ├┤ CX ├──■──
└───┘└────┘
Trade-offs
- Fewer native gates: decomposition uses fewer gate types but may require more total gates
- Shorter depth: reorder decomposed gates to minimize circuit depth
- Hardware constraints: decompose to match hardware's native gate set
Quantum compiler tools (Qiskit, Cirq, Q#) handle decomposition automatically.
quantum-gate-decomposition.md · Last modified:
