Abstract: Quantum support vector machines have the potential to achieve a quantum speedup for solving certain machine learning problems. The key challenge for doing so is finding good quantum kernels for a given data set -- a task called kernel alignment. In this paper we study this problem using the Pegasos algorithm, which is an algorithm that uses stochastic gradient descent to solve the support vector machine optimization problem. We extend Pegasos to the quantum case and and demonstrate its effectiveness for kernel alignment. Unlike previous work which performs kernel alignment by training a QSVM within an outer optimization loop, we show that using Pegasos it is possible to simultaneously train the support vector machine and align the kernel. Our experiments show that this approach is capable of aligning quantum feature maps with high accuracy, and outperforms existing quantum kernel alignment techniques. Specifically, we demonstrate that Pegasos is particularly effective for non-stationary data, which is an important challenge in real-world applications.
Introduction
Quantum Support Vector Machines (QSVMs) offer a potential path to quantum advantage by mapping classical data into a high-dimensional quantum feature space. However, the success of a QSVM depends entirely on the "kernel"—the specific mapping of data to quantum states. Finding the right kernel for a specific dataset, a process called kernel alignment, has traditionally been a computationally prohibitive "nested" optimization task. Furthermore, most existing methods assume stationary data, making them brittle in real-world scenarios where data distributions shift over time.
This paper introduces a streamlined method for Quantum Kernel Alignment by adapting the Pegasos algorithm (Primal Estimated sub-GrAdient SOlver for SVM) to the quantum realm. By solving the SVM problem in its primal form using stochastic gradient descent, we can simultaneously train the classifier and optimize the quantum feature map, enabling real-time adaptation to dynamic data.
Methodology: Simultaneous Optimization
The core technical innovation is the shift from the standard "dual" formulation of SVMs to the primal problem. Unlike previous methods that use an outer loop for the kernel and an inner loop for the SVM, the Pegasos algorithm allows for updating both the SVM weights and the quantum circuit parameters ($\theta$) in a single iterative process.
To update the quantum circuit parameters, we employ Simultaneous Perturbation Stochastic Approximation (SPSA). This gradient-free optimizer approximates gradients using only two measurements, making it highly efficient for noisy intermediate-scale quantum (NISQ) hardware. This iterative nature also facilitates online learning, where the model processes data points sequentially rather than requiring the full dataset upfront.
Experimental Setup
The researchers evaluated this approach using two primary datasets:
- Covariant Dataset: A synthetic dataset designed to exhibit a structure that quantum kernels can exploit but classical ones struggle with.
- Non-Stationary Covariant Dataset: A novel variation where the ideal kernel parameter ($\theta_{opt}$) shifts over time (e.g., according to a sine wave), simulating real-world "concept drift."
Key Results and Insights
The primal formulation proves significantly more efficient for joint optimization than the dual problem, turning a sequential bottleneck into a parallelizable update. For a dataset of size $M$, while dual approaches scale as $O(M^{4.67})$, the Pegasos-based approach scales much more favorably.
In simulations with 10 qubits, the algorithm achieved 100% training accuracy on the covariant dataset. Crucially, the method demonstrated hardware resilience; in experiments on the 7-qubit ibm_nairobi device, the algorithm successfully tracked a continuously changing optimal parameter, maintaining a classification accuracy of over 90% despite gate errors and readout noise.
Conclusion and Future Work
While Pegasos QKA is a vital step toward practical quantum machine learning, challenges such as "barren plateaus" (vanishing gradients) and noise sensitivity remain as qubit counts increase. Future work will explore the performance of simultaneous alignment on broader, less structured real-world datasets to further validate its generalizability.
Summary updated