Offline · exact source
Exact Lean source

PCTPartialTrace

formalization/Cloning/PCTPartialTrace.lean

Source hash: df19df9c3d01c37a4ca9b8125a1fba6438c7d960e025a25d7a77b47971eaf640

Full source copied without mathematical changes from the snapshot whose input hash matches the passing audit. Select a line number for a stable source pointer.

The declarations belong to the compiled inventory covered by the project’s shared axiom audit. That audit records an aggregate union, without attributing axioms to individual declarations.

Declarations in this module
1import Cloning.PCTWernerMixture
2 
3/-! A concrete finite-register partial trace as an actual CPTP map on the
4trace-class Banach space. Its matrix entries are the ordinary spectator-index
5sum, so it can be used directly in physical Gaussian-mixture limits. -/
6noncomputable section
7open scoped BigOperators InnerProductSpace ComplexOrder Topology
8open Filter MeasureTheory Cloning.InfiniteTraceClass
9namespace Cloning.PCT
10set_option maxHeartbeats 1000000
11set_option linter.unusedSectionVars false
12set_option backward.isDefEq.respectTransparency false
13 
14abbrev Register (A : Type*) := lp (fun _ : A => ℂ) 2
15 
16variable {A B : Type*} [Fintype A] [Fintype B] [DecidableEq A] [DecidableEq B]
17 
18def registerBasis (A : Type*) : HilbertBasis A ℂ (Register A) :=
19  HilbertBasis.ofRepr (LinearIsometryEquiv.refl ℂ (Register A))
20 
21@[simp] theorem registerBasis_apply (a : A) :
22    registerBasis A a = lp.single 2 a 1 :=
23  ((registerBasis A).repr_symm_single a).symm
24 
25theorem register_inner_single (a : A) (x : Register A) :
26    ⟪lp.single 2 a 1, x⟫_ℂ = x a := by
27  simp [lp.inner_single_left, RCLike.inner_apply]
28 
29theorem environment_orthonormal (b : B) :
30    Orthonormal ℂ (fun a : A => (lp.single 2 (a, b) 1 : Register (A × B))) := by
31  rw [orthonormal_iff_ite]
32  intro a c
33  simp [register_inner_single, lp.single_apply, Pi.single_apply]
34 
35def environmentEmbedding (b : B) : Register A →ₗᵢ[ℂ] Register (A × B) :=
36  (environment_orthonormal (A := A) b).orthogonalFamily.linearIsometry
37 
38theorem environmentEmbedding_single (b : B) (a : A) :
39    environmentEmbedding b (lp.single 2 a 1) = lp.single 2 (a, b) 1 := by
40  rw [environmentEmbedding, OrthogonalFamily.linearIsometry_apply_single]
41  exact one_smul ℂ _
42 
43def environmentSlice (b : B) : Register (A × B) →L[ℂ] Register A :=
44  (environmentEmbedding b).toContinuousLinearMap.adjoint
45 
46@[simp] theorem environmentSlice_apply (b : B) (x : Register (A × B)) (a : A) :
47    environmentSlice b x a = x (a, b) := by
48  rw [← register_inner_single]
49  change ⟪lp.single 2 a 1, (environmentEmbedding b).toContinuousLinearMap.adjoint x⟫_ℂ = _
50  rw [ContinuousLinearMap.adjoint_inner_right]
51  change ⟪environmentEmbedding b (lp.single 2 a 1), x⟫_ℂ = _
52  rw [environmentEmbedding_single, register_inner_single]
53 
54@[simp] theorem environmentSlice_adjoint_single (b : B) (a : A) :
55    (environmentSlice b).adjoint (lp.single 2 a 1) = lp.single 2 (a, b) 1 := by
56  rw [environmentSlice, ContinuousLinearMap.adjoint_adjoint]
57  exact environmentEmbedding_single b a
58 
59/-- The literal finite Kraus sum with Kraus maps `I ⊗ ⟨b|`. -/
60def partialTraceLinear : TraceClass (Register (A × B)) →ₗ[ℂ] TraceClass (Register A) :=
61  ∑ b : B, conjugationLinearMap (environmentSlice b)
62 
63theorem partialTraceLinear_coefficient (X : TraceClass (Register (A × B))) (a c : A) :
64    (partialTraceLinear X).1 (lp.single 2 c 1) a =
65      ∑ b : B, X.1 (lp.single 2 (c, b) 1) (a, b) := by
66  change inclusionCLM (partialTraceLinear X) (lp.single 2 c 1) a = _
67  simp only [partialTraceLinear, LinearMap.sum_apply, map_sum,
68    ContinuousLinearMap.sum_apply, lp.coeFn_sum, Finset.sum_apply]
69  apply Finset.sum_congr rfl
70  intro b hb
71  change environmentSlice b (X.1 ((environmentSlice b).adjoint (lp.single 2 c 1))) a = _
72  rw [environmentSlice_adjoint_single, environmentSlice_apply]
73 
74theorem traceCLM_register (X : TraceClass (Register A)) :
75    traceCLM X = ∑ a : A, X.1 (lp.single 2 a 1) a := by
76  letI : FiniteDimensional ℂ (Register A) :=
77    (registerBasis A).toOrthonormalBasis.toBasis.finiteDimensional_of_finite
78  change trace X.1 X.2 = _
79  rw [trace_eq_linearMap_trace_of_finiteDimensional]
80  simpa only [HilbertBasis.coe_toOrthonormalBasis, ContinuousLinearMap.coe_coe,
81    registerBasis_apply, register_inner_single] using
82    LinearMap.trace_eq_sum_inner X.1.toLinearMap (registerBasis A).toOrthonormalBasis
83 
84theorem partialTraceLinear_trace (X : TraceClass (Register (A × B))) :
85    traceCLM (partialTraceLinear X) = traceCLM X := by
86  rw [traceCLM_register, traceCLM_register]
87  simp only [partialTraceLinear_coefficient, Fintype.sum_prod_type]
88 
89theorem partialTraceLinear_nonneg (X : TraceClass (Register (A × B))) (hX : 0 ≤ X.1) :
90    0 ≤ (partialTraceLinear X).1 := by
91  change 0 ≤ inclusionCLM (partialTraceLinear X)
92  simp only [partialTraceLinear, LinearMap.sum_apply, map_sum]
93  exact Finset.sum_nonneg (fun b _ => conjugationLinearMap_nonneg _ X hX)
94 
95theorem partialTraceLinear_completelyPositive :
96    IsCompletelyPositive (partialTraceLinear (A := A) (B := B)) := by
97  classical
98  have hs (t : Finset B) : IsCompletelyPositive
99      (∑ b ∈ t, conjugationLinearMap (environmentSlice (A := A) b)) := by
100    induction t using Finset.induction_on with
101    | empty =>
102      intro n X hX x
103      simp
104    | @insert b t hb ih =>
105      simpa only [Finset.sum_insert hb] using
106        (conjugationLinearMap_completelyPositive (environmentSlice b)).add ih
107  exact hs Finset.univ
108 
109/-- The actual partial trace, including complete positivity at every ancilla
110size and exact trace preservation on all complex trace-class inputs. -/
111def partialTraceChannel : QuantumChannel (Register (A × B)) (Register A) where
112  toLinearMap := partialTraceLinear
113  map_nonneg := partialTraceLinear_nonneg
114  trace_preserving := partialTraceLinear_trace
115  completelyPositive := partialTraceLinear_completelyPositive
116 
117theorem partialTraceChannel_vectorProjector (x : Register (A × B)) :
118    partialTraceChannel.toLinearMap (vectorProjector x) =
119      ∑ b : B, vectorProjector (environmentSlice b x) := by
120  simp only [partialTraceChannel, partialTraceLinear, LinearMap.sum_apply,
121    conjugationLinearMap_vectorProjector]
122 
123end Cloning.PCT