QuantumCore

Hands-on lab · 2 steps

Teleport a qubit

Teleport the state ∣ψ⟩=RZ(0.6)RY(1.1)∣0⟩≃cos⁡0.55 ∣0⟩+e0.6isin⁡0.55 ∣1⟩\lvert\psi\rangle=R_Z(0.6)R_Y(1.1)\lvert0\rangle\simeq\cos0.55\,\lvert0\rangle+e^{0.6i}\sin0.55\,\lvert1\rangle from Alice's qubit 00 to Bob's qubit 22 through the pre-shared pair ∣Φ+⟩12\lvert\Phi^+\rangle_{12}. First implement the protocol with the corrections moved before measurement (principle of deferred measurement), then with real mid-circuit measurements and classically conditioned corrections. The grader compares Bob's reduced density matrix with σ=∣ψ⟩⟨ψ∣\sigma=\lvert\psi\rangle\langle\psi\rvert in trace distance.

0/2 steps passedBest score 0/100

Step 1: Teleportation with deferred measurement

The first four operations are locked: RY(1.1)R_Y(1.1) and RZ(0.6)R_Z(0.6) on qubit 00 prepare e−0.3i∣ψ⟩e^{-0.3i}\lvert\psi\rangle, and H1H_1, CNOT1→2\mathrm{CNOT}_{1\to2} prepare the shared pair ∣Φ+⟩12=12(∣00⟩+∣11⟩)\lvert\Phi^+\rangle_{12}=\tfrac1{\sqrt2}(\lvert00\rangle+\lvert11\rangle). Qubit 00 is the most significant bit. Append at most four gates from {H,CNOT,CZ,X,Z}\{H,\mathrm{CNOT},\mathrm{CZ},X,Z\}, at most three of them two-qubit gates, and no measurements, so that Bob's qubit 22 ends in ∣ψ⟩\lvert\psi\rangle. The target is σ=(cos⁡20.55cos⁡0.55sin⁡0.55 e−0.6icos⁡0.55sin⁡0.55 e0.6isin⁡20.55).\sigma=\begin{pmatrix}\cos^2 0.55 & \cos0.55\sin0.55\,e^{-0.6i}\\ \cos0.55\sin0.55\,e^{0.6i} & \sin^2 0.55\end{pmatrix}. Two checks are run. bob-state computes ρ2=Tr01∣Ψ⟩⟨Ψ∣\rho_2=\mathrm{Tr}_{01}\lvert\Psi\rangle\langle\Psi\rvert and passes when T(ρ2,σ)=12∥ρ2−σ∥1≤10−6T(\rho_2,\sigma)=\tfrac12\lVert\rho_2-\sigma\rVert_1\le10^{-6}. alice-register computes ρ01=Tr2∣Ψ⟩⟨Ψ∣\rho_{01}=\mathrm{Tr}_2\lvert\Psi\rangle\langle\Psi\rvert and passes when it is within 10−610^{-6} of ∣++⟩⟨++∣\lvert{+}{+}\rangle\langle{+}{+}\rvert (every entry 14\tfrac14), the state the deferred protocol leaves on Alice's side.

  • 3 qubits
  • allowed gates: H, CNOT, CZ, X, Z
  • at most 4 gates
  • at most 3 two-qubit gates
  • no measurements
  • first 4 ops locked

Locked prefix (always applied first)

RY(0, 1.100000); RZ(0, 0.600000); H(1); CNOT(1,2)

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 answerRY(1.10) on q0; RZ(0.60) on q0; H on q1; X on q2 controlled by q1q0q1q2RY(1.10)RZ(0.60)H
Statevector amplitudes
BasisAmplitude α|α|Phase arg αProbability
|000⟩0.5759 − 0.1781i
0.6028
−0.0955π
36.34%
|011⟩0.5759 − 0.1781i
0.6028
−0.0955π
36.34%
|100⟩0.3531 + 0.1092i
0.3696
0.0955π
13.66%
|111⟩0.3531 + 0.1092i
0.3696
0.0955π
13.66%
4 basis states with zero amplitude hidden

Step 2: Teleportation with classical feed-forward

Same locked preparation, now with two classical bits c0,c1c_0,c_1. Alice measures qubit 00 into c0c_0 and qubit 11 into c1c_1; Bob may then apply XX and ZZ to qubit 22 only as classically conditioned gates (a gate with a condition such as "execute if c1=1c_1=1"). The budget is at most four gates from {H,CNOT,X,Z}\{H,\mathrm{CNOT},X,Z\}, measurements not counted, and at most one two-qubit gate, so the quantum-controlled corrections of the deferred step are no longer available; XX and ZZ must both appear. The grader evaluates the circuit on the density-matrix backend, which sums all four measurement branches exactly: ρ=∑m0,m1ρm0m1\rho=\sum_{m_0,m_1}\rho_{m_0m_1}. The check bob-state passes when T(Tr01ρ,σ)≤10−6T(\mathrm{Tr}_{01}\rho,\sigma)\le10^{-6}.

  • 3 qubits
  • allowed gates: H, CNOT, X, Z
  • at most 4 gates
  • at most 1 two-qubit gate
  • must use: X, Z
  • first 4 ops locked

Locked prefix (always applied first)

RY(0, 1.100000); RZ(0, 0.600000); H(1); CNOT(1,2)

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) (bits c0..c1); 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 answerRY(1.10) on q0; RZ(0.60) on q0; H on q1; X on q2 controlled by q1q0q1q2c0c1RY(1.10)RZ(0.60)H
Statevector amplitudes
BasisAmplitude α|α|Phase arg αProbability
|000⟩0.5759 − 0.1781i
0.6028
−0.0955π
36.34%
|011⟩0.5759 − 0.1781i
0.6028
−0.0955π
36.34%
|100⟩0.3531 + 0.1092i
0.3696
0.0955π
13.66%
|111⟩0.3531 + 0.1092i
0.3696
0.0955π
13.66%
4 basis states with zero amplitude hidden