Multi-Qubit States

4 hours ~8 min read

Multi-Qubit States

One qubit lives in C2\mathbb{C}^2. Two qubits do not live in C2×C2\mathbb{C}^2\times\mathbb{C}^2 — they live in the tensor product C2C2=C4\mathbb{C}^2\otimes\mathbb{C}^2=\mathbb{C}^4, and that single fact is where the entire mystery of quantum computing begins. This lesson assembles the nn-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:

  1. Construct the nn-qubit state space (C2)n=C2n(\mathbb{C}^2)^{\otimes n}=\mathbb{C}^{2^n} and write its computational basis {q0qn1}\{|q_0\cdots q_{n-1}\rangle\} with correct big-endian indexing.
  2. Distinguish product (separable) states from entangled states, and prove a given state is one or the other.
  3. Express local operations as tensor products ABA\otimes B and contrast them with global (entangling) operations.
  4. Apply the coefficient-matrix / Schmidt-rank separability test to a bipartite pure state.
  5. Build multi-qubit states in NumPy and decide separability numerically via matrix rank.

Intuition

A single qubit is a unit vector α0+β1\alpha|0\rangle+\beta|1\rangle in C2\mathbb{C}^2. The naïve guess for two qubits is "a pair of qubits," (C2,C2)(\mathbb{C}^2,\mathbb{C}^2) — 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 00,01,10,11|00\rangle,|01\rangle,|10\rangle,|11\rangle, so its state space is the 44-dimensional span of those configurations: C4\mathbb{C}^4, not a pair of C2\mathbb{C}^2's. The extra room — four complex amplitudes instead of two pairs — is exactly the room where entanglement hides.

The headline consequence is exponential: nn qubits need 2n2^n 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 nn-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 nn qubits,

Hn=C2C2C2n factors=(C2)n=C2n,dimHn=2n. \mathcal{H}_n = \underbrace{\mathbb{C}^2\otimes\mathbb{C}^2\otimes\cdots\otimes\mathbb{C}^2}_{n\text{ factors}} = (\mathbb{C}^2)^{\otimes n} = \mathbb{C}^{2^n}, \qquad \dim\mathcal{H}_n = 2^n .

The dimension multiplies (22=2n2\cdot2\cdots = 2^n), 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 50\sim 50 qubits.

The computational basis and big-endian indexing

An orthonormal basis of Hn\mathcal{H}_n is obtained by tensoring the single-qubit basis kets in all 2n2^n ways:

q0q1qn1:=q0q1qn1,qk{0,1}. |q_0 q_1\cdots q_{n-1}\rangle := |q_0\rangle\otimes|q_1\rangle\otimes\cdots\otimes|q_{n-1}\rangle, \qquad q_k\in\{0,1\}.

We use big-endian ordering (Appendix C): qubit 0 is leftmost / most significant. The bit-string q0q1qn1q_0 q_1\cdots q_{n-1} is read as a binary integer that fixes the basis ket's position in the 2n2^n-vector:

index(q0qn1)=k=0n1qk2n1k. \operatorname{index}(|q_0\cdots q_{n-1}\rangle) = \sum_{k=0}^{n-1} q_k\, 2^{\,n-1-k}.

For two qubits this gives 000|00\rangle\to 0, 011|01\rangle\to 1, 102|10\rangle\to 2, 113|11\rangle\to 3, so

00=(1,0,0,0)T,  01=(0,1,0,0)T,  10=(0,0,1,0)T,  11=(0,0,0,1)T, |00\rangle=(1,0,0,0)^T,\ \ |01\rangle=(0,1,0,0)^T,\ \ |10\rangle=(0,0,1,0)^T,\ \ |11\rangle=(0,0,0,1)^T,

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 nn-qubit pure state is

Ψ=x{0,1}ncxx,xcx2=1,cxC. |\Psi\rangle = \sum_{x\in\{0,1\}^n} c_x\,|x\rangle, \qquad \sum_x |c_x|^2 = 1, \quad c_x\in\mathbb{C}.

