In short

The controlled-U gate is the family that CNOT belongs to. Pick any single-qubit unitary U — Pauli-X (giving CNOT), Pauli-Z (giving CZ), a rotation R_z(\theta) (giving a controlled-phase), a Hadamard (giving controlled-H), anything at all — and a new two-qubit gate falls out: "do U to the target when the control is |1\rangle, do nothing when the control is |0\rangle." Its matrix is the block form \begin{pmatrix} I & 0 \\ 0 & U \end{pmatrix}. One surprise: controlled-Z is symmetric between control and target, even though CNOT is famously not. A second surprise: if U|u\rangle = e^{i\phi}|u\rangle, then applying controlled-U to |+\rangle|u\rangle moves that phase from the target onto the control — phase kickback — which is the engine behind phase estimation, Shor, and the rest of Part 9.

Spend enough time staring at the CNOT gate and a natural question forms: why only X? CNOT is the gate that applies Pauli-X to a target qubit when the control is |1\rangle. But X is just one of the infinitely many single-qubit unitary matrices available to you. What happens if you replace it with Z? With a T gate? With a rotation R_y(\pi/3)? With a Hadamard?

Nothing stops you. The "controlled" construction works for every single-qubit unitary U and gives you a new two-qubit gate every time. You read the name "controlled-U" off the construction: the first qubit is the control, the second qubit is the target, and the gate's rule is as simple as it gets — when the control is |1\rangle, do U on the target; when the control is |0\rangle, do nothing. CNOT is the specific case U = X. Everything else is a cousin.

This chapter is the map of that family. You will see the block-matrix form that captures every member at once, meet the most important named ones (controlled-Z, controlled-phase, controlled-Hadamard), and then hit the one phenomenon that makes controlled-U gates genuinely quantum rather than merely a menu of options: phase kickback, the trick that turns a target-qubit eigenvalue into a relative phase on the control. Phase kickback is the mechanism under the hood of phase estimation and Shor's algorithm; you meet it here first in its simplest incarnation.

What controlled-U does

Start from the job description in one sentence: controlled-U applies the single-qubit unitary U to the target qubit exactly when the control qubit is |1\rangle. If the control is |0\rangle, neither qubit is disturbed. If the control is a superposition, the whole controlled-U inherits the linearity of quantum mechanics and acts on each piece of the superposition separately.

Why it is worth generalising: every "condition this on that" pattern in quantum algorithm design — from phase estimation to quantum chemistry simulation — comes down to a controlled-U. You don't want to rebuild the control machinery for each choice of U. You want one family, one picture, one rule — and to choose the gate U at the last moment based on what the algorithm needs.

The action on a computational basis product state is clean. Let the control carry a definite bit and the target carry any state |\psi\rangle:

\text{C-}U\,|0\rangle|\psi\rangle \;=\; |0\rangle|\psi\rangle, \qquad \text{C-}U\,|1\rangle|\psi\rangle \;=\; |1\rangle\,U|\psi\rangle.

Read these two lines out loud. The first says: when the control reads 0, the target is untouched — whatever state it was in, it still is. The second says: when the control reads 1, the target gets U applied to it — the full single-qubit unitary lands on whatever state was there. That is the entire definition of the gate.

A superposition on the control gets both cases at once. If the control is \alpha|0\rangle + \beta|1\rangle and the target is |\psi\rangle, then by linearity

\text{C-}U\,\bigl(\alpha|0\rangle + \beta|1\rangle\bigr)|\psi\rangle \;=\; \alpha|0\rangle|\psi\rangle + \beta|1\rangle\,U|\psi\rangle.

This is the moment the gate starts looking interesting, because the two branches of the control's superposition now hold different things on the target: one branch has |\psi\rangle, the other has U|\psi\rangle. That difference is what will later turn into kickback and interference.

The block-matrix form

You can encode the rule above as a single 4 \times 4 matrix. Use the basis order |00\rangle, |01\rangle, |10\rangle, |11\rangle — control first, target second.

When the control is |0\rangle (the first two basis states), the gate does nothing: the top-left 2 \times 2 block of the matrix is the identity I. When the control is |1\rangle (the last two basis states), the gate applies U to the target: the bottom-right 2 \times 2 block is U itself. The off-diagonal blocks are zero because the two control branches never mix — the control is not disturbed, only read.

