Quantum kernels (qiskit_machine_learning.kernels)#

A set of extendable classes that can be used to evaluate kernel matrices.

The general task of machine learning is to find and study patterns in data. For many algorithms, the datapoints are better understood in a higher dimensional feature space, through the use of a kernel function:

\[K(x, y) = \langle f(x), f(y)\rangle.\]

Here \(K\) is the kernel function, \(x\), \(y\) are \(n\) dimensional inputs. \(f\) is a map from \(n\)-dimension to \(m\)-dimension space. \(\langle x, y \rangle\) denotes the inner product. Usually \(m\) is much larger than \(n\).

The quantum kernel algorithm calculates a kernel matrix, given datapoints \(x\) and \(y\) and feature map \(f\), all of \(n\) dimension. This kernel matrix can then be used in classical machine learning algorithms such as support vector classification, spectral clustering or ridge regression.

Quantum Kernels#

BaseKernel

An abstract definition of the quantum kernel interface.

FidelityQuantumKernel

An implementation of the quantum kernel interface based on the BaseStateFidelity algorithm.

FidelityStatevectorKernel

A reference implementation of the quantum kernel interface optimized for (and limited to) classically simulated statevectors.

TrainableKernel

An abstract definition of the ability to train kernel via specifying training parameters.

TrainableFidelityQuantumKernel

An implementation of the quantum kernel that is based on the BaseStateFidelity algorithm and provides ability to train it.

TrainableFidelityStatevectorKernel

A trainable version of the FidelityStatevectorKernel.

Submodules#