Quantum computing is buried under hype, but the basics are concrete: a qubit is a vector, a gate is a matrix, and you can simulate small quantum circuits in plain Python with NumPy. You do not need a quantum computer to understand how one works.
A qubit is a vector
A classical bit is 0 or 1. A qubit is a combination of both, written as a 2-element vector of amplitudes:
import numpy as np
zero = np.array([1, 0]) # |0>
one = np.array([0, 1]) # |1>
# a superposition: equal parts |0> and |1>
plus = np.array([1, 1]) / np.sqrt(2)
The amplitudes are not probabilities directly; their squared magnitudes are. For plus, each squared amplitude is 1/2, so measuring gives 0 or 1 with equal chance. That is superposition: the qubit holds both possibilities until measured.
A gate is a matrix
Quantum gates are matrices that transform the qubit's vector. The Hadamard gate creates superposition; the X gate is a quantum NOT:
H = np.array([[1, 1], [1, -1]]) / np.sqrt(2)
X = np.array([[0, 1], [1, 0]])
H @ zero # -> the plus state, superposition from |0>
X @ zero # -> |1>, a bit flip
Applying a gate is just matrix-vector multiplication. A circuit is a sequence of these multiplications. That is the entire computational model, simulable with NumPy.
Measurement
Measurement collapses the superposition to a definite 0 or 1, with probability equal to the squared amplitude. Simulating it is sampling:
def measure(state):
probs = np.abs(state) ** 2
return np.random.choice(len(state), p=probs)
Run it many times on the plus state and you get roughly half 0s and half 1s. This is the part that feels strange: the outcome is genuinely probabilistic, and reading the qubit destroys the superposition.
Why it matters
With multiple qubits you get entanglement and a state space that grows exponentially (n qubits need 2^n amplitudes), which is the source of quantum computing's potential power for specific problems like search (Grover's algorithm) and factoring. Simulating small cases in Python is exactly how people build intuition before touching real hardware, and it shows you both the promise and the limits without the marketing.
Build it yourself
The physics with Python track covers quantum mechanics and simulation from scratch, building qubits, gates, measurement, and algorithms in NumPy, all graded in your browser. The first project is free.
Quantum computing is reachable. Simulate a few qubits and the ideas become concrete, hype removed.









