2025年6月23日月曜日

Comparison of Kernel PCA on Gaussian and Quantum kernel

Auto-translated from Japanese.

[Abstract]
The ad_hoc_data dataset is commonly used in research exploring quantum methods for data classification. An example of applying the KPCA (Kernel Principal Component Analysis) method to this dataset is provided in the IBM tutorial "Qiskit Machine Learning 0.8.3". In the tutorial, a comparison is made between a Gaussian kernel (the classical RBF kernel) and a quantum kernel (based on the ZZFeatureMap). The results demonstrated an example of quantum advantage. This article revisits and reaffirms those findings.

🔴 Characteristics of the Input Dataset: ad_hoc_data
This is an artificial dataset designed to make linear separation (classification) difficult for classical methods but easier for quantum techniques. Although it lacks practical applications, it is often used in studies of quantum advantage. Specifically, the dataset is constructed so that classification is challenging with classical kernels (e.g., Gaussian RBF), but effective with quantum kernels based on quantum feature maps such as ZZFeatureMap. It is primarily a binary classification dataset (labels 0 and 1), split into training and test sets.

    A key parameter, gap, controls how easily the classes can be separated. Larger values generally make the separation easier. Figure 1 shows the sample distribution. The samples for classes 0 and 1 are grouped into small clusters, making linear separation appear difficult.


🔴 Mechanism of KPCA (Kernel Principal Component Analysis) and Classification
KPCA is an extension of traditional PCA using the kernel trick, allowing it to effectively handle datasets with nonlinear structures. First, the input data is implicitly mapped into a high-dimensional feature space using a kernel function. In that space, similarities between samples are calculated, forming a kernel matrix (see Fig. 2). The kernel can be either a classical kernel (e.g., Gaussian RBF) or a quantum kernel (e.g., using a quantum feature map).

    Next, PCA is applied to this kernel matrix to project the data onto the principal components (or, reduce dimensionality).

    At this stage, we are only preparing for classification — no label information is used yet. Interestingly, when constructing a kernel matrix based on fidelity (similarity) using the ZZFeatureMap, a class-like structure (similar to clustering) can emerge even without using labels, particularly in datasets favorable to quantum kernels such as ad_hoc_data. That is, a block-like structure becomes visible in the heatmap of the kernel matrix.

    Figure 2(a) demonstrates this clearly. Most of the data pairs with label 0 (indices 0–49) form a high-similarity block (dark green), as do those with label 1 (indices 50–99). By contrast, in the classical Gaussian kernel case (Fig. 2(b)), this block structure is much less evident.


    After this stage, we proceed to supervised learning by incorporating label information. While Support Vector Classification (SVC) could be used, we opted for Logistic Regression due to its simplicity and compatibility with quantum kernels such as ZZFeatureMap-based.

    The classification results are shown in Fig. 3. They appear to reflect the structure seen in the kernel matrix of Fig. 2. Indeed, the test accuracy was 0.95 using the quantum kernel (Fig. 3(a)) and 0.6 with the classical kernel (Fig. 3(b)). This provides an illustrative example of the potential benefits of quantum kernels.

🔴Reference [Qiskit Machine Learning 0.8.3]

0 件のコメント:

コメントを投稿