Qubit Bloch Sphere Simulator: Quantum State Visualization & Gates

simulator intermediate ~10 min
Loading simulation...
|+> state — equal superposition on the equator

With theta=90 and phi=0, the qubit is in the |+> = (|0> + |1>)/sqrt(2) state, located on the equator of the Bloch sphere along the positive X axis. Both measurement outcomes are equally probable.

Formula

Qubit state: |psi> = cos(theta/2)|0> + e^(i phi) sin(theta/2)|1>
Bloch vector: r = (sin theta cos phi, sin theta sin phi, cos theta)
Hadamard: H = (1/sqrt(2))[[1,1],[1,-1]]
Measurement probabilities: P(|0>) = cos^2(theta/2), P(|1>) = sin^2(theta/2)

The Bloch Sphere

Every pure state of a single qubit can be visualized as a point on the surface of a unit sphere — the Bloch sphere. The state |psi> = cos(theta/2)|0> + e^(i phi)sin(theta/2)|1> maps to spherical coordinates (theta, phi), where theta is the polar angle from the north pole and phi is the azimuthal angle in the equatorial plane. This elegant representation transforms abstract quantum states into geometric intuition.

Key States

The north pole (theta=0) is |0>, the south pole (theta=180) is |1>. The equator (theta=90) contains all equal superpositions: |+> = (|0>+|1>)/sqrt(2) at phi=0, |-> = (|0>-|1>)/sqrt(2) at phi=180, and |i> = (|0>+i|1>)/sqrt(2) at phi=90. The polar angle theta determines the measurement probabilities: P(|0>) = cos^2(theta/2) and P(|1>) = sin^2(theta/2).

Quantum Gates as Rotations

Every single-qubit quantum gate corresponds to a rotation of the Bloch sphere. This simulator lets you apply four fundamental gates:

Probability Bars

The probability bars on the right show |alpha|^2 (probability of measuring |0>) and |beta|^2 (probability of measuring |1>) in real time. These always sum to 1. When the state is at the equator, both probabilities are 50%. As the state moves toward a pole, one probability approaches 1.

From One Qubit to Quantum Computing

While the Bloch sphere describes only a single qubit, it provides the foundation for understanding quantum computing. Multi-qubit systems exhibit entanglement — correlations that cannot be captured by individual Bloch spheres — but the single-qubit rotations visualized here remain the building blocks of all quantum circuits. The gate set {H, T, CNOT} is universal for quantum computation.

FAQ

What is the Bloch sphere?

The Bloch sphere is a geometric representation of a single qubit's pure state. Any qubit state |psi> = cos(theta/2)|0> + e^(i*phi)sin(theta/2)|1> maps to a point on a unit sphere, where theta is the polar angle and phi is the azimuthal angle. The north pole is |0>, the south pole is |1>, and the equator contains equal superpositions like |+> and |->.

What is a quantum gate?

A quantum gate is a unitary transformation that changes a qubit's state. On the Bloch sphere, every single-qubit gate corresponds to a rotation. The Hadamard gate (H) creates superpositions, Pauli-X is a bit flip (rotation by pi around X), Pauli-Z is a phase flip (rotation by pi around Z), and the T-gate adds a pi/4 phase (rotation by pi/4 around Z).

What does the Hadamard gate do?

The Hadamard gate H maps |0> to |+> = (|0>+|1>)/sqrt(2) and |1> to |-> = (|0>-|1>)/sqrt(2). On the Bloch sphere, it's a 180-degree rotation around the axis (X+Z)/sqrt(2). The Hadamard gate is the key to creating superpositions and is one of the most important gates in quantum computing.

Why is the Bloch sphere useful for quantum computing?

The Bloch sphere provides geometric intuition for quantum operations. Gate sequences become rotation compositions, quantum noise becomes sphere contraction (toward the center for mixed states), and measurement probabilities are read directly from the polar angle. It's invaluable for understanding single-qubit quantum circuits and error channels.

Sources

Embed

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