Simple Algorithm
Quantum Computing · Excited State · 22 min

Composite Systems & Tensor Products

Two qubits, four amplitudes: how state spaces multiply.

Put two qubits side by side and you do not get 2+22+2 numbers, you get 2×22\times2. The tensor product is the rule by which quantum state spaces multiply, and everything about entanglement, from Bell states to the exponential cost of classical simulation, follows from it.

What you’ll learn

  • Compute tensor (Kronecker) products of vectors and matrices, and use the mixed-product rule.
  • Write the 4×44\times4 matrices of local gates such as X⊗IX\otimes I and of CNOT, and prove that CNOT is not a product of single-qubit operators.
  • Decide whether a two-qubit pure state is a product state with the determinant test c00c11−c01c10=0c_{00}c_{11}-c_{01}c_{10} = 0.
  • Compute outcome probabilities and post-measurement states when only one subsystem is measured, and the reduced density matrix ρA=CC†\rho_A = CC^\dagger.

The composite-system postulate

If system A has state space HA\Hil_A and system B has state space HB\Hil_B, the composite system AB lives in the tensor product HA⊗HB\Hil_A\otimes\Hil_B. If {∣i⟩}\{\ket{i}\} is an orthonormal basis of HA\Hil_A and {∣j⟩}\{\ket{j}\} one of HB\Hil_B, then the products ∣i⟩⊗∣j⟩\ket{i}\otimes\ket{j} form an orthonormal basis of HA⊗HB\Hil_A\otimes\Hil_B, so

dim⁡(HA⊗HB)=dim⁡HA⋅dim⁡HB.\dim(\Hil_A\otimes\Hil_B) = \dim\Hil_A\cdot\dim\Hil_B.

Shorthand: ∣i⟩⊗∣j⟩=∣i⟩∣j⟩=∣i,j⟩=∣ij⟩\ket{i}\otimes\ket{j} = \ket{i}\ket{j} = \ket{i,j} = \ket{ij}.

In coordinates the tensor product is the Kronecker product: each entry of the first vector multiplies a full copy of the second,

(a0a1)⊗(b0b1)=(a0b0a0b1a1b0a1b1).\begin{pmatrix}a_0\\a_1\end{pmatrix}\otimes\begin{pmatrix}b_0\\b_1\end{pmatrix} = \begin{pmatrix}a_0b_0\\a_0b_1\\a_1b_0\\a_1b_1\end{pmatrix}.

The basis order 00,01,10,1100, 01, 10, 11 reads each label as a binary number with qubit 0 as the leftmost, most significant bit. This course and most physics texts use this convention; some software, notably Qiskit, uses the reverse.

Think first Why the tensor product, and not simply stacking the two vectors on top of each other (the direct sum HA⊕HB\Hil_A\oplus\Hil_B)?

The direct sum describes a system that is either A or B, like one particle in one of two boxes; dimensions add. Two systems that both exist need an amplitude for every combination of basis states, and independent preparations must give multiplying probabilities P(i,j)=PA(i) PB(j)P(i,j) = P_A(i)\,P_B(j), which bilinearity guarantees. For two qubits both constructions happen to have dimension 4 (2+2=2⋅22+2 = 2\cdot2), but for nn qubits the direct sum has dimension 2n2n and the tensor product 2n2^n.

Check your understanding

What is the dimension of the joint state space of three qubits and one qutrit (d=3d=3)?

  1. 99
  2. 1212
  3. 2424
  4. 8181
Show the answer

C. 2424

Dimensions multiply: 2⋅2⋅2⋅3=242\cdot2\cdot2\cdot3 = 24.

Operators on composite systems

Operators combine the same way. For AA acting on HA\Hil_A and BB on HB\Hil_B, the operator A⊗BA\otimes B is defined by

(A⊗B)(∣a⟩⊗∣b⟩)=A∣a⟩⊗B∣b⟩(A\otimes B)(\ket{a}\otimes\ket{b}) = A\ket{a}\otimes B\ket{b}

and extended linearly. Its matrix is the Kronecker product, a block matrix whose blocks are aijBa_{ij}B:

A⊗B=(a00Ba01Ba10Ba11B).A\otimes B = \begin{pmatrix} a_{00}B & a_{01}B\\ a_{10}B & a_{11}B\end{pmatrix}.

The workhorse rule is the mixed-product property (A⊗B)(C⊗D)=AC⊗BD(A\otimes B)(C\otimes D) = AC\otimes BD. Together with (A⊗B)†=A†⊗B†(A\otimes B)^\dagger = A^\dagger\otimes B^\dagger, it shows that tensor products of unitaries are unitary.

