
# Partial Trace & Reduced States

> You hold one qubit of an entangled pair; your collaborator across the galaxy holds the other. What
> is *your* qubit's state? Not a ket — there isn't one. The operation that answers the question is the
> **partial trace**, and its output, the **reduced density matrix**, is the single most important
> construction in quantum information after the density operator itself. It is how a pure global state
> becomes a mixed local one, how entanglement is quantified, and (Term 4) how an open system "feels"
> its environment. It also delivers a clean punchline: *the reduced state of a maximally entangled
> pair is the maximally mixed state* — total local ignorance born from perfect global knowledge.

## Learning Objectives

After this lesson you will be able to:

1. **Define** the partial trace $\rho_A = \operatorname{Tr}_B(\rho_{AB})$ operationally (on product
   operators) and by **index contraction**, and prove it yields a valid density operator.
2. **Justify** the partial trace as the *unique* operation reproducing local measurement statistics
   ($\operatorname{Tr}(\rho_A M_A) = \operatorname{Tr}(\rho_{AB}\,M_A\otimes I_B)$).
3. **Prove** the headline result: the reduced state of an **entangled pure** state is **mixed**, and
   compute $\rho_A = I/2$ for the Bell state $|\Phi^+\rangle$.
4. **State and apply purification**: every mixed state is a reduced state of a pure state on a larger
   space (Bell example).
5. **Articulate no-signaling**: a local operation on $B$ leaves $\rho_A$ unchanged.

---

## Intuition

A bipartite system $AB$ lives in $\mathcal H_A\otimes\mathcal H_B$
([0.1.7](../../term-0-foundations/c01-linear-algebra/07-tensor-products.md)). Suppose you only ever
touch subsystem $A$: every measurement you can do is of the form $M_A\otimes I_B$ — act on $A$, do
nothing to $B$. The question "what is the state of $A$?" can only mean: *what single operator $\rho_A$
on $\mathcal H_A$ reproduces all of these statistics?* That demand — match $\operatorname{Tr}(\rho_{AB}\,
M_A\otimes I_B)$ for every $M_A$ — has exactly one answer, and computing it is the partial trace.

The mechanical picture: the full $\operatorname{Tr}$ collapses *both* tensor factors to a number; the
**partial** trace $\operatorname{Tr}_B$ collapses *only* the $B$ factor, leaving an operator on $A$. You
are "summing $B$ out" — averaging over everything you cannot see. And here is the twist that makes
quantum mechanics strange: even when the global $\rho_{AB} = |\Psi\rangle\langle\Psi|$ is pure (maximal
knowledge), summing out an *entangled* partner injects genuine uncertainty into $A$. Knowledge of the
whole does **not** imply knowledge of the parts. That is the formal signature of entanglement, and the
rest of the lesson makes it precise and runs it in code.

---

## Theory

### Definition (operational form)

> **Definition (partial trace).** $\operatorname{Tr}_B : \mathcal L(\mathcal H_A\otimes\mathcal H_B)
> \to \mathcal L(\mathcal H_A)$ is the linear map defined on product operators by
> $$ \operatorname{Tr}_B\big(\,|a\rangle\langle a'|\otimes|b\rangle\langle b'|\,\big)
> = |a\rangle\langle a'|\;\langle b'|b\rangle , $$
> and extended **linearly** to all operators. The **reduced density matrix of $A$** is $\rho_A =
> \operatorname{Tr}_B(\rho_{AB})$. Symmetrically, $\rho_B = \operatorname{Tr}_A(\rho_{AB})$.

In words: leave the $A$ part of each term alone, and replace the $B$ part $|b\rangle\langle b'|$ by the
*number* $\langle b'|b\rangle = \operatorname{Tr}(|b\rangle\langle b'|)$ — you take the ordinary trace
on the $B$ factor only. This matches the preview in
[0.1.7](../../term-0-foundations/c01-linear-algebra/07-tensor-products.md). Since every operator on
$\mathcal H_A\otimes\mathcal H_B$ is a linear combination of product operators
$|a\rangle\langle a'|\otimes|b\rangle\langle b'|$ (these form a basis of $\mathcal L(\mathcal H_A\otimes
\mathcal H_B)$), linear extension defines $\operatorname{Tr}_B$ uniquely on everything.

### Index form (the computational definition)

Fix orthonormal bases $\{|i\rangle_A\}$ and $\{|\mu\rangle_B\}$. Any bipartite operator has matrix
elements $\langle i\mu|\,\rho_{AB}\,|j\nu\rangle =: (\rho_{AB})_{i\mu,\,j\nu}$. The partial trace
**sums over the repeated $B$ index**:

