
# The Composite Systems Postulate

> The final postulate tells us how to combine systems: **take the tensor product**. From this one
> rule flow the exponential $2^n$ dimension of $n$-qubit space, the notion of **entanglement**, and the
> reason quantum computers can do things classical ones find hard. We built the tensor-product
> machinery in Term 0; here we adopt it as physics and set up Courses 1.4–1.5.

## Learning Objectives

After this lesson you will be able to:

1. State **Postulate 4** and use it to construct the state space of a multi-part system.
2. Combine subsystem states ($\otimes$) and operators ($A\otimes B$), and apply **local** operations.
3. Explain why the joint space has dimension $\prod_i d_i$ (hence $2^n$ for qubits).
4. Distinguish **product (separable)** from **entangled** joint states.
5. Build composite states and local operators in NumPy.

---

## Intuition

If you have a qubit Alice can hold and a qubit Bob can hold, what is "the state of both"? Not a pair of
single-qubit vectors — that could only ever describe *independent* qubits. Nature uses the **tensor
product**, which contains all such independent ("product") states **and** their superpositions. Those
extra superpositions — states that can't be split into "Alice's part $\otimes$ Bob's part" — are
**entangled**, and they have no classical analog. The cost (or gift) is dimensional: combining systems
*multiplies* dimensions, so $n$ qubits need $2^n$ amplitudes. That exponential is the whole game.

---

## Theory

### Postulate 4 (Composite systems)

> **Postulate 4.** The state space of a composite system is the **tensor product** of the state spaces
> of its components. If subsystems $1,\dots,m$ have spaces $\mathcal{H}_1,\dots,\mathcal{H}_m$, the
> joint space is
> $$ \mathcal{H} = \mathcal{H}_1 \otimes \mathcal{H}_2 \otimes \cdots \otimes \mathcal{H}_m . $$
> Moreover, if subsystem $i$ is prepared in state $\lvert\psi_i\rangle$, the joint state is the product
> $\lvert\psi_1\rangle\otimes\cdots\otimes\lvert\psi_m\rangle$.

For $n$ qubits, $\mathcal{H} = (\mathbb{C}^2)^{\otimes n} = \mathbb{C}^{2^n}$, with the computational
basis $\{\lvert q_0 q_1\cdots q_{n-1}\rangle\}$ indexed **big-endian** (qubit 0 leftmost/most-significant
— [Appendix C](../../appendix/C-notation-glossary.md)), matching Braket's bit-strings.

### Operators on the joint space; local operations

If $A$ acts on subsystem 1 and $B$ on subsystem 2, the joint operator is $A\otimes B$, acting by
$(A\otimes B)(\lvert\psi\rangle\otimes\lvert\phi\rangle) = (A\lvert\psi\rangle)\otimes(B\lvert\phi\rangle)$
([0.1.7](../../term-0-foundations/c01-linear-algebra/07-tensor-products.md)). A **local** operation on
subsystem 1 alone is $A\otimes I$ — it leaves subsystem 2 untouched. The mixed-product identity
$(A\otimes B)(C\otimes D) = AC\otimes BD$ and the unitarity/Hermiticity of tensor products carry over
verbatim from Term 0. Crucially:

> **Local unitaries cannot create entanglement.** $U_1\otimes U_2$ maps product states to product
> states. Generating entanglement requires a genuinely joint (entangling) gate such as **CNOT**
> (Term 2.1), which is *not* of the form $U_1\otimes U_2$.

### Dimension counting and the exponential wall

$\dim\mathcal{H} = \prod_i \dim\mathcal{H}_i$. For qubits this is $2^n$, *not* $2n$: state space grows
**exponentially** in the number of qubits. Fifty qubits already exceed any classical memory
([0.1.7 E2](../../term-0-foundations/c01-linear-algebra/07-tensor-products.md)). This is simultaneously
(i) why classical simulation of quantum systems is hard, and (ii) the space in which quantum algorithms
maneuver. It is the single most important structural fact about quantum computing.

### Product vs entangled states

A joint pure state is a **product (separable)** state if it factors,

$$
\lvert\Psi\rangle = \lvert\psi\rangle_1 \otimes \cdots \otimes \lvert\psi\rangle_m ,
$$

and **entangled** otherwise. For two qubits, $\lvert\Psi\rangle = \sum_{ij}c_{ij}\lvert ij\rangle$ is a
product state **iff** the coefficient matrix $C=(c_{ij})$ has rank $1$ (the Schmidt criterion from
[0.1.7](../../term-0-foundations/c01-linear-algebra/07-tensor-products.md), developed for physics in
[1.4.4](../c04-entanglement/04-schmidt-decomposition.md)). The canonical entangled state is the **Bell
state** $\lvert\Phi^+\rangle = \tfrac1{\sqrt2}(\lvert00\rangle + \lvert11\rangle)$, which we proved
non-factorable in [0.1.7](../../term-0-foundations/c01-linear-algebra/07-tensor-products.md). Entanglement
is the resource behind teleportation, superdense coding, and the CHSH violation — the entire content of
Course 1.4.

