Documentation

CslibFrontier.Foundations.Quantum.DensityMatrix

Density matrices and the partial trace #

A density matrix on ℂ^ι is a positive semidefinite matrix of trace one (Cslib.Quantum.IsDensityMatrix), the general (mixed) state of a quantum system; a unit vector ψ gives the pure state |ψ⟩⟨ψ| (Cslib.Quantum.pureState) (de Wolf, §15.1). For a bipartite system ℂ^{ι × κ}, the partial trace over the first system (Cslib.Quantum.partialTraceLeft) gives the reduced state of the second, (Tr_A ρ)_{k k'} = ∑ᵢ ρ_{(i, k), (i, k')}, and symmetrically Cslib.Quantum.partialTraceRight gives the reduced state of the first (de Wolf, §18.3, where Tr_B is defined on product matrices by Tr_B (C ⊗ D) = C · Tr D and extended linearly).

The partial trace preserves the trace and positive semidefiniteness, so it maps density matrices to density matrices; on a Kronecker product it is Tr_A (A ⊗ₖ B) = tr A • B. An operator A on the traced-out system can be moved cyclically under Tr_A, which gives no-signalling (Cslib.Quantum.partialTraceLeft_kraus): whatever Alice does to her system, as a Kraus family {Kⱼ} with ∑ⱼ Kⱼᴴ Kⱼ = 1 (a unitary, a measurement whose outcome is discarded, ...), Bob's reduced state is unchanged. This generalizes de Wolf, Chapter 18, Exercise 7 ("Alice cannot give information to Bob by doing a unitary operation on her part of an entangled pure state") from unitaries on pure states to Kraus families on mixed states.

Main definitions #

Main results #

References #

Density matrices #

structure Cslib.Quantum.IsDensityMatrix {ι : Type u_1} [Fintype ι] (ρ : Matrix ι ι ℂ) :

A density matrix: positive semidefinite with trace one.

  • posSemidef : ρ.PosSemidef

    A density matrix is positive semidefinite.

  • trace_eq_one : ρ.trace = 1

    A density matrix has trace one.

noncomputable def Cslib.Quantum.pureState {ι : Type u_1} (ψ : EuclideanSpace ℂ ι) :
Matrix ι ι ℂ

The pure state |ψ⟩⟨ψ|, with entries ψᵢ conj ψⱼ.

@[simp]
theorem Cslib.Quantum.pureState_apply {ι : Type u_1} (ψ : EuclideanSpace ℂ ι) (i j : ι) :
pureState ψ i j = ψ.ofLp i * star (ψ.ofLp j)
theorem Cslib.Quantum.trace_pureState {ι : Type u_1} [Fintype ι] (ψ : EuclideanSpace ℂ ι) :
(pureState ψ).trace = ↑(‖ψ‖ ^ 2)

|ψ⟩⟨ψ| is a density matrix for a unit vector ψ.

theorem Cslib.Quantum.IsDensityMatrix.conj_isometry {ι : Type u_1} {ι' : Type u_2} [Fintype ι] [Fintype ι'] [DecidableEq ι] {ρ : Matrix ι ι ℂ} (hρ : IsDensityMatrix ρ) {V : Matrix ι' ι ℂ} (hV : V.conjTranspose * V = 1) :

Conjugation by a possibly rectangular isometry preserves density matrices.

theorem Cslib.Quantum.IsDensityMatrix.conj_unitary {ι : Type u_1} [Fintype ι] [DecidableEq ι] {ρ : Matrix ι ι ℂ} (hρ : IsDensityMatrix ρ) {U : Matrix ι ι ℂ} (hU : U ∈ Matrix.unitaryGroup ι ℂ) :

Unitary evolution ρ ↦ U ρ Uᴴ preserves density matrices.

The partial trace #

def Cslib.Quantum.partialTraceLeft {ι : Type u_1} {κ : Type u_3} {R : Type u_4} [Fintype ι] [AddCommMonoid R] (ρ : Matrix (ι × κ) (ι × κ) R) :
Matrix κ κ R

The partial trace over the first system: the reduced state Tr_A ρ of the second system, (Tr_A ρ)_{k k'} = ∑ᵢ ρ_{(i, k), (i, k')}.

def Cslib.Quantum.partialTraceRight {ι : Type u_1} {κ : Type u_3} {R : Type u_4} [Fintype κ] [AddCommMonoid R] (ρ : Matrix (ι × κ) (ι × κ) R) :
Matrix ι ι R

The partial trace over the second system: the reduced state Tr_B ρ of the first system, (Tr_B ρ)_{i i'} = ∑ₖ ρ_{(i, k), (i', k)}.

