English

A quantum binary classifier based on cosine similarity

Quantum Physics 2022-05-03 v1

Abstract

We introduce the quantum implementation of a binary classifier based on cosine similarity between data vectors. The proposed quantum algorithm evaluates the classifier on a set of data vectors with time complexity that is logarithmic in the product of the set cardinality and the dimension of the vectors. It is based just on a suitable state preparation like the retrieval from a QRAM, a SWAP test circuit (two Hadamard gates and one Fredkin gate), and a measurement process on a single qubit. Furthermore we present a simple implementation of the considered classifier on the IBM quantum processor ibmq_16_melbourne. Finally we describe the combination of the classifier with the quantum version of a K-nearest neighbors algorithm within a hybrid quantum-classical structure.

Keywords

Cite

@article{arxiv.2104.02975,
  title  = {A quantum binary classifier based on cosine similarity},
  author = {Davide Pastorello and Enrico Blanzieri},
  journal= {arXiv preprint arXiv:2104.02975},
  year   = {2022}
}

Comments

12 pages, 2 figures

R2 v1 2026-06-24T00:54:54.327Z