Skip to main content

Effect of Different Encodings and Distance Functions on Quantum Instance-Based Classifiers

  • Conference paper
  • First Online:
  • 1992 Accesses

Part of the book series: Lecture Notes in Computer Science ((LNAI,volume 13281))

Abstract

In the last years, we have witnessed the increasing usage of machine learning technologies. In parallel, we have observed the raise of quantum computing, a paradigm for computing making use of quantum theory. Quantum computing can empower machine learning with theoretical properties allowing to overcome the limitations of classical computing. The translation of classical algorithms into their quantum counter-part is not trivial and hides many difficulties. We illustrate and implement alternatives for the quantum nearest neighbor classifier focusing on the challenges related to data preparation and their effect on the performance. We show that, with certain data preparation strategies, quantum algorithms are comparable with the classic version, yet allowing for a theoretical reduction of the complexity for distances calculation.

This is a preview of subscription content, log in via an institution.

Buying options

Chapter
USD   29.95
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever
eBook
USD   79.99
Price excludes VAT (USA)
  • Available as EPUB and PDF
  • Read on any device
  • Instant download
  • Own it forever
Softcover Book
USD   99.99
Price excludes VAT (USA)
  • Compact, lightweight edition
  • Dispatched in 3 to 5 business days
  • Free shipping worldwide - see info

Tax calculation will be finalised at checkout

Purchases are for personal use only

Learn about institutional subscriptions

Notes

  1. 1.

    Python code available at: https://github.com/Brotherhood94/quantum_knn. We implemented QKNN using the qiskit library: https://qiskit.org/.

  2. 2.

    https://scikit-learn.org/stable. For mnist we focus on the task of classification between “0” and “8”.

References

  1. Afham, A., et al.: Quantum K-nearest neighbor machine learning algorithm. arXiv:2003.09187 (2020)

  2. Brassard, G., et al.: Quantum amplitude amplification and estimation. Quantum Comput. Inf. 305, 53–74 (2002)

    MathSciNet  MATH  Google Scholar 

  3. Dang, Y., Jiang, N., Hu, H., Ji, Z., Zhang, W.: Image classification based on quantum K-nearest-neighbor algorithm. Quantum Inf. Proc. 17(9), 239 (2018). https://doi.org/10.1007/s11128-018-2004-9

    Article  MATH  Google Scholar 

  4. Dougherty, J., Kohavi, R., Sahami, M.: Supervised and unsupervised discretization of continuous features. In: ICML, pp. 194–202 (1995)

    Google Scholar 

  5. Durr, C., Hoyer, P.: A quantum algorithm for finding the minimum. arXiv preprint arXiv:quant-ph/9607014v2 (1999)

  6. Kaye, P.: Reversible addition circuit using one ancillary bit with application to quantum computing. arXiv, p. 0408173, August 2004

    Google Scholar 

  7. Leskovec, J., et al.: Mining of Massive Datasets. Cambridge University Press, Cambridge (2014)

    Book  Google Scholar 

  8. Li, J., Lin, S., Kai, Y., Guo, G.: Quantum K-nearest neighbor classification algorithm based on hamming distance. arXiv preprint arXiv:2103.04253 (2021)

  9. Lloyd, S., Mohseni, M., Rebentrost, P.: Quantum algorithms for supervised and unsupervised machine learning. arXiv preprint arXiv:1307.0411 (2013)

  10. Möttönen, M., et al.: Transformation of quantum states using uniformly controlled rotations. Quantum Inf. Com. 5, 467–473 (2005)

    MathSciNet  MATH  Google Scholar 

  11. Nielsen, M., et al.: Quantum Computation and Quantum Information. CUP, Cambridge (2016)

    Google Scholar 

  12. Park, D.K., Petruccione, F., Rhee, J.-K.K.: Circuit-based quantum random access memory for classical data. Sci. Rep. 9(1), 1–8 (2019)

    Google Scholar 

  13. Ruan, Y., et al.: Quantum algorithm for K-nearest neighbors classification based on the metric of hamming distance. IJTP 56(11), 3496–3507 (2017)

    MathSciNet  MATH  Google Scholar 

  14. Schuld, M., et al.: Implementing a distance-based classifier with a quantum interference circuit. EPL (Europhys. Lett.) 119(6), 60002 (2017)

    Article  Google Scholar 

  15. Schuld, M., et al.: Supervised Learning with Quantum Computers. Springer, Cham (2018). https://doi.org/10.1007/978-3-319-96424-9

  16. Schuld, M., Sinayskiy, I., Petruccione, F.: Quantum computing for pattern classification. In: Pham, D.-N., Park, S.-B. (eds.) PRICAI 2014. LNCS (LNAI), vol. 8862, pp. 208–220. Springer, Cham (2014). https://doi.org/10.1007/978-3-319-13560-1_17

    Chapter  Google Scholar 

  17. Shende, V.V., Bullock, S.S., Markov, I.L.: Synthesis of quantum-logic circuits. IEEE Trans. Comput. Aided Des. Integr. Circ. Syst. 25(6), 1000–1010 (2006)

    Article  Google Scholar 

  18. Tan, P., et al.: Introduction to Data Mining. Addison-Wesley, Boston (2005)

    Google Scholar 

  19. Ventura, D., et al.: Quantum associative memory. Inf. Sci. 124(1–4), 273–296 (2000)

    Article  MathSciNet  Google Scholar 

  20. Wiebe, N., Kapoor, A., Svore, K.M.: Quantum nearest-neighbor algorithms for machine learning. Quantum Inf. Comput. 15, 318–358 (2018)

    Google Scholar 

Download references

Acknowledgment

This work is supported by Università di Pisa under the “PRA - Progetti di Ricerca di Ateneo” (Institutional Research Grants) - Pr. no. PRA_2020-2021_92, “Quantum Computing, Technologies and Applications”, and the work of Gianna Del Corso was supported also by GNCS-INdAM.

Author information

Authors and Affiliations

Authors

Corresponding author

Correspondence to Alessandro Berti .

Editor information

Editors and Affiliations

Rights and permissions

Reprints and permissions

Copyright information

© 2022 The Author(s), under exclusive license to Springer Nature Switzerland AG

About this paper

Check for updates. Verify currency and authenticity via CrossMark

Cite this paper

Berti, A., Bernasconi, A., Del Corso, G.M., Guidotti, R. (2022). Effect of Different Encodings and Distance Functions on Quantum Instance-Based Classifiers. In: Gama, J., Li, T., Yu, Y., Chen, E., Zheng, Y., Teng, F. (eds) Advances in Knowledge Discovery and Data Mining. PAKDD 2022. Lecture Notes in Computer Science(), vol 13281. Springer, Cham. https://doi.org/10.1007/978-3-031-05936-0_8

Download citation

  • DOI: https://doi.org/10.1007/978-3-031-05936-0_8

  • Published:

  • Publisher Name: Springer, Cham

  • Print ISBN: 978-3-031-05935-3

  • Online ISBN: 978-3-031-05936-0

  • eBook Packages: Computer ScienceComputer Science (R0)

Publish with us

Policies and ethics