Quantum Machine Learning (QML), using quantum algorithms to learn quantum or classical systems, has attracted a lot of research in recent years, with some algorithms possibly gaining an exponential speedup [
1,
2,
3]. Since machine learning routines often push real-world limits of computing power, an exponential improvement to algorithm speed would allow for such systems with vastly greater capabilities [
4]. Google’s ‘Quantum Supremacy’ experiment [
5] showed that quantum computers can naturally solve certain problems with complex correlations between inputs that can be incredibly hard for traditional (“classical”) computers. Such a result naturally suggests that machine learning models executed on quantum computers could be more effective for certain applications. It seems quite possible that quantum computing could lead to faster computation, better generalization on less data, or both even, for an appropriately designed learning model. Hence, it is of great interest to discover and model the scenarios in which such a “quantum advantage” could be achieved. A number of such “Quantum Machine Learning” algorithms are detailed in papers such as [
2,
6,
7,
8,
9]. Many of these methods claim to offer exponential speedups over analogous classical algorithms. However, on the path from theory to technology, some significant gaps exist between theoretical prediction and implementation. These gaps result in unforeseen technological hurdles and sometimes misconceptions, necessitating more careful case-by-case studies.
In this work, we, therefore, reduce the use of quantum methods to estimate distances and dissimilarities. We thereby minimise the storage time of quantum states by encoding the states before each shot and using destructive measurements. We utilise this process of encoding classical data into quantum states productively by ‘pre-processing’ the data in this step. As in the case of angle embedding, the pre-processing of data before encoding using the unitary is the critical step which we can utilise. We propose an encoding using the inverse stereographic projection (ISP) and show its performance on real-world 64-QAM data. We also introduce an analogous classical quantum-inspired algorithm.
The paper is structured as follows. In the remainder of this introduction, we discuss the related body of work and our contribution to it. In
Section 2, we introduce the preliminaries required for understanding our approach and describe the problem to be tackled - clustering of 64-QAM optic fibre transmission data - as well as the experimental setup used. Furthermore,
Section 3 introduces the developed stereographic quantum k nearest-neighbour clustering (SQ-kNN).
Section 4 defines the developed quantum-inspired 2D Stereographic Classical k Nearest-Neighbour (2DSC-kNN) algorithm and proves its equivalence to the SQ-kNN quantum algorithm. Afterwards, in
Section 5, we describe the various experiments for testing the algorithms, present the obtained results, and discuss the conclusions from the experimental results.
Section 6 concludes this work and proposes some directions for future research, some of which are partially discussed in the appendix.
1.1. Related Work
A unifying overview of several quantum algorithms is presented in [
14] in a tutorial style. An overview targeting data scientists is given in [
15]. The idea of using quantum information processing methods to obtain speedups for the k-means algorithm was proposed in [
16]. In general, neither the best nor even the fastest method for a given problem and problem size can be uniquely ascribed to either the class of quantum or classical algorithms, as can be seen in the detailed discussion presented in [
9]. The advantages of using local (classical) processing units alongside quantum processing units in a distributed fashion are quantified in [
17]. The accuracy of (quantum) K-means has been demonstrated experimentally in [
18] and in [
19], while quantum circuits for loading classical data into a quantum computer are described in [
20].
An algorithm is proposed in [
2] that solves the problem of clustering N-dimensional vectors to M clusters in
time on a quantum computer, which is exponentially faster than
time for the (then) best known classical algorithm. The approach detailed in [
2] requires querying the QRAM [
21] for preparing a ‘mean state’, which is then used to find the inner product between the centroid (by default the mean point) using the SWAP test [
22,
23,
24]. However, there exist some significant caveats to this approach. Firstly, this algorithm achieves an exponential speedup only when comparing the bit-to-bit processing time with the qubit-to-qubit processing time. If one compares the bit-to-bit execution times of both algorithms, the exponential speedup disappears [
12,
25]. Secondly, since stable enough quantum memories do not exist, a hybrid quantum-classical approach must be used in real-world applications - all the information is stored in classical memories, and the states to be used in the algorithm are prepared in real-time. This process is known as ‘Data Embedding’ since we are embedding the classical data into quantum states. This, as mentioned before [
4,
25] slows down the algorithm to only a polynomial advantage over classical k-means. However, we propose an approach whereby this step of embedding can be treated as a data preprocessing step, allowing us to achieve an advantage still and make the quantum approach viable. Quantum-inspired algorithms have shown a lot of promise in achieving some types of advantage that are demonstrated by quantum algorithms [
4,
25,
26,
27], but as [
9] remarks, the massive increase in runtime with rank, condition number, Frobenius norm, and error threshold make the algorithms proposed in [
12,
25] impractical for matrices arising from real-world applications. This observation is supported by [
28].
Recent works such as [
25] suggest that even the best QML algorithms, without state preparation assumptions, fail to achieve exponential speedups over their classical counterparts. In [
4] it is pointed out that most QML algorithms are incomparable to classical algorithms since they take quantum states as input and output quantum states, and that there is no analogous classical model of computation where one could search for similar classical algorithms. In [
4], the idea of matching state preparation assumptions with
-norm sampling assumptions (first proposed in [
25]) is implemented by introducing a new input model,
sample and query access (SQ access). In [
4] the Quantum K-Means algorithm described in [
2] is ‘de-quantised’ using the ‘toolkit’ developed in [
25], i.e. a classical algorithm is given that, with classical SQ access assumptions replacing quantum state preparation assumptions, matches the bounds and runtime of the corresponding quantum algorithm up to polynomial slowdown. From the works [
4,
25,
29], we can conclude that the exponential speedups of many quantum machine learning algorithms that are under consideration arise not from the ‘quantumness’ of the algorithms but instead from strong input assumptions, since the exponential part of the speedups vanish when classical algorithms are given analogous assumptions. In other words, in a wide array of settings, on classical data, these algorithms do not give exponential speedups but rather yield polynomial speedups.
The fundamental aspect that allowed for the exponential speedup in [
25] vis-á-vis classical recommendation system algorithms is the type of problem being addressed by recommendation systems in [
8]. The philosophy of recommendation algorithms before this breakthrough was to estimate all the possible preferences of a user and then suggest one or more of the most preferred objects. The quantum algorithm promised an exponential speedup but provided a recommendation without estimating all the preferences; namely, it only provided a
sample of the most preferred objects. This process of sampling along with state preparation assumptions was, in fact, what gave the quantum algorithm an exponential advantage. The new classical algorithm obtains comparable speedups also by only providing samples rather than solving the whole preference problem. In [
4], it is argued that the time taken to create the quantum state should be included for comparison since the time taken is not insignificant; it is also claimed that for every such linear algebraic quantum machine learning algorithm, a polynomially slower classical algorithm can be constructed by using the binary tree data structure described in [
25]. Since then, more sampling algorithms have shown that multiple quantum exponential speedups are not due to the quantum algorithms themselves but due to the way data is provided to the algorithms and how the quantum algorithm provides the solutions [
4,
29,
30,
31]. Notably, in [
31] it is argued that there exist competing classical algorithms for all linear algebra subroutines, and thus for many quantum machine learning algorithms. However, as pointed out in [
9] and proven in [
28], there exist significant caveats to these aforementioned results of quantum-inspired algorithms. The polynomial factor in these algorithms often contains a very high power of the rank and condition number, making them suitable only for sparse low-rank matrices. Matrices of real-world data are most often quite high in rank and hence unfavourable for such sampling-based quantum-inspired approaches. Whether such sampling algorithms can be used also highly depends on the specific application and whether or not samples of the solution instead of the complete data are suitable. It should be pointed out that in case such complete data is needed, quantum algorithms generally do not provide an advantage anyway.
The method of encoding classical data into quantum states contributes to the complexity and performance of the algorithm. In this work, the use of the ISP is proposed. Others have explored this procedure [
32,
33,
34] as well; however, the motivation, implementation, and use vary significantly, as well as the procedure for embedding data points into quantum states. There has also been no extensive testing of the proposed methods, especially not in an industry context. In our method, we exclusively use pure states from the Bloch sphere since this reduces the complexity of the application. Lemma 3 assures that our method with existing quantum techniques is applicable for nearest neighbour clustering. In contrast, the density matrices of mixed states and the normalised trace distance between the density matrices are used for binary classification in [
32,
33]. A very important thing to consider here is to distinguish the contribution of the ISP from the quantum effects. We will see in
Section 5 that the ISP itself seems to be the most important contributing factor. In [
35], it is also proposed to encode classical information into quantum states using the ISP in the context of quantum generative adversarial networks. Their motivation for using the ISP is due to the fact that it is one-one and can hence be used to uniquely represent every point in the 2D plane without any loss of information. Angle embedding, on the other hand, loses all amplitude information due to the normalisation of all points. A method to transform an unknown manifold into an n-sphere using ISP is proposed in [
36] - here, however, the property of their concern was the conformality of the projection since subsequent learning is performed upon the surface. In [
37], a parallelised version of [
2] is developed using the FF-QRAM procedure [
38] for amplitude encoding and the ISP to ensure a one-one embedding.
In the method of Spherical Clustering [
39], the nearest neighbour algorithm is explored on the basis of the cosine similarity measure (Equation (27) and Lemma 2). The cosine similarity is used in cases of information retrieval, text mining, and data mining to find the similarity between document vectors. It is used in those cases because the cosine similarity has low complexity for sparse vectors since only the non-zero coordinates need to be considered. For our case as well, it is in our interest to study Equations (22) to (24) with the cosine dissimilarity. This, in particular, becomes relevant once we employ stereographic embedding to encode the data points into quantum states.
In this work, we develop an analogous classical algorithm to our proposed quantum algorithm to overcome the many issues faced by quantum algorithms. This work focuses on developing the stereographic quantum and quantum-inspired k nearest-neighbour algorithms and experimentally verifying the viability of the stereographic quantum-inspired k nearest-neighbour classical algorithm on real-world 64-QAM communication data.
1.2. Contribution
The subject of this work is the development and testing of the quantum-analogous classical algorithm for performing k nearest neighbour clustering using the general ISP (
Section 4) and the stereographic quantum k nearest-neighbour clustering quantum algorithm (
Section 3). The main contributions of this work are (a) the development of a novel quantum embedding using the
generalised ISP along with proving that the ideal projection radius is not 1; (b) the development of the 2DSC-kNN classical algorithm through a new method of centroid update which yields significant advantage and; (c) the experimental exploration and verification of the developed algorithms. The extensive testing upon the
real-world, experimental QAM dataset (
Section 2.1) revealed some very important results regarding the dependence of accuracy, runtime, and convergence performance upon the radius of projection, number of points, noise in the optic fibre, and stopping criterion - described in
Section 5. No other work has considered a generalised projection radius for quantum embedding or studied its effect. Through our experimentation, we have verified that there exists an ideal radius greater than 1 for which accuracy performance is maximised. The advantageous implementation of the algorithm upon experimental data shows that our procedure is quite competitive. The fact that the developed quantum algorithm has a completely classical analogue (with comparable time complexity to the classical k means algorithm) is a distinct advantage in terms of in-field deployment, especially compared to [
2,
9,
16,
32,
33,
34,
37]. The developed quantum algorithm also has another advantage with respect to Noisy intermediate-scale quantum (NISQ) realisations - it has the least circuit depth and circuit width among all candidates [
2,
9,
34,
37] - making it practical to implement with the current quantum technologies. Another important contribution is the our generalisation of the dissimilarity for clustering; instead of Euclidean dissimilarity (distance), we consider other dissimilarities which might be better estimated by quantum circuits (
Appendix E). A somewhat similar approach was developed in parallel by [
40] in the context of amplitude embedding. All previous approaches [
2,
9,
34,
37] only try to estimate the Euclidean distance. We also make the contribution of studying the relative effect of ‘quantumness’ and the ISP, something completely overlooked in previous works. We show that the quantum ‘advantage’ in accuracy performance touted by works such as [
32,
33,
34,
37] is in reality quite suspect and achievable through classical means. We describe a generalisation of the stereographic embedding - the Ellipsoidal embedding, which we expect to give even better results.
Other contributions of our work include: the development of a mathematical formalism for the generalisation of the k nearest-neighbour problem to clearly indicate the contribution various parameters such as dissimilarities and dataspace (see
Section 2.4) and; presenting the procedure and circuit for
stereographic embedding using the angle embedding procedure, which consumes only
in time and resources (
Section 3.1).