Documentation

LeanPool.LeanQuantumAlg.Primitives.QKernel.Expressivity

Embedding quantum kernels: density-matrix realization (expressivity) #

The genuine core of Gil-Fuster, Eisert, Dunjko (2023) Theorem 1: every feature-map kernel is realizable, up to a positive affine transform, by valid density matrices via the embedding quantum kernel tr{ρ(x)ρ(x')}. Converse of quantumKernel_gram_posSemidef. No assumptions.

noncomputable def QuantumAlg.offDiagEmb {r : } (v : Fin r) :
Matrix (Fin 1 Fin r) (Fin 1 Fin r)

Off-diagonal Hermitian embedding of a feature vector v into Fin 1 ⊕ Fin r.

Equations
Instances For
    theorem QuantumAlg.trace_fromBlocks' {r : } {A : Matrix (Fin 1) (Fin 1) } {B : Matrix (Fin 1) (Fin r) } {C : Matrix (Fin r) (Fin 1) } {D : Matrix (Fin r) (Fin r) } :

    A local trace-of-block-matrix helper (trace_fromBlocks is not in Mathlib).

    theorem QuantumAlg.trace_offDiagEmb_mul {r : } (v w : Fin r) :
    (offDiagEmb v * offDiagEmb w).trace = 2 * (∑ k : Fin r, (starRingEnd ) (v k) * w k).re

    The HS inner product of two off-diagonal embeddings: tr(offDiagEmb v * offDiagEmb w) = 2·Re⟨v,w⟩ (a real number).

    theorem QuantumAlg.one_add_offDiagEmb_eq {r : } (v : Fin r) :
    1 + offDiagEmb v = Matrix.fromBlocks 1 (Matrix.of fun (x : Fin 1) (k : Fin r) => v k) (Matrix.of fun (k : Fin r) (x : Fin 1) => (starRingEnd ) (v k)) 1

    1 + offDiagEmb v written as a bordered block matrix.

    theorem QuantumAlg.one_add_offDiagEmb_posSemidef {r : } (v : Fin r) (hv : k : Fin r, Complex.normSq (v k) 1) :

    Validity crux: 1 + offDiagEmb v is positive semidefinite when ∑ ‖v k‖² ≤ 1. Proved by the fromBlocks₂₂ Schur complement, which collapses to the 1×1 matrix [1 - ∑ normSq (v k)].

    noncomputable def QuantumAlg.densityOf {r : } (v : Fin r) :
    Matrix (Fin 1 Fin r) (Fin 1 Fin r)

    The maximally-mixed-plus-perturbation density operator for feature vector v.

    Equations
    Instances For
      theorem QuantumAlg.densityOf_posSemidef {r : } (v : Fin r) (hv : k : Fin r, Complex.normSq (v k) 1) :
      theorem QuantumAlg.densityOf_isHermitian {r : } (v : Fin r) (hv : k : Fin r, Complex.normSq (v k) 1) :
      theorem QuantumAlg.densityOf_mul_trace {r : } (v w : Fin r) :
      (densityOf v * densityOf w).trace = (r + 1)⁻¹ ^ 2 * (↑(1 + r) + 2 * (∑ k : Fin r, (starRingEnd ) (v k) * w k).re)

      EQK trace identity: the embedding quantum kernel of two feature vectors is a positive affine image of Re⟨v,w⟩ (here in the raw form c²·(D + 2·Re⟨v,w⟩), c = 1/D, D = r+1).

      theorem QuantumAlg.eqk_realizes {r : } {ι : Type u_1} (φ : ιFin r) ( : ∀ (i : ι), k : Fin r, Complex.normSq (φ i k) 1) :
      (∀ (i : ι), (densityOf (φ i)).IsHermitian (densityOf (φ i)).trace = 1 (densityOf (φ i)).PosSemidef) ∀ (i j : ι), (densityOf (φ i) * densityOf (φ j)).trace = (r + 1)⁻¹ ^ 2 * (↑(1 + r) + 2 * (∑ k : Fin r, (starRingEnd ) (φ i k) * φ j k).re)

      Approximate universality (finite, positive-affine form), Gil-Fuster 2023 Thm 1. Any normalized feature map φ is realized by a family of genuine density matrices whose embedding quantum kernel equals c²·(D + 2·Re⟨φ_i,φ_j⟩) — a positive affine image of the feature kernel Re⟨φ_i,φ_j⟩ (exact for real feature maps).

      theorem QuantumAlg.eqk_nonempty :
      ∃ (r : ) (φ : Fin 2Fin r), (∀ (i : Fin 2), (densityOf (φ i)).PosSemidef (densityOf (φ i)).trace = 1) (densityOf (φ 0) * densityOf (φ 0)).trace (densityOf (φ 0) * densityOf (φ 1)).trace

      Non-vacuity: a concrete two-input feature map gives valid density matrices realizing a non-constant embedding quantum kernel.