Curriculum / Quantum Foundations / Tensor Products: The Math of Multiple Qubits
Tensor Products: The Math of Multiple Qubits
Build multi-qubit states with the tensor product and see exactly what entanglement means.
Tensor Products: The Math of Multiple Qubits
Where Do Four Basis States Come From?
In the last lesson you saw that two qubits have four basis states: |00⟩, |01⟩, |10⟩, and |11⟩. We treated that as a fact of notation, but it is not. There is a precise mathematical operation that takes two single-qubit state spaces and builds the joint state space, and it is called the tensor product, written ⊗. Understanding it pays off twice. First, it tells you exactly how multi-qubit states and multi-qubit gates are constructed, no hand-waving required. Second, it gives you the sharpest possible definition of entanglement, the concept at the heart of the next two lessons.
Combining Two States
A single qubit is a 2-dimensional vector of amplitudes. To combine qubit 1 in state a₀|0⟩ + a₁|1⟩ with qubit 0 in state b₀|0⟩ + b₁|1⟩, you multiply every amplitude of the first by every amplitude of the second:
Notice what happened to the dimensions: 2 times 2 gives 4, not 2 plus 2. Each qubit you add multiplies the dimension by 2, so n qubits live in a 2ⁿ-dimensional space. The exponential scaling quoted in the previous lesson ("50 qubits need 2⁵⁰ complex numbers") is not a slogan, it is a direct consequence of this multiplication rule.
This platform follows Qiskit's little-endian convention. In the label |q1 q0⟩ the rightmost position is qubit 0, so the left factor of the tensor product is qubit 1 and the right factor is qubit 0. Every vector and matrix below follows this rule. Mixing up the order is the single most common multi-qubit bug, so keep this callout in mind.
Building Concrete 4-Vectors
The four basis states are tensor products of |0⟩ = (1, 0) and |1⟩ = (0, 1). The joint vector lists amplitudes in the order |00⟩, |01⟩, |10⟩, |11⟩. The starting state of every 2-qubit circuit is:
Now put qubit 0 into the superposition |+⟩ = (|0⟩ + |1⟩)/√2 and leave qubit 1 alone. The joint state is |0⟩ ⊗ |+⟩:
Equal amplitude on |00⟩ and |01⟩: qubit 0 (the rightmost digit) is random, qubit 1 is definitely 0. Flip the roles and put qubit 1 into |+⟩ instead, giving |+⟩ ⊗ |0⟩:
Now the amplitude sits on |00⟩ and |10⟩: qubit 1 (the left digit) is random instead. Same ingredients, different qubit, different 4-vector. The tensor product keeps perfect track of which qubit is doing what.
Gates Get Tensor Products Too
A gate acting on one qubit of a 2-qubit system is also built with the tensor product, this time of matrices (the Kronecker product). Applying H to qubit 0 while doing nothing to qubit 1 is the 4×4 matrix I ⊗ H. Applying H to qubit 1 instead is H ⊗ I:
The position in the tensor product matches the little-endian state label: qc.h(0) is I ⊗ H (the right slot is qubit 0) and qc.h(1) is H ⊗ I. You can check by hand that (I ⊗ H) applied to (1, 0, 0, 0) gives exactly the |0⟩ ⊗ |+⟩ vector above, and (H ⊗ I) gives the |+⟩ ⊗ |0⟩ vector.
The Punchline: Product States vs Entangled States
Every state we have built so far is a product state: it can be written as (one qubit's state) ⊗ (the other qubit's state). Each qubit has its own well-defined state, and the tensor product just bundles them together.
Here is the question that defines entanglement: can every 2-qubit state be written this way? Take the Bell state (|00⟩ + |11⟩)/√2 from the very first lesson and try to factor it as (a|0⟩ + b|1⟩) ⊗ (c|0⟩ + d|1⟩). Expanding the product and matching amplitudes against (1/√2, 0, 0, 1/√2) gives four equations:
- •ac = 1/√2 and bd = 1/√2 (the |00⟩ and |11⟩ amplitudes)
- •ad = 0 and bc = 0 (the |01⟩ and |10⟩ amplitudes)
The proof takes two lines. From ad = 0, either a = 0 or d = 0. If a = 0 then ac = 0, contradicting ac = 1/√2. If d = 0 then bd = 0, contradicting bd = 1/√2. There is no solution. The Bell state cannot be factored, no matter how cleverly you choose a, b, c, d.
This is the precise mathematical meaning of entanglement: an entangled state is a joint state that is not a tensor product of single-qubit states. Neither qubit has a state of its own. Only the pair does. Everything mysterious you have heard about entanglement, the perfect correlations, the "spooky action", is downstream of this one algebraic fact.
For any product state the amplitudes are (ac, ad, bc, bd), so the outer pair and the inner pair always have the same product: amp₀₀ · amp₁₁ = amp₀₁ · amp₁₀. For the Bell state the left side is 1/2 and the right side is 0. Unequal, therefore entangled. This determinant-style check works for any 2-qubit pure state.
Check It Yourself
Predict before you run: apply X to qubit 1 and H to qubit 0. The tensor product says the result is |1⟩ ⊗ |+⟩ = (|10⟩ + |11⟩)/√2, so the left digit should always read 1 and the right digit should be a coin flip. You should see roughly 500 counts each of 10 and 11, and never 00 or 01. Paste this into the playground and confirm:
qc = QuantumCircuit(2, 2)
qc.x(1) # qubit 1 -> |1>
qc.h(0) # qubit 0 -> |+>
qc.measure(0, 0)
qc.measure(1, 1)
counts = simulate(qc, shots=1000)
print_counts(counts)What Comes Next
There is a deeper pattern in this lesson: single-qubit gates are tensor products like I ⊗ H, and tensor products of gates always map product states to product states. So no sequence of single-qubit gates, however long, can ever create the Bell state you just proved is unfactorable. To make entanglement you need a genuinely two-qubit gate, one whose matrix does not factor. That gate is the CNOT, and it is up next: the lesson after this one introduces it, and the one after that uses H plus CNOT to create exactly the non-product states this lesson defined.
How this lesson works
A guided reading lesson with interactive knowledge checks. Concepts are explained step by step with circuit diagrams and runnable examples, and you confirm understanding before moving on.
Part of: Quantum Foundations
Learn the basics: qubits, gates, superposition, and measurement.
Take this lesson free
Create a free account and start this lesson in your browser. No credit card, no installation.