Multi-class quantum k-nearest-neighbour classification in a single quantum circuit
Razieh Abdolahi, M. Reza Soleymani, Walaa Hamouda
Abstract
Abstract In this paper we present a novel quantum k-nearest-neighbour circuit. The k-nearest-neighbour problem asks for the K closest stored points to a query among all data; quantum interference allows every stored point of every class to be compared in a single execution, a substantial computational gain. Quantum k-nearest-neighbour designs to date have rested on assumed primitives—quantum random-access memory, oracle access, amplitude-amplified search—which remain hypothetical and serve mainly to set limits on what the algorithms could achieve, or they restrict the distance metric or the number of classes. Our design uses none of these: no quantum random-access memory, no oracle, no metric restriction, no binary-class limit, and every operation is a practically implementable gate. Training members of each class are loaded into a dedicated register in superposition, a butterfly network of controlled-SWAP stages routes all classes to a common comparison position, and the class and member identity of every neighbour is read directly from the measurement statistics. The architecture rests on closed-form expressions for the post-selected probabilities and a geometric analysis showing that inverse stereographic projection carries the Euclidean nearest-neighbour ranking onto state fidelity with a sharp distortion bound. In simulation the circuit reproduces its intended decision rule exactly, and its accuracy matches classical k-nearest neighbours across a controlled benchmark at a realistic measurement budget. Every loading and sampling cost is stated in full—costs that most prior work hides by assuming quantum random-access memory.