235 lines
5.4 KiB
TeX
Raw Normal View History

2024-02-06 10:17:58 -08:00
\section{Quantum Gates}
2024-02-06 16:49:40 -08:00
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{
2024-02-08 09:21:22 -08:00
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.
2024-02-06 16:49:40 -08:00
}
\item $G$ preserves lengths; i.e $|x| = |Gx|$. \par
2024-02-08 09:21:22 -08:00
\note{This ensures that $G\ket{\psi}$ is always a valid state.}
2024-02-06 16:49:40 -08:00
\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.)
2024-02-06 10:17:58 -08:00
\definition{}
2024-02-06 16:49:40 -08:00
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$.
2024-02-06 10:17:58 -08:00
2024-02-06 16:49:40 -08:00
\definition{}<qgateislinear>
Let $G$ be a quantum gate. \par
Since quantum gates are, by definition, \textit{linear} maps,
the following holds: \par
2024-02-06 10:17:58 -08:00
2024-02-06 16:49:40 -08:00
\begin{equation*}
G\bigl(a_0 \ket{0} + a_1\ket{1}\bigr) = a_0G\ket{0} + a_1G\ket{1}
\end{equation*}
2024-02-06 10:17:58 -08:00
2024-02-15 16:23:25 -08:00
\problem{}<cnot>
2024-02-06 16:49:40 -08:00
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.
2024-02-06 10:17:58 -08:00
\begin{solution}
\begin{equation*}
2024-02-15 16:23:25 -08:00
\text{X}_\text{c} = \left[\begin{smallmatrix}
2024-02-06 10:17:58 -08:00
1 & 0 & 0 & 0 \\
0 & 1 & 0 & 0 \\
0 & 0 & 0 & 1 \\
0 & 0 & 1 & 0 \\
2024-02-06 16:49:40 -08:00
\end{smallmatrix}\right]
2024-02-06 10:17:58 -08:00
\end{equation*}
\vspace{4mm}
If $\ket{a}$ is $\ket{0}$, $\ket{a} \otimes \ket{b}$ is
$
2024-02-06 16:49:40 -08:00
\left[
\begin{smallmatrix}
\left[
\begin{smallmatrix}
2024-02-06 10:17:58 -08:00
b_1 \\ b_2
2024-02-06 16:49:40 -08:00
\end{smallmatrix}
\right]
\\ 0 \\ 0
\end{smallmatrix}
\right]
2024-02-06 10:17:58 -08:00
$, and the \say{not} portion of the matrix is ignored.
\vspace{4mm}
If $\ket{a}$ is $\ket{1}$, $\ket{a} \otimes \ket{b}$ is
$
2024-02-06 16:49:40 -08:00
\left[
\begin{smallmatrix}
2024-02-06 10:17:58 -08:00
0 \\ 0 \\
2024-02-06 16:49:40 -08:00
\left[
\begin{smallmatrix}
2024-02-06 10:17:58 -08:00
b_1 \\ b_2
2024-02-06 16:49:40 -08:00
\end{smallmatrix}
\right]
\end{smallmatrix}
\right]
2024-02-06 10:17:58 -08:00
$, 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}
2024-02-06 16:49:40 -08:00
\vfill
\pagebreak
2024-02-06 10:17:58 -08:00
2024-02-06 16:49:40 -08:00
\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*}
2024-02-06 10:17:58 -08:00
\vfill
\problem{}
2024-02-06 16:49:40 -08:00
If we measure the result of \ref{applycnot}, what are the probabilities of getting each state?
2024-02-06 10:17:58 -08:00
\vfill
2024-02-15 16:23:25 -08:00
\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}$.
2024-02-06 10:17:58 -08:00
2024-02-15 16:23:25 -08:00
\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
2024-02-08 09:21:22 -08:00
\pagebreak
2024-02-06 10:17:58 -08:00
2024-02-15 16:23:25 -08:00
2024-02-06 10:17:58 -08:00
2024-02-07 11:26:40 -08:00
2024-02-06 16:49:40 -08:00
\definition{}
2024-02-07 11:26:40 -08:00
The \textit{Hadamard Gate} is given by the following matrix: \par
2024-02-06 16:49:40 -08:00
\begin{equation*}
H = \frac{1}{\sqrt{2}}\begin{bmatrix}
1 & 1 \\
1 & -1
\end{bmatrix}
\end{equation*}
2024-02-07 11:26:40 -08:00
\note{Note that we divide by $\sqrt{2}$, since $H$ must be orthonormal.}
2024-02-06 10:17:58 -08:00
2024-02-07 11:26:40 -08:00
\begin{ORMCbox}{Review: Matrix Multiplication}{black!10!white}{black!65!white}
2024-02-06 16:49:40 -08:00
Matrix multiplication works as follows:
2024-02-06 10:17:58 -08:00
\begin{equation*}
2024-02-06 16:49:40 -08:00
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 \\
2024-02-06 10:17:58 -08:00
\end{bmatrix}
\end{equation*}
2024-02-06 16:49:40 -08:00
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$:
2024-02-06 10:17:58 -08:00
2024-02-06 16:49:40 -08:00
\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*}
2024-02-06 10:17:58 -08:00
2024-02-11 10:09:30 -08:00
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$.
2024-02-06 16:49:40 -08:00
\end{ORMCbox}
2024-02-06 10:17:58 -08:00
2024-02-07 11:26:40 -08:00
\problem{}
What is $HH$? \par
Using this result, find $H^{-1}$.
\begin{solution}
$HH = I$, so $H^{-1} = H$
\end{solution}
\vfill
2024-02-15 16:23:25 -08:00
\problem{}
What geometric transformation does $H$ apply to the unit circle? \par
\hint{Rotation or reflection? How much, or about which axis?}
\vfill
2024-02-07 11:26:40 -08:00
\problem{}
What are $H\ket{0}$ and $H\ket{1}$? \par
2024-02-08 09:21:22 -08:00
Are these states entangled?
2024-02-07 11:26:40 -08:00
\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
2024-02-08 09:21:22 -08:00
Both of these are entangled states.
2024-02-07 11:26:40 -08:00
\end{solution}
\vfill
2024-02-06 10:17:58 -08:00
\pagebreak