QuantumCore

Hands-on lab · 1 step

Prepare the singlet state

Starting from ∣00⟩\lvert00\rangle, prepare the singlet ∣Ψ−⟩=12(∣01⟩−∣10⟩)\lvert\Psi^-\rangle=\tfrac1{\sqrt2}(\lvert01\rangle-\lvert10\rangle) with at most four gates from {H,X,Z,CNOT}\{H,X,Z,\mathrm{CNOT}\}. The grader checks the state fidelity and, separately, the perfectly anti-correlated measurement statistics, so it can tell a wrong relative sign from a wrong pair of basis states.

0/1 step passedBest score 0/100

Step 1: Prepare the singlet

Both qubits start in ∣0⟩\lvert0\rangle; qubit 00 is the most significant bit, so ∣ab⟩\lvert ab\rangle has qubit 00 in state ∣a⟩\lvert a\rangle. Build a circuit with at most four gates from HH, XX, ZZ and CNOT\mathrm{CNOT} (no measurements) whose output is ∣Ψ−⟩=12(∣01⟩−∣10⟩)=(0, 12, −12, 0)T.\lvert\Psi^-\rangle=\tfrac1{\sqrt2}\big(\lvert01\rangle-\lvert10\rangle\big)=\big(0,\ \tfrac1{\sqrt2},\ -\tfrac1{\sqrt2},\ 0\big)^T. Two checks are run. is-singlet computes F=∣⟨Ψ−∣ψ⟩∣2F=\lvert\langle\Psi^-\vert\psi\rangle\rvert^2 and passes when F≥1−10−6F\ge1-10^{-6}; a global phase does not change FF. anti-correlated compares the Born probabilities (p00,p01,p10,p11)(p_{00},p_{01},p_{10},p_{11}) with (0,12,12,0)(0,\tfrac12,\tfrac12,0) to within 10−610^{-6}; it passes for both ∣Ψ+⟩\lvert\Psi^+\rangle and ∣Ψ−⟩\lvert\Psi^-\rangle, because the two states differ only in the relative sign of ∣10⟩\lvert10\rangle.

  • 2 qubits
  • allowed gates: H, X, Z, CNOT
  • at most 4 gates
  • no measurements

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 answerEmpty circuitq0q1
Statevector amplitudes
BasisAmplitude α|α|Phase arg αProbability
|00⟩1
1.0000
0
100.00%
3 basis states with zero amplitude hidden