Added Tectonic.toml
This commit is contained in:
591
Advanced/Introduction to Quantum/src/parts/01 bits.tex
Normal file
591
Advanced/Introduction to Quantum/src/parts/01 bits.tex
Normal file
@ -0,0 +1,591 @@
|
||||
\section{Probabilistic Bits}
|
||||
|
||||
|
||||
\definition{}
|
||||
|
||||
As we already know, a \textit{classical bit} may take the values \texttt{0} and \texttt{1}. \par
|
||||
We can model this with a two-sided coin, one face of which is labeled \texttt{0}, and the other, \texttt{1}. \par
|
||||
|
||||
\vspace{2mm}
|
||||
|
||||
Of course, if we toss such a \say{bit-coin,} we'll get either \texttt{0} or \texttt{1}. \par
|
||||
We'll denote the probability of getting \texttt{0} as $p_0$, and the probability of getting \texttt{1} as $p_1$. \par
|
||||
As with all probabilities, $p_0 + p_1$ must be equal to 1.
|
||||
|
||||
|
||||
\vfill
|
||||
|
||||
|
||||
\definition{}
|
||||
|
||||
Say we toss a \say{bit-coin} and don't observe the result. We now have a \textit{probabilistic bit}, with a probability $p_0$
|
||||
of being \texttt{0}, and a probability $p_1$ of being \texttt{1}.
|
||||
|
||||
\vspace{2mm}
|
||||
|
||||
We'll represent this probabilistic bit's \textit{state} as a vector:
|
||||
$\left[\begin{smallmatrix}
|
||||
p_0 \\ p_1
|
||||
\end{smallmatrix}\right]$ \par
|
||||
We do \textbf{not} assume this coin is fair, and thus $p_0$ might not equal $p_1$.
|
||||
|
||||
\note{
|
||||
This may seem a bit redundant: since $p_0 + p_1$, we can always calculate one probability given the other. \\
|
||||
We'll still include both probabilities in the state vector, since this provides a clearer analogy to quantum bits.
|
||||
}
|
||||
|
||||
|
||||
\vfill
|
||||
|
||||
|
||||
\definition{}
|
||||
|
||||
The simplest probabilistic bit states are of course $[0]$ and $[1]$, defined as follows:
|
||||
\begin{itemize}
|
||||
\item $[0] = \left[\begin{smallmatrix} 1 \\ 0 \end{smallmatrix}\right]$
|
||||
\item $[1] = \left[\begin{smallmatrix} 0 \\ 1 \end{smallmatrix}\right]$
|
||||
\end{itemize}
|
||||
That is, $[0]$ represents a bit that we known to be \texttt{0}, \par
|
||||
and $[1]$ represents a bit we know to be \texttt{1}.
|
||||
|
||||
\vfill
|
||||
|
||||
|
||||
\definition{}
|
||||
$[0]$ and $[1]$ form a \textit{basis} for all possible probabilistic bit states: \par
|
||||
Every other probabilistic bit can be written as a \textit{linear combination} of $[0]$ and $[1]$:
|
||||
|
||||
\begin{equation*}
|
||||
\begin{bmatrix} p_0 \\ p_1 \end{bmatrix}
|
||||
=
|
||||
p_0 \begin{bmatrix} 1 \\ 0 \end{bmatrix} +
|
||||
p_1 \begin{bmatrix} 0 \\ 1 \end{bmatrix}
|
||||
=
|
||||
p_0 [0] + p_1 [1]
|
||||
\end{equation*}
|
||||
|
||||
|
||||
\vfill
|
||||
\pagebreak
|
||||
|
||||
\problem{}
|
||||
Every possible state of a probabilistic bit is a two-dimensional vector. \par
|
||||
Draw all possible states on the axis below.
|
||||
|
||||
|
||||
\begin{center}
|
||||
\begin{tikzpicture}[scale = 2.0]
|
||||
\fill[color = black] (0, 0) circle[radius=0.05];
|
||||
\node[below left] at (0, 0) {$\left[\begin{smallmatrix} 0 \\ 0 \end{smallmatrix}\right]$};
|
||||
|
||||
\draw[->] (0, 0) -- (1.2, 0);
|
||||
\node[right] at (1.2, 0) {$p_0$};
|
||||
\fill[color = oblue] (1, 0) circle[radius=0.05];
|
||||
\node[below] at (1, 0) {$[0]$};
|
||||
|
||||
\draw[->] (0, 0) -- (0, 1.2);
|
||||
\node[above] at (0, 1.2) {$p_1$};
|
||||
\fill[color = oblue] (0, 1) circle[radius=0.05];
|
||||
\node[left] at (0, 1) {$[1]$};
|
||||
\end{tikzpicture}
|
||||
\end{center}
|
||||
|
||||
\begin{solution}
|
||||
\begin{center}
|
||||
\begin{tikzpicture}[scale = 2.0]
|
||||
\fill[color = black] (0, 0) circle[radius=0.05];
|
||||
\node[below left] at (0, 0) {$\left[\begin{smallmatrix} 0 \\ 0 \end{smallmatrix}\right]$};
|
||||
|
||||
\draw[ored, -, line width = 2] (0, 1) -- (1, 0);
|
||||
|
||||
|
||||
\draw[->] (0, 0) -- (1.2, 0);
|
||||
\node[right] at (1.2, 0) {$p_0$};
|
||||
\fill[color = oblue] (1, 0) circle[radius=0.05];
|
||||
\node[below] at (1, 0) {$[0]$};
|
||||
|
||||
\draw[->] (0, 0) -- (0, 1.2);
|
||||
\node[above] at (0, 1.2) {$p_1$};
|
||||
\fill[color = oblue] (0, 1) circle[radius=0.05];
|
||||
\node[left] at (0, 1) {$[1]$};
|
||||
\end{tikzpicture}
|
||||
\end{center}
|
||||
\end{solution}
|
||||
|
||||
|
||||
\vfill
|
||||
\pagebreak
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
\section{Measuring Probabilistic Bits}
|
||||
|
||||
|
||||
\definition{}
|
||||
As we noted before, a probabilistic bit represents a coin we've tossed but haven't looked at. \par
|
||||
We do not know whether the bit is \texttt{0} or \texttt{1}, but we do know the probability of both of these outcomes. \par
|
||||
|
||||
\vspace{2mm}
|
||||
|
||||
If we \textit{measure} (or \textit{observe}) a probabilistic bit, we see either \texttt{0} or \texttt{1}---and thus our
|
||||
knowledge of its state is updated to either $[0]$ or $[1]$, since we now certainly know what face the coin landed on.
|
||||
|
||||
\vspace{2mm}
|
||||
|
||||
Since measurement changes what we know about a probabilistic bit, it changes the probabilistic bit's state.
|
||||
When we measure a bit, it's state \textit{collapses} to either $[0]$ or $[1]$, and the original state of the
|
||||
bit vanishes. We \textit{cannot} recover the state $[x_0, x_1]$ from a measured probabilistic bit.
|
||||
|
||||
|
||||
\definition{Multiple bits}
|
||||
Say we have two probabilistic bits, $x$ and $y$, \par
|
||||
with states
|
||||
$[x]=[ x_0, x_1]$
|
||||
and
|
||||
$[y]=[y_0, y_1]$
|
||||
|
||||
\vspace{2mm}
|
||||
|
||||
The \textit{compound state} of $[x]$ and $[y]$ is exactly what it sounds like: \par
|
||||
It is the probabilistic two-bit state $\ket{xy}$, where the probabilities of the first bit are
|
||||
determined by $[x]$, and the probabilities of the second are determined by $[y]$.
|
||||
|
||||
|
||||
|
||||
|
||||
\problem{}<firstcompoundstate>
|
||||
Say $[x] = [\nicefrac{2}{3}, \nicefrac{1}{3}]$ and $[y] = [\nicefrac{3}{4}, \nicefrac{1}{4}]$. \par
|
||||
\begin{itemize}[itemsep = 1mm]
|
||||
\item If we measure $x$ and $y$ simultaneously, \par
|
||||
what is the probability of getting each of \texttt{00}, \texttt{01}, \texttt{10}, and \texttt{11}?
|
||||
|
||||
|
||||
\item If we measure $y$ first and observe \texttt{1}, \par
|
||||
what is the probability of getting each of \texttt{00}, \texttt{01}, \texttt{10}, and \texttt{11}?
|
||||
\end{itemize}
|
||||
\note[Note]{$[x]$ and $[y]$ are column vectors, but I've written them horizontally to save space.}
|
||||
|
||||
|
||||
\vfill
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
\problem{}
|
||||
With $x$ and $y$ defined as above, find the probability of measuring each of \texttt{00}, \texttt{01}, \texttt{10}, and \texttt{11}.
|
||||
|
||||
\vfill
|
||||
|
||||
\problem{}
|
||||
Say $[x] = [\nicefrac{2}{3}, \nicefrac{1}{3}]$ and $[y] = [\nicefrac{3}{4}, \nicefrac{1}{4}]$. \par
|
||||
What is the probability that $x$ and $y$ produce different outcomes?
|
||||
|
||||
\vfill
|
||||
\pagebreak
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
\section{Tensor Products}
|
||||
|
||||
\definition{Tensor Products}
|
||||
The \textit{tensor product} of two vectors is defined as follows:
|
||||
\begin{equation*}
|
||||
\begin{bmatrix}
|
||||
x_1 \\ x_2
|
||||
\end{bmatrix}
|
||||
\otimes
|
||||
\begin{bmatrix}
|
||||
y_1 \\ y_2
|
||||
\end{bmatrix}
|
||||
=
|
||||
\begin{bmatrix}
|
||||
x_1
|
||||
\begin{bmatrix}
|
||||
y_1 \\ y_2
|
||||
\end{bmatrix}
|
||||
|
||||
\\[4mm]
|
||||
|
||||
x_2
|
||||
\begin{bmatrix}
|
||||
y_1 \\ y_2
|
||||
\end{bmatrix}
|
||||
\end{bmatrix}
|
||||
=
|
||||
\begin{bmatrix}
|
||||
x_1y_1 \\[1mm]
|
||||
x_1y_2 \\[1mm]
|
||||
x_2y_1 \\[1mm]
|
||||
x_2y_2 \\[0.5mm]
|
||||
\end{bmatrix}
|
||||
\end{equation*}
|
||||
|
||||
|
||||
That is, we take our first vector, multiply the second
|
||||
vector by each of its components, and stack the result.
|
||||
You could think of this as a generalization of scalar
|
||||
mulitiplication, where scalar mulitiplication is a
|
||||
tensor product with a vector in $\mathbb{R}^1$:
|
||||
\begin{equation*}
|
||||
a
|
||||
\begin{bmatrix}
|
||||
x_1 \\ x_2
|
||||
\end{bmatrix}
|
||||
=
|
||||
\begin{bmatrix}
|
||||
a_1
|
||||
\end{bmatrix}
|
||||
\otimes
|
||||
\begin{bmatrix}
|
||||
y_1 \\ y_2
|
||||
\end{bmatrix}
|
||||
=
|
||||
\begin{bmatrix}
|
||||
a_1
|
||||
\begin{bmatrix}
|
||||
y_1 \\ y_2
|
||||
\end{bmatrix}
|
||||
\end{bmatrix}
|
||||
=
|
||||
\begin{bmatrix}
|
||||
a_1y_1 \\[1mm]
|
||||
a_1y_2
|
||||
\end{bmatrix}
|
||||
\end{equation*}
|
||||
|
||||
\problem{}
|
||||
Say $x \in \mathbb{R}^n$ and $y \in \mathbb{R}^m$. \par
|
||||
What is the dimension of $x \otimes y$?
|
||||
|
||||
\vfill
|
||||
|
||||
\problem{}<basistp>
|
||||
What is the pairwise tensor product
|
||||
$
|
||||
\Bigl\{
|
||||
\left[
|
||||
\begin{smallmatrix}
|
||||
1 \\ 0 \\ 0
|
||||
\end{smallmatrix}
|
||||
\right],
|
||||
\left[
|
||||
\begin{smallmatrix}
|
||||
0 \\ 1 \\ 0
|
||||
\end{smallmatrix}
|
||||
\right],
|
||||
\left[
|
||||
\begin{smallmatrix}
|
||||
0 \\ 0 \\ 1
|
||||
\end{smallmatrix}
|
||||
\right]
|
||||
\Bigr\}
|
||||
\otimes
|
||||
\Bigl\{
|
||||
\left[
|
||||
\begin{smallmatrix}
|
||||
1 \\ 0
|
||||
\end{smallmatrix}
|
||||
\right],
|
||||
\left[
|
||||
\begin{smallmatrix}
|
||||
0 \\ 1
|
||||
\end{smallmatrix}
|
||||
\right]
|
||||
\Bigr\}
|
||||
$?
|
||||
|
||||
\note{in other words, distribute the tensor product between every pair of vectors.}
|
||||
|
||||
\vfill
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
\problem{}
|
||||
What is the \textit{span} of the vectors we found in \ref{basistp}? \par
|
||||
In other words, what is the set of vectors that can be written as linear combinations of the vectors above?
|
||||
|
||||
\vfill
|
||||
|
||||
Look through the above problems and convince yourself of the following fact: \par
|
||||
If $a$ is a basis of $A$ and $b$ is a basis of $B$, $a \otimes b$ is a basis of $A \times B$. \par
|
||||
\note{If you don't understand what this says, ask an instructor. \\ This is the reason we did the last few problems!}
|
||||
|
||||
\begin{instructornote}
|
||||
\textbf{The idea here is as follows:}
|
||||
|
||||
If $a$ is in $\{\texttt{0}, \texttt{1}\}$ and $b$ is in $\{\texttt{0}, \texttt{1}\}$,
|
||||
the values $ab$ can take are
|
||||
$\{\texttt{0}, \texttt{1}\} \times \{\texttt{0}, \texttt{1}\} = \{\texttt{00}, \texttt{01}, \texttt{10}, \texttt{11}\}$.
|
||||
|
||||
\vspace{2mm}
|
||||
|
||||
The same is true of any other state set: if $a$ takes values in $A$ and $b$ takes values in $B$, \par
|
||||
the compound state $(a,b)$ takes values in $A \times B$.
|
||||
|
||||
\vspace{2mm}
|
||||
|
||||
We would like to do the same with probabilistic bits. \par
|
||||
Given bits $\ket{a}$ and $\ket{b}$, how should we represent the state of $\ket{ab}$?
|
||||
\end{instructornote}
|
||||
|
||||
\pagebreak
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
\problem{}
|
||||
Say $[x] = [\nicefrac{2}{3}, \nicefrac{1}{3}]$ and $[y] = [\nicefrac{3}{4}, \nicefrac{1}{4}]$. \par
|
||||
What is $[x] \otimes [y]$? How does this relate to \ref{firstcompoundstate}?
|
||||
|
||||
\vfill
|
||||
|
||||
|
||||
|
||||
\problem{}
|
||||
The compound state of two vector-form bits is their tensor product. \par
|
||||
Compute the following. Is the result what we'd expect?
|
||||
\begin{itemize}
|
||||
\item $[0] \otimes [0]$
|
||||
\item $[0] \otimes [1]$
|
||||
\item $[1] \otimes [0]$
|
||||
\item $[1] \otimes [1]$
|
||||
\end{itemize}
|
||||
\hint{
|
||||
Remember that
|
||||
$[0] = \left[\begin{smallmatrix} 1 \\ 0 \end{smallmatrix}\right]$
|
||||
and
|
||||
$[1] = \left[\begin{smallmatrix} 0 \\ 1 \end{smallmatrix}\right]$.
|
||||
}
|
||||
|
||||
|
||||
\vfill
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
\problem{}<fivequant>
|
||||
Of course, writing $[0] \otimes [1]$ is a bit excessive. We'll shorten this notation to $[01]$. \par
|
||||
|
||||
\vspace{2mm}
|
||||
|
||||
In fact, we could go further: if we wanted to write the set of bits $[1] \otimes [1] \otimes [0] \otimes [1]$, \par
|
||||
we could write $[1101]$---but a shorter alternative is $[13]$, since $13$ is \texttt{1101} in binary.
|
||||
|
||||
\vspace{2mm}
|
||||
|
||||
Write $[5]$ as three-bit probabilistic state. \par
|
||||
|
||||
\begin{solution}
|
||||
$[5] = [101] = [1] \otimes [0] \otimes [1] = [0,0,0,0,0,1,0,0]^T$ \par
|
||||
Notice how we're counting from the top, with $[000] = [1,0,...,0]$ and $[111] = [0, ..., 0, 1]$.
|
||||
\end{solution}
|
||||
|
||||
\vfill
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
\problem{}
|
||||
Write the three-bit states $[0]$ through $[7]$ as column vectors. \par
|
||||
\hint{You do not need to compute every tensor product. Do a few and find the pattern.}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
\vfill
|
||||
\pagebreak
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
\section{Operations on Probabilistic Bits}
|
||||
|
||||
Now that we can write probabilistic bits as vectors, we can represent operations on these bits
|
||||
with linear transformations---in other words, as matrices.
|
||||
|
||||
\definition{}
|
||||
Consider the NOT gate, which operates as follows: \par
|
||||
\begin{itemize}
|
||||
\item $\text{NOT}[0] = [1]$
|
||||
\item $\text{NOT}[1] = [0]$
|
||||
\end{itemize}
|
||||
What should NOT do to a probabilistic bit $[x_0, x_1]$? \par
|
||||
If we return to our coin analogy, we can think of the NOT operation as
|
||||
flipping a coin we have already tossed, without looking at it's state.
|
||||
Thus,
|
||||
\begin{equation*}
|
||||
\text{NOT} \begin{bmatrix}
|
||||
x_0 \\ x_1
|
||||
\end{bmatrix} = \begin{bmatrix}
|
||||
x_1 \\ x_0
|
||||
\end{bmatrix}
|
||||
\end{equation*}
|
||||
|
||||
|
||||
\begin{ORMCbox}{Review: Matrix Multiplication}{black!10!white}{black!65!white}
|
||||
Matrix multiplication works as follows:
|
||||
|
||||
\begin{equation*}
|
||||
AB =
|
||||
\begin{bmatrix}
|
||||
1 & 2 \\
|
||||
3 & 4 \\
|
||||
\end{bmatrix}
|
||||
\begin{bmatrix}
|
||||
a_0 & b_0 \\
|
||||
a_1 & b_1 \\
|
||||
\end{bmatrix}
|
||||
=
|
||||
\begin{bmatrix}
|
||||
1a_0 + 2a_1 & 1b_0 + 2b_1 \\
|
||||
3a_0 + 4a_1 & 3b_0 + 4b_1 \\
|
||||
\end{bmatrix}
|
||||
\end{equation*}
|
||||
|
||||
|
||||
Note that this is very similar to multiplying each column of $B$ by $A$. \par
|
||||
The product $AB$ is simply $Ac$ for every column $c$ in $B$:
|
||||
|
||||
\begin{equation*}
|
||||
Ac_0 =
|
||||
\begin{bmatrix}
|
||||
1 & 2 \\
|
||||
3 & 4 \\
|
||||
\end{bmatrix}
|
||||
\begin{bmatrix}
|
||||
a_0 \\ a_1
|
||||
\end{bmatrix}
|
||||
=
|
||||
\begin{bmatrix}
|
||||
1a_0 + 2a_1 \\
|
||||
3a_0 + 4a_1
|
||||
\end{bmatrix}
|
||||
\end{equation*}
|
||||
|
||||
This is exactly the first column of the matrix product. \par
|
||||
Also, note that each element of $Ac_0$ is the dot product of a row in $A$ and a column in $c_0$.
|
||||
\end{ORMCbox}
|
||||
|
||||
\problem{}
|
||||
Compute the following product:
|
||||
\begin{equation*}
|
||||
\begin{bmatrix}
|
||||
1 & 0.5 \\ 0 & 1
|
||||
\end{bmatrix}
|
||||
\begin{bmatrix}
|
||||
3 \\ 2
|
||||
\end{bmatrix}
|
||||
\end{equation*}
|
||||
|
||||
|
||||
\vfill
|
||||
|
||||
\generic{Remark:}
|
||||
Also, recall that every matrix is linear map, and that every linear map may be written as a matrix. \par
|
||||
We often use the terms \textit{matrix}, \textit{transformation}, and \textit{linear map} interchangably.
|
||||
|
||||
\pagebreak
|
||||
|
||||
|
||||
\problem{}
|
||||
Find the matrix that represents the NOT operation on one probabilistic bit.
|
||||
|
||||
\begin{solution}
|
||||
\begin{equation*}
|
||||
\begin{bmatrix}
|
||||
0 & 1 \\ 1 & 0
|
||||
\end{bmatrix}
|
||||
\end{equation*}
|
||||
\end{solution}
|
||||
|
||||
\vfill
|
||||
|
||||
|
||||
\problem{Extension by linearity}
|
||||
Say we have an arbitrary operation $A$. \par
|
||||
If we know how $A$ acts on $[1]$ and $[0]$, can we compute $A[x]$ for an arbitrary state $[x]$? \par
|
||||
Say $[x] = [x_0, x_1]$.
|
||||
\begin{itemize}
|
||||
\item What is the probability we observe $0$ when we measure $x$?
|
||||
\item What is the probability that we observe $M[0]$ when we measure $Mx$?
|
||||
\end{itemize}
|
||||
|
||||
\vfill
|
||||
|
||||
\problem{}<linearextension>
|
||||
Write $M[x_0, x_1]$ in terms of $M[0]$, $M[1]$, $x_0$, and $x_1$.
|
||||
|
||||
|
||||
\begin{solution}
|
||||
\begin{equation*}
|
||||
M \begin{bmatrix}
|
||||
x_0 \\ x_1
|
||||
\end{bmatrix}
|
||||
=
|
||||
x_0 M \begin{bmatrix}
|
||||
1 \\ 0
|
||||
\end{bmatrix}
|
||||
+
|
||||
x_1 M \begin{bmatrix}
|
||||
0 \\ 1
|
||||
\end{bmatrix}
|
||||
=
|
||||
x_0 M [0] +
|
||||
x_1 M [1]
|
||||
\end{equation*}
|
||||
\end{solution}
|
||||
|
||||
|
||||
|
||||
\vfill
|
||||
|
||||
\generic{Remark:}
|
||||
Every matrix represents a \textit{linear} map, so the following is always true:
|
||||
\begin{equation*}
|
||||
A \times (px + qy) = pAx + qAy
|
||||
\end{equation*}
|
||||
\ref{linearextension} is just a special case of this fact.
|
||||
|
||||
\pagebreak
|
347
Advanced/Introduction to Quantum/src/parts/02 qubit.tex
Normal file
347
Advanced/Introduction to Quantum/src/parts/02 qubit.tex
Normal file
@ -0,0 +1,347 @@
|
||||
\section{One Qubit}
|
||||
|
||||
Quantum bits (or \textit{qubits}) are very similar to probabilistic bits, but have one major difference: \par
|
||||
probabilities are replaced with \textit{amplitudes}.
|
||||
|
||||
\vspace{2mm}
|
||||
Of course, a qubit can take the values \texttt{0} and \texttt{1}, which are denoted $\ket{0}$ and $\ket{1}$. \par
|
||||
Like probabilistic bits, a quantum bit is written as a linear combination of $\ket{0}$ and $\ket{1}$:
|
||||
\begin{equation*}
|
||||
\ket{\psi} = \psi_0\ket{0} + \psi_1\ket{1}
|
||||
\end{equation*}
|
||||
Such linear combinations are called \textit{superpositions}.
|
||||
|
||||
\vspace{2mm}
|
||||
|
||||
The $\ket{~}$ you see in the expressions above is called a \say{ket,} and denotes a column vector. \par
|
||||
$\ket{0}$ is pronounced \say{ket zero,} and $\ket{1}$ is pronounced \say{ket one.} This is called bra-ket notation. \par
|
||||
\note[Note]{$\bra{0}$ is called a \say{bra,} but we won't worry about that for now.}
|
||||
|
||||
\vspace{2mm}
|
||||
This is very similiar to the \say{box} $[~]$ notation we used for probabilistic bits. \par
|
||||
As before, we will write $\ket{0} = \left[\begin{smallmatrix} 1 \\ 0 \end{smallmatrix}\right]$
|
||||
and $\ket{1} = \left[\begin{smallmatrix} 0 \\ 1 \end{smallmatrix}\right]$.
|
||||
|
||||
|
||||
\vspace{8mm}
|
||||
|
||||
Recall that probabilistic bits are subject to the restriction that $p_0 + p_1 = 1$. \par
|
||||
Quantum bits have a similar condition: $\psi_0^2 + \psi_1^2 = 1$. \par
|
||||
Note that this implies that $\psi_0$ and $\psi_1$ are both in $[-1, 1]$. \par
|
||||
Quantum amplitudes may be negative, but probabilistic bit probabilities cannot.
|
||||
|
||||
\vspace{2mm}
|
||||
|
||||
If we plot the set of valid quantum states on our plane, we get a unit circle centered at the origin:
|
||||
|
||||
\begin{center}
|
||||
\begin{tikzpicture}[scale=1.5]
|
||||
\draw[dashed] (0,0) circle(1);
|
||||
|
||||
\fill[color = black] (0, 0) circle[radius=0.05];
|
||||
|
||||
\draw[->] (0, 0) -- (1.2, 0);
|
||||
\fill[color = oblue] (1, 0) circle[radius=0.05];
|
||||
\node[below right] at (1, 0) {$\ket{0}$};
|
||||
|
||||
\draw[->] (0, 0) -- (0, 1.2);
|
||||
\fill[color = oblue] (0, 1) circle[radius=0.05];
|
||||
\node[above left] at (0, 1) {$\ket{1}$};
|
||||
|
||||
\fill[color = ored] (0.87, 0.5) circle[radius=0.05];
|
||||
\node[above right] at (0.87, 0.5) {$\ket{\psi}$};
|
||||
\end{tikzpicture}
|
||||
\end{center}
|
||||
|
||||
|
||||
|
||||
Recall that the set of probabilistic bits forms a line instead:
|
||||
|
||||
|
||||
\begin{center}
|
||||
\begin{tikzpicture}[scale = 1.5]
|
||||
\fill[color = black] (0, 0) circle[radius=0.05];
|
||||
\node[below left] at (0, 0) {$\left[\begin{smallmatrix} 0 \\ 0 \end{smallmatrix}\right]$};
|
||||
|
||||
\draw[ored, -, line width = 2] (0, 1) -- (1, 0);
|
||||
|
||||
|
||||
\draw[->] (0, 0) -- (1.2, 0);
|
||||
\node[right] at (1.2, 0) {$p_0$};
|
||||
\fill[color = oblue] (1, 0) circle[radius=0.05];
|
||||
\node[below] at (1, 0) {$[0]$};
|
||||
|
||||
\draw[->] (0, 0) -- (0, 1.2);
|
||||
\node[above] at (0, 1.2) {$p_1$};
|
||||
\fill[color = oblue] (0, 1) circle[radius=0.05];
|
||||
\node[left] at (0, 1) {$[1]$};
|
||||
\end{tikzpicture}
|
||||
\end{center}
|
||||
|
||||
|
||||
\problem{}
|
||||
In the above unit circle, the counterclockwise angle from $\ket{0}$ to $\ket{\psi}$ is $30^\circ$\hspace{-1ex}. \par
|
||||
Write $\ket{\psi}$ as a linear combination of $\ket{0}$ and $\ket{1}$.
|
||||
|
||||
|
||||
\vfill
|
||||
\pagebreak
|
||||
|
||||
|
||||
\definition{Measurement I}
|
||||
Just like a probabilistic bit, we must observed $\ket{0}$ or $\ket{1}$ when we measure a qubit. \par
|
||||
If we were to measure $\ket{\psi} = \psi_0\ket{0} + \psi_1\ket{1}$, we'd observe either $\ket{0}$ or $\ket{1}$, \par
|
||||
with the following probabilities:
|
||||
\begin{itemize}[itemsep = 2mm, topsep = 2mm]
|
||||
\item $\mathcal{P}(\ket{1}) = \psi_1^2$
|
||||
\item $\mathcal{P}(\ket{0}) = \psi_0^2$
|
||||
\end{itemize}
|
||||
\note{Note that $\mathcal{P}(\ket{0}) + \mathcal{P}(\ket{1}) = 1$.}
|
||||
|
||||
|
||||
\vspace{2mm}
|
||||
|
||||
As before, $\ket{\psi}$ \textit{collapses} when it is measured: its state becomes that which we observed in our measurement,
|
||||
leaving no trace of the previous superposition. \par
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
\problem{}
|
||||
\begin{itemize}
|
||||
\item What is the probability we observe $\ket{0}$ when we measure $\ket{\psi}$? \par
|
||||
\item What can we observe if we measure $\ket{\psi}$ a second time? \par
|
||||
\item What are these probabilities for $\ket{\varphi}$?
|
||||
\end{itemize}
|
||||
|
||||
|
||||
|
||||
\begin{center}
|
||||
\begin{tikzpicture}[scale=1.5]
|
||||
\draw[dashed] (0,0) circle(1);
|
||||
|
||||
\fill[color = black] (0, 0) circle[radius=0.05];
|
||||
|
||||
\draw[->] (0, 0) -- (1.2, 0);
|
||||
\fill[color = oblue] (1, 0) circle[radius=0.05];
|
||||
\node[below right] at (1, 0) {$\ket{0}$};
|
||||
|
||||
\draw[->] (0, 0) -- (0, 1.2);
|
||||
\fill[color = oblue] (0, 1) circle[radius=0.05];
|
||||
\node[above left] at (0, 1) {$\ket{1}$};
|
||||
|
||||
\draw[dotted] (0, 0) -- (0.87, 0.5);
|
||||
\draw[color=gray,->] (0.5, 0.0) arc (0:30:0.5);
|
||||
\node[right, color=gray] at (0.47, 0.12) {$30^\circ$};
|
||||
\fill[color = ored] (0.87, 0.5) circle[radius=0.05];
|
||||
\node[above right] at (0.87, 0.5) {$\ket{\psi}$};
|
||||
|
||||
|
||||
\draw[dotted] (0, 0) -- (-0.707, -0.707);
|
||||
\draw[color=gray,->] (0.25, 0.0) arc (0:-135:0.25);
|
||||
\node[below, color=gray] at (0.2, -0.2) {$135^\circ$};
|
||||
\fill[color = ored] (-0.707, -0.707) circle[radius=0.05];
|
||||
\node[below left] at (-0.707, -0.707) {$\ket{\varphi}$};
|
||||
\end{tikzpicture}
|
||||
\end{center}
|
||||
|
||||
|
||||
|
||||
\vfill
|
||||
|
||||
As you may have noticed, we don't need two coordinates to fully define a quibit's state. \par
|
||||
We can get by with one coordinate just as well.
|
||||
|
||||
Instead of referring to each state using its cartesian coordinates $\psi_0$ and $\psi_1$, \par
|
||||
we can address it using its \textit{polar angle} $\theta$, measured from $\ket{0}$ counterclockwise:
|
||||
|
||||
\begin{center}
|
||||
\begin{tikzpicture}[scale=1.5]
|
||||
\draw[dashed] (0,0) circle(1);
|
||||
\fill[color = black] (0, 0) circle[radius=0.05];
|
||||
|
||||
\draw[dotted] (0, 0) -- (0.707, 0.707);
|
||||
\draw[color=gray,->] (0.5, 0.0) arc (0:45:0.5);
|
||||
\node[above right, color=gray] at (0.5, 0) {$\theta$};
|
||||
|
||||
\draw[->] (0, 0) -- (1.2, 0);
|
||||
\fill[color = oblue] (1, 0) circle[radius=0.05];
|
||||
\node[below right] at (1, 0) {$\ket{0}$};
|
||||
|
||||
\draw[->] (0, 0) -- (0, 1.2);
|
||||
\fill[color = oblue] (0, 1) circle[radius=0.05];
|
||||
\node[above left] at (0, 1) {$\ket{1}$};
|
||||
|
||||
\fill[color = ored] (0.707, 0.707) circle[radius=0.05];
|
||||
\node[above right] at (0.707, 0.707) {$\ket{\psi}$};
|
||||
\end{tikzpicture}
|
||||
\end{center}
|
||||
|
||||
|
||||
\problem{}
|
||||
Find $\psi_0$ and $\psi_1$ in terms of $\theta$ for an arbitrary qubit $\psi$.
|
||||
|
||||
|
||||
\vfill
|
||||
\pagebreak
|
||||
|
||||
|
||||
\problem{}
|
||||
Consider the following qubit states:
|
||||
|
||||
\null\hfill\begin{minipage}{0.48\textwidth}
|
||||
\begin{equation*}
|
||||
\ket{+} = \frac{\ket{0} + \ket{1}}{\sqrt{2}}
|
||||
\end{equation*}
|
||||
\end{minipage}\hfill\begin{minipage}{0.48\textwidth}
|
||||
\begin{equation*}
|
||||
\ket{-} = \frac{\ket{0} - \ket{1}}{\sqrt{2}}
|
||||
\end{equation*}
|
||||
\end{minipage}\hfill\null
|
||||
|
||||
\begin{itemize}
|
||||
\item Where are these on the unit circle?
|
||||
\item What are their polar angles?
|
||||
\item What are the probabilities of observing $\ket{0}$ and $\ket{1}$ when measuring $\ket{+}$ and $\ket{-}$?
|
||||
\end{itemize}
|
||||
|
||||
\vfill
|
||||
|
||||
\begin{center}
|
||||
\begin{tikzpicture}[scale = 2.5]
|
||||
\draw[dashed] (0,0) circle(1);
|
||||
\fill[color = black] (0, 0) circle[radius=0.05];
|
||||
|
||||
\draw[->] (0, 0) -- (1.2, 0);
|
||||
\fill[color = oblue] (1, 0) circle[radius=0.05];
|
||||
\node[below right] at (1, 0) {$\ket{0}$};
|
||||
|
||||
\draw[->] (0, 0) -- (0, 1.2);
|
||||
\fill[color = oblue] (0, 1) circle[radius=0.05];
|
||||
\node[above left] at (0, 1) {$\ket{1}$};
|
||||
\end{tikzpicture}
|
||||
\end{center}
|
||||
|
||||
\vfill
|
||||
\vfill
|
||||
\pagebreak
|
||||
|
||||
|
||||
\section{Operations on One Qubit}
|
||||
|
||||
We may apply transformations to qubits just as we apply transformations to probabilistic bits.
|
||||
Again, we'll represent transformations as $2 \times 2$ matrices, since we want to map
|
||||
one qubit state to another. \par
|
||||
\note{In other words, we want to map elements of $\mathbb{R}^2$ to elements of $\mathbb{R}^2$.} \par
|
||||
We will call such maps \textit{quantum gates,} since they are the quantum equivalent of classical logic gates.
|
||||
|
||||
|
||||
\vspace{2mm}
|
||||
|
||||
There are two conditions a valid quantum gate $G$ must satisfy:
|
||||
\begin{itemize}[itemsep = 1mm]
|
||||
\item For any valid state $\ket{\psi}$, $G\ket{\psi}$ is a valid state. \par
|
||||
Namely, $G$ must preserve the length of any vector it is applied to. \par
|
||||
Recall that the set of valid quantum states is the set of unit vectors in $\mathbb{R}^2$
|
||||
|
||||
\item Any quantum gate must be \textit{invertible}. \par
|
||||
We'll skip this condition for now, and return to it later.
|
||||
\end{itemize}
|
||||
In short, a quantum gate is a linear map that maps the unit circle to itself. \par
|
||||
There are only two kinds of linear maps that do this: reflections and rotations.
|
||||
|
||||
\problem{}
|
||||
The $X$ gate is the quantum analog of the \texttt{not} gate, defined by the following table:
|
||||
\begin{itemize}
|
||||
\item $X\ket{0} = \ket{1}$
|
||||
\item $X\ket{1} = \ket{0}$
|
||||
\end{itemize}
|
||||
Find the matrix $X$.
|
||||
|
||||
\begin{solution}
|
||||
\begin{equation*}
|
||||
\begin{bmatrix}
|
||||
0 & 1 \\ 1 & 0
|
||||
\end{bmatrix}
|
||||
\end{equation*}
|
||||
\end{solution}
|
||||
|
||||
\vfill
|
||||
|
||||
\problem{}
|
||||
What is $X\ket{+}$ and $X\ket{-}$? \par
|
||||
\hint{Remember that all matrices are linear maps. What does this mean?}
|
||||
|
||||
\begin{solution}
|
||||
$X\ket{+} = \ket{+}$ and $X\ket{-} = -\ket{-}$ (that is, negative ket-minus). \par
|
||||
Most notably, remember that $G(a\ket{0} + b\ket{1}) = aG\ket{0} + bG\ket{1}$
|
||||
\end{solution}
|
||||
|
||||
\vfill
|
||||
|
||||
|
||||
\problem{}
|
||||
In terms of geometric transformations, what does $X$ do to the unit circle?
|
||||
|
||||
\begin{solution}
|
||||
It is a reflection about the $45^\circ$ axis.
|
||||
\end{solution}
|
||||
|
||||
\vfill
|
||||
\pagebreak
|
||||
|
||||
|
||||
\problem{}
|
||||
Let $Z$ be a quantum gate defined by the following table: \par
|
||||
\begin{itemize}
|
||||
\item $Z\ket{0} = \ket{0}$,
|
||||
\item $Z\ket{1} = -\ket{1}$.
|
||||
\end{itemize}
|
||||
What is the matrix $Z$? What are $Z\ket{+}$ and $Z\ket{-}$? \par
|
||||
What is $Z$ as a geometric transformation?
|
||||
|
||||
\vfill
|
||||
|
||||
\problem{}
|
||||
Is the map $B$ defined by the table below a valid quantum gate?
|
||||
\begin{itemize}
|
||||
\item $B\ket{0} = \ket{0}$
|
||||
\item $B\ket{1} = \ket{+}$
|
||||
\end{itemize}
|
||||
\hint{Find a $\ket{\psi}$ so that $B\ket{\psi}$ is not a valid qubit state}
|
||||
|
||||
\begin{solution}
|
||||
$B\ket{+} = \frac{1 + \sqrt{2}}{2}\ket{0} + \frac{1}{2}\ket{1}$, which has a non-unit length of $\frac{\sqrt{2} + 1}{\sqrt{2}}$.
|
||||
\end{solution}
|
||||
|
||||
\vfill
|
||||
|
||||
|
||||
|
||||
\problem{Rotation}
|
||||
As we noted earlier, any rotation about the center is a valid quantum gate. \par
|
||||
Let's derive all transformations of this form.
|
||||
\begin{itemize}[itemsep = 1mm]
|
||||
\item Let $U_\phi$ be the matrix that represents a counterclockwise rotation of $\phi$ degrees. \par
|
||||
What is $U\ket{0}$ and $U\ket{1}$?
|
||||
|
||||
\item Find the matrix $U_\phi$ for an arbitrary $\phi$.
|
||||
\end{itemize}
|
||||
|
||||
\vfill
|
||||
|
||||
|
||||
\problem{}
|
||||
Say we have a qubit that is either $\ket{+}$ or $\ket{-}$. We do not know which of the two states it is in. \par
|
||||
Using one operation and one measurement, how can we find out, for certain, which qubit we received? \par
|
||||
|
||||
\vfill
|
||||
\pagebreak
|
145
Advanced/Introduction to Quantum/src/parts/03 two qubits.tex
Normal file
145
Advanced/Introduction to Quantum/src/parts/03 two qubits.tex
Normal file
@ -0,0 +1,145 @@
|
||||
\section{Two Qubits}
|
||||
|
||||
|
||||
\definition{}
|
||||
Just as before, we'll represent multi-quibit states as linear combinations of multi-qubit basis states. \par
|
||||
For example, a two-qubit state $\ket{ab}$ is the four-dimensional unit vector
|
||||
\begin{equation}
|
||||
\begin{bmatrix}
|
||||
a \\ b \\ c \\ d
|
||||
\end{bmatrix}
|
||||
= a \ket{00} + b\ket{01} + c\ket{10} + d\ket{11}
|
||||
\end{equation}
|
||||
|
||||
As always, multi-qubit states are unit vectors. \par
|
||||
Thus, $a^2 + b^2 + c^2 + d^2 = 1$ in the two-bit case above.
|
||||
|
||||
|
||||
\problem{}
|
||||
Say we have two qubits $\ket{\psi}$ and $\ket{\varphi}$. \par
|
||||
Show that $\ket{\psi} \otimes \ket{\varphi}$ is always a unit vector (and is thus a valid quantum state).
|
||||
|
||||
\vfill
|
||||
|
||||
|
||||
\definition{Measurement II}<measureii>
|
||||
Measurement of a two-qubit state works just like measurement of a one-qubit state: \par
|
||||
If we measure $a\ket{00} + b\ket{01} + c\ket{10} + d\ket{11}$, \par
|
||||
we get one of the four basis states with the following probabilities:
|
||||
|
||||
\begin{itemize}
|
||||
\item $\mathcal{P}(\ket{00}) = a^2$
|
||||
\item $\mathcal{P}(\ket{01}) = b^2$
|
||||
\item $\mathcal{P}(\ket{10}) = c^2$
|
||||
\item $\mathcal{P}(\ket{11}) = d^2$
|
||||
\end{itemize}
|
||||
Of course, the sum of all the above probabilities is $1$.
|
||||
|
||||
|
||||
\problem{}
|
||||
Consider the two-qubit state
|
||||
$\ket{\psi} = \frac{1}{\sqrt{2}} \ket{00} + \frac{1}{2} \ket{01} + \frac{\sqrt{3}}{4} \ket{10} + \frac{1}{4} \ket{11}$
|
||||
|
||||
\begin{itemize}[itemsep=2mm]
|
||||
\item If we measure both bits of $\ket{\psi}$ simultaneously, \par
|
||||
what is the probability of getting each of $\ket{00}$, $\ket{01}$, $\ket{10}$, and $\ket{11}$?
|
||||
|
||||
\item If we measure the ONLY the first qubit, what is the probability we get $\ket{0}$? How about $\ket{1}$? \par
|
||||
\hint{There are two basis states in which the first qubit is $\ket{0}$.}
|
||||
|
||||
\item Say we measured the second bit and read $\ket{1}$. \par
|
||||
If we now measure the first bit, what is the probability of getting $\ket{0}$?
|
||||
\end{itemize}
|
||||
|
||||
|
||||
|
||||
\vfill
|
||||
\pagebreak
|
||||
|
||||
\problem{}
|
||||
Again, consider the two-qubit state
|
||||
$\ket{\psi} = \frac{1}{\sqrt{2}} \ket{00} + \frac{1}{2} \ket{01} + \frac{\sqrt{3}}{4} \ket{10} + \frac{1}{4} \ket{11}$ \par
|
||||
If we measure the first qubit of $\ket{\psi}$ and get $\ket{0}$, what is the resulting state of $\ket{\psi}$? \par
|
||||
What would the state be if we'd measured $\ket{1}$ instead?
|
||||
|
||||
\vfill
|
||||
|
||||
\problem{}
|
||||
Consider the three-qubit state $\ket{\psi} = c_0\ket{000} + c_1\ket{001} + ... + c_7 \ket{111}$. \par
|
||||
Say we measure the first two qubits and get $\ket{00}$. What is the resulting state of $\ket{\psi}$?
|
||||
|
||||
\begin{solution}
|
||||
We measure $\ket{00}$ with probability $c_0^2 + c_1^2$, and $\ket{\psi}$ collapses to
|
||||
\begin{equation*}
|
||||
\frac{c_0\ket{000} + c_1\ket{001}}{\sqrt{c_0^2 + c_1^2}}
|
||||
\end{equation*}
|
||||
\end{solution}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
\vfill
|
||||
\pagebreak
|
||||
|
||||
|
||||
|
||||
\definition{Entanglement}
|
||||
Some product states can be factored into a tensor product of individual qubit states. For example,
|
||||
\begin{equation*}
|
||||
\frac{1}{2} \bigl(\ket{00} + \ket{01} + \ket{10} + \ket{11}\bigr)
|
||||
= \frac{1}{\sqrt{2}}\bigl( \ket{0} + \ket{1} \bigr) \otimes
|
||||
\frac{1}{\sqrt{2}}\bigl( \ket{0} - \ket{1} \bigr)
|
||||
\end{equation*}
|
||||
Such states are called \textit{product states.} States that aren't product states are called \textit{entangled} states.
|
||||
|
||||
\problem{}
|
||||
Factor the following product state:
|
||||
\begin{equation*}
|
||||
\frac{1}{2\sqrt{2}} \bigl(\sqrt{3}\ket{00} - \sqrt{3}\ket{01} + \ket{10} - \ket{11}\bigr)
|
||||
\end{equation*}
|
||||
|
||||
\begin{solution}
|
||||
\begin{equation*}
|
||||
\frac{1}{2\sqrt{2}} \biggl(\sqrt{3}\ket{00} - \sqrt{3}\ket{01} + \ket{10} - \ket{11}\biggr)
|
||||
= \biggl( \frac{\sqrt{3}}{2}\ket{0} + \frac{1}{2}\ket{1} \biggr) \otimes
|
||||
\biggl(\frac{1}{\sqrt{2}}\ket{0} - \frac{1}{\sqrt{2}}\ket{1} \biggr)
|
||||
\end{equation*}
|
||||
\end{solution}
|
||||
|
||||
|
||||
\vfill
|
||||
|
||||
\problem{}
|
||||
Show that the following is an entangled state.
|
||||
\begin{equation*}
|
||||
\frac{1}{\sqrt{2}}\ket{00} + \frac{1}{\sqrt{2}}\ket{11}
|
||||
\end{equation*}
|
||||
|
||||
\begin{solution}
|
||||
$
|
||||
\left[
|
||||
\begin{smallmatrix}
|
||||
a_0 \\ a_1
|
||||
\end{smallmatrix}
|
||||
\right]
|
||||
\otimes
|
||||
\left[
|
||||
\begin{smallmatrix}
|
||||
b_0 \\ b_1
|
||||
\end{smallmatrix}
|
||||
\right]
|
||||
=
|
||||
a_0b_0\ket{00} + a_0b_1\ket{01} + a_1b_0\ket{10} + a_1b_1\ket{11}
|
||||
$
|
||||
|
||||
\vspace{2mm}
|
||||
|
||||
So, we have that $a_1b_1 = a_0b_0 = \sqrt{2}^{-1}$ \par
|
||||
But $a_0b_1 = a_1b_0 = 0$, so one of $a_0$ and $b_1$ must be zero. \par
|
||||
We thus have a contradiction.
|
||||
\end{solution}
|
||||
|
||||
|
||||
\vfill
|
||||
\pagebreak
|
311
Advanced/Introduction to Quantum/src/parts/04 logic gates.tex
Normal file
311
Advanced/Introduction to Quantum/src/parts/04 logic gates.tex
Normal file
@ -0,0 +1,311 @@
|
||||
\section{Logic Gates}
|
||||
|
||||
\definition{Matrices}
|
||||
Throughout this handout, we've been using matrices. Again, recall that every linear map may be written as a matrix,
|
||||
and that every matrix represents a linear map. For example, if $f: \mathbb{R}^2 \to \mathbb{R}^2$ is a linear
|
||||
map, we can write it as follows:
|
||||
\begin{equation*}
|
||||
f\left(
|
||||
\ket{x}
|
||||
\right)
|
||||
=
|
||||
\begin{bmatrix}
|
||||
m_1 & m_2 \\
|
||||
m_3 & m_4
|
||||
\end{bmatrix}
|
||||
\begin{bmatrix} x_1 \\ x_2 \end{bmatrix}
|
||||
=
|
||||
\left[
|
||||
\begin{matrix}
|
||||
m_1x_1 + m_2x_2 \\
|
||||
m_3x_1 + m_4x_2
|
||||
\end{matrix}
|
||||
\right]
|
||||
\end{equation*}
|
||||
|
||||
|
||||
\definition{}
|
||||
Before we discussing multi-qubit quantum gates, we need to review to classical logic. \par
|
||||
Of course, a classical logic gate is a linear map from $\mathbb{B}^m$ to $\mathbb{B}^n$
|
||||
|
||||
|
||||
\problem{}<notgatex>
|
||||
The \texttt{not} gate is a map from $\mathbb{B}$ to $\mathbb{B}$ defined by the following table: \par
|
||||
|
||||
\begin{itemize}
|
||||
\item $X\ket{0} = \ket{1}$
|
||||
\item $X\ket{1} = \ket{0}$
|
||||
\end{itemize}
|
||||
|
||||
Write the \texttt{not} gate as a matrix that operates on single-bit vector states. \par
|
||||
That is, find a matrix $X$ so that
|
||||
$
|
||||
X\left[\begin{smallmatrix} 1 \\ 0 \end{smallmatrix}\right]
|
||||
= \left[\begin{smallmatrix} 0 \\ 1 \end{smallmatrix}\right]
|
||||
$
|
||||
and
|
||||
$
|
||||
X\left[\begin{smallmatrix} 0 \\ 1 \end{smallmatrix}\right]
|
||||
= \left[\begin{smallmatrix} 1 \\ 0 \end{smallmatrix}\right]
|
||||
$ \par
|
||||
|
||||
\begin{solution}
|
||||
\begin{equation*}
|
||||
X = \begin{bmatrix}
|
||||
0 & 1 \\ 1 & 0
|
||||
\end{bmatrix}
|
||||
\end{equation*}
|
||||
\end{solution}
|
||||
|
||||
|
||||
\vfill
|
||||
|
||||
|
||||
\problem{}
|
||||
The \texttt{and} gate is a map $\mathbb{B}^2 \to \mathbb{B}$ defined by the following table:
|
||||
\begin{center}
|
||||
\begin{tabular}{ c | c | c }
|
||||
\hline
|
||||
\texttt{a} & \texttt{b} & \texttt{a} and \texttt{b} \\
|
||||
\hline
|
||||
0 & 0 & 0 \\
|
||||
0 & 1 & 0 \\
|
||||
1 & 0 & 0 \\
|
||||
1 & 1 & 1
|
||||
\end{tabular}
|
||||
\end{center}
|
||||
|
||||
Find a matrix $A$ so that $A\ket{\texttt{ab}}$ works as expected. \par
|
||||
|
||||
|
||||
\begin{solution}
|
||||
\begin{equation*}
|
||||
A = \begin{bmatrix}
|
||||
1 & 1 & 1 & 0 \\
|
||||
0 & 0 & 0 & 1 \\
|
||||
\end{bmatrix}
|
||||
\end{equation*}
|
||||
|
||||
\begin{instructornote}
|
||||
Because of the way we represent bits here, we also have the following property: \par
|
||||
The columns of $A$ correspond to the output for each input---i.e, $A$ is just a table of outputs. \par
|
||||
|
||||
\vspace{2mm}
|
||||
For example, if we look at the first column of $A$ (which is $[1, 0]$), we see: \par
|
||||
$A\ket{00} = A[1,0,0,0] = [1,0] = \ket{0}$
|
||||
|
||||
\vspace{2mm}
|
||||
Also with the last column (which is $[0,1]$): \par
|
||||
$A\ket{00} = A[0,0,0,1] = [0,1] = \ket{1}$
|
||||
\end{instructornote}
|
||||
\end{solution}
|
||||
|
||||
|
||||
\vfill
|
||||
\pagebreak
|
||||
|
||||
\generic{Remark:}
|
||||
The way a quantum circuit handles information is a bit different than the way a classical circuit does.
|
||||
We usually think of logic gates as \textit{functions}: they consume one set of bits, and return another:
|
||||
|
||||
|
||||
\begin{center}
|
||||
\begin{tikzpicture}[circuit logic US, scale=2]
|
||||
\node[and gate] (and) at (0,-0.8) {\tiny\texttt{and}};
|
||||
\draw[->] ([shift={(-0.5, 0)}] and.input 1) node[left] {\texttt{input A}} -- ([shift={(-0.25, 0)}]and.input 1);
|
||||
\draw[->] ([shift={(-0.5, 0)}] and.input 2) node[left] {\texttt{input B}} -- ([shift={(-0.25, 0)}]and.input 2);
|
||||
\draw ([shift={(-0.25, 0)}] and.input 1) -- (and.input 1);
|
||||
\draw ([shift={(-0.25, 0)}] and.input 2) -- (and.input 2);
|
||||
\draw[->] (and.output) -- ([shift={(0.5, 0)}] and.output) node[right] {\texttt{output}};
|
||||
\end{tikzpicture}
|
||||
\end{center}
|
||||
|
||||
|
||||
This model, however, won't work for quantum logic. If we want to understand quantum gates, we need to see them
|
||||
not as \textit{functions}, but as \textit{transformations}. This distinction is subtle, but significant:
|
||||
\begin{itemize}
|
||||
\item functions \textit{consume} a set of inputs and \textit{produce} a set of outputs
|
||||
\item transformations \textit{change} a set of objects, without adding or removing any elements
|
||||
\end{itemize}
|
||||
|
||||
\vspace{2mm}
|
||||
|
||||
Our usual logic circuit notation models logic gates as functions---we thus can't use it. \par
|
||||
We'll need a different diagram to draw quantum circuits. \par
|
||||
|
||||
\vfill
|
||||
|
||||
|
||||
First, we'll need a set of bits. For this example, we'll use two, drawn in a vertical array. \par
|
||||
We'll also add a horizontal time axis, moving from left to right:
|
||||
|
||||
\begin{center}
|
||||
\begin{tikzpicture}[scale=1]
|
||||
\node[qubit] (a) at (0, 0) {\texttt{0}};
|
||||
\node[qubit] (b) at (0, -1) {\texttt{1}};
|
||||
|
||||
\draw[wire] (a) -- ([shift={(4, 0)}] a.center) node[qubit] {\texttt{0}};
|
||||
\draw[wire] (b) -- ([shift={(4, 0)}] b.center) node[qubit] {\texttt{1}};
|
||||
|
||||
\draw[
|
||||
color = oblue,
|
||||
->>,
|
||||
line width = 0.5mm
|
||||
] (-1,-1.5) -- (5, -1.5);
|
||||
|
||||
\node[fill=white, text=oblue] at (2, -1.5) {\texttt{time axis}};
|
||||
|
||||
|
||||
\node[left, gray] at (-1, -0.5) {State of each bit at start};
|
||||
\node[right, gray] at (5, -0.5) {State of each bit at end};
|
||||
|
||||
\draw[
|
||||
->,
|
||||
color = gray,
|
||||
line width = 0.2mm,
|
||||
rounded corners = 2mm
|
||||
]
|
||||
(-1, -0.5) -- (-0.8, -0.5) -- (-0.8, 0) --(a)
|
||||
;
|
||||
\draw[
|
||||
->,
|
||||
color = gray,
|
||||
line width = 0.2mm,
|
||||
rounded corners = 2mm
|
||||
]
|
||||
(-1, -0.5) -- (-0.8, -0.5) -- (-0.8, -1) -- (b)
|
||||
;
|
||||
|
||||
\draw[
|
||||
<-,
|
||||
color = gray,
|
||||
line width = 0.2mm,
|
||||
rounded corners = 2mm
|
||||
]
|
||||
(4.2, 0) -- (4.8, 0) -- (4.8, -0.5) -- (5, -0.5)
|
||||
;
|
||||
\draw[
|
||||
<-,
|
||||
color = gray,
|
||||
line width = 0.2mm,
|
||||
rounded corners = 2mm
|
||||
]
|
||||
(4.2, -1) -- (4.8, -1) -- (4.8, -0.5) -- (5, -0.5)
|
||||
;
|
||||
|
||||
\end{tikzpicture}
|
||||
\end{center}
|
||||
|
||||
In the diagram above, we didn't change our bits---so the labels at the start match those at the end.
|
||||
|
||||
\vfill
|
||||
|
||||
Thus, our circuit forms a grid, with bits ordered vertically and time horizontally. \par
|
||||
If we want to change our state, we draw transformations as vertical boxes. \par
|
||||
Every column represents a single transformation on the entire state:
|
||||
|
||||
\begin{center}
|
||||
\begin{tikzpicture}[scale=1]
|
||||
\node[qubit] (a) at (0, 0) {\texttt{1}};
|
||||
\node[qubit] (b) at (0, -1) {\texttt{0}};
|
||||
|
||||
\draw[wire] (a) -- ([shift={(5, 0)}] a.center) node[qubit] {\texttt{0}};
|
||||
\draw[wire] (b) -- ([shift={(5, 0)}] b.center) node[qubit] {\texttt{1}};
|
||||
|
||||
\ghostqubox{a}{1}{b}{2}{$T_1$}
|
||||
\ghostqubox{a}{2}{b}{3}{$T_2$}
|
||||
\ghostqubox{a}{3}{b}{4}{$T_3$}
|
||||
|
||||
\end{tikzpicture}
|
||||
\end{center}
|
||||
|
||||
Note that the transformations above span the whole state. This is important: \par
|
||||
we cannot apply transformations to individual bits---we always transform the \textit{entire} state.
|
||||
|
||||
|
||||
\vfill
|
||||
\pagebreak
|
||||
|
||||
\generic{Setup:}
|
||||
Say we want to invert the first bit of a two-bit state. That is, we want a transformation $T$ so that \par
|
||||
|
||||
\begin{center}
|
||||
\begin{tikzpicture}[scale=0.8]
|
||||
\node[qubit] (a) at (0, 0) {\texttt{a}};
|
||||
\node[qubit] (b) at (0, -1) {\texttt{b}};
|
||||
|
||||
\draw[wire] (a) -- ([shift={(4, 0)}] a.center) node[qubit] {\texttt{not a}};
|
||||
\draw[wire] (b) -- ([shift={(4, 0)}] b.center) node[qubit] {\texttt{b}};
|
||||
|
||||
\qubox{a}{1.5}{b}{2.5}{$T$}
|
||||
\end{tikzpicture}
|
||||
\end{center}
|
||||
|
||||
In other words, we want a matrix $T$ satisfying the following equalities:
|
||||
\begin{itemize}
|
||||
\item $T\ket{00} = \ket{10}$
|
||||
\item $T\ket{01} = \ket{11}$
|
||||
\item $T\ket{10} = \ket{00}$
|
||||
\item $T\ket{11} = \ket{01}$
|
||||
\end{itemize}
|
||||
|
||||
|
||||
|
||||
\problem{}
|
||||
Find the matrix that corresponds to the above transformation. \par
|
||||
\hint{
|
||||
Remember that
|
||||
$\ket{0} = \left[\begin{smallmatrix} 1 \\ 0 \end{smallmatrix}\right]$ and
|
||||
$\ket{1} = \left[\begin{smallmatrix} 0 \\ 1 \end{smallmatrix}\right]$ \\
|
||||
Also, we found earlier that $X = \left[\begin{smallmatrix} 0 && 1 \\ 1 && 0 \end{smallmatrix}\right]$,
|
||||
and of course $I = \left[\begin{smallmatrix} 1 && 0 \\ 0 && 1 \end{smallmatrix}\right]$.
|
||||
}
|
||||
|
||||
\begin{solution}
|
||||
\begin{equation*}
|
||||
T = \begin{bmatrix}
|
||||
0 & 0 & 1 & 0 \\
|
||||
0 & 0 & 0 & 1 \\
|
||||
1 & 0 & 0 & 0 \\
|
||||
0 & 1 & 0 & 0 \\
|
||||
\end{bmatrix}
|
||||
\end{equation*}
|
||||
\end{solution}
|
||||
|
||||
\vfill
|
||||
|
||||
\generic{Remark:}
|
||||
We could draw the above transformation as a combination $X$ and $I$ (identity) gate:
|
||||
\begin{center}
|
||||
\begin{tikzpicture}[scale=0.8]
|
||||
\node[qubit] (a) at (0, 0) {$\ket{0}$};
|
||||
\node[qubit] (b) at (0, -1) {$\ket{0}$};
|
||||
|
||||
\draw[wire] (a) -- ([shift={(3, 0)}] a.center) node[qubit] {$\ket{1}$};
|
||||
\draw[wire] (b) -- ([shift={(3, 0)}] b.center) node[qubit] {$\ket{0}$};
|
||||
|
||||
\qubox{a}{1}{a}{2}{$X$}
|
||||
\qubox{b}{1}{b}{2}{$I$}
|
||||
\end{tikzpicture}
|
||||
\end{center}
|
||||
|
||||
We can even omit the $I$ gate, since we now know that transformations affect the whole state: \par
|
||||
\begin{center}
|
||||
\begin{tikzpicture}[scale=0.8]
|
||||
\node[qubit] (a) at (0, 0) {$\ket{0}$};
|
||||
\node[qubit] (b) at (0, -1) {$\ket{0}$};
|
||||
|
||||
\draw[wire] (a) -- ([shift={(3, 0)}] a.center) node[qubit] {$\ket{1}$};
|
||||
\draw[wire] (b) -- ([shift={(3, 0)}] b.center) node[qubit] {$\ket{0}$};
|
||||
|
||||
\qubox{a}{1}{a}{2}{$X$}
|
||||
\end{tikzpicture}
|
||||
\end{center}
|
||||
We're now done: this is how we draw quantum circuits.
|
||||
Don't forget that transformations \textit{always} affect the whole state---even if our diagram doesn't explicitly state this.
|
||||
|
||||
\pagebreak
|
||||
|
||||
% TODO:
|
||||
% distributive property of tensor product
|
||||
% quantum gate algebra
|
234
Advanced/Introduction to Quantum/src/parts/05 quantum gates.tex
Normal file
234
Advanced/Introduction to Quantum/src/parts/05 quantum gates.tex
Normal file
@ -0,0 +1,234 @@
|
||||
\section{Quantum Gates}
|
||||
|
||||
|
||||
In the previous section, we stated that a quantum gate is a linear map. \par
|
||||
Let's complete that definition.
|
||||
|
||||
\definition{}
|
||||
A quantum gate is a \textit{orthonormal matrix}, which means any gate $G$
|
||||
satisfies $GG^\text{T} = I$. \par
|
||||
This implies the following: \par
|
||||
|
||||
\begin{itemize}
|
||||
\item $G$ is square \par
|
||||
\note{
|
||||
If we think of $G$ as a map, this means that $G$ has as many inputs as it has outputs. \\
|
||||
This is to be expected: we stated earlier that quantum gates do not destroy or create qubits.
|
||||
}
|
||||
|
||||
\item $G$ preserves lengths; i.e $|x| = |Gx|$. \par
|
||||
\note{This ensures that $G\ket{\psi}$ is always a valid state.}
|
||||
\end{itemize}
|
||||
|
||||
(You will prove all these properties in any introductory linear algebra course. \\
|
||||
This isn't a lesson on linear algebra, so you may take them as given today.)
|
||||
|
||||
\definition{}
|
||||
Let $\mathbb{U} \subset \mathbb{R}^2$ be the set of points in the unit circle. \par
|
||||
We can restate the above definition as follows: \par
|
||||
A quantum gate is an invertible map from $\mathbb{U}^n$ to $\mathbb{U}^n$.
|
||||
|
||||
|
||||
\definition{}<qgateislinear>
|
||||
Let $G$ be a quantum gate. \par
|
||||
Since quantum gates are, by definition, \textit{linear} maps,
|
||||
the following holds: \par
|
||||
|
||||
\begin{equation*}
|
||||
G\bigl(a_0 \ket{0} + a_1\ket{1}\bigr) = a_0G\ket{0} + a_1G\ket{1}
|
||||
\end{equation*}
|
||||
|
||||
\problem{}<cnot>
|
||||
Consider the \textit{controlled not} (or \textit{cnot}) gate, defined by the following table: \par
|
||||
\begin{itemize}
|
||||
\item $\text{X}_\text{c}\ket{00} = \ket{00}$
|
||||
\item $\text{X}_\text{c}\ket{01} = \ket{11}$
|
||||
\item $\text{X}_\text{c}\ket{10} = \ket{10}$
|
||||
\item $\text{X}_\text{c}\ket{11} = \ket{01}$
|
||||
\end{itemize}
|
||||
In other words, the cnot gate inverts its first bit if its second bit is $\ket{1}$. \par
|
||||
Find the matrix that applies the cnot gate.
|
||||
|
||||
\begin{solution}
|
||||
\begin{equation*}
|
||||
\text{X}_\text{c} = \left[\begin{smallmatrix}
|
||||
1 & 0 & 0 & 0 \\
|
||||
0 & 1 & 0 & 0 \\
|
||||
0 & 0 & 0 & 1 \\
|
||||
0 & 0 & 1 & 0 \\
|
||||
\end{smallmatrix}\right]
|
||||
\end{equation*}
|
||||
|
||||
\vspace{4mm}
|
||||
|
||||
If $\ket{a}$ is $\ket{0}$, $\ket{a} \otimes \ket{b}$ is
|
||||
$
|
||||
\left[
|
||||
\begin{smallmatrix}
|
||||
\left[
|
||||
\begin{smallmatrix}
|
||||
b_1 \\ b_2
|
||||
\end{smallmatrix}
|
||||
\right]
|
||||
\\ 0 \\ 0
|
||||
\end{smallmatrix}
|
||||
\right]
|
||||
$, and the \say{not} portion of the matrix is ignored.
|
||||
|
||||
|
||||
\vspace{4mm}
|
||||
|
||||
If $\ket{a}$ is $\ket{1}$, $\ket{a} \otimes \ket{b}$ is
|
||||
$
|
||||
\left[
|
||||
\begin{smallmatrix}
|
||||
0 \\ 0 \\
|
||||
\left[
|
||||
\begin{smallmatrix}
|
||||
b_1 \\ b_2
|
||||
\end{smallmatrix}
|
||||
\right]
|
||||
\end{smallmatrix}
|
||||
\right]
|
||||
$, and the \say{identity} portion of the matrix is ignored.
|
||||
|
||||
|
||||
The state of $\ket{a}$ is always preserved, since it's determined by the position of
|
||||
$\left[\begin{smallmatrix}b_1 \\ b_2\end{smallmatrix}\right]$ in the tensor product.
|
||||
If $\left[\begin{smallmatrix}b_1 \\ b_2\end{smallmatrix}\right]$ is on top, $\ket{a}$ is $\ket{0}$,
|
||||
and if $\left[\begin{smallmatrix}b_1 \\ b_2\end{smallmatrix}\right]$ is on the bottom, $\ket{a}$ is $\ket{1}$.
|
||||
\end{solution}
|
||||
|
||||
|
||||
|
||||
|
||||
\vfill
|
||||
\pagebreak
|
||||
|
||||
|
||||
|
||||
\problem{}<applycnot>
|
||||
Evaluate the following:
|
||||
\begin{equation*}
|
||||
\text{X}_\text{C}
|
||||
\Bigl(
|
||||
\frac{1}{2}\ket{00} +
|
||||
\frac{1}{2}\ket{01} -
|
||||
\frac{1}{2}\ket{10} -
|
||||
\frac{1}{2}\ket{11}
|
||||
\Bigr)
|
||||
\end{equation*}
|
||||
|
||||
|
||||
\vfill
|
||||
|
||||
\problem{}
|
||||
If we measure the result of \ref{applycnot}, what are the probabilities of getting each state?
|
||||
|
||||
\vfill
|
||||
|
||||
\problem{}
|
||||
Finally, modify the original cnot gate so that the roles of its bits are reversed: \par
|
||||
$\text{X}_\text{c, flipped} \ket{ab}$ should invert $\ket{a}$ iff $\ket{b}$ is $\ket{1}$.
|
||||
|
||||
|
||||
\begin{solution}
|
||||
\begin{equation*}
|
||||
\text{X}_\text{c, flipped} = \begin{bmatrix}
|
||||
1 & 0 & 0 & 0 \\
|
||||
0 & 0 & 0 & 1 \\
|
||||
0 & 0 & 1 & 0 \\
|
||||
0 & 1 & 0 & 0 \\
|
||||
\end{bmatrix}
|
||||
\end{equation*}
|
||||
\end{solution}
|
||||
|
||||
\vfill
|
||||
\pagebreak
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
\definition{}
|
||||
The \textit{Hadamard Gate} is given by the following matrix: \par
|
||||
\begin{equation*}
|
||||
H = \frac{1}{\sqrt{2}}\begin{bmatrix}
|
||||
1 & 1 \\
|
||||
1 & -1
|
||||
\end{bmatrix}
|
||||
\end{equation*}
|
||||
\note{Note that we divide by $\sqrt{2}$, since $H$ must be orthonormal.}
|
||||
|
||||
\begin{ORMCbox}{Review: Matrix Multiplication}{black!10!white}{black!65!white}
|
||||
Matrix multiplication works as follows:
|
||||
|
||||
\begin{equation*}
|
||||
AB =
|
||||
\begin{bmatrix}
|
||||
1 & 2 \\
|
||||
3 & 4 \\
|
||||
\end{bmatrix}
|
||||
\begin{bmatrix}
|
||||
a_0 & b_0 \\
|
||||
a_1 & b_1 \\
|
||||
\end{bmatrix}
|
||||
=
|
||||
\begin{bmatrix}
|
||||
1a_0 + 2a_1 & 1b_0 + 2b_1 \\
|
||||
3a_0 + 4a_1 & 3b_0 + 4b_1 \\
|
||||
\end{bmatrix}
|
||||
\end{equation*}
|
||||
|
||||
|
||||
Note that this is very similar to multiplying each column of $B$ by $A$. \par
|
||||
The product $AB$ is simply $Ac$ for every column $c$ in $B$:
|
||||
|
||||
\begin{equation*}
|
||||
Ac_0 =
|
||||
\begin{bmatrix}
|
||||
1 & 2 \\
|
||||
3 & 4 \\
|
||||
\end{bmatrix}
|
||||
\begin{bmatrix}
|
||||
a_0 \\ a_1
|
||||
\end{bmatrix}
|
||||
=
|
||||
\begin{bmatrix}
|
||||
1a_0 + 2a_1 \\
|
||||
3a_0 + 4a_1
|
||||
\end{bmatrix}
|
||||
\end{equation*}
|
||||
|
||||
This is exactly the first column of the matrix product. \par
|
||||
Also, note that each element of $Ac_0$ is the dot product of a row in $A$ and a column in $c_0$.
|
||||
\end{ORMCbox}
|
||||
|
||||
|
||||
\problem{}
|
||||
What is $HH$? \par
|
||||
Using this result, find $H^{-1}$.
|
||||
|
||||
\begin{solution}
|
||||
$HH = I$, so $H^{-1} = H$
|
||||
\end{solution}
|
||||
|
||||
\vfill
|
||||
|
||||
\problem{}
|
||||
What geometric transformation does $H$ apply to the unit circle? \par
|
||||
\hint{Rotation or reflection? How much, or about which axis?}
|
||||
|
||||
\vfill
|
||||
|
||||
\problem{}
|
||||
What are $H\ket{0}$ and $H\ket{1}$? \par
|
||||
Are these states entangled?
|
||||
|
||||
\begin{solution}
|
||||
$H\ket{0} = \frac{1}{\sqrt{2}}\bigl(\ket{0} + \ket{1}\bigr)$ and $H\ket{1} = \frac{1}{\sqrt{2}}\bigl(\ket{0} - \ket{1}\bigr)$ \par
|
||||
Both of these are entangled states.
|
||||
\end{solution}
|
||||
|
||||
\vfill
|
||||
\pagebreak
|
Reference in New Issue
Block a user