> **What "the state of one subsystem" means.** When the joint state is entangled, no pure state
> describes a single subsystem on its own; you must use the **reduced density matrix** (partial trace),
> which comes out *mixed*. That formalism is Course 1.5 — Postulate 4 is exactly what makes it
> necessary.

---

## Worked Examples

### Example 1 — Building a two-qubit product state and a local operation

Prepare qubit 0 in $\lvert+\rangle$ and qubit 1 in $\lvert0\rangle$:

$$
\lvert\Psi\rangle = \lvert+\rangle\otimes\lvert0\rangle = \tfrac1{\sqrt2}(\lvert0\rangle+\lvert1\rangle)\otimes\lvert0\rangle = \tfrac1{\sqrt2}(\lvert00\rangle + \lvert10\rangle).
$$

Apply a local $Z$ to qubit 0, i.e. $Z\otimes I$: $Z\lvert0\rangle = \lvert0\rangle$, $Z\lvert1\rangle = -\lvert1\rangle$, so

$$
(Z\otimes I)\lvert\Psi\rangle = \tfrac1{\sqrt2}(\lvert00\rangle - \lvert10\rangle) = \lvert-\rangle\otimes\lvert0\rangle .
$$

Still a product state — as guaranteed, a local operation can't entangle.

### Example 2 — Counting and reading amplitudes for 3 qubits

For $n=3$, $\dim = 2^3 = 8$. The state $\lvert\psi\rangle = \tfrac1{\sqrt2}(\lvert000\rangle + \lvert110\rangle)$
has amplitude $\tfrac1{\sqrt2}$ at big-endian indices $000_2 = 0$ and $110_2 = 6$, and $0$ elsewhere — a
length-8 vector $(\tfrac1{\sqrt2}, 0,0,0,0,0, \tfrac1{\sqrt2}, 0)^T$. Note qubit 2 is in $\lvert0\rangle$
and factors out: $\lvert\psi\rangle = \tfrac1{\sqrt2}(\lvert00\rangle+\lvert11\rangle)_{01}\otimes\lvert0\rangle_2$
— entangled across qubits 0,1 but unentangled with qubit 2.

---

## Hands-on (Python)

```python
import numpy as np
from functools import reduce

ket0 = np.array([1, 0], dtype=complex)
ket1 = np.array([0, 1], dtype=complex)
plus = (ket0 + ket1) / np.sqrt(2)
I = np.eye(2, dtype=complex)
Z = np.array([[1, 0], [0, -1]], dtype=complex)

def tensor(*xs):
    return reduce(np.kron, xs)            # big-endian: first arg is qubit 0

# Example 1: |+>|0>, then local Z on qubit 0 (Z ⊗ I):
psi = tensor(plus, ket0)
print(np.round(psi, 3))                   # [0.707 0 0.707 0]  = (|00>+|10>)/√2
out = tensor(Z, I) @ psi
print(np.round(out, 3))                   # [0.707 0 -0.707 0] = (|00>-|10>)/√2 = |->|0>
```

```python
# Dimension grows as 2^n:
for n in (1, 3, 10):
    print(n, "qubits ->", 2**n, "amplitudes")

# Separability test (Schmidt rank) for a 2-qubit state:
def schmidt_rank(state2q):
    return np.linalg.matrix_rank(state2q.reshape(2, 2), tol=1e-9)

bell = (tensor(ket0, ket0) + tensor(ket1, ket1)) / np.sqrt(2)   # |Φ+>
print(schmidt_rank(tensor(plus, ket0)))   # 1 -> product
print(schmidt_rank(bell))                  # 2 -> entangled

# Local unitaries can't entangle: (U⊗V) keeps a product state product.
U = np.array([[0,1],[1,0]], dtype=complex)   # X
V = plus_gate = np.array([[1,1],[1,-1]], dtype=complex)/np.sqrt(2)  # H
print(schmidt_rank(tensor(U, V) @ tensor(plus, ket0)))   # 1 -> still product
```

> **On Braket.** A circuit on $n$ qubits returns a length-$2^n$ amplitude vector (state-vector
> simulators) indexed exactly as `tensor(...)` here. The entangling work is done by two-qubit gates like
> `cnot`; you'll build your first multi-qubit circuits in [1.2](../c02-qubits-bloch/01-the-qubit.md) and
> Term 2.

---

## Exercises

**E1 (easy).** Write $\lvert1\rangle\otimes\lvert-\rangle$ as a 4-vector (big-endian) and list which
basis kets appear.

<details><summary>Solution</summary>

