Challenges
Datasets
Workspaces
Papers
Discussions
Leaderboard
Log inSign up
Challenges
Datasets
Workspaces
Papers
Discussions
Leaderboard
Blog
Job Board
Q3AS

© 2026 Aqora Quantum S.A.S.

TermsPrivacyLegal Notice

International Conference on Optimization and Applications (ICOA)

A Fidelity-Based Quantum K-Nearest Neighbors (FQKNN) for Enhanced Classification

Amine Zeguendry, Zahi Jarir, Mohamed Quafafou

Published Oct 16, 2025• 1 citation
Publisher

Abstract

Dealing with high-dimensional data is a well-known limitation for the classic K-Nearest Neighbors (KNN) algorithm, creating substantial computational and memory overhead. While Quantum Machine Learning (QML) presents a compelling alternative, many existing Quantum KNN (QKNN) frameworks are largely theoretical, remaining impractical for current hardware due to their significant qubit demands. This paper introduces the Fidelity-Based Quantum K-Nearest Neighbors (FQKNN) algorithm, a method specifically designed for feasibility on near-term devices. Our primary contribution is the use of quantum fidelity as a similarity function, which offers a more nuanced metric than conventional distance calculations. This is combined with an efficient amplitude encoding strategy that logarithmically scales the qubit requirement to just log2(N) for an N-dimensional feature vector. This combination makes FQKNN a resource-efficient and practical algorithm. We validated its performance on the benchmark Iris and Breast Cancer datasets, achieving classification accuracies of 96.7% and 93.3% respectively, surpassing the performance of the classical KNN baseline. These findings not only confirm the viability of our fidelity-based similarity measure but also underscore the demonstrable potential of QML to enhance classification tasks.

DOI
10.1109/icoa66896.2025.11236908

Related papers

Performance Analysis and Noise Impact of a Novel Quantum KNN Algorithm for Machine Learning

Asif Akhtab Ronggon, Md. Saifur Rahman

This paper presents a novel quantum K-nearest neighbors (QKNN) algorithm, which offers improved performance over the classical k-NN technique by incorporating quantum computing (QC) techniques to enhance classification accuracy, scalability, and robustness. The proposed modifications focus on optimizing quantum data encoding using Hadamard and rotation gates, ensuring more effective rendering of classical data in quantum states. In addition, the quantum feature extraction process is significantly enhanced by the use of entangled gates such as IsingXY and CNOT, which enables better feature interactions and class separability. A novel quantum distance metric, based on the swap test, is introduced to calculate similarity measures between various quantum states, offering superior accuracy and computational efficiency compared to traditional Euclidean distance metrics. We assess the achievement of the proposed QKNN algorithm on three benchmark datasets: Wisconsin Breast Cancer, Iris, and Bank Note Authentication, and have noted its superior performance relative to both classical k-NN (CKNN) and Quantum Neural Network (QNN). The proposed QKNN algorithm is found to achieve prediction accuracies of 98.25%, 100%, and 99.27% ,respectively, for the three datasets, while the customized QNN shows prediction accuracies of only 97.17%, 83.33%, and 86.18%, respectively. Furthermore, we address the challenges of quantum noise by incorporating a repetition encoding-based error mitigation strategy, which ensures the stability and resilience of the algorithm in noisy quantum environments. The results highlight the potential of the proposed QKNN as a scalable, efficient and robust quantum-enhanced machine learning algorithm, especially in high-dimensional and complex datasets, when traditional approaches frequently fail.

arXiv:2505.06441•May 9, 2025•1 citation

QKNN: Noise‐Resilient Quantum KNN Algorithm for High‐Accuracy Classification

Asif Akhtab Ronggon, Tuhin Hossain, Tahani Jaser Alahmadi +1 more

ABSTRACT A quantum K‐nearest neighbors(QKNN) algorithm is proposed to offer superior performance compared to the classical KNN(CKNN) approach, improving classification accuracy, scalability, and robustness. Our approach optimizes Hadamard and rotation gates for quantum data encoding and efficiently embeds classical data into quantum states. Entangled gates, such as IsingXY and CNOT, enhance feature extraction and classification by enabling complex feature interactions. A new quantum distance metric based on swap test results is used to calculate similarity measures between quantum states. This algorithm offers superior accuracy and computational efficiency compared to traditional Euclidean distance metrics. We used three benchmark datasets to evaluate the suggested QKNN method. The results demonstrated that it outperformed the other two methods, classical KNN (CKNN) and quantum neural networks (QNN), as well as the more recent QKNN research. The proposed QKNN algorithm achieves prediction accuracies of 98.25%, 100%, and 99.27% for the three datasets, whereas the QNN achieves prediction accuracies of 97.17%, 83.33%, and 86.18%, respectively. Moreover, quantum noise challenges are addressed by integrating a Shor code‐based error mitigation strategy, which ensures stability of the algorithm and resilience to noisy quantum environments. The results demonstrate the scalability, efficiency, and robustness of the proposed QKNN algorithm.