Local vs global operations

An operation acting on each qubit independently is a tensor product of single-qubit operators. To apply AA to qubit 0 and BB to qubit 1 of a two-qubit register,

(AB)(ψϕ)=(Aψ)(Bϕ), (A\otimes B)\big(|\psi\rangle\otimes|\phi\rangle\big) = (A|\psi\rangle)\otimes(B|\phi\rangle),

and "do nothing to qubit 1" is just AIA\otimes I. These are local operations. By the mixed-product identity (Appendix E), (AB)(CD)=(AC)(BD)(A\otimes B)(C\otimes D)=(AC)\otimes(BD) — 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 Hn\mathcal{H}_n that is not of the product form ABA\otimes B; the canonical example is CNOT\mathrm{CNOT} (Term 2.1), the entangling two-qubit gate.

Product (separable) vs entangled states

A bipartite pure state ΨHAHB|\Psi\rangle\in\mathcal{H}_A\otimes\mathcal{H}_B is a product (separable) state if it factors,

Ψ=ψAϕB, |\Psi\rangle = |\psi\rangle_A\otimes|\phi\rangle_B ,

and entangled otherwise. (For n>2n>2 qubits "separable" usually means fully separable, ψ0ψn1|\psi_0\rangle\otimes\cdots\otimes|\psi_{n-1}\rangle; one may also speak of separability across a particular bipartition ABA\,|\,B. We treat the bipartite case as the fundamental one.)

Local operations preserve separability. If Ψ=ψϕ|\Psi\rangle=|\psi\rangle\otimes|\phi\rangle then (AB)Ψ=(Aψ)(Bϕ)(A\otimes B)|\Psi\rangle=(A|\psi\rangle)\otimes(B|\phi\rangle) 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 HA\mathcal{H}_A as {i}\{|i\rangle\} (dAd_A of them) and of HB\mathcal{H}_B as {j}\{|j\rangle\} (dBd_B of them),

Ψ=i=0dA1j=0dB1cijiAjB,C:=(cij)CdA×dB. |\Psi\rangle = \sum_{i=0}^{d_A-1}\sum_{j=0}^{d_B-1} c_{ij}\,|i\rangle_A\otimes|j\rangle_B, \qquad C := (c_{ij}) \in \mathbb{C}^{d_A\times d_B}.

CC is the coefficient matrix. The criterion is:

 Ψ is a product state    rank(C)=1.  \boxed{\ |\Psi\rangle \text{ is a product state} \iff \operatorname{rank}(C) = 1.\ }

Proof. (\Rightarrow) If Ψ=ψϕ|\Psi\rangle=|\psi\rangle\otimes|\phi\rangle with ψ=iaii|\psi\rangle=\sum_i a_i|i\rangle, ϕ=jbjj|\phi\rangle=\sum_j b_j|j\rangle, then cij=aibjc_{ij}=a_i b_j, i.e. C=abC = a\,b^{\top} is an outer product of nonzero vectors, which has rank 11.

(\Leftarrow) If rank(C)=1\operatorname{rank}(C)=1, then C=abC=a\,b^{\top} for some nonzero aCdAa\in\mathbb{C}^{d_A}, bCdBb\in\mathbb{C}^{d_B} (every rank-11 matrix is an outer product). Then cij=aibjc_{ij}=a_i b_j and

Ψ=ijaibjij=(iaii)(jbjj), |\Psi\rangle=\sum_{ij}a_i b_j|i\rangle|j\rangle = \Big(\sum_i a_i|i\rangle\Big)\otimes\Big(\sum_j b_j|j\rangle\Big),

a product state. ∎

The integer rank(C)\operatorname{rank}(C) — equivalently the number of nonzero singular values of CC — is the Schmidt rank. Rank 11 means separable; rank 2\ge 2 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 CC is a single number computable in O((dAdB)min(dA,dB))O((d_Ad_B)\min(d_A,d_B)) 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 10|10\rangle, and a local flip

