Picture This: Visualizing a Qubit on the Bloch Sphere
Project Overview:
A classical bit only has two possible states, a dot on a number line, 0 or 1. A qubit is far richer, it can point to any location on the surface of a 3D sphere called the Bloch sphere, with the north pole representing 0, the south pole representing 1, and every other point representing some mix of both, including all the superposition states you have been creating in earlier projects. In this project you will use Qiskit to actually generate and view the Bloch sphere for several different qubit states, turning an abstract idea into something you can literally see and rotate.
Materials Required:
A computer with internet access
A free Google account, to use Google Colab, no installation needed
Basic comfort reading Python
Background: Why the Sphere Matters
Every possible state a single qubit can be in corresponds to exactly one point on the surface of this sphere. The north pole is the state 0. The south pole is the state 1. Anywhere along the equator represents an equal, 50 50 superposition of both, but with different phase, a property that has no classical equivalent and is part of why quantum states are so much richer than classical bits. Applying a quantum gate to a qubit is the same thing as rotating its point around the sphere to a new location. Once you can see this, gates like the Hadamard gate stop being mysterious symbols and become simple, specific rotations you can visually track.
Step by Step Instructions
Set up your notebook.
Go to Google Colab at colab.research.google.com and create a new notebook.
Install Qiskit.
Type the following into a code cell and run it:
pip install qiskit qiskit-aer
Visualize the plain 0 state first.
from qiskit import QuantumCircuit
from qiskit.quantum_info import Statevector
from qiskit.visualization import plot_bloch_multivector
qc = QuantumCircuit(1)
state = Statevector.from_instruction(qc)
plot_bloch_multivector(state)
Run it and look at the sphere.
The arrow should be pointing straight up, at the north pole, representing the plain state 0, since we have not applied any gates yet.
Now apply a Hadamard gate and visualize again.
qc = QuantumCircuit(1)
qc.h(0)
state = Statevector.from_instruction(qc)
plot_bloch_multivector(state)
Compare the two images.
The arrow should now be lying flat along the equator, no longer pointing at either pole, visually showing the equal superposition between 0 and 1 that the Hadamard gate creates, the same superposition from your very first coin flip project, now made visible as an actual direction in space.
Try a few more gates and watch the arrow move.
qc = QuantumCircuit(1)
qc.h(0)
qc.z(0)
state = Statevector.from_instruction(qc)
plot_bloch_multivector(state)
qc2 = QuantumCircuit(1)
qc2.x(0)
state2 = Statevector.from_instruction(qc2)
plot_bloch_multivector(state2)
Compare the arrow positions.
The z gate after h should move the arrow to a different point along the equator than plain h did, still a superposition, but with a different phase. The x gate alone should flip the arrow all the way from the north pole to the south pole, since x fully swaps 0 and 1, the quantum version of a classical NOT operation.
Stretch step, chain several gates together.
Build a circuit with three or four gates in a row, visualize the final state, then remove them one at a time and re-visualize after each removal, watching the arrow trace its way back toward the north pole step by step, effectively watching a rotation happen frame by frame.
Congratulations, you just built a visual intuition for what quantum gates actually do, seeing them as rotations in space rather than abstract symbols, which is exactly how physicists and quantum engineers think about circuits when designing real algorithms.
Fun Fact:
The Bloch sphere is named after physicist Felix Bloch, and while it perfectly represents a single qubit, it is one of the reasons quantum computing gets so much harder to visualize as systems grow, a system of just 10 qubits already requires a mathematical space far too large to draw as any simple picture, which is part of why quantum computers can represent information so much more densely than classical ones.