\text{C-}U \;=\; \begin{pmatrix} I & 0 \\ 0 & U \end{pmatrix} \;=\; \begin{pmatrix} 1 & 0 & 0 & 0 \\ 0 & 1 & 0 & 0 \\ 0 & 0 & u_{00} & u_{01} \\ 0 & 0 & u_{10} & u_{11} \end{pmatrix}

where u_{ij} are the entries of the single-qubit unitary U = \begin{pmatrix} u_{00} & u_{01} \\ u_{10} & u_{11} \end{pmatrix}.

Why the block structure is obvious once you see it: the four basis states of the two-qubit system split into two groups — the "control is 0" half \{|00\rangle, |01\rangle\} and the "control is 1" half \{|10\rangle, |11\rangle\}. The gate acts independently on the two halves, so the matrix is block-diagonal with one block per half. The first block is I (do nothing), the second is U (apply U).

Block matrix form of controlled-UA 4 by 4 matrix with dividing lines splitting it into four 2 by 2 blocks. The top left block is labelled I and shaded. The bottom right block is labelled U and shaded with the accent colour. The top right and bottom left blocks are labelled zero.I00Ucontrol = 0control = 1target blocktarget blocktop-left: do nothing · bottom-right: apply U
The block form of controlled-U. The top-left $2 \times 2$ is the identity (control is $|0\rangle$, target untouched). The bottom-right $2 \times 2$ is $U$ (control is $|1\rangle$, target gets $U$). Off-diagonal blocks are zero.

Plug in U = X and the bottom-right block becomes \begin{pmatrix} 0 & 1 \\ 1 & 0 \end{pmatrix} — the CNOT matrix drops right out. Plug in U = Z and you get controlled-Z. Plug in U = I and every block is diagonal — the gate does nothing on any input, which is the degenerate case of the family.

The circuit symbol

Every controlled-gate shares the same drawing convention: a filled dot on the control wire, a vertical line connecting it to a box on the target wire, and the box is labelled with whatever U is. The CNOT's \oplus is the one special case — the "box" degenerates to a circled-plus sign because X is so common it gets its own symbol.

Circuit symbols for controlled-UFour two-wire circuits side by side showing CNOT, controlled-Z, controlled-H, and a generic controlled-U. Each has a filled dot on the control wire and a vertical line down to a box on the target wire. CNOT has a circled plus as its target symbol.CNOT (U = X)Zcontrolled-ZHcontrolled-HUcontrolled-U (general)ct
The same filled-dot-on-control, labelled-box-on-target template works for every controlled-U gate. Only the target label changes.

Controlled-Z — the symmetric surprise

The most important member of the family after CNOT is controlled-Z, written CZ. Plug U = Z = \begin{pmatrix} 1 & 0 \\ 0 & -1 \end{pmatrix} into the block-matrix recipe and you get

\text{CZ} \;=\; \begin{pmatrix} 1 & 0 & 0 & 0 \\ 0 & 1 & 0 & 0 \\ 0 & 0 & 1 & 0 \\ 0 & 0 & 0 & -1 \end{pmatrix}.

Reading the matrix. Every basis state is an eigenvector of CZ with eigenvalue \pm 1. Three of them — |00\rangle, |01\rangle, |10\rangle — get eigenvalue +1 (nothing happens). One of them — |11\rangle — gets eigenvalue -1 (its amplitude flips sign). That one minus sign sitting in the bottom-right corner is the entire gate.

Another way to say the same thing, without the block-matrix picture: CZ applies a -1 phase to the state |11\rangle and leaves the other three basis states alone.

\text{CZ}\,|ab\rangle \;=\; (-1)^{a \cdot b}\,|ab\rangle.

Why this single-sign rule captures the gate: CZ does nothing unless both qubits are 1, because the first qubit (the control) must be 1 for anything to happen, and the second qubit (the target) must also be 1 for Z to produce a minus sign. The product a \cdot b is 1 only in that one corner.

Now the surprise. Stare at that last equation for ten seconds. The product a \cdot b is symmetric in the two qubits: a \cdot b = b \cdot a. So CZ doesn't care which of the two qubits you call "control" and which you call "target." If you swap their roles, you get the same gate back. In a circuit diagram this is drawn as a symmetric symbol — two filled dots on the two wires, connected by a vertical line, with no box at either end.

