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

Advanced Quantum Technologies

Quantum‐Enhanced K‐Nearest Neighbors for Text Classification: A Hybrid Approach with Unified Circuit and Reduced Quantum Gates

Amine Zeguendry, Zahi Jarir, Mohamed Quafafou

Published Aug 1, 2024• 9 citations
Publisher

Abstract

Abstract Text classification, a key process in natural language processing (NLP), relies on the k‐nearest neighbors (KNN) algorithm for its simplicity and effectiveness. Traditional methods often grapple with the high‐dimensional nature of textual data, leading to substantial computational demands. This study introduces a novel classical quantum k‐nearest neighbors (CQKNN) algorithm, which integrates quantum circuits into a conventional machine‐learning framework to enhance computational efficiency and reduce storage requirements. This hybrid approach uses a unified quantum circuit that simplifies multiple similarity calculations through mid‐circuit measurements and qubit reset operations, significantly improving upon traditional multi‐circuit quantum k‐nearest neighbors (QKNN) models. The CQKNN algorithm, tested on datasets such as SMS Spam Collection, Twitter US Airline Sentiment, and IMDB Movie Reviews, not only outperforms classical KNN but also addresses challenges posed by noisy intermediate‐scale quantum (NISQ) devices through advanced error mitigation techniques. This work highlights resource efficiency and reduced gate complexity and demonstrates the practical application of fidelity in quantum similarity calculations, setting new standards for quantum‐enhanced machine learning and advancing current quantum technology capabilities in complex data classification tasks.

DOI
10.1002/qute.202400122

Related papers

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

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

New approach of KNN Algorithm in quantum computing based on new design of quantum circuits

Vu Tuan Hai, Phan Hoang Chuong, Pham The Bao

Quantum computing has risen as the new type of computer that theoretically reduces the time complexity of classical methods exponentially because of the nature of superposition. It is promising to reduce runtimes on large data sets in machine learning (ML). Meanwhile, k-nearest neighbor (kNN) is a simple ML algorithm that can be translated to a quantum version (QkNN) to perform classification tasks efficiently. Here, we show a new version of QkNN which has a speed up in time complexity by using a new design of quantum circuits called integrated swap test. This quantum circuit can load two N-dimensional states and calculate the fidelity between them. Results show that QkNN allows us to take a different approach to the ML field.

Informatica•Apr 19, 2022•11 citations

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

Amine Zeguendry, Zahi Jarir, Mohamed Quafafou

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.

International Conference on Optimization and Applications (ICOA)•Oct 16, 2025•1 citation

Optimizing the Quantum Circuit of Quantum K-Nearest Neighbors (QKNN) Using Hybrid Gradient Descent and Golden Eagle Optimization Algorithm

Tamilselvan Arjunan, Gopalakrishnan Arjunan, N. Jagadish Kumar +1 more

This study concentrates on the enhancement of the quantum circuit pertaining to Quantum K-Nearest Neighbors (QKNN), which is a fundamental algorithm within the domain of quantum machine learning, through the implementation of a hybrid optimization methodology that integrates Gradient Descent with the Golden Eagle Optimization Algorithm (GEOA). QKNN harnesses the capabilities of quantum computing to process high-dimensional datasets with enhanced computational efficiency and precision; however, its effectiveness is frequently compromised by inadequate quantum circuit parameters and elevated noise levels present in near-term quantum devices. The proposed hybrid optimization methodology augments Quantum K-Nearest Neighbors (QKNN) through the amalgamation of the global search capabilities inherent in Golden Eagle Optimization (GEO) and the localized refinement efficacy provided by Gradient Descent (GD). This collaborative interplay culminates in expedited convergence (40 iterations), elevated classification accuracy (97.2 %), diminished circuit complexity (42 quantum gates), and enhanced resilience against gate noise (fidelity: 0.983). In contrast to conventional optimization techniques such as Genetic Algorithm (GA), Particle Swarm Optimization (PSO), and Simulated Annealing (SA), our proposed methodology demonstrates superior efficacy by optimizing quantum distance computation, entanglement strategies, and circuit depth, while simultaneously attenuating the effects of gate noise.

International Conference on Computing Technologies & Data Communication (ICCTDC)•Jul 4, 2025•3 citations

Quantum Natural Language Processing Using Hybrid AI Algorithms: A Variational Quantum–Classical Framework for Efficient Text Classification

P. Anitha

