Skip to content

Commit

Permalink
small tweaks to lecture 9 material for clarity and correctness
Browse files Browse the repository at this point in the history
  • Loading branch information
micahkepe committed Feb 22, 2025
1 parent ed3d49a commit d28095c
Showing 1 changed file with 28 additions and 32 deletions.
60 changes: 28 additions & 32 deletions lectures/phase-ii/lecture9.tex
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ \subsection*{Problem Statement}
and only one item is “special.” Classically, you must check each item one by
one (on average, \( O(2^n) \) trials) to find the special item. Grover's
algorithm, however, uses quantum amplitude amplification to solve this
problem in only \( O(\sqrt{2^n}) \) iterations- a quadratic speedup over
problem in only \( O(\sqrt{2^n}) \) iterationsa quadratic speedup over
classical search.

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
Expand Down Expand Up @@ -57,8 +57,8 @@ \subsection*{Grover's Algorithm Circuit}
O \ket{x} = (-1)^{f(x)} \ket{x}.
\]

In our example, if the winning state is \(\ket{w}\), then \( O\ket{w}
= -\ket{w} \).
For example, if the winning state is \(\ket{w}\), then
\( O\ket{w} = -\ket{w} \).

\item \textbf{Diffusion Operator \(D\):} Reflect all amplitudes about
the average amplitude. This operator is given by
Expand All @@ -67,18 +67,20 @@ \subsection*{Grover's Algorithm Circuit}
D = 2\ket{s}\bra{s} - I.
\]

In practice, \( D \) is implemented by the sequence:
In practice, \( D \) is implemented as

\[
H^{\otimes n} \; X^{\otimes n} \; (CZ) \; X^{\otimes n} \;
H^{\otimes n}.
D = H^{\otimes n} \; X^{\otimes n} \; (CZ) \; X^{\otimes n} \;
H^{\otimes n},
\]

where the \(CZ\) gate here represents a controlled phase flip on
\(\ket{1}^{\otimes n}\) (for \(n>2\), this is a multi-controlled \(Z\)
gate).
\end{itemize}
\end{enumerate}

The following diagram shows the high-level circuit for an \( n \)-qubit
Grover algorithm:
The high-level circuit for an \( n \)-qubit Grover algorithm is illustrated as:

\[
\begin{quantikz}
Expand All @@ -100,14 +102,13 @@ \subsection*{Grover's Algorithm Circuit}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\subsubsection*{2-Qubit Example}

To build intuition, let us consider the case \( n=2 \) (i.e. \( N=4 \)) with
the winning state chosen as \(\ket{11}\).
To build intuition, consider the case \( n=2 \) (i.e., \( N=4 \)) with the winning
state chosen as \(\ket{11}\).

\vspace{0.3cm}

\textbf{Oracle:} For a 2-qubit system, the Oracle \(O\) can be implemented as
a controlled-Z (CZ) gate since

\textbf{Oracle:} For a 2-qubit system, the Oracle \(O\) can be implemented as a
controlled-\(Z\) (CZ) gate:
\[
CZ =
\begin{pmatrix}
Expand All @@ -128,10 +129,9 @@ \subsubsection*{2-Qubit Example}
D = H^{\otimes 2}\; X^{\otimes 2}\; CZ\; X^{\otimes 2}\; H^{\otimes 2}.
\]

\textbf{2-Qubit Grover Circuit:}

\vspace{0.3cm}

The following circuit implements Grover's algorithm for 2 qubits:
\textbf{2-Qubit Grover Circuit:}

\[
\begin{quantikz}
Expand All @@ -146,13 +146,11 @@ \subsubsection*{2-Qubit Example}
\textbf{Explanation:}

\begin{itemize}
\item \textbf{Oracle:} The Oracle adds a phase of \(-1\) to the winner
\item \textbf{Oracle:} The Oracle adds a phase of \(-1\) to the winning
state \(\ket{11}\), effectively marking it.

\item \textbf{Diffusion Operator:} The diffusion circuit reflects all
amplitudes about the average. This inversion about the mean amplifies the
amplitude of the marked state while reducing that of all others.

\item \textbf{Diffusion Operator:} The diffusion circuit (implemented as
\(H\;X\;CZ\;X\;H\)) reflects all amplitudes about the average. This
inversion about the mean amplifies the amplitude of the marked state.
\end{itemize}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
Expand Down Expand Up @@ -188,10 +186,10 @@ \subsection*{Walkthrough of the Algorithm and Generalization to \(n\) Qubits}
\[
O\ket{x} = (-1)^{f(x)}\ket{x},
\]
(i.e., flip the phase of the marked state).\;

\quad (i.e., flip the phase of the marked state).\;
Apply the Diffusion Operator \( D = 2\ket{s}\bra{s} - I \) (which
reflects amplitudes about the average).\;
Apply the Diffusion Operator \( D = 2\ket{s}\bra{s} - I \)
(which reflects amplitudes about the average).\;
}

Measure the state in the computational basis to obtain \( x_0 \).\;
Expand All @@ -211,15 +209,13 @@ \subsection*{Walkthrough of the Algorithm and Generalization to \(n\) Qubits}
\(O\ket{w} = -\ket{w}\)).

\item \textbf{Diffusion (Inversion about the Mean):} This operator reflects
the state vector about the average amplitude. Geometrically, if you
visualize the amplitudes as vectors in the complex plane, the Oracle
rotates the winning state's amplitude by 180°, and the diffusion operator
then “pushes” this amplitude further away from the average, thereby
amplifying it.
the state vector about the average amplitude. Geometrically, one can
view the process as a rotation in a two-dimensional subspace (see
below).

\item \textbf{Iteration:} Repeating the Oracle and Diffusion steps
approximately \( \sqrt{2^n} \) times ensures that the probability
amplitude of the marked state is maximized.
approximately \( \sqrt{2^n} \) times amplifies the probability amplitude of
the marked state.

\item \textbf{Measurement:} Finally, a measurement in the computational
basis yields the marked element with high probability.
Expand Down

0 comments on commit d28095c

Please sign in to comment.