CZ circuit symbol — symmetricA two-wire circuit showing controlled-Z drawn two equivalent ways: on the left, a dot on top wire connected by a vertical line to a Z box on the bottom wire; on the right, two filled dots connected by a vertical line, no box. An equals sign between them.Z=one control, one Z targetsymmetric two-dot form
CZ can be drawn as a control-plus-$Z$ or as two symmetric dots. Both are the same gate — CZ is symmetric in its two qubits.

Why CZ's symmetry matters in practice: it means the compiler is free to pick either qubit as the control when targeting CZ-native hardware. CNOT has a fixed direction (the control qubit determines the outcome; the target does not affect the control), so inserting a CNOT commits you to a specific orientation. CZ does not. On hardware where the two-qubit interaction is naturally symmetric — many superconducting chips, including IBM's more recent machines — CZ is closer to what the hardware actually does.

CNOT is not symmetric. A CNOT with qubit 1 controlling qubit 2 acts differently from a CNOT with qubit 2 controlling qubit 1 (look at the four truth-table rows and you can see this). The asymmetry of CNOT is the default; CZ's symmetry is the exception, and it is the first hint that different choices of U can give the family members very different personalities.

Turning CZ into CNOT with two Hadamards

CZ and CNOT are close cousins. In fact, you can turn one into the other with two Hadamards on the target qubit. The identity

\text{CNOT} \;=\; (I \otimes H) \cdot \text{CZ} \cdot (I \otimes H)

says: Hadamard the target, then CZ, then Hadamard the target again, and the net effect is a CNOT. The proof is a line of algebra once you remember HZH = X — a single-qubit circuit identity you will have seen in the Hadamard chapter. Put an H on each side of the Z that sits in the bottom-right block of CZ, and the block becomes HZH = X, which is the bottom-right block of CNOT.

This is not an idle observation. On hardware whose native two-qubit gate is CZ (rather than CNOT), this identity is literally how the compiler synthesises a CNOT. Every CNOT you write costs one CZ plus two single-qubit Hadamards.

Controlled-phase — a continuous family

Push the idea further. Replace Z with a phase-gate P(\phi) = \begin{pmatrix} 1 & 0 \\ 0 & e^{i\phi} \end{pmatrix} and you get the controlled-phase gate \text{CP}(\phi):

\text{CP}(\phi) \;=\; \begin{pmatrix} 1 & 0 & 0 & 0 \\ 0 & 1 & 0 & 0 \\ 0 & 0 & 1 & 0 \\ 0 & 0 & 0 & e^{i\phi} \end{pmatrix}.

Its action is equally clean: multiply |11\rangle by e^{i\phi}, leave the other three basis states alone. Setting \phi = \pi recovers CZ (because e^{i\pi} = -1). Setting \phi = \pi/2 gives controlled-S, with i in the corner. Setting \phi = \pi/4 gives controlled-T, with e^{i\pi/4} in the corner.

This continuous family — parameterised by \phi — is the backbone of the quantum Fourier transform. The QFT circuit on n qubits is built almost entirely out of Hadamards and controlled-phase gates at various angles, arranged in a particular pattern. When you meet the QFT in Part 9, the gates you will see are exactly \text{CP}(\phi) for various \phi. So every piece of machinery in this section is preparing you for that.

Controlled-phase gates are also symmetric in their qubits, for the same reason CZ is: the matrix is diagonal, and only the |11\rangle entry differs from 1. Swapping control and target doesn't change anything.

Phase kickback — the mechanism under everything

Now for the phenomenon that makes controlled-U gates feel genuinely quantum. It is called phase kickback, and it is worth slowing down for because it powers phase estimation, Shor's factoring algorithm, and a long list of other quantum-advantage results.

Set up a very specific situation. Put the control qubit in the |+\rangle state — the equal superposition \tfrac{1}{\sqrt 2}(|0\rangle + |1\rangle). Put the target qubit in a state |u\rangle that is an eigenstate of U with eigenvalue e^{i\phi}:

U|u\rangle \;=\; e^{i\phi}|u\rangle.

Recall what "eigenstate" means: |u\rangle is a state that U merely multiplies by a phase; it does not actually change the state's direction in Hilbert space. Different U have different eigenstates — Z's eigenstates are |0\rangle (eigenvalue +1) and |1\rangle (eigenvalue -1); a rotation R_z(2\phi)'s eigenstates are also |0\rangle (eigenvalue e^{-i\phi}) and |1\rangle (eigenvalue e^{+i\phi}). The machinery below doesn't care which U you picked; it only cares that you know U's eigenstate and eigenvalue.

