QuantumCore

Hands-on lab · 2 steps

Prepare the W state and measure its entanglement

The three-qubit W state ∣W3⟩=13(∣001⟩+∣010⟩+∣100⟩)\lvert W_3\rangle=\tfrac1{\sqrt3}(\lvert001\rangle+\lvert010\rangle+\lvert100\rangle) has bond dimension χ=2\chi=2 at both cuts, so a short sequential circuit prepares it. In the first step you build such a circuit from RYR_Y, XX, controlled-RYR_Y and CNOT gates. In the second step you compute the entanglement entropy of one qubit from its Schmidt spectrum.

0/2 steps passedBest score 0/100

Step 1: Prepare |W₃⟩ with at most 8 gates

Starting from ∣000⟩\lvert000\rangle, build a circuit that outputs ∣W3⟩=13(∣001⟩+∣010⟩+∣100⟩).\lvert W_3\rangle=\frac1{\sqrt3}\big(\lvert001\rangle+\lvert010\rangle+\lvert100\rangle\big). Qubit 00 is the leftmost (most significant) bit, RY(α)=e−iαY/2R_Y(\alpha)=e^{-i\alpha Y/2}, so RY(α)∣0⟩=cos⁡α2∣0⟩+sin⁡α2∣1⟩R_Y(\alpha)\lvert0\rangle=\cos\frac\alpha2\lvert0\rangle+\sin\frac\alpha2\lvert1\rangle, and CRY(c,t,α)\mathrm{CRY}(c,t,\alpha) applies RY(α)R_Y(\alpha) to qubit tt when qubit cc is ∣1⟩\lvert1\rangle. Allowed gates: RYR_Y, XX, CRY\mathrm{CRY} and CNOT\mathrm{CNOT}, at most 88 gates in total. The grader requires the fidelity F=∣⟨W3∣ψ⟩∣2≥1−10−6F=\lvert\langle W_3\vert\psi\rangle\rvert^2\ge1-10^{-6}.

A workable plan, following the sequential construction of the lesson: (1) put the amplitudes 2/3\sqrt{2/3} and 1/3\sqrt{1/3} on qubit 00; (2) split the weight-23\tfrac23 branch evenly with one controlled rotation onto qubit 11, so that qubits 0,10,1 hold 13(∣00⟩+∣01⟩+∣10⟩)\tfrac1{\sqrt3}(\lvert00\rangle+\lvert01\rangle+\lvert10\rangle); (3) write the missing bit into qubit 22.

  • 3 qubits
  • allowed gates: RY, X, CRY, CNOT
  • at most 8 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 circuitq0q1q2
Statevector amplitudes
BasisAmplitude α|α|Phase arg αProbability
|000⟩1
1.0000
0
100.00%
7 basis states with zero amplitude hidden

Step 2: Entanglement entropy of one qubit of |W₃⟩

Let ρ0=Tr12∣W3⟩⟨W3∣\rho_0=\mathrm{Tr}_{12}\lvert W_3\rangle\langle W_3\rvert be the reduced state of qubit 00. Compute its von Neumann entropy S(ρ0)=−Tr ρ0log⁡2ρ0=−∑αλα2log⁡2λα2,S(\rho_0)=-\mathrm{Tr}\,\rho_0\log_2\rho_0=-\sum_\alpha\lambda_\alpha^2\log_2\lambda_\alpha^2, where λα\lambda_\alpha are the Schmidt coefficients of ∣W3⟩\lvert W_3\rangle across the cut between qubit 00 and qubits 1,21,2. Give the value in bits (log⁡2\log_2). The grader accepts an absolute error of 10−310^{-3}.

Enter exact expressions or decimals, e.g. 1/sqrt(2), pi/3. Values must be real.

enter a value
Fill every field with a valid expression.