Die Seite is noch nich übersetzt. Se kieken die englische Originalversion.
Quantum Kernels
Introduction to quantum kernels
The "Quantum kernel method" refers to any method that uses quantum computers to estimate a kernel. In this context, "kernel" will refer to the kernel matrix or individual entries therein. Recall that a feature mapping is a mapping from to where usually and where the goal of this mapping is to make the categories of data separable by a hyperplane. The kernel function takes vectors in the feature-mapped space as arguments and returns their inner product, that is, with . Classically, we are interested in feature maps for which the kernel function is easy to evaluate. This often means finding a kernel function for which the inner product in the feature-mapped space can be written in terms of the original data vectors, without having to ever construct and . In the method of quantum kernels, the feature mapping is done by a quantum circuit, and the kernel is estimated using measurements on that circuit and the relative measurement probabilities.
In this lesson we will examine the depths of pre-coded encoding circuits that use substantial entanglement and compare those to depths of circuits we code by hand. This is not to advocate for one method over another. You may find that pre-coded circuits are too deep, and that the entanglement in the custom-built circuit is insufficient to be useful. Again, these are shown only to enable your exploration.
Before walking through a kernel matrix estimation in detail, let us outline the workflow using the language of Qiskit patterns.
Step 1: Map classical inputs to a quantum problem
- Input: Training dataset
- Output: Abstract circuit for calculating a kernel matrix entry
Given the dataset, the starting point is to encode the data into a quantum circuit. In other words, we need to map our data into the Hilbert space of states of our quantum computer. We do this by constructing a data-dependent circuit. There are many ways of doing this, and the previous lesson outlined a number of options. You can construct your own circuit to encode your data, or you can use a pre-made feature map like zz_feature_map. In this lesson, we will do both.
Note that in order to calculate a single kernel matrix element, we will want to encode two different points, so we can estimate their inner product. A full quantum kernel workflow will of course, involve many such inner products between mapped data vectors, as well as classical machine learning methods. But the core step being iterated is the estimation of a single kernel matrix element. For this we select a data-dependent quantum circuit and map two data vectors into the feature space.

For the task of generating a kernel matrix, we are particularly interested in the probability of measuring the state, in which all qubits are in the state. To see this, consider that the circuit responsible for encoding and mapping of one data vector can be written as , and the one responsible for encoding and mapping is , and denote the mapped states
These states are the mapping of the data to higher dimensions, so our desired kernel entry is the inner product