<!DOCTYPE article PUBLIC "-//NLM//DTD JATS (Z39.96) Journal Archiving and Interchange DTD v1.0 20120330//EN" "JATS-archivearticle1.dtd">
<article xmlns:xlink="http://www.w3.org/1999/xlink">
  <front>
    <journal-meta />
    <article-meta>
      <title-group>
        <article-title>Exploring an implementation of quantum learning pipeline for support vector machines</article-title>
      </title-group>
      <contrib-group>
        <contrib contrib-type="author">
          <string-name>Mario Bifulco</string-name>
        </contrib>
        <contrib contrib-type="author">
          <string-name>Luca Roversi</string-name>
        </contrib>
      </contrib-group>
      <pub-date>
        <year>2025</year>
      </pub-date>
      <abstract>
        <p>This work presents a fully quantum approach to support vector machine (SVM) learning by integrating gate-based quantum kernel methods with quantum annealing-based optimization. We explore the construction of quantum kernels using various feature maps and qubit configurations, evaluating their suitability through Kernel-Target Alignment (KTA). The SVM dual problem is reformulated as a Quadratic Unconstrained Binary Optimization (QUBO) problem, enabling its solution via quantum annealers. Our experiments demonstrate that a high degree of alignment in the kernel and an appropriate regularization parameter lead to competitive performance, with the best model achieving an F1-score of 90%. These results highlight the feasibility of an end-to-end quantum learning pipeline and the potential of hybrid quantum architectures in quantum high-performance computing (QHPC) contexts.</p>
      </abstract>
      <kwd-group>
        <kwd>eol&gt;Quantum Machine Learning</kwd>
        <kwd>Quantum Support Vector Machine</kwd>
        <kwd>Quantum High Performance Computing</kwd>
        <kwd>Quantum Gate</kwd>
        <kwd>Quantum Annealing</kwd>
      </kwd-group>
    </article-meta>
  </front>
  <body>
    <sec id="sec-1">
      <title>1. Introduction</title>
      <p>Quantum computing ultimately aims to expand the boundaries of what is currently considered eficiently
computable. Among the various fields where such advancements appear promising is machine learning.</p>
      <p>When discussing quantum computing, it is essential to specify the computational paradigm being
considered. Gate-based quantum computing refers to a universal quantum computing model, typically
implemented using superconducting circuits, where quantum circuits are programmed analogously to
how logic gates define classical circuits. Annealing-based quantum computing, on the other hand, refers
to a non-universal subset of adiabatic quantum computing, primarily designed for solving optimization
problems.</p>
      <p>
        In the context of quantum machine learning, support vector machines (SVMs) have been studied
under both computational paradigms[
        <xref ref-type="bibr" rid="ref1 ref2">1, 2</xref>
        ]. Within SVMs, we can distinguish two principal components
that contribute to model training: 1. The kernel method, which enables the mapping of examples into a
higher-dimensional feature space, thereby increasing the likelihood of linear separability, as per Cover’s
theorem[3]; 2. The optimization problem, which identifies the model parameters used for inference on
new data instances.
      </p>
      <p>In the literature, the term Quantum Support Vector Machine (QSVM) is used with two distinct meanings.
In the quantum annealing framework, QSVM refers to the use of classical kernels combined with a
reformulation of the optimization problem to be solved via quantum annealing. In the gate-based
approach, by contrast, quantum computing is employed to compute the kernels, while the optimization
is handled by classical processors.</p>
      <p>This work aims to unify the aforementioned approaches to construct a fully quantum learning pipeline
for support vector machines using a kernel based on quantum gates and a model optimization process
based on quantum annealing. Moreover, the use of diferent types of QPUs enables experimentation
within the domain of Quantum High Performance Computing (QHPC). In this domain, traditional CPU
and GPU systems can collaborate with various QPUs—regardless of their underlying architecture—with
the goal of addressing computationally intensive problems.</p>
      <p>To evaluate the proposed pipeline, we employed a subset of the Breast Cancer dataset [4]. The samples
were randomly selected by iterating over the first 10,000 prime numbers as seeds, in order to identify
the one that best preserved the original statistical distribution. Breast Cancer dataset was chosen due
to its well-established use in benchmarking classification algorithms and its balanced representation
of clinically relevant features, which make it particularly suitable for evaluating the robustness and
generalizability of machine learning pipelines.</p>
    </sec>
    <sec id="sec-2">
      <title>2. A short recap about gate-based generated Quantum Kernels</title>
      <p>This section briefly recalls the main steps to construct a gate-based quantum circuit that implements a
quantum kernel.</p>
      <p>Let  be a set of input vectors.
