|q⟩ Bad Qubits

advanced · Programming · Distributed & Networked Quantum Computing

Checkpoint: A Two-Node Protocol

This checkpoint brings the module together. You will build a complete one-hop quantum repeater: two independently prepared Bell pairs, a Bell-state measurement at the repeater, and feed-forward corrections that leave the two end nodes — Alice and Bob — sharing a Bell pair they could never have established directly.

The protocol, end to end

Lay out the register as Alice =q0= q_0, repeater =q1,q2= q_1, q_2, Bob =q3= q_3.

  1. Two elementary links. Create Φ+q0q1|\Phi^+\rangle_{q_0 q_1} and Φ+q2q3|\Phi^+\rangle_{q_2 q_3}. At this point Alice is entangled only with the repeater's q1q_1, and Bob only with q2q_2.
  2. Bell-state measurement. The repeater jointly measures q1,q2q_1, q_2 in the Bell basis — the inverse of the entangler: CNOTq1q2\mathrm{CNOT}_{q_1\to q_2} then HH on q1q_1, then read both out. This consumes the repeater qubits and projects q0,q3q_0, q_3 into a Bell state.
  3. Feed-forward. The two measurement bits determine which Bell state q0,q3q_0, q_3 share. Bob applies Xmq2Zmq1X^{m_{q_2}} Z^{m_{q_1}} to standardise on Φ+|\Phi^+\rangle. In circuit form (deferred measurement), this is CNOTq2q3\mathrm{CNOT}_{q_2\to q_3} followed by CZq1q3\mathrm{CZ}_{q_1\to q_3}.

What "success" means

A correct swap leaves Alice and Bob perfectly correlated: a computational-basis readout never finds q0q3q_0 \neq q_3. The repeater qubits, having been measured, come out uniformly random and carry no remaining link to the data. The grader checks three things:

Why this is the whole module in miniature

Every primitive you studied appears here: a Bell pair is the resource, a Bell-state measurement is the swap engine, classical feed-forward fixes the Pauli frame, and the result is the extended entanglement a repeater chains to reach across a continent. Get this two-node protocol right and you have, in essence, written the inner loop of a quantum internet.

Try it

Implement the full swap and measure. Make all three grader checks pass.

Run your code to see the quantum state.

When it succeeds, every populated bar in the Probabilities tab has matching first and last bits — Alice and Bob, never directly connected, now share a Bell pair through the repeater.

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