|q⟩ Bad Qubits

beginner · Programming · Controlled Gates: CNOT, CZ, SWAP

Phase Kickback

Every controlled gate has a classical story: "apply the operation to the target if and only if the control is ∣1⟩|1\rangle." Phase kickback is the quantum twist: when the target is an eigenstate of the gate, the associated eigenvalue does not stay on the target — it travels back and multiplies the control.

Eigenstates and eigenvalues

A unitary gate UU has eigenstates ∣λ⟩|\lambda\rangle satisfying

U∣λ⟩=eiϕ∣λ⟩.U|\lambda\rangle = e^{i\phi}|\lambda\rangle.

The gate leaves the state's shape unchanged and only multiplies it by a complex number of magnitude

  1. For the ZZ gate (and therefore also for CZCZ), the eigenstates are ∣0⟩|0\rangle and ∣1⟩|1\rangle with eigenvalues +1+1 and −1-1 respectively:
Z∣0⟩=∣0⟩,Z∣1⟩=−∣1⟩.Z|0\rangle = |0\rangle, \qquad Z|1\rangle = -|1\rangle.

The kickback mechanism

Consider a two-qubit system where the target qubit is prepared in an eigenstate ∣λ⟩|\lambda\rangle of UU with eigenvalue eiϕe^{i\phi}. Let the control start in an arbitrary superposition α∣0⟩+β∣1⟩\alpha|0\rangle + \beta|1\rangle. The joint state before the controlled-UU gate is

(α∣0⟩+β∣1⟩)∣λ⟩=α∣0⟩∣λ⟩+β∣1⟩∣λ⟩.\bigl(\alpha|0\rangle + \beta|1\rangle\bigr)|\lambda\rangle = \alpha|0\rangle|\lambda\rangle + \beta|1\rangle|\lambda\rangle.

Applying the controlled-UU gate acts UU on the target only in the ∣1⟩|1\rangle branch of the control:

α∣0⟩∣λ⟩+β∣1⟩ U∣λ⟩=α∣0⟩∣λ⟩+βeiϕ∣1⟩∣λ⟩.\alpha|0\rangle|\lambda\rangle + \beta|1\rangle\,U|\lambda\rangle = \alpha|0\rangle|\lambda\rangle + \beta e^{i\phi}|1\rangle|\lambda\rangle.

Factor out ∣λ⟩|\lambda\rangle because the target state is the same in both branches:

=(α∣0⟩+βeiϕ∣1⟩)∣λ⟩.= \bigl(\alpha|0\rangle + \beta e^{i\phi}|1\rangle\bigr)|\lambda\rangle.

The target is unchanged. The phase eiϕe^{i\phi} has moved onto the control's ∣1⟩|1\rangle amplitude — it has "kicked back." The control qubit now carries information about the gate's eigenvalue even though it was the target that the gate acted on.

A concrete example: CZ with ∣+⟩|+\rangle control and ∣1⟩|1\rangle target

The CZCZ gate multiplies the ∣11⟩|11\rangle component by −1-1 and leaves ∣00⟩|00\rangle, ∣01⟩|01\rangle, ∣10⟩|10\rangle unchanged. Prepare the control in ∣+⟩=12(∣0⟩+∣1⟩)|+\rangle = \tfrac{1}{\sqrt{2}}(|0\rangle + |1\rangle) and the target in ∣1⟩|1\rangle:

∣+⟩∣1⟩=12(∣01⟩+∣11⟩).|+\rangle|1\rangle = \tfrac{1}{\sqrt{2}}\bigl(|01\rangle + |11\rangle\bigr).

After CZCZ, the ∣11⟩|11\rangle component picks up a factor of −1-1:

CZ(∣+⟩∣1⟩)=12(∣01⟩−∣11⟩).CZ\bigl(|+\rangle|1\rangle\bigr) = \tfrac{1}{\sqrt{2}}\bigl(|01\rangle - |11\rangle\bigr).

Factor the target qubit out:

=12(∣0⟩−∣1⟩)∣1⟩=∣−⟩∣1⟩.= \tfrac{1}{\sqrt{2}}\bigl(|0\rangle - |1\rangle\bigr)|1\rangle = |{-}\rangle|1\rangle.

The target is still ∣1⟩|1\rangle. The control, however, has flipped from ∣+⟩|+\rangle to ∣−⟩|{-}\rangle — a phase difference of π\pi on the Bloch sphere's equator. The −1-1 eigenvalue of ZZ acting on ∣1⟩|1\rangle has been transferred to the control qubit.

Try it

Put qubit 0 into ∣+⟩|+\rangle with a Hadamard, put qubit 1 into ∣1⟩|1\rangle with an X gate, then apply CZCZ. The grader checks the full state vector, which should be 12(∣01⟩−∣11⟩)\tfrac{1}{\sqrt{2}}(|01\rangle - |11\rangle) — equivalently ∣−⟩∣1⟩|{-}\rangle|1\rangle.

Run your code to see the quantum state.

After running, inspect the Amplitudes tab: the ∣01⟩|01\rangle amplitude should be ≈+0.707\approx +0.707 and the ∣11⟩|11\rangle amplitude ≈−0.707\approx -0.707, while ∣00⟩|00\rangle and ∣10⟩|10\rangle remain zero. That sign change on the control is phase kickback in action.

Sign in on the full site to ask questions and join the discussion.