Quantum computing is a promising new approach to tackle the complex real-world computational problems by harnessing the power of quantum mechanics principles. The inherent parallelism and exponential computational power of quantum systems hold the potential to outpace classical counterparts in solving complex optimization problems, which are pervasive in machine learning. Quantum Support Vector Machine (QSVM) is a quantum machine learning algorithm inspired by classical Support Vector Machine (SVM) that exploits quantum parallelism to efficiently classify data points in high-dimensional feature spaces. We provide a comprehensive overview of the underlying principles of QSVM, elucidating how different quantum feature maps and quantum kernels enable the manipulation of quantum states to perform classification tasks. Through a comparative analysis, we reveal the quantum advantage achieved by these algorithms in terms of speedup and solution quality. As a case study, we explored the potential of quantum paradigms in the context of a real-world problem: classifying pancreatic cancer biomarker data. The Support Vector Classifier (SVC) algorithm was employed for the classical approach while the QSVM algorithm was executed on a quantum simulator provided by the Qiskit quantum computing framework. The classical approach as well as the quantum-based techniques reported similar accuracy. This uniformity suggests that these methods effectively captured similar underlying patterns in the dataset. Remarkably, quantum implementations exhibited substantially reduced execution times demonstrating the potential of quantum approaches in enhancing classification efficiency. This affirms the growing significance of quantum computing as a transformative tool for augmenting machine learning paradigms and also underscores the potency of quantum execution for computational acceleration.

