QuantumCore

Hands-on lab · 1 step

Prepare exactly |−⟩ (global phase included)

Prepare the exact vector 12(1,−1)T\tfrac{1}{\sqrt2}(1,-1)^T from ∣0⟩\lvert0\rangle. Physically eiγ∣−⟩e^{i\gamma}\lvert-\rangle is the same state, but this lab compares vectors component by component, so the global phase must be γ=0\gamma=0.

0/1 step passedBest score 0/100

Step 1: Build the exact minus state

Starting from ∣0⟩\lvert0\rangle, use at most three gates from {X,Y,Z,H}\{X, Y, Z, H\} to prepare exactly

∣ψ⟩=12(1−1)=12(∣0⟩−∣1⟩)=∣−⟩.\lvert\psi\rangle=\frac{1}{\sqrt2}\begin{pmatrix}1\\-1\end{pmatrix}=\frac{1}{\sqrt2}\big(\lvert0\rangle-\lvert1\rangle\big)=\lvert-\rangle .

This lab is intentionally phase-sensitive: the grader requires ∥ψyours−ψtarget∥2≤10−6\lVert\psi_{\text{yours}}-\psi_{\text{target}}\rVert_2\le10^{-6}, so a state eiγ∣−⟩e^{i\gamma}\lvert-\rangle with γ≠0\gamma\neq0 fails even though Postulate 1 says it describes the same physical state (same ray).

  • 1 qubit
  • allowed gates: X, H, Z, Y
  • at most 3 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 circuitq0
Statevector amplitudes
BasisAmplitude α|α|Phase arg αProbability
|0⟩1
1.0000
0
100.00%
1 basis state with zero amplitude hidden