$$
\boxed{\;(\rho_A)_{ij} = \langle i|\rho_A|j\rangle = \sum_{\mu} \langle i\mu|\,\rho_{AB}\,|j\mu\rangle
= \sum_\mu (\rho_{AB})_{i\mu,\,j\nu=\mu}\;}
$$

**Derivation from the operational form.** Expand $\rho_{AB} = \sum_{i\mu,j\nu}(\rho_{AB})_{i\mu,j\nu}\,
|i\rangle\langle j|\otimes|\mu\rangle\langle\nu|$. Apply $\operatorname{Tr}_B$ termwise:
$\operatorname{Tr}_B(|i\rangle\langle j|\otimes|\mu\rangle\langle\nu|) = |i\rangle\langle j|\,
\langle\nu|\mu\rangle = \delta_{\mu\nu}\,|i\rangle\langle j|$. The Kronecker delta sets $\nu = \mu$ and
sums, giving $\rho_A = \sum_{ij}\big(\sum_\mu(\rho_{AB})_{i\mu,j\mu}\big)|i\rangle\langle j|$, which is
the boxed formula. ∎ Computationally this is a `reshape`-and-`einsum`: index $\rho_{AB}$ as a
4-tensor $\rho[i,\mu,j,\nu]$ and contract $\mu = \nu$ — exactly the code below.

### The defining property: partial trace reproduces local statistics

The operational definition is not arbitrary; it is *forced* by physics.

> **Theorem.** $\rho_A = \operatorname{Tr}_B(\rho_{AB})$ is the **unique** operator on $\mathcal H_A$
> such that, for every observable $M_A$ on $A$,
> $$ \operatorname{Tr}_A(\rho_A\,M_A) = \operatorname{Tr}_{AB}\big(\rho_{AB}\,(M_A\otimes I_B)\big). $$

This says: predicting any $A$-only measurement from the reduced state gives the same answer as
predicting it from the full state with $I_B$ on the untouched side — as it must.

**Proof.** *Existence.* For a product operator $\rho_{AB} = \sigma\otimes\tau$ (with $\sigma\in\mathcal
L(\mathcal H_A)$, $\tau\in\mathcal L(\mathcal H_B)$), $\operatorname{Tr}_B(\sigma\otimes\tau) =
\sigma\,\operatorname{Tr}(\tau)$ directly from the definition. Then

$$
\operatorname{Tr}_{AB}\big((\sigma\otimes\tau)(M_A\otimes I_B)\big)
= \operatorname{Tr}_{AB}\big((\sigma M_A)\otimes\tau\big)
= \operatorname{Tr}_A(\sigma M_A)\,\operatorname{Tr}_B(\tau)
= \operatorname{Tr}_A\big(\operatorname{Tr}_B(\sigma\otimes\tau)\,M_A\big),
$$