A gate on a single qubit is a tensor product with the identity. In our ordering,

X⊗I=(0010000110000100),I⊗X=(0100100000010010).X\otimes I = \begin{pmatrix}0&0&1&0\\0&0&0&1\\1&0&0&0\\0&1&0&0\end{pmatrix},\qquad I\otimes X = \begin{pmatrix}0&1&0&0\\1&0&0&0\\0&0&0&1\\0&0&1&0\end{pmatrix}.

The CNOT with qubit 0 as control is a sum of products, "if qubit 0 is 00 do nothing, if it is 11 apply XX to qubit 1":

CNOT=∣0⟩ ⁣⟨0∣⊗I+∣1⟩ ⁣⟨1∣⊗X=(1000010000010010).\mathrm{CNOT} = \dyad{0}\otimes I + \dyad{1}\otimes X = \begin{pmatrix}1&0&0&0\\0&1&0&0\\0&0&0&1\\0&0&1&0\end{pmatrix}.
DerivationCNOT is not a product of single-qubit operators
  1. CNOT∣00⟩=∣00⟩,CNOT∣10⟩=∣11⟩\mathrm{CNOT}\ket{00} = \ket{00},\qquad \mathrm{CNOT}\ket{10} = \ket{11}

    Suppose CNOT=A⊗B\mathrm{CNOT} = A\otimes B for some single-qubit operators AA and BB. Compare both sides on ∣00⟩\ket{00} and ∣10⟩\ket{10}:

  2. A∣0⟩⊗B∣0⟩=∣0⟩⊗∣0⟩,A∣1⟩⊗B∣0⟩=∣1⟩⊗∣1⟩A\ket0\otimes B\ket0 = \ket0\otimes\ket0,\qquad A\ket1\otimes B\ket0 = \ket1\otimes\ket1

    Since A⊗BA\otimes B would be invertible, A∣0⟩A\ket0, A∣1⟩A\ket1 and B∣0⟩B\ket0 are all nonzero, and the two equations read

  3. B∣0⟩∝∣0⟩andB∣0⟩∝∣1⟩B\ket0\propto\ket0\quad\text{and}\quad B\ket0\propto\ket1

    Nonzero product vectors are equal only if their factors are proportional. Comparing the second factors:

  4. No nonzero vector is proportional to both ∣0⟩\ket0 and ∣1⟩\ket1. So CNOT is a genuinely two-qubit operator. That is exactly why it can create entanglement, while any A⊗BA\otimes B maps product states to product states.

python
import numpy as np

ket0 = np.array([1, 0])
I2 = np.eye(2)
X = np.array([[0, 1], [1, 0]])
H = np.array([[1, 1], [1, -1]]) / np.sqrt(2)
P0, P1 = np.diag([1, 0]), np.diag([0, 1])      # |0><0| and |1><1|

CNOT = np.kron(P0, I2) + np.kron(P1, X)         # control = qubit 0 (left factor)
psi = CNOT @ np.kron(H, I2) @ np.kron(ket0, ket0)
print(np.round(psi, 3))   # expect [0.707 0. 0. 0.707], i.e. (|00> + |11>)/sqrt(2)

The Bell-pair circuit with explicit Kronecker products. np.kron(A, B) puts A on qubit 0, the left factor.

Product or entangled?

Collect the amplitudes of a two-qubit state into its coefficient matrix CC:

∣ψ⟩=∑i,j∈{0,1}cij∣ij⟩,C=(c00c01c10c11).\ket\psi = \sum_{i,j\in\{0,1\}} c_{ij}\ket{ij},\qquad C = \begin{pmatrix}c_{00}&c_{01}\\c_{10}&c_{11}\end{pmatrix}.

The state is a product state if ∣ψ⟩=∣a⟩⊗∣b⟩\ket\psi = \ket{a}\otimes\ket{b} for some single-qubit states, and entangled otherwise.

