Bloch Sphere Visualizer
Bloch Sphere Visualizer
Move the angles θ and φ or apply gates, and watch the state vector move on a rotatable 3D Bloch sphereBloch Sphere: The Bloch sphere is a geometric representation of single-qubit states: pure states are points on the surface of a unit sphere, mixed states are points inside it, and sin…, with the corresponding equation updated live.
Experiment steps
- Move the θ slider from 0 to π and notice the vector moving from the north pole |0⟩ to the south pole |1⟩.
- Move φ and notice the rotation about the Z axis while the probabilities stay fixed.
- Drag the sphere with the mouse or the arrow keys to change the viewing angle.
- Apply H, S, T, Rx, Ry and Rz and see the rotation each gate represents.
The state $\cos\tfrac{\theta}{2}|0\rangle+e^{i\varphi}\sin\tfrac{\theta}{2}|1\rangle$ corresponds to the point $(\sin\theta\cos\varphi,\ \sin\theta\sin\varphi,\ \cos\theta)$. The global phase does not appear on the sphere.
Ready-made scenarios
Each scenario opens the simulator with specific settings; the simulator loads only when the scenario is opened.
Placing a State with Bloch Angles
The angles $\theta=60^\circ$ and $\phi=45^\circ$ define the state $\cos30^\circ|0\rangle+e^{i\pi/4}\sin30^\circ|1\rangle$ and the Bloch vector $(0.612,\,0.612,\,0.5)$.
Goal: Relate the angles $\theta,\phi$ to the amplitudes and to the Cartesian coordinates of the Bloch vector.
- Set $\theta=60^\circ$ and $\phi=45^\circ$.
- Read the vector $(x,y,z)$ and the two amplitudes.
- Change $\phi$ alone and note the vector rotating about the $z$ axis without $z$ changing.
- Set $\theta=90^\circ$ and compare with the state $|+\rangle$ at $\phi=0$.
Theory predicts the vector $(x,y,z)=(0.6124,\,0.6124,\,0.5)$ with length 1 (a pure state), and $P(0)=0.75$, $P(1)=0.25$. Changing $\phi$ keeps $z=0.5$ fixed.
Hadamard on the Bloch Sphere
The Hadamard gate moves the north pole $|0\rangle$ to the point $(1,0,0)$ on the equator, i.e. the state $|+\rangle$.
Goal: See the Hadamard gate as a rotation on the Bloch sphere.
- Start from $|0\rangle$ (the north pole).
- Apply H and watch the vector move.
- Apply H a second time.
- Start from $|1\rangle$ and repeat the steps.
Theory predicts that the vector moves from $(0,0,1)$ to $(1,0,0)$ after H, then returns to $(0,0,1)$ after a second H. From $|1\rangle$ it moves to $(-1,0,0)$.
Phase Gates S and T as Z-Rotations
The $S$ gate rotates $|+\rangle$ by $90^\circ$ about the $z$ axis to $(0,1,0)$, and the $T$ gate rotates it by $45^\circ$ to $(0.707,0.707,0)$.
Goal: Understand phase gates as rotations about the $z$ axis and verify $T^2=S$ and $S^2=Z$.
- Start from $|+\rangle$.
- Apply $S$ and record the vector.
- Start again, apply $T$ twice, and compare with the result of $S$.
- Apply $S$ twice and note that you reach $|-\rangle$.
Theory predicts $S|+\rangle\to(0,1,0)$, $T|+\rangle\to(0.7071,0.7071,0)$, $TT|+\rangle=S|+\rangle$, and $SS|+\rangle=|-\rangle\to(-1,0,0)$. In every case $P(0)=P(1)=0.5$.
Relaxation and Dephasing: T1 and T2
With noise $T_1=100$ and $T_2=60$, the Bloch vector of the state $|+\rangle$ shrinks inside the sphere: $x(t)=e^{-t/T_2}$ and $z(t)=1-e^{-t/T_1}$.
Goal: Watch how noise turns a pure state into a mixed state, and distinguish the effect of $T_1$ from that of $T_2$.
- Start from $|+\rangle$ (the vector $(1,0,0)$) and enable noise with $T_1=100$, $T_2=60$.
- Move time to $t=30$, then $t=60$, then $t=100$, and record $x$ and $z$.
- Note that the vector's length falls below 1.
- Repeat the experiment from $|1\rangle$ and note that $z$ moves towards $+1$, i.e. $|0\rangle$.
Theory predicts at $t=30$: $x\approx0.607$, $z\approx0.259$; at $t=60$: $x=e^{-1}\approx0.368$, $z\approx0.451$; and at $t=100$: $x\approx0.189$, $z\approx0.632$. As $t\to\infty$ the vector tends to $(0,0,1)$, i.e. $|0\rangle$.
Concepts this experiment explains
References
- Michael A. Nielsen; Isaac L. Chuang (2010). Quantum Computation and Quantum Information (10th Anniversary Edition). Cambridge University Press doi:10.1017/CBO9780511976667The standard reference for quantum computing; the Crossref record gives 2012 for the Cambridge Core online edition.
- Microsoft (2025). The Qubit in Quantum Computing. Azure Quantum documentation learn.microsoft.com