@[simp]
theorem Cslib.Quantum.partialTraceLeft_apply {ι : Type u_1} {κ : Type u_3} {R : Type u_4} [Fintype ι] [AddCommMonoid R] (ρ : Matrix (ι × κ) (ι × κ) R) (k k' : κ) :
partialTraceLeft ρ k k' = ∑ i : ι, ρ (i, k) (i, k')
@[simp]
theorem Cslib.Quantum.partialTraceRight_apply {ι : Type u_1} {κ : Type u_3} {R : Type u_4} [Fintype κ] [AddCommMonoid R] (ρ : Matrix (ι × κ) (ι × κ) R) (i i' : ι) :
partialTraceRight ρ i i' = ∑ k : κ, ρ (i, k) (i', k)
theorem Cslib.Quantum.partialTraceLeft_add {ι : Type u_1} {κ : Type u_3} {R : Type u_4} [Fintype ι] [AddCommMonoid R] (ρ σ : Matrix (ι × κ) (ι × κ) R) :
theorem Cslib.Quantum.partialTraceLeft_sum {ι : Type u_1} {κ : Type u_3} {R : Type u_4} [Fintype ι] [AddCommMonoid R] {α : Type u_5} (s : Finset α) (ρ : α → Matrix (ι × κ) (ι × κ) R) :
partialTraceLeft (∑ a ∈ s, ρ a) = ∑ a ∈ s, partialTraceLeft (ρ a)
theorem Cslib.Quantum.partialTraceLeft_smul {ι : Type u_1} {κ : Type u_3} {R : Type u_4} [Fintype ι] [Semiring R] (c : R) (ρ : Matrix (ι × κ) (ι × κ) R) :
theorem Cslib.Quantum.partialTraceRight_add {ι : Type u_1} {κ : Type u_3} {R : Type u_4} [Fintype κ] [AddCommMonoid R] (ρ σ : Matrix (ι × κ) (ι × κ) R) :
theorem Cslib.Quantum.partialTraceRight_sum {ι : Type u_1} {κ : Type u_3} {R : Type u_4} [Fintype κ] [AddCommMonoid R] {α : Type u_5} (s : Finset α) (ρ : α → Matrix (ι × κ) (ι × κ) R) :
partialTraceRight (∑ a ∈ s, ρ a) = ∑ a ∈ s, partialTraceRight (ρ a)
theorem Cslib.Quantum.partialTraceRight_smul {ι : Type u_1} {κ : Type u_3} {R : Type u_4} [Fintype κ] [Semiring R] (c : R) (ρ : Matrix (ι × κ) (ι × κ) R) :
theorem Cslib.Quantum.trace_partialTraceLeft {ι : Type u_1} {κ : Type u_3} {R : Type u_4} [Fintype ι] [Fintype κ] [AddCommMonoid R] (ρ : Matrix (ι × κ) (ι × κ) R) :

The partial trace over the first system preserves the trace.

theorem Cslib.Quantum.trace_partialTraceRight {ι : Type u_1} {κ : Type u_3} {R : Type u_4} [Fintype ι] [Fintype κ] [AddCommMonoid R] (ρ : Matrix (ι × κ) (ι × κ) R) :

The partial trace over the second system preserves the trace.

theorem Cslib.Quantum.partialTraceLeft_kronecker {ι : Type u_1} {κ : Type u_3} {R : Type u_4} [Fintype ι] [CommSemiring R] (A : Matrix ι ι R) (B : Matrix κ κ R) :
partialTraceLeft (Matrix.kroneckerMap (fun (x1 x2 : R) => x1 * x2) A B) = A.trace • B

Tr_A (A ⊗ₖ B) = tr A • B.

theorem Cslib.Quantum.partialTraceRight_kronecker {ι : Type u_1} {κ : Type u_3} {R : Type u_4} [Fintype κ] [CommSemiring R] (A : Matrix ι ι R) (B : Matrix κ κ R) :
partialTraceRight (Matrix.kroneckerMap (fun (x1 x2 : R) => x1 * x2) A B) = B.trace • A

Tr_B (A ⊗ₖ B) = tr B • A.

theorem Cslib.Quantum.partialTraceLeft_eq_sum_submatrix {ι : Type u_1} {κ : Type u_3} {R : Type u_4} [Fintype ι] [AddCommMonoid R] (ρ : Matrix (ι × κ) (ι × κ) R) :
partialTraceLeft ρ = ∑ i : ι, ρ.submatrix (fun (k : κ) => (i, k)) fun (k : κ) => (i, k)

The partial trace over the first system is a sum of compressions ρ ↦ ρ_{(i, ·), (i, ·)}.

theorem Cslib.Quantum.partialTraceRight_eq_sum_submatrix {ι : Type u_1} {κ : Type u_3} {R : Type u_4} [Fintype κ] [AddCommMonoid R] (ρ : Matrix (ι × κ) (ι × κ) R) :
partialTraceRight ρ = ∑ k : κ, ρ.submatrix (fun (i : ι) => (i, k)) fun (i : ι) => (i, k)
theorem Cslib.Quantum.posSemidef_partialTraceLeft {ι : Type u_1} {κ : Type u_3} [Fintype ι] {ρ : Matrix (ι × κ) (ι × κ) ℂ} (hρ : ρ.PosSemidef) :