Now apply controlled-U to the joint state |+\rangle|u\rangle. Expand the control's superposition:

\text{C-}U\,|+\rangle|u\rangle \;=\; \text{C-}U\,\tfrac{1}{\sqrt 2}\bigl(|0\rangle + |1\rangle\bigr)|u\rangle \;=\; \tfrac{1}{\sqrt 2}\bigl(|0\rangle|u\rangle + |1\rangle\,U|u\rangle\bigr).

Why this step is just the controlled-U's definition: on the |0\rangle branch the target is untouched, so you get |0\rangle|u\rangle. On the |1\rangle branch the target picks up U, so you get |1\rangle\,U|u\rangle. Linearity does the rest.

Now use the eigenvalue equation U|u\rangle = e^{i\phi}|u\rangle to simplify:

\tfrac{1}{\sqrt 2}\bigl(|0\rangle|u\rangle + |1\rangle\,e^{i\phi}|u\rangle\bigr) \;=\; \tfrac{1}{\sqrt 2}\bigl(|0\rangle + e^{i\phi}|1\rangle\bigr)|u\rangle.

Why you can factor: the phase e^{i\phi} is a complex number, not an operator. It commutes past the |1\rangle ket freely, and because |u\rangle appears on both branches, it factors out of the whole expression.

Look at what just happened. The target started in |u\rangle and ended in |u\rangle — unchanged. The control started in |+\rangle and ended in \tfrac{1}{\sqrt 2}(|0\rangle + e^{i\phi}|1\rangle) — a state with a new relative phase \phi between its two amplitudes. The phase that was the eigenvalue of U on the target ended up as a relative phase on the control. The phase got kicked back — from the qubit that U physically acted on, to the qubit that was supposed to be doing the controlling.

This is weird. Classically you would expect that controlling-on-|1\rangle means information flows from the control to the target. And information does flow that way — the target is where U gets applied. But in this particular eigenstate setting the target refuses to change (because it is an eigenstate of U), and the phase the target would have picked up on its own has nowhere to go except onto the control's superposition amplitudes.

Phase kickback — the phase moves from target to controlBefore-and-after diagram. On the left, the joint state is written as the plus state on the control times ket u on the target. A controlled-U gate is drawn in the middle with the control wire and a box labelled U on the target wire. On the right, the joint state is written as (ket 0 + e to the i phi ket 1) over root 2, tensored with ket u. Arrows show the phase emerging on the control side.before|+⟩(control in superposition)|u⟩(eigenstate of U)Uafter(|0⟩ + e^{iφ}|1⟩)/√2← phase landed here|u⟩(unchanged)
Phase kickback: starting with $|+\rangle|u\rangle$, applying C-$U$ lands the phase $e^{i\phi}$ onto the control's relative amplitude. The target comes out unchanged.

If this is your first encounter with kickback, it will not feel intuitive — it rarely does on a first pass. That is normal. The usefulness of kickback is that it turns "knowing an eigenvalue of U" into "a measurable phase on a single qubit." A Hadamard on the control followed by a measurement turns that phase into an interference pattern you can read out. That whole procedure is quantum phase estimation, and it is the engine room of Shor's factoring algorithm: find a unitary whose eigenvalue encodes the thing you want to compute, prepare an eigenstate as the target, put the control in |+\rangle (or a tower of them in |+\rangle^{\otimes n}), and let kickback do the work.

You will meet phase estimation formally in Part 9. For now, the takeaway is: phase kickback is the reason controlled-U gates are not just "do U sometimes." They are the mechanism for moving eigenvalue information between qubits, and that mechanism is at the heart of quantum advantage for factoring and many other problems.

Decomposing a controlled-U into CNOTs + single-qubit gates

Real hardware does not implement every controlled-U you might dream up. It typically exposes one or two entangling primitives — CNOT, or CZ, or an iSWAP-like interaction — plus a universal set of single-qubit gates. If you want a controlled-H, or a controlled-R_z(\theta), or a controlled-anything that is not directly on the menu, the compiler has to decompose it.

The key identity is already above, and it works in both directions. Let U be any single-qubit unitary. There always exist single-qubit unitaries A, B, C and a phase \alpha such that

U \;=\; e^{i\alpha}\,A X B X C, \qquad ABC = I.

