1. Introduction
A promising study [
1] established, for the first time, a method to produce accurate results with a 127-qubit computer. That work paved the way for near-term quantum applications and a new period, which is sometimes referred to as the “quantum utility era.” Quantum computing has provided similar or better results, compared to classical approaches, for certain optimization problems.
For example, ref. [
2] demonstrated that quantum optimization can integrate with the Rosetta software for molecular design. In pharmacology, it is challenging to find a molecule that has the desired effect without any side effects and that is also easy to package and produce. The problem becomes exponentially complex as the size of the molecule increases. In contrast, quantum optimization performs consistently, regardless of the molecule’s size.
Quantum optimization yields distinct classification outcomes compared to its classical counterpart. In ref. [
3], the authors studied the feasibility of quantum technology to detect fraudulent micropayment transactions. They identified the transactions for which classical and quantum classifiers disagreed and utilized those instances to train a meta-classifier. The meta-classifier was then used to select the preferred prediction in situations where the predictions from the quantum and classical classifiers differed. A key takeaway from the study is that quantum and classical approaches can detect different types of relationships. As a result, combining these approaches can enhance the classification performance.
Quantum machine learning has also provided excellent results in healthcare when classifying diabetes or heart disease, analyzing the impact of stress on mental health, and detecting Alzheimer’s or schizophrenia [
4]. In ref. [
4], it was shown that a quantum support vector machine (QSVM) using the correct set of hyperparameters—specifically, the feature map that determined the quantum kernel’s type—achieved a high classification score for detecting schizophrenia, based on an electroencephalogram (EEG) analysis.
Also in the domain of EEG analyses, ref. [
5] demonstrated that quantum classification achieved excellent results when classifying resting states. Different resting states were induced by asking subjects to open or close their eyes. The algorithm then categorized the EEG signal epochs recorded during the two experimental conditions. The algorithm achieved a 99 % accuracy using only five qubits and limited preprocessing steps. Classification was performed on a time-sample-by-time-sample basis, and a principal component analysis (PCA) was used for a dimensionality reduction.
Similarly, ref. [
6] provided a proof of concept for the quantum classification of EEG signals by computing symmetric positive definite (SPD) matrices and processing them using Riemannian geometry. The study focused on the P300, a potential elicited in the brain in response to a stimulation, which has a lower signal-to-noise ratio than data from resting states. The tangent space method based on Riemannian geometry was employed to generate feature vectors for each EEG trial epoch [
7]. The feature vectors underwent an additional PCA to reduce their dimensions. The classifier was able to generalize, with results that were close to, but slightly lower than, those of the state-of-the-art linear discriminant analysis (LDA).
In this article, we focus on another classifier, called nearest convex hull (NCH) [
8], which has been adapted to SPD matrices [
9]. This is a supervised classifier where the label of a trial for classification is determined by calculating the Riemannian distance between the trial and the convex hull of the training trials. More precisely, the unidentified trial is assigned the label of the nearest hull in the Riemannian manifold. The optimization problem involves finding the point on the hull that is closest to the trial. We contributed additional classification strategies to the NCH. First, instead of using all training samples, we constructed the convex hull from only the
N nearest samples. Second, we constructed
K convex hulls per class, each based on
N randomly selected samples.
This study assessed the performance of the NCH classifier for the classification of electroencephalography signals using a classical computer and a quantum simulator. In this study, we considered the dataset [
10] to be a particularly challenging classification problem. It contained EEG recordings of participants alternating between two extremely similar resting states.
Another key challenge addressed in this study is the encoding of an optimization problem with continuous variables into an objective function that is quadratic, is binary, and accepts only linear constraints—in other words, an approach suitable for variational quantum algorithms. Our approach separates the objective function from the optimization techniques and demonstrates a promising avenue for translating an existing machine learning algorithm into one that can run on a quantum computer.
Note that the quantum computer or simulator was used exclusively to solve the optimization problem at the core of the classical machine learning algorithm. This represents a narrower scope within the broader field of quantum machine learning, as only the optimization routine is replaced by a quantum method, while both the model and data remain classical.
This approach of combining classical and quantum technologies is not entirely new, and several examples exist in the state of the art. For instance, ref. [
11] proposed an enhanced variational quantum algorithm aimed at simulating the time evolution of large, uniform quantum systems with repeating structures. The core idea of their method is to determine optimal weights for a variational quantum circuit on small problem instances using classical resources. Once trained, these circuits are then scaled qubit by qubit to address larger instances of the problem.
In a similar vein, ref. [
12] presented a hybrid classical–quantum approach in which a classical convolutional neural network (CNN) was trained to predict expectation values from random quantum circuits. This enabled the model to generalize to larger and deeper circuits, beyond the reach of current quantum hardware. A parallel can be drawn with Mozilla’s PRESC framework (accessed on 23 October 2025)
https://mozilla.github.io/PRESC/) [
13], which explores how classical machine learning models can replicate behaviors originally produced by black-boxed systems. While PRESC is typically applied in more traditional domains, ref. [
12] embodied a similar philosophy for quantum computing. Another hybrid quantum–classical CNN approach is available in [
14]. The authors proposed a framework designed to preserve image data privacy. It preserved the model’s accuracy while ensuring data privacy. These examples indicate that hybrid models represent an active field of research.
This paper is structured as follows.
Section 2 introduces the NCH classifier, framed as a quadratic optimization problem, and background information on the quantum approximate optimization.
Section 3 highlights our contribution. In particular, it describes the implementation of the objective function using a constraint-programming model and the process to solve this model using quantum optimization.
Section 4 contains an experimental validation of the NCH on EEG data.
Section 5 presents the results in comparison to the state-of-the-art method. In
Section 6, we provide a comprehensive overview of our approach and recommendations, and
Section 7 holds our conclusions.
2. Background
2.1. NCH Classifier
The NCH classifier [
8] models each class by its convex hull. The NCH classifier is like k-NN at training time and stores only the training set in memory (
Figure 1a). During classification, the matrix
X to be classified is assigned to the class with the closest convex hull, denoted as
:
The distance to the hull
is the distance between
X and the classification point
. The classification point is the closest point on
to
X:
Note that the classification point
depends on the test matrix
X, as illustrated in
Figure 1b, with a second test matrix.
Originally developed for Euclidean data, NCH was later extended to cover SPD matrices in [
9]. Using a log-Euclidean distance, the classification problem can be explicitly written (see Equation (20) in [
9]) as follows:
with
and
. In the above equation,
denotes the matrix logarithm;
X represents the matrix to be classified;
is the index of the matrix belonging to class
c;
is the training matrix belonging to class
c; and
w is the weight that is optimized to find the classification point
.
The objective function can be simplified as follows [
9]:
as the term
is constant. Note that the trace operator
was omitted in Equation (21) of [
9]. This objective function is a quadratic optimization problem that can be solved with constraint programming. However, it was not originally designed for EEG classification; to our knowledge, its application to an EEG analysis in this study is novel.
2.2. Quantum Approximate Optimization Algorithm
Quantum optimization algorithms are hybrid algorithms that rely partially on classical optimizers. In the field of quantum optimization, the main approaches are the variational quantum eigensolver (VQE) [
15], the quantum approximate optimization algorithm (QAOA) [
16], and quantum annealing (QA) [
17]. The first two, VQE and QAOA, are very similar and belong to a family of variational quantum algorithms (VQAs). In contrast, QA falls under the category of simulated annealing algorithms. Strictly speaking, QA does not implement adiabatic quantum computing. More information is provided in
Appendix A.
In this paper, we used QAOA as a quantum optimization algorithm. QAOA is a variational algorithm, originally designed to solve combinatory problems such as the MaxCut problem [
16]. In other words, it integrates parameterized quantum circuits with classical optimization routines to solve quadratic, unconstrained, and binary optimization (QUBO) problems.
QAOA can be interpreted as a discretized approximation of adiabatic quantum computing (AQC). In particular, the unitary evolution operator
derived from AQC (Equation (A3)) can be approximated using the Trotter–Suzuki expansion [
18], as follows:
where
and
are non-commuting Hamiltonians, representing the initial (or mixer) and problem (or cost) Hamiltonians, respectively.
In QAOA, the ansatz is a parameterized quantum circuit constructed by alternating applications of the mixer and cost operators, repeated over
n layers (see
Figure 2). A classical optimizer is used to determine the optimal parameters
and
that minimize a given cost function.
In the original implementation, the expectation value of the measured qubits was optimized. This expectation is always 0 and 1 on a universal computer. In contrast, the expectation can be continuous between 0 and 1 on a computer in which the registers are, or are equivalent to, harmonic oscillators, such as photonic or bosonic quantum computers. In our case, we were only interested in gate-based universal computers.
The cost operator was the Ising Hamiltonian of the QUBO problem. It was computed by mapping the terms of the objective function to a Pauli observable (i.e., a Hermitian matrix) [
20], such as
We considered, as an example, the following objective function:
This Boolean function can be mapped to an Ising Hamiltonian using the following standard substitution:
where
is the Pauli-
Z operator acting on qubit
i. The resulting Hamiltonian is
where
is the identity operator acting on qubit
i and ⊗ denotes the tensor product over the respective Hilbert spaces.
The mixer operator relies on the encoding scheme of the variables. As QAOA only works with QUBO problems, it is standard practice to convert integer or categorical variables into their binary form. By default, we used the X mixer, which is defined by the following Hamiltonian:
where
N is the number of qubits and
is the Pauli
X operator acting on the
ith qubit (indices starting at zero):
The X mixer performs the best when the variables are binary-encoded [
21]. However, when the variables are encoded with one-hot encoding, we used the XY mixer, defined by
where
is the Pauli
Y operator acting on the
ith qubit:
For domain-wall encoding, we used the domain-wall mixer, defined by
where
is the Pauli
Z operator acting on the
ith qubit. Domain-wall encoding provides the best results for combinatory problems, such as workflow optimization [
21].
In a quantum computer with registers functioning as harmonic oscillators, the qubit’s value oscillates between 0 and 1. Consequently, with a few adjustments to the mixer operator, one can optimize continuous variables using QAOA [
22,
23]. The QAOA then behaves as a quantum version of the gradient descent. On a gate-based quantum computer, this approach can be implemented by simulating registers with harmonic oscillators. An alternative method, proposed in [
24], focuses on optimizing the quasi-probability distribution of the qubit rather than its expectation value. The motivation for this approach lies in the fact that the quasi-probability distribution is always continuous, whereas the expectation value on gate-based quantum computers remains binary. In the remainder of this article, we focus on this method and benchmark it against a naive implementation of QAOA for continuous variables, where continuous variables are simply encoded into binary variables and optimized using the original QAOA. These approaches are described in more detail in
Section 3.3 and
Section 3.4.
In conclusion, the performance of QAOA relies on the selection of both the mixer operator and classical optimizer. In [
25], various classical optimizers were benchmarked for QAOA, and gradient-based algorithms such as Adam and Powell, as well as COBYLA and the SPSA, achieved solutions with the lowest energy values. SLSQP was also reported as a competitive option, being the fastest among all the tested optimizers. This speed advantage may allow SLSQP to perform more iterations within the same time budget, potentially leading to lower energy values. However, the results in [
25] were obtained using a quantum simulator with only the noise model of a five-qubit quantum device (IBMQ Rome). For experiments on real quantum hardware or extremely noisy quantum simulators, a simultaneous perturbation stochastic approximation (SPSA) [
26,
27] may be a more suitable choice, as it is specifically designed to operate effectively in noisy environments.
3. NCH Implementation for Quantum Computing
For our quantum implementation, we employed constrained optimization methods, which enabled the use of both the naïve implementation of QAOA-CV and the QAOA-CV variant with quasi-probability distribution optimization. We used the SLSQP optimizer, except for QAOA-CV, where the SPSA algorithm was applied. In this section, we explore the NCH model and its adaptation, selecting the most suitable quantum encoding strategy. Next, we address every aspect of this implementation in detail.
3.1. Constraint-Programming Model
Constraint programming is a declarative programming paradigm for representing complex problems by defining variables and their relationships. This results in an objective function along with a set of constraints. An optimizer then searches for solutions that minimize or maximize the objective function while satisfying all constraints.
The core idea is to promote optimization expressiveness by decoupling the problem definition from the solving strategy. This separation enables the use of various, potentially novel or specialized, optimization techniques to solve the same problem formulation.
DOcplex [
28] is IBM’s modeling framework, used here to define a quadratic optimization problem through constraint programming. DOcplex aids in converting a mathematical problem into an objective function that can be further optimized. The mathematical problem considered in this case was the NCH quadratic problem, which is utilized in Equation (
4) with the log-Euclidean distance, where
w is the variable to optimize.
This problem admits a linear constraint whereby the sum of the weights must be equal to 1. However, because QUBO problems do not support constraints, a penalty term was added to the objective function. This term heavily penalizes any violation of the constraint, so the solver is
guided toward feasible solutions. We used the
LinearEqualityToPenalty converter [
29], which automatically converts a linear equality constraint into such a penalty term. The objective function in Equation (
4) can then be rewritten as follows:
where
is the penalty coefficient. The idea is that any solution for which the weights do not sum to 1 incurs a large penalty, making it unlikely to be selected when minimizing the objective function. In our case,
was computed as follows:
where
and
denote the upper and lower bounds of the linear objective terms, and
and
refer to those of the quadratic terms.
This objective function is straightforward to implement with DOcplex using the sum method and DOcplex variables to represent the weights w (Listing 1). The variable type can be either continuous, integer, or binary, depending on the optimization method used (naïve QAOA, QAOA-CV, or classical).
| Listing 1. Definition of the objective function with DOcplex. |
![Quantumrep 07 00051 i001 Quantumrep 07 00051 i001]() |
In pyRiemann-qiskit, this type is managed by an instance of
pyQiskitOptimizer, which employs the correct variable type and, if necessary, converts the problem into QUBO. The convex distance of the NCH was implemented through constraint programming using DOcplex, and the implementation is available in pyRiemann-qiskit [
30].
3.2. Quantum Implementations of NCH
In the NCH algorithm, each point in the training set is associated with a weight that must be optimized. Consequently, the complexity of the problem increases with the size of the training set.
In the context of quantum computing, each weight is ultimately encoded into one or more qubits, which imposes strict constraints on the size of the dataset. Quantum simulators have a maximum capacity of 36 qubits, meaning that, in the best-case scenario—where each weight is represented by a single qubit—these simulators can handle convex hulls containing up to 36 matrices. However, approaching this upper limit is not advisable, as the simulation time grows exponentially with the number of qubits, making such experiments computationally impractical.
For this reason, the NCH module in pyRiemann-qiskit implements the following two strategies to avoid estimating the hull on all matrices of each class:
Min hull: The min hull finds the matrices closest to the test matrix and uses them to estimate the hull of the class.
Random hull: The random hull randomly samples subsets of training matrices to construct multiple convex hulls per class, each based on fewer points. For a given test sample, the distances to all hulls within each class are computed and summed, resulting in an aggregate distance per class. The class with the minimum aggregate distance is then assigned as the label for the sample.
The number of hulls and samples per hull are controlled by the parameters of the NCH implementation.
3.3. Naïve Implementation of QAOA-CV
QAOA-CV stands for “quantum approximate optimization algorithm with continuous variables.” This version is an extension of the original QAOA that allows for handling not just binary variables, but also continuous ones. A straightforward implementation of QAOA-CV involves transforming continuous variables into binary ones.
The algorithm comprises two steps:
Step 1: Discretization of Continuous Variables
Each continuous variable in the objective function is transformed into a bounded integer variable . The lower bound of is fixed at 0, while the upper bound is arbitrarily defined and determines the precision of the representation.
The mapping between
and
can be expressed as follows:
As increases, the discretization becomes finer, thereby enhancing the precision of the continuous variable’s representation.
Example 1. Consider a continuous variable . If its integer representation is defined by , thenAs shown in Figure 3, a value of 0.6 falls into category 1. Increasing the upper bound (e.g., from 3 to 10) allows for a more granular mapping between x and z. Step 2: Encoding for Quantum Representation
Each integer variable
is subsequently encoded into binary variables to enable processing by the QAOA. This step establishes the connection between the discretized classical variables and their quantum representation by mapping each integer value to a unique binary string. As shown in
Figure 3, each category obtained in the previous step is assigned a binary representation using the
binary encoding scheme, allowing QAOA to operate directly on the encoded variables.
Remark 1. In general, the encoding can be implemented using one of several techniques, including the following:
Binary encoding;
One-hot encoding;
Domain-wall encoding [21].
We selected binary encoding and now provide the rationale for this choice. Each binary variable generated through this algorithm requires a separate qubit. Consequently, the total number of qubits required by QAOA scales with both the number of discretized variables and the chosen encoding scheme. Quantum simulations typically strive to minimize the number of qubits used, which makes it crucial to select an efficient encoding strategy and set a proper upper bound. For instance, integer variables ranging from 0 to 3 (upper bound = 3) can be represented using one-hot encoding with three bits (e.g., 001, 010, 100), or more efficiently with binary encoding using only two bits (00, 01, 10, 11). In contrast, variables ranging from 0 to 15 (upper bound = 15) require 4 bits with binary encoding, but as many as 15 bits with one-hot encoding. This illustrates the importance of selecting a compact representation to balance precision and quantum resource constraints. To balance the precision and resource constraints, we adopted binary encoding and set the upper bound of the integer variable to 7 by default, allowing for eight distinct categories. This decision represents a practical compromise that ensures adequate precision while keeping the computational costs low.
Example 2 (with NCH). If there are two training points, the weight vector will consist of two variables. Each variable can take integer values between 0 and 7, requiring three qubits to encode each value ( possible values). Consequently, the total number of qubits needed is .
A notable advantage of binary encoding is its efficiency in qubit usage when the upper bound is high. For instance, representing eight categories using one-hot encoding would require eight qubits per weight. In contrast, binary encoding achieves the same representation with far fewer qubits (only three, as we saw).
In the remainder of this article, the X mixer was utilized to encode the continuous variables, and we employed the SLSQP algorithm to optimize the weights of the QAOA ansatz.
3.4. QAOA-CV with Quasi-Probability Distribution Optimization
QAOA focuses on optimizing the expectation values, which are typically
and
, for a universal quantum computer. The current implementation of QAOA-CV was proposed in [
24] and focuses on the optimization of the quasi-probability distribution, which is continuous.
In this case, we simply replaced the continuous variables with binary ones. This is a formal modification that allows us to compute the cost operator as if the variables are binary. The cost operator is therefore the same as if the problem were just a QUBO problem. We then optimized the parameters of the circuit, based not on the expectation values, but rather on the quasi-probability distribution. For example,
The quasi-probability of the first (resp. second) qubit being in state
is 0.5 (resp. 0.6). Therefore, we retain 0.5 and 0.6, respectively, as the new values for variables
a and
b. This approach differs from classical QAOA, which optimizes the expectation value
, where
is the most probable state (e.g.,
) and
is the cost Hamiltonian. In our case, the expectation value becomes
where
f is the cost function.
In [
24], the SPSA was shown to perform well as a classical optimizer for determining the weights of the QAOA ansatz, whereas SLSQP failed to converge. This is noteworthy, as SLSQP was the recommended optimizer for the naïve implementation of QAOA-CV.
While [
24] does not provide a theoretical framework to explain this discrepancy, it is important to emphasize that the cost function described above differs from that of QAOA. As a result, the implementation presented in [
24] shares the ansatz and algorithm name with QAOA, but not the exact mathematical formulation.
4. Experiments
4.1. Data
The classification of resting states falls under the domain of passive brain–computer interfaces (BCIs), which involve responsive interfaces that monitor and adjust to the user’s cognitive state without requiring their active participation [
31].
We utilized the Cattan2019_PHMD dataset [
10] for passive music listening, accessible through MOABB [
32,
33]. The data comprise EEG recordings from twelve healthy subjects (three females) who had a mean age of 26.25 years (standard deviation: 2.63 years). The EEG signals were captured using the EC20 cap equipped with 16 wet electrodes (EasyCap, Herrsching am Ammersee, Germany), placed according to the 10–10 standard. The reference was placed on the right earlobe, and the ground was placed at the AFz scalp location. The amplifier was linked via a USB connection to a personal computer on which the data were recorded, using the software OpenViBE [
34,
35]. The data were acquired without digital filtering, using a sampling frequency of 512 samples per second.
For all participants, the experimental task involved listening to music, both with and without a passive head-mounted display. A passive head-mounted display has no electronics other than a smartphone. The experiment consisted of ten blocks: in five blocks, the smartphone was switched off, and in the other five, it was switched on. Each block consisted of 1 min of EEG data recording with the subject’s eyes open. A total of 10 min was thus recorded for each subject. The sequence of the ten blocks was randomized prior to the experiment.
The resulting dataset poses a classification challenge, as [
36] found no significant differences in the power signal of the two experimental conditions for the same subject. As a result, state-of-the-art EEG classification methods (e.g., Riemannian methods like the MDM [
37]) fail to distinguish epochs of signals recorded when the participant is wearing or not wearing a head-mounted display.
To provide a point of comparison for the interpretation of the results thereafter, Riemannian classification pipelines typically report area under the ROC curve (AUROC) values ranging from 0.7 to 0.95 [
38], depending on the paradigm and the dataset. For the classification of resting states, the same methods achieve an AUROC close to 1 with [
39]. In contrast, the AUROCs found in the Results section (
Section 5), using the same methods, are low, with values reported below 0.6.
4.2. Preprocessing
The data were resampled to 128 Hz, and we applied a bandpass filter between 1 and 35 Hz. For each trial, composed of 16 channels, we extracted an epoch lasting 40 s and starting 10 s after the onset of the trial. No artifact removal was applied. The EEG epochs were transformed into SPD matrices, as detailed below.
For each signal epoch
S (n_channels x n_samples), a covariance matrix
X (n_channels × n_channels) was estimated that was, by definition, symmetric:
after centering the signal
S. See [
40] for other covariance matrix estimators.
With sufficient time samples, the covariance matrices become SPD, or otherwise, they must be regularized. Regularization was achieved by computing the shrunk Ledoit–Wolf covariance matrix of the epoch [
40].
The space of SPD matrices is a manifold with a more intricate geometry than that of the Euclidean space.
The manifold becomes a Riemannian manifold when endowed with an affine invariant metric, where each covariance matrix becomes a point on this manifold.
In summary, each trial was transformed into a covariance matrix of size 16 × 16. We can now apply a classifier to this manifold. In this study, we considered the NCH and two classifiers based on Riemannian geometry executed on a non-quantum computer. First, the minimum distance to mean (MDM) [
37] is a popular classifier that assigns an SPD matrix to the class according to the nearest mean on the manifold. Second, tangent space + LDA (TS + LDA) [
41] is a state-of-the-art classifier that projects the SPD matrices onto the tangent space of the manifold and then applies a linear discriminant analysis (LDA) for classification. The LDA projects data into a lower-dimensional space while maximizing the separability between classes, assuming that they follow a normal distribution with a common covariance matrix, which allows for a linear decision boundary. The choice of these algorithms comes from the EEG benchmark [
38]. Together, these two classifiers establish a robust baseline against which the performance of our new NCH implementation can be compared.
4.3. Pipelines
We then tested the following eight different classification methods:
NCH + MH: NCH classifier with min hull subsampling. We used SLSQP as a classical optimizer.
NCH + RH: NCH classifier with random hull subsampling. We used SLSQP as a classical optimizer.
NCH + MH_NAIVEQAOA: NCH classifier with min hull subsampling. We used the naïve implementation of QAOA-CV with SLSQP as an optimizer, and the mixer operator was the X mixer.
NCH + MH_QAOACV: NCH classifier with min hull subsampling. We used QAOA-CV (with quasi-probability distribution optimization) using SPSA as an optimizer, and the mixer operator was the X mixer.
NCH + RH_NAIVEQAOA: NCH classifier with random hull subsampling. We used the naïve implementation of QAOA-CV with SLSQP as an optimizer, and the mixer operator was the X mixer.
NCH + RH_QAOACV: NCH classifier with random hull subsampling. We used QAOA-CV (with quasi-probability distribution optimization) using SPSA as an optimizer, and the mixer operator was the X mixer.
TS + LDA: 16 × 16 covariance matrices were projected from the SPD manifold to the tangent space, resulting in vectors of dimension 136 = 16 × (16 + 1)/2). These vectors were then passed as input to an LDA classifier [
41].
MDM: Direct classification of 16 × 16 covariance matrices in the SPD manifold with the Riemannian mean and distance [
37].
For optimizers of NCH classifiers, we set the number of maximum iterations to 100. For MIN_HULL-based NCH classifiers, we set the number of samples to six. For RANDOM_HULL-based NCH classifiers, the number of hulls and samples per hull were set to three and six, respectively. The number of repetitions for the QAOA ansatz was set to two.
4.4. Evaluation
We used a cross-subject evaluation with three splits, using the standardized implementation available in MOABB. This implementation uses group k-fold validation (non-stratified), with three folds. The AUROC was used as the classification metric.
The global seed for the Qiskit algorithm module, the random seed for the quantum transpiler (which compiles the Python code into the quantum circuit assembly) and simulator, and the seed for the NumPy and random Python modules were all set to 475,751. This seed corresponds to the one generated the first time we ran our code.
5. Results
Figure 4 displays the results obtained from classical optimization. The scores and times for all pipelines, shown as the averages across all sessions, are listed in
Table 1.
As the dataset presents a significant classification challenge, lower performance results were anticipated.
We calculated the chance level for the Cattan2019_PHMD dataset. At an alpha value of 0.05, significance was attained when AUROC = 0.5833 or at 70 correct classifications. The significance threshold is reported here in accordance with the standards commonly used in the EEG field [
46,
47]. Only two pipelines, namely TS + LDA (AUROC = 0.59) and NCH + MH_NAIVEQAOA (AUROC = 0.61), were significantly better than the chance level (AUROC = 0.5833).
The main takeaways are, firstly, that NCH is able to extract valuable information from the data in cases where classes are difficult to distinguish and the MDM struggles to generalize.
Secondly, the quantum-optimized pipeline NCH + MH_NAIVEQAOA ranked first and performed slightly better than the state-of-the-art TS + LDA. While the results are encouraging, it should not be interpreted as exceeding the current state of the art.
Third, the non-quantum version of the NCH performed worse than the quantum-enhanced versions.
Considering the classification difficulty of the selected dataset, and because the observed values were close to chance and relatively similar across pipelines, we did not perform statistical significance testing—such as permutation tests—to assess the differences between them, as meaningful results were not anticipated.
The reader is referred to
Appendix B to gain a deeper understanding of the behavior of the NCH algorithm when the number of hulls and samples were varied.
6. Discussion and Limitations
The approaches presented in this article warrant further investigation due to several limitations. First, the naïve QAOA approach relies on solving QUBO problems, which necessitates encoding continuous variables into binary representations. In our study, this was achieved by fixing an arbitrary precision and upper bound. While increasing the upper bound allows for finer precision, it also substantially increases the number of quantum bits required to encode the weights. Alternative encoding methods, such as fixed-point, one-hot, or domain-wall encoding [
21], may offer advantages that were not explored here, given the limited scope of this article.
Secondly, the number of weights required for QAOA-CV is directly proportional to the number of samples used for training. As a result, the memory demands and computational costs increase as a function of the dataset’s size. This scaling makes the method in its current form practical only for small datasets, especially during simulation.
Third, this study employed only a quantum simulation instead of a real quantum computer. Simulations provide an understanding of the algorithm’s behavior, but they do not incorporate the practical constraints and challenges that arise when using real quantum hardware. In practice, quantum computers are subject to various sources of noise—such as topological and environmental noise—that cause the decoherence of the quantum state and introduce measurement errors. Additionally, the naïve QAOA algorithm does not scale efficiently, as the number of qubits increases exponentially with the upper bound applied during binary encoding. Consequently, QAOA is currently practical only for small datasets, whether executed on a simulator or on real quantum hardware, typically limited to 127 qubits at the time of writing. Another constraint that arises when using real quantum computers is the waiting time before a computation is executed on the quantum device. This waiting time depends on the number of concurrent users and user privileges. This limitation alone currently makes real quantum computers impractical for online classification tasks.
Fourth, these results were contingent on the random seed we chose at the beginning of the experiment, as well as the shuffle performed during the group three-fold validation. Hence, the results are only valid for a specific setup. Additionally, we utilized cross-subject validation, which involves the challenging task of transfer learning between sessions and subjects, in a dataset where the two experimental conditions are not easily distinguishable.
7. Conclusions
This paper advances the field through the following three contributions.
First, we contributed our own implementation of the nearest convex hull (NCH) algorithm, enhanced with two additional strategies for the construction of convex hulls and subsequent classification, that can better handle different datasets.
Second, we outlined the fundamental steps required to adapt an existing classical algorithm for quantum processing. Using the NCH algorithm as a case study for bio-signal data classification, we achieved this adaptation by reformulating the algorithm as an optimization problem via constraint programming. This reformulation made the algorithm compatible with the QAOA optimizer, which operates on QUBO problems. In summary, the optimization problems we defined are quadratic, accommodate only linear constraints, and involve converting continuous variables into binary ones. In addition, we also introduced an original approach to QAOA-CV, focusing on the optimization of the quasi-probability distribution of binary variables. This adaptation is versatile and can be applied to a wide range of optimization problems and domains, beyond the scope of the NCH algorithm.
Third, we also evaluated for the first time the performance of the NCH classifier on EEG data. Our results show that it is a promising algorithm for cross-subject classification with resting-state data, particularly when combined with quantum optimization. On this dataset, the NCH + MH_NAIVEQAOA variant approached the performance of the state-of-the-art TS + LDA method and performed rather better than the MDM. Note that TS + LDA operates in the tangent space of the Riemannian manifold, while both MDM and NCH perform classification directly on the manifold. There remains room for improvement, however, as both NCH + MH_NAIVEQAOA and TS + LDA achieved classification accuracies only slightly above the chance level for this dataset.
Consequently, it is difficult to draw definitive conclusions regarding the conditions under which quantum optimization may outperform its classical counterparts. We note, however, that the dataset is relatively small and that the classification task is particularly challenging. In other words, potential quantum advantages are more likely to emerge in scenarios where classical approaches struggle to provide a satisfactory performance.
It is also possible that the naïve QAOA is particularly well suited to the NCH classifier. QAOA was originally designed to address discrete combinatorial optimization problems, and in this context, it appears to be effective at identifying combinations of weights that provide an optimal classification point for the NCH.
Once again, we caution the attentive reader against drawing premature conclusions about a definitive quantum advantage of the NCH over its classical counterpart. These are encouraging, yet early, results, obtained under specific conditions—such as the use of a quantum simulator—and tailored to a particularly challenging dataset (see
Section 6). In fact, these findings demonstrate that the proposed method for translating an optimization problem into a quantum classifier operates as intended, and that the resulting quantum classifier can generalize.
In summary, this study bridges the domain of BCI and quantum computing and suggests that, in the BCI domain, the NCH, when combined with quantum optimization, can be a viable alternative to classical methods in challenging scenarios. We hope this will prove beneficial to future research in both areas and beyond.
The key challenges ahead include identifying the paradigms and conditions under which the NCH and quantum approach offer a clear advantage, as well as enabling the online classification of EEG signals.