cs.LGOct 24, 2026

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

Authors: Christopher Rector, Jiangwen Sun

Organizations: Computer Science, Old Dominion University, 1 Old Dominion University, Norfolk, 23529, VA, United States of America.

Abstract

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.

Figures & tables

Explore similar work

CardsList
  1. Quantum Evolution Kernel for Node-Attributed Graphs

    Oct 27, 2026Manuel Padovani, Alessandra Di Pierro, Claudia DaffaraQuantum Kernel MethodsGraph Representation Learning

  2. Distance Prediction for Quantum Codes

    Oct 13, 2026Nadav Schneider, Eliya NachmaniQuantum LDPC CodesQuantum Error Correction

  3. Optimal algorithmic complexity of inference in quantum kernel methods

    Apr 16, 2026Elies Gil-Fuster, Seongwook Shin, Sofiene Jerbi +2Query ComplexityQuantum Kernel Methods