Skip to content
Quantum ComputingAN INTERACTIVE OPEN TEXTBOOK
charithj.com.au

Controlled gates and CNOT

Conditional quantum operations work coherently, without first measuring the control.

10 min readDr. Charith Jayasekara↓ Chapter PDF
By the end, you’ll be able to
  • Trace CNOT on basis states and superpositions.
  • State the control, target and bit-order convention.

Controlled-X, often called CNOT or CX, maps

∣c,t⟩⟼∣c,t⊕c⟩.\lvert c,t\rangle\longmapsto\lvert c,t\oplus c\rangle.
InputOutput
0000
0101
1011
1110

In this book’s playground, q0 is the control and q1 the target. CX preserves q0 and flips q1 only on the branch where q0 is 1.

For a superposed control, linearity applies the operation to both components coherently:

∣00⟩+∣10⟩2⟼∣00⟩+∣11⟩2.\frac{\lvert00\rangle+\lvert10\rangle}{\sqrt2} \longmapsto\frac{\lvert00\rangle+\lvert11\rangle}{\sqrt2}.

This creates entanglement for that input. CX does not entangle every input: ∣00⟩\lvert00\rangle remains a product state, and a target in ∣+⟩\lvert+\rangle is unchanged by X.

Applying the same CX twice restores the input because XOR with the same control twice cancels. The gate is unitary and self-inverse.

Practice: prepare H on q1 only, then CX. Predict the four amplitudes. Compare it with H on q0 followed by CX. The difference is a useful way to catch swapped control and target conventions.

Reference: IBM Quantum — Multiple systems.

ONE IDEA FURTHER

Ready for the next step?

Your progress stays in this browser.