Checkpoint: Run BB84
This checkpoint ties the protocol together: you will simulate two sifted BB84 rounds — rounds where Alice and Bob already chose the same basis — and watch Bob deterministically recover Alice's bits. It is the operational core of BB84: matched bases ⇒ perfect agreement.
Setup
You build a 2-qubit circuit, one qubit per round:
- Round A (qubit 0). Alice encodes the bit in the diagonal () basis, i.e. she prepares . Bob, having sifted to the same basis, measures in .
- Round B (qubit 1). Alice encodes the bit in the rectilinear () basis, i.e. she prepares . Bob measures in .
Measuring in a rotated basis
The simulator measures in the computational () basis. To realize an -basis measurement, you first rotate the diagonal basis onto the computational one with a Hadamard, then measure:
So Bob's -basis measurement of qubit 0 is "apply , then read ." On round A the qubit's life is , so Bob reads — exactly Alice's bit. On round B nothing rotates: measured in reads .
What the grader checks
Both rounds are deterministic when the bases match, so the joint outcome is the single basis state
10 (qubit 0 , qubit 1 ) with probability :
Bob's sifted key 1,0 equals Alice's transmitted bits 1,0. That perfect agreement on sifted rounds
is what makes the key usable — and any deviation from it (the QBER) is exactly the eavesdropping
signal you studied earlier. You have now run, end to end, the quantum heart of BB84.
Sign in on the full site to ask questions and join the discussion.