1. Each ⃗ ∈  is interpreted as a quantum state |(⃗)⟩ by means of a quantum circuit (⃗);
2. For each pair (⃗, ⃗ ), the quantum circuit (⃗); ((⃗ ))− 1 is constructed. It pipelines (⃗),
building the state |(⃗)⟩, with the inverse ((⃗ ))− 1 of (⃗ ), building the state |(⃗ )⟩;
3. The overlap between the states |(⃗)⟩ and |(⃗ )⟩ is estimated by measuring the probability of
the resulting state collapsing to the all-zero state, i.e., computing |⟨(⃗)|(⃗ )⟩|2.
This procedure leads to define a kernel matrix  such that each entry  corresponds to the similarity
between ⃗ and ⃗ as inferred from their representation as quantum states |(⃗)⟩ and |(⃗ )⟩.
Intuitively, the advantage of constructing  as above lies in the ability of quantum kernels to exploit qubit
entanglement and state superposition to compress the number of qubits required. Adding a single qubit
to the feature map  doubles the dimensionality of the space to which the input  is mapped.</p>
    </sec>
    <sec id="sec-3">
      <title>3. Quantum Annealing Support Vector Machine</title>
      <p>Annealing-based quantum computing naturally addresses quadratic optimization problems, particularly
those formulated as QUBO (Quadratic Unconstrained Binary Optimization) instances. The dual
formulation of the support vector machine (SVM) problem [5] leads to a multivariate quadratic polynomial,
which serves as the objective function to be optimized. By incorporating constraints into the objective
via penalty terms and converting continuous variables into their binary expansion, the problem can be
reformulated as a QUBO model.</p>
      <p>Constraint incorporation is typically achieved through Lagrangian relaxation [6]. However, the
binarization process is less straightforward due to the continuous nature of the optimization variables,
which lie in R. On one hand, integer variables can be automatically encoded in binary format, provided
that an upper bound is defined for each variable. On the other hand, the binarization of real-valued
variables incurs significantly more overhead.</p>
      <p>Empirically, we found that treating all optimization variables as integers yields a degradation in
model performance of less than one percentage point. This trade-of led us to favor an approximated
yet more hardware-eficient formulation during model generation.</p>
      <p>An additional hyperparameter of practical importance is a regularization parameter . It controls
the trade-of between maximizing the classification margin and minimizing classification errors. In
this context, the margin refers to the distance between the separating hyperplane and the closest data
points from each class.</p>
      <p>Higher values of  emphasize correct classification of training examples, whereas lower values allow
for a softer margin with more tolerance to misclassified points.</p>
      <p>(a) SU2HR feature map
(b) SU2RR feature map
(c) ZZ feature map repeated twice</p>
    </sec>
    <sec id="sec-4">
      <title>4. Results</title>
      <p>Both the design of a kernel and the optimization of the SVM problem require the selection of
hyperparameters prior to training. Section 4.1 presents our investigation into the parametrization of the
construction of a quantum kernel in the context of gate-based architectures, with respect to the chosen
dataset. Section 4.2 reports on a set of experiments aimed at selecting the parameter  in the context of
quantum-anneal based architectures, assuming no kernel is employed during training.</p>
      <p>Once the optimal hyperparameters for the individual components of the problem have been
independently identified, Section 4.3 presents the results of the end-to-end learning pipeline for fully quantum
SVMs—namely, those employing a kernel generated via quantum gates and optimization performed
through quantum annealing.</p>
      <sec id="sec-4-1">
        <title>4.1. Finding a good Quantum Kernel</title>
        <p>To identify the optimal hyperparameters to find a quantum kernel, we evaluated several values for the
following parameters:
Number of qubits available: Determines the upper limit of encodable features. When the number
of qubits was insuficient, we applied Principal Component Analysis (PCA) to project the data
into an n-dimensional subspace capturing the most relevant variance. We evaluated the pipeline
using 4, 8, 16, and 30 qubits, which represents the maximum number of features in the dataset.
Feature map: The quantum circuit responsible for encoding classical data into quantum states. These
circuits determine the geometry of the induced Hilbert space and afect model expressivity.
Figure 1a, Figure 1b and Figure 1c are three examples of possible feature maps. The feature maps
considered in our experiments include Z_feature_map, ZZ_feature_map, SU2HR, and SU2RR.
Repetitions of the feature map: Defines how many times the feature map circuit is applied in
sequence. The reason repetitions of the same feature map may be required is that, in certain cases,
a single application is not suficient to capture the desired non-linear transformation (⃗). This
layered construction is analogous to deep architectures in classical machine learning, where
increasing depth enhances representational capacity. Figure 1c shows a ZZ_feature_map repeated
twice. We tested circuits with both one and two repetitions of the feature map.</p>
        <p>To evaluate the quality of the kernel derived from the various feature maps, we employed the
