QuantumCore

Hands-on lab · 1 step

Send the message 11 with one qubit

Alice (qubit 00) and Bob (qubit 11) share ∣Φ+⟩=12(∣00⟩+∣11⟩)\lvert\Phi^+\rangle=\tfrac1{\sqrt2}(\lvert00\rangle+\lvert11\rangle), prepared by a locked H(0); CNOT(0,1)H(0);\ \mathrm{CNOT}(0,1). Encode the two-bit message b1b2=11b_1b_2=11 with Pauli gates on Alice's qubit only, then decode with the inverse Bell circuit (H⊗I) CNOT(H\otimes I)\,\mathrm{CNOT} so that the register ends in ∣11⟩\lvert11\rangle. The grader checks the joint distribution and each bit separately, so it can tell which of the two bits went wrong.

0/1 step passedBest score 0/100

Step 1: Encode 11 on Alice’s qubit and decode it

The first two operations, HH on qubit 00 and CNOT\mathrm{CNOT} with control 00 and target 11, are locked: they create the shared pair ∣Φ+⟩=12(∣00⟩+∣11⟩)=12(1,0,0,1)T,\lvert\Phi^+\rangle=\tfrac1{\sqrt2}\big(\lvert00\rangle+\lvert11\rangle\big)=\tfrac1{\sqrt2}(1,0,0,1)^T, with qubit 00 (Alice, the most significant bit) and qubit 11 (Bob). Append at most four gates from {X,Z,CNOT,H}\{X,Z,\mathrm{CNOT},H\}, no measurements:

  1. Encode the message b1b2=11b_1b_2=11 by applying Zb1Xb2Z^{b_1}X^{b_2} to Alice's qubit 00, i.e. XX and then ZZ on qubit 00. Alice may only act on her own qubit; qubit 11 accepts nothing except the decoding CNOT\mathrm{CNOT}.
  2. Decode with (H⊗I) CNOT0→1(H\otimes I)\,\mathrm{CNOT}_{0\to1}: first CNOT\mathrm{CNOT} with control 00 and target 11, then HH on qubit 00. This is B†B^\dagger for the Bell circuit B=CNOT(H⊗I)B=\mathrm{CNOT}(H\otimes I).

At most one two-qubit gate may follow the locked prefix. Three checks are run, all with tolerance 10−610^{-6}: decoded-11 compares (p00,p01,p10,p11)(p_{00},p_{01},p_{10},p_{11}) with (0,0,0,1)(0,0,0,1); first-bit compares the marginal of qubit 00 with (p0,p1)=(0,1)(p_0,p_1)=(0,1); second-bit compares the marginal of qubit 11 with (0,1)(0,1).

  • 2 qubits
  • allowed gates: X, Z, CNOT, H
  • at most 4 gates
  • at most 1 two-qubit gate
  • no measurements
  • first 2 ops locked
  • qubit 1: only CNOT

Locked prefix (always applied first)

H(0); CNOT(0,1)

One gate per line or separated by ;, e.g. H(0); CNOT(0,1); RY(1, pi/3); measure(1 -> 0). Qubit 0 is the top wire (most significant bit); controls come first. # starts a comment.

Measure into a classical bit with measure(q -> c); apply a gate only when a bit is set with X(2) if c1==1 (several bits, first = most significant: if c[0,1]==3).

Circuit diagram of your answerH on q0; X on q1 controlled by q0q0q1H
Statevector amplitudes
BasisAmplitude α|α|Phase arg αProbability
|00⟩0.7071
0.7071
0
50.00%
|11⟩0.7071
0.7071
0
50.00%
2 basis states with zero amplitude hidden