Day 8 — Official Sample Gaps
Math Prep
Solve this BEFORE lesson.md. Day 8 is the sample test + gap day; the concept questions that surface there assume "quantum literacy": you can recognize the classic algorithms and say why they work in two sentences of math. This prep gives exactly that layer.
Requires: Days 1–7 math prep. Video back-up: Watrous Lessons 04–08 (entanglement protocols, query algorithms, QFT/QPE, Grover); notes in resource-artifactory/notes/video-notes/.
1. Phase kickback — the engine of everything
Let (eigenvector with eigenphase φ). Then controlled- with control in superposition:
The target is untouched; the phase lands on the control. Special case used by oracles: , so a CNOT targeting flips the control's phase:
This turns a function into a phase oracle — the trick inside Deutsch–Jozsa, Bernstein–Vazirani, and Grover.
2. The Hadamard sandwich
Hadamards create the uniform superposition; a second layer converts phases back to bits:
( = parity of shared 1-bits.)
Deutsch–Jozsa (f promised constant or balanced): H-layer → phase oracle → H-layer → measure. Amplitude of at the end: = ±1 if constant, 0 if balanced. So: all-zeros ⇒ constant, anything else ⇒ balanced. 1 query vs classical (deterministic).
Bernstein–Vazirani (): same circuit; the interference maps the phase pattern straight to . One query reads the whole hidden string.
3. Grover — amplitude amplification you can compute
Search space items, marked. Geometry: the state stays in a 2-D plane spanned by "marked" and "unmarked" superpositions; one Grover iteration (phase oracle + diffusion ) rotates by where .
Quadratic speedup: vs classical . Overshooting is real: past the success probability decreases (keeps rotating). For : , ONE iteration gives — exact.
4. QFT and phase estimation — reading phases as numbers
It's the unitary DFT matrix (); circuit = H's + controlled phases, gates.
Phase estimation (QPE): given , use control qubits running controlled- (kickback writes φ's binary digits into phases), then inverse QFT turns those phases into the bitstring of (binary fraction). Exact when φ has an -bit binary expansion; otherwise concentrated near it. QPE + modular arithmetic = order finding = the quantum core of Shor's algorithm (period of ⇒ factors via ) — exponential speedup over known classical factoring.
5. Teleportation & superdense coding — entanglement as a resource
Teleportation: move an unknown using 1 shared Bell pair + 2 classical bits. Sender: CNOT then H then measure both qubits → 2 bits ; receiver applies . Why it works: rewriting in the Bell basis of the sender's two qubits shows the receiver's qubit already holds up to one of the four Pauli corrections . No cloning (original is measured away), no faster-than-light signaling (useless without the classical bits).
Superdense coding: the reverse trade — 1 Bell pair + sending 1 qubit transmits 2 classical bits. Encoder applies one of to their half; the four results are the four orthogonal Bell states, distinguished by the decoder's CNOT+H measurement.
No-cloning theorem: no unitary maps for all — cloning isn't linear (proof in P7).
6. Speedup scoreboard (recognition table)
| Algorithm | Problem | Quantum | Classical | Speedup |
|---|---|---|---|---|
| Deutsch–Jozsa | constant vs balanced | 1 query | exponential (vs deterministic) | |
| Bernstein–Vazirani | hidden dot-product string | 1 query | polynomial | |
| Simon | hidden XOR period | exponential | ||
| Grover | unstructured search | quadratic | ||
| Shor | factoring | poly | sub-exponential | (believed) exponential |
PROBLEMS
P1. Show the kickback identity: apply CNOT with control , target ; write the output as (control state) ⊗ (target state).
P2. Deutsch's problem (): run H → phase oracle → H on the input qubit. Compute the final state for and for constant . What does measuring tell you?
P3. Grover with : give θ, the optimal iteration count, and the success probability after 1 and 2 iterations.
P4. In Grover, what happens to the success probability if you run iterations instead of (qualitatively, from the rotation picture)?
P5. QPE with 3 counting qubits on with eigenphase : which bitstring do you measure (with certainty)? Why is it certain here?
P6. In teleportation, the sender's measurement returns . The receiver's qubit currently holds where the target was . Verify the prescribed correction fixes it.
P7. Use linearity to prove no-cloning: assume and , and compute . Compare with .
P8. Which algorithm does the circuit "H's on all qubits → oracle → H's on all qubits → measure; promised constant-or-balanced" implement, and what does outcome '000' mean?
ANSWERS
A1. . CNOT: the -branch applies X to giving . Output . The control flipped ; the target never changed. ∎
A2. State after the oracle: (times the idle ). For : . For : . Measurement: 0 ⇒ constant, 1 ⇒ balanced — one query decides what classically needs two.
A3. rad. . ; .
A4. The state rotates past the marked axis — success probability comes back DOWN. Grover is not "more iterations = better"; it's periodic in .
A5. — exactly 3 bits ⇒ QPE is exact ⇒ measure '101' with probability 1. Certainty holds precisely because is an integer.
A6. Correction for is . . ✓
A7. — a Bell state. Cloning demands . Different states ⇒ no unitary clones all inputs. (What actually is — CNOT — is how we entangle instead of clone.)
A8. Deutsch–Jozsa. '000' (all zeros) ⇒ is constant; any other outcome ⇒ balanced.
Self-check: you can derive kickback in two lines, run DJ on by hand, compute Grover's θ and for any N, state what QPE outputs, and reproduce the teleportation correction table .