QuantumCore

Hands-on lab · 1 step

Build the product state |+⟩ ⊗ |1⟩

Use single-qubit gates only to prepare ∣+⟩⊗∣1⟩=12(∣01⟩+∣11⟩)\lvert+\rangle\otimes\lvert1\rangle=\tfrac{1}{\sqrt2}(\lvert01\rangle+\lvert11\rangle) on two qubits, and see why the Kronecker order (qubit 00 is the left factor) decides which qubit gets which gate.

0/1 step passedBest score 0/100

Step 1: Prepare |+⟩ ⊗ |1⟩

Starting from ∣00⟩=∣0⟩⊗∣0⟩\lvert00\rangle=\lvert0\rangle\otimes\lvert0\rangle, prepare

∣ψ⟩=∣+⟩⊗∣1⟩=12(11)⊗(01)=12(1⋅01⋅11⋅01⋅1)=12(0101)=12(∣01⟩+∣11⟩).\lvert\psi\rangle=\lvert+\rangle\otimes\lvert1\rangle=\frac{1}{\sqrt2}\begin{pmatrix}1\\1\end{pmatrix}\otimes\begin{pmatrix}0\\1\end{pmatrix}=\frac{1}{\sqrt2}\begin{pmatrix}1\cdot0\\1\cdot1\\1\cdot0\\1\cdot1\end{pmatrix}=\frac{1}{\sqrt2}\begin{pmatrix}0\\1\\0\\1\end{pmatrix}=\frac{1}{\sqrt2}\big(\lvert01\rangle+\lvert11\rangle\big).

Convention: qubit 00 is the most significant bit, i.e. the left tensor factor, so basis state ∣q0q1⟩\lvert q_0q_1\rangle has index 2q0+q12q_0+q_1 and a gate AA on qubit 00 with BB on qubit 11 acts as A⊗BA\otimes B.

Allowed gates: H,X,Y,ZH, X, Y, Z (single-qubit only, at most 44 gates, no two-qubit gates). The grader requires fidelity ∣⟨ψtarget∣ψ⟩∣2≥1−10−6\lvert\langle\psi_{\text{target}}\vert\psi\rangle\rvert^2\ge1-10^{-6}.

  • 2 qubits
  • allowed gates: H, X, Y, Z
  • at most 4 gates
  • at most 0 two-qubit 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