From this, a standard construction builds controlled-U out of one CNOT, one A, one B, one C, one controlled-phase e^{i\alpha} acting only on the control — and one more CNOT. A total of two CNOTs plus single-qubit gates, for any U.

You do not need to absorb the full construction here — the details are in Nielsen & Chuang §4.3 and are standard across the QC compiler literature. The point is that every controlled-U can be compiled into a fixed recipe that uses only CNOTs and single-qubit gates. Hardware only needs CNOT (or an equivalent), and the rest of the family falls out.

A concrete example: the controlled-Hadamard gate can be built as

\text{C-}H \;=\; (I \otimes R_y(\pi/4)) \cdot \text{CNOT} \cdot (I \otimes R_y(-\pi/4))

where R_y(\theta) is a rotation about the Bloch sphere's y-axis by angle \theta. One CNOT, two single-qubit rotations. That is typical for most named controlled-U gates — one or two CNOTs plus a handful of single-qubit boxes.

Example 1: CZ on $|+\rangle|+\rangle$ — the graph-state seed

Take two qubits, each prepared in |+\rangle, and hit them with CZ. The result turns out to be one of the simplest graph states — the workhorse resource of measurement-based quantum computing.

Setup. The joint input state is

|+\rangle|+\rangle \;=\; \tfrac{1}{2}\bigl(|00\rangle + |01\rangle + |10\rangle + |11\rangle\bigr).

All four basis states get equal amplitude 1/2. Now apply CZ.

Step 1 — apply CZ term by term. CZ is linear, so it distributes over the sum. Three of the four terms — |00\rangle, |01\rangle, |10\rangle — are fixed by CZ. Only the last term, |11\rangle, picks up a sign:

\text{CZ}\,|+\rangle|+\rangle \;=\; \tfrac{1}{2}\bigl(|00\rangle + |01\rangle + |10\rangle - |11\rangle\bigr).

Why only |11\rangle changes: CZ's only action is |11\rangle \to -|11\rangle. The other three basis states sit in the top-left 3 \times 3 submatrix of CZ, which is the identity, so they pass through unchanged.

Step 2 — is this state entangled? Try to factor it as a product (a|0\rangle + b|1\rangle)(c|0\rangle + d|1\rangle). Expanding gives amplitudes ac, ad, bc, bd for the four basis states |00\rangle, |01\rangle, |10\rangle, |11\rangle. You would need

ac = \tfrac{1}{2},\; ad = \tfrac{1}{2},\; bc = \tfrac{1}{2},\; bd = -\tfrac{1}{2}.

Divide the first by the second: c/d = 1, so c = d. Divide the third by the fourth: c/d = -1, so c = -d. Both cannot be true unless c = d = 0, which contradicts ac = 1/2. No factorisation exists — the state is entangled.

Step 3 — name the state. The state \tfrac{1}{2}(|00\rangle + |01\rangle + |10\rangle - |11\rangle) is (up to local Hadamards) one of the four Bell states. Apply a Hadamard to the second qubit and you recover \tfrac{1}{\sqrt 2}(|00\rangle + |11\rangle) = |\Phi^+\rangle exactly. So CZ acting on |+\rangle|+\rangle produces a Bell pair up to a single-qubit rotation.

What this shows. CZ is an entangling gate, like CNOT. The hint was already in the matrix — one off-diagonal-in-effect entry — but the concrete check through a factorisation attempt confirms it. More generally, the two-qubit graph state associated with an edge between two qubits is exactly the output of CZ on |+\rangle|+\rangle. Bigger graph states (on 3, 4, ..., 1000 qubits) are built by preparing each qubit in |+\rangle and then applying a CZ on every pair of qubits that share an edge in the target graph. This construction is the starting point of measurement-based quantum computing, and in Part 12 you will see why it is equivalent in computational power to the standard circuit model.

CZ on two plus statesTwo-wire circuit with each input labelled ket plus. A CZ is applied as two filled dots connected by a vertical line. The output is labelled as the entangled state (|00⟩ + |01⟩ + |10⟩ − |11⟩) over 2.|+⟩|+⟩(|00⟩ + |01⟩ + |10⟩ − |11⟩)/2entangled — cannot factor as |α⟩|β⟩
CZ on $|+\rangle|+\rangle$ produces an entangled state equivalent (up to a local Hadamard) to a Bell pair. The single minus sign introduced by CZ on $|11\rangle$ is what breaks the factorisation.

