cfahlgren1's picture
download
raw
2.92 kB
12
def fidelity (A B : Mat n) : ℝ := traceNorm (CFC.sqrt A*CFC.sqrt B)
13
lemma sqrt_psd (A : Mat n) : (CFC.sqrt A).PosSemidef :=
proof · 1 line
  Matrix.nonneg_iff_posSemidef.mp (CFC.sqrt_nonneg A)
15
lemma sqrt_herm (A : Mat n) : (CFC.sqrt A)ᴴ=CFC.sqrt A := (sqrt_psd A).isHermitian.eq
17
lemma traceNorm_conjTranspose (A : Mat n) : traceNorm Aᴴ=traceNorm A := by
proof · 3 lines
  obtain ⟨U,hU,he⟩ := MatrixPolar.polar A
  conv_lhs => rw [he,Matrix.conjTranspose_mul,sqrt_herm,traceNorm_unitary_right _ (unitary_star hU)]
  conv_rhs => rw [he,traceNorm_unitary_left _ hU]
22
lemma sqrt_transpose {A : Mat n} (hA : A.PosSemidef) : CFC.sqrt Aᵀ=(CFC.sqrt A)ᵀ := by
proof · 3 lines
  apply CFC.sqrt_unique
  · rw [← Matrix.transpose_mul,CFC.sqrt_mul_sqrt_self A hA.nonneg]
  · exact (sqrt_psd A).transpose.nonneg
28
lemma conjugate_transpose_transpose (A : Mat n) : (Aᵀ)ᴴ=(Aᴴ)ᵀ := by
proof · 2 lines
  ext i j
  rfl
32
lemma traceNorm_transpose (A : Mat n) : traceNorm Aᵀ=traceNorm A := by
proof · 7 lines
  rw [← traceNorm_conjTranspose A]
  have hAA : (A*Aᴴ).PosSemidef := by
    simpa only [Matrix.conjTranspose_conjTranspose] using Matrix.posSemidef_conjTranspose_mul_self Aᴴ
  unfold traceNorm
  rw [conjugate_transpose_transpose,← Matrix.transpose_mul,
    sqrt_transpose hAA,Matrix.trace_transpose,
    Matrix.conjTranspose_conjTranspose]
41
lemma fidelity_polar (A B : Mat n) : fidelity (Aᴴ*A) (Bᴴ*B)=traceNorm (A*Bᴴ) := by
proof · 6 lines
  obtain ⟨U,hU,heA⟩ := MatrixPolar.polar A
  obtain ⟨V,hV,heB⟩ := MatrixPolar.polar B
  conv_rhs => rw [heA,heB,Matrix.conjTranspose_mul,sqrt_herm]
  rw [← Matrix.mul_assoc,Matrix.mul_assoc U,traceNorm_unitary_right _ (unitary_star hV),
    traceNorm_unitary_left _ hU]
  rfl
49
lemma fidelity_transpose {A B : Mat n} (hA : A.PosSemidef) (hB : B.PosSemidef) :
    fidelity Aᵀ Bᵀ=fidelity A B := by
proof · 4 lines
  unfold fidelity
  rw [sqrt_transpose hA,sqrt_transpose hB,← Matrix.transpose_mul,traceNorm_transpose,
    ← traceNorm_conjTranspose (CFC.sqrt B*CFC.sqrt A),Matrix.conjTranspose_mul,
    sqrt_herm,sqrt_herm]
56
lemma unitary_trace_conj {U : Mat n} (hU : Uᴴ*U=1) (A : Mat n) :
    Matrix.trace (Uᴴ*A*U)=Matrix.trace A := by
proof · 1 line
  rw [Matrix.trace_mul_cycle,unitary_reverse hU,Matrix.one_mul]
60
lemma unitary_traceNorm_conj {U : Mat n} (hU : Uᴴ*U=1) (A : Mat n) :
    traceNorm (Uᴴ*A*U)=traceNorm A := by
proof · 1 line
  rw [traceNorm_unitary_right _ hU,traceNorm_unitary_left _ (unitary_star hU)]
64
lemma unitary_conj_mul {U : Mat n} (hU : Uᴴ*U=1) (A B : Mat n) :
    (Uᴴ*A*U)*(Uᴴ*B*U)=Uᴴ*(A*B)*U := by
proof · 2 lines
  simp only [Matrix.mul_assoc]
  rw [← Matrix.mul_assoc U Uᴴ,unitary_reverse hU,Matrix.one_mul]

Xet Storage Details

Size:
2.92 kB
·
Xet hash:
9d70c27f3c3c8f9ded7d6c5c4967ddf3267f78191bf858c8a450665f3c156cee

Xet efficiently stores files, intelligently splitting them into unique chunks and accelerating uploads and downloads. More info.