DerivationThe determinant test
  1. ∣a⟩⊗∣b⟩=∑ijaibj∣ij⟩⟺C=(a0a1)(b0b1)=a bT\ket a\otimes\ket b = \sum_{ij}a_ib_j\ket{ij}\quad\Longleftrightarrow\quad C = \begin{pmatrix}a_0\\a_1\end{pmatrix}\begin{pmatrix}b_0&b_1\end{pmatrix} = a\,b^{T}

    A product state has an outer-product coefficient matrix, which has rank one:

  2. det⁡C=a0b0 a1b1−a0b1 a1b0=0\det C = a_0b_0\,a_1b_1 - a_0b_1\,a_1b_0 = 0

    So every product state has a vanishing determinant:

  3. det⁡C=0  ⟹  rank⁡C=1  ⟹  C=a bT\det C = 0\;\Longrightarrow\;\rank C = 1\;\Longrightarrow\;C = a\,b^{T}

    Conversely, if det⁡C=0\det C = 0, the nonzero matrix CC has rank one, so C=a bTC = a\,b^T for some vectors aa, bb. Reading off the entries gives ∣ψ⟩=(a0∣0⟩+a1∣1⟩)⊗(b0∣0⟩+b1∣1⟩)\ket\psi = (a_0\ket0+a_1\ket1)\otimes(b_0\ket0+b_1\ket1).

  4.  ∣ψ⟩ is a product state  ⟺  c00c11−c01c10=0 \boxed{\ \ket\psi\ \text{is a product state}\iff c_{00}c_{11}-c_{01}c_{10} = 0\ }

    For ∣Φ+⟩=12(∣00⟩+∣11⟩)\ket{\Phi^+} = \tfrac{1}{\sqrt2}(\ket{00}+\ket{11}), C=I/2C = I/\sqrt2 and det⁡C=12≠0\det C = \tfrac12\neq0: entangled, as the Ground State lessons argued by hand.

Local gates cannot change the verdict. Applying U⊗VU\otimes V maps the coefficient matrix to C↦UCVTC\mapsto UCV^{T} (expand (U⊗V)∑ijcij∣i⟩∣j⟩(U\otimes V)\sum_{ij}c_{ij}\ket i\ket j to check), so det⁡C↦det⁡U det⁡V det⁡C\det C\mapsto\det U\,\det V\,\det C, and ∣det⁡U∣=∣det⁡V∣=1\abs{\det U} = \abs{\det V} = 1 for unitaries. The invariant C=2∣det⁡C∣\mathcal{C} = 2\abs{\det C} is called the concurrence: 00 for product states and 11 for maximally entangled ones, such as every Bell state.

Check your understanding

Which state is entangled?

  1. 12(∣00⟩−∣01⟩+∣10⟩−∣11⟩)\tfrac12(\ket{00}-\ket{01}+\ket{10}-\ket{11})
  2. 12(∣00⟩+i∣01⟩)\tfrac{1}{\sqrt2}(\ket{00}+i\ket{01})
  3. 12(∣00⟩+∣01⟩+∣10⟩−∣11⟩)\tfrac12(\ket{00}+\ket{01}+\ket{10}-\ket{11})
  4. 12(∣00⟩+∣01⟩+∣10⟩+∣11⟩)\tfrac12(\ket{00}+\ket{01}+\ket{10}+\ket{11})
Show the answer

C. 12(∣00⟩+∣01⟩+∣10⟩−∣11⟩)\tfrac12(\ket{00}+\ket{01}+\ket{10}-\ket{11})

det⁡C=14((1)(−1)−(1)(1))=−12≠0\det C = \tfrac14\big((1)(-1)-(1)(1)\big) = -\tfrac12\neq0, so the concurrence is 2⋅12=12\cdot\tfrac12 = 1: maximally entangled. It is (I⊗H)∣Φ+⟩(I\otimes H)\ket{\Phi^+}, and also the output of a CZ gate on ∣+⟩∣+⟩\ket{+}\ket{+}. The other three have det⁡C=0\det C = 0: they are ∣+⟩∣−⟩\ket{+}\ket{-}, ∣0⟩∣+i⟩\ket{0}\ket{+i} and ∣+⟩∣+⟩\ket{+}\ket{+}.

Measuring part of a system

Measure only qubit 0 of ∣ψ⟩=∑ijcij∣ij⟩\ket\psi = \sum_{ij}c_{ij}\ket{ij}. The projector for outcome ii is ∣i⟩ ⁣⟨i∣⊗I\dyad{i}\otimes I, and the Born rule and the collapse rule give:

