Skip to content

Commit 93d31be

Browse files
author
Scinawa
committed
Add proper discussion on number of queries and truncated harmonic series by taylor expansion, and change permission on create_images
1 parent 8523c70 commit 93d31be

File tree

2 files changed

+15
-5
lines changed

2 files changed

+15
-5
lines changed

create_images.py

100644100755
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ def create_images(directory, latex_files):
1010
for latex_document in latex_files:
1111

1212
document_name = latex_document.split(".")
13-
13+
print("\n\n {} \n\n".format(latex_document))
1414
subprocess.call(["pdflatex", "-output-directory={}".format(directory), latex_document])
1515

1616
# "-background", "white", "-alpha", "remove",

graphs.Rmd

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -118,8 +118,7 @@ knitr::include_graphics("algpseudocode/quantum-connectivity.png")
118118

119119

120120
````{theorem, algo-connectivity, name="Quantum algorithm for graph conectivity (adjacency matrix model)"}
121-
Assume that $U_A$ is a unitary that gives you query access to the adjacency matrix $M$ of an undirected graph $G=(V,E)$. Then, deciding if a graph is connected has an expected number of queries to $U_{A}$ of $O(n^{3/2})$. In particular, if the graph is connected, algorithm \@ref(fig:quantum-algo-connectivity) returns a spanning tree for $G$ with probability greater than $2/3$.
122-
121+
Assume that $U_A$ is a unitary that gives you query access to the adjacency matrix $M$ of an undirected graph $G=(V,E)$. Then, deciding if a graph is connected has an expected number of queries to $U_{A}$ of $\widetilde{O}(n^{3/2})$. In particular, if the graph is connected, algorithm in figure \@ref(fig:quantum-algo-connectivity) returns a spanning tree for $G$ with probability greater than $2/3$.
123122
```
124123
125124
@@ -135,10 +134,15 @@ $$ f_T(e) \begin{cases}
135134
Where $c(G)$ is the number of connected components of the graph $G$. It is basically a unitary that checks if a given edge has endpoints of 2 different connected component. Note that $U_{f_T}$ needs to compare a given edge with a whole list of edges that are currently in the list of connected components. Note that in order to work, this oracle should compare a given edge with the list of edges that are part of the spanning tree $T$. The spanning tree can grow up to size $O(n)$, so the depth of the oracle is at worst $O(n)$ (up to a polylogarithmic factors).
136135
137136
138-
The runtime analysis is concluded by noting that we need to repeat the search procedure of theorem \@ref(thm:grover-improved) up to $n$ times (because when we obtain $n$ nodes in the MST we stop the algorithm). Suppose that the graph is connected. The main loop of the algorithm is repeated exactly $n-1$ times. Each search can be done in $O(\sqrt{n^2/k})$. where $k$ is the number of valid solutions to the search problem. These solutions correspond to the edges $e$ of $G$ that are connecting any two connected components. At the first iteration, we have at least $k=n-1$ solutions (i.e. any edge is a good solution), and the number decrease at each iteration. The number of queries is:
137+
The runtime analysis is concluded by noting that we need to repeat the search procedure of theorem \@ref(thm:grover-improved) up to $n$ times (because when we obtain $n$ nodes in the MST we stop the algorithm). Suppose that the graph is connected. The main loop of the algorithm is repeated exactly $n-1$ times, and each search withint the loop can be done in $O(\sqrt{n^2/k})$, where $k$ is the number of valid solutions to the search problem. These solutions correspond to the edges $e$ of $G$ that are linking any two connected components. It is simple to observe that at the first iteration we have at least $k=n-1$ solutions (i.e. any edge is a good solution), and the number of solutions decreases at each iteration. The number of queries to the oracle is:
139138
140-
$$\sum_{k=2}^n \sqrt{\frac{n^2}{(k-1)}}=O(n^{3/2})$$
139+
$$\sum_{k=2}^n \sqrt{\frac{n^2}{(k-1)}} = n\sum_{k=2}^n \frac{1}{\sqrt{k-1}}$$
140+
With Cauchy-Schwartz we can see that:
141+
142+
$$\sum_{k=2}^n \frac{1}{\sqrt{k-1}} = \sum_{k=1}^{n-1} \frac{1}{\sqrt{k}} \leq \sqrt{n-1}\left(\sum_{k=1}^{n-1}\frac{1}{k} \right)^{1/2} = \sqrt{n-1}\left(\gamma + \log(n-1) + \frac{1}{2(n-1)} \right)^{1/2}$$
141143
144+
where $\gamma$ is the Bonferroni constant, and we just interpret the second norm as a [truncated Harmonic series approximated by Taylor expansion](https://en.wikipedia.org/wiki/Harmonic_number#Approximation_using_the_Taylor_series_expansion). Thus, overall we get
145+
$$\sum_{k=2}^n \sqrt{\frac{n^2}{k-1}} \leq n \sqrt{n-1} \left(\gamma + \log(n-1) + \frac{1}{2(n-1)} \right)^{1/2} = O(n^{1.5}\log(n))$$
142146
143147
If the graph is not connected, at some point we will not be able to find any new edges, and the procedure of theorem \@ref(thm:grover-improved) will fail (we can repeat this procedure a certain number of times to be sure that there are indeed no more valid edges, leveraging the powering lemma, i.e. lemma \@ref(lem:powering-lemma)).
144148
@@ -147,6 +151,12 @@ It is simple to check that if we want the probability of failure to be bounded b
147151
148152
```
149153
154+
155+
```{exercise, name="Improve bound of number of queries"}
156+
Can you show that $\sum_{k=2}^n \sqrt{\frac{n^2}{(k-1)}}=O(n^{3/2})$, i.e. without the polylogarithmic factor $\log(n)$. Or can you prove that it is not possible to remove it? [Hint](https://math.stackexchange.com/questions/3745324/upper-bound-of-sum-k-1n-frac1-sqrtk).
157+
```
158+
159+
150160
For the array model, we report the theorem of [@durr2006quantum].
151161
152162
````{theorem, algo-connectivity-array, name="Quantum algorithm for graph conectivity (array model)"}

0 commit comments

Comments
 (0)