AFTD Auto-Formalizing Theoretical Domains

bell_state_fidelity

def

The fidelity of a two-qubit operator M with the standard Bell state |Phi+> is the real part of (M_{(0,0),(0,0)} + M_{(0,0),(1,1)} + M_{(1,1),(0,0)} + M_{(1,1),(1,1)}) / 2.

Statement

noncomputable def bell_state_fidelity (M : Matrix (Fin 2 × Fin 2) (Fin 2 × Fin 2) ℂ) : ℝ
Defined in
Nielsen & Chuang, Quantum Computation and Quantum Information, Section 1.3
Verified
12 Nov 2026
Axioms
none listed
Used by 1
  • fully_entangled_fractionThe fully entangled fraction of a two-qubit density matrix ρ is the supremum over all 2-by-2 unitary matrices U of the fidelity of (I…

Read back from the Lean

Given a complex matrix $M$ indexed by $(\text{Fin } 2 \times \text{Fin } 2) \times (\text{Fin } 2 \times \text{Fin } 2)$, bell_state_fidelity M is the real number defined as the real part of $(M_{(0, 0), (0, 0)} + M_{(0, 0), (1, 1)} + M_{(1, 1), (0, 0)} + M_{(1, 1), (1, 1)})$ divided by $2$.

Written by a model that saw only the Lean, never the English above. If the two disagree, that is worth a challenge.

Lean source view module on GitHub

/-- Fidelity of a two-qubit state with the maximally entangled Bell state |Phi+> = (|00> + |11>) / sqrt(2). -/
noncomputable def bell_state_fidelity (M : Matrix (Fin 2 × Fin 2) (Fin 2 × Fin 2) ℂ) : ℝ := (M (0, 0) (0, 0) + M (0, 0) (1, 1) + M (1, 1) (0, 0) + M (1, 1) (1, 1)).re / 2
See it in the graphDiscuss this resultChallenge it