q-means: A quantum algorithm for unsupervised machine learning

Quantum machine learning is one of the most promising applications of a full-scale quantum computer. Over the past few years, many quantum machine learning algorithms have been proposed that can potentially offer considerable speedups over the corresponding classical algorithms. In this paper, we introduce q-means, a new quantum algorithm for clustering which is a canonical problem in unsupervised machine learning. The $q$-means algorithm has convergence and precision guarantees similar to $k$-means, and it outputs with high probability a good approximation of the $k$ cluster centroids like the classical algorithm. Given a dataset of $N$ $d$-dimensional vectors $v_i$ (seen as a matrix $V \in \mathbb{R}^{N \times d})$ stored in QRAM, the running time of q-means is $\widetilde{O}\left( k d \frac{\eta}{\delta^2}\kappa(V)(\mu(V) + k \frac{\eta}{\delta}) + k^2 \frac{\eta^{1.5}}{\delta^2} \kappa(V)\mu(V) \right)$ per iteration, where $\kappa(V)$ is the condition number, $\mu(V)$ is a parameter that appears in quantum linear algebra procedures and $\eta = \max_{i} ||v_{i}||^{2}$. For a natural notion of well-clusterable datasets, the running time becomes $\widetilde{O}\left( k^2 d \frac{\eta^{2.5}}{\delta^3} + k^{2.5} \frac{\eta^2}{\delta^3} \right)$ per iteration, which is linear in the number of features $d$, and polynomial in the rank $k$, the maximum square norm $\eta$ and the error parameter $\delta$. Both running times are only polylogarithmic in the number of datapoints $N$. Our algorithm provides substantial savings compared to the classical $k$-means algorithm that runs in time $O(kdN)$ per iteration, particularly for the case of large datasets.

[1]  G. Brassard,et al.  Quantum Amplitude Amplification and Estimation , 2000, quant-ph/0005055.

[2]  Amit Kumar,et al.  Clustering with Spectral Norm and the k-Means Algorithm , 2010, 2010 IEEE 51st Annual Symposium on Foundations of Computer Science.

[3]  A. Prakash,et al.  Quantum gradient descent for linear systems and least squares , 2017, Physical Review A.

[4]  E. Farhi,et al.  A Quantum Approximate Optimization Algorithm , 2014, 1411.4028.

[5]  S. P. Lloyd,et al.  Least squares quantization in PCM , 1982, IEEE Trans. Inf. Theory.

[6]  Dimitris Achlioptas,et al.  Fast computation of low-rank matrix approximations , 2007, JACM.

[7]  Eric R. Ziegel,et al.  The Elements of Statistical Learning , 2003, Technometrics.

[8]  Alan M. Frieze,et al.  Fast Monte-Carlo algorithms for finding low-rank approximations , 1998, Proceedings 39th Annual Symposium on Foundations of Computer Science (Cat. No.98CB36280).

[9]  S. Lloyd,et al.  Quantum algorithms for supervised and unsupervised machine learning , 2013, 1307.0411.

[10]  A. Harrow,et al.  Quantum algorithm for linear systems of equations. , 2008, Physical review letters.

[11]  Sergei Vassilvitskii,et al.  How slow is the k-means method? , 2006, SCG '06.

[12]  Stacey Jeffery,et al.  The power of block-encoded matrix powers: improved regression techniques via faster Hamiltonian simulation , 2018, ICALP.

[13]  Christoph Dürr,et al.  A Quantum Algorithm for Finding the Minimum , 1996, ArXiv.

[14]  Blake R. Johnson,et al.  Unsupervised Machine Learning on a Hybrid Quantum Computer , 2017, 1712.05771.

[15]  Ewin Tang,et al.  Quantum-inspired classical algorithms for principal component analysis and supervised clustering , 2018, ArXiv.

[16]  Ashish Kapoor,et al.  Quantum algorithms for nearest-neighbor methods for supervised and unsupervised learning , 2014, Quantum Inf. Comput..

[17]  Seth Lloyd,et al.  Quantum-inspired algorithms in practice , 2019, Quantum.

[18]  Iordanis Kerenidis,et al.  A Quantum Interior Point Method for LPs and SDPs , 2018, ACM Transactions on Quantum Computing.

[19]  Iordanis Kerenidis,et al.  Quantum Algorithms for Feedforward Neural Networks , 2018, ACM Transactions on Quantum Computing.

[20]  Ewin Tang,et al.  A quantum-inspired classical algorithm for recommendation systems , 2018, Electron. Colloquium Comput. Complex..

[21]  Iordanis Kerenidis,et al.  Quantum classification of the MNIST dataset via Slow Feature Analysis , 2018, ArXiv.

[22]  Gilles Brassard,et al.  Quantum speed-up for unsupervised learning , 2012, Machine Learning.

[23]  Franccois Le Gall,et al.  Quantum-Inspired Classical Algorithms for Singular Value Transformation , 2020, MFCS.

[24]  Iordanis Kerenidis,et al.  Quantum Recommendation Systems , 2016, ITCS.

[25]  Alan M. Frieze,et al.  Clustering Large Graphs via the Singular Value Decomposition , 2004, Machine Learning.

[26]  Andris Ambainis,et al.  Variable time amplitude amplification and quantum algorithms for linear algebra problems , 2012, STACS.

[27]  Seth Lloyd,et al.  Quantum-inspired low-rank stochastic regression with logarithmic dependence on the dimension , 2018, ArXiv.

[28]  S. Lloyd,et al.  Quantum principal component analysis , 2013, Nature Physics.

[29]  Amnon Ta-Shma,et al.  Inverting well conditioned matrices in quantum logspace , 2013, STOC '13.

[30]  Sergei Vassilvitskii,et al.  k-means++: the advantages of careful seeding , 2007, SODA '07.

[31]  Nathan Wiebe,et al.  Quantum singular value transformation and beyond: exponential improvements for quantum matrix arithmetics , 2018, STOC.

[32]  Prabhakar Raghavan,et al.  Competitive recommendation systems , 2002, STOC '02.

[33]  Luming Duan,et al.  Quantum discriminant analysis for dimensionality reduction and classification , 2015, 1510.00113.

[34]  Tongyang Li,et al.  Sampling-based sublinear low-rank matrix arithmetic framework for dequantizing Quantum machine learning , 2019, STOC.

[35]  Thierry Paul,et al.  Quantum computation and quantum information , 2007, Mathematical Structures in Computer Science.