using the mixed-product identity and $\operatorname{Tr}(A\otimes B) = \operatorname{Tr} A
\operatorname{Tr} B$ ([Appendix E §4–5](../../appendix/E-math-identities.md)). By linearity it holds for
all $\rho_{AB}$. *Uniqueness.* If two operators $\rho_A,\rho_A'$ satisfied the identity for all $M_A$,
then $\operatorname{Tr}_A((\rho_A - \rho_A')M_A) = 0$ for all $M_A$; taking $M_A = (\rho_A - \rho_A')^\dagger$
gives $\operatorname{Tr}((\rho_A-\rho_A')^\dagger(\rho_A-\rho_A')) = 0$, i.e. the Hilbert–Schmidt norm
of the difference is zero, so $\rho_A = \rho_A'$. ∎

### The reduced state is a valid density operator

> **Proposition.** If $\rho_{AB}$ is a density operator, so is $\rho_A = \operatorname{Tr}_B(\rho_{AB})$.

**Proof.** *Hermitian:* taking $\dagger$ commutes with $\operatorname{Tr}_B$ (check on product
operators: $(\operatorname{Tr}_B(|a\rangle\langle a'|\otimes|b\rangle\langle b'|))^\dagger =
(\langle b'|b\rangle|a\rangle\langle a'|)^\dagger = \overline{\langle b'|b\rangle}|a'\rangle\langle a|
= \langle b|b'\rangle|a'\rangle\langle a| = \operatorname{Tr}_B(|a'\rangle\langle a|\otimes|b'\rangle\langle b|)$),
so $\rho_A^\dagger = \operatorname{Tr}_B(\rho_{AB}^\dagger) = \operatorname{Tr}_B(\rho_{AB}) = \rho_A$.
*Unit trace:* $\operatorname{Tr}_A(\rho_A) = \operatorname{Tr}_{AB}(\rho_{AB}) = 1$ (the iterated
partial traces equal the full trace). *Positive:* for any $|\varphi\rangle_A$, set $M_A =
|\varphi\rangle\langle\varphi|\succeq0$; by the defining identity $\langle\varphi|\rho_A|\varphi\rangle
= \operatorname{Tr}_A(\rho_A M_A) = \operatorname{Tr}_{AB}(\rho_{AB}\,M_A\otimes I_B) \ge 0$ because
$\rho_{AB}\succeq0$ and $M_A\otimes I_B\succeq0$ (the trace of a product of two PSD operators is
$\ge0$). ∎

### The headline result: entangled ⇒ mixed reduced state

Now the payoff. Take a **pure** global state $\rho_{AB} = |\Psi\rangle\langle\Psi|$. When is $\rho_A$
pure, and when is it mixed?

> **Theorem.** For a bipartite **pure** state $|\Psi\rangle\in\mathcal H_A\otimes\mathcal H_B$, the
> reduced state $\rho_A$ is **pure iff $|\Psi\rangle$ is a product state**, and **mixed iff
> $|\Psi\rangle$ is entangled**. Moreover $\rho_A$ and $\rho_B$ have the **same nonzero eigenvalues**.

**Proof (via the Schmidt decomposition).** By the Schmidt decomposition
([1.4.4](../c04-entanglement/04-schmidt-decomposition.md), built on the SVD of
[0.1.6](../../term-0-foundations/c01-linear-algebra/06-special-operators.md)), write
$$
|\Psi\rangle = \sum_{k=1}^{r}\sqrt{\lambda_k}\,|u_k\rangle_A\otimes|w_k\rangle_B,
\qquad \lambda_k > 0,\ \sum_k\lambda_k = 1,
$$
with $\{|u_k\rangle\}$, $\{|w_k\rangle\}$ orthonormal and $r$ the Schmidt rank. Then
$$
\rho_{AB} = \sum_{k,l}\sqrt{\lambda_k\lambda_l}\,|u_k\rangle\langle u_l|\otimes|w_k\rangle\langle w_l|,
$$
and tracing out $B$ (using $\operatorname{Tr}_B(|w_k\rangle\langle w_l|) = \langle w_l|w_k\rangle =
\delta_{kl}$):
$$
\boxed{\;\rho_A = \operatorname{Tr}_B(\rho_{AB}) = \sum_{k=1}^{r}\lambda_k\,|u_k\rangle\langle u_k|\;}
$$
So the **eigenvalues of $\rho_A$ are exactly the squared Schmidt coefficients $\lambda_k$**. By the
symmetric computation, $\rho_B = \sum_k\lambda_k|w_k\rangle\langle w_l|$ has the *same* eigenvalues.

If $|\Psi\rangle$ is a **product** state, $r = 1$, one $\lambda_1 = 1$: $\rho_A = |u_1\rangle\langle u_1|$
is **pure**. If $|\Psi\rangle$ is **entangled**, $r \ge 2$, so at least two $\lambda_k\in(0,1)$:
$\operatorname{Tr}(\rho_A^2) = \sum_k\lambda_k^2 < (\sum_k\lambda_k)^2 = 1$, hence **mixed** (Lesson 1's
purity bound, with strict inequality whenever two weights are nonzero). ∎

This is striking: a pure $|\Psi\rangle$ carries *all* the information about $AB$, yet $\rho_A$ — your
complete local description — is mixed. The "missing" information is not in $A$ or in $B$ separately; it
lives in the **correlations** between them. The purity of $\rho_A$ becomes a *measure* of entanglement
(the basis of the **entropy of entanglement** $S(\rho_A) = -\sum_k\lambda_k\log\lambda_k$, Term 4 and
beyond).

### Worked engine: $\rho_A = I/2$ for the Bell state

Take the Bell state ([1.4.2](../c04-entanglement/02-bell-states.md))
$|\Phi^+\rangle = \tfrac1{\sqrt2}(|00\rangle + |11\rangle)$. Its density operator is

$$
\rho_{AB} = |\Phi^+\rangle\langle\Phi^+|
= \tfrac12\big(|00\rangle + |11\rangle\big)\big(\langle00| + \langle11|\big)
= \tfrac12\big(|00\rangle\langle00| + |00\rangle\langle11| + |11\rangle\langle00| + |11\rangle\langle11|\big).
$$

Rewrite each term as $|a\rangle\langle a'|_A\otimes|b\rangle\langle b'|_B$ and apply $\operatorname{Tr}_B$,
which replaces $|b\rangle\langle b'|$ by $\langle b'|b\rangle$:

$$
\begin{aligned}
\operatorname{Tr}_B\big(|00\rangle\langle00|\big) &= |0\rangle\langle0|_A\,\langle0|0\rangle_B = |0\rangle\langle0|, \\
\operatorname{Tr}_B\big(|00\rangle\langle11|\big) &= |0\rangle\langle1|_A\,\langle1|0\rangle_B = 0, \\
\operatorname{Tr}_B\big(|11\rangle\langle00|\big) &= |1\rangle\langle0|_A\,\langle0|1\rangle_B = 0, \\
\operatorname{Tr}_B\big(|11\rangle\langle11|\big) &= |1\rangle\langle1|_A\,\langle1|1\rangle_B = |1\rangle\langle1|.
\end{aligned}
$$

The two off-diagonal (coherence) terms are **killed** by the orthogonality $\langle 1|0\rangle = 0$ —
this is the crux. Summing the survivors:

$$
\boxed{\;\rho_A = \tfrac12\big(|0\rangle\langle0| + |1\rangle\langle1|\big) = \tfrac12 I\;}
$$

The reduced state of a maximally entangled pair is **maximally mixed**: purity
$\operatorname{Tr}(\rho_A^2) = \tfrac12$, the smallest a qubit allows. Globally you know everything (a
single pure ket); locally you know *nothing* (a fair coin in every basis). The Schmidt coefficients are
$\lambda_1 = \lambda_2 = \tfrac12$, confirming maximal entanglement.

### Purification

The headline result has a powerful converse.

> **Theorem (purification).** Every density operator $\rho_A$ on $\mathcal H_A$ is the reduced state of
> some **pure** state $|\Psi\rangle_{AB}$ on $\mathcal H_A\otimes\mathcal H_B$ with $\dim\mathcal H_B \ge
> \operatorname{rank}(\rho_A)$. We call $|\Psi\rangle$ a **purification** of $\rho_A$.

**Proof (construction).** Diagonalize $\rho_A = \sum_k\lambda_k|u_k\rangle\langle u_k|$ (Lesson 1). Pick
an orthonormal set $\{|w_k\rangle\}$ in a reference system $\mathcal H_B$ and define
$$
|\Psi\rangle = \sum_k\sqrt{\lambda_k}\,|u_k\rangle_A\otimes|w_k\rangle_B .
$$
This is normalized ($\langle\Psi|\Psi\rangle = \sum_k\lambda_k = 1$) and pure, and by the Schmidt
computation above $\operatorname{Tr}_B(|\Psi\rangle\langle\Psi|) = \sum_k\lambda_k|u_k\rangle\langle u_k|
= \rho_A$. ∎

Purification is the formal statement that **every mixed state can be seen as part of a larger pure
state** — classical uncertainty is "really" entanglement with a system you are ignoring (a
*reference*, or, physically, the *environment*). This "go to the church of the larger Hilbert space"
move underpins quantum channels and the Stinespring dilation in Term 4.

**Bell example.** For $\rho_A = \tfrac12 I$ we have $\lambda_1 = \lambda_2 = \tfrac12$,
$|u_k\rangle = |k\rangle$. Choosing $|w_k\rangle = |k\rangle$ rebuilds
$|\Psi\rangle = \tfrac1{\sqrt2}(|00\rangle + |11\rangle) = |\Phi^+\rangle$ — the Bell state *is* a
purification of the maximally mixed qubit. (Purifications are not unique: any $|w_k'\rangle = V|w_k\rangle$
for unitary $V$ on $B$ gives another, e.g. $\tfrac1{\sqrt2}(|0+\rangle + |1-\rangle)$ — the freedom
matching Lesson 1's ensemble ambiguity.)

### No-signaling

Suppose your distant collaborator performs *any* physical operation on $B$ alone — a unitary $U_B$, a
measurement, even discarding it. Can that change *your* $\rho_A$? No.

> **No-signaling (unitary case).** If $\rho_{AB}\to (I_A\otimes U_B)\rho_{AB}(I_A\otimes U_B)^\dagger$,
> then $\rho_A$ is **unchanged**.

**Proof.** Using $\operatorname{Tr}_B((I_A\otimes U_B)\,M\,(I_A\otimes U_B^\dagger))$ and cyclicity
*within the $B$ factor*: on a product operator $\sigma\otimes\tau$,
$$
\operatorname{Tr}_B\big((I\otimes U_B)(\sigma\otimes\tau)(I\otimes U_B^\dagger)\big)
= \operatorname{Tr}_B\big(\sigma\otimes U_B\tau U_B^\dagger\big)
= \sigma\,\operatorname{Tr}(U_B\tau U_B^\dagger)
= \sigma\,\operatorname{Tr}(\tau) = \operatorname{Tr}_B(\sigma\otimes\tau),
$$
and linear extension gives $\operatorname{Tr}_B((I\otimes U_B)\rho_{AB}(I\otimes U_B^\dagger)) =
\operatorname{Tr}_B(\rho_{AB}) = \rho_A$. ∎ (For a measurement on $B$, the same holds after averaging
over $B$'s outcomes — Term 1.3.)

This is *why entanglement cannot transmit information*: Alice's local description is immune to anything
Bob does. Bob can correlate his outcomes with Alice's (that is what entanglement *is*), but he cannot
steer her marginal $\rho_A$ — consistent with relativity, and the reason the Bell-state correlations of
[Term 1.4](../c04-entanglement/03-nonlocality-chsh.md) coexist peacefully with no faster-than-light
signaling.

---

## Worked Examples

### Example 1 — A product state has a *pure* reduced state

Take the separable $|\Psi\rangle = |+\rangle_A\otimes|0\rangle_B$. Then $\rho_{AB} =
|+\rangle\langle+|\otimes|0\rangle\langle0|$ is a product operator, so

$$
\rho_A = \operatorname{Tr}_B\big(|+\rangle\langle+|\otimes|0\rangle\langle0|\big)
= |+\rangle\langle+|\,\operatorname{Tr}(|0\rangle\langle0|)
= |+\rangle\langle+|\cdot 1 = |+\rangle\langle+| .
$$

The reduced state is pure ($\operatorname{Tr}(\rho_A^2) = 1$) — exactly as the theorem predicts for a
product state (Schmidt rank $1$). Contrast this with the Bell state, where the *same* qubit $A$ comes
out maximally mixed. The difference is entanglement, full stop.

### Example 2 — A partially entangled state: tunable purity

Consider $|\Psi_\theta\rangle = \cos\theta\,|00\rangle + \sin\theta\,|11\rangle$ (already in Schmidt
form: $\sqrt{\lambda_1} = \cos\theta$, $\sqrt{\lambda_2} = \sin\theta$, orthonormal local bases
$\{|0\rangle,|1\rangle\}$). Then

$$
\rho_A = \cos^2\theta\,|0\rangle\langle0| + \sin^2\theta\,|1\rangle\langle1|
= \begin{pmatrix}\cos^2\theta & 0\\ 0 & \sin^2\theta\end{pmatrix},
$$

with purity

$$
\operatorname{Tr}(\rho_A^2) = \cos^4\theta + \sin^4\theta = 1 - 2\sin^2\theta\cos^2\theta
= 1 - \tfrac12\sin^2(2\theta).
$$

This interpolates continuously between the extremes: at $\theta = 0$ the state is the product
$|00\rangle$ and purity $= 1$ (pure $\rho_A$); at $\theta = \tfrac\pi4$ it is $|\Phi^+\rangle$ and
purity $= 1 - \tfrac12 = \tfrac12$ (maximally mixed). So the reduced purity is a **dial for the amount
of entanglement** — minimized exactly at the maximally entangled point. We will see in Lesson 3 that
this corresponds to the Bloch vector shrinking from the sphere ($|\vec r| = 1$) to the center
($|\vec r| = 0$) as $\theta: 0\to\tfrac\pi4$.

---

## Hands-on (Python)

We implement the partial trace via `reshape`/`einsum`, confirm $\rho_A = I/2$ for $|\Phi^+\rangle$,
watch the purity drop, and check no-signaling numerically.

```python
import numpy as np

# Big-endian: qubit A = index 0 (leftmost), qubit B = index 1.
ket0 = np.array([1, 0], dtype=complex)
ket1 = np.array([0, 1], dtype=complex)

def partial_trace_B(rho_AB, dimA=2, dimB=2):
    """
    Tr_B(ρ_AB): contract the B factor of a bipartite density matrix.
    Reshape the (dA·dB)×(dA·dB) matrix into a 4-tensor ρ[i, μ, j, ν]
    (row = (i,μ), col = (j,ν)), then sum the diagonal over the B indices μ=ν.
    """
    t = rho_AB.reshape(dimA, dimB, dimA, dimB)   # ρ[i, μ, j, ν]
    return np.einsum('imjm->ij', t)              # Σ_μ ρ[i, μ, j, μ]

def partial_trace_A(rho_AB, dimA=2, dimB=2):
    """Tr_A(ρ_AB): contract the A factor instead (sum the A index k=k)."""
    t = rho_AB.reshape(dimA, dimB, dimA, dimB)   # ρ[k, μ, k, ν]
    return np.einsum('kmkn->mn', t)              # Σ_k ρ[k, μ, k, ν] -> operator on B

def purity(rho):
    return np.trace(rho @ rho).real
```

```python
# Build the Bell state |Φ+⟩ = (|00⟩ + |11⟩)/√2 and its density matrix (big-endian).
ket00 = np.kron(ket0, ket0)
ket11 = np.kron(ket1, ket1)
phi_plus = (ket00 + ket11) / np.sqrt(2)
rho_AB = np.outer(phi_plus, phi_plus.conj())

print("Global purity Tr(ρ_AB²):", round(purity(rho_AB), 6))   # 1.0  (pure global state)

rho_A = partial_trace_B(rho_AB)
print("ρ_A =\n", np.round(rho_A, 6))
print("Is ρ_A = I/2 ?", np.allclose(rho_A, np.eye(2) / 2))     # True
print("Local purity Tr(ρ_A²):", round(purity(rho_A), 6))       # 0.5  -> maximally mixed!

# Entangled pure global state (purity 1) -> mixed local state (purity 1/2).
```

```python
# Tunable entanglement: |Ψθ⟩ = cosθ|00⟩ + sinθ|11⟩ (Worked Example 2).
for theta in [0.0, np.pi/8, np.pi/4]:
    psi = np.cos(theta) * ket00 + np.sin(theta) * ket11
    rho = np.outer(psi, psi.conj())
    rA = partial_trace_B(rho)
    print(f"θ={theta:.4f}  Tr(ρ_A²)={purity(rA):.4f}  "
          f"(predicted 1 - ½sin²2θ = {1 - 0.5*np.sin(2*theta)**2:.4f})")
# θ=0     -> 1.0000 (product, pure ρ_A)
# θ=π/4   -> 0.5000 (Bell, maximally mixed) -- minimum purity = max entanglement
```

```python
# No-signaling: any local unitary on B leaves ρ_A untouched.
H = np.array([[1, 1], [1, -1]], dtype=complex) / np.sqrt(2)
S = np.array([[1, 0], [0, 1j]], dtype=complex)
U_B = S @ H                                   # an arbitrary unitary on B
op = np.kron(np.eye(2), U_B)                  # I_A ⊗ U_B
rho_AB_after = op @ rho_AB @ op.conj().T
rho_A_after = partial_trace_B(rho_AB_after)
print("ρ_A unchanged by Bob's operation?", np.allclose(rho_A_after, rho_A))  # True
```

```python
# Optional cross-check on Braket's LocalSimulator (free): density-matrix simulator
# reproduces ρ_A = I/2 for the Bell state. Deep Braket intro is Term 2 — basic pattern only.
try:
    from braket.circuits import Circuit
    from braket.devices import LocalSimulator

    bell = Circuit().h(0).cnot(0, 1)          # prepares (|00⟩+|11⟩)/√2, big-endian
    dm_sim = LocalSimulator("braket_dm")      # density-matrix local simulator
    full_rho = dm_sim.run(bell.density_matrix(), shots=0).result().values[0]
    rho_A_braket = partial_trace_B(np.asarray(full_rho))
    print("Braket ρ_A = I/2 ?", np.allclose(rho_A_braket, np.eye(2) / 2))
except Exception as e:                        # SDK not installed / offline — NumPy result already proved it
    print("Braket optional check skipped:", type(e).__name__)
```

> **Why `einsum`?** Indexing $\rho_{AB}$ as the 4-tensor $\rho[i,\mu,j,\nu]$ makes the index definition
> literal: `'imjm->ij'` says "fix free indices $i,j$ on $A$, sum the repeated $B$ index $\mu$." For $n$
> qubits, reshape to $2n$ axes and contract the traced-out subset — the same idea scales (with the
> usual exponential memory cost of dense simulation, [0.1.7](../../term-0-foundations/c01-linear-algebra/07-tensor-products.md)).

---

## Exercises

**E1 (easy).** Compute $\rho_B = \operatorname{Tr}_A(|\Phi^+\rangle\langle\Phi^+|)$ and confirm it
equals $\rho_A = \tfrac12 I$. What does the equality of eigenvalues say in general?

<details><summary>Solution</summary>

By the symmetric calculation (trace out $A$ instead, using $\langle 1|0\rangle_A = 0$ to kill the
coherences), $\rho_B = \tfrac12(|0\rangle\langle0| + |1\rangle\langle1|) = \tfrac12 I = \rho_A$. In
general $\rho_A$ and $\rho_B$ share the **same nonzero eigenvalues** (the squared Schmidt coefficients),
so they have equal purity and equal entropy — the entanglement is a symmetric property of the *pair*.
</details>

**E2 (easy).** For the product state $|\Psi\rangle = |0\rangle_A\otimes|+\rangle_B$, compute $\rho_A$
and $\rho_B$ and state their purities.

<details><summary>Solution</summary>

$\rho_{AB} = |0\rangle\langle0|\otimes|+\rangle\langle+|$ is a product operator, so $\rho_A =
|0\rangle\langle0|\,\operatorname{Tr}(|+\rangle\langle+|) = |0\rangle\langle0|$ and $\rho_B =
|+\rangle\langle+|\,\operatorname{Tr}(|0\rangle\langle0|) = |+\rangle\langle+|$. Both pure: purity $= 1$.
A product state has pure reduced states on both sides (Schmidt rank 1).
</details>

**E3 (medium).** Show that $\operatorname{Tr}_B$ followed by $\operatorname{Tr}_A$ equals the full
trace: $\operatorname{Tr}_A(\operatorname{Tr}_B(\rho_{AB})) = \operatorname{Tr}_{AB}(\rho_{AB})$.

<details><summary>Solution</summary>

On a product operator $|a\rangle\langle a'|\otimes|b\rangle\langle b'|$:
$\operatorname{Tr}_B(\cdot) = \langle b'|b\rangle\,|a\rangle\langle a'|$, then $\operatorname{Tr}_A(\cdot)
= \langle b'|b\rangle\langle a'|a\rangle$. Meanwhile $\operatorname{Tr}_{AB}(|a\rangle\langle a'|\otimes
|b\rangle\langle b'|) = \operatorname{Tr}(|a\rangle\langle a'|)\operatorname{Tr}(|b\rangle\langle b'|) =
\langle a'|a\rangle\langle b'|b\rangle$ — the same number. Linearity extends to all $\rho_{AB}$. ∎ (In
particular $\operatorname{Tr}\rho_A = \operatorname{Tr}\rho_{AB} = 1$, reconfirming $\rho_A$ is unit-trace.)
</details>

**E4 (medium).** Let $\rho_{AB} = \tfrac12|00\rangle\langle00| + \tfrac12|11\rangle\langle11|$ — the
*classically correlated* (separable, mixed) cousin of the Bell state. Compute $\rho_A$. Compare with the
Bell-state reduced state and explain why they coincide despite very different global states.

<details><summary>Solution</summary>

$\operatorname{Tr}_B(|00\rangle\langle00|) = |0\rangle\langle0|$ and $\operatorname{Tr}_B(|11\rangle\langle11|)
= |1\rangle\langle1|$ (no cross terms exist here), so $\rho_A = \tfrac12(|0\rangle\langle0| +
|1\rangle\langle1|) = \tfrac12 I$ — identical to the Bell-state $\rho_A$. The reduced state cannot tell
a *quantum-entangled* global state from a *classically correlated* one: both look maximally mixed
locally. The distinction lives in correlations and only shows up in joint measurements (e.g. CHSH,
[Term 1.4](../c04-entanglement/03-nonlocality-chsh.md)) — the local marginal throws that information
away. This is exactly the ensemble ambiguity of Lesson 1, viewed through the partial trace.
</details>

**E5 (hard).** Prove that $\operatorname{Tr}_B(\rho_{AB})$ is independent of the orthonormal basis
$\{|\mu\rangle_B\}$ used in the index definition $\sum_\mu\langle i\mu|\rho_{AB}|j\mu\rangle$.

<details><summary>Solution</summary>

Let $\{|\mu'\rangle_B\}$ be another ONB, related by a unitary $U$ on $B$: $|\mu'\rangle = \sum_\nu
U_{\nu\mu}|\nu\rangle$. Then $\sum_\mu\langle i\mu'|\rho_{AB}|j\mu'\rangle = \sum_{\mu,\nu,\sigma}
\overline{U_{\nu\mu}}U_{\sigma\mu}\langle i\nu|\rho_{AB}|j\sigma\rangle = \sum_{\nu,\sigma}\big(\sum_\mu
U_{\sigma\mu}\overline{U_{\nu\mu}}\big)\langle i\nu|\rho_{AB}|j\sigma\rangle$. The inner sum is
$(UU^\dagger)_{\sigma\nu} = \delta_{\sigma\nu}$, collapsing to $\sum_\nu\langle i\nu|\rho_{AB}|j\nu\rangle$ —
the original expression. So $\operatorname{Tr}_B$ is basis-independent (as it must be, being defined
operationally without reference to a basis). ∎
</details>

**E6 (hard).** Use the Schmidt decomposition to prove that **any** purification of a given $\rho_A$ is
related to the canonical one $\sum_k\sqrt{\lambda_k}|u_k\rangle_A|w_k\rangle_B$ by an isometry on the
purifying system $B$ (assuming $\dim\mathcal H_B$ is large enough). Conclude purifications are unique up
to such an isometry.

<details><summary>Solution</summary>

Let $|\Psi\rangle = \sum_k\sqrt{\lambda_k}|u_k\rangle_A|w_k\rangle_B$ and $|\Psi'\rangle =
\sum_k\sqrt{\lambda_k}|u_k\rangle_A|w_k'\rangle_{B'}$ both purify $\rho_A = \sum_k\lambda_k|u_k\rangle\langle u_k|$
(same $A$-Schmidt vectors and coefficients, since these are fixed by $\rho_A$'s spectral
decomposition). Define $W:\mathcal H_B\to\mathcal H_{B'}$ on the relevant subspace by $W|w_k\rangle =
|w_k'\rangle$; since both $\{|w_k\rangle\}$ and $\{|w_k'\rangle\}$ are orthonormal, $W$ is an isometry
($W^\dagger W = I$ on its support). Then $(I_A\otimes W)|\Psi\rangle = \sum_k\sqrt{\lambda_k}|u_k\rangle
W|w_k\rangle = |\Psi'\rangle$. Hence any two purifications differ by an isometry on $B$ (a unitary when
$\dim\mathcal H_B = \dim\mathcal H_{B'}$). ∎ This is the operator-level statement of "the freedom of
purification," and it is the source of Lesson 1's ensemble ambiguity (HJW): different bases
$\{|w_k\rangle\}$ for the reference correspond to different ensembles realizing the *same* $\rho_A$.
</details>

---

## Checkpoint

1. Define the partial trace on product operators and in index form. Which $B$-index gets summed?
2. What property forces the partial trace to be exactly this map (and not some other "discard $B$")?
3. State and justify in one line: the reduced state of an entangled pure state is mixed.
4. Compute $\rho_A$ for $|\Phi^+\rangle$ and give its purity. What does global-pure / local-mixed mean?
5. State purification and no-signaling, and say what each is "for."

<details><summary>Answers</summary>

1. $\operatorname{Tr}_B(|a\rangle\langle a'|\otimes|b\rangle\langle b'|) = \langle b'|b\rangle\,
   |a\rangle\langle a'|$; in indices $(\rho_A)_{ij} = \sum_\mu\langle i\mu|\rho_{AB}|j\mu\rangle$ —
   the repeated $B$ index $\mu$ is summed (set $\nu = \mu$).
2. It is the *unique* map with $\operatorname{Tr}_A(\rho_A M_A) = \operatorname{Tr}_{AB}(\rho_{AB}\,
   M_A\otimes I_B)$ for all $M_A$, i.e. it reproduces all local measurement statistics.
3. Schmidt: $\rho_A = \sum_k\lambda_k|u_k\rangle\langle u_k|$ with eigenvalues $=$ squared Schmidt
   coefficients; entangled means $\ge2$ nonzero $\lambda_k$, so $\operatorname{Tr}\rho_A^2 < 1$ — mixed.
4. $\rho_A = \tfrac12 I$, purity $\tfrac12$ (maximally mixed). Global-pure/local-mixed: you know the
   whole pair perfectly yet know nothing about either qubit alone — the information is in the correlations.
5. Purification: every mixed $\rho_A$ is $\operatorname{Tr}_B$ of a pure $|\Psi\rangle_{AB}$ — for
   treating mixedness as entanglement with a reference/environment (channels, Term 4). No-signaling:
   local operations on $B$ leave $\rho_A$ fixed — for ruling out faster-than-light signaling via
   entanglement.

</details>

---

## Further Reading

- **[NC]** Nielsen & Chuang, §2.4.3 (reduced density operator & partial trace), §2.5 (Schmidt
  decomposition & purification).
- **[Pre]** Preskill, *Ph219*, Ch. 2 — partial trace, the "church of the larger Hilbert space," and
  no-signaling.
- **[Wat]** Watrous, *Theory of Quantum Information*, Ch. 2 — partial trace as a linear map and its
  characterization.
- **[Wil]** Wilde, *Quantum Information Theory*, Ch. 5 — purification and the reduced-state formalism.
- **[Appendix E §4–5](../../appendix/E-math-identities.md)** — trace and Kronecker identities used in the proofs.

---

← Prev: [The Density Operator](01-density-operator.md) · Up: [Term 1](../README.md) · Next: [The Bloch Ball & Purity](03-bloch-ball-purity.md) →
