Quantum kernel methods: the fidelity kernel and its Gram-matrix positive semidefiniteness #
A data-encoding quantum feature map sends a classical input x to a quantum
state |φ(x)⟩. The induced fidelity quantum kernel is
k(x, y) = |⟨φ(x) | φ(y)⟩|² (for pure states this equals tr[ρ(x) ρ(y)],
the Hilbert–Schmidt inner product of the density operators). The core fact that
makes such a k a legitimate kernel for classical kernel methods (SVMs, etc.)
is that every Gram matrix K_{ij} = k(xᵢ, xⱼ) is positive semidefinite.
The proof realizes the fidelity kernel as a genuine inner-product Gram matrix:
with the feature vector w(x) := φ(x) ⊗ conj φ(x) one has
⟨w(x), w(y)⟩ = ⟨φ(x), φ(y)⟩ · conj⟨φ(x), φ(y)⟩ = |⟨φ(x), φ(y)⟩|²
(via PureState.inner_tensor_tensor), so the kernel Gram matrix factors as
K = Bᴴ B and is positive semidefinite by
Matrix.posSemidef_conjTranspose_mul_self.
Sources: Schuld & Killoran (2019), Quantum machine learning in feature Hilbert spaces; Schuld (2021), Supervised quantum machine learning models are kernel methods.
Main definitions / results #
LeanPool.LeanQuantumAlg.PureState.conjState— elementwise complex conjugate of a state.LeanPool.LeanQuantumAlg.quantumKernel— the fidelity quantum kernel|⟨φ(x), φ(y)⟩|².LeanPool.LeanQuantumAlg.quantumKernel_eq_inner_featureTensor— the kernel as an inner product of feature vectorsφ(x) ⊗ conj φ(x).LeanPool.LeanQuantumAlg.quantumKernel_gram_posSemidef— the kernel Gram matrix is positive semidefinite (the validity-of-the-kernel theorem). Being positive semidefinite it is in particular Hermitian, i.e. symmetric.LeanPool.LeanQuantumAlg.quantumKernel_self— the diagonal value on a pure state.
Elementwise complex conjugate of a pure state.
Equations
- ψ.conjState = QuantumAlg.PureState.ofVec (WithLp.toLp 2 fun (i : Fin (2 ^ n)) => (starRingEnd ℂ) (ψ.vec.ofLp i)) ⋯
Instances For
The feature vector φ(x) ⊗ conj φ(x) whose inner products realize the
fidelity kernel as a Gram matrix.
Equations
- QuantumAlg.featureTensor φ x = (φ x).tensor (φ x).conjState
Instances For
The fidelity quantum kernel k(x, y) = |⟨φ(x), φ(y)⟩|², written as the
complex product ⟨φ(x), φ(y)⟩ · conj⟨φ(x), φ(y)⟩ (a nonnegative real).
Equations
- QuantumAlg.quantumKernel φ x y = inner ℂ (φ x) (φ y) * (starRingEnd ℂ) (inner ℂ (φ x) (φ y))
Instances For
The fidelity kernel is the inner product of the feature vectors
φ(·) ⊗ conj φ(·).
The diagonal kernel value is 1.
Validity of the quantum kernel. For any finite family of inputs, the
fidelity-kernel Gram matrix K_{ij} = k(xᵢ, xⱼ) is positive semidefinite, hence
k is a legitimate (positive-semidefinite) kernel.
Main theorem: fidelity quantum-kernel Gram matrices are positive semidefinite.
Public supporting theorem: the fidelity kernel is an inner product after tensor lifting.
Public supporting theorem: the diagonal fidelity-kernel value of a pure state is one.