QuantumCore

Hands-on lab · 2 steps

Hit the target on the Bloch sphere

Place the state ∣+i⟩=12(∣0⟩+i∣1⟩)\lvert{+i}\rangle=\tfrac1{\sqrt2}(\lvert0\rangle+i\lvert1\rangle) on the Bloch sphere, first by choosing (θ,ϕ)(\theta,\phi) directly and then by preparing it from ∣0⟩\lvert0\rangle with at most two gates from {H,S}\{H,S\}.

0/2 steps passedBest score 0/100

Step 1: Set the angles

Use the θ\theta and ϕ\phi sliders to set the state to ∣+i⟩=12(∣0⟩+i∣1⟩)\lvert{+i}\rangle=\tfrac1{\sqrt2}(\lvert0\rangle+i\lvert1\rangle). Recall ∣ψ⟩=cos⁡θ2∣0⟩+eiϕsin⁡θ2∣1⟩\lvert\psi\rangle=\cos\tfrac\theta2\lvert0\rangle+e^{i\phi}\sin\tfrac\theta2\lvert1\rangle and r⃗=(sin⁡θcos⁡ϕ,sin⁡θsin⁡ϕ,cos⁡θ)\vec r=(\sin\theta\cos\phi,\sin\theta\sin\phi,\cos\theta); the target Bloch vector is (0,1,0)(0,1,0).

3D view unavailable (WebGL is not supported in this browser). The Bloch coordinates of the state are listed in the readout.
0.000 (0)
0.000 (0)
∣ψ⟩=cos⁡0.0002 ∣0⟩+ei 0.000sin⁡0.0002 ∣1⟩=1.000 ∣0⟩\lvert\psi\rangle = \cos\tfrac{0.000}{2}\,\lvert 0\rangle + e^{i\,0.000}\sin\tfrac{0.000}{2}\,\lvert 1\rangle = 1.000\,\lvert 0\rangle

Bloch vector r = (0.000, 0.000, 1.000), |r| = 1.000; P(0) = 1.000, P(1) = 0.000

θ = 0.0000 rad, φ = 0.0000 rad

Step 2: Prepare it with H and S

Starting from ∣0⟩\lvert0\rangle, prepare ∣+i⟩\lvert{+i}\rangle using only the gates H=12(111−1)H=\tfrac1{\sqrt2}\begin{pmatrix}1&1\\1&-1\end{pmatrix} and S=(100i)S=\begin{pmatrix}1&0\\0&i\end{pmatrix}, at most two gates in total.

  • 1 qubit
  • allowed gates: H, S
  • at most 2 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