The term ‘Quantum computing’ encompasses the utilization of quantum mechanics principles to devise algorithms based on the fundamental laws of physics. These algorithms operate differently from classical computer operations [

In a classical computer, the computation manipulates the bits that can be 0 or 1. In the quantum model, the quantum bit, referred to as qubit, can be in any amount of superposition of the states _{x}(θ), R_{y}(θ), R_{z}(θ)) denote rotation by θ degrees in Euclidean space. Toffoli or CCNOT gate acts as controlled gate for three qubits. CSWAP gate performs a controlled swap operation on three qubits. These gates can be systematically combined in a serial or parallel manner tailored to the specific demands of the given problem [

A quantum algorithm is described in terms of the quantum circuit model, where the circuit is a layout of quantum gates acting on the predetermined number of input qubits. The process culminates with measurements taken to yield the desired output. The circuit design forms a sequential sequence of quantum gates, akin to a pipeline. This assembly can be replicated and evaluated on a quantum simulator by conducting vector multiplications involving unitary matrices, corresponding to the quantum gates. The circuit's execution is reiterated multiple times, as the result entails probability values for diverse potential outcomes. These iterative executions are termed as “shots”. Hence, the quantum algorithm workflow encompasses the following steps: a. Formulation of the quantum circuit tailored to the specific requirements of the problem; b. Repetitive execution of the circuit for a designated count of trails and capturing the output measurements; and c. Evaluate the collected outputs, culminating in the presentation of conclusive results [

Machine Learning is a sub-field of Artificial Intelligence that employs a number of algorithms to learn the patterns out of data and use it for data analysis, its classification, and further predictions [

Quantum machine learning amalgamates the power of classical machine learning algorithms using the quantum systems, yielding enhanced computational capabilities [

Support Vector Machine (SVM) is a type of supervised machine learning algorithm used for classification problems [

SVM algorithms make use of mathematical kernel functions that can transform the input data into higher dimension space [_{1}, y_{1}), (x_{2}, y_{2}),_{n}, y_{n}) distinct values. Each element x_{i} is a vector of size _{i} is mapped to {+1, −1} values for classification. So, the job of hyperplane is to divide the set into two classes for which y_{i} is either +1 or −1. The hyperplane is represented by the equation w^{T}.x – b = 0, where w is a normal vector to the hyperplane and b is the offset of hyperplane from origin in the direction of normal. _{i} (w^{T}.x_{i} – b) ≥ 1 for 1≤ i ≤ n. The x_{i} that are closest to the hyperplane influence it the most and are known as support vectors. If the dataset is not linearly separable, nonlinear kernel functions are used. They support maximizing the margin hyperplane in a transformed feature space. The hyperplane in non-linear classification corresponds to a linear classification in the transformed vector space. Some nonlinear kernels and their equations are given below:

Quantum SVM (QSVM) algorithm implements the classical SVM algorithm in quantum systems. QSVM uses ‘kernel trick’ to construct the hyperplane that divides the data into respective classes by using linear or non-linear transformation functions also known as feature map in feature space [

Hence, for the classification problem, the input datapoints are represented in the higher dimension quantum feature space with the help of a kernel function as

In QSVM, quantum feature map

In the current study, we have employed both the classical and quantum-based classification algorithms for a comparative analysis. The SVM and QSVM algorithms have been implemented for a multiclass classification of the pancreatic cancer biomarker data. Anaconda Python distribution with Python 3.9.4 on Windows 10 has been used for code development. The Python modules, numpy and pandas were used for storing and processing the dataset. The modules matplotlib and seaborn were used for visualization. The machine learning component was executed using the scikit-learn (sci-kit learn) module, a comprehensive toolkit specifically designed for machine learning tasks.

Incorporating the quantum dimension into our study, we embraced Qiskit and the qiskit_machine_learning modules. These tools play a pivotal role in orchestrating various aspects of quantum machine learning. This encompasses establishing the quantum instance, designing quantum circuits tailored for the classification task, establishing connections to the quantum backend, and ultimately executing the classification algorithms on the quantum hardware.

This holistic approach, combining both classical and quantum techniques, has enabled us to tackle the intricate task of classifying pancreatic cancer data effectively. By leveraging the capabilities of the chosen Python libraries and Qiskit, we have not only demonstrated the potential of quantum-assisted machine learning but also showcased the seamless integration of classical and quantum computing frameworks for solving real-world challenges [

Pancreatic ductal adenocarcinoma (PDAC) originates in the part of pancreas that secretes digestive enzymes and accounts for about 90% of the pancreatic cancer [

The initial stage of the analysis involved data preprocessing, wherein several essential steps were undertaken. Initially, columns housing text-based annotation data pertaining to the samples were excluded from the dataset. Following this, a correlation analysis was conducted to identify and retain the most pertinent features for further investigation.

The dataset was split into training and test subset with a test size of 20% using the train_test_split function of the model_selection module. The SVM module from sklearn library was used to apply SVC function on the data. The SVC (C-support vector classification) is a libsvm based implementation. Multiclass classification according to one

In the domain of quantum-assisted machine learning, Qiskit and its qiskit_machine_learning modules offer a range of submodules that facilitate the integration of quantum algorithms. These encompass tools for harnessing quantum circuit libraries, implementing quantum kernels, developing neural networks, and accessing a collection of built-in datasets. These versatile submodules contribute to the effective utilization of quantum resources for enhancing machine learning tasks. The ‘AllPairs’ Multiclass classification is supported by the aqua module of Qiskit. This functionality within the module caters to multiclass classification tasks by employing an “all-pairs” strategy to transform the problem into a series of binary classifications. This approach aids in effectively handling complex classification scenarios involving multiple classes. Classical SVC can also be executed using quantum kernel in a quantum instance. The quantum support vector classifier (QSVC) class in qiskit_machine_learning module extends the sklearn module’s SVC class. A separate module QSVM is provided that runs the algorithm on quantum circuit on either the simulator or a real quantum processor by connecting to either of these backends, defining the circuit, providing the training and test input, and finally executing the quantum instance.

A feature map is a pivotal component in quantum machine learning, responsible for translating classical data into a quantum format suitable for manipulation by quantum circuits. This transformation bridges the gap between classical and quantum domains, allowing quantum algorithms to glean insights from classical datasets. The PauliFeatureMap implements the Pauli expansion circuit. In quantum mechanics, Pauli matrices (X, Y, Z) are fundamental operators that describe the quantum observables. The PauliFeatureMap uses combinations of these Pauli operators to create a quantum circuit that transforms classical input data into a quantum state. By applying these Pauli matrices to different qubits and utilizing their tensor products, the PauliFeatureMap encapsulates complex relationships between features. This facilitates the encoding of classical data into a multi-qubit quantum state, allowing quantum algorithms to operate on this state for various machine learning tasks. ZFeatureMap implements the first order Pauli-Z evolution circuit. This gate induces phase shifts in the quantum state based on the classical input features. This approach encodes the input data as distinct quantum phases, preserving important information while translating classical data into quantum states. ZZFeatureMap implements the second order Pauli-Z evolution circuit. This expanded feature map allows for the encoding of more intricate correlations present in the classical data. By using the tensor product of Pauli-Z operators on pairs of qubits, the ZZFeatureMap effectively encodes both linear and quadratic interactions, resulting in a richer quantum state representation of the classical data. In essence, these feature maps are quantum circuits designed to transform classical data into quantum states by exploiting the properties of Pauli matrices and gates. Each feature map varies in complexity, capturing different levels of relationships between classical features and quantum states. The choice of feature map depends on the complexity of the dataset and the specific quantum algorithm being employed.

The qasm_simulator was used as the backend for execution. A quantum instance was created to run on the backend and the number of shots was set to 1024. The quantum instance and a feature map were supplied to quantum kernel and the classification algorithms were provided with the training and testing datasets.

The time taken to execute the model fitting in both the environments was measured by the calling the time function in Python just before start of fitting the model on training data set and just after the prediction on test data set of the same sizes.

The Pancreatic Cancer dataset was employed to both train and assess the accuracy of the Support Vector Machine (SVM) classification model within both the classical and quantum computational settings. This comparative evaluation across two environments provided insights into the potential benefits and performance enhancements brought about by quantum-assisted machine learning techniques. As already discussed, the biomarker panel produces the readings of three proteins. The diagnosis feature was used for classification. The data points were classified as 1-healthy control, 2-patients with non-PDAC pancreatic conditions and 3-patients with PDAC. After the correlation analysis and feature selection process, the features dataset was subjected to scaler transform using the scaler.fit_transform function of StandardScalar module of sklearn.preprocessing library. It was followed by the Principal Component Analysis (PCA) transform using the pca.fit_transform function of the PCA module of sklearn.decomposition library.

The three different feature maps were designed next by selecting the appropriate quantum gates and arranging them on qubits to encapsulate distinct relationships present in the classical data. The screenshots of the circuit designs for the three types of feature maps (ZZFeatureMap, ZFeatureMap and PauliFeatureMap) used for data encoding are shown in the

For the ZZFeatureMap, each qubit is first prepared in the

For the ZFeatureMap, each qubit is first prepared in the

For the PauliFeatureMap, each qubit is prepared in the

In machine learning algorithms like Support Vector Classification, a kernel is an essential tool that allows to transform data into higher-dimensional spaces. This transformation can make it easier to find decision boundaries between different classes of data. The sci-kit learn SVC algorithm permits the kernel to be defined either as a callable function or as a precomputed matrix. The callable function maps the original data into a higher-dimensional quantum space, allowing SVC to find decision boundaries more effectively. Instead of using raw data to compute the kernel during training and testing, the kernel matrices can also be precomputed for both training and testing data pairs using the kernel.evaluate function. This allows the kernel values to be calculated in advance and is stored in matrices. Each element (i, j) of the training kernel matrix represents the similarity between the i^{th} and j^{th} training data points. Similarly, the testing kernel matrix stores the similarity values between testing data pairs. These precomputed kernel matrices essentially encapsulate the information required for the SVC algorithm to operate in the transformed space. The kernel was provided as a callable function by using Quantum kernel. The training and testing kernel matrices were precomputed using kernel.evaluate function.

Following the preprocessing and feature map preparation steps, different algorithms were applied. The classical SVC algorithm was called first using the SVC model of svm module of sklearn library. Linear kernel with regularization parameter value of 10 was used. QSVM models from Qiskit Aqua module were set using the three different feature maps as designed above. Aer quantum simulator was chosen as backend for the quantum computations and hence simulated the quantum circuits on a classical computer. Three different QuantumInstances were created for running the QSVM algorithm. The classification methods were evaluated using different implementations, including classical and quantum-inspired approaches. The performance of each method was assessed based on accuracy and the time taken for execution. The accuracy of support vector machine classification in classical and quantum environments for executing one instance of training and test data set is reported in

Implementation | Classification method | Accuracy | Time taken (sec) |
---|---|---|---|

Classical | SVC | 0.483 | 70 |

Quantum | SVC with callable kernel | 0.483 | 3282 |

SVC with precomputed kernel | 0.483 | 0.04 | |

QSVC | 0.483 | 3340 | |

QSVM with ZFeatureMap | 0.5 | 10 | |

QSVM with ZZFeatureMap | 0.5 | 19 | |

QSVM with PauliFeatureMap | 0.5 | 22 |

The classification accuracy achieved across all methods was found to be consistent, ranging between 48.3% and 50%. This consistency implies that each method was capable of capturing similar underlying patterns within the dataset. The time taken varies significantly across the implementations. The “Quantum SVC with callable kernel” and “QSVC” methods took the longest time due to the computational complexity of quantum computations. This can be attributed to the inherent complexity and resource-intensive nature of quantum computations. Quantum simulations require substantial computational overhead due to intricate quantum state manipulations. This was primarily due to the need to simulate quantum circuits for each data point pair, accompanied by complex quantum operations and calculations. The callable function’s complexity, along with quantum state transformations, contributed to the overall execution time. Notably, the “QSVM with ZFeatureMap,” “QSVM with ZZFeatureMap,” and “QSVM with PauliFeatureMap” methods achieved a slightly improved accuracy of 50%, potentially due to the utilization of quantum-inspired feature maps. Despite this improvement, these quantum-inspired methods necessitated a moderate execution time, further underlining the trade-off between accuracy and computational efficiency. The “SVC with precomputed kernel” demonstrated the shortest execution time which indicates the usefulness of precomputed kernels. These results collectively contribute to a comprehensive understanding of the performance variations between classical and quantum-inspired machine learning methods, emphasizing the need to balance accuracy aspirations with practical computational considerations.

In the current study, we undertook a comprehensive exploration of classification methodologies, encompassing both classical and quantum-inspired approaches, to address a pancreatic cancer data classification task. The goal was to assess the accuracy and computational efficiency of various implementations, shedding light on the trade-offs between accuracy enhancements and computational complexity in the realm of quantum machine learning. The choice of implementation should be determined by the trade-offs between accuracy and computational efficiency, tailored to the specific problem's demands and available resources. While quantum-inspired methods hold the promise of enhanced accuracy, their current computational overhead must be carefully weighed against their benefits.

Refining the quantum computation methodologies and harnessing quantum strengths could pave the way for more streamlined and precise solutions to the current computational challenges.

The authors acknowledge the access to IBM Quantum cloud and Qiskit documentation and tutorials. SS acknowledges Savitribai Phule Pune University and AS acknowledges Ministry of Electronics and Information Technology (MeitY), Government of India for infrastructural support.

The authors received no specific funding for this study.

The authors confirm contribution to the paper as follows: study conception and design: A. Saxena, S. Saxena; data collection: A. Saxena; analysis and interpretation of results: A. Saxena, S. Saxena; draft manuscript preparation: A. Saxena, S. Saxena. All authors reviewed the results and approved the final version of the manuscript.

The dataset used in this study can be accessed through the Kaggle website as mentioned in the reference section. Access to this dataset is subject to Kaggle's terms of use, and interested parties should refer to Kaggle's platform for data access and usage guidelines.

The authors declare that they have no conflicts of interest to report regarding the present study.