Quantum Natural Language Processing (QNLP) represents a novel interdisciplinaryparadigm that integrates Quantum Computing with Natural Language Processing toenhance semantic modeling and computational efficiency. Despite the remarkable successof transformer-based architectures such as BERT and GPT, classical NLP systems requirelarge-scale computational resources and extensive parameter tuning. This paper proposesa hybrid quantum–classical architecture employing parameterized quantum circuits (PQCs)integrated with classical embedding layers for text classification tasks. The frameworkutilizes classical preprocessing, quantum state encoding, variational optimization, andclassical post-measurement classification. Experimental results on benchmark sentimentanalysis datasets demonstrate competitive accuracy with significantly reduced parametercomplexity. The findings indicate that hybrid QNLP models provide enhanced semanticcompositionality and efficient representation in Hilbert space while remaining feasiblewithin Noisy Intermediate-Scale Quantum (NISQ) constraints

International Journal For Multidisciplinary Research•Mar 4, 2026•0 citations
Abstract Text classification, a key process in natural language processing (NLP), relies on the k‐nearest neighbors (KNN) algorithm for its simplicity and effectiveness. Traditional methods often grapple with the high‐dimensional nature of textual data, leading to substantial computational demands. This study introduces a novel classical quantum k‐nearest neighbors (CQKNN) algorithm, which integrates quantum circuits into a conventional machine‐learning framework to enhance computational efficiency and reduce storage requirements. This hybrid approach uses a unified quantum circuit that simplifies multiple similarity calculations through mid‐circuit measurements and qubit reset operations, significantly improving upon traditional multi‐circuit quantum k‐nearest neighbors (QKNN) models. The CQKNN algorithm, tested on datasets such as SMS Spam Collection, Twitter US Airline Sentiment, and IMDB Movie Reviews, not only outperforms classical KNN but also addresses challenges posed by noisy intermediate‐scale quantum (NISQ) devices through advanced error mitigation techniques. This work highlights resource efficiency and reduced gate complexity and demonstrates the practical application of fidelity in quantum similarity calculations, setting new standards for quantum‐enhanced machine learning and advancing current quantum technology capabilities in complex data classification tasks.
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.
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.
Quantum computing has risen as the new type of computer that theoretically reduces the time complexity of classical methods exponentially because of the nature of superposition. It is promising to reduce runtimes on large data sets in machine learning (ML). Meanwhile, k-nearest neighbor (kNN) is a simple ML algorithm that can be translated to a quantum version (QkNN) to perform classification tasks efficiently. Here, we show a new version of QkNN which has a speed up in time complexity by using a new design of quantum circuits called integrated swap test. This quantum circuit can load two N-dimensional states and calculate the fidelity between them. Results show that QkNN allows us to take a different approach to the ML field.
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 study concentrates on the enhancement of the quantum circuit pertaining to Quantum K-Nearest Neighbors (QKNN), which is a fundamental algorithm within the domain of quantum machine learning, through the implementation of a hybrid optimization methodology that integrates Gradient Descent with the Golden Eagle Optimization Algorithm (GEOA). QKNN harnesses the capabilities of quantum computing to process high-dimensional datasets with enhanced computational efficiency and precision; however, its effectiveness is frequently compromised by inadequate quantum circuit parameters and elevated noise levels present in near-term quantum devices. The proposed hybrid optimization methodology augments Quantum K-Nearest Neighbors (QKNN) through the amalgamation of the global search capabilities inherent in Golden Eagle Optimization (GEO) and the localized refinement efficacy provided by Gradient Descent (GD). This collaborative interplay culminates in expedited convergence (40 iterations), elevated classification accuracy (97.2 %), diminished circuit complexity (42 quantum gates), and enhanced resilience against gate noise (fidelity: 0.983). In contrast to conventional optimization techniques such as Genetic Algorithm (GA), Particle Swarm Optimization (PSO), and Simulated Annealing (SA), our proposed methodology demonstrates superior efficacy by optimizing quantum distance computation, entanglement strategies, and circuit depth, while simultaneously attenuating the effects of gate noise.
Quantum Natural Language Processing (QNLP) represents a novel interdisciplinaryparadigm that integrates Quantum Computing with Natural Language Processing toenhance semantic modeling and computational efficiency. Despite the remarkable successof transformer-based architectures such as BERT and GPT, classical NLP systems requirelarge-scale computational resources and extensive parameter tuning. This paper proposesa hybrid quantum–classical architecture employing parameterized quantum circuits (PQCs)integrated with classical embedding layers for text classification tasks. The frameworkutilizes classical preprocessing, quantum state encoding, variational optimization, andclassical post-measurement classification. Experimental results on benchmark sentimentanalysis datasets demonstrate competitive accuracy with significantly reduced parametercomplexity. The findings indicate that hybrid QNLP models provide enhanced semanticcompositionality and efficient representation in Hilbert space while remaining feasiblewithin Noisy Intermediate-Scale Quantum (NISQ) constraints