Take the two-qubit basis ket 10|10\rangle. Big-endian: qubit 0 is 11, qubit 1 is 00, binary 102=210_2=2, so it sits at index 22: 10=(0,0,1,0)T|10\rangle=(0,0,1,0)^T. As a tensor product, 10=10=(01)(10)=(0,0,1,0)T|10\rangle=|1\rangle\otimes|0\rangle=\binom{0}{1}\otimes\binom{1}{0}=(0,0,1,0)^T — consistent.

Now apply the local operation "flip qubit 1, leave qubit 0," i.e. IXI\otimes X:

(IX)10=(I1)(X0)=11=11. (I\otimes X)\,|1\rangle\otimes|0\rangle = (I|1\rangle)\otimes(X|0\rangle) = |1\rangle\otimes|1\rangle = |11\rangle .

A product went to a product, as local operations must.

Example 2 — Is 12(00+11)\tfrac{1}{\sqrt2}(|00\rangle+|11\rangle) entangled?

Its coefficient matrix (rows indexed by qubit 0, columns by qubit 1) is

C=12(c00c01c10c11)=12(1001). C = \frac{1}{\sqrt2}\begin{pmatrix} c_{00} & c_{01}\\ c_{10} & c_{11}\end{pmatrix} = \frac{1}{\sqrt2}\begin{pmatrix} 1 & 0\\ 0 & 1\end{pmatrix}.

detC=120\det C = \tfrac12\neq 0, so rank(C)=2\operatorname{rank}(C)=2. By the test, the state is entangled — this is the Bell state Φ+|\Phi^+\rangle of Lesson 1.4.2.

Contrast with 12(00+01+10+11)\tfrac12(|00\rangle+|01\rangle+|10\rangle+|11\rangle), whose coefficient matrix C=12(1 11 1)C=\tfrac12\binom{1\ \,1}{1\ \,1} has detC=0\det C = 0 and rank 11separable, in fact ++|+\rangle\otimes|+\rangle.

Example 3 — A three-qubit state across a bipartition

Consider Ψ=12(000+111)|\Psi\rangle=\tfrac{1}{\sqrt2}(|000\rangle+|111\rangle) (the GHZ state, Term 2.3). Group it as qubit 00 (AA) versus qubits 1,21,2 (BB). The coefficient matrix has shape 2×42\times 4 with the single nonzero entries c0,00=c1,11=12c_{0,\,00}=c_{1,\,11}=\tfrac1{\sqrt2}:

C=12(10000001),rank(C)=2. C=\frac1{\sqrt2}\begin{pmatrix} 1 & 0 & 0 & 0\\ 0 & 0 & 0 & 1\end{pmatrix},\qquad \operatorname{rank}(C)=2.

So Ψ|\Psi\rangle is entangled across the cut ABA\,|\,B. 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|12

Floating-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 1011|1011\rangle as a 1616-vector index, and as a tensor product of single-qubit kets.

Solution

Binary 10112=8+0+2+1=111011_2 = 8+0+2+1 = 11, so 1011|1011\rangle is the unit vector with a 11 at index 1111 (and 00 elsewhere). As a tensor product, 1011=1011|1011\rangle=|1\rangle\otimes|0\rangle\otimes|1\rangle\otimes|1\rangle (qubit 0 leftmost).

E2 (easy). How many real parameters does a normalized nn-qubit pure state have, after removing the global phase? Evaluate for n=1,2,3n=1,2,3.

Solution

A state has 2n2^n complex amplitudes =22n= 2\cdot 2^n real numbers. Normalization removes 11; the irrelevant global phase removes another 11. So 2n+122^{n+1}-2 real parameters: n=12n=1\Rightarrow 2 (the Bloch sphere), n=26n=2\Rightarrow 6, n=314n=3\Rightarrow 14.

E3 (medium). Show that ψ=12(00+10)|\psi\rangle=\tfrac{1}{\sqrt2}(|00\rangle+|10\rangle) is separable by factoring it, then confirm rank(C)=1\operatorname{rank}(C)=1.

