intermediate · Physics · Density Matrices & Mixed States
The Partial Trace
The partial trace is the operation that produces a subsystem's state from a joint state. It is the
quantum generalization of marginalizing a joint probability distribution.
Definition on product operators
For an operator that factorizes, M=A⊗B, the partial trace over the second system is defined
by
TrB(A⊗B)=ATr(B).
It traces the B factor down to a number and leaves the A factor alone. Because every operator on
HA⊗HB is a linear combination of such product operators, this single rule
plus linearity defines TrB on everything.
You sum over the diagonal of the traced-out system while keeping the surviving system's indices open.
Tracing out A instead is symmetric: (TrAρ)bb′=∑a⟨a,b∣ρ∣a,b′⟩.
Key properties
Trace-preserving:Tr(TrBρ)=Tr(ρ),
so ρA stays a valid density operator.
Recovers factors of product states: if ρAB=ρA⊗ρB then
TrB(ρAB)=ρATr(ρB)=ρA, since ρB has trace 1.
Completely positive: it maps valid states to valid states even when applied to part of a larger
system — a property essential to the theory of open systems and noise channels.
Marginalization analogy
If ρ were a classical joint distribution p(a,b) written as a diagonal matrix, the partial trace
over B would compute ∑bp(a,b)=p(a) — the ordinary marginal. The partial trace is exactly this
operation lifted to operators, where it also correctly handles the off-diagonal coherences that have no
classical counterpart.
Try it
Build the product state ρAB=ρA⊗ρB with ρA=diag(0.8,0.2)
and ρB=diag(0.5,0.5) via the Kronecker product, then trace out B and return the
(0,0) entry. It should return 0.8, recovering ρA exactly.
Run your code to see the quantum state.
Sign in on the full site to ask questions and join the discussion.