What is a Qubit?
January 1, 2025
A qubit (quantum bit) is the basic unit of quantum information. It generalizes the classical bit by allowing states that are not merely 0 or 1, but normalized vectors in a two-dimensional complex Hilbert space.
Classical bit vs quantum bit
A classical bit is in one of two definite states: 0 or 1. You can copy it arbitrarily and read it without disturbing it.
A qubit can be prepared in a superposition of and . You still obtain a classical outcome (0 or 1) when you measure in the computational basis, but the pre-measurement state carries more information in the amplitudes.
Mathematical representation (Dirac notation)
We write an arbitrary single-qubit pure state as a ket:
The bra is the conjugate-transpose row vector. Inner products use the braket .
Superposition
Superposition means and can both be non-zero. A measurement in the computational basis yields:
- outcome
0with probability - outcome
1with probability
Even though only one outcome is observed, the quantum description before measurement is the full normalized vector .
Bloch sphere (introduction)
Up to a global phase, any pure single-qubit state can be written as
with and . The pair maps to a point on the Bloch sphere: a geometric picture of single-qubit pure states as points on a unit sphere.
Python / Qiskit example
The snippet below prepares a superposition with a Hadamard gate and prints the statevector (ideal noise-free simulation).
from qiskit import QuantumCircuit
from qiskit.quantum_info import Statevector
qc = QuantumCircuit(1)
qc.h(0)
psi = Statevector(qc)
print(psi)You should obtain amplitudes consistent with up to numerical formatting. To see random 0/1 outcomes from measurement, run the circuit on a simulator or device with shots after you add a measurement instruction.
Exercise
Thought question: Suppose you are given many copies of an unknown qubit state . Why is it impossible to learn and perfectly from a single measurement on one copy? What kind of repeated experiment would let you estimate and ?
Next
Continue with Superposition for more intuition before you formalize gates as matrices.