8 min read
Tensor Products and Multi-Qubit State Space
How single-qubit spaces combine into the 2^n-dimensional space multi-qubit states live in, and why entanglement means "not a tensor product."
Suggested before this lesson
Everything so far has lived in , a single qubit's state space. This lesson covers the operation that builds up the state space for multiple qubits: the tensor product, written .
Given and , their tensor product is a 4-entry vector:
every pairwise product of one entry from each vector, in a fixed order. Apply this to the computational basis states and you get exactly the 2-qubit basis you already know from every circuit diagram in this course:
is shorthand for the 4-entry vector , for , and so on, each ket labeling one axis of .
One qubit: . Two qubits: . qubits: tensor copies of together and you get . This is the mathematical reason simulating qubits classically requires tracking complex amplitudes, and why every visualization in this course that shows exact amplitudes (the Exact State table) grows exponentially with qubit count: the state genuinely lives in a -dimensional space, there's no shortcut representation for a generic state.
Applying a gate to one qubit while leaving another untouched is the tensor product of that gate with the identity. qc.h(0) on a 2-qubit circuit ( on qubit 0, nothing on qubit 1) is the matrix (Qiskit's own little-endian qubit ordering puts qubit 0's gate on the right of the tensor product, qubit 1's on the left). Two independent single-qubit gates applied together, qc.h(0) and qc.x(1) in the same moment, compose as . This is also why a broadcast like qc.h([0, 1, 2]) amounts to a single matrix acting on all three qubits' joint state at once, exactly the uniform-superposition construction the algorithms track uses constantly.
Not every valid 2-qubit state is some . Take the Bell state:
Suppose this were for some , . Matching entries against the formula above: , , , . From , neither nor is zero. But then forces , and forces , which makes , contradicting . No such exist.
This is the formal definition of entanglement: a multi-qubit state is entangled exactly when it can't be factored as a tensor product of individual single-qubit states, i.e. exactly when there's no way to describe "qubit 0's state" and "qubit 1's state" separately. The Bell state above is the canonical example, and it's exactly the state the entanglement lesson right after this track builds with then .
Pick a state for each qubit and watch the four joint amplitudes of compute live, then try the Bell state and see why no combination of buttons can reach it.
Qubit 0 (left)
Qubit 1 (right)
Joint amplitudes
0.500
0.500
0.500
0.500
Pick a single-qubit state for each qubit and watch the four joint amplitudes update live, every entry is just one amplitude from the left state times one from the right. Then flip to the Bell state: it is a perfectly valid 2-qubit state, but no button combination above builds it, which is exactly what "entangled" means.