KernelTarget Alignment (KTA) strategy [7]. This metric allows for estimating the efectiveness of a given
kernel on a reference dataset without the need to train a machine learning model.</p>
        <p>Formally, given a kernel matrix  ∈ R×  computed over a set of  examples, and a label vector
y ∈ {− 1, 1}, the KTA is defined as:</p>
        <p>KTA(, y) =
y⊤ y
‖‖ · 
where ‖‖ denotes the Frobenius norm of the kernel matrix. This normalized inner product quantifies
the alignment between the kernel matrix and the ideal target kernel implied by the labels. A higher
value of KTA indicates a stronger alignment and, consequently, a potentially more suitable kernel for
classification tasks.</p>
        <p>The top three configurations for the quantum kernel are reported in Table 1. All proposed
configurations exhibit a high degree of alignment. In this study, no single hyperparameter emerged as universally
optimal across configurations. This is evidenced by the presence of both circuits with many qubits and
those with fewer qubits, deep circuits as well as shallow ones, and the use of three distinct feature maps.</p>
      </sec>
      <sec id="sec-4-2">
        <title>4.2. Selecting the regularization parameter C for Quantum Annealing SVM</title>
        <p>In our experiments, we explored a range of values for  by selecting powers of two, from 22 − 1
to 212 − 1. This choice is motivated by the way optimization variables are encoded in our quantum
annealing formulation of SVMs. Specifically, each continuous optimization variable is discretized and
represented using log2() binary variables. By choosing  as 2 − 1, where  is the number of bits used,
we ensure that the integer values these binary variables can represent range from 0 to , thereby fully
utilizing all possible bit combinations. This approach minimizes the number of unused configurations
in the binary encoding and ensures a compact and eficient use of the available qubits, which is crucial
given the hardware limitations of current quantum annealers.</p>
        <p>We observed the best performance using regularization parameter values of  = 7, 63, 255.
Nevertheless, the diferences in performance across the various configurations are minimal, suggesting
that—in the application context we investigated—the examples are likely to be linearly separable with
not excessive rate.</p>
      </sec>
      <sec id="sec-4-3">
        <title>4.3. Fully Quantum SVM</title>
        <p>By combining quantum kernels with optimization via quantum annealing, we designed a QSVM pipeline
consisting of the following steps: 1. Computing the quantum kernel matrix  using a gate-based
quantum device, which encodes pairwise similarities between training examples in an implicit feature
space; 2. Formulating an optimization problem where  is used to construct the objective function;
3. Solving this problem using quantum annealing to determine the optimal model parameters; 4. Using
the obtained parameters to perform inference on new examples. These models are designed to solve
supervised classification tasks by learning a hyperplane that separates samples belonging to the positive
class from those of the negative class.</p>
        <p>The best-performing model was based on the kernel with the highest alignment (see Table 1),
specifically the kernel constructed using 30 qubits and, among the candidate values introduced in
Section 4.2, a regularization parameter of  = 255. In this case, we achieved an F1-score of 90%.
We also observed that the negative class exhibited higher recall but lower precision, whereas the
opposite was true for the positive class. This suggests that the trained model sufers from classification
issues that lead to the generation of false negatives. False negatives were found across all models,
indicating that this is a systematic issue. As usual, a more efective preprocessing phase would likely
result in a uniform performance improvement across all configurations.</p>
        <p>The model with the smallest number of qubits yielded the poorest results. Using only 8 qubits to
encode the input features and setting  = 63, the resulting F1-score was 52%, making this model
comparable to random guessing. This behavior may be attributed to an insuficient number of features
used to represent the data: reducing from 30 to 8 qubits likely caused a significant loss of information,
leading to examples becoming overly similar and thus harder to distinguish.</p>
      </sec>
    </sec>
    <sec id="sec-5">
      <title>5. Conclusion</title>
      <p>In this study, we have explored the feasibility and efectiveness of constructing an end-to-end quantum
learning pipeline for support vector machines. By integrating gate-based quantum kernel methods with
quantum annealing-based optimization, we demonstrated that it is possible to train a fully quantum
SVM model on real-world datasets.</p>
      <p>Our results show that the choice of quantum kernel—particularly the number of qubits and the
selected feature map—significantly influences classification performance. Furthermore, we observed
that the approximation involved in representing real-valued optimization variables with discrete binary
variables in the QUBO formulation does not lead to substantial performance degradation.</p>
      <p>The best-performing configuration, employing 30 qubits and a regularization parameter  = 255,