DerivationPartial measurement
  1. P(i)=⟨ψ∣(∣i⟩ ⁣⟨i∣⊗I)∣ψ⟩=∑j∣cij∣2P(i) = \bra\psi\big(\dyad{i}\otimes I\big)\ket\psi = \sum_j\abs{c_{ij}}^2

    The probability of outcome ii sums ∣cij∣2\abs{c_{ij}}^2 over everything qubit 1 could be:

  2. ∣ψ⟩  ⟼  (∣i⟩ ⁣⟨i∣⊗I)∣ψ⟩P(i)=∣i⟩⊗∑jcij∣j⟩P(i)\ket\psi\;\longmapsto\;\frac{(\dyad{i}\otimes I)\ket\psi}{\sqrt{P(i)}} = \ket{i}\otimes\frac{\sum_jc_{ij}\ket{j}}{\sqrt{P(i)}}

    The state collapses onto the branch where qubit 0 equals ii; qubit 1 is left in the normalized row ii of CC:

  3. P(0)=23 → ∣0⟩∣+⟩,P(1)=13 → ∣1⟩∣0⟩P(0) = \tfrac23\ \to\ \ket0\ket+,\qquad P(1) = \tfrac13\ \to\ \ket1\ket0

    Example: ∣ψ⟩=13(∣00⟩+∣01⟩+∣10⟩)\ket\psi = \tfrac{1}{\sqrt3}(\ket{00}+\ket{01}+\ket{10}). Outcome 00 has probability 23\tfrac23 and leaves qubit 1 in ∣+⟩\ket{+}; outcome 11 has probability 13\tfrac13 and leaves it in ∣0⟩\ket0.

What if you never look at qubit 1 and only want to predict measurements on qubit 0? All such predictions are captured by the reduced density matrix ρA=Tr⁡B∣ψ⟩ ⁣⟨ψ∣\rho_A = \Tr_B\dyad\psi, obtained by the partial trace over B. In terms of the coefficient matrix it is simply

ρA=C C†,(ρA)ii′=∑jcij ci′j‾.\rho_A = C\,C^\dagger,\qquad (\rho_A)_{ii'} = \sum_j c_{ij}\,\overline{c_{i'j}}.

For a product state, ρA=∣a⟩ ⁣⟨a∣\rho_A = \dyad{a} is pure. For ∣Φ+⟩\ket{\Phi^+}, C=I/2C = I/\sqrt2 gives ρA=I/2\rho_A = I/2: the maximally mixed state at the center of the Bloch ball.

Predict before you look

For 13(∣00⟩+∣01⟩+∣10⟩)\tfrac{1}{\sqrt3}(\ket{00}+\ket{01}+\ket{10}), the reduced state is ρA=13(2111)\rho_A = \tfrac13\begin{pmatrix}2&1\\1&1\end{pmatrix}. What is its purity Tr⁡ρA2\Tr\rho_A^2?

Show the answer

0.78

ρA2=19(5332)\rho_A^2 = \tfrac19\begin{pmatrix}5&3\\3&2\end{pmatrix}, so Tr⁡ρA2=79≈0.78\Tr\rho_A^2 = \tfrac79\approx0.78: between 12\tfrac12 (maximally mixed, maximally entangled) and 11 (pure, product). The state is entangled, but not maximally.

Many qubits and the exponential wall

Everything generalizes: nn qubits live in (C2)⊗n≅C2n(\C^2)^{\otimes n}\cong\C^{2^n}, with one amplitude per bit string. A product state ∣a1⟩⊗⋯⊗∣an⟩\ket{a_1}\otimes\cdots\otimes\ket{a_n} needs only 2n2n real parameters (two Bloch angles per qubit), but a general pure state needs 2n+1−22^{n+1}-2. Product states are a tiny corner of the space: almost every state is entangled.

Qubits nnAmplitudes 2n2^nMemory at 16 bytes per amplitude
101024102416 KiB
30≈1.1×109\approx1.1\times10^{9}16 GiB
50≈1.1×1015\approx1.1\times10^{15}16 PiB
300≈2×1090\approx2\times10^{90}more bytes than atoms in the observable universe (∼1080\sim10^{80})
Brute-force state-vector simulation: each added qubit doubles the cost.

The gap between 2n2n and 2n2^n is both why quantum computers might be powerful and why simulating them is hard. But it is entanglement that makes the wall real: if every cut through a many-qubit state carries little entanglement, the state can be stored with far fewer numbers. That is the idea behind tensor networks.