Example 2: phase kickback with a controlled-phase gate

Take a controlled-phase gate \text{CP}(\phi) with some angle \phi. Feed it the eigenstate |1\rangle on the target (yes — |1\rangle is an eigenstate of any diagonal single-qubit unitary) and |+\rangle on the control. Watch the phase land on the control.

Setup. The target unitary is P(\phi) = \begin{pmatrix} 1 & 0 \\ 0 & e^{i\phi} \end{pmatrix}. It has two eigenstates: |0\rangle with eigenvalue 1 (boring — no phase to kick back) and |1\rangle with eigenvalue e^{i\phi}. Pick |1\rangle as the target to get a non-trivial kickback.

Step 1 — write the joint state.

|+\rangle|1\rangle \;=\; \tfrac{1}{\sqrt 2}\bigl(|0\rangle + |1\rangle\bigr)|1\rangle \;=\; \tfrac{1}{\sqrt 2}\bigl(|01\rangle + |11\rangle\bigr).

Step 2 — apply \text{CP}(\phi). The gate multiplies the |11\rangle component by e^{i\phi} and leaves |01\rangle alone (because the control is |0\rangle on that branch):

\text{CP}(\phi)\,|+\rangle|1\rangle \;=\; \tfrac{1}{\sqrt 2}\bigl(|01\rangle + e^{i\phi}|11\rangle\bigr).

Why only |11\rangle gets the phase: \text{CP}(\phi)'s matrix has its one non-trivial entry at the |11\rangle, |11\rangle corner — the bottom-right. Every other basis state is an eigenvector of \text{CP}(\phi) with eigenvalue 1.

Step 3 — factor the target out.

\tfrac{1}{\sqrt 2}\bigl(|01\rangle + e^{i\phi}|11\rangle\bigr) \;=\; \tfrac{1}{\sqrt 2}\bigl(|0\rangle + e^{i\phi}|1\rangle\bigr)|1\rangle.

Why this factorisation works: both terms carry |1\rangle on the second slot, so the second slot can be pulled out front and the first slot becomes a two-amplitude combination.

Step 4 — read off the kickback. The target is |1\rangle (unchanged). The control is \tfrac{1}{\sqrt 2}(|0\rangle + e^{i\phi}|1\rangle) — the |+\rangle state it started in, but with a relative phase \phi between its two amplitudes. The phase has moved from the target's eigenvalue to the control's relative amplitude.

What this shows. The kickback trick works with any controlled-U gate and any eigenstate of U. Here it happens to be controlled-phase and |1\rangle; in the phase-estimation algorithm the same move is applied with a larger U (like a rotation by 2\pi \theta, where \theta is what you want to estimate) and a tower of |+\rangle controls. The output is a pattern of kicked-back phases on the controls, from which \theta can be read out by an inverse quantum Fourier transform. That is the whole shape of phase estimation. The single kickback you just did here is the primitive on which that tower is built.

Phase kickback with a controlled-phaseTwo-wire circuit with control labelled ket plus and target labelled ket 1. A controlled-phase gate CP phi is drawn with a dot on the control wire connected by a vertical line to a box labelled P phi on the target wire. The outputs are labelled: the control becomes (ket 0 + e to the i phi ket 1) over root 2, the target stays ket 1.P(φ)|+⟩|1⟩(|0⟩ + e^{iφ}|1⟩)/√2|1⟩phase φ kicks back onto the control
Phase kickback in action. The target $|1\rangle$ is an eigenstate of $P(\phi)$ with eigenvalue $e^{i\phi}$, so the target is unchanged and the phase shows up on the control's relative amplitude.

Common confusions

Going deeper

You now have everything you need to read most quantum algorithm papers and understand when a controlled-U appears and why. The rest of this section covers the formal kickback derivation, the link into phase estimation, the stabilizer perspective on CZ, and a hardware note on why many superconducting devices prefer native CZ over CNOT.

Phase kickback — the formal picture

The eigenstate-based kickback generalises. Suppose U has a spectral decomposition

U \;=\; \sum_k e^{i\phi_k}\,|u_k\rangle\langle u_k|

where the |u_k\rangle are the eigenstates and the e^{i\phi_k} are the corresponding eigenvalues. Any target state |\psi\rangle can be expanded in this basis as |\psi\rangle = \sum_k c_k |u_k\rangle. Applying C-U to |+\rangle|\psi\rangle gives

