|
132 | 132 | "source": [
|
133 | 133 | "## Quantum Algorithm for Simon's Problem<a name=\"quantumalgorithm\"></a>\n",
|
134 | 134 | "\n",
|
135 |
| - "Simon's algorithm is a scheme for solving the problem above using exponentially fewer queries to the funciton $f$. In order for Simon's algorithm to work, one needs to be able to implement the unknown function $f$ using quantum logic. That is, given an input *quantum state* $|x\\rangle$, one needs a *unitary* $U_f$ satisfying\n", |
| 135 | + "Simon's algorithm is a scheme for solving the problem above using exponentially fewer queries to the function $f$. In order for Simon's algorithm to work, one needs to be able to implement the unknown function $f$ using quantum logic. That is, given an input *quantum state* $|x\\rangle$, one needs a *unitary* $U_f$ satisfying\n", |
136 | 136 | "$$U_f|x\\rangle |0\\rangle = |x\\rangle |f(x)\\rangle.$$\n",
|
137 | 137 | "This unitary is an *oracle* for $f$, and the goal is to query it as few times as possible to learn the secret string $s$.\n",
|
138 | 138 | "\n",
|
|
182 | 182 | "From the measurement results $\\{z_1, \\dots, z_k\\}$, we can form a system of equations:\n",
|
183 | 183 | "$$ \\begin{aligned}z_{1}\\cdot s&=0\\mod{2}\\\\z_{2}\\cdot s&=0\\mod{2}\\\\&\\,\\,\\vdots \\\\z_{k}\\cdot s&=0\\mod{2}\\end{aligned}$$ \n",
|
184 | 184 | "\n",
|
185 |
| - "There are $k$ equations and $n$ unknowns (the elements of $s$). If we run the quantum part enough times so that we find $n$ **independent** equations, then we can solve these equations (using, e.g., Gaussian elimination) to recover the secret string $s$. This is precisely the classical post-processing requried: solve the system of equations found above to recover the string $s$. We refer the interested reader to the [Appendix](#Classical-post-processing) for details." |
| 185 | + "There are $k$ equations and $n$ unknowns (the elements of $s$). If we run the quantum part enough times so that we find $n$ **independent** equations, then we can solve these equations (using, e.g., Gaussian elimination) to recover the secret string $s$. This is precisely the classical post-processing required: solve the system of equations found above to recover the string $s$. We refer the interested reader to the [Appendix](#Classical-post-processing) for details." |
186 | 186 | ]
|
187 | 187 | },
|
188 | 188 | {
|
|
594 | 594 | "#### Quantum Implementation of $U_f$\n",
|
595 | 595 | "We now define the unitary using the `@circuit.subroutine` functionality of the Amazon Braket SDK. The following code was imported from the `simons_utils.py` module, and is shown below for reference. \n",
|
596 | 596 | "\n",
|
597 |
| - "In the quantum setting, we first copy the input register into some ancilliary qubits:\n", |
| 597 | + "In the quantum setting, we first copy the input register into some ancillary qubits:\n", |
598 | 598 | "$$ |x\\rangle|0\\rangle\\mapsto |x\\rangle|x\\rangle.$$\n",
|
599 |
| - "We then perform the quantum analog of $\\mathrm{XOR}$, which means we apply an $X$ gate to the $k^\\text{th}$ qubit whenever the $k^\\text{th}$ bit of $s$ is $1$. However, we only apply this $X$ gate when the flag qubit is also $|1\\rangle$. Thus, our $X$ gate becomes a $\\mathrm{CNOT}$ gate beween the flag qubit on the input register, and the $k^\\text{th}$ qubit on the output." |
| 599 | + "We then perform the quantum analog of $\\mathrm{XOR}$, which means we apply an $X$ gate to the $k^\\text{th}$ qubit whenever the $k^\\text{th}$ bit of $s$ is $1$. However, we only apply this $X$ gate when the flag qubit is also $|1\\rangle$. Thus, our $X$ gate becomes a $\\mathrm{CNOT}$ gate between the flag qubit on the input register, and the $k^\\text{th}$ qubit on the output." |
600 | 600 | ]
|
601 | 601 | },
|
602 | 602 | {
|
|
0 commit comments