Bloch Sphere Simulator: Visualize Qubit Quantum States

simulator intermediate ~10 min
Loading simulation...
P(|0⟩) = 0.75 — biased toward |0⟩

At θ=60°, the qubit has a 75% chance of being measured as |0⟩ and 25% as |1⟩, with the azimuthal angle φ=45° setting the relative phase between components.

Formula

|ψ⟩ = cos(θ/2)|0⟩ + e^{iφ} sin(θ/2)|1⟩
P(|0⟩) = cos²(θ/2), P(|1⟩) = sin²(θ/2)
⟨Z⟩ = cos(θ), ⟨X⟩ = sin(θ)cos(φ), ⟨Y⟩ = sin(θ)sin(φ)

The Geometry of a Qubit

A classical bit is either 0 or 1. A qubit can be any point on the surface of a unit sphere — the Bloch sphere, named after physicist Felix Bloch. The north pole represents |0⟩, the south pole represents |1⟩, and every other point is a superposition of both. This geometric picture makes it intuitive to understand how quantum gates work: each gate is simply a rotation of the state vector on this sphere.

Angles and Amplitudes

The polar angle θ (theta) determines the measurement probabilities: cos²(θ/2) for |0⟩ and sin²(θ/2) for |1⟩. At θ=0 (north pole), you always measure |0⟩; at θ=π (south pole), always |1⟩; at θ=π/2 (equator), it's a perfect coin flip. The azimuthal angle φ (phi) controls the relative phase between the |0⟩ and |1⟩ components — invisible in Z measurements but critical for interference effects and X/Y measurements.

Decoherence and the Shrinking Sphere

Real qubits interact with their environment, causing decoherence. The T₂ time quantifies how long the phase relationship persists. As decoherence progresses, the Bloch vector shrinks from the surface toward the center, representing a mixed state. Superconducting qubits achieve T₂ times of 50–200 µs, while trapped ions can reach milliseconds. Every quantum algorithm must complete within this coherence window.

From Sphere to Quantum Gates

Each single-qubit quantum gate maps to a specific rotation on the Bloch sphere. The Pauli-X gate rotates 180° around the X-axis (equivalent to a classical NOT). The Hadamard gate takes |0⟩ to the equator, creating equal superposition. By composing rotations around different axes, any single-qubit unitary transformation can be achieved — this is the foundation of universal quantum computation.

FAQ

What is the Bloch sphere?

The Bloch sphere is a geometric representation of a single qubit's pure state. The north pole represents |0⟩, the south pole |1⟩, and every point on the surface corresponds to a unique superposition. The polar angle θ controls the measurement probabilities, while the azimuthal angle φ sets the relative phase.

How do qubit measurement probabilities relate to the Bloch sphere?

The probability of measuring |0⟩ equals cos²(θ/2) and |1⟩ equals sin²(θ/2). Points on the equator give 50/50 odds. The azimuthal angle doesn't affect Z-measurement probabilities but matters for X and Y measurements.

What is quantum decoherence?

Decoherence is the process by which a qubit loses its quantum properties through interaction with the environment. The T₂ time measures how long the phase coherence persists. Longer T₂ means the qubit can maintain superposition states for more gate operations.

Why is the Bloch sphere important for quantum computing?

Every single-qubit gate corresponds to a rotation on the Bloch sphere. An X gate rotates 180° around the X-axis (bit flip), a Z gate rotates around the Z-axis (phase flip), and the Hadamard gate rotates from pole to equator. Understanding the geometry helps design gate sequences.

Sources

Embed

<iframe src="https://homo-deus.com/lab/quantum-computing/qubit-bloch-sphere/embed" width="100%" height="400" frameborder="0"></iframe>
View source on GitHub