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
Copy file name to clipboardExpand all lines: toolbox.Rmd
+51-6Lines changed: 51 additions & 6 deletions
Original file line number
Diff line number
Diff line change
@@ -59,10 +59,12 @@ using $O_x$ only $O(\sqrt{N})$ times.
59
59
This problem can be generalized to the case where there are multiple elements "marked" as good solutions. If we know the number of solutions in advance, the algorithm can be modified such that it fails with probability 0.
60
60
61
61
62
+
### Amplitude estimation
63
+
62
64
Amplitude amplification and amplitude estimation are two of the workhorses of quantum algorithms.
Given a quantum algorithm $$A:\ket{0} \to \sqrt{p}\ket{y,1} + \sqrt{1-p}\ket{G,0}$$ where $\ket{G}$ is some garbage state, then the amplitude estimation algorithm, using exactly $P$ iterations of the algorithm $A$ for any positive integer $P$, outputs $\tilde{p}$ $(0 \le \tilde p \le 1)$ such that
@@ -81,9 +83,34 @@ There is a quantum algorithm called amplitude estimation which takes as input on
81
83
with probability at least $8/\pi^2$, using $U$ and $V$ $t$ times each. If $a=0$ then $\tilde{a}=0$ with certainty, and if $a=1$ and $t$ is even, then $\tilde{a}=1$ with certainty.
82
84
```
83
85
84
-
In the original version of the Grover's algorithm we assume to know the number of marked elements, and therefore we can derive the correct number of iterations. Later on, a fixed-point version of amplitude amplification was proposed [@brassard2002quantum][@grover2005fixed], which was then optimized in [@yoder2014fixed]. These versions do not require to know the number of iterations in advance. These results foundamentally leverage the observation reprted in Proposition \@ref(prp:qesa-observation).
86
+
In the original version of the Grover's algorithm we assume to know the number of marked elements, and therefore we can derive the correct number of iterations. Later on, a fixed-point version of amplitude amplification was proposed [@brassard2002quantum][@grover2005fixed], which was then optimized in [@yoder2014fixed]. These versions do not require to know the number of iterations in advance. These results fundamentally leverage the trick that we reported in Proposition \@ref(prp:qesa-observation).
87
+
88
+
89
+
Let's see in practice how to use Theorem \@ref(thm:thm-ampest-orig). Suppose that we want to estimate $a$ with relative error $\epsilon$. What is the number of times that we have to use the two unitaries? Let's check that it suffices to take $t=\frac{2 \pi }{\epsilon \sqrt{a}}$, as
\leq & \epsilon a (1 - \frac{a}{2}) + \frac{\epsilon^2 a}{4} = \epsilon a\left( 1- \frac{a}{2}+ \frac{\epsilon}{4}\right) \leq \epsilon a.
94
+
\end{align}
95
+
96
+
In the previous equation we used the Taylor expansion of $\sqrt{1-x}$ to the second order, i.e. $\sqrt{1-x} \leq 1 - x/2$, and the fact that $\epsilon,a < 1$ in the last inequality. The asymptotic runtime of the algorithm is thus $O(\frac{1}{\epsilon \sqrt{a}})$.
97
+
98
+
What if we want to have an absolute error now? We have some of options. The simplest one is to note that a relative error of a quantity between $0$ and $1$ automatically translates in an absolute error. But this might not be the most elegant thing to do: since an absolute error for a quantity between $0$ and $1$ is "worse" than the relative error on the same quantity, we might want to save some resources, i.e. decrease the number of calls to the oracles. Let's set $t=\frac{2\pi}{\epsilon}$ and observe that
Here, in addition to the tricks used in the relative error, we also used that $\sqrt{a}\leq 1$.
106
+
107
+
108
+
109
+
```{exercise name="(Hard)"}
110
+
Another idea is to realize that we could run the algorithm returning the relative error as a black box, and set the error to $\epsilon'=\epsilon/a$. In this way we might estimate a relative error $\epsilon'a=\epsilon$, with the hope to save some resources. What is the impact of this operation in the runtime of the algorithm? It's simple to see that the runtime becomes $O(\frac{1}{\frac{\epsilon}{a}\sqrt{a}}) = O(\frac{\sqrt{a}}{\epsilon})$.
111
+
Can we check if setting $t=\frac{2\pi \sqrt{a}}{\epsilon}$ can give an absolute error in $O(\frac{\sqrt{a}}{\epsilon})$ runtime? What is difficult about it?
112
+
```
85
113
86
-
Recently, various researches worked on improvements of amplitude estimation by getting rid of the part of the original algorithm that performed the phase estimation (i.e. the Quantum Fourier Transform [@NC02]) [@grinko2019iterative], [@aaronson2020quantum]. As the QFT is not a NISQ subroutine, these results bring more hope to apply these algorithms in useful scenarios in the first quantum computers.
87
114
88
115
Perhaps a simpler formulation, which hides the complexity of the low-level implementation of the algorithm, and is thus more suitable to be used in quantum algorithms for machine learning is the following:
89
116
@@ -93,6 +120,25 @@ Perhaps a simpler formulation, which hides the complexity of the low-level imple
93
120
If there is a unitary operator $U$ such that $U\ket{0}^{l}= \ket{\phi} = \sin(\theta) \ket{x, 0} + \cos(\theta) \ket{G, 0^\bot}$ then $\sin^{2}(\theta)$ can be estimated to multiplicative error $\eta$ in time $O(\frac{T(U)}{\eta \sin(\theta)})$ and $\ket{x}$ can be generated in expected time $O(\frac{T(U)}{\sin (\theta)})$ where $T(U)$ is the time to implement $U$.
94
121
```
95
122
123
+
124
+
125
+
126
+
127
+
<!-- TODO add Fixed-point quantum search with an optimal number of queries
128
+
exact amplitude amplification -->
129
+
<!-- TODO add oblivious amplitude amplification -->
130
+
131
+
132
+
133
+
134
+
135
+
136
+
137
+
138
+
Recently, various researches worked on improvements of amplitude estimation by getting rid of the part of the original algorithm that performed the phase estimation (i.e. the Quantum Fourier Transform [@NC02]) [@grinko2019iterative], [@aaronson2020quantum]. As the QFT is not considered to be a NISQ subroutine, these results bring more hope to apply these algorithms in useful scenarios in the first quantum computers.
0 commit comments