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.
Quantum circuit for the quantum parallelized Hamming distance calculating between all pairs of binary vectors from two sets ${X}$ and ${Y}$ encoded \cite{trugenberger2001} in $X$ and $Y$ quantum registers respectively.
228
228
First, we encoded information about pairwise different qubits in a quantum state of the $X$-register with applying the CNOT gates.
229
-
Second, Hamming distance values are extracted into the amplitudes of superposition with the controled rotation around $z$-axis gate and Hadamard gates.
229
+
Second, Hamming distance values are extracted into the amplitudes of superposition with the controled rotation around $z$-axis gate~(\ref{eq:controled_rotation}) and Hadamard gates.
230
230
Finally, a quantum state of the $X$-register returned to the initial basis for information retrieval.
where $\left| a \right\rangle$ is an auxiliary qubit in the state $\left| 0\right\rangle$ initially.
282
282
283
-
Given this initial state we may begin the processing of the problem. We start by applying a CNOT gate between$\left| X \right\rangle$ and $\left| Y \right\rangle$
283
+
Given this initial state we may begin the processing of the problem. We start by applying a CNOT gate on$\left| x^{(\alpha)} y^{(\alpha)} \right\rangle$ and $\alpha = 1\dots n$
284
284
285
-
\begin{align}
286
-
| \psi_1 \rangle & =
287
-
\mathrm{CNOT} (Y,X)| \psi_0 \rangle\nonumber\\
288
-
& =
285
+
\begin{equation}
286
+
| \psi_1 \rangle =
289
287
\frac{1}{\sqrt{kl}} \sum_{i, j=1}^{k}
290
288
| d^{(1)}_{ij}, \dots, d^{(n)}_{ij} \rangle
291
289
| y^{(1)}_j, \dots, y^{(n)}_j \rangle
292
290
| 0 \rangle
293
-
\end{align}
291
+
\end{equation}
294
292
%
295
-
where $d^\alpha_{ij} = \mathrm{CNOT}(y^\alpha_i, x^\alpha_j)$, $\alpha = 1\dots n$, and $i,j$ are the qubit indexes in the registers.
293
+
where $d^{(\alpha)}_{ij} = \mathrm{CNOT}(y^{(\alpha)}_i, x^{(\alpha)}_j)$, and $\alpha = 1\dots n$ is the qubit index in the register.
296
294
At this stage of the computation the $\left| X \right\rangle$ no longer stores the input vectors,
297
295
instead it stores the information about pairwise different qubits between the input vector $\{X\}$ and cluster vector $\{Y\}$.
298
296
Next, for each pair $\{X\}$ and $\{Y\}$, the accumulated information of all the differences is projected onto the amplitude of the superposed state.
299
297
This is achieved by applying the Hadamard gate on auxiliary qubit,
300
298
followed by a controlled rotation around $z$-axis gate on $\left| Xa \right\rangle$ defined as
At this stage, the information regarding the differences between pairs of $\{X\}$ and $\{Y\}$\hl{encoded in the amplitudes, in order to extract the Hamming distances between the relevant $\left| x_i \right\rangle$, $\left| y_j \right\rangle$ we return to our initial basis} for register $\left| X \right\rangle$ by applying pairwise CNOT gates:
In this case, the biggest amplitude of the measurement result coincides with the smallest Hamming distance when the measurement result of the ancilla qubit is 0.
391
406
If the ancilla qubit is 1, the smallest amplitude of the measurement result coincides with the smallest Hamming distance.
392
407
393
-
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,
408
+
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,
394
409
this can be done using the following projection operator
395
410
%
396
411
\begin{align}
397
-
\Pi_{i,j} = &\left| X_i\rangle\langleX_i\right| \otimes\left| Y_j\rangle\langleY_j\right| \otimes I .
412
+
\Pi_{i,j} = &\left| x_i\rangle\langlex_i\right| \otimes\left| y_j\rangle\langley_j\right| \otimes I .
398
413
\end{align}
399
414
%
400
415
Using the above projection operator, the subspace of the Hilbert space formed by a particular pair of input and cluster vectors can be traced out as
(a) Representation of the data set of abstracts with the bag-of-words model is shown.
447
+
(a) Representation of the data set of abstracts with the bag-of-words \cite{weikang2016} model is shown.
433
448
Each abstract is represented by a binary vector with 9 elements, corresponding to the 9 words on the horizontal axis.
434
449
The samples are sorted into groups (QML, MED, BIO) with 3 papers for each tag, for a total of 9 paper.
435
450
(b) The Hamming distance between each vectorized abstract is shown as a number in the matrix.
@@ -467,7 +482,7 @@ \section{Experimental demonstration of QASOFM}
467
482
``Quantum Machine Learning'' (QML),
468
483
``Cancer'' (MED)
469
484
and ``Gene Expression'' (BIO).
470
-
Abstracts were vectorized by the bag-of-words\cite{weikang2016} model in order to choose most defining words in each data set (see Fig.~\ref{fig:vectorized_sample}) \cite{mctear2016}.
485
+
Abstracts were vectorized by the bag-of-words\cite{weikang2016} model in order to choose most defining words in each data set (see Fig.~\ref{fig:vectorized_sample}) \cite{mctear2016}.
471
486
This model represents text as a multiset ``bag'' of its words taking into account only multiplicity of words.
472
487
Preparing the bag-of-words we excluded the words that appear only in one abstract and more than in 4 abstracts and we also excluded the word ``level'' from consideration due to the frequent overlap between the clusters because it gives instabilities for both classical and quantum algorithms.
473
488
We restricted our bag-of-word size to 9 of the most frequent words from the full bags-of-word due to limitations of the number of qubits.
0 commit comments