\text{C-}U\,|+\rangle|\psi\rangle \;=\; \tfrac{1}{\sqrt 2}\sum_k c_k\bigl(|0\rangle|u_k\rangle + e^{i\phi_k}|1\rangle|u_k\rangle\bigr).

Unless |\psi\rangle happens to be a single eigenstate, the kickback phases are different for different k, and the control qubit ends up entangled with the target — no longer a product state. Only when |\psi\rangle is an eigenstate does the kickback land cleanly on the control without dragging in entanglement. That constraint is why phase-estimation circuits start by preparing an eigenstate (or a rough approximation to one) on the target register.

Phase estimation — a one-paragraph preview

Given a unitary U and an eigenstate |u\rangle with eigenvalue e^{2\pi i \theta} (for some unknown \theta \in [0, 1)), quantum phase estimation estimates \theta to n-bit precision using n control qubits and roughly 2^n applications of U. The circuit shape is: prepare the controls in |+\rangle^{\otimes n} and the target in |u\rangle; apply controlled-U^{2^k} with the k-th control (for k = 0, 1, \ldots, n-1); do an inverse QFT on the controls; measure. The kicked-back phases on the n controls encode the bits of \theta in a specific interference pattern, and the inverse QFT decodes them. Every piece of this is built out of controlled-U gates at various angles and a QFT circuit (which is itself mostly Hadamards and controlled-phase gates). The full treatment lives in Part 9.

Stabilizer formalism — why CZ lives so comfortably inside it

CZ is one of a small club of two-qubit gates (along with CNOT, H, S, and the Paulis) that form the Clifford group — the gates that map Pauli operators to Pauli operators under conjugation. Circuits built entirely from Clifford gates are called stabilizer circuits, and they are efficiently classically simulable (Gottesman-Knill theorem). That does not make stabilizer circuits useless — every quantum error-correcting code in current practical use is a stabilizer code, and the encoding, syndrome-measurement, and decoding circuits are Clifford circuits. CZ is the most common two-qubit Clifford gate in surface-code error-correction circuits, partly because of its symmetry and partly because superconducting hardware can implement it natively.

Hardware — when CZ is what you actually have

Real devices tend to implement either CNOT (via cross-resonance, on IBM heavy-hex chips) or CZ (via a direct qubit-qubit interaction, on many Google superconducting processors and on some of the newer IBM chips). The compiler's job, given a circuit you wrote in terms of CNOTs, is to swap in CZs and two flanking Hadamards on every CNOT before sending the pulse program to the chip. This is done so routinely you never see it in the Qiskit or Cirq output — but under the hood, the native gate on the transmon is very often CZ, not CNOT. India's National Quantum Mission-supported groups at TIFR and IIT Madras are working with both architectures, depending on the specific device.

Toffoli — a preview of multi-controlled gates

One final stretch of the family. A Toffoli gate (also known as CCX or controlled-controlled-NOT) has two controls and one target: flip the target if and only if both controls are |1\rangle. Its matrix is 8 \times 8 and it is a three-qubit gate. It decomposes into six CNOTs plus a handful of single-qubit gates. Its special property — universality for classical reversible computation — is the content of the next chapter. Every AND, OR, and NAND gate you know from classical computing can be synthesised from Toffolis, which is why Toffoli is the bridge from classical to quantum reversible computing.

Where this leads next

References

  1. Nielsen and Chuang, Quantum Computation and Quantum Information (2010), §4.3 (controlled operations and the U = e^{i\alpha}AXBXC decomposition) — Cambridge University Press.
  2. John Preskill, Lecture Notes on Quantum Computation, Ch. 5 (controlled operations and phase estimation) — theory.caltech.edu/~preskill/ph229.
  3. Barenco et al., Elementary gates for quantum computation (1995) — the original paper establishing that CNOT + single-qubit gates is universal and that every controlled-U decomposes into them. arXiv:quant-ph/9503016.
  4. Wikipedia, Controlled NOT gate — includes CZ, controlled-phase, and the symmetry discussion.
  5. Kitaev, Quantum measurements and the abelian stabilizer problem (1995) — where phase estimation using kickback was first written out in detail. arXiv:quant-ph/9511026.
  6. Qiskit Textbook, Phase kickback and the controlled gate zoo — runnable examples of kickback with controlled-phase and controlled-T.