Lab
Bloch Sphere Playground
Interactive 3D visualization of qubit states and quantum gate operations.
Learn quantum computing fundamentals
What this is
An interactive 3D visualization of qubit states using the Bloch sphere representation. Watch how quantum gates rotate the state vector in real-time.
Key concepts
- Superposition: states between |0〉 and |1〉
- Phase: rotation around the Z axis
- Gates as rotations on the sphere
Bloch Sphere
Drag to rotate the view. The arrow shows the current qubit state.
Current State
Preset States
Gate History
Try this
- Start at |0⟩, then click H to land on the equator (50/50).
- Click S or T to spin the arrow around Z while probabilities stay 50/50.
- Click Measure to collapse the state to |0⟩ or |1⟩.
Quantum Gates
Apply gates to transform the qubit state. Each gate is a rotation on the Bloch sphere.
Pauli Gates (180° rotations)
Hadamard & Phase Gates
Custom Rotations
Gate Reference
Matrix representations and geometric interpretations of each gate.
180° rotation around X axis. Swaps |0⟩ ↔ |1⟩
180° rotation around Y axis. Combines bit and phase flip.
180° rotation around Z axis. Flips relative phase.
Creates superposition: |0⟩→|+⟩, |1⟩→|−⟩
90° rotation around Z axis. S² = Z
45° rotation around Z axis. T² = S
Understanding the Bloch Sphere
Qubit State Representation
Any pure qubit state can be written as:
Where θ (theta) is the polar angle from the +Z axis (0° to 180°), and φ (phi) is the azimuthal angle in the XY plane (0° to 360°).
Key Points on the Sphere
- |0⟩ — North pole (θ=0°)
- |1⟩ — South pole (θ=180°)
- |+⟩ — +X axis (θ=90°, φ=0°)
- |−⟩ — −X axis (θ=90°, φ=180°)
- |i⟩ — +Y axis (θ=90°, φ=90°)
- |−i⟩ — −Y axis (θ=90°, φ=270°)
Why It Matters
The Bloch sphere provides geometric intuition for quantum operations:
- • Single-qubit gates are rotations on the sphere
- • Measurement projects onto the Z axis
- • Opposite points are orthogonal states
- • Superposition = points not on the poles
Connection to Quantum Computing
Understanding the Bloch sphere is foundational for:
- • Designing quantum algorithms
- • Understanding gate decomposition
- • Visualizing quantum error correction
- • Grasping why Shor's algorithm breaks RSA
Keyboard shortcuts
- X Apply X gate
- Y Apply Y gate
- Z Apply Z gate
- H Apply Hadamard gate
- S Apply S gate
- T Apply T gate
- M Measure
- R Reset to |0⟩
- Arrow keys Rotate view
Security model (30 seconds)
This tool runs entirely in your browser. All quantum state calculations and rendering happen locally using JavaScript. No data is sent to any server. This is an educational simulation — it does not connect to real quantum hardware.