Skip to content

Commit 8af8474

Browse files
committed
Add comments on amplitude estimation.
1 parent 1e60652 commit 8af8474

File tree

1 file changed

+51
-6
lines changed

1 file changed

+51
-6
lines changed

toolbox.Rmd

Lines changed: 51 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -59,10 +59,12 @@ using $O_x$ only $O(\sqrt{N})$ times.
5959
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.
6060

6161

62+
### Amplitude estimation
63+
6264
Amplitude amplification and amplitude estimation are two of the workhorses of quantum algorithms.
6365

6466

65-
(ref:brassard2002quantum) [@nannicini2019fast]
67+
(ref:brassard2002quantum) [@brassard2002quantum]
6668

6769
```{theorem, thm-ampest-orig, name="Amplitude estimation, (ref:brassard2002quantum)"}
6870
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
8183
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.
8284
```
8385

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
90+
91+
\begin{align}
92+
\left| a - \widetilde{a} \right| \leq & \frac{2 \pi\sqrt{a} \sqrt{a(1-a)}\epsilon}{2\pi} + \frac{\pi^2 \epsilon^2a}{4 \pi^2} = \epsilon a \sqrt{1-a} + \frac{\epsilon^2 a}{4} \nonumber \\
93+
\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
99+
100+
\begin{align}
101+
\left| a - \widetilde{a} \right| \leq & \frac{2 \pi \sqrt{a(1-a)}\epsilon}{2\pi} + \frac{\pi^2 \epsilon^2}{4 \pi^2} = \epsilon \sqrt{a}\sqrt{1-a} + \frac{\epsilon^2}{4} \nonumber \\
102+
\leq & \epsilon \sqrt{a}(1 - \frac{a}{2}) + \frac{\epsilon^2}{4} = \epsilon\left(\sqrt{a}(1- \frac{a}{2})+ \frac{\epsilon}{4}\right) \leq \epsilon.
103+
\end{align}
104+
105+
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+
```
85113

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.
87114

88115
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:
89116

@@ -93,6 +120,25 @@ Perhaps a simpler formulation, which hides the complexity of the low-level imple
93120
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$.
94121
```
95122

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.
139+
140+
141+
96142
(ref:ambainis2012variable) [@ambainis2012variable]
97143

98144
```{theorem, variable-time-search, name="Variable Time Search (ref:ambainis2012variable)"}
@@ -102,11 +148,10 @@ Then there exists a quantum algorithm with success probability at least $2/3$ th
102148
$$\widetilde O\left(\sqrt{T_1^2+\ldots+T_n^2}\right).$$
103149
```
104150

151+
### Amplitude amplification
152+
105153

106154

107-
<!-- TODO add Fixed-point quantum search with an optimal number of queries
108-
exact amplitude amplification -->
109-
<!-- TODO add oblivious amplitude amplification -->
110155

111156

112157
### Example: estimating average and variance of a function

0 commit comments

Comments
 (0)