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.
221
221
First, we encoded information about pairwise different qubits in a quantum state of the $X$-register with applying the CNOT gates.
222
-
Second, Hamming distance values are extracted into the amplitudes of superposition with the controled rotation around $z$-axis gate and Hadamard gates.
222
+
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.
223
223
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.
278
278
279
-
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$
279
+
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$
280
280
281
-
\begin{align}
282
-
| \psi_1 \rangle & =
283
-
\mathrm{CNOT} (Y,X)| \psi_0 \rangle\nonumber\\
284
-
& =
281
+
\begin{equation}
282
+
| \psi_1 \rangle =
285
283
\frac{1}{\sqrt{kl}} \sum_{i, j=1}^{k}
286
284
| d^{(1)}_{ij}, \dots, d^{(n)}_{ij} \rangle
287
285
| y^{(1)}_j, \dots, y^{(n)}_j \rangle
288
286
| 0 \rangle
289
-
\end{align}
287
+
\end{equation}
290
288
%
291
-
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.
289
+
where $d^{(\alpha)}_{ij} = \mathrm{CNOT}(y^{(\alpha)}_i, x^{(\alpha)}_j)$, and $\alpha = 1\dots n$ is the qubit index in the register.
292
290
At this stage of the computation the $\left| X \right\rangle$ no longer stores the input vectors,
293
291
instead it stores the information about pairwise different qubits between the input vector $\{X\}$ and cluster vector $\{Y\}$.
294
292
Next, for each pair $\{X\}$ and $\{Y\}$, the accumulated information of all the differences is projected onto the amplitude of the superposed state.
295
293
This is achieved by applying the Hadamard gate on auxiliary qubit,
296
294
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.
387
402
If the ancilla qubit is 1, the smallest amplitude of the measurement result coincides with the smallest Hamming distance.
388
403
389
-
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,
404
+
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,
390
405
this can be done using the following projection operator
391
406
%
392
407
\begin{align}
393
-
\Pi_{i,j} = &\left| X_i\rangle\langleX_i\right| \otimes\left| Y_j\rangle\langleY_j\right| \otimes I .
408
+
\Pi_{i,j} = &\left| x_i\rangle\langlex_i\right| \otimes\left| y_j\rangle\langley_j\right| \otimes I .
394
409
\end{align}
395
410
%
396
411
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
0 commit comments