Advanced Quantum Technologies•Jan 1, 2026•1 citation

Quantum kkk-nearest neighbors algorithm

Afrad Basheer, A. Afham, Sandeep K. Goyal

One of the simplest and most effective classical machine learning algorithms is the $k$-nearest neighbors algorithm ($k$NN) which classifies an unknown test state by finding the $k$ nearest neighbors from a set of $M$ train states. Here we present a quantum analog of classical $k$NN $-$ quantum $k$NN (Q$k$NN) $-$ based on fidelity as the similarity measure. We show that Q$k$NN algorithm can be reduced to an instance of the quantum $k$-maxima algorithm, hence the query complexity of Q$k$NN is $O(\sqrt{kM})$. The non-trivial task in this reduction is to encode the fidelity information between the test state and all the train states as amplitudes of a quantum state. Converting this amplitude encoded information to a digital format enables us to compare them efficiently, thus completing the reduction. Unlike classical $k$NN and existing quantum $k$NN algorithms, the proposed algorithm can be directly used on quantum data thereby bypassing expensive processes such as quantum state tomography. As an example, we show the applicability of this algorithm in entanglement classification and quantum state discrimination.

arXiv:2003.09187•Mar 20, 2020•24 citations

A quantum k-nearest neighbors implementation using magnitude-aware comparisons

Christopher Rector, Jiangwen Sun

Much attention has recently been devoted to the k-nearest neighbors (KNN) algorithm as a case study for quantum computing algorithms. Several algorithms have devised methods to compute a similarity metric to solve Quantum KNN (QKNN). This paper presents a practical quantum encoding technique that enables Euclidean distance calculation between vectors with different L2 norms by appending a single component to each vector, then uses it in the QKNN problem. It is arguably simpler to understand and implement than comparable methods and uses fewer qubits. Further, an implementation of this algorithm is provided and is used to benchmark it against a recent Euclidean-distance QKNN method on standard labeled datasets. In addition to demonstrating proper formulation, the results show marked improvement over similar implementations during simulation with realistic noise due to the use of fewer qubits and thus more coherent circuits.

arXiv:2610.33739•Oct 24, 2026•0 citations

Fidelity-Derived Quantum Dissimilarity-Enhanced k-Nearest Neighbor Algorithm for Arterial Hypertension Detection

Antonia E. Tampakaki, Georgios D. Barmparis, Eleni Angelaki +2 more

We present a quantum-enhanced version of the classic k-Nearest Neighbors (kNN) classification algorithm, applied to the detection of arterial hypertension. The traditional Euclidean distance metric of the kNN algorithm is replaced with a fidelity-derived quantum dissimilarity measure to evaluate the similarity between data samples. We map classical real-world clinical and ECG-derived data features into quantum states via the dense-angle encoding, which efficiently packs multiple features into minimal qubits while maintaining pure states. We evaluate the performance of the dissimilarity measure using both the noiseless state-vector Simulator and the IBM Qiskit Estimator primitives on 25 test sets. We found that the quantum approaches present a lower mean number of neighbors (6.8 ± 4.1), while the classical approach has a mean of (7.9 ± 4.4) neighbors. The classical kNN algorithm achieves a balanced accuracy of (70.9 ± 2.9)% and an F1-macro of (71.5 ± 3.0)%, while the quantum algorithm scores (67.9 ± 2.4)% and (68.3 ± 2.4)%, respectively, indicating a marginally non-statistically significant difference with a p-value of 6.6%. In addition, the classical kNN algorithm with cosine similarity achieves performance equivalent to the quantum dissimilarity metric, with a p-value of 75.5% for the F1-macro metric. While the quantum algorithm does not claim computational supremacy over the classical baseline, the framework provides a promising simulation-based proof of concept that fidelity-based similarity is a physically meaningful approach to hybrid quantum-classical classification.

AI in Medicine•Oct 26, 2026•0 citations

An Enhanced Quantum K-Nearest Neighbor Classification Algorithm Based on Polar Distance

Congcong Feng, Bo Zhao, Xin Zhou +2 more

