QubitLab
IDELearnPlaygroundDocsCommunity
Log in
QubitLab
IDELearnPlaygroundDocsCommunity
Log in
QubitLab
IDELearnPlaygroundDocsCommunity
Log in
HomeLearnCatalogRanksPlaygroundDocs
05 · Phase Kickback: The Algorithm Secret0%

You are reading without signing in. Sign in or continue as guest to take quizzes and climb the ranks.

Learn/QC 102Gates and Circuits·Lesson 5 of 7

Phase Kickback: The Algorithm Secret

How a CNOT can change its own control: a target in |−⟩ sends a phase back, the trick inside every oracle and phase estimation.

Intermediate12 min read8 sections · 2 questions+45
By the end you will be able to
  1. 01Show that X leaves |−⟩ unchanged except for a sign.
  2. 02Follow a CNOT with the control in |+⟩ and the target in |−⟩, and find the control in |−⟩ afterwards.
  3. 03Name where phase kickback is used: Deutsch–Jozsa, Grover's oracle and phase estimation.

In a classical circuit information flows one way: the control is read, the target is written. On basis states a CNOT looks exactly like that, |c t⟩ → |c, t⊕c⟩. Prepare the target in the right superposition, though, and the effect lands on the control instead, while the target stays as it was.

01The key fact: X only flips the sign of |−⟩

X∣−⟩=X2​∣0⟩−∣1⟩​=2​∣1⟩−∣0⟩​=−∣−⟩
|−⟩ is an eigenstate of X with eigenvalue −1. Applying X to it changes nothing you could measure on the target; it only multiplies the state by −1.

02Kickback, step by step

CNOT∣+⟩c​∣−⟩t​=2​1​(∣0⟩c​∣−⟩t​+∣1⟩c​X∣−⟩t​)=2​1​(∣0⟩−∣1⟩)c​∣−⟩t​=∣−⟩c​∣−⟩t​
When the control is 0 nothing happens; when it is 1 the branch picks up −1. A sign on that branch is the same as a sign on the control's |1⟩: the phase has been kicked back, and the control turns from |+⟩ into |−⟩. The two qubits stay unentangled.

Measuring the control right away still gives 50/50, because |+⟩ and |−⟩ have the same probabilities. A final H turns the hidden sign into a bit: H|−⟩ = |1⟩, so the control reads 1 in every shot. With the target in |0⟩ instead, the same CNOT makes a Bell pair and the final H gives 50/50.

Hands-on

Read the kicked phase

q[1] is prepared in |−⟩ (x then h), q[0] in |+⟩. Simulate: the control reads 1 in every shot. Delete the x q[1] line so the target starts in |+⟩ (eigenvalue +1): nothing is kicked back and the control reads 0 every time.

OpenQASM 3
OPENQASM 3.0;
include "stdgates.inc";
qubit[2] q;
bit[1] c;
x q[1];
h q[1];
h q[0];
cx q[0], q[1];
h q[0];
c[0] = measure q[0];
Sign in to run (nothing is saved)
Open in the IDE Open in the Playground
Hands-on

Watch the control move

The Debug tab opens with the circuit. Press Debug, then the Step over button (the arrow) one gate at a time. Before the CX the control's Bloch arrow points along +X; after it, along −X. The target's arrow does not move, and both arrows keep full length: no entanglement, just a phase.

OpenQASM 3
OPENQASM 3.0;
include "stdgates.inc";
qubit[2] q;
x q[1];
h q[1];
h q[0];
cx q[0], q[1];
Sign in to run (nothing is saved)
Open in the IDE Open in the Playground

03Why algorithms need it

  • Deutsch–Jozsa and Bernstein–Vazirani: the oracle flips a helper qubit in |−⟩ whenever f(x) = 1, so f(x) becomes a sign (−1)^f(x) on the input register. Hadamards then turn those signs into the answer.
  • Grover: the oracle marks the solution with a minus sign in the same way; the diffusion step turns that sign into a larger amplitude.
  • Phase estimation, and with it Shor: a controlled-U acting on an eigenstate of U kicks the eigenvalue's phase back onto the control qubits, where the inverse QFT reads it out.
Knowledge check

2 questions · one try each counts

Question 1

Control in |+⟩, target in |−⟩, then a CNOT. What is the control's state afterwards?

Sign in to answer and climb the ranks; you will come back to this lesson.

Question 2

Same circuit, but the target starts in |0⟩: H on the control, CNOT, H on the control, measure the control. What do you see?

Sign in to answer and climb the ranks; you will come back to this lesson.

Key takeaway

If the target is an eigenstate of the controlled gate, the target does not change and the eigenvalue becomes a phase on the control. A |−⟩ target turns a CNOT into a sign flip on the control: that is how oracles write answers into phases.

Finished reading?

Knowledge check: 2 questions waiting above. Questions are optional. Mark it complete, or press Next: moving on marks it complete too.

Up next
Lesson 6 · 10 min
Reading a circuit: depth, width and cost
Columns, layers, depth, two-qubit count: the numbers QubitLab shows and why they predict hardware results.
Further reading
  • Docs: CNOT and controlled gates
More in Gates and Circuits
  • Pauli gates: X, Y, Z
  • Phase and rotation gates
  • Two-qubit gates: CNOT, CZ, SWAP
Entanglement and the Bell statesReading a circuit: depth, width and cost
In this lesson0%
  1. Introduction
  2. The key fact: X only flips the sign of |−⟩
  3. Kickback, step by step
  4. Try it: Read the kicked phase
  5. Try it: Watch the control move
  6. Why algorithms need it
  7. Knowledge check
  8. Key takeaway
QubitLab
IDELearnPlaygroundDocsCommunity
Log in
QubitLab
IDELearnPlaygroundDocsCommunity
Log in