$\lvert1\rangle\otimes\tfrac1{\sqrt2}(\lvert0\rangle-\lvert1\rangle) = \tfrac1{\sqrt2}(\lvert10\rangle - \lvert11\rangle)
= \tfrac1{\sqrt2}(0,0,1,-1)^T$. Kets $\lvert10\rangle$ and $\lvert11\rangle$, amplitudes $\pm1/\sqrt2$.
</details>

**E2 (easy).** What is the dimension of the joint space of a qubit ($\mathbb{C}^2$) and a qutrit
($\mathbb{C}^3$)? Give an example product state.

<details><summary>Solution</summary>

$\dim = 2\cdot 3 = 6$. Example: $\lvert0\rangle\otimes\lvert2\rangle$ (qutrit basis $\{\lvert0\rangle,\lvert1\rangle,\lvert2\rangle\}$),
a 6-vector with a single $1$ in the slot for $(0,2)$.
</details>

**E3 (medium).** Show that $(A\otimes I)(I\otimes B) = A\otimes B = (I\otimes B)(A\otimes I)$ — local
operations on different subsystems commute.

<details><summary>Solution</summary>

By the mixed-product identity, $(A\otimes I)(I\otimes B) = (A\cdot I)\otimes(I\cdot B) = A\otimes B$, and
$(I\otimes B)(A\otimes I) = (I\cdot A)\otimes(B\cdot I) = A\otimes B$. Equal, so they commute. ∎
(Physically: Alice's and Bob's local gates don't interfere with each other's timing.)
</details>

**E4 (medium).** Decide whether $\tfrac12(\lvert00\rangle + \lvert01\rangle + \lvert10\rangle - \lvert11\rangle)$
is entangled; factor it if not.

<details><summary>Solution</summary>

$C = \tfrac12\begin{psmallmatrix}1 & 1\\ 1 & -1\end{psmallmatrix}$, $\det C = \tfrac14(-1-1) = -\tfrac12 \neq 0$,
so $\operatorname{rank}C = 2$ ⇒ **entangled**. (Interesting: it equals $(H\otimes H)$ applied to... check
— actually it is $\tfrac1{\sqrt2}(\lvert0\rangle\lvert+\rangle + \lvert1\rangle\lvert-\rangle)$, a Bell-like
entangled state.)
</details>

**E5 (hard).** Prove that a product of local unitaries $U_1\otimes U_2$ maps every product state to a
product state, and conclude that entanglement cannot be created by local operations alone.

<details><summary>Solution</summary>

For any product state $\lvert\psi\rangle\otimes\lvert\phi\rangle$, $(U_1\otimes U_2)(\lvert\psi\rangle\otimes\lvert\phi\rangle)
= (U_1\lvert\psi\rangle)\otimes(U_2\lvert\phi\rangle)$, again a product. Since the Schmidt rank is
invariant under local unitaries (they act as basis changes on each factor, preserving the rank of the
coefficient matrix $C \to U_1 C U_2^\top$, and unitaries don't change rank), a rank-1 (product) state
stays rank-1. Hence no sequence of purely local unitaries can raise the Schmidt rank above $1$ — you need
a joint entangling gate. ∎
</details>

---

## Checkpoint

1. State Postulate 4. What is $\dim\mathcal{H}$ for a composite system?
2. How do subsystem states and operators combine? What is a *local* operation?
3. Why is the dimension of $n$ qubits $2^n$, and why does that matter?
4. Define product vs entangled states and give the rank test for two qubits.
5. Can local unitaries create entanglement? Justify.

<details><summary>Answers</summary>

1. The joint space is the tensor product $\bigotimes_i\mathcal H_i$; its dimension is $\prod_i\dim\mathcal H_i$.
2. States combine by $\otimes$, operators by $A\otimes B$; a local operation acts as $A\otimes I$ on one subsystem.
3. Each qubit multiplies the dimension by $2$, giving $2^n$ — an exponential space that is both the source of quantum power and of classical-simulation hardness.
4. Product: factors as $\bigotimes_i\lvert\psi_i\rangle$; entangled: doesn't. Two qubits: separable iff the coefficient matrix has rank $1$.
5. No — $U_1\otimes U_2$ preserves Schmidt rank, so it maps product states to product states; entanglement needs a joint entangling gate.

</details>

---

## Further Reading

- **[NC]** Nielsen & Chuang, §2.2.8 (Postulate 4) and §2.2.8 on entanglement.
- **[Pre]** Preskill, *Ph219*, Ch. 2–4 — composite systems and entanglement.
- **[Wat]** Watrous, *Theory of Quantum Information*, Ch. 2 — tensor-product formalism for physics.

---

← Prev: [The Evolution Postulate](03-evolution-postulate.md) · Up: [Term 1](../README.md) · Next: [1.2.1 The Qubit](../c02-qubits-bloch/01-the-qubit.md) →
