\documentclass{article}
\usepackage{amsmath,amssymb}
\input{preamble.tex}
\newcommand{\noi}{\noindent}
\newcommand{\bd}{\begin{displaymath}}
\newcommand{\ed}{\end{displaymath}}
\newcommand{\be}{\begin{eqnarray*}}
\newcommand{\ee}{\end{eqnarray*}}


\begin{document}

\lecture{13}{March 22, 2001}{Dan Spielman}{Abhinav Kumar}

\bigskip

This lecture will be on oracle quantum turing machines. \\
We wish to compare Quantum complexity classes to ordinary complexity classes. 

{\fact BQP $\subseteq$ PSPACE}\\
This is easy to prove, in fact it's on the problem set. A harder proposition is the following.
{\fact BQP $\subseteq$ P$^{\#P}$}\\
Another result says
\bd 
\exists A \textrm{ such that } NP^A \notin BQP^A.
\ed
So at least in its ability to access an oracle, NP can be more powerful than BQP.

We need to define the notion of accessing an oracle for a quantum computer. The idea is to put quantum gates in the circuit representing the oracle. An oracle is viewed as a function $A: \{0,1\}^* \rightarrow \{0,1\}$.
We consider the quantum gate $Q_{A_n}$, as shown in the figure.

\begin{picture}(200,200)
\put(60,170){\line(1,0){80}}
\put(60,30){\line(1,0){80}}
\put(60,30){\line(0,1){140}}
\put(140,30){\line(0,1){140}}
\put(20,35){\line(1,0){40}}
\put(20,55){\line(1,0){40}}
\put(20,75){\line(1,0){40}}
\put(20,95){\line(1,0){40}}
\put(20,115){\line(1,0){40}}
\put(20,135){\line(1,0){40}}
\put(140,135){\line(1,0){40}}
\put(140,35){\line(1,0){40}}
\put(140,55){\line(1,0){40}}
\put(140,75){\line(1,0){40}}
\put(140,95){\line(1,0){40}}
\put(140,115){\line(1,0){40}}
\put(140,135){\line(1,0){40}}
\put(140,155){\line(1,0){40}}
\put(20,155){\line(1,0){40}}

\put(5,105){$x \in \{0,1\}^n$}
\put(10,35){$y$}
\put(185,105){$x$}
\put(185,35){$y \oplus A(x)$}
\put(90,10){Gate $Q_{A_n}$}

\end{picture}
\label{qgate}

To describe the quantum gate $Q_A$, assume that $A$ tells us what $Q_A$ does on basis states $ |x,y>$, $x \in \{0,1\}^n, y \in \{0,1\}$. $Q_A$ sends this to $ |x, A(x) \oplus y >$. Extend by linearity to get a unitary transformation.

Then an oracle quantum turing machine just means a quantum circuit which is allowed to incorporate some gates of this form.

Let $L(A) = \{w | \exists x \in A, |x| = |w|\}$.
Clearly $L(A) \in NP^A$. We will see that quantum computers can't decide $L(A)$ very well. Putting in one word of a given length makes  very slight difference to the functioning of a quantum circuit trying to decide $L(A)$. The rough idea is that if $|A \cap \{0,1\}^n | = 0 \textrm{ or } 1$, it doesn't make much of a difference which of these values it is (to a Quantum circuit). The proof idea is similar to the proof of $P^A \subsetneq NP^A$.

{\theorem $L(A) \notin BQP^A$}\\

\noindent {\bf Proof}: 
Suffices to argue about one quantum circuit. The way we elude all Quantum circuits is the same as in the proof of $P^A \subsetneq NP^A$. In fact, if a quantum circuit with $T$ oracle gates accepts $L(A)$ with error probability less than a fixed constant, then $T = \Omega(2^{n/2})$ (this bound is tight - see Grover's algorithm).
Define
Let the initial state be $|\phi_0>$.
\bd
|\phi_T> := U_TQ_A...Q_AU_1 |\phi_0>
\ed
where $U_i$'s are unitary matrices, $T$ refers to time steps for the circuit. the language $A$ acts as an oracle: if $x \in \{0,1\}^n$, then $A(x) = 0$ if $x \in A$, $1$ if $x \notin A$. Note that if $|A \cap \{0,1\}^n| = 0$, then $Q_{A_n}$, is the identity. We will compare two cases: no words against exactly one word. Define
\bd
|\theta_i> := U_i...U_1|\phi_0>
\ed

Our goal is to find $x \in \{0,1\}^n$ such that if $A_n = \{x\}$, then $||\phi_T - \theta_T || > const. \Rightarrow T \textrm{ is huge} $. 

{\lemma $\exists x \in \{0,1\}^n$ such that 
$||\phi_T-\theta_T|| \leq \sqrt{\frac{2T^2}{2^n}}$
}
\\ \\
Before we prove the lemma, we state a corollary:\\
\noindent {\bf Claim}: If $T = o(2^{n/2})$ then this circuit can't distinguish between $|A \cap \{0,1\}^n| = 0$ or $1$.\\

Now our goal is to find $x$ so that it's not queried in a meaningful way. Assume w.lo.g. that there is a distinguished set of wires that are inputs to the $Q_A$ gate, i.e. assume dedicated input wires for $Q_A$. For a state 
\bd 
|\psi> = \sum\limits_{c \textrm{ basis state }} \alpha_c |c>
\ed
we define the query magnitude of $x$ in $\psi$ to be $\sum\limits_{c \in S_x} | \alpha_c|^2$, where 
\bd 
S_x = \{ \textrm{ basis states with x on oracle wires } \}
\ed

\noindent {\bf Def.} The query magnitude of $x$ at time $i$ is $q_{i,x} = $ the query magnitude of $x$ in $\theta_i$.

\noindent {\bf Def.} The query magnitude of $x$, $q_x = \sum\limits_{i=1}^T q_{i,x}$.

\noindent Idea: take $x$ of mimimal query magnitude so $q_x < \frac{T}{2^n}$, because $\sum\limits_{x}q_{i,x} = 1$ for every $i$.\\
\noindent
{\bf Claim}: $||\theta_T - \phi_T|| \leq \sqrt{T\cdot 2q_x} $ (this $\Rightarrow$ Lemma 4).\\ \\
{\bf Proof of claim:}\\

Let $V_i = U_iQ_A$. 
\be
|\phi_T> &=& (V_TV_{T-1}...V_1)|\phi_0> \cr
|\theta_T> &=& (U_TU_{T-1}...U_1)|\phi_0> \cr
\psi_{k,i} &=& V_iV_{i-1}...V_{k+1}U_k...U_1|\phi_0> (\textrm{ called the k'th hybrid at time i} \cr
\textrm{so } \psi_{0,T} &=& V_T...V_1 |\phi_0 \cr
\psi_{k,T} &=& V_T...V_{k+1}U_k...U_1|\phi_0> \cr
\psi_{T,T} &=& U_T...U_1|\phi_0> 
\ee

Compare $\psi_{k,k+1}$ with $\psi_{k+1,k+1}$. \\
$\theta_k = \psi_{k,k}$, we apply either $V_k$ or $U_k$.
It is easily verified that 
\bd 
|| \psi_{k,k+1} - \psi_{k+1,k+1}|| \leq 2q_{k,x}
\ed
\bd 
\Rightarrow || \psi_{k,k+1} - \psi_{k+1,k+1}||^2 \leq  2q_{k,x} \textrm{ since } || \psi_{k,T} - \psi_{k+1,T}||^2 = || \psi_{k,k+1} - \psi_{k+1,k+1}||^2
\ed
because unitary transformations preserve norms.
Therefore 
\bd 
\sum\limits_{k=0}^{T-1} || \psi_{k,T} - \psi_{k+1,T}||^2 \leq \sum\limits_{k=0}^{T-1} 2q_{k,x} \leq 2q_x
\ed
By Cauchy-Schwartz,
\bd 
||\theta_T-\phi_T|| = ||\psi_{0,T} - \psi_{T,T} || \leq \sum\limits_{k} ||\psi_{k,T} - \psi_{k+1,T} || \leq \sqrt{2q_x T}
\ed

{\bf Grover's Algorithm}\\

Search in $O(\sqrt{N})$ time. 
Let $H$ be the Hadamard matrix 
\bd
M = \frac{1}{\sqrt{2}} \begin{bmatrix}1 & 1 \cr 1 & -1 \end{bmatrix}
\ed
Also, let us consider the matrix corresponding to the gate $NOT$,
\bd
Q_{NOT_2} = \begin{bmatrix}0 & 1 \cr 1 & 0 \end{bmatrix}
\ed
We shall use the matrices $H$ and $NOT$ to get a unitary transformation that flips the sign of one bit, namely $U = H\cdot NOT\cdot H$.
\bd
U = \frac{1}{2} \begin{bmatrix}1 & 1 \cr 1 & -1 \end{bmatrix} \cdot  \begin{bmatrix}0 & 1 \cr 1 & 0 \end{bmatrix}\cdot \begin{bmatrix}1 & 1 \cr 1 & -1 \end{bmatrix} 
= \begin{bmatrix}1 & 0 \cr 0 & -1 \end{bmatrix}
\ed
Using this machinery, we can construct a gate $Q_A'$ for an oracle $A$, which takes $|x> to -|x>$ if $x \in A$, and leaves $|x>$ unchanged otherwise (note this is a unitary transformation, since it is unitary on the orthogonal basis vectors, and takes them to orthogonal vectors).

So if $A = {01}$, $Q_A' |01> = -|01>$.
Suppose we apply this transform to a uniform linear combination of states \\
$$ |x_0> = \frac{1}{2}(|00>+|01>+|10>+|11>)$$ We get out
$$\frac{1}{2}(|00>-|01>+|10>+|11>)$$

Now suppose to the result we apply a Hadamard transform to each bit, then apply the matrix
\bd
\begin{bmatrix}1 & & & \cr & -1 & & \cr & & -1 & \cr & & & -1\end{bmatrix} \textrm{    (reflection about mean)}
\ed
to it, and again the Hadamard transform to it.  We get out just $|01>$! \\
The Hadamard transform acts as a Fourier transform.
The general algorithm is based on these lines, the idea is to iterate, applying these two gates (the diffusion transform and $Q_A'$), when we have more than 2 inputs.
\bd
RQ_A'RQ_A'...|x_0> (\frac{4}{\pi}\sqrt{2^n} \textrm{ times})
\ed
the dominant term will be the word we want to select. This takes time $O(\sqrt{N})$ since $N \approx 2^n$.


\end{document}