Solution

$\tfrac1{\sqrt2}(|00\rangle+|10\rangle)=\tfrac1{\sqrt2}(|0\rangle+|1\rangle)\otimes|0\rangle =|+\rangle\otimes|0\rangle.Coefficientmatrix. Coefficient matrix C=\tfrac1{\sqrt2}\binom{1\ ,0}{1\ ,0}$ has identical nonzero structure only in its first column, so its columns are linearly dependent ⇒ rank 11. Separable. ✓

E4 (medium). The state 13(00+01+10)\tfrac{1}{\sqrt3}(|00\rangle+|01\rangle+|10\rangle) — 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,so, so \operatorname{rank}(C)=2$ ⇒ entangled. (It cannot be written as a single product; there is no way to get 00,01,10|00\rangle,|01\rangle,|10\rangle but not 11|11\rangle from a product.)

E5 (hard). Prove that a single-qubit-on-each-side local unitary UAUBU_A\otimes U_B leaves the Schmidt rank of any bipartite pure state unchanged. (Hence local operations cannot change whether a state is entangled.)

Solution

Let Ψ|\Psi\rangle have coefficient matrix CC. Acting with UAUBU_A\otimes U_B sends $c_{ij}\mapsto \sum_{kl}(U_A){ik}(U_B){jl}c_{kl},i.e., i.e. C\mapsto U_A,C,U_B^{\top}$. Multiplying by the invertible matrices UAU_A (left) and UBU_B^{\top} (right) is multiplication by full-rank matrices, which preserves matrix rank: rank(UACUB)=rank(C)\operatorname{rank}(U_A C U_B^{\top})=\operatorname{rank}(C). So the Schmidt rank — hence separable-vs-entangled — is invariant under local unitaries. ∎

E6 (hard). Generalize the rank test to detect whether an nn-qubit state is entangled across the bipartition "qubit 00 vs the rest." Describe the reshape and the rank you'd compute, and what rank range is possible.

Solution

Reshape the 2n2^n-vector into a 2×2n12\times 2^{n-1} matrix CC (rows = qubit 0's basis, columns = the other n1n-1 qubits' joint basis). Compute rank(C)\operatorname{rank}(C) (equivalently the number of nonzero singular values). Since CC has 22 rows, the rank is 11 or 22: rank 11 ⇒ qubit 0 is unentangled from the rest; rank 22 ⇒ entangled across that cut. (For a balanced cut into kk and nkn-k qubits, the matrix is 2k×2nk2^k\times 2^{n-k} and the rank can be up to min(2k,2nk)\min(2^k,2^{n-k}).)


Checkpoint

  1. Why is the two-qubit state space C4\mathbb{C}^4 and not "two copies of C2\mathbb{C}^2"? What is dim\dim for nn qubits?
  2. Give the big-endian index of 110|110\rangle.
  3. What is the difference between a local and a global operation? Why can't a local operation create entanglement?
  4. State the coefficient-matrix separability test and the meaning of Schmidt rank.
  5. Is separability an absolute property of a multi-qubit state, or relative to something?
Answers
  1. The composite postulate uses the tensor product, whose dimension multiplies: 22=42\cdot2=4 for two qubits and 2n2^n for nn. The joint system can be in any superposition of the 44 (resp. 2n2^n) joint configurations.
  2. 1102=6110_2 = 6, so 110|110\rangle is at index 66.
  3. Local =AB=A\otimes B (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.
  4. Form C=(cij)C=(c_{ij}) from Ψ=cijij|\Psi\rangle=\sum c_{ij}|i\rangle|j\rangle; the state is a product iff rank(C)=1\operatorname{rank}(C)=1. The Schmidt rank is rank(C)=\operatorname{rank}(C)= number of nonzero singular values; 11 = separable, 2\ge 2 = entangled.
  5. Relative to a bipartition ABA\,|\,B (and for n>2n>2, "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

Ready to measure your state?

6 exercises · 10 checkpoint questions

Start the quiz