Negativity, partial transpose, reduced states, and the matrix (Lyu 2026)
DefinitionLyuNegativity_DefsDefinitions for Lyu (2026). A pure state of three parties is a vector on .
- Negativity of a Hermitian matrix: the sum of the absolute values of its negative eigenvalues (with multiplicity); for non-Hermitian input (never used).
- Partial transpose on : .
- Reduced states , , and the pure state across (unnormalized; normalization is a hypothesis where needed).
- Blocks , , and the real matrix with , ().
import Mathlib
/-!
# Definitions for Lyu (2026), "Quantum Negativity Is Monogamous" (arXiv:2611.40361)
States are vectors `ψ : a × (b × c) → ℂ` on `ℂ^{d_A} ⊗ ℂ^{d_B} ⊗ ℂ^{d_C}` (finite index types
`a`, `b`, `c`); operators are complex matrices indexed by products of these types.
-/
open Matrix
open scoped Kronecker
namespace LyuNegativity
variable {a b c : Type*}
/-- Negativity of a Hermitian matrix `H`: the sum of the absolute values of its negative
eigenvalues (defined as `0` if `H` is not Hermitian, a case that never occurs below).
For `H = ρ^{T_A}` with `Tr H = 1` this equals `(‖ρ^{T_A}‖₁ − 1)/2`. -/
noncomputable def negativity {n : Type*} [Fintype n] [DecidableEq n] (H : Matrix n n ℂ) : ℝ :=
if h : H.IsHermitian then ∑ k, max 0 (-(h.eigenvalues k)) else 0
/-- Partial transpose on the first factor: `⟨i,k|X^{T_A}|j,l⟩ = ⟨j,k|X|i,l⟩`. -/
def ptA {m : Type*} (X : Matrix (a × m) (a × m) ℂ) : Matrix (a × m) (a × m) ℂ :=
fun ix jy => X (jy.1, ix.2) (ix.1, jy.2)
/-- Reduced state `ρ_AB = Tr_C |ψ⟩⟨ψ|` of a vector `ψ` on `A ⊗ (B ⊗ C)`. -/
def rhoAB [Fintype c] (ψ : a × (b × c) → ℂ) : Matrix (a × b) (a × b) ℂ :=
fun ix jy => ∑ z, ψ (ix.1, (ix.2, z)) * star (ψ (jy.1, (jy.2, z)))
/-- Reduced state `ρ_AC = Tr_B |ψ⟩⟨ψ|`. -/
def rhoAC [Fintype b] (ψ : a × (b × c) → ℂ) : Matrix (a × c) (a × c) ℂ :=
fun iz ju => ∑ x, ψ (iz.1, (x, iz.2)) * star (ψ (ju.1, (x, ju.2)))
/-- The pure state `|ψ⟩⟨ψ|` on `A ⊗ (B ⊗ C)`, viewed across the cut `A | BC`. -/
def pureState (ψ : a × (b × c) → ℂ) : Matrix (a × (b × c)) (a × (b × c)) ℂ :=
fun iv ju => ψ iv * star (ψ ju)
/-- The block `P_ij = (⟨i|_A ⊗ I_B) P (|j⟩_A ⊗ I_B)` of an operator `P` on `A ⊗ B`. -/
def blk (P : Matrix (a × b) (a × b) ℂ) (i j : a) : Matrix b b ℂ := fun x y => P (i, x) (j, y)
/-- `Z_ij = p P_ij ⊗ I_C + q I_B ⊗ Q_ij`, an operator on `B ⊗ C`. -/
def Zop [Fintype b] [DecidableEq b] [Fintype c] [DecidableEq c]
(P : Matrix (a × b) (a × b) ℂ) (Q : Matrix (a × c) (a × c) ℂ) (p q : ℝ) (i j : a) :
Matrix (b × c) (b × c) ℂ :=
(p : ℂ) • (blk P i j ⊗ₖ (1 : Matrix c c ℂ)) + (q : ℂ) • ((1 : Matrix b b ℂ) ⊗ₖ blk Q i j)
/-- The real matrix `M` of the paper: `M_ii = ⟨w_i|Z_ii|w_i⟩`,
`M_ij = 1/2 + Re⟨w_j|Z_ij|w_i⟩` for `i ≠ j`. -/
noncomputable def Mmat [DecidableEq a] [Fintype b] [DecidableEq b] [Fintype c] [DecidableEq c]
(P : Matrix (a × b) (a × b) ℂ) (Q : Matrix (a × c) (a × c) ℂ) (p q : ℝ)
(w : a → (b × c → ℂ)) (i j : a) : ℝ :=
if i = j then (star (w i) ⬝ᵥ (Zop P Q p q i i *ᵥ w i)).re
else 1 / 2 + (star (w j) ⬝ᵥ (Zop P Q p q i j *ᵥ w i)).re
end LyuNegativity
Read-back
What the Lean code literally says, in plain math · claude-opus-5-5
Definition file (namespace LyuNegativity). Throughout, are arbitrary types (finite where a sum over them is taken); vectors are functions , i.e. elements of with the composite index written . Matrices are complex matrices indexed by (products of) these types. None of the definitions assumes normalisation, positivity or nonemptiness.
- negativity. For a square complex matrix indexed by a finite type :
where are the real eigenvalues of the Hermitian matrix listed with multiplicity (one per index ). So is the sum of the absolute values of the negative eigenvalues. Junk value: a non-Hermitian input gets . The docstring's remark that when is a comment only; the definition contains no trace-norm or trace normalisation.
- ptA (partial transpose on the first factor). For indexed by (any type ):
i.e. the two first-factor indices are swapped and the second-factor indices are left in place. This is the transpose on the factor (no complex conjugation).
- rhoAB. For finite :
the partial trace over of , indexed by . Not divided by .
- rhoAC. For finite :
the partial trace over , indexed by .
-
pureState. , indexed by , so when is applied the second factor is (cut ).
-
blk. For indexed by and , the block
- Zop. For on , on , real and , the matrix indexed by
with Kronecker convention ; are embedded as real complex scalars.
- Mmat. Given additionally a family of vectors (no normalisation imposed), a real number for each :
where (conjugate-linear in the first slot). Note the order in the off-diagonal entry: on the left (bra), on the right (ket), and the block . The constant appears only off the diagonal. Symmetry is not built into the definition.
Confirmed by the mission captain (proposal self-audit).
Confirmed by the moderator at approval.