achieved an F1-score of 90%, a result comparable to that obtained using a classical SVM with an RBF
kernel, which achieved an F1-score of 91%. The marginal performance diference may be attributed
to the discretization of optimization variables in the quantum annealing process. The presence of
systematic false negatives suggests that further improvements could be achieved with a more refined
data preprocessing pipeline. While incorporating domain knowledge about the origin and nature of the
training and test datasets could also be beneficial, we believe that the most efective improvements are
likely to come from enhanced preprocessing strategies or the use of larger and more representative
datasets</p>
      <p>This work is a first step towards future investigations into scalable quantum machine learning
pipelines and highlights the role of quantum high-performance computing in facilitating hybrid
computational workflows across diverse quantum architectures.</p>
    </sec>
    <sec id="sec-6">
      <title>Acknowledgments</title>
      <p>This work was partially supported by CN-HPC-Spoke1-Future HPC &amp; Big Data funded with PNRR
funds MUR-M4C2-Investimento 1.4.</p>
    </sec>
    <sec id="sec-7">
      <title>Declaration on Generative AI</title>
      <p>The authors have not employed any Generative AI tools.
[3] T. M. Cover, Geometrical and statistical properties of systems of linear inequalities with applications
in pattern recognition, IEEE Transactions on Electronic Computers EC-14 (1965) 326–334. doi:10.
1109/PGEC.1965.264137.
[4] W. Wolberg, O. Mangasarian, N. Street, W. Street, Breast cancer wisconsin (diagnostic), https:
//doi.org/10.24432/C5DW2B, 1993. UCI Machine Learning Repository.
[5] C. Cortes, V. N. Vapnik, Support-vector networks, Machine Learning 20 (1995) 273–297. URL:
https://api.semanticscholar.org/CorpusID:52874011.
[6] C. Lemaréchal, Lagrangian Relaxation, Springer Berlin Heidelberg, Berlin, Heidelberg, 2001, pp.</p>
      <p>112–156. URL: https://doi.org/10.1007/3-540-45586-8_4. doi:10.1007/3-540-45586-8_4.
[7] N. Cristianini, J. Shawe-Taylor, A. Elisseef, J. S. Kandola, On kernel-target alignment, in: Neural
Information Processing Systems, 2001. URL: https://api.semanticscholar.org/CorpusID:17466014.</p>
    </sec>
  </body>
  <back>
    <ref-list>
      <ref id="ref1">
        <mixed-citation>
          [1]
          <string-name>
            <given-names>D.</given-names>
            <surname>Willsch</surname>
          </string-name>
          ,
          <string-name>
            <given-names>M.</given-names>
            <surname>Willsch</surname>
          </string-name>
          ,
          <string-name>
            <given-names>H.</given-names>
            <surname>Raedt</surname>
          </string-name>
          ,
          <string-name>
            <given-names>K.</given-names>
            <surname>Michielsen</surname>
          </string-name>
          ,
          <article-title>Support vector machines on the d-wave quantum annealer</article-title>
          ,
          <source>Computer Physics Communications</source>
          <volume>248</volume>
          (
          <year>2019</year>
          )
          <article-title>107006</article-title>
          . doi:
          <volume>10</volume>
          .1016/j.cpc.
          <year>2019</year>
          .
          <volume>107006</volume>
          .
        </mixed-citation>
      </ref>
      <ref id="ref2">
        <mixed-citation>
          [2]
          <string-name>
            <given-names>V.</given-names>
            <surname>Havlíček</surname>
          </string-name>
          ,
          <string-name>
            <given-names>A. D.</given-names>
            <surname>Córcoles</surname>
          </string-name>
          ,
          <string-name>
            <given-names>K.</given-names>
            <surname>Temme</surname>
          </string-name>
          ,
          <string-name>
            <given-names>A. W.</given-names>
            <surname>Harrow</surname>
          </string-name>
          ,
          <string-name>
            <given-names>A.</given-names>
            <surname>Kandala</surname>
          </string-name>
          ,
          <string-name>
            <given-names>J. M.</given-names>
            <surname>Chow</surname>
          </string-name>
          ,
          <string-name>
            <given-names>J. M.</given-names>
            <surname>Gambetta</surname>
          </string-name>
          ,
          <article-title>Supervised learning with quantum-enhanced feature spaces</article-title>
          ,
          <source>Nature</source>
          <volume>567</volume>
          (
          <year>2019</year>
          )
          <fpage>209</fpage>
          -
          <lpage>212</lpage>
          . URL: http://dx.doi.org/10.1038/s41586-019-0980-2. doi:
          <volume>10</volume>
          .1038/s41586-019-0980-2.
        </mixed-citation>
      </ref>
    </ref-list>
  </back>
</article>