Multi-Qubit States
Multi-Qubit States
One qubit lives in . Two qubits do not live in — they live in the tensor product , and that single fact is where the entire mystery of quantum computing begins. This lesson assembles the -qubit state space, pins down the big-endian computational basis you will see in every Braket bit-string, and gives you a sharp, runnable test for the question that drives the rest of the course: is this state entangled?
Learning Objectives
After this lesson you will be able to:
- Construct the -qubit state space and write its computational basis with correct big-endian indexing.
- Distinguish product (separable) states from entangled states, and prove a given state is one or the other.
- Express local operations as tensor products and contrast them with global (entangling) operations.
- Apply the coefficient-matrix / Schmidt-rank separability test to a bipartite pure state.
- Build multi-qubit states in NumPy and decide separability numerically via matrix rank.
Intuition
A single qubit is a unit vector in . The naïve guess for two qubits is "a pair of qubits," — four real parameters. That guess is wrong, and the reason is the whole story. Quantum mechanics says the joint system can be in any superposition of the four joint configurations , so its state space is the -dimensional span of those configurations: , not a pair of 's. The extra room — four complex amplitudes instead of two pairs — is exactly the room where entanglement hides.
The headline consequence is exponential: qubits need complex amplitudes. Most of those states do not factor into "a state of qubit 0" times "a state of qubit 1" times … . A factorable state is separable (boring, classical-ish); a non-factorable one is entangled (the resource behind teleportation, dense coding, and quantum speedups — Term 2). Our job here is to make "factorable" precise and testable, because everything downstream is a refinement of that distinction.
Theory
The -qubit state space
By the composite-systems postulate (1.1.4), the state space of a system built from parts is the tensor product of the parts' spaces (0.1.7). For qubits,
The dimension multiplies (), it does not add — this is the single most important difference between quantum and classical state spaces, and the origin of the simulation wall at qubits.
The computational basis and big-endian indexing
An orthonormal basis of is obtained by tensoring the single-qubit basis kets in all ways:
We use big-endian ordering (Appendix C): qubit 0 is leftmost / most significant. The bit-string is read as a binary integer that fixes the basis ket's position in the -vector:
For two qubits this gives , , , , so
exactly the Kronecker-product coordinates of 0.1.7.
This is also precisely how Braket's measurement_counts keys read (qubit 0 first), so the convention
costs us nothing later. A general -qubit pure state is
Local vs global operations
An operation acting on each qubit independently is a tensor product of single-qubit operators. To apply to qubit 0 and to qubit 1 of a two-qubit register,
and "do nothing to qubit 1" is just . These are local operations. By the mixed-product identity (Appendix E), — local operations compose factor-by-factor and therefore can never produce entanglement (we prove the relevant direction below). A global operation is any unitary on that is not of the product form ; the canonical example is (Term 2.1), the entangling two-qubit gate.
Product (separable) vs entangled states
A bipartite pure state is a product (separable) state if it factors,
and entangled otherwise. (For qubits "separable" usually means fully separable, ; one may also speak of separability across a particular bipartition . We treat the bipartite case as the fundamental one.)
Local operations preserve separability. If then is again a product. So no amount of single-qubit gates, applied in parallel, can entangle initially unentangled qubits — you need a global gate. ∎
The separability / Schmidt-rank test
We need a decidable criterion, not "stare at it and try to factor." Arrange the amplitudes of a bipartite state into a matrix. Writing the basis of as ( of them) and of as ( of them),
is the coefficient matrix. The criterion is:
Proof. () If with , , then , i.e. is an outer product of nonzero vectors, which has rank .
() If , then for some nonzero , (every rank- matrix is an outer product). Then and
a product state. ∎
The integer — equivalently the number of nonzero singular values of — is the Schmidt rank. Rank means separable; rank means entangled, and a larger rank (with balanced singular values) means more entangled. Computing rank via the singular value decomposition (SVD) is robust to floating-point noise, which is why the code below uses a tolerance. The full theory — the Schmidt decomposition itself and entanglement entropy — is Lesson 1.4.4.
Why rank, not "can I factor it"? Factoring by hand is error-prone and does not scale. The rank of is a single number computable in time, gives a yes/no answer, and generalizes immediately to a quantitative measure of entanglement. It is the workhorse of this whole course.
Worked Examples
Example 1 — Two ways to read , and a local flip
Take the two-qubit basis ket . Big-endian: qubit 0 is , qubit 1 is , binary , so it sits at index : . As a tensor product, — consistent.
Now apply the local operation "flip qubit 1, leave qubit 0," i.e. :
A product went to a product, as local operations must.
Example 2 — Is entangled?
Its coefficient matrix (rows indexed by qubit 0, columns by qubit 1) is
, so . By the test, the state is entangled — this is the Bell state of Lesson 1.4.2.
Contrast with , whose coefficient matrix has and rank — separable, in fact .
Example 3 — A three-qubit state across a bipartition
Consider (the GHZ state, Term 2.3). Group it as qubit () versus qubits (). The coefficient matrix has shape with the single nonzero entries :
So is entangled across the cut . The lesson: separability is relative to a bipartition, and the coefficient matrix is reshaped accordingly. We reuse this reshape trick constantly.
Hands-on (Python)
import numpy as np
from functools import reduce
ket0 = np.array([1, 0], dtype=complex)
ket1 = np.array([0, 1], dtype=complex)
def tensor(*ops):
"""Kronecker product of any number of kets/operators.
Big-endian: the FIRST argument is qubit 0 (most significant)."""
return reduce(np.kron, ops)
def basis_ket(bits):
"""Build a computational-basis ket from a bit-string like '101'."""
return tensor(*[ket0 if b == '0' else ket1 for b in bits])
# Big-endian indexing: |10> sits at integer index 2 = binary 10.
print(np.real(basis_ket('10'))) # [0. 0. 1. 0.]
print(int('10', 2)) # 2 -> the position of the lone 1# Local (product) operations are tensor products; e.g. I ⊗ X flips qubit 1 only.
I = np.eye(2, dtype=complex)
X = np.array([[0, 1], [1, 0]], dtype=complex)
state = basis_ket('10') # |10>
flipped = tensor(I, X) @ state # apply X to qubit 1
print(np.real(flipped)) # [0. 0. 0. 1.] = |11>def coefficient_matrix(state, dA, dB):
"""Reshape a bipartite state vector into its coefficient matrix C (dA x dB)."""
return state.reshape(dA, dB)
def schmidt_rank(state, dA, dB, tol=1e-9):
"""Number of nonzero singular values of C = the Schmidt rank.
rank 1 -> product (separable); rank >= 2 -> entangled (across the A|B cut)."""
C = coefficient_matrix(state, dA, dB)
s = np.linalg.svd(C, compute_uv=False) # singular values, descending
return int(np.sum(s > tol))
# Product state |+>|0>: expect rank 1.
plus = (ket0 + ket1) / np.sqrt(2)
print(schmidt_rank(tensor(plus, ket0), 2, 2)) # 1 -> separable
# Bell state (|00>+|11>)/√2: expect rank 2.
bell = (basis_ket('00') + basis_ket('11')) / np.sqrt(2)
print(schmidt_rank(bell, 2, 2)) # 2 -> entangled
# Equal superposition |+>|+> over 2 qubits: separable despite "looking" mixed.
equal = 0.5 * (basis_ket('00') + basis_ket('01')
+ basis_ket('10') + basis_ket('11'))
print(schmidt_rank(equal, 2, 2)) # 1 -> separable# Separability is RELATIVE to a bipartition. GHZ = (|000>+|111>)/√2,
# cut qubit 0 (dim 2) vs qubits 1,2 (dim 4):
ghz = (basis_ket('000') + basis_ket('111')) / np.sqrt(2)
print(schmidt_rank(ghz, 2, 4)) # 2 -> entangled across 0|12Floating-point note. Never test singular values for exact zero. Use a tolerance (here
1e-9); simulator amplitudes and any non-trivial preparation accumulate rounding error. This mirrors how the real Schmidt-decomposition code in Lesson 1.4.4 treats tiny singular values as numerical zeros.
Exercises
E1 (easy). Write the four-qubit basis ket as a -vector index, and as a tensor product of single-qubit kets.
Solution
Binary , so is the unit vector with a at index (and elsewhere). As a tensor product, (qubit 0 leftmost).
E2 (easy). How many real parameters does a normalized -qubit pure state have, after removing the global phase? Evaluate for .
Solution
A state has complex amplitudes real numbers. Normalization removes ; the irrelevant global phase removes another . So real parameters: (the Bloch sphere), , .
E3 (medium). Show that is separable by factoring it, then confirm .
Solution
$\tfrac1{\sqrt2}(|00\rangle+|10\rangle)=\tfrac1{\sqrt2}(|0\rangle+|1\rangle)\otimes|0\rangle =|+\rangle\otimes|0\rangleC=\tfrac1{\sqrt2}\binom{1\ ,0}{1\ ,0}$ has identical nonzero structure only in its first column, so its columns are linearly dependent ⇒ rank . Separable. ✓
E4 (medium). The state — is it entangled? Justify with the rank test.
Solution
C=\tfrac1{\sqrt3}\begin{psmallmatrix}1&1\\1&0\end{psmallmatrix}. $\det C=\tfrac13(1\cdot0-1\cdot1) =-\tfrac13\neq0\operatorname{rank}(C)=2$ ⇒ entangled. (It cannot be written as a single product; there is no way to get but not from a product.)
E5 (hard). Prove that a single-qubit-on-each-side local unitary leaves the Schmidt rank of any bipartite pure state unchanged. (Hence local operations cannot change whether a state is entangled.)
Solution
Let have coefficient matrix . Acting with sends $c_{ij}\mapsto \sum_{kl}(U_A){ik}(U_B){jl}c_{kl}C\mapsto U_A,C,U_B^{\top}$. Multiplying by the invertible matrices (left) and (right) is multiplication by full-rank matrices, which preserves matrix rank: . So the Schmidt rank — hence separable-vs-entangled — is invariant under local unitaries. ∎
E6 (hard). Generalize the rank test to detect whether an -qubit state is entangled across the bipartition "qubit vs the rest." Describe the reshape and the rank you'd compute, and what rank range is possible.
Solution
Reshape the -vector into a matrix (rows = qubit 0's basis, columns = the other qubits' joint basis). Compute (equivalently the number of nonzero singular values). Since has rows, the rank is or : rank ⇒ qubit 0 is unentangled from the rest; rank ⇒ entangled across that cut. (For a balanced cut into and qubits, the matrix is and the rank can be up to .)
Checkpoint
- Why is the two-qubit state space and not "two copies of "? What is for qubits?
- Give the big-endian index of .
- What is the difference between a local and a global operation? Why can't a local operation create entanglement?
- State the coefficient-matrix separability test and the meaning of Schmidt rank.
- Is separability an absolute property of a multi-qubit state, or relative to something?
Answers
- The composite postulate uses the tensor product, whose dimension multiplies: for two qubits and for . The joint system can be in any superposition of the (resp. ) joint configurations.
- , so is at index .
- Local (acts factor-wise); global any unitary not of product form (e.g. CNOT). Local ops send products to products: $(A\otimes B)(|\psi\rangle\otimes|\phi\rangle) =(A|\psi\rangle)\otimes(B|\phi\rangle)$, so they can't entangle initially unentangled qubits.
- Form from ; the state is a product iff . The Schmidt rank is number of nonzero singular values; = separable, = entangled.
- Relative to a bipartition (and for , "fully separable" means it factors across every qubit). The coefficient matrix is reshaped to match the chosen cut.
Further Reading
- [NC] Nielsen & Chuang, §2.2.8 (composite systems) and §2.5 (the Schmidt decomposition).
- [Pre] Preskill, Ph219, Ch. 2 — bipartite systems and the meaning of separability.
- [Wat] Watrous, Theory of Quantum Information, Ch. 2 — rigorous tensor-product formalism.
- 0.1.7 Tensor Products — the construction this lesson builds on, including the Kronecker product in coordinates.
← Prev: POVMs & Generalized Measurement · Up: Term 1 · Next: Bell States →