Kernel method in machine learning consists of encoding input data into a vector in a Hilbert space called the feature space and modeling the target function as a linear map on the feature space. Given a cost function, computing such an optimal linear map requires computation of a kernel matrix whose entries equal the inner products of feature vectors. In the quantum kernel method it is assumed that the feature vectors are quantum states in which case the quantum kernel matrix is given in terms of the overlap of quantum states. In practice, to estimate entries of the quantum kernel matrix one should apply, e.g., the SWAP-test and the number of such SWAP-tests is a relevant parameter in evaluating the performance of the quantum kernel method. Moreover, quantum systems are subject to noise, so the quantum states as feature vectors cannot be prepared exactly and this is another source of error in the computation of the quantum kernel matrix. Taking both the above considerations into account, we prove a bound on the performance (generalization error) of the quantum kernel method.
Kernel method in machine learning consists of encoding input data into a vector in a Hilbert space called the feature space and modeling the target function as a linear map on the feature space. Given a cost function, computing such an optimal linear map requires computation of a kernel matrix whose entries equal the inner products of feature vectors. In the quantum kernel method it is assumed that the feature vectors are quantum states in which case the quantum kernel matrix is given in terms of the overlap of quantum states. In practice, to estimate entries of the quantum kernel matrix one should apply, e.g., the SWAP-test and the number of such SWAP-tests is a relevant parameter in evaluating the performance of the quantum kernel method. Moreover, quantum systems are subject to noise, so the quantum states as feature vectors cannot be prepared exactly and this is another source of error in the computation of the quantum kernel matrix. Taking both the above considerations into account, we prove a bound on the performance (generalization error) of the quantum kernel method.
A basic idea of quantum computing is surprisingly similar to that of kernel methods in machine learning, namely, to efficiently perform computations in an intractably large Hilbert space. In this Letter we explore some theoretical foundations of this link and show how it opens up a new avenue for the design of quantum machine learning algorithms. We interpret the process of encoding inputs in a quantum state as a nonlinear feature map that maps data to quantum Hilbert space. A quantum computer can now analyze the input data in this feature space. Based on this link, we discuss two approaches for building a quantum model for classification. In the first approach, the quantum device estimates inner products of quantum states to compute a classically intractable kernel. The kernel can be fed into any classical kernel method such as a support vector machine. In the second approach, we use a variational quantum circuit as a linear model that classifies data explicitly in Hilbert space. We illustrate these ideas with a feature map based on squeezing in a continuous-variable system, and visualize the working principle with two-dimensional minibenchmark datasets.
This chapter gives an example of quantum kernels and the swap test. Then, it describes quantum kernels and the inversion test. Quantum feature maps encodes classical data into quantum data via a parametrized quantum circuit. A quantum computer can estimate a quantum kernel and the estimate can be used by a kernel method on a classical computer. This is because the exponential quantum advantage in evaluating inner products allows to estimate the quantum kernel machines directly in the higher-dimensional space. Quantum feature maps encodes classical data into quantum data via a parametrized quantum circuit. Quantum feature maps encodes classical data into quantum data via a parametrized quantum circuit that are hard to simulate classically and is an active area of current research.
Quantum-enhanced machine learning is a rapidly evolving field that aims to leverage the unique properties of quantum mechanics to enhance classical machine learning. However, the practical applicability of these methods remains an open question, particularly beyond the context of specifically crafted toy problems, and given the current limitations of quantum hardware. This study focuses on quantum kernel methods in the context of classification tasks. In particular, it examines the performance of quantum kernel estimation and quantum kernel training (QKT) in connection with two quantum feature mappings, namely, ZZFeatureMap and CovariantFeatureMap. Remarkably, these feature maps have been proposed in the literature under the conjecture of possible near-term quantum advantage and have shown promising performance in ad hoc datasets. This study aims to evaluate their versatility and generalization capabilities in a more general benchmark, encompassing both artificial and established reference datasets. Classical machine learning methods, specifically support vector machines and logistic regression, are also incorporated as baseline comparisons. Experimental results indicate that quantum methods exhibit varying performance across different datasets. Despite outperforming classical methods in ad hoc datasets, mixed results are obtained for the general case among standard classical benchmarks. The experimental data call into question a general added value of applying QKT optimization, for which the additional computational cost does not necessarily translate into improved classification performance. Instead, it is suggested that a careful choice of the quantum feature map in connection with proper hyperparameterization may prove more effective.
Kernel methods compare inputs through feature maps. Quantum kernels follow the same principle: input data are encoded into quantum states, which define quantum feature representations in Hilbert spaces. Kernel values are then obtained by estimating inner products between these states using suitable quantum circuit measurements. As a result, quantum kernels may be intractable to compute classically while remaining efficiently computable on quantum hardware, potentially leading to a quantum advantage. However, designing effective quantum kernels remains a major challenge. Many quantum kernels, such as the fidelity kernel, suffer from exponential concentration. This results in near-identity kernel matrices that fail to capture meaningful data correlations and lead to overfitting and poor generalization. In this paper, we propose a novel strategy for constructing quantum kernels that achieve good generalization performance, drawing inspiration from benign overfitting in classical machine learning. We introduce the concept of Local-Global quantum kernels, which combine two components: a local quantum kernel based on measurements of small subsystems, and a global quantum kernel derived from full-system measurements. To support the effectiveness of the proposed construction, we show theoretically and empirically that Local-Global quantum kernels exhibit benign overfitting.
Abstract One of the most natural connections between quantum and classical machine learning has been established in the context of kernel methods. Kernel methods rely on kernels, which are inner products of feature vectors living in large feature spaces. Quantum kernels are typically evaluated by explicitly constructing quantum feature states and then taking their inner product, here called embedding quantum kernels. Since classical kernels are usually evaluated without using the feature vectors explicitly, we wonder how expressive embedding quantum kernels are. In this work, we raise the fundamental question: can all quantum kernels be expressed as the inner product of quantum feature states? Our first result is positive: Invoking computational universality, we find that for any kernel function there always exists a corresponding quantum feature map and an embedding quantum kernel. The more operational reading of the question is concerned with efficient constructions, however. In a second part, we formalize the question of universality of efficient embedding quantum kernels. For shift-invariant kernels, we use the technique of random Fourier features to show that they are universal within the broad class of all kernels which allow a variant of efficient Fourier sampling. We then extend this result to a new class of so-called composition kernels, which we show also contains projected quantum kernels introduced in recent works. After proving the universality of embedding quantum kernels for both shift-invariant and composition kernels, we identify the directions towards new, more exotic, and unexplored quantum kernel families, for which it still remains open whether they correspond to efficient embedding quantum kernels.
Kernel methods are a cornerstone of classical machine learning. The idea of using quantum computers to compute kernels has recently attracted attention. Quantum embedding kernels (QEKs), constructed by embedding data into the Hilbert space of a quantum computer, are a particular quantum kernel technique that is particularly suitable for noisy intermediate-scale quantum devices. Unfortunately, kernel methods face three major problems: Constructing the kernel matrix has quadratic computational complexity in the number of training samples, choosing the right kernel function is nontrivial, and the effects of noise are unknown. In this work, we addressed the latter two. In particular, we introduced the notion of trainable QEKs, based on the idea of classical model optimization methods. To train the parameters of the QEK, we proposed the use of kernel-target alignment. We verified the feasibility of this method, and showed that for our experimental setup we could reduce the training error significantly. Furthermore, we investigated the effects of device and finite sampling noise, and we evaluated various mitigation techniques numerically on classical hardware. We took the best performing strategy and evaluated it on data from a real quantum processing unit. We found that using this mitigation strategy demonstrated an increased kernel matrix quality.