chars int64 40 24k | content_type stringclasses 9
values | id stringlengths 13 64 | source stringclasses 5
values | subset stringclasses 31
values | text stringlengths 40 24k |
|---|---|---|---|---|---|
181 | leanexplore_declaration | leanexplore:378505 | leanexplore_sqlite | leanexplore_declarations | def prod (ρ₁ : MState d₁) (ρ₂ : MState d₂) : MState (d₁ × d₂) where
M := ρ₁.M ⊗ₖ ρ₂.M
nonneg := HermitianMat.zero_le_iff.mpr (ρ₁.psd.PosSemidef_kronecker ρ₂.psd)
tr := by simp |
477 | leanexplore_declaration | leanexplore:378507 | leanexplore_sqlite | leanexplore_declarations | theorem prod_inner_prod (ξ1 ψ1 : MState d₁) (ξ2 ψ2 : MState d₂) :
⟪ξ1 ⊗ᴹ ξ2, ψ1 ⊗ᴹ ψ2⟫_Prob = ⟪ξ1, ψ1⟫_Prob * ⟪ξ2, ψ2⟫_Prob := by
ext1
simp only [inner_def, Prob.coe_mul, ← Complex.ofReal_inj]
--Lots of this should actually be facts about HermitianMat first
simp only [prod, Complex.ofReal_mul]
simp only [... |
237 | leanexplore_declaration | leanexplore:378508 | leanexplore_sqlite | leanexplore_declarations | /-- The product of pure states is a pure product state , `Ket.prod`. -/
theorem pure_prod_pure (ψ₁ : Ket d₁) (ψ₂ : Ket d₂) : pure (ψ₁ ⊗ᵠ ψ₂) = (pure ψ₁) ⊗ᴹ (pure ψ₂) := by
ext : 3
simp [Ket.prod, Ket.apply, prod, -mat_apply]
ac_rfl |
305 | leanexplore_declaration | leanexplore:378509 | leanexplore_sqlite | leanexplore_declarations | /-- A representation of a classical distribution as a quantum state, diagonal in the given basis. -/
def ofClassical (dist : ProbDistribution d) : MState d where
M := diagonal ℂ (fun x ↦ dist x)
nonneg := by simp [zero_le_iff, diagonal, Matrix.posSemidef_diagonal_iff]
tr := by simp [trace_diagonal] |
120 | leanexplore_declaration | leanexplore:378510 | leanexplore_sqlite | leanexplore_declarations | @[simp]
theorem coe_ofClassical (dist : ProbDistribution d) :
(ofClassical dist).M = diagonal ℂ (dist ·) := by
rfl |
169 | leanexplore_declaration | leanexplore:378511 | leanexplore_sqlite | leanexplore_declarations | theorem ofClassical_pow (dist : ProbDistribution d) (p : ℝ) :
(ofClassical dist).M ^ p = diagonal ℂ (fun i ↦ (dist i) ^ p) := by
rw [coe_ofClassical, diagonal_pow] |
111 | leanexplore_declaration | leanexplore:378512 | leanexplore_sqlite | leanexplore_declarations | /-- The maximally mixed state. -/
def uniform [Nonempty d] : MState d :=
ofClassical ProbDistribution.uniform |
694 | leanexplore_declaration | leanexplore:378513 | leanexplore_sqlite | leanexplore_declarations | /-- There is exactly one state on a dimension-1 system. -/
--note that this still takes (and uses) the `Fintype d` and `DecidableEq d` instances on `MState d`.
--Even though instances for those can be derived from `Unique d`, we want this `Unique` instance to
--apply on `@MState d ?x ?y` for _any_ x and y.
instance ins... |
184 | leanexplore_declaration | leanexplore:378514 | leanexplore_sqlite | leanexplore_declarations | /-- There exists a mixed state for every nonempty `d`.
Here, the maximally mixed one is chosen. -/
instance instInhabited [Nonempty d] : Inhabited (MState d) where
default := uniform |
69 | leanexplore_declaration | leanexplore:378515 | leanexplore_sqlite | leanexplore_declarations | lemma default_eq [Nonempty d] : (default : MState d) = uniform := rfl |
106 | leanexplore_declaration | leanexplore:378516 | leanexplore_sqlite | leanexplore_declarations | @[simp]
theorem M_default [Unique d] : (default : MState d).M = 1 := by
simp [default_eq, uniform]
rfl |
206 | leanexplore_declaration | leanexplore:378517 | leanexplore_sqlite | leanexplore_declarations | /-- Partial tracing out the left half of a system. -/
@[simps]
def traceLeft (ρ : MState (d₁ × d₂)) : MState d₂ where
M := ρ.M.traceLeft
nonneg := zero_le_iff.mpr ρ.psd.traceLeft
tr := by simp [trace] |
84 | leanexplore_declaration | leanexplore:378518 | leanexplore_sqlite | leanexplore_declarations | @[simps]
def traceLeft (ρ : MState (d₁ × d₂)) : MState d₂ where
M := ρ.M.traceLeft |
210 | leanexplore_declaration | leanexplore:378519 | leanexplore_sqlite | leanexplore_declarations | /-- Partial tracing out the right half of a system. -/
@[simps]
def traceRight (ρ : MState (d₁ × d₂)) : MState d₁ where
M := ρ.M.traceRight
nonneg := zero_le_iff.mpr ρ.psd.traceRight
tr := by simp [trace] |
86 | leanexplore_declaration | leanexplore:378520 | leanexplore_sqlite | leanexplore_declarations | @[simps]
def traceRight (ρ : MState (d₁ × d₂)) : MState d₁ where
M := ρ.M.traceRight |
213 | leanexplore_declaration | leanexplore:378521 | leanexplore_sqlite | leanexplore_declarations | /-- Taking the direct product on the left and tracing it back out gives the same state. -/
@[simp]
theorem traceLeft_prod_eq (ρ₁ : MState d₁) (ρ₂ : MState d₂) : (ρ₁ ⊗ᴹ ρ₂).traceLeft = ρ₂ := by
ext1
simp [prod] |
216 | leanexplore_declaration | leanexplore:378522 | leanexplore_sqlite | leanexplore_declarations | /-- Taking the direct product on the right and tracing it back out gives the same state. -/
@[simp]
theorem traceRight_prod_eq (ρ₁ : MState d₁) (ρ₂ : MState d₂) : (ρ₁ ⊗ᴹ ρ₂).traceRight = ρ₁ := by
ext1
simp [prod] |
3,136 | leanexplore_declaration | leanexplore:378523 | leanexplore_sqlite | leanexplore_declarations | /-- Spectrum of direct product. There is a permutation σ so that the spectrum of the direct product of
ρ₁ and ρ₂, as permuted under σ, is the pairwise products of the spectra of ρ₁ and ρ₂. -/
theorem spectrum_prod (ρ₁ : MState d₁) (ρ₂ : MState d₂) : ∃(σ : d₁ × d₂ ≃ d₁ × d₂),
∀i, ∀j, (ρ₁ ⊗ᴹ ρ₂).spectrum (σ (i, j))... |
728 | leanexplore_declaration | leanexplore:378524 | leanexplore_sqlite | leanexplore_declarations | theorem sInf_spectrum_prod (ρ : MState d) (σ : MState d₂) :
sInf (_root_.spectrum ℝ (ρ ⊗ᴹ σ).m) = sInf (_root_.spectrum ℝ ρ.m) * sInf (_root_.spectrum ℝ σ.m) := by
rcases isEmpty_or_nonempty d with _ | _; · simp
rcases isEmpty_or_nonempty d₂ with _ | _; · simp
rw [MState.m, MState.prod, HermitianMat.spectrum_... |
396 | leanexplore_declaration | leanexplore:378525 | leanexplore_sqlite | leanexplore_declarations | /-- A mixed state is separable iff it can be written as a convex combination of product mixed states. -/
def IsSeparable (ρ : MState (d₁ × d₂)) : Prop :=
∃ ρLRs : Finset (MState d₁ × MState d₂), --Finite set of (ρL, ρR) pairs
∃ ps : ProbDistribution ρLRs, --ProbDistribution over those pairs, an ensemble
ρ.M... |
283 | leanexplore_declaration | leanexplore:378526 | leanexplore_sqlite | leanexplore_declarations | /-- A product state `MState.prod` is separable. -/
theorem IsSeparable_prod (ρ₁ : MState d₁) (ρ₂ : MState d₂) : IsSeparable (ρ₁ ⊗ᴹ ρ₂) := by
let only := (ρ₁, ρ₂)
use { only }, ProbDistribution.constant ⟨only, Finset.mem_singleton_self only⟩
simp [prod, Unique.eq_default, only] |
2,809 | leanexplore_declaration | leanexplore:378527 | leanexplore_sqlite | leanexplore_declarations | theorem eq_of_sum_eq_pure {d : Type*} [Fintype d] [DecidableEq d]
{ι : Type*} {s : Finset ι} {p : ι → ℝ} {ρs : ι → MState d}
{ρ : MState d} (h_pure : ρ.purity = 1) (h_sum : ρ.M = ∑ i ∈ s, p i • (ρs i).M)
(hp_nonneg : ∀ i ∈ s, 0 ≤ p i) (hp_sum : ∑ i ∈ s, p i = 1) (i : ι) (hi : i ∈ s) (hpi : 0 < p i) :
ρs... |
219 | leanexplore_declaration | leanexplore:378528 | leanexplore_sqlite | leanexplore_declarations | theorem purity_prod {d₁ d₂ : Type*} [Fintype d₁] [Fintype d₂] [DecidableEq d₁] [DecidableEq d₂]
(ρ₁ : MState d₁) (ρ₂ : MState d₂) : (ρ₁ ⊗ᴹ ρ₂).purity = ρ₁.purity * ρ₂.purity := by
exact prod_inner_prod ρ₁ ρ₁ ρ₂ ρ₂ |
1,904 | leanexplore_declaration | leanexplore:378529 | leanexplore_sqlite | leanexplore_declarations | theorem pure_eq_pure_iff {d : Type*} [Fintype d] [DecidableEq d] (ψ φ : Ket d) :
pure ψ = pure φ ↔ ∃ z : ℂ, ‖z‖ = 1 ∧ ψ.vec = z • φ.vec := by
refine' ⟨ fun h => _, fun h => _ ⟩;
· -- By definition of pure state, we have that ψ.vec * conj ψ.vec = φ.vec * conj φ.vec.
have h_eq : ∀ i j, ψ.vec i * starRingEnd ℂ... |
266 | leanexplore_declaration | leanexplore:378530 | leanexplore_sqlite | leanexplore_declarations | /-- Two kets are phase-equivalent if and only if their pure states are equal. -/
theorem PhaseEquiv_iff_pure_eq {d : Type*} [Fintype d] [DecidableEq d] (ψ φ : Ket d) :
Ket.PhaseEquiv.r ψ φ ↔ MState.pure ψ = MState.pure φ := by
exact (pure_eq_pure_iff ψ φ).symm |
239 | leanexplore_declaration | leanexplore:378531 | leanexplore_sqlite | leanexplore_declarations | /-- `MState.pure` descends to the quotient `KetUpToPhase`. -/
def pureQ {d : Type*} [Fintype d] [DecidableEq d] : KetUpToPhase d → MState d :=
@Quotient.lift _ _ Ket.PhaseEquiv MState.pure (fun a b h => (PhaseEquiv_iff_pure_eq a b).mp h) |
142 | leanexplore_declaration | leanexplore:378532 | leanexplore_sqlite | leanexplore_declarations | @[simp]
theorem pureQ_mk {d : Type*} [Fintype d] [DecidableEq d] (ψ : Ket d) :
pureQ (Quotient.mk Ket.PhaseEquiv ψ) = MState.pure ψ := rfl |
267 | leanexplore_declaration | leanexplore:378533 | leanexplore_sqlite | leanexplore_declarations | theorem pureQ_injective {d : Type*} [Fintype d] [DecidableEq d] : Function.Injective (pureQ (d := d)) := by
intro a b h
induction a using Quotient.ind
induction b using Quotient.ind
simp [pureQ] at h
exact Quotient.sound ((PhaseEquiv_iff_pure_eq _ _).mpr h) |
3,431 | leanexplore_declaration | leanexplore:378534 | leanexplore_sqlite | leanexplore_declarations | theorem pure_separable_imp_IsProd {d₁ d₂ : Type*} [Fintype d₁] [Fintype d₂] [DecidableEq d₁] [DecidableEq d₂]
(ψ : Ket (d₁ × d₂)) (h : IsSeparable (pure ψ)) : ψ.IsProd := by
obtain ⟨ ρLRs, ps, hps ⟩ := h;
-- Since `pure ψ` is pure (`purity = 1`), by `MState.eq_of_sum_eq_pure`, for any `k` with `p_k > 0`, we hav... |
303 | leanexplore_declaration | leanexplore:378535 | leanexplore_sqlite | leanexplore_declarations | /-- A pure state is separable iff the ket is a product state. -/
theorem pure_separable_iff_IsProd (ψ : Ket (d₁ × d₂)) :
IsSeparable (pure ψ) ↔ ψ.IsProd := by
apply Iff.intro
· exact pure_separable_imp_IsProd ψ
· rintro ⟨ ξ, φ, rfl ⟩
rw [pure_prod_pure ξ φ]
exact IsSeparable_prod _ _; |
4,072 | leanexplore_declaration | leanexplore:378536 | leanexplore_sqlite | leanexplore_declarations | /--
A mixed state is pure if and only if its rank is 1.
-/
theorem pure_iff_rank_eq_one {d : Type*} [Fintype d] [DecidableEq d] (ρ : MState d) :
(∃ ψ, ρ = pure ψ) ↔ ρ.m.rank = 1 := by
constructor <;> intro h;
· obtain ⟨w, rfl⟩ := h
-- The rank of the outer product of a vector with itself is 1.
have h_ra... |
2,925 | leanexplore_declaration | leanexplore:378537 | leanexplore_sqlite | leanexplore_declarations | /--
A ket on a product space is a product state if and only if its coefficient matrix has rank 1.
-/
theorem Ket.IsProd_iff_rank_eq_one {d₁ d₂ : Type*} [Fintype d₁] [Fintype d₂] [DecidableEq d₁] [DecidableEq d₂]
(ψ : Ket (d₁ × d₂)) :
ψ.IsProd ↔ (Matrix.of (fun i j => ψ (i, j))).rank = 1 := by
rw [ Ket.IsProd_... |
855 | leanexplore_declaration | leanexplore:378538 | leanexplore_sqlite | leanexplore_declarations | /-- A pure state is separable iff the partial trace on the left is pure. -/
theorem pure_separable_iff_traceLeft_pure (ψ : Ket (d₁ × d₂)) : IsSeparable (pure ψ) ↔
∃ ψ₁, pure ψ₁ = (pure ψ).traceLeft := by
have h1 := MState.pure_separable_iff_IsProd ψ;
have h2 := Ket.IsProd_iff_rank_eq_one ψ;
have h3 := MState.... |
967 | leanexplore_declaration | leanexplore:378539 | leanexplore_sqlite | leanexplore_declarations | /-- The purification of a mixed state. Always uses the full dimension of the Hilbert space (d) to
purify, so e.g. an existing pure state with d=4 still becomes d=16 in the purification. The defining
property is `MState.traceRight_of_purify`; see also `MState.purify'` for the bundled version. -/
def purify (ρ : MState... |
1,607 | leanexplore_declaration | leanexplore:378540 | leanexplore_sqlite | leanexplore_declarations | /-- The defining property of purification, that tracing out the purifying system gives the
original mixed state. -/
@[simp]
theorem purify_spec (ρ : MState d) : (pure ρ.purify).traceRight = ρ := by
ext i j
simp_rw [purify, traceRight, HermitianMat.traceRight, Matrix.traceRight]
simp only [Matrix.IsHermitian.eige... |
195 | leanexplore_declaration | leanexplore:378541 | leanexplore_sqlite | leanexplore_declarations | /-- `MState.purify` bundled with its defining property `MState.traceRight_of_purify`. -/
def purifyX (ρ : MState d) : { ψ : Ket (d × d) // (pure ψ).traceRight = ρ } :=
⟨ρ.purify, ρ.purify_spec⟩ |
159 | leanexplore_declaration | leanexplore:378542 | leanexplore_sqlite | leanexplore_declarations | @[simps]
def relabel (ρ : MState d₁) (e : d₂ ≃ d₁) : MState d₂ where
M := ρ.M.reindex e.symm
nonneg := by simp [zero_le_iff, ρ.psd]
tr := by simp [trace] |
94 | leanexplore_declaration | leanexplore:378543 | leanexplore_sqlite | leanexplore_declarations | @[simps]
def relabel (ρ : MState d₁) (e : d₂ ≃ d₁) : MState d₂ where
M := ρ.M.reindex e.symm |
109 | leanexplore_declaration | leanexplore:378544 | leanexplore_sqlite | leanexplore_declarations | @[simp]
theorem relabel_m (ρ : MState d₁) (e : d₂ ≃ d₁) :
(ρ.relabel e).m = ρ.m.submatrix e e := by
rfl |
137 | leanexplore_declaration | leanexplore:378545 | leanexplore_sqlite | leanexplore_declarations | @[simp]
theorem relabel_refl {d : Type*} [Fintype d] [DecidableEq d] (ρ : MState d) :
ρ.relabel (Equiv.refl d) = ρ := by
ext
simp |
275 | leanexplore_declaration | leanexplore:378546 | leanexplore_sqlite | leanexplore_declarations | /-- Relabeling a pure state by a bijection yields another pure state. -/
theorem relabel_pure_exists (ψ : Ket d₁) (e : d₂ ≃ d₁) :
∃ ψ' : Ket d₂, (pure ψ).relabel e = pure ψ' := by
refine ⟨⟨fun i => ψ (e i), ?_⟩, rfl⟩
rw [← ψ.normalized', Fintype.sum_equiv e]
congr! |
252 | leanexplore_declaration | leanexplore:378547 | leanexplore_sqlite | leanexplore_declarations | @[simp]
theorem relabel_relabel {d d₂ d₃ : Type*}
[Fintype d] [DecidableEq d] [Fintype d₂] [DecidableEq d₂] [Fintype d₃] [DecidableEq d₃]
(ρ : MState d) (e : d₂ ≃ d) (e₂ : d₃ ≃ d₂) : (ρ.relabel e).relabel e₂ = ρ.relabel (e₂.trans e) := by
rfl |
308 | leanexplore_declaration | leanexplore:378548 | leanexplore_sqlite | leanexplore_declarations | theorem eq_relabel_iff {d₁ d₂ : Type u} [Fintype d₁] [DecidableEq d₁] [Fintype d₂] [DecidableEq d₂]
(ρ : MState d₁) (σ : MState d₂) (h : d₁ ≃ d₂) :
ρ = σ.relabel h ↔ ρ.relabel h.symm = σ := by
simp only [MState.ext_iff, HermitianMat.ext_iff, mat_M, relabel_m]
exact ⟨(by simp[·]), (by simp[← ·])⟩ |
252 | leanexplore_declaration | leanexplore:378549 | leanexplore_sqlite | leanexplore_declarations | theorem relabel_comp {d₁ d₂ d₃ : Type*} [Fintype d₁] [DecidableEq d₁] [Fintype d₂] [DecidableEq d₂]
[Fintype d₃] [DecidableEq d₃] (ρ : MState d₁) (e : d₂ ≃ d₁) (f : d₃ ≃ d₂) :
(ρ.relabel e).relabel f = ρ.relabel (f.trans e) := by
ext
simp |
392 | leanexplore_declaration | leanexplore:378550 | leanexplore_sqlite | leanexplore_declarations | theorem relabel_cast {d₁ d₂ : Type u} [Fintype d₁] [DecidableEq d₁]
[Fintype d₂] [DecidableEq d₂]
(ρ : MState d₁) (e : d₂ = d₁) :
ρ.relabel (Equiv.cast e) = cast (by have := e.symm; congr <;> (apply Subsingleton.helim; congr)) ρ := by
ext i j
simp only [relabel_M, mat_reindex, mat_M, Matrix.reindex_a... |
505 | leanexplore_declaration | leanexplore:378551 | leanexplore_sqlite | leanexplore_declarations | @[simp]
theorem spectrum_relabel {ρ : MState d} (e : d₂ ≃ d) :
_root_.spectrum ℝ (ρ.relabel e).m = _root_.spectrum ℝ ρ.m := by
ext1 v
rw [spectrum.mem_iff] --TODO make a plain `Matrix` version of this
rw [Algebra.algebraMap_eq_smul_one v]
rw [MState.relabel_m, ← Matrix.submatrix_one_equiv e]
rw [← Matrix.... |
229 | leanexplore_declaration | leanexplore:378552 | leanexplore_sqlite | leanexplore_declarations | /-- The purity of a state is invariant under relabeling of the basis. -/
@[simp]
theorem purity_relabel (ρ : MState d₁) (e : d₂ ≃ d₁) : (ρ.relabel e).purity = ρ.purity := by
simp [purity, inner_def, -inner_self_eq_norm_sq_to_K] |
386 | leanexplore_declaration | leanexplore:378553 | leanexplore_sqlite | leanexplore_declarations | /-- The heterogeneous SWAP gate that exchanges the left and right halves of a quantum system.
This can apply even when the two "halves" are of different types, as opposed to (say) the SWAP
gate on quantum circuits that leaves the qubit dimensions unchanged. Notably, it is not unitary. -/
def SWAP (ρ : MState (d₁ × ... |
1,618 | leanexplore_declaration | leanexplore:378554 | leanexplore_sqlite | leanexplore_declarations | /--
The multiset of values in the spectrum of a relabeled state is the same as the multiset of values in the spectrum of the original state.
-/
lemma multiset_spectrum_relabel_eq {d₁ d₂ : Type*} [Fintype d₁] [DecidableEq d₁] [Fintype d₂] [DecidableEq d₂]
(ρ : MState d₁) (e : d₂ ≃ d₁) :
Multiset.map (ρ.relabel e... |
387 | leanexplore_declaration | leanexplore:378555 | leanexplore_sqlite | leanexplore_declarations | def spectrum_SWAP (ρ : MState (d₁ × d₂)) : ∃ e, ρ.SWAP.spectrum.relabel e = ρ.spectrum := by
-- Apply the lemma exists_equiv_of_multiset_map_eq with the appropriate parameters.
obtain ⟨w, h⟩ := exists_equiv_of_multiset_map_eq (fun p => ρ.spectrum p) (fun p => ρ.SWAP.spectrum p)
(ρ.multiset_spectrum_relabel_eq (... |
75 | leanexplore_declaration | leanexplore:378556 | leanexplore_sqlite | leanexplore_declarations | @[simp]
theorem SWAP_SWAP (ρ : MState (d₁ × d₂)) : ρ.SWAP.SWAP = ρ :=
rfl |
96 | leanexplore_declaration | leanexplore:378557 | leanexplore_sqlite | leanexplore_declarations | @[simp]
theorem traceLeft_SWAP (ρ : MState (d₁ × d₂)) : ρ.SWAP.traceLeft = ρ.traceRight :=
rfl |
97 | leanexplore_declaration | leanexplore:378558 | leanexplore_sqlite | leanexplore_declarations | @[simp]
theorem traceRight_SWAP (ρ : MState (d₁ × d₂)) : ρ.SWAP.traceRight = ρ.traceLeft :=
rfl |
180 | leanexplore_declaration | leanexplore:378559 | leanexplore_sqlite | leanexplore_declarations | /-- The associator that re-clusters the parts of a quantum system. -/
def assoc (ρ : MState ((d₁ × d₂) × d₃)) : MState (d₁ × d₂ × d₃) :=
ρ.relabel (Equiv.prodAssoc d₁ d₂ d₃).symm |
168 | leanexplore_declaration | leanexplore:378560 | leanexplore_sqlite | leanexplore_declarations | /-- The associator that re-clusters the parts of a quantum system. -/
def assoc' (ρ : MState (d₁ × d₂ × d₃)) : MState ((d₁ × d₂) × d₃) :=
ρ.SWAP.assoc.SWAP.assoc.SWAP |
89 | leanexplore_declaration | leanexplore:378561 | leanexplore_sqlite | leanexplore_declarations | @[simp]
theorem assoc_assoc' (ρ : MState (d₁ × d₂ × d₃)) : ρ.assoc'.assoc = ρ := by
rfl |
91 | leanexplore_declaration | leanexplore:378562 | leanexplore_sqlite | leanexplore_declarations | @[simp]
theorem assoc'_assoc (ρ : MState ((d₁ × d₂) × d₃)) : ρ.assoc.assoc' = ρ := by
rfl |
250 | leanexplore_declaration | leanexplore:378563 | leanexplore_sqlite | leanexplore_declarations | @[simp]
theorem traceLeft_right_assoc (ρ : MState ((d₁ × d₂) × d₃)) :
ρ.assoc.traceLeft.traceRight = ρ.traceRight.traceLeft := by
ext
simpa [assoc, relabel, Matrix.traceLeft, traceLeft, Matrix.traceRight, traceRight]
using Finset.sum_comm |
187 | leanexplore_declaration | leanexplore:378564 | leanexplore_sqlite | leanexplore_declarations | @[simp]
theorem traceRight_left_assoc' (ρ : MState (d₁ × d₂ × d₃)) :
ρ.assoc'.traceRight.traceLeft = ρ.traceLeft.traceRight := by
rw [← ρ.assoc'.traceLeft_right_assoc, assoc_assoc'] |
156 | leanexplore_declaration | leanexplore:378565 | leanexplore_sqlite | leanexplore_declarations | @[simp]
theorem traceRight_assoc (ρ : MState ((d₁ × d₂) × d₃)) :
ρ.assoc.traceRight = ρ.traceRight.traceRight := by
ext : 3
apply Finset.sum_product |
167 | leanexplore_declaration | leanexplore:378566 | leanexplore_sqlite | leanexplore_declarations | @[simp]
theorem traceLeft_assoc' (ρ : MState (d₁ × d₂ × d₃)) :
ρ.assoc'.traceLeft = ρ.traceLeft.traceLeft := by
convert ρ.SWAP.assoc.SWAP.traceRight_assoc
simp |
148 | leanexplore_declaration | leanexplore:378567 | leanexplore_sqlite | leanexplore_declarations | @[simp]
theorem traceLeft_left_assoc (ρ : MState ((d₁ × d₂) × d₃)) :
ρ.assoc.traceLeft.traceLeft = ρ.traceLeft := by
simp [← traceLeft_assoc'] |
141 | leanexplore_declaration | leanexplore:378568 | leanexplore_sqlite | leanexplore_declarations | @[simp]
theorem traceRight_right_assoc' (ρ : MState (d₁ × d₂ × d₃)) :
ρ.assoc'.traceRight.traceRight = ρ.traceRight := by
simp [assoc'] |
204 | leanexplore_declaration | leanexplore:378569 | leanexplore_sqlite | leanexplore_declarations | @[simp]
theorem traceNorm_eq_1 (ρ : MState d) : ρ.m.traceNorm = 1 :=
have := calc (ρ.m.traceNorm : ℂ)
_ = ρ.m.trace := ρ.psd.traceNorm_PSD_eq_trace
_ = 1 := ρ.tr'
Complex.ofReal_eq_one.mp this |
190 | leanexplore_declaration | leanexplore:378570 | leanexplore_sqlite | leanexplore_declarations | theorem relabel_kron (ρ : MState d₁) (σ : MState d₂) (e : d₃ ≃ d₁) :
((ρ.relabel e) ⊗ᴹ σ) = (ρ ⊗ᴹ σ).relabel (e.prodCongr (Equiv.refl d₂)) := by
rfl --is this defeq abuse? I don't know |
152 | leanexplore_declaration | leanexplore:378571 | leanexplore_sqlite | leanexplore_declarations | theorem kron_relabel (ρ : MState d₁) (σ : MState d₂) (e : d₃ ≃ d₂) :
(ρ ⊗ᴹ σ.relabel e) = (ρ ⊗ᴹ σ).relabel ((Equiv.refl d₁).prodCongr e) := by
rfl |
245 | leanexplore_declaration | leanexplore:378572 | leanexplore_sqlite | leanexplore_declarations | theorem prod_assoc (ρ : MState d₁) (σ : MState d₂) (τ : MState d₃) :
(ρ ⊗ᴹ (σ ⊗ᴹ τ)) = (ρ ⊗ᴹ σ ⊗ᴹ τ).relabel (Equiv.prodAssoc d₁ d₂ d₃).symm := by
ext : 2
simp [-Matrix.kronecker_assoc']
exact (Matrix.kronecker_assoc' ρ.m σ.m τ.m).symm |
155 | leanexplore_declaration | leanexplore:378573 | leanexplore_sqlite | leanexplore_declarations | /-- Mixed states inherit the subspace topology from matrices -/
instance : TopologicalSpace (MState d) :=
TopologicalSpace.induced MState.M inferInstance |
211 | leanexplore_declaration | leanexplore:378574 | leanexplore_sqlite | leanexplore_declarations | /-- The projection from mixed states to their Hermitian matrices is an embedding -/
theorem toMat_IsEmbedding : Topology.IsEmbedding (MState.M (d := d)) where
eq_induced := rfl
injective := @MState.ext _ _ _ |
81 | leanexplore_declaration | leanexplore:378575 | leanexplore_sqlite | leanexplore_declarations | instance : T3Space (MState d) :=
Topology.IsEmbedding.t3Space toMat_IsEmbedding |
478 | leanexplore_declaration | leanexplore:378576 | leanexplore_sqlite | leanexplore_declarations | instance : CompactSpace (MState d) := by
constructor
rw [(Topology.IsInducing.induced MState.M).isCompact_iff]
suffices IsCompact (Set.Icc 0 1 ∩ { m | m.trace = 1} : Set (HermitianMat d ℂ)) by
convert this
ext1 m
constructor
· rintro ⟨ρ, _, rfl⟩
simp [ρ.nonneg, ρ.le_one]
· simpa using fu... |
114 | leanexplore_declaration | leanexplore:378577 | leanexplore_sqlite | leanexplore_declarations | noncomputable instance : MetricSpace (MState d) :=
MetricSpace.induced MState.M MState.M_Injective inferInstance |
70 | leanexplore_declaration | leanexplore:378578 | leanexplore_sqlite | leanexplore_declarations | theorem dist_eq (x y : MState d) : dist x y = dist x.M y.M := by
rfl |
100 | leanexplore_declaration | leanexplore:378579 | leanexplore_sqlite | leanexplore_declarations | instance : BoundedSpace (MState d) where
bounded_univ :=
CompactSpace.isCompact_univ.isBounded |
123 | leanexplore_declaration | leanexplore:378580 | leanexplore_sqlite | leanexplore_declarations | @[fun_prop]
theorem Continuous_HermitianMat : Continuous (MState.M (d := d)) :=
continuous_iff_le_induced.mpr fun _ => id |
105 | leanexplore_declaration | leanexplore:378581 | leanexplore_sqlite | leanexplore_declarations | @[fun_prop]
theorem Continuous_Matrix : Continuous (MState.m (d := d)) := by
unfold MState.m
fun_prop |
161 | leanexplore_declaration | leanexplore:378582 | leanexplore_sqlite | leanexplore_declarations | theorem image_M_isBounded (S : Set (MState d)) : Bornology.IsBounded (MState.M '' S) := by
rw [← Bornology.isBounded_induced]
exact Bornology.IsBounded.all S |
333 | leanexplore_declaration | leanexplore:378583 | leanexplore_sqlite | leanexplore_declarations | def piProd (ρi : (i:ι) → MState (dI i)) : MState ((i:ι) → dI i) where
M := {
val := Matrix.piProd (fun i ↦ (ρi i).m)
property := Matrix.IsHermitian.piProd (fun i ↦ (ρi i).Hermitian)
}
nonneg := by
rw [zero_le_iff]
exact Matrix.PosSemidef.piProd (fun i => psd (ρi i))
tr := by simp [trace, Matrix.... |
165 | leanexplore_declaration | leanexplore:378584 | leanexplore_sqlite | leanexplore_declarations | /-- The n-copy "power" of a mixed state, with the standard basis indexed by pi types. -/
def npow (ρ : MState d) (n : ℕ) : MState (Fin n → d) :=
piProd (fun _ ↦ ρ) |
277 | leanexplore_declaration | leanexplore:378585 | leanexplore_sqlite | leanexplore_declarations | @[inherit_doc]
infixl:110 " ⊗ᴹ^ " => MState.npow
end finprod
section posdef
theorem PosDef.kron {d₁ d₂ : Type*} [Fintype d₁] [DecidableEq d₁] [Fintype d₂] [DecidableEq d₂]
{σ₁ : MState d₁} {σ₂ : MState d₂} (hσ₁ : σ₁.m.PosDef) (hσ₂ : σ₂.m.PosDef) : (σ₁ ⊗ᴹ σ₂).m.PosDef := |
213 | leanexplore_declaration | leanexplore:378586 | leanexplore_sqlite | leanexplore_declarations | theorem PosDef.kron {d₁ d₂ : Type*} [Fintype d₁] [DecidableEq d₁] [Fintype d₂] [DecidableEq d₂]
{σ₁ : MState d₁} {σ₂ : MState d₂} (hσ₁ : σ₁.m.PosDef) (hσ₂ : σ₂.m.PosDef) : (σ₁ ⊗ᴹ σ₂).m.PosDef :=
hσ₁.kron hσ₂ |
212 | leanexplore_declaration | leanexplore:378587 | leanexplore_sqlite | leanexplore_declarations | theorem PosDef.relabel {d₁ d₂ : Type*} [Fintype d₁] [DecidableEq d₁] [Fintype d₂] [DecidableEq d₂]
{ρ : MState d₁} (hρ : ρ.m.PosDef) (e : d₂ ≃ d₁) : (ρ.relabel e).m.PosDef :=
Matrix.PosDef.reindex hρ e.symm |
289 | leanexplore_declaration | leanexplore:378588 | leanexplore_sqlite | leanexplore_declarations | /-- If both states positive definite, so is their mixture. -/
theorem PosDef_mix {d : Type*} [Fintype d] [DecidableEq d] {σ₁ σ₂ : MState d}
(hσ₁ : σ₁.m.PosDef) (hσ₂ : σ₂.m.PosDef) (p : Prob) : (p [σ₁ ↔ σ₂]).m.PosDef :=
Matrix.PosDef.Convex hσ₁ hσ₂ p.zero_le (1 - p).zero_le (by simp) |
378 | leanexplore_declaration | leanexplore:378589 | leanexplore_sqlite | leanexplore_declarations | /-- If one state is positive definite and the mixture is nondegenerate, their mixture is also positive definite. -/
theorem PosDef_mix_of_ne_zero {d : Type*} [Fintype d] [DecidableEq d] {σ₁ σ₂ : MState d}
(hσ₁ : σ₁.m.PosDef) (p : Prob) (hp : p ≠ 0) : (p [σ₁ ↔ σ₂]).m.PosDef := by
rw [← zero_lt_iff] at hp
exact (... |
633 | leanexplore_declaration | leanexplore:378590 | leanexplore_sqlite | leanexplore_declarations | /-- If the second state is positive definite and the mixture is nondegenerate, their mixture is also positive definite. -/
theorem PosDef_mix_of_ne_one {d : Type*} [Fintype d] [DecidableEq d] {σ₁ σ₂ : MState d}
(hσ₂ : σ₂.m.PosDef) (p : Prob) (hp : p ≠ 1) : (p [σ₁ ↔ σ₂]).m.PosDef := by
have : 0 < 1 - p := by
-... |
196 | leanexplore_declaration | leanexplore:378591 | leanexplore_sqlite | leanexplore_declarations | theorem uniform_posDef {d : Type*} [Nonempty d] [Fintype d] [DecidableEq d] :
(uniform (d := d)).m.PosDef := by
simp [uniform, ofClassical, m, HermitianMat.diagonal]
exact Fintype.card_pos |
168 | leanexplore_declaration | leanexplore:378592 | leanexplore_sqlite | leanexplore_declarations | theorem posDef_of_unique {d : Type*} [Fintype d] [DecidableEq d] (ρ : MState d) [Unique d] : ρ.m.PosDef := by
rw [Subsingleton.allEq ρ uniform]
exact uniform_posDef |
631 | leanexplore_declaration | leanexplore:378593 | leanexplore_sqlite | leanexplore_declarations | /-- A POVM is a (finite) collection of PSD matrices on the same Hilbert space
that sum to the identity. Here `X` indexes the matrices, and `d` is the space
dimension.
Applied to an `MState` on that on that space with
`POVM.measure`, this produces a distribution of outcomes indexed by the same
type as the collecti... |
2,109 | leanexplore_declaration | leanexplore:378594 | leanexplore_sqlite | leanexplore_declarations | /-- The act of measuring is a quantum channel, that maps a `d`-dimensional quantum
state to an `d × X`-dimensional quantum-classical state. -/
def measurementMap (Λ : POVM X d) : CPTPMap d (d × X) where
toLinearMap :=
∑ (x : X), open Kronecker in {
toFun := fun ρ ↦ ((((Λ.mats x) ^ (1/2:ℝ)).mat * ρ * ((Λ.mat... |
272 | leanexplore_declaration | leanexplore:378595 | leanexplore_sqlite | leanexplore_declarations | theorem measurementMap_apply_matrix (Λ : POVM X d) (m : Matrix d d ℂ) :
Λ.measurementMap.map m = ∑ x : X,
((((Λ.mats x) ^ (1/2:ℝ)).mat * m * ((Λ.mats x)^(1/2:ℝ)).mat) ⊗ₖ Matrix.single x x 1) := by
dsimp [measurementMap, HPMap.map]
rw [LinearMap.sum_apply]
rfl |
609 | leanexplore_declaration | leanexplore:378596 | leanexplore_sqlite | leanexplore_declarations | theorem measurementMap_apply_hermitianMat (Λ : POVM X d) (m : HermitianMat d ℂ) :
Λ.measurementMap.toHPMap m = ∑ x : X,
--TODO: Something like `HermitianMat.single` to make this better
((m.conj ((Λ.mats x)^(1/2:ℝ)).mat : HermitianMat d ℂ) ⊗ₖ HermitianMat.diagonal ℂ (fun y ↦ ite (x = y) 1 0)) := by
ext1
co... |
413 | leanexplore_declaration | leanexplore:378597 | leanexplore_sqlite | leanexplore_declarations | /-- A POVM leads to a distribution of outcomes on any given mixed state ρ. -/
def measure (Λ : POVM X d) (ρ : MState d) : ProbDistribution X := .mk'
(f := fun x ↦ ⟪Λ.mats x, ρ.M⟫)
(h₁ := fun x ↦ HermitianMat.inner_ge_zero (Λ.nonneg x) ρ.nonneg)
(hN := by
simp [HermitianMat.inner_eq_re_trace, ← Complex... |
1,198 | leanexplore_declaration | leanexplore:378598 | leanexplore_sqlite | leanexplore_declarations | /-- The quantum-classical `POVM.measurement_map`, gives a marginal on the right equal to `POVM.measure`.-/
theorem traceLeft_measurementMap_eq_measure (Λ : POVM X d) (ρ : MState d) :
(Λ.measurementMap ρ).traceLeft = MState.ofClassical (Λ.measure ρ) := by
open Kronecker in
ext i j
rcases ρ with ⟨⟨ρ, ρH⟩, hρ0, ... |
327 | leanexplore_declaration | leanexplore:378599 | leanexplore_sqlite | leanexplore_declarations | /-- The action of measuring a state with the POVM `Λ`, discarding the resulting state, and keeping
the mixed state recording the outcome. This resulting state is purely diagonal, as given in
`POVM.measureDiscard_apply`. -/
noncomputable def measureDiscard (Λ : POVM X d) : CPTPMap d X :=
CPTPMap.traceLeft ∘ₘ Λ.measure... |
185 | leanexplore_declaration | leanexplore:378600 | leanexplore_sqlite | leanexplore_declarations | theorem measureDiscard_apply (Λ : POVM X d) (ρ : MState d) :
Λ.measureDiscard ρ = MState.ofClassical (Λ.measure ρ) := by
simp [measureDiscard, traceLeft_measurementMap_eq_measure] |
231 | leanexplore_declaration | leanexplore:378601 | leanexplore_sqlite | leanexplore_declarations | /-- The action of measuring a state with the POVM `Λ`, forgetting the measurement outcome, and
keeping the disturbed state. -/
noncomputable def measureForget (Λ : POVM X d) : CPTPMap d d :=
CPTPMap.traceRight ∘ₘ Λ.measurementMap |
123 | leanexplore_declaration | leanexplore:378602 | leanexplore_sqlite | leanexplore_declarations | def pinching_kraus (ρ : MState d) : spectrum ℝ ρ.m → HermitianMat d ℂ :=
fun x ↦ ρ.M.cfc (fun y ↦ if y = x then 1 else 0) |
243 | leanexplore_declaration | leanexplore:378603 | leanexplore_sqlite | leanexplore_declarations | theorem pinching_kraus_commutes (ρ : MState d) (i : spectrum ℝ ρ.m) :
Commute (pinching_kraus ρ i).mat ρ.m := by
rw [MState.m, ← ρ.M.cfc_id, commute_iff_eq, pinching_kraus]
rw [← ρ.M.mat_cfc_mul, ← ρ.M.mat_cfc_mul]
congr 2; ext; simp |
313 | leanexplore_declaration | leanexplore:378604 | leanexplore_sqlite | leanexplore_declarations | theorem pinching_kraus_mul_self (ρ : MState d) (i : spectrum ℝ ρ.m) :
(pinching_kraus ρ i).mat * ρ.m = i.val • pinching_kraus ρ i := by
dsimp [MState.m]
nth_rw 1 [← ρ.M.cfc_id]
rw [pinching_kraus]
rw [← ρ.M.mat_cfc_mul, ← HermitianMat.mat_smul]
rw [← ρ.M.cfc_const_mul]
congr! 3
simp +contextual |
110 | leanexplore_declaration | leanexplore:378605 | leanexplore_sqlite | leanexplore_declarations | instance finite_spectrum_inst (ρ : MState d) : Fintype (spectrum ℝ ρ.m) :=
Fintype.ofFinite (spectrum ℝ ρ.m) |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.