You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Jan 10, 2025. It is now read-only.
From those amplitudes estimations we are able to plot the distance matrix between two data sets of binary vectors.
407
407
The probability amplitude of the ancilla qubit outcomes captures the exact Hamming distance as the result of the preprocessing function.
408
408
There are two possible outcomes of measurement of the ancilla qubit, each has own probability amplitude and own interpretation of that amplitude.
409
-
For instance, for the \left| 0 \right\rangle outcome, the larger the amplitude the smaller the Hamming distance,
410
-
and for the \left| 1 \right\rangle outcome it is the other way around, magnitude of the amplitude of that outcome is proportional to the Hamming distance.
409
+
For instance, for the $\left| 0\right\rangle$ outcome, the larger the amplitude the smaller the Hamming distance,
410
+
and for the $\left| 1\right\rangle$ outcome it is the other way around, magnitude of the amplitude of that outcome is proportional to the Hamming distance.
411
411
412
412
Measuring the Hamming distance of a particular pair of input vectors $\left| x_i \right\rangle$ and cluster vector $\left| y_j \right\rangle$ consists of extracting the relevant amplitude from the subspace that those states form,
413
413
this can be done using the following projection operator
Currently available quantum platforms are still subject to substantial level of noise and extracting the exact distance from amplitude is still a difficult task.
443
443
Fortunately, for most of algorithms, SOFM included, the information of nearest vectors is sufficient.
444
444
445
-
Because of that property, those algorithms fall into a special case category for which, as there is only one input vector considered, the ``Decoding'' stage (Fig.\ref{fig:qcircuit}) can be removed as measurement no longer needs to indicate for which input vector the distance has been measured.
446
-
In this special case scenario the circuit depth complexity is matching with \cite{shuld2014}.
445
+
Because of that property, those algorithms fall into a special case category for which, as there is only one input vector considered, the ``Decoding'' stage (Fig.~\ref{fig:qcircuit}) can be removed as measurement no longer needs to indicate for which input vector the distance has been measured.
446
+
In this special case scenario the circuit depth complexity is matching with \cite{schuld2014}.
447
447
448
448
In the general case when multiple input vectors are present in the register, the ``Decoding'' stage still needs to be included leading to larger circuit depth and less attractive complexity in terms of number of controlled gate operations.
449
449
The number of controlled gate operations in this general case of multiple input vectors is matching the number of controlled gate operations in \cite{trugenberger2001}.
@@ -506,28 +506,28 @@ \section{Experimental demonstration of QASOFM}
506
506
where $N$ is number of samples,
507
507
$M$ is number of randomly sampled cluster vectors,
508
508
and $L$ is number of the shifts of cluster vectors.
509
-
In the QASOFM described in the previous section, distance calculations are realized on a quantum device (i.e. the IBM Q Experience) with the use of circuit presented in Fig.\ref{fig:qcircuit}. This approach allows one to reduce the number of operations in a number of cluster states with an optimized number of gates
509
+
In the QASOFM described in the previous section, distance calculations are realized on a quantum device (i.e. the IBM Q Experience) with the use of circuit presented in Fig.~\ref{fig:qcircuit}. This approach allows one to reduce the number of operations in a number of cluster states with an optimized number of gates
510
510
that are possible to realize on quantum computing devices that are currently available.
511
511
The circuit realized in such a manner
512
512
that calculation of Hamming distance between the sample vector and all cluster vectors is realized in one operation.
513
513
The complexity of the quantum assisted SOFM then scales as $O(LN)$.
514
514
515
-
In order to check that our algorithm gives the expected results we compare it to classical calculations of the distance matrix on two data sets of binary vectors, as shown in Fig.\ref{fig:distance_matrix}.
515
+
In order to check that our algorithm gives the expected results we compare it to classical calculations of the distance matrix on two data sets of binary vectors, as shown in Fig.~\ref{fig:distance_matrix}.
516
516
We see good agreement between the distance matrices calculated classically and on the IBM Q Experience.
517
-
The theoretical calculations and classical simulations show perfect agreement with each other (Fig.\ref{fig:distance_matrix}(a)).
518
-
The difference between Figs.\ref{fig:distance_matrix} (a) and (b) appears due to noise in the currently available non fault-tolerant quantum processors.
517
+
The theoretical calculations and classical simulations show perfect agreement with each other (Fig.~\ref{fig:distance_matrix}(a)).
518
+
The difference between Figs.~\ref{fig:distance_matrix} (a) and (b) appears due to noise in the currently available non fault-tolerant quantum processors.
519
519
520
520
An example of the QASOFM learning process is shown in Fig.~\ref{convergence}.
521
521
Initially, the cluster vectors were randomly chosen (see Fig.~\ref{convergence})
522
-
and the label of sample distribution is shown for the zeroth epoch in Fig.~\ref{convergence}(a). In order to prepare a superposition of cluster vectors needed for the calculation of the distance matrix we use the standard initialization of QISKIT library.
522
+
and the label of sample distribution is shown for the zeroth epoch in Fig.~\ref{convergence}(a). In order to prepare a superposition of cluster vectors needed for the calculation of the distance matrix we use the standard initialization of QISKIT\cite{qiskit} library.
523
523
Each epoch of the algorithm consists of distance calculation between all data and cluster vectors
524
524
and requires 9 distance calculations in the quantum implementation ($N$ in general case)
525
525
or 27 distance calculations for classical realization
526
526
($MN$ in general case).
527
527
After the distance calculation from each sample to all cluster vectors at each epoch we label each sample with the index of the closest cluster vector
528
528
and shift the closest cluster vectors to the sample one.
529
529
The shift is made by the change of the first binary element in the cluster vectors different from the sample one.
530
-
The evolution of the labels presented on Fig.~\ref{convergence}(c).
530
+
The evolution of the labels presented on Fig.~\ref{convergence}(c).
531
531
Good convergence is already observed in the fourth epoch.
532
532
533
533
This proof of concept example shows that developing of noisy intermediate scale quantum hardware will allow to solve some practical problems in unsupervised manner with very simple encoding of categorical data to quantum register.
@@ -566,7 +566,12 @@ \section{Discussions}
566
566
where $N$ is number of samples, $M$ is number of randomly sampled cluster vectors,
567
567
and $L$ is number of the shifts of cluster vectors.
568
568
Due to wide use of classical SOFMs in different areas of modern research and technology,
569
-
this can give opportunities for the use of QASOFM in practical applications in near term, outperforming classical algorithms. In addition, as our algorithm performs the Hamming distance calculation, it has potential to enhance any classical algorithm that relies on calculating distances between data entries of vector form. In machine learning, data science, statistics and optimization, distance is a common way of representing similarity, calculating it between large data sets is common procedure and our circuit could potentially enhance other distance-based algorithms as long as exact distance is not required, but when knowledge of nearest vectors is sufficient.
569
+
this can give opportunities for the use of QASOFM in practical applications in near term, outperforming classical algorithms.
570
+
In addition, as our algorithm performs the Hamming distance calculation,
571
+
it has potential to enhance any classical algorithm that relies on calculating distances between data entries of vector form.
572
+
In machine learning, data science, statistics and optimization, distance is a common way of representing similarity, calculating it between large data sets is common procedure
573
+
and our circuit could potentially enhance other distance-based algorithms as long as exact distance is not required,
574
+
but when knowledge of nearest vectors is sufficient.
0 commit comments