Quantum Machine Learning (QML), using quantum algorithms to learn quantum or classical systems, has attracted much 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 specific problems with complex correlations between inputs that can be incredibly hard for traditional (“classical”) computers. Such a result suggests that machine learning models executed on quantum computers could be more effective for specific applications. It seems quite possible that quantum computing could lead to faster computation, better generalisation on less data, or both, 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, some significant gaps exist between theoretical prediction and implementation on the path from theory to technology. These gaps result in unforeseen technological hurdles and sometimes misconceptions, necessitating more careful case-by-case studies such as [
10].
It is known from the literature that the
k-nearest-neighbour clustering algorithm (kNN) can be applied to solve the problem of phase estimation in optical fibres [
11,
12]. A quantum version of this kNN has been developed in [
2], promising an exponential speedup. However, the practical usefulness of this algorithm is under debate [
13]. The encoding of classical data into quantum states has been proven to be a complex task which significantly reduces the advantage of known quantum machine learning algorithms [
13]. There are claims that the speedup is reduced to only polynomial once the quantum version of the algorithm takes into account the time taken to prepare the necessary quantum states. Furthermore, for near-intermediate scale quantum (NISQ) [
3] applications, we should not expect the availability of QRAM, as this assumes reliable memories and operations which are still several milestones out of reach [
14]. For this reason, it is not currently possible to use the fully quantum clustering algorithm and thus we resort to using
hybrid quantum-classical kNN algorithms. Any classical implementation of kNN clustering involves, among other steps, repeated evaluations of a dissimilarity and and a loss function; changing the dissimilarity leads to a different clustering. A hybrid quantum classical kNN clustering algorithm utilizes quantum methods only to estimate the dissimilarity, eliminating the need for long-lasting quantum memories. However, reproducing the dissimilarity of a classical kNN algorithm using quantum methods can be prohibitively restrictive. The quantum dissimilarity also depends on the embedding (how the classical data is encoded in quantum states) and might only approximates the classical one, introducing fundamental deviations from the classical kNN algorithm. In [
10], we applied a hybrid quantum-classical algorithm with modified angle embedding to the problem of
k-means clustering for 64-QAM (Quadrature Amplitude Modulation) optical-fibre data (a well-known technical problem in signal processing through optical-fibre communication links) provided by Huawei [
15], and show that this currently does not yield an advantage due to both the embedding and the current speed and noise of quantum devices.
In this work, we use the same problem and datasets to bring two main but independent contributions using the generalised inverse stereographic projection. First, we embed classical 2-dimensional data by computing the ISP onto the 3-dimensional sphere, and use the resulting normalised vector as Bloch vector to produce a pure quantum state of one qubit, which we call stereographic embedding. The resulting quantum dissimilarity directly translates into the cosine dissimilarity, thus making the quantum algorithm mathematically closer to the classical k-means algorithm. This means that no inherent limitation is introduced by the embedding and any loss in performance of this hybrid algorithm can be compensated for by improving the noise level and the speed of the quantum device. We thus propose stereographic embedding as an improved quantum embedding that may lead to improvement in several quantum machine learning algorithms (although there might still not be a practical quantum time advantage).
The second contribution comes from the benchmarking of the hybrid stereographic quantum mentioned above. Since, as already mentioned, the resulting hybrid clustering algorithm is mathematically equivalent to a classical `quantum-inspired’ kNN algorithm, in order to assess its performance in the absence of noise we simply test the equivalent classical quantum-inspired kNN algorithm. This algorithm is the result of first computing the ISP of the data and then performing clustering using a novel `quantum’ centroid update. We observe an increase in accuracy and convergence performance over k-means clustering on the 2-dimensional optical-fibre data. This suggests, as a purely classical second main contribution, that an advantage in decoding 64-QAM optical-fibre data is achieved by performing clustering in the inverse stereographically projected sphere and by using the spherical centroid.
The paper is structured as follows. In the remainder of this introduction, we discuss related works and our contribution to it. In
Section 2, we introduce the experimental setup generating the 64-QAM optical-fibre transmission data and define clustering, the stereographic projection and the necessary quantum concepts for the hybrid protocols. Next,
Section 3 introduces the developed Stereographic Quantum kNN (SQ-kNN), while
Section 4 defines the developed quantum-inspired 2D Stereographic Classical kNN (2DSC-kNN) algorithm and proves its equivalence to the SQ-kNN quantum algorithm. In
Section 5, we describe the various experiments for testing the algorithms, present the obtained results, and discuss their conclusions. We end the main text in
Section 6 proposing 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 [
16] in a tutorial style. An overview targeting data scientists is given in [
17]. The idea of using quantum information processing methods to obtain speedups for the k-means algorithm was proposed in [
18]. 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 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 discussed in [
19]. The accuracy of (quantum) K-means has been demonstrated experimentally in [
20] and in [
21], while quantum circuits for loading classical data into a quantum computer are described in [
22].
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 [
23] 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 [
24,
25,
26]. 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, as shown in [
13,
27]. Secondly, since stable enough quantum memories do not exist, a hybrid quantum-classical approach must be used in real-world applications. Namely, all the information must be stored in classical memories, and the states to be used in the algorithm are prepared in real time. The process of preparing quantum states from classical data is known as `Data Embedding’ since we are embedding the classical data into quantum states. This, as mentioned before [
4,
27], 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 pre-processing step, allowing us to achieve some advantages in accuracy and convergence rate, taking a step towards making the quantum approach more viable. Instead of using a quantum algorithm, classical alternatives mimicking their behaviour, collectively known as quantum-inspired algorithms, have shown much promise in achieving classically some types of advantage that are demonstrated by quantum algorithms [
4,
27,
28,
29], but as [
9] remarks, the massive increase in runtime with rank, condition number, Frobenius norm, and error threshold make the algorithms proposed in [
13,
27] impractical for matrices arising from real-world applications. This observation is supported by [
30].
Recent works such as [
27] 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 [
27]) 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 [
27], i.e. a classical quantum-inspired 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,
27,
31], 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, these algorithms do not give exponential speedups but rather yield polynomial speedups on classical data.
The fundamental aspect that allowed for the exponential speedup in [
27] is exemplified by the problem of recommendation systems. The philosophy of classical 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. A quantum algorithm in [
8] 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 [
27]. 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,
31,
32,
33]. Notably, in [
33] it is argued that there exist competing classical algorithms for all linear algebraic subroutines and thus for many quantum machine learning algorithms. However, as pointed out in [
9] and proven in [
30], significant caveats exist 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 often relatively 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 quantum machine learning algorithms generally do not provide an advantage if such complete data is needed.
The method of encoding classical data into quantum states contributes to the complexity and performance of the algorithm. An extensive analysis and testing of the hybrid quantum-classical implementation of the quantum k-means algorithm using angle embedding can be found in [
10]. In this work, the use of the ISP is proposed. Others have explored this procedure [
34,
35,
36] 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. 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 [
34,
35]. A crucial 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 seems to be the most important contributing factor. In [
37], 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 injective and can hence be used to uniquely represent every point in the 2D plane without any loss of information. On the other hand, angle embedding 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 [
38] - here, however, the property of their concern was the conformality of the projection since subsequent learning is performed upon the surface. In [
39], a parallelised version of [
2] is developed using the FF-QRAM procedure [
40] for amplitude encoding and the ISP to ensure a injective embedding.
In the method of Spherical Clustering [
41], the nearest neighbour algorithm is explored based on the cosine similarity measure (). 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 co-ordinates need to be considered. For our case as well, it is in our interest to study with the cosine dissimilarity. This approach becomes particularly relevant once we employ stereographic embedding to encode the data points into quantum states.
1.2. Contribution
In this work, we first develop generalised stereographic embedding for hybrid quantum-classical kNN clustering as a better encoding that allows the quantum algorithm (
Section 3) to outperform the accuracy and convergence of classical k-means algorithm in the absence of noise; in contrast, angle embedding introduces fundamental limitations to the accuracy not due to quantum noise. To validate this statement, we simulate this algorithm classically, which translates into an equivalent classical quantum-analogous stereographic kNN clustering algorithm (
Section 4). One must note that we do not demonstrate that running the stereographic quantum kNN algorithm is more practical than the classical k-means algorithm in the NISQ context. We show that stereographic quantum kNN clustering converges faster and is more accurate than other hybrid quantum-classical kNN algorithms with angle or amplitude embedding. In parallel, the benchmarking of the classical stereographic kNN algorithm lets us claim that for the problem of decoding 64-QAM optical-fibre signals the generalised ISP and spherical centroid can allow for better accuracy and convergence.
The extensive testing upon the
real-world, experimental QAM dataset (
Section 2.1) revealed some significant results regarding the dependence of accuracy, runtime, and convergence performance upon the radius of projection, number of points, noise in the optical-fibre, and stopping criterion - described in
Section 5. Noteworthy, we observe the existence of a finite optimal radius for the ISP (not equal to 1). To the best of our knowledge, 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 an entirely 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,
18,
34,
35,
36,
39]. The developed quantum algorithm also has another advantage in the context of Noisy Intermediate-Scale Quantum (NISQ) realisations - it has the least circuit depth and circuit width among all candidates [
2,
9,
36,
39] - making it easier to implement with the current quantum technologies. Another significant contribution is 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 [
42] in the context of amplitude embedding. All previous approaches [
2,
9,
36,
39] 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 [
34,
35,
36,
39] is in reality quite suspect and achievable through classical means. In the appendix, we describe a generalisation of the stereographic embedding - the Ellipsoidal embedding, which we expect to give even better results in future works.
Other secondary contributions of our work include:
The development of a mathematical formalism for the generalisation of kNN to indicate the contribution of various parameters such as dissimilarities and dataspace (
Section 2.4);
Presenting the procedure and circuit for
stereographic embedding using the Bloch embedding procedure, which consumes only
in time and resources (
Section 3.1).