The K-nearest neighbor (KNN) algorithm is one of the most extensively used classification algorithms, while its high time complexity limits its performance in the era of big data. The quantum K-nearest neighbor (QKNN) algorithm can handle the above problem with satisfactory efficiency; however, its accuracy is sacrificed when directly applying the traditional similarity measure based on Euclidean distance. Inspired by the Polar coordinate system and the quantum property, this work proposes a new similarity measure to replace the Euclidean distance, which is defined as Polar distance. Polar distance considers both angular and module length information, introducing a weight parameter adjusted to the specific application data. To validate the efficiency of Polar distance, we conducted various experiments using several typical datasets. For the conventional KNN algorithm, the accuracy performance is comparable when using Polar distance for similarity measurement, while for the QKNN algorithm, it significantly outperforms the Euclidean distance in terms of classification accuracy. Furthermore, the Polar distance shows scalability and robustness superior to the Euclidean distance, providing an opportunity for the large-scale application of QKNN in practice.

Entropy•Jan 8, 2023•59 citations
Dealing with high-dimensional data is a well-known limitation for the classic K-Nearest Neighbors (KNN) algorithm, creating substantial computational and memory overhead. While Quantum Machine Learning (QML) presents a compelling alternative, many existing Quantum KNN (QKNN) frameworks are largely theoretical, remaining impractical for current hardware due to their significant qubit demands. This paper introduces the Fidelity-Based Quantum K-Nearest Neighbors (FQKNN) algorithm, a method specifically designed for feasibility on near-term devices. Our primary contribution is the use of quantum fidelity as a similarity function, which offers a more nuanced metric than conventional distance calculations. This is combined with an efficient amplitude encoding strategy that logarithmically scales the qubit requirement to just log2(N) for an N-dimensional feature vector. This combination makes FQKNN a resource-efficient and practical algorithm. We validated its performance on the benchmark Iris and Breast Cancer datasets, achieving classification accuracies of 96.7% and 93.3% respectively, surpassing the performance of the classical KNN baseline. These findings not only confirm the viability of our fidelity-based similarity measure but also underscore the demonstrable potential of QML to enhance classification tasks.
This paper presents a novel quantum K-nearest neighbors (QKNN) algorithm, which offers improved performance over the classical k-NN technique by incorporating quantum computing (QC) techniques to enhance classification accuracy, scalability, and robustness. The proposed modifications focus on optimizing quantum data encoding using Hadamard and rotation gates, ensuring more effective rendering of classical data in quantum states. In addition, the quantum feature extraction process is significantly enhanced by the use of entangled gates such as IsingXY and CNOT, which enables better feature interactions and class separability. A novel quantum distance metric, based on the swap test, is introduced to calculate similarity measures between various quantum states, offering superior accuracy and computational efficiency compared to traditional Euclidean distance metrics. We assess the achievement of the proposed QKNN algorithm on three benchmark datasets: Wisconsin Breast Cancer, Iris, and Bank Note Authentication, and have noted its superior performance relative to both classical k-NN (CKNN) and Quantum Neural Network (QNN). The proposed QKNN algorithm is found to achieve prediction accuracies of 98.25%, 100%, and 99.27% ,respectively, for the three datasets, while the customized QNN shows prediction accuracies of only 97.17%, 83.33%, and 86.18%, respectively. Furthermore, we address the challenges of quantum noise by incorporating a repetition encoding-based error mitigation strategy, which ensures the stability and resilience of the algorithm in noisy quantum environments. The results highlight the potential of the proposed QKNN as a scalable, efficient and robust quantum-enhanced machine learning algorithm, especially in high-dimensional and complex datasets, when traditional approaches frequently fail.
ABSTRACT A quantum K‐nearest neighbors(QKNN) algorithm is proposed to offer superior performance compared to the classical KNN(CKNN) approach, improving classification accuracy, scalability, and robustness. Our approach optimizes Hadamard and rotation gates for quantum data encoding and efficiently embeds classical data into quantum states. Entangled gates, such as IsingXY and CNOT, enhance feature extraction and classification by enabling complex feature interactions. A new quantum distance metric based on swap test results is used to calculate similarity measures between quantum states. This algorithm offers superior accuracy and computational efficiency compared to traditional Euclidean distance metrics. We used three benchmark datasets to evaluate the suggested QKNN method. The results demonstrated that it outperformed the other two methods, classical KNN (CKNN) and quantum neural networks (QNN), as well as the more recent QKNN research. The proposed QKNN algorithm achieves prediction accuracies of 98.25%, 100%, and 99.27% for the three datasets, whereas the QNN achieves prediction accuracies of 97.17%, 83.33%, and 86.18%, respectively. Moreover, quantum noise challenges are addressed by integrating a Shor code‐based error mitigation strategy, which ensures stability of the algorithm and resilience to noisy quantum environments. The results demonstrate the scalability, efficiency, and robustness of the proposed QKNN algorithm.
One of the simplest and most effective classical machine learning algorithms is the kkk-nearest neighbors algorithm (kkkNN) which classifies an unknown test state by finding the kkk nearest neighbors from a set of MMM train states. Here we present a quantum analog of classical kkkNN −-− quantum kkkNN (QkkkNN) −-− based on fidelity as the similarity measure. We show that QkkkNN algorithm can be reduced to an instance of the quantum kkk-maxima algorithm, hence the query complexity of QkkkNN is O(kM)O(\sqrt{kM})O(kM​). The non-trivial task in this reduction is to encode the fidelity information between the test state and all the train states as amplitudes of a quantum state. Converting this amplitude encoded information to a digital format enables us to compare them efficiently, thus completing the reduction. Unlike classical kkkNN and existing quantum kkkNN algorithms, the proposed algorithm can be directly used on quantum data thereby bypassing expensive processes such as quantum state tomography. As an example, we show the applicability of this algorithm in entanglement classification and quantum state discrimination.
Much attention has recently been devoted to the k-nearest neighbors (KNN) algorithm as a case study for quantum computing algorithms. Several algorithms have devised methods to compute a similarity metric to solve Quantum KNN (QKNN). This paper presents a practical quantum encoding technique that enables Euclidean distance calculation between vectors with different L2 norms by appending a single component to each vector, then uses it in the QKNN problem. It is arguably simpler to understand and implement than comparable methods and uses fewer qubits. Further, an implementation of this algorithm is provided and is used to benchmark it against a recent Euclidean-distance QKNN method on standard labeled datasets. In addition to demonstrating proper formulation, the results show marked improvement over similar implementations during simulation with realistic noise due to the use of fewer qubits and thus more coherent circuits.
We present a quantum-enhanced version of the classic k-Nearest Neighbors (kNN) classification algorithm, applied to the detection of arterial hypertension. The traditional Euclidean distance metric of the kNN algorithm is replaced with a fidelity-derived quantum dissimilarity measure to evaluate the similarity between data samples. We map classical real-world clinical and ECG-derived data features into quantum states via the dense-angle encoding, which efficiently packs multiple features into minimal qubits while maintaining pure states. We evaluate the performance of the dissimilarity measure using both the noiseless state-vector Simulator and the IBM Qiskit Estimator primitives on 25 test sets. We found that the quantum approaches present a lower mean number of neighbors (6.8 ± 4.1), while the classical approach has a mean of (7.9 ± 4.4) neighbors. The classical kNN algorithm achieves a balanced accuracy of (70.9 ± 2.9)% and an F1-macro of (71.5 ± 3.0)%, while the quantum algorithm scores (67.9 ± 2.4)% and (68.3 ± 2.4)%, respectively, indicating a marginally non-statistically significant difference with a p-value of 6.6%. In addition, the classical kNN algorithm with cosine similarity achieves performance equivalent to the quantum dissimilarity metric, with a p-value of 75.5% for the F1-macro metric. While the quantum algorithm does not claim computational supremacy over the classical baseline, the framework provides a promising simulation-based proof of concept that fidelity-based similarity is a physically meaningful approach to hybrid quantum-classical classification.
The K-nearest neighbor (KNN) algorithm is one of the most extensively used classification algorithms, while its high time complexity limits its performance in the era of big data. The quantum K-nearest neighbor (QKNN) algorithm can handle the above problem with satisfactory efficiency; however, its accuracy is sacrificed when directly applying the traditional similarity measure based on Euclidean distance. Inspired by the Polar coordinate system and the quantum property, this work proposes a new similarity measure to replace the Euclidean distance, which is defined as Polar distance. Polar distance considers both angular and module length information, introducing a weight parameter adjusted to the specific application data. To validate the efficiency of Polar distance, we conducted various experiments using several typical datasets. For the conventional KNN algorithm, the accuracy performance is comparable when using Polar distance for similarity measurement, while for the QKNN algorithm, it significantly outperforms the Euclidean distance in terms of classification accuracy. Furthermore, the Polar distance shows scalability and robustness superior to the Euclidean distance, providing an opportunity for the large-scale application of QKNN in practice.