A controlled gate is a multi-qubit quantum logic gate that applies a unitary operation U to one or more target qubits only when its control qubits are in a specified state, usually |1>, and leaves the targets unchanged otherwise. In quantum computing, controlled gates are the main tool for making qubits interact, and they appear throughout quantum gates & circuits as the building blocks of entanglement, arithmetic and oracles.
Because the control can itself be in superposition, a controlled gate does not simply branch like a classical if statement. It correlates the target with the control, which is exactly how entangled states such as Bell states are produced from separable inputs.
How a controlled gate acts on control and target qubits
A controlled gate with one control and a single-qubit operation U is written C-U or controlled-U. Its matrix is block diagonal: an identity block acting when the control is |0> and the U block acting when the control is |1>. In compact form, C-U equals |0><0| tensor I plus |1><1| tensor U, written here in words to keep the notation readable.
Linearity makes the behavior on superpositions follow automatically. If the control is in a|0> + b|1>, the output is a|0>|t> + b|1>U|t>, which is generally entangled unless U leaves the target unchanged up to a phase. This is why controlled gates are called entangling gates.
The table below lists frequently used controlled gates and their targets.
| Gate | Controls | Operation on target | Typical role |
|---|---|---|---|
| CNOT gate | 1 | Pauli X (bit flip) | Entanglement, parity, copying basis states |
| Controlled-Z gate | 1 | Pauli Z (phase flip) | Native entangler on many devices |
| Controlled phase | 1 | Phase rotation by angle phi | Quantum Fourier transform |
| Controlled rotation | 1 | Rx, Ry or Rz by angle theta | Variational and amplitude encoding circuits |
| Toffoli gate | 2 | Pauli X | Reversible AND, arithmetic |
| Fredkin gate | 1 | SWAP of two targets | Controlled swap tests |
Control conditions, symmetry and phase kickback
Controls need not trigger on |1>. A negative control, drawn as an open circle, triggers on |0> and is implemented by surrounding a normal control with X gates. Multi-controlled gates can mix positive and negative controls to match any classical bit pattern.
The distinction between control and target is basis dependent. The controlled-Z gate is fully symmetric, so either qubit can be called the control. A CNOT viewed in the Hadamard basis reverses roles: conjugating both qubits with Hadamard gates swaps control and target.
Phase kickback is the most important consequence of this symmetry. When the target is an eigenstate of U with eigenvalue e^(i phi), the phase moves onto the control qubit instead of changing the target. Quantum phase estimation, Shor’s algorithm and the Deutsch–Jozsa algorithm all rely on this effect.
| Variant | Triggers when | Implementation note |
|---|---|---|
| Positive control | Control is |1> | Standard filled dot |
| Negative control | Control is |0> | X gates before and after |
| Multi-control | All controls match pattern | Needs decomposition or ancillas |
| Classical control | Measured bit equals 1 | Uses mid-circuit measurement result |
Decomposing controlled gates into native operations
Hardware rarely implements arbitrary controlled gates directly, so compilers decompose them into a native gate set. Any controlled-U on one target can be built from at most two CNOT gates and single-qubit rotations, using the decomposition of U into rotations and a global phase that becomes a controlled phase.
Multi-controlled gates are more expensive. A Toffoli gate needs six CNOT gates in its standard decomposition with T and Hadamard gates, and an n-controlled gate grows to a linear number of Toffolis when ancilla qubits are available, or to a quadratic count without them. On error-corrected hardware, the T-gate count often dominates cost.
The following table gives typical decomposition costs; exact numbers depend on connectivity and the native gate set.
| Gate | CNOT count | Ancillas | Notes |
|---|---|---|---|
| Controlled-Z | 1 | None | CNOT conjugated by Hadamard gates |
| Controlled-U, single target | Up to 2 | None | Plus single-qubit rotations |
| Toffoli | 6 | None | Seven T or T-dagger gates |
| n-controlled X | Linear in n | About n minus 2 | Toffoli ladder with uncomputation |
| n-controlled X | Quadratic in n | None | Slower but saves qubits |
Role in universality and quantum algorithms
Controlled gates are essential for universal quantum computation. Single-qubit gates alone cannot create entanglement, but adding any one entangling two-qubit gate, such as CNOT or controlled-Z, yields a universal gate set capable of approximating any unitary to arbitrary precision.
In algorithms, controlled gates implement oracles, arithmetic and controlled evolution. Grover’s algorithm uses a multi-controlled Z as its diffusion core, while phase estimation applies controlled powers of U to read out eigenvalues. Note that the Clifford group including CNOT is efficiently simulable classically under the Gottesman–Knill theorem, so non-Clifford controlled gates such as Toffoli supply the computational power.
Errors and practical pitfalls
Two-qubit controlled gates are typically the noisiest operations on current hardware, with error rates often ten times higher than single-qubit gates. Minimizing their number is therefore a primary objective of circuit optimization.
| Symptom | Likely cause | Mitigation |
|---|---|---|
| Low fidelity in deep circuits | Too many two-qubit gates | Gate cancellation, better synthesis |
| Unexpected phase errors | Ignored global phase of U | Implement it as controlled phase |
| Extra SWAP overhead | Control and target not adjacent | Qubit routing and layout optimization |
| Wrong results after reuse | Ancillas left entangled | Uncompute ancillas before reuse |
The short version
A controlled gate is a quantum switch with a condition: it changes one qubit only if another qubit says yes. Think of a light that turns on only when a separate key is turned.
The surprising part is that the key can be half turned and half not at the same time. Then the light ends up linked to the key, so checking one tells you about the other. This link is called entanglement, and controlled gates are the main way quantum computers create it.
Where it makes a difference
A software engineer is preparing a three-qubit quantum Fourier transform for a superconducting processor whose native two-qubit gate is the controlled-Z. The textbook circuit contains three controlled phase gates with angles of pi/2, pi/4 and pi/2, plus Hadamard gates and a final swap.
The compiler rewrites each controlled phase as two CNOT-equivalent controlled-Z gates with single-qubit rotations, and routes qubits to avoid extra SWAPs on the device layout. The optimized version uses six two-qubit gates instead of nine in a naive compilation. On hardware with roughly one percent two-qubit error, this cut raises the measured success probability noticeably, showing why counting controlled gates is central to practical circuit design.