Controlled-U Gates
Almost everything a quantum computer does that a classical one cannot comes from making an operation conditional on quantum information — and the controlled- gate is the primitive that does exactly this. Take any single-qubit unitary , hand it a second qubit called the control, and runs on the target in the branch where the control reads and leaves it alone in the branch. Because the control can itself be in superposition, the two branches coexist and the result is generically entangled. This one construction contains CNOT (), controlled- (), the controlled phase rotations that build the quantum Fourier transform, and — stacked into multi-control form — the Toffoli gate and quantum oracles. The structure is deceptively simple: is block-diagonal in the control basis, an identity block above a copy of , and from that one fact everything follows. Feed the target an eigenstate of and the eigenvalue detaches from the target and reappears as a relative phase on the control — phase kickback, the engine of phase estimation, Shor's algorithm, and HHL. Ask how to build from hardware-native CNOTs and single-qubit rotations and the Z–Y decomposition answers with an exact two-CNOT circuit, while exposing a trap: the global phase of , invisible for a lone gate, becomes physically real the moment is controlled.
- A controlled- gate applies a single-qubit unitary to a target qubit only when the control is , and does nothing when the control is .
- Its operator is block-diagonal, , which specializes to CNOT (), controlled- () and controlled phase ().
- On an eigenstate the target is untouched and the eigenphase kicks back onto the control — the mechanism behind phase estimation.
- Any compiles into exactly two CNOTs via the ABC identity with , plus a phase gate on the control — and dropping that control-phase gate is the classic compilation bug.
- Multi-controlled gates (Toffoli, oracles) are built recursively from two-qubit controlled gates using .
- Key idea: controlled- writes a single-qubit unitary into the block of a block-diagonal two-qubit operator, — phase kickback, the two-CNOT compilation, and multi-controlled gates all follow from this one structure.
Controlled- writes a single-qubit unitary into the block of a block-diagonal two-qubit operator: . Everything else — phase kickback, the ABC compilation, and multi-controlled extensions — follows from this single structure.
Where this lives today
Controlled- is not a textbook idealization — it is what quantum hardware spends most of its time doing. Superconducting processors from IBM and Google expose a two-qubit entangler (a controlled-, an echoed cross-resonance CNOT, or a tunable controlled-phase) plus single-qubit rotations, and every higher-level operation is transpiled into those primitives using exactly the two-CNOT ABC construction; IBM's native gate is the of Worked Example 2, while trapped-ion and neutral-atom machines use Mølmer–Sørensen and Rydberg-blockade interactions. At the algorithm layer, controlled powers drive quantum phase estimation — the heart of Shor's factoring, HHL, and quantum-chemistry energy estimation — and the controlled rotations are the rungs of every quantum Fourier transform. Fault-tolerant architectures spend heavily synthesizing controlled non-Clifford gates by distilling magic states, and open problems stay sharp: optimal CNOT- and -count synthesis of a given , and efficient block-encoding of controlled unitaries for qubitization — refinements of the primitive introduced here.
The physical picture
Picture the control qubit as a quantum switch wired to the target: "off" applies the identity , "on" applies . What makes it quantum is that the switch itself can be placed in superposition. When the control is , both settings fire at once into orthogonal branches and the gate produces — a coherent superposition of "did nothing" and "applied ." That output is entangled unless , which is why the controlled gate is the workhorse for making entanglement. The first figure fixes this switch picture together with the block-diagonal operator it produces.
Now suppose the target starts in an eigenstate of , say . The gate cannot change — it may only multiply it by — but that scalar sits in front of the branch only, giving : the target is untouched while the eigenphase migrates onto the control. This "phase kickback" lets a quantum computer read out a property of by measuring the control, and the second figure carries it through with real numbers, using (whose eigenvalue is ) to turn a hidden eigenphase into a concrete pair of measurement probabilities.
The core equations
The definition is a single operator, written with the control qubit first. Two orthogonal projectors on the control select which single-qubit operation the target sees: the identity in one branch, in the other — and every property of the gate is a corollary of this one line.
where: are the projectors onto the control basis states; is the identity on the target; is any single-qubit unitary with . Reading it: the control chooses the block, the target lives inside the chosen block. Ordering the two-qubit basis as with the control most significant, equation (1) becomes a block-diagonal matrix — a identity in the top-left, the matrix of in the bottom-right, zeros off the blocks.
where: are the matrix elements of . The upper block never touches the lower block, so unitarity of is exactly unitarity of . Acting on a control in superposition, linearity distributes the gate over the two branches — the equation that makes controlled gates entangling rather than merely conditional.
where: are the control amplitudes with , and is any target state. The output factorizes only when ; otherwise the two qubits are entangled. When the target is an eigenstate of , it survives untouched and the eigenvalue attaches to the amplitude of the control — phase kickback stated as an identity.
where: is an eigenstate of and its unit-modulus eigenvalue. A property of the target () has become a relative phase of the control, ready to be read by interference. To build from a hardware gate set, start from the Z–Y decomposition and repackage it: choose whose product is the identity but between which a Pauli- reconstructs .
where: are single-qubit gates assembled from - and -rotations, is the global phase of , and each is supplied by a CNOT's target action. Control off gives (target untouched); control on inserts the two 's and yields . Turning equation (5) into a circuit, each is realized by a CNOT sharing the control, and the leftover is applied as a phase gate on the control — because a global phase becomes a relative phase between branches.
where: acts on the control and is a CNOT with the same control and the working target. Two CNOTs, three single-qubit gates, and one control-phase gate reproduce any exactly.
The goal is to derive the matrix form (2) directly from the operator definition (1), so the block structure is a computed consequence rather than an assertion, and then to read off unitarity for free. We fix a basis ordering, evaluate the four control blocks one by one using the orthogonality of the control projectors, and check that the matrix times its adjoint is the identity exactly when is unitary — showing why controlling a unitary can never break unitarity.
Step 1. Order the computational basis as with the control most significant, giving . Why: the block structure only looks block-diagonal in this ordering; putting the target first would interleave the entries and hide it.
Step 2. Evaluate the control- block: , because projects onto the first term of (1) and kills the second. Why: this is the mathematical statement that "control off does nothing" — the upper-left block is the identity.
Step 3. Evaluate the control- block: , and the two cross blocks vanish since . Why: the lower-right block is exactly , and orthogonal control projectors guarantee the off-diagonal blocks are strictly zero.
Step 4. Assemble the results into matrix (2) and form ; the block-diagonal product is . Why: unitarity of reduces to unitarity of — controlling a valid gate always yields a valid gate. *The block-diagonal matrix follows directly from the ordering and the orthogonality of the control projectors; by direct block multiplication.*
Go deeper · Derivation B · 1 minCompiling controlled-U into two CNOTs and a control-phase gate
The goal is to build an explicit circuit for using only CNOTs, single-qubit rotations, and one phase gate — the compilation every real quantum computer must perform, since no hardware executes an arbitrary directly. Starting from the Z–Y decomposition of , we manufacture three single-qubit gates whose product is the identity yet whose -conjugated combination rebuilds , then restore the global phase as a control-phase gate — tracking the two branches separately proves the circuit exact and shows why the global phase, harmless for a lone , must be re-inserted.
Step 1. By the Z–Y decomposition write and define , , . Why: these splits are engineered so the - and -angles cancel in one combination and reinforce in the other — the whole construction hinges on this bookkeeping.
Step 2. Verify the control-off branch: . Why: the -rotations cancel and the -angles sum to , so with no CNOTs firing the branch is the identity.
Step 3. Verify the control-on branch using and : the two 's flip the signs of 's angles, and . Why: conjugating by converts the cancelling combination into the reinforcing one, rebuilding the part of ; each comes from a CNOT whose control is on.
Step 4. Restore the global phase: since the reconstruction gives , apply on the control, contributing only in the branch. Why: for a lone the factor is unobservable, but here it multiplies one branch and not the other — omitting this gate is the most common controlled- compilation error. *For a random , and hold to machine precision; two CNOTs is optimal for a generic .*
Go deeper · Derivation C · 1 minPhase kickback: turning an eigenvalue into a control phase
The goal is to show that controlling a unitary on one of its eigenstates transfers the eigenphase onto the control while leaving the target physically unchanged — the exact mechanism quantum phase estimation, Shor's algorithm, and amplitude estimation all exploit. We prepare the control in an equal superposition and the target in an eigenstate, apply the defining operator branch-by-branch, and watch the eigenvalue factor out onto the control; a final Hadamard turns that phase into a measurable bit, so the target does real work while never actually changing.
Step 1. Prepare the control in and the target in with , then apply branch by branch: . Why: the defining operator acts as identity on the branch and as on the branch, so linearity is all that is used here.
Step 2. Substitute the eigenvalue equation so the branch becomes . Why: because is an eigenstate, is only permitted to multiply by a scalar — the target amplitude is preserved and only a phase appears.
Step 3. Factor the common target: the state is , a product state. Why: the eigenphase has "kicked back" onto the control and the target is disentangled — you could discard the target and keep the phase, which is what phase estimation effectively does.
Step 4. Read out by interference: a Hadamard on the control gives measurement probability for outcome , encoding ; a register of controls with powers plus an inverse QFT extracts bit by bit. Why: interference converts an unobservable relative phase into observable statistics — this is the readout step of the phase-estimation algorithm. *Substituting the eigenvalue equation gives a product state; for () the Hadamard gives .*
Limiting cases
Particular choices of the target unitary collapse onto the standard named gates — and one choice exposes the global-phase subtlety directly:
| Case | Result | Meaning |
|---|---|---|
| trivial: the control does nothing, the gate is the identity on both qubits | ||
| the CNOT: flips the target iff the control is | ||
| controlled-: diagonal, and symmetric under controltarget exchange | ||
| controlled phase rotation — the building block of the quantum Fourier transform | ||
| a pure global phase on becomes a real phase gate on the control |
Worked examples
1 · Single-bit phase estimation with controlled-T (fully worked)
Take , the gate. Its eigenvalue is , so is an eigenstate with phase . Prepare the control in and the target in , apply controlled-, then Hadamard the control. Find the measurement statistics and show they encode .
Step 1. Apply controlled- branch by branch. Since , kickback (equation 4) gives . The target is untouched; the phase has moved onto the control. The state factorizes — the target does no visible work yet carries the answer.
Step 2. Hadamard the control. Using and , the control becomes .
Step 3. Compute the outcome- probability: . Numerically and .
Step 4. Interpret. The bias of the coin is set entirely by the eigenphase, , so the lopsided result signals a small phase . Repeating with controlled powers and an inverse QFT extracts the bits of exactly — this single gate is one round of phase estimation. , , reading .
2 · Assembling a Toffoli from controlled-√X
The Toffoli gate flips the target only when both controls are . Build it from two-qubit controlled gates using , the "" gate native to superconducting hardware, where and .
Step 1. Confirm the building block: , using and . So two applications of the controlled- equal one controlled-.
Step 2. Lay out the Barenco circuit on qubits (control 1, control 2, target 3), read left to right in time: , , , , .
Step 3. Track the net target operation over the four control settings. Both : every gate idle, net . Controls : target sees then , net . Controls : the CNOTs toggle qubit 2 so the target sees then , net . Controls : qubit 2 is toggled to before the middle gate, so the target sees then , net .
Step 4. The target is flipped by only when both controls are — precisely the Toffoli truth table. with (verified to machine precision). The same recursion builds for any , and iterating gives .
Physics of the portrait
Controlled gates are where the idea of a "quantum program" became concrete: a circuit of conditional unitaries on qubits. The person who framed computation that way, and first exhibited a universal controlled-controlled gate, is David Deutsch.
Origins · 1 minDavid Deutsch and how this was discovered
David Deutsch turned quantum computation from a slogan into a formalism. In 1985 he defined the universal quantum Turing machine and argued, via the Church–Turing–Deutsch principle, that a device built on quantum evolution could do what no classical machine efficiently could. But it was his 1989 paper "Quantum computational networks" that introduced the language used ever since: computation as a network of quantum gates, unitary boxes wired together in time. There Deutsch exhibited a single three-qubit gate — the Deutsch gate , a controlled-controlled rotation applying only when two controls are both — and proved it universal: any quantum computation can be approximated by that one gate alone (for an irrational multiple of ). This is the controlled- idea at full stretch, and it set the programme that Barenco, Bennett, Cleve, DiVincenzo and collaborators completed in 1995 with the two-CNOT compilation of an arbitrary and the recursive construction. Deutsch also gave the field its first algorithm — the Deutsch, later Deutsch–Jozsa, problem — whose speed-up runs entirely on phase kickback. The modern circuit model, in which every conditional operation is some , descends directly from his networks.
Going further
Texts. Nielsen & Chuang, Quantum Computation and Quantum Information, §4.3 (controlled operations) and Fig. 4.6, §5.2 (phase estimation) · Preskill, Lecture Notes for Physics 219, Ch. 5 (classical and quantum circuits) · Barenco, Bennett, Cleve, DiVincenzo, Margolus, Shor, Sleator, Smolin, Weinfurter, "Elementary gates for quantum computation," Phys. Rev. A 52, 3457 (1995) · Watrous, The Theory of Quantum Information, Ch. 2 · Kitaev, Shen, Vyalyi, Classical and Quantum Computation, §8 · Mermin, Quantum Computer Science, Ch. 2. Key checkpoints: the block-diagonal matrix follows from the ordering; and via ; the kickback factorization gives for controlled-; and the Toffoli identity rests on , .
Prerequisites. Quantum Circuit Model · Single-Qubit Rotation Gates · Z–Y Decomposition of Single-Qubit Gates · CNOT Gate. Leads to. Controlled-Z Gate · Universal Gate Sets · Circuit Identities and Equivalences · SWAP Gate.
Ask the tutor: Ask me to walk you through the two-CNOT ABC compilation of any specific gate — a controlled-Hadamard, controlled-, or a controlled rotation from your own circuit — or to show how phase kickback turns into the bits of a phase-estimation readout.
Is the "control" qubit really more in charge than the target?
Less than the name suggests — the asymmetry lives entirely in , not in the construction. For controlled- the roles are interchangeable: is symmetric under swapping the qubits, because is diagonal. Even for CNOT you can move "which qubit is the control" by conjugating with Hadamards, since is a CNOT with control and target exchanged. And under phase kickback it is often the target that supplies the information while the control merely records it. Control and target are labels of convenience, not a fixed hierarchy.
What is phase kickback, intuitively?
A controlled gate acting on an eigenstate of cannot change that eigenstate — it may only multiply it by the eigenvalue — but that scalar attaches to the branch of the control alone. So a property of the target (its eigenphase) is copied onto the control as a relative phase you can read by interference, while the target comes out exactly as it went in. This is why phase estimation feeds an eigenstate it never disturbs yet extracts the eigenphase to many bits: the answer was always riding on the control.
Why exactly two CNOTs — can I ever do it in one?
For a generic single-qubit , two CNOTs are necessary and sufficient. The ABC construction achieves two, and Barenco et al. proved you cannot generally do better: a single CNOT with surrounding single-qubit gates realizes only a restricted family, because the constraint with one insertion cannot reproduce an arbitrary -branch unitary while keeping the -branch identity. Special cases do better — a gate equivalent to controlled- up to single-qubit gates costs one entangler, and costs none — but "two CNOTs for a generic " is the tight bound.
How do I build a controlled gate if my hardware only has CNOT?
You use the two-CNOT ABC circuit (equation 6): decompose , form from those angles, and lay down , CNOT, , CNOT, on the target with a phase gate on the control. Every gate there is a CNOT or a single-qubit rotation, both native to essentially all hardware — this is exactly what a transpiler emits for an abstract . The one thing hand-compilers forget is the control-phase gate ; omit it and the gate is wrong by a control-dependent phase.
How does controlled-U scale to many control qubits?
A multiply-controlled gate fires only when all controls are . You build it recursively from two-qubit controlled gates using : Worked Example 2 shows from three controlled-/ gates and two CNOTs, and the same idea nests upward. With a handful of ancilla qubits (the multi-controlled Toffoli) can be done with two-qubit gates. These constructions underlie quantum oracles, Grover's diffusion operator, and reversible arithmetic — anywhere a large logical AND of qubits must gate an operation.
Does measuring the control after kickback disturb the target?
No, provided the target was an eigenstate of . After kickback the joint state is a product, , so measuring the control leaves untouched — the same eigenstate can be fed through many controlled powers of without being consumed, which is exactly what phase estimation relies on. The story changes if the target is not an eigenstate: the output (equation 3) is then entangled, and measuring the control back-acts on the target, projecting it into or .