The partial trace over the first system preserves positive semidefiniteness.

theorem Cslib.Quantum.posSemidef_partialTraceRight {ι : Type u_1} {κ : Type u_3} [Fintype κ] {ρ : Matrix (ι × κ) (ι × κ) ℂ} (hρ : ρ.PosSemidef) :

The partial trace over the second system preserves positive semidefiniteness.

theorem Cslib.Quantum.IsDensityMatrix.partialTraceLeft {ι : Type u_1} {κ : Type u_3} [Fintype ι] [Fintype κ] {ρ : Matrix (ι × κ) (ι × κ) ℂ} (hρ : IsDensityMatrix ρ) :

The reduced state Tr_A ρ of a density matrix is a density matrix.

The reduced state Tr_B ρ of a density matrix is a density matrix.

The reduced state of either half of the maximally entangled state is maximally mixed: Tr_A |Φ⟩⟨Φ| = 1 / |ι| (de Wolf, §18.3, for the EPR pair).

Tr_B |Φ⟩⟨Φ| = 1 / |ι| for the maximally entangled state.

No-signalling #

theorem Cslib.Quantum.partialTraceLeft_kronecker_one_mul {ι : Type u_1} {ι' : Type u_2} {κ : Type u_3} {R : Type u_4} [Fintype ι] [Fintype ι'] [Fintype κ] [DecidableEq κ] [CommSemiring R] (A : Matrix ι' ι R) (ρ : Matrix (ι × κ) (ι' × κ) R) :
partialTraceLeft (Matrix.kroneckerMap (fun (x1 x2 : R) => x1 * x2) A 1 * ρ) = partialTraceLeft (ρ * Matrix.kroneckerMap (fun (x1 x2 : R) => x1 * x2) A 1)

A possibly rectangular operator on the traced-out first system moves cyclically under the partial trace. The two sides trace out the respective output and input systems.

theorem Cslib.Quantum.partialTraceLeft_kraus {ι : Type u_1} {ι' : Type u_2} {κ : Type u_3} [Fintype ι] [Fintype ι'] [Fintype κ] [DecidableEq ι] [DecidableEq κ] {α : Type u_5} (s : Finset α) (K : α → Matrix ι' ι ℂ) (hK : ∑ j ∈ s, (K j).conjTranspose * K j = 1) (ρ : Matrix (ι × κ) (ι × κ) ℂ) :
partialTraceLeft (∑ j ∈ s, Matrix.kroneckerMap (fun (x1 x2 : ℂ) => x1 * x2) (K j) 1 * ρ * (Matrix.kroneckerMap (fun (x1 x2 : ℂ) => x1 * x2) (K j) 1).conjTranspose) = partialTraceLeft ρ

No-signalling for a Kraus family on the first system, with possibly different input and output dimensions: if Alice applies the operation ρ ↦ ∑ⱼ (Kⱼ ⊗ 1) ρ (Kⱼ ⊗ 1)ᴴ with ∑ⱼ Kⱼᴴ Kⱼ = 1, Bob's reduced state Tr_A ρ is unchanged. This generalizes de Wolf, Chapter 18, Exercise 7, from a unitary on a pure state to a Kraus family on a mixed state.

theorem Cslib.Quantum.partialTraceLeft_conj_unitary {ι : Type u_1} {κ : Type u_3} [Fintype ι] [Fintype κ] [DecidableEq ι] [DecidableEq κ] {U : Matrix ι ι ℂ} (hU : U ∈ Matrix.unitaryGroup ι ℂ) (ρ : Matrix (ι × κ) (ι × κ) ℂ) :
partialTraceLeft (Matrix.kroneckerMap (fun (x1 x2 : ℂ) => x1 * x2) U 1 * ρ * (Matrix.kroneckerMap (fun (x1 x2 : ℂ) => x1 * x2) U 1).conjTranspose) = partialTraceLeft ρ

No-signalling for a local unitary (de Wolf, Chapter 18, Exercise 7, for mixed states): a unitary U applied by Alice leaves Bob's reduced state unchanged.

theorem Cslib.Quantum.partialTraceLeft_measure {ι : Type u_1} {κ : Type u_3} [Fintype ι] [Fintype κ] [DecidableEq ι] [DecidableEq κ] (ρ : Matrix (ι × κ) (ι × κ) ℂ) :
partialTraceLeft (∑ i : ι, Matrix.kroneckerMap (fun (x1 x2 : ℂ) => x1 * x2) (Matrix.single i i 1) 1 * ρ * (Matrix.kroneckerMap (fun (x1 x2 : ℂ) => x1 * x2) (Matrix.single i i 1) 1).conjTranspose) = partialTraceLeft ρ

No-signalling for a measurement: if Alice measures her system in the computational basis and the outcome is discarded, ρ ↦ ∑ᵢ (|i⟩⟨i| ⊗ 1) ρ (|i⟩⟨i| ⊗ 1), Bob's reduced state is unchanged.