Key takeaways

  • Composite systems live in HA⊗HB\Hil_A\otimes\Hil_B: dimensions multiply, and in coordinates ⊗\otimes is the Kronecker product.
  • (A⊗B)(C⊗D)=AC⊗BD(A\otimes B)(C\otimes D) = AC\otimes BD. A gate on one qubit is U⊗IU\otimes I; CNOT is a sum of products and cannot be written as A⊗BA\otimes B.
  • A two-qubit pure state is a product state iff c00c11−c01c10=0c_{00}c_{11}-c_{01}c_{10} = 0, and local unitaries preserve ∣det⁡C∣\abs{\det C}.
  • Measuring one qubit leaves the other in a normalized row of CC; ignoring a qubit leaves the reduced state ρA=CC†\rho_A = CC^\dagger, which is mixed exactly when the pure state is entangled.

Check yourself

In the interactive lesson these are scored with your confidence, and what you miss comes back for review.

Question 1

What is the amplitude of ∣11⟩\ket{11} in (H⊗H)∣01⟩(H\otimes H)\ket{01}?

  1. 12\tfrac12
  2. −12-\tfrac{1}{\sqrt2}
  3. 00
  4. −12-\tfrac12
Show the answer

D. −12-\tfrac12

(H⊗H)∣01⟩=H∣0⟩⊗H∣1⟩=12(∣0⟩+∣1⟩)⊗(∣0⟩−∣1⟩)(H\otimes H)\ket{01} = H\ket0\otimes H\ket1 = \tfrac12(\ket0+\ket1)\otimes(\ket0-\ket1). The ∣11⟩\ket{11} term is 12⋅(1)(−1)=−12\tfrac12\cdot(1)(-1) = -\tfrac12.

Question 2

For which φ\varphi is 12(∣00⟩+∣01⟩+∣10⟩+eiφ∣11⟩)\tfrac12(\ket{00}+\ket{01}+\ket{10}+e^{i\varphi}\ket{11}) a product state?

  1. φ=0\varphi = 0 only (mod 2π2\pi)
  2. φ=π\varphi = \pi only
  3. Every φ\varphi: phases never entangle
  4. No φ\varphi
Show the answer

A. φ=0\varphi = 0 only (mod 2π2\pi)

det⁡C=14(eiφ−1)\det C = \tfrac14(e^{i\varphi}-1), which vanishes only at φ=0\varphi = 0. At φ=π\varphi = \pi, ∣det⁡C∣=12\abs{\det C} = \tfrac12 and the state is maximally entangled: it is what a controlled-ZZ gate makes from ∣+⟩∣+⟩\ket{+}\ket{+}.

Question 3

You measure qubit 1 (the right qubit) of 13(∣00⟩+i∣01⟩+∣11⟩)\tfrac{1}{\sqrt3}(\ket{00}+i\ket{01}+\ket{11}) and get 11. What state is qubit 0 left in?

  1. ∣+i⟩\ket{+i}
  2. ∣1⟩\ket{1}
  3. ∣−i⟩\ket{-i}
  4. ∣+⟩\ket{+}
Show the answer

C. ∣−i⟩\ket{-i}

Keep the terms with qubit 1 equal to 11: i∣0⟩∣1⟩+∣1⟩∣1⟩i\ket{0}\ket1+\ket1\ket1. Qubit 0 is 12(i∣0⟩+∣1⟩)=i2(∣0⟩−i∣1⟩)\tfrac{1}{\sqrt2}(i\ket0+\ket1) = \tfrac{i}{\sqrt2}(\ket0-i\ket1), which is ∣−i⟩\ket{-i} up to a global phase.

Question 4

What is the reduced state ρA\rho_A of the singlet 12(∣01⟩−∣10⟩)\tfrac{1}{\sqrt2}(\ket{01}-\ket{10})?

  1. ∣0⟩ ⁣⟨0∣\dyad{0}
  2. ∣−⟩ ⁣⟨−∣\dyad{-}
  3. I/2I/2
  4. It is undefined, because the state is entangled
Show the answer

C. I/2I/2

C=12(01−10)C = \tfrac{1}{\sqrt2}\begin{pmatrix}0&1\\-1&0\end{pmatrix} and CC†=12ICC^\dagger = \tfrac12I. Like every Bell state, each half is maximally mixed.

Go deeper

Further reading

  • M. A. Nielsen & I. L. Chuang, Quantum Computation and Quantum Information, §2.1.7 (tensor products), §2.2.8 (composite systems) and §2.4.3 (the reduced density operator) (Cambridge, 2010).
  • N. D. Mermin, Quantum Computer Science: An Introduction, ch. 1 (Cambridge, 2007).
  • J. Preskill, Lecture Notes for Physics 219: Quantum Computation (Caltech), chapters on foundations and entanglement.