Quantum edits
This commit is contained in:
parent
82064f890c
commit
4dd9645738
@ -38,6 +38,11 @@
|
|||||||
|
|
||||||
\maketitle
|
\maketitle
|
||||||
|
|
||||||
\input{parts/0 bits}
|
\input{parts/00.00 bits}
|
||||||
\input{parts/1 gates}
|
\input{parts/00.01 two bits}
|
||||||
|
\input{parts/02.00 half a qubit}
|
||||||
|
\input{parts/02.01 two halves}
|
||||||
|
%\input{parts/03.00 gates}
|
||||||
|
%\input{parts/03.01 and a gate}
|
||||||
|
|
||||||
\end{document}
|
\end{document}
|
@ -6,33 +6,18 @@ To keep things simple, we'll use regular (usually called \textit{classical}) bit
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
\definition{}
|
\definition{Binary Digits}
|
||||||
$\mathbb{B}$ is the set of binary digits. In other words, $\mathbb{B} = \{\texttt{0}, \texttt{1}\}$. \par
|
$\mathbb{B}$ is the set of binary digits. In other words, $\mathbb{B} = \{\texttt{0}, \texttt{1}\}$. \par
|
||||||
\note[Note]{We've seen $\mathbb{B}$ before: It's $(\mathbb{Z}_2, +)$, the addition group mod 2.}
|
\note[Note]{We've seen $\mathbb{B}$ before: It's $(\mathbb{Z}_2, +)$, the addition group mod 2.}
|
||||||
|
|
||||||
\vspace{2mm}
|
\vspace{2mm}
|
||||||
|
|
||||||
Multiplication in $\mathbb{B}$ works just as you'd expect: \par
|
|
||||||
$
|
|
||||||
\texttt{0} \times \texttt{0} =
|
|
||||||
\texttt{0} \times \texttt{1} =
|
|
||||||
\texttt{1} \times \texttt{0} = \texttt{0}
|
|
||||||
$; and $\texttt{1} \times \texttt{1} = \texttt{1}$.
|
|
||||||
|
|
||||||
\vspace{2mm}
|
|
||||||
|
|
||||||
We'll treat addition a bit differently: \par
|
|
||||||
$0 + 0 = 0$ and $0 + 1 = 1$, but $1 + 1$, for our purposes, is undefined.
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
\definition{Cartesian Products}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
\definition{}
|
|
||||||
Let $A$ and $B$ be sets. \par
|
Let $A$ and $B$ be sets. \par
|
||||||
The \textit{cartesian product} $A \times B$ is the set of all pairs $(a, b)$ where $a \in A$ and $b \in B$. \par
|
The \textit{cartesian product} $A \times B$ is the set of all pairs $(a, b)$ where $a \in A$ and $b \in B$. \par
|
||||||
As usual, we can write $A \times A \times A$ as $A^3$. \par
|
As usual, we can write $A \times A \times A$ as $A^3$. \par
|
||||||
@ -67,9 +52,8 @@ What is the size of $\mathbb{B}^n$?
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
% NOTE: this is time-travelled later in the handout.
|
||||||
|
% if you edit this, edit that too.
|
||||||
|
|
||||||
\generic{Remark:}
|
\generic{Remark:}
|
||||||
Consider a single classical bit. It takes states in $\{\texttt{0}, \texttt{1}\}$, picking one at a time. \par
|
Consider a single classical bit. It takes states in $\{\texttt{0}, \texttt{1}\}$, picking one at a time. \par
|
||||||
The states \texttt{0} and \texttt{1} are fully independent. They are completely disjoint; they share no parts. \par
|
The states \texttt{0} and \texttt{1} are fully independent. They are completely disjoint; they share no parts. \par
|
||||||
@ -98,7 +82,7 @@ We can draw $\vec{0}$ and $\vec{1}$ as perpendicular axis on a plane to represen
|
|||||||
|
|
||||||
The point marked $1$ is at $[0, 1]$. It is no parts $\vec{0}$, and all parts $\vec{1}$. \par
|
The point marked $1$ is at $[0, 1]$. It is no parts $\vec{0}$, and all parts $\vec{1}$. \par
|
||||||
Of course, we can say something similar about the point marked $0$: \par
|
Of course, we can say something similar about the point marked $0$: \par
|
||||||
It is at $[1, 0] = (1 \times \vec{0}) + (2 \times \vec{1})$. In other words, all $\vec{0}$ and no $\vec{1}$. \par
|
It is at $[1, 0] = (1 \times \vec{0}) + (0 \times \vec{1})$, and is thus all $\vec{0}$ and no $\vec{1}$. \par
|
||||||
|
|
||||||
\vspace{2mm}
|
\vspace{2mm}
|
||||||
|
|
||||||
@ -173,7 +157,7 @@ Our bit is fully $\vec{0}$ or fully $\vec{1}$. There's nothing in between.
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
\definition{}
|
\definition{Orthonormal Basis}
|
||||||
The unit vectors $\vec{0}$ and $\vec{1}$ form an \textit{orthonormal basis} of the plane $\mathbb{R}^2$. \par
|
The unit vectors $\vec{0}$ and $\vec{1}$ form an \textit{orthonormal basis} of the plane $\mathbb{R}^2$. \par
|
||||||
\note{
|
\note{
|
||||||
\say{ortho-} means \say{orthogonal}; normal means \say{normal,} which means length $= 1$. \\
|
\say{ortho-} means \say{orthogonal}; normal means \say{normal,} which means length $= 1$. \\
|
||||||
@ -225,7 +209,7 @@ The tuple $[a,b,c]$ is called the \textit{coordinate} of a point with respect to
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
\definition{}
|
\definition{Vectored Bits}
|
||||||
This brings us to what we'll call the \textit{vectored representation} of a bit. \par
|
This brings us to what we'll call the \textit{vectored representation} of a bit. \par
|
||||||
Instead of writing our bits as just \texttt{0} and \texttt{1}, we'll break them into their components: \par
|
Instead of writing our bits as just \texttt{0} and \texttt{1}, we'll break them into their components: \par
|
||||||
|
|
||||||
@ -287,334 +271,5 @@ Write \texttt{x} and \texttt{y} in the diagram below in terms of $\ket{0}$ and $
|
|||||||
\end{tikzpicture}
|
\end{tikzpicture}
|
||||||
\end{center}
|
\end{center}
|
||||||
|
|
||||||
\vfill
|
|
||||||
\pagebreak
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
\section{Two Bits}
|
|
||||||
How do we represent multi-bit states using vectors? \par
|
|
||||||
Unfortunately, this is hard to visualize---but the idea is simple.
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
\problem{}
|
|
||||||
What is the set of possible states of two bits (i.e, $\mathbb{B}^2$)?
|
|
||||||
|
|
||||||
|
|
||||||
\vspace{2cm}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
\generic{Remark:}
|
|
||||||
When we have two bits, we have four orthogonal states:
|
|
||||||
$\overrightarrow{00}$, $\overrightarrow{01}$, $\overrightarrow{10}$, and $\overrightarrow{11}$. \par
|
|
||||||
We need four dimensions to draw all of these vectors, so I can't provide a picture... \par
|
|
||||||
but the idea here is the same as before.
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
\problem{}
|
|
||||||
Write $\ket{00}$, $\ket{01}$, $\ket{10}$, and $\ket{11}$ as column vectors \par
|
|
||||||
with respect to the orthonormal basis $\{\overrightarrow{00}, \overrightarrow{01}, \overrightarrow{10}, \overrightarrow{11}\}$.
|
|
||||||
|
|
||||||
\vfill
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
\generic{Remark:}
|
|
||||||
So, we represent each possible state as an axis in an $n$-dimensional space. \par
|
|
||||||
A set of $n$ bits gives us $2^n$ possible states, which forms a basis in $2^n$ dimensions.
|
|
||||||
|
|
||||||
\vspace{1mm}
|
|
||||||
|
|
||||||
Say we now have two seperate bits: $\ket{a}$ and $\ket{b}$. \par
|
|
||||||
How do we represent their compound state? \par
|
|
||||||
|
|
||||||
\vspace{4mm}
|
|
||||||
|
|
||||||
If we return to our usual notation, this is very easy:
|
|
||||||
$a$ is in $\{\texttt{0}, \texttt{1}\}$ and $b$ is in $\{\texttt{0}, \texttt{1}\}$, \par
|
|
||||||
so the possible compound states of $ab$ are
|
|
||||||
$\{\texttt{0}, \texttt{1}\} \times \{\texttt{0}, \texttt{1}\} = \{\texttt{00}, \texttt{01}, \texttt{10}, \texttt{11}\}$
|
|
||||||
|
|
||||||
\vspace{1mm}
|
|
||||||
|
|
||||||
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$. This is trivial.
|
|
||||||
|
|
||||||
|
|
||||||
\vspace{4mm}
|
|
||||||
|
|
||||||
We would like to do the same in vector notation. Given $\ket{a}$ and $\ket{b}$, \par
|
|
||||||
how should we represent the state of $\ket{ab}$?
|
|
||||||
|
|
||||||
|
|
||||||
\vfill
|
|
||||||
\pagebreak
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
\definition{}
|
|
||||||
The \textit{tensor product} between 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*}
|
|
||||||
|
|
||||||
|
|
||||||
\vspace{2mm}
|
|
||||||
|
|
||||||
Also, note that the tensor product is very similar to the
|
|
||||||
Cartesian product: if we take $x$ and $y$ as sets, with
|
|
||||||
$x = \{x_1, x_2\}$ and $y = \{y_1, y_2\}$, the Cartesian product
|
|
||||||
contains the same elements as the tensor product---every possible
|
|
||||||
pairing of an element in $x$ with an element in $y$:
|
|
||||||
\begin{equation*}
|
|
||||||
x \times y = \{~(x_1,y_1), (x_1,y_2), (x_2,y_1), (x_2y_2)~\}
|
|
||||||
\end{equation*}
|
|
||||||
|
|
||||||
|
|
||||||
In fact, these two operations are (in a sense) essentially identical. \par
|
|
||||||
Let's quickly demonstrate this.
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
\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{}
|
|
||||||
The vectors we found in \ref{basistp} are a basis of what space? \par
|
|
||||||
|
|
||||||
\vfill
|
|
||||||
\pagebreak
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
\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 $\ket{0} \otimes \ket{0}$
|
|
||||||
\item $\ket{0} \otimes \ket{1}$
|
|
||||||
\item $\ket{1} \otimes \ket{0}$
|
|
||||||
\item $\ket{1} \otimes \ket{1}$
|
|
||||||
\end{itemize}
|
|
||||||
\hint{
|
|
||||||
Remember that the coordinates of
|
|
||||||
$\ket{0}$ are $\left[\begin{smallmatrix} 1 \\ 0 \end{smallmatrix}\right]$,
|
|
||||||
and the coordinates of
|
|
||||||
$\ket{1}$ are $\left[\begin{smallmatrix} 0 \\ 1 \end{smallmatrix}\right]$.
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
\vfill
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
\problem{}<fivequant>
|
|
||||||
Of course, writing $\ket{0} \otimes \ket{1}$ is a bit excessive. \par
|
|
||||||
We'll shorten this notation to $\ket{01}$. \par
|
|
||||||
Thus, the two-bit kets we saw on the previous page are, by definition, tensor products.
|
|
||||||
|
|
||||||
\vspace{2mm}
|
|
||||||
|
|
||||||
In fact, we could go further: if we wanted to write the set of bits $\ket{1} \otimes \ket{1} \otimes \ket{0} \otimes \ket{1}$, \par
|
|
||||||
we could write $\ket{1101}$---but a shorter alternative is $\ket{13}$, since $13$ is \texttt{1101} in binary.
|
|
||||||
|
|
||||||
\vspace{2mm}
|
|
||||||
|
|
||||||
Write $\ket{5}$ as three-bit state vector. \par
|
|
||||||
|
|
||||||
\begin{solution}
|
|
||||||
$\ket{5} = \ket{101} = \ket{1} \otimes \ket{0} \otimes \ket{1} = [0,0,0,0,0,1,0,0]^T$ \par
|
|
||||||
Notice how we're counting from the top, with $\ket{000} = [1,0,...,0]$ and $\ket{111} = [0, ..., 0, 1]$.
|
|
||||||
\end{solution}
|
|
||||||
|
|
||||||
\vfill
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
\problem{}
|
|
||||||
Write the three-bit states $\ket{0}$ through $\ket{7}$ as column vectors. \par
|
|
||||||
What do you see?
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
\vfill
|
\vfill
|
||||||
\pagebreak
|
\pagebreak
|
314
Advanced/Introduction to Quantum/parts/00.01 two bits.tex
Normal file
314
Advanced/Introduction to Quantum/parts/00.01 two bits.tex
Normal file
@ -0,0 +1,314 @@
|
|||||||
|
\section{Two Bits}
|
||||||
|
How do we represent multi-bit states using vectors? \par
|
||||||
|
Unfortunately, this is hard to visualize---but the idea is simple.
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
\problem{}
|
||||||
|
What is the set of possible states of two bits (i.e, $\mathbb{B}^2$)?
|
||||||
|
|
||||||
|
|
||||||
|
\vspace{2cm}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
\generic{Remark:}
|
||||||
|
When we have two bits, we have four orthogonal states:
|
||||||
|
$\overrightarrow{00}$, $\overrightarrow{01}$, $\overrightarrow{10}$, and $\overrightarrow{11}$. \par
|
||||||
|
We need four dimensions to draw all of these vectors, so I can't provide a picture... \par
|
||||||
|
but the idea here is the same as before.
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
\problem{}
|
||||||
|
Write $\ket{00}$, $\ket{01}$, $\ket{10}$, and $\ket{11}$ as column vectors \par
|
||||||
|
with respect to the orthonormal basis $\{\overrightarrow{00}, \overrightarrow{01}, \overrightarrow{10}, \overrightarrow{11}\}$.
|
||||||
|
|
||||||
|
\vfill
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
\generic{Remark:}
|
||||||
|
So, we represent each possible state as an axis in an $n$-dimensional space. \par
|
||||||
|
A set of $n$ bits gives us $2^n$ possible states, which forms a basis in $2^n$ dimensions.
|
||||||
|
|
||||||
|
\vspace{1mm}
|
||||||
|
|
||||||
|
Say we now have two seperate bits: $\ket{a}$ and $\ket{b}$. \par
|
||||||
|
How do we represent their compound state? \par
|
||||||
|
|
||||||
|
\vspace{4mm}
|
||||||
|
|
||||||
|
If we return to our usual notation, this is very easy:
|
||||||
|
$a$ is in $\{\texttt{0}, \texttt{1}\}$ and $b$ is in $\{\texttt{0}, \texttt{1}\}$, \par
|
||||||
|
so the possible compound states of $ab$ are
|
||||||
|
$\{\texttt{0}, \texttt{1}\} \times \{\texttt{0}, \texttt{1}\} = \{\texttt{00}, \texttt{01}, \texttt{10}, \texttt{11}\}$
|
||||||
|
|
||||||
|
\vspace{1mm}
|
||||||
|
|
||||||
|
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$. This is trivial.
|
||||||
|
|
||||||
|
|
||||||
|
\vspace{4mm}
|
||||||
|
|
||||||
|
We would like to do the same in vector notation. Given $\ket{a}$ and $\ket{b}$, \par
|
||||||
|
how should we represent the state of $\ket{ab}$?
|
||||||
|
|
||||||
|
|
||||||
|
\vfill
|
||||||
|
\pagebreak
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
\definition{Tensor Products}
|
||||||
|
The \textit{tensor product} between 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*}
|
||||||
|
|
||||||
|
|
||||||
|
\vspace{2mm}
|
||||||
|
|
||||||
|
Also, note that the tensor product is very similar to the
|
||||||
|
Cartesian product: if we take $x$ and $y$ as sets, with
|
||||||
|
$x = \{x_1, x_2\}$ and $y = \{y_1, y_2\}$, the Cartesian product
|
||||||
|
contains the same elements as the tensor product---every possible
|
||||||
|
pairing of an element in $x$ with an element in $y$:
|
||||||
|
\begin{equation*}
|
||||||
|
x \times y = \{~(x_1,y_1), (x_1,y_2), (x_2,y_1), (x_2y_2)~\}
|
||||||
|
\end{equation*}
|
||||||
|
|
||||||
|
|
||||||
|
In fact, these two operations are (in a sense) essentially identical. \par
|
||||||
|
Let's quickly demonstrate this.
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
\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{}
|
||||||
|
The vectors we found in \ref{basistp} are a basis of what space? \par
|
||||||
|
|
||||||
|
\vfill
|
||||||
|
\pagebreak
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
\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 $\ket{0} \otimes \ket{0}$
|
||||||
|
\item $\ket{0} \otimes \ket{1}$
|
||||||
|
\item $\ket{1} \otimes \ket{0}$
|
||||||
|
\item $\ket{1} \otimes \ket{1}$
|
||||||
|
\end{itemize}
|
||||||
|
\hint{
|
||||||
|
Remember that the coordinates of
|
||||||
|
$\ket{0}$ are $\left[\begin{smallmatrix} 1 \\ 0 \end{smallmatrix}\right]$,
|
||||||
|
and the coordinates of
|
||||||
|
$\ket{1}$ are $\left[\begin{smallmatrix} 0 \\ 1 \end{smallmatrix}\right]$.
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
\vfill
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
\problem{}<fivequant>
|
||||||
|
Of course, writing $\ket{0} \otimes \ket{1}$ is a bit excessive. \par
|
||||||
|
We'll shorten this notation to $\ket{01}$. \par
|
||||||
|
Thus, the two-bit kets we saw on the previous page are, by definition, tensor products.
|
||||||
|
|
||||||
|
\vspace{2mm}
|
||||||
|
|
||||||
|
In fact, we could go further: if we wanted to write the set of bits $\ket{1} \otimes \ket{1} \otimes \ket{0} \otimes \ket{1}$, \par
|
||||||
|
we could write $\ket{1101}$---but a shorter alternative is $\ket{13}$, since $13$ is \texttt{1101} in binary.
|
||||||
|
|
||||||
|
\vspace{2mm}
|
||||||
|
|
||||||
|
Write $\ket{5}$ as three-bit state vector. \par
|
||||||
|
|
||||||
|
\begin{solution}
|
||||||
|
$\ket{5} = \ket{101} = \ket{1} \otimes \ket{0} \otimes \ket{1} = [0,0,0,0,0,1,0,0]^T$ \par
|
||||||
|
Notice how we're counting from the top, with $\ket{000} = [1,0,...,0]$ and $\ket{111} = [0, ..., 0, 1]$.
|
||||||
|
\end{solution}
|
||||||
|
|
||||||
|
\vfill
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
\problem{}
|
||||||
|
Write the three-bit states $\ket{0}$ through $\ket{7}$ as column vectors. \par
|
||||||
|
What do you see?
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
\vfill
|
||||||
|
\pagebreak
|
268
Advanced/Introduction to Quantum/parts/02.00 half a qubit.tex
Normal file
268
Advanced/Introduction to Quantum/parts/02.00 half a qubit.tex
Normal file
@ -0,0 +1,268 @@
|
|||||||
|
\section{Half a Qubit}
|
||||||
|
|
||||||
|
First, a pair of definitions. We've used both these terms implicitly in the previous section,
|
||||||
|
but we'll need to introduce proper definitions before we continue.
|
||||||
|
|
||||||
|
\definition{}
|
||||||
|
A \textit{linear combination} of two vectors $u$ and $v$ is the sum $au + bv$ for scalars $a$ and $b$. \par
|
||||||
|
\note[Note]{In other words, a linear combination is exactly what it sounds like.}
|
||||||
|
|
||||||
|
\definition{}
|
||||||
|
A \textit{normalized vector} (also called a \textit{unit vector}) is a vector with length 1.
|
||||||
|
|
||||||
|
\vspace{4mm}
|
||||||
|
|
||||||
|
\begin{tcolorbox}[
|
||||||
|
enhanced,
|
||||||
|
breakable,
|
||||||
|
colback=white,
|
||||||
|
colframe=ored,
|
||||||
|
boxrule=0.6mm,
|
||||||
|
arc=0mm,
|
||||||
|
outer arc=0mm,
|
||||||
|
]
|
||||||
|
\color{ored}
|
||||||
|
\begingroup
|
||||||
|
\large\centering
|
||||||
|
\textbf{Disclaimer:} \par
|
||||||
|
\endgroup
|
||||||
|
\vspace{1ex}
|
||||||
|
The \say{qubits} we're about to define aren't \textit{really} qubits. The proper definition is a bit more
|
||||||
|
complicated, but don't worry about that yet. For now, take what I say as truth---we'll get to
|
||||||
|
the complex definition soon enough.
|
||||||
|
|
||||||
|
\vspace{2mm}
|
||||||
|
|
||||||
|
The information provided in this handout does not, and is not intended to, constitute legal advice.
|
||||||
|
All information, content, and material in this document is for general informational purposes only.
|
||||||
|
\end{tcolorbox}
|
||||||
|
|
||||||
|
|
||||||
|
\generic{Remark:}
|
||||||
|
Just like a classical bit, a \textit{quantum bit} (or \textit{qubit}) can take the values $\ket{0}$ and $\ket{1}$. \par
|
||||||
|
However, \texttt{0} and \texttt{1} aren't the only states a qubit may have.
|
||||||
|
|
||||||
|
\vspace{2mm}
|
||||||
|
|
||||||
|
We'll make sense of quantum bits by extending the \say{vectored} bit representation we developed in the previous section.
|
||||||
|
First, let's look at a diagram we drew a few pages ago:
|
||||||
|
|
||||||
|
\begin{timetravel}
|
||||||
|
A classical bit takes states in $\{\texttt{0}, \texttt{1}\}$, picking one at a time. \par
|
||||||
|
We'll represent \texttt{0} and \texttt{1} as perpendicular unit vectors $\ket{0}$ and $\ket{1}$,
|
||||||
|
show below.
|
||||||
|
|
||||||
|
\begin{center}
|
||||||
|
\begin{tikzpicture}[scale=1.5]
|
||||||
|
\fill[color = black] (0, 0) circle[radius=0.05];
|
||||||
|
|
||||||
|
\draw[->] (0, 0) -- (1.2, 0);
|
||||||
|
\node[right] at (1.2, 0) {$\ket{0}$};
|
||||||
|
\fill[color = oblue] (1, 0) circle[radius=0.05];
|
||||||
|
\node[below] at (1, 0) {\texttt{0}};
|
||||||
|
|
||||||
|
\draw[->] (0, 0) -- (0, 1.2);
|
||||||
|
\node[above] at (0, 1.2) {$\ket{1}$};
|
||||||
|
\fill[color = oblue] (0, 1) circle[radius=0.05];
|
||||||
|
\node[left] at (0, 1) {\texttt{1}};
|
||||||
|
\end{tikzpicture}
|
||||||
|
\end{center}
|
||||||
|
|
||||||
|
|
||||||
|
The point marked $1$ is at $[0, 1]$. It is no parts $\ket{0}$, and all parts $\ket{1}$. \par
|
||||||
|
Of course, we can say something similar about the point marked $0$: \par
|
||||||
|
It is at $[1, 0] = (1 \times \ket{0}) + (0 \times \ket{1})$, and is thus all $\ket{0}$ and no $\ket{1}$. \par
|
||||||
|
\end{timetravel}
|
||||||
|
|
||||||
|
The diagram in the box above can also be used to describe the state of a qubit. \par
|
||||||
|
Like classical bits, qubits have the \textit{basis states} $\ket{0}$ and $\ket{1}$. \par
|
||||||
|
Unlike classical bits, qubits may take values that are some combination of both.
|
||||||
|
|
||||||
|
|
||||||
|
\vspace{2mm}
|
||||||
|
|
||||||
|
Namely, every possible state of a qubit is a \textit{normalized linear combination} of $\ket{0}$ and $\ket{1}$. \par
|
||||||
|
Such states are called \textit{superpositions} of $\ket{0}$ and $\ket{1}$, since they partially contain both states.
|
||||||
|
|
||||||
|
|
||||||
|
\vfill
|
||||||
|
\pagebreak
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
\definition{}
|
||||||
|
The state of a quantum bit is the column unit vector
|
||||||
|
$
|
||||||
|
\ket{\psi}
|
||||||
|
= \left[\begin{smallmatrix} a \\ b \end{smallmatrix}\right]
|
||||||
|
= a\ket{0} + b\ket{1}$ for $a, b \in \mathbb{R}
|
||||||
|
$. \par
|
||||||
|
|
||||||
|
Note that the length of $\ket{\psi}$ must always be $1$, which is the same as saying that $a^2 + b^2 = 1$.
|
||||||
|
|
||||||
|
\vspace{2mm}
|
||||||
|
If we plot the set of valid quantum states on our plane, we get a unit circle centered at the origin: \par
|
||||||
|
|
||||||
|
\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}
|
||||||
|
|
||||||
|
\problem{}
|
||||||
|
In the above diagram, 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
|
||||||
|
|
||||||
|
|
||||||
|
\definition{Measurement I}
|
||||||
|
Although a qubit may have many states, it must be $\ket{0}$ or $\ket{1}$ when we measure it. \par
|
||||||
|
|
||||||
|
\vspace{2mm}
|
||||||
|
|
||||||
|
As a trivial example, say $\ket{\psi}$ = $\ket{0}$. \par
|
||||||
|
If we were to measure $\ket{\psi}$, we'd get $\ket{0}$, and the state of the qubit wouldn't change.
|
||||||
|
|
||||||
|
\vspace{2mm}
|
||||||
|
|
||||||
|
However, something interesting happens when $\ket{\psi} = a\ket{0} + b\ket{1}$. \par
|
||||||
|
Our measurement again returns either $\ket{0}$ or $\ket{1}$, with the following probabilities: \par
|
||||||
|
\begin{itemize}[itemsep = 2mm, topsep = 2mm]
|
||||||
|
\item $\mathcal{P}(\ket{1}) = a^2$
|
||||||
|
\item $\mathcal{P}(\ket{0}) = b^2$
|
||||||
|
\end{itemize}
|
||||||
|
\note{
|
||||||
|
Note that $\mathcal{P}(\ket{0}) + \mathcal{P}(\ket{1}) = 1$. \\
|
||||||
|
As you already know, this is true of any probability function.
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
\vspace{2mm}
|
||||||
|
|
||||||
|
In addition $\ket{\psi}$ \textit{collapses} to the state we measure: it instantly jumps to the state we measure, \par
|
||||||
|
leaving no trace of its previous state. If we measure $\ket{\psi}$ and get $\ket{1}$, $\ket{\psi}$ becomes $\ket{1}$---and
|
||||||
|
it will remain in that state until it is changed.
|
||||||
|
\vspace{2mm}
|
||||||
|
|
||||||
|
Quantum bits \textit{cannot} be measured without their state collapsing. \par
|
||||||
|
We cannot certainly know the state of a qubit unless that state is $\ket{0}$ or $\ket{1}$.
|
||||||
|
|
||||||
|
\pagebreak
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
\problem{}
|
||||||
|
\begin{itemize}
|
||||||
|
\item What is the probability we get $\ket{0}$ if we measure $\ket{\psi_0}$? \par
|
||||||
|
\item What outcomes can we get if we measure it a second time? \par
|
||||||
|
\item What are these probabilities for $\ket{\psi_1}$?
|
||||||
|
\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_0}$};
|
||||||
|
|
||||||
|
|
||||||
|
\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{\psi_1}$};
|
||||||
|
\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.
|
||||||
|
|
||||||
|
\vspace{2mm}
|
||||||
|
|
||||||
|
Instead of referring to each state using its cartesian coordinates $a$ and $b$, \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 $a$ and $b$ in terms of $\theta$ for an arbitrary qubit.
|
||||||
|
|
||||||
|
|
||||||
|
\vfill
|
||||||
|
\pagebreak
|
112
Advanced/Introduction to Quantum/parts/02.01 two halves.tex
Normal file
112
Advanced/Introduction to Quantum/parts/02.01 two halves.tex
Normal file
@ -0,0 +1,112 @@
|
|||||||
|
\section{Two Halves of a Qubit}
|
||||||
|
|
||||||
|
|
||||||
|
\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{\phi}$? \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
|
||||||
|
\pagebreak
|
@ -1,635 +0,0 @@
|
|||||||
\section{Logic Gates}
|
|
||||||
Now that we know how to write vectored bits, let's look at the ways we can change them.
|
|
||||||
|
|
||||||
\generic{Remark:}
|
|
||||||
A few weeks ago, we talked about matrices. 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*}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
\problem{}
|
|
||||||
The \say{not} gate is a map from $\mathbb{B}$ to $\mathbb{B}$ defined by the following table:
|
|
||||||
\begin{itemize}
|
|
||||||
\item $\text{not}(\texttt{1}) = \texttt{0}$
|
|
||||||
\item $\text{not}(\texttt{0}) = \texttt{1}$
|
|
||||||
\end{itemize}
|
|
||||||
|
|
||||||
Write the not gate as a matrix that operates on single-bit vector states. \par
|
|
||||||
That is, find a matrix $N$ so that $N\ket{0} = \ket{1}$ and $N\ket{1} = \ket{0}$.
|
|
||||||
|
|
||||||
\begin{solution}
|
|
||||||
\begin{equation*}
|
|
||||||
N = \begin{bmatrix}
|
|
||||||
0 & 1 \\ 1 & 0
|
|
||||||
\end{bmatrix}
|
|
||||||
\end{equation*}
|
|
||||||
\end{solution}
|
|
||||||
|
|
||||||
|
|
||||||
\vfill
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
\problem{}
|
|
||||||
The \say{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
|
|
||||||
\hint{
|
|
||||||
What is the dimension of the input? What is the dimension of the desired output? \\
|
|
||||||
What do these two values tell us about the dimension of the matrix $A$?
|
|
||||||
}
|
|
||||||
|
|
||||||
\begin{solution}
|
|
||||||
\begin{equation*}
|
|
||||||
A = \begin{bmatrix}
|
|
||||||
1 & 1 & 1 & 0 \\
|
|
||||||
0 & 0 & 0 & 1 \\
|
|
||||||
\end{bmatrix}
|
|
||||||
\end{equation*}
|
|
||||||
\end{solution}
|
|
||||||
|
|
||||||
\vfill
|
|
||||||
\pagebreak
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
\generic{Remark:}
|
|
||||||
The way a quantum computer handles information is a bit different than the way a classical computer does.
|
|
||||||
For spooky physics reasons, all quantum gates must be invertible. Naturally, this implies that the usual
|
|
||||||
logic gates we use (and, or, xor) aren't valid quantum gates: each of these takes two inputs (four states)
|
|
||||||
and produces one output (two states), losing information by mapping many inputs to the same output. \par
|
|
||||||
\note[Note]{The \say{not} gate is fine. It is its own inverse, after all!}
|
|
||||||
|
|
||||||
\vspace{2mm}
|
|
||||||
|
|
||||||
Although we are still using classical bits, we'll design our gates to be reversible. \par
|
|
||||||
One consequence of the \say{reversibility} rule is that all quantum gate matrices must be square. \par
|
|
||||||
(i.e, they must take the same number of inputs and outputs.) \par
|
|
||||||
\note[Note]{All invertible matrices are square, but not all square matrices are invertible.}
|
|
||||||
|
|
||||||
\vspace{2mm}
|
|
||||||
|
|
||||||
This is fairly intuitive: if we have more inputs than we have outputs, we inevitably lose information.
|
|
||||||
|
|
||||||
\vspace{2mm}
|
|
||||||
|
|
||||||
There's also a better way to think about this: rather than seeing quantum gates as \textit{functions}
|
|
||||||
that consume one set of bits and produce another, it's better to think of them as \textit{transformations}
|
|
||||||
we apply to an existing set of bits.
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
\problem{}
|
|
||||||
For example, take the CNOT (controlled not) gate. \par
|
|
||||||
When applied to a two-bit state $\ket{ab}$, CNOT inverts $b$ iff $a$ is $\ket{1}$. \par
|
|
||||||
Find the matrix that represents the CNOT gate. \par
|
|
||||||
\hint{what are the dimensions of this matrix?}
|
|
||||||
|
|
||||||
\begin{solution}
|
|
||||||
\begin{equation*}
|
|
||||||
\text{CNOT} = \begin{bmatrix}
|
|
||||||
1 & 0 & 0 & 0 \\
|
|
||||||
0 & 1 & 0 & 0 \\
|
|
||||||
0 & 0 & 0 & 1 \\
|
|
||||||
0 & 0 & 1 & 0 \\
|
|
||||||
\end{bmatrix}
|
|
||||||
\end{equation*}
|
|
||||||
|
|
||||||
\vspace{4mm}
|
|
||||||
|
|
||||||
If $\ket{a}$ is $\ket{0}$, $\ket{a} \otimes \ket{b}$ is
|
|
||||||
$
|
|
||||||
\begin{bmatrix}
|
|
||||||
\begin{bmatrix}
|
|
||||||
b_1 \\ b_2
|
|
||||||
\end{bmatrix} \\ 0 \\ 0
|
|
||||||
\end{bmatrix}
|
|
||||||
$, and the \say{not} portion of the matrix is ignored.
|
|
||||||
|
|
||||||
|
|
||||||
\vspace{4mm}
|
|
||||||
|
|
||||||
If $\ket{a}$ is $\ket{1}$, $\ket{a} \otimes \ket{b}$ is
|
|
||||||
$
|
|
||||||
\begin{bmatrix}
|
|
||||||
0 \\ 0 \\
|
|
||||||
\begin{bmatrix}
|
|
||||||
b_1 \\ b_2
|
|
||||||
\end{bmatrix}
|
|
||||||
\end{bmatrix}
|
|
||||||
$, 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
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
\problem{}
|
|
||||||
Now, modify the CNOT gate so that it inverts $\ket{a}$ whenever it is applied.
|
|
||||||
|
|
||||||
\begin{solution}
|
|
||||||
\begin{equation*}
|
|
||||||
\text{CNOT}_{\text{mod}} = \begin{bmatrix}
|
|
||||||
0 & 1 & 0 & 0 \\
|
|
||||||
1 & 0 & 0 & 0 \\
|
|
||||||
0 & 0 & 1 & 0 \\
|
|
||||||
0 & 0 & 0 & 1 \\
|
|
||||||
\end{bmatrix}
|
|
||||||
\end{equation*}
|
|
||||||
\end{solution}
|
|
||||||
|
|
||||||
\vfill
|
|
||||||
\pagebreak
|
|
||||||
|
|
||||||
\iffalse
|
|
||||||
\problem{}
|
|
||||||
Finally, modify the original CNOT gate so that the roles of its bits are reversed: \par
|
|
||||||
$\text{CNOT}_{\text{flip}} \ket{ab}$ should invert $\ket{a}$ iff $\ket{b}$ is $\ket{1}$.
|
|
||||||
|
|
||||||
|
|
||||||
\begin{solution}
|
|
||||||
\begin{equation*}
|
|
||||||
\text{CNOT}_{\text{flip}} = \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
|
|
||||||
\fi
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
\problem{}
|
|
||||||
The SWAP gate swaps two bits: $\text{SWAP}\ket{ab} = \ket{ba}$. \par
|
|
||||||
Find its matrix.
|
|
||||||
|
|
||||||
\begin{solution}
|
|
||||||
\begin{equation*}
|
|
||||||
\text{SWAP} = \begin{bmatrix}
|
|
||||||
1 & 0 & 0 & 0 \\
|
|
||||||
0 & 0 & 1 & 0 \\
|
|
||||||
0 & 1 & 0 & 0 \\
|
|
||||||
0 & 0 & 0 & 1 \\
|
|
||||||
\end{bmatrix}
|
|
||||||
\end{equation*}
|
|
||||||
\end{solution}
|
|
||||||
|
|
||||||
\vfill
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
\problem{}
|
|
||||||
The $T$ gate is a three-bit gate that inverts its right bit iff its left and middle inputs are both $\ket{1}$. \par
|
|
||||||
In other words, $T\ket{11x} = \ket{11}\ket{\text{not } x}$, and $T\ket{abx} = \ket{abx}$ for all other inputs. \par
|
|
||||||
Find the $T$ gate's matrix. \par
|
|
||||||
\note{
|
|
||||||
This gate is particularly interesting because it's a \textit{universal quantum gate}: \\
|
|
||||||
like NOR and NAND in classical logic, any quantum gate may emulated by only applying $T$ gates.
|
|
||||||
}
|
|
||||||
|
|
||||||
\begin{solution}
|
|
||||||
\begin{equation*}
|
|
||||||
\text{T} = \begin{bmatrix}
|
|
||||||
1 & 0 & 0 & 0 & 0 & 0 & 0 & 0 \\
|
|
||||||
0 & 1 & 0 & 0 & 0 & 0 & 0 & 0 \\
|
|
||||||
0 & 0 & 1 & 0 & 0 & 0 & 0 & 0 \\
|
|
||||||
0 & 0 & 0 & 1 & 0 & 0 & 0 & 0 \\
|
|
||||||
0 & 0 & 0 & 0 & 1 & 0 & 0 & 0 \\
|
|
||||||
0 & 0 & 0 & 0 & 0 & 1 & 0 & 0 \\
|
|
||||||
0 & 0 & 0 & 0 & 0 & 0 & 0 & 1 \\
|
|
||||||
0 & 0 & 0 & 0 & 0 & 0 & 1 & 0 \\
|
|
||||||
\end{bmatrix}
|
|
||||||
\end{equation*}
|
|
||||||
\end{solution}
|
|
||||||
|
|
||||||
\vfill
|
|
||||||
\pagebreak
|
|
||||||
|
|
||||||
The last thing we need is a way to draw complex sequences of gates. \par
|
|
||||||
We already know how to do this with classical gates:
|
|
||||||
|
|
||||||
\begin{center}
|
|
||||||
\begin{tikzpicture}[circuit logic US, scale=1.5]
|
|
||||||
\node[and gate] (and) at (0,-0.8) {\tiny\texttt{and}};
|
|
||||||
\draw ([shift={(-0.5, 0)}] and.input 1) node[left] {\texttt{1}} -- (and.input 1);
|
|
||||||
\draw ([shift={(-0.5, 0)}] and.input 2) node[left] {\texttt{0}} -- (and.input 2);
|
|
||||||
\draw (and.output) -- ([shift={(0.5, 0)}] and.output) node[right] {\texttt{0}};
|
|
||||||
\end{tikzpicture}
|
|
||||||
\end{center}
|
|
||||||
|
|
||||||
We draw quantum circuits in a very similar way. \par
|
|
||||||
For example, here a simple three-bit circuit consisting of a CNOT gate on the first bit, \par
|
|
||||||
controlled by the third. The first bit is X'd iff the third bit is $\ket{1}$:
|
|
||||||
|
|
||||||
\begin{center}
|
|
||||||
\begin{tikzpicture}[scale=1]
|
|
||||||
\node[qubit] (a) at (0, 0) {$\ket{0}$};
|
|
||||||
\node[qubit] (b) at (0, -1) {$\ket{0}$};
|
|
||||||
\node[qubit] (c) at (0, -2) {$\ket{1}$};
|
|
||||||
|
|
||||||
\draw[wire] (a) -- ([shift={(4, 0)}] a.center) node[qubit] {$\ket{1}$};
|
|
||||||
\draw[wire] (b) -- ([shift={(4, 0)}] b.center) node[qubit] {$\ket{0}$};
|
|
||||||
\draw[wire] (c) -- ([shift={(4, 0)}] c.center) node[qubit] {$\ket{1}$};
|
|
||||||
|
|
||||||
\draw[wire]
|
|
||||||
($([shift={(1,0)}] a)!0.5!([shift={(3,0)}] a)$) --
|
|
||||||
($([shift={(1,0)}] c)!0.5!([shift={(3,0)}] c)$)
|
|
||||||
;
|
|
||||||
|
|
||||||
\draw[wirejoin]
|
|
||||||
($([shift={(1,0)}] c)!0.5!([shift={(3,0)}] c)$)
|
|
||||||
circle[radius=0.1] coordinate(dot)
|
|
||||||
;
|
|
||||||
|
|
||||||
\qubox{a}{1}{a}{3}{CNOT};
|
|
||||||
\end{tikzpicture}
|
|
||||||
\end{center}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
\problem{}
|
|
||||||
Draw the CNOT gate as a classical logic circuit. \par
|
|
||||||
\hint{This can be done with one gate.}
|
|
||||||
|
|
||||||
\begin{solution}
|
|
||||||
\begin{center}
|
|
||||||
\begin{tikzpicture}[circuit logic US, scale=2]
|
|
||||||
\node[xor gate] (xor) at (0, 0) {\tiny\texttt{xor}};
|
|
||||||
\draw (xor.input 1) ++(-0.5, 0) coordinate (start);
|
|
||||||
\draw (xor.input 1) ++(-0.25, 0) coordinate (startjoin);
|
|
||||||
\draw (xor.input 1) -- (xor.input 1 -| start) node[left] {$a$};
|
|
||||||
\draw (xor.input 2) -| (0,-0.25 -| startjoin) |- (0,-0.25, -| start) node[left] {$b$};
|
|
||||||
\filldraw (0,-0.25, -| startjoin) circle[radius=0.3mm] coordinate(dot);
|
|
||||||
\draw (dot) -- (dot -| 1,0) node[right] {$b_\text{out}$};
|
|
||||||
\draw (xor.output) -- (xor.output -| 1,0) node[right] {$a_\text{out}$};
|
|
||||||
\end{tikzpicture}
|
|
||||||
\end{center}
|
|
||||||
\end{solution}
|
|
||||||
|
|
||||||
|
|
||||||
\vfill
|
|
||||||
|
|
||||||
Gate controls may be marked with a filled circle or an empty circle. \par
|
|
||||||
Empty circles denote \textit{inverse controls,} which (of course) have an inverse effect. \par
|
|
||||||
For example, the two circuits below are identical:
|
|
||||||
|
|
||||||
\null\hfill
|
|
||||||
\begin{minipage}{0.48\textwidth}
|
|
||||||
\begin{center}
|
|
||||||
\begin{tikzpicture}[scale=1]
|
|
||||||
\node[qubit] (a) at (0, 0) {$\ket{0}$};
|
|
||||||
\node[qubit] (b) at (0, -1) {$\ket{0}$};
|
|
||||||
|
|
||||||
\draw[wire] (a) -- ([shift={(4, 0)}] a.center) node[qubit] {$\ket{a}$};
|
|
||||||
\draw[wire] (b) -- ([shift={(4, 0)}] b.center) node[qubit] {$\ket{b}$};
|
|
||||||
|
|
||||||
\draw[wire]
|
|
||||||
($([shift={(1,0)}] a)!0.5!([shift={(3,0)}] a)$) --
|
|
||||||
($([shift={(1,0)}] b)!0.5!([shift={(3,0)}] b)$)
|
|
||||||
;
|
|
||||||
|
|
||||||
\draw[wireijoin]
|
|
||||||
($([shift={(1,0)}] b)!0.5!([shift={(3,0)}] b)$)
|
|
||||||
circle[radius=0.1] coordinate(dot)
|
|
||||||
;
|
|
||||||
|
|
||||||
\qubox{a}{1}{a}{3}{CNOT};
|
|
||||||
\end{tikzpicture}
|
|
||||||
\end{center}
|
|
||||||
\end{minipage}
|
|
||||||
\hfill
|
|
||||||
\begin{minipage}{0.48\textwidth}
|
|
||||||
\begin{center}
|
|
||||||
\begin{tikzpicture}[scale=1]
|
|
||||||
\node[qubit] (a) at (0, 0) {$\ket{0}$};
|
|
||||||
\node[qubit] (b) at (0, -1) {$\ket{0}$};
|
|
||||||
|
|
||||||
\draw[wire] (a) -- ([shift={(4, 0)}] a.center) node[qubit] {$\ket{a}$};
|
|
||||||
\draw[wire] (b) -- ([shift={(4, 0)}] b.center) node[qubit] {$\ket{b}$};
|
|
||||||
|
|
||||||
\draw[wire]
|
|
||||||
($([shift={(1.5,0)}] a)!0.5!([shift={(2.5,0)}] a)$) --
|
|
||||||
($([shift={(1.5,0)}] b)!0.5!([shift={(2.5,0)}] b)$)
|
|
||||||
;
|
|
||||||
|
|
||||||
\draw[wirejoin]
|
|
||||||
($([shift={(1.5,0)}] b)!0.5!([shift={(2.5,0)}] b)$)
|
|
||||||
circle[radius=0.1] coordinate(dot)
|
|
||||||
;
|
|
||||||
\qubox{a}{1}{a}{3}{CNOT};
|
|
||||||
\qubox{b}{0.5}{b}{1.5}{X};
|
|
||||||
\qubox{b}{2.5}{b}{3.5}{X};
|
|
||||||
\end{tikzpicture}
|
|
||||||
\end{center}
|
|
||||||
\end{minipage}
|
|
||||||
\hfill\null
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
\problem{}
|
|
||||||
What are $\ket{a}$ and $\ket{b}$ in the diagrams above?
|
|
||||||
|
|
||||||
\begin{solution}
|
|
||||||
\begin{center}
|
|
||||||
\begin{tikzpicture}[scale=1]
|
|
||||||
\node[qubit] (a) at (0, 0) {$\ket{0}$};
|
|
||||||
\node[qubit] (b) at (0, -1) {$\ket{0}$};
|
|
||||||
|
|
||||||
\draw[wire] (a) -- ([shift={(4, 0)}] a.center) node[qubit] {$\ket{1}$};
|
|
||||||
\draw[wire] (b) -- ([shift={(4, 0)}] b.center) node[qubit] {$\ket{0}$};
|
|
||||||
|
|
||||||
\draw[wire]
|
|
||||||
($([shift={(1,0)}] a)!0.5!([shift={(3,0)}] a)$) --
|
|
||||||
($([shift={(1,0)}] b)!0.5!([shift={(3,0)}] b)$)
|
|
||||||
;
|
|
||||||
|
|
||||||
\draw[wireijoin]
|
|
||||||
($([shift={(1,0)}] b)!0.5!([shift={(3,0)}] b)$)
|
|
||||||
circle[radius=0.1] coordinate(dot)
|
|
||||||
;
|
|
||||||
|
|
||||||
\qubox{a}{1}{a}{3}{CNOT};
|
|
||||||
\end{tikzpicture}
|
|
||||||
\end{center}
|
|
||||||
\end{solution}
|
|
||||||
|
|
||||||
\vfill
|
|
||||||
\pagebreak
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
As we noted before, quantum gates are \textit{transformations,} modifying a set of bits. \par
|
|
||||||
Thus, quantum circuits are drawn with a fixed set of bits, whose states transform with time. \par
|
|
||||||
\note[Note]{
|
|
||||||
In this diagram, CNOT and SWAP are drawn as $\oplus$ and \rotatebox[origin=c]{90}{$\leftrightarrows$} to save space.
|
|
||||||
}
|
|
||||||
|
|
||||||
\begin{center}
|
|
||||||
\begin{tikzpicture}[scale=1]
|
|
||||||
\node[qubit] (a) at (0, 0) {$\ket{a}$};
|
|
||||||
\node[qubit] (b) at (0, -1) {$\ket{1}$};
|
|
||||||
\node[qubit] (c) at (0, -2) {$\ket{c}$};
|
|
||||||
\node[qubit] (d) at (0, -3) {$\ket{d}$};
|
|
||||||
\node[qubit] (e) at (0, -4) {$\ket{1}$};
|
|
||||||
|
|
||||||
\draw[wire] (a) -- ([shift={(7, 0)}] a.center) node[qubit] {$\ket{0}$};
|
|
||||||
\draw[wire] (b) -- ([shift={(7, 0)}] b.center) node[qubit] {$\ket{b}$};
|
|
||||||
\draw[wire] (c) -- ([shift={(7, 0)}] c.center) node[qubit] {$\ket{1}$};
|
|
||||||
\draw[wire] (d) -- ([shift={(7, 0)}] d.center) node[qubit] {$\ket{0}$};
|
|
||||||
\draw[wire] (e) -- ([shift={(7, 0)}] e.center) node[qubit] {$\ket{e}$};
|
|
||||||
|
|
||||||
|
|
||||||
\draw[wire]
|
|
||||||
($([shift={(1,0)}] a)!0.5!([shift={(2,0)}] a)$) --
|
|
||||||
($([shift={(1,0)}] c)!0.5!([shift={(2,0)}] c)$)
|
|
||||||
;
|
|
||||||
\draw[wirejoin]
|
|
||||||
($([shift={(1,0)}] b)!0.5!([shift={(2,0)}] b)$)
|
|
||||||
circle[radius=0.1] coordinate(dot)
|
|
||||||
;
|
|
||||||
\draw[wireijoin]
|
|
||||||
($([shift={(1,0)}] c)!0.5!([shift={(2,0)}] c)$)
|
|
||||||
circle[radius=0.1] coordinate(dot)
|
|
||||||
;
|
|
||||||
\qubox{a}{1}{a}{2}{T};
|
|
||||||
|
|
||||||
\qubox{a}{4}{a}{5}{X};
|
|
||||||
|
|
||||||
\draw[wire]
|
|
||||||
($([shift={(2,0)}] e)!0.5!([shift={(3,0)}] e)$) --
|
|
||||||
($([shift={(2,0)}] d)!0.5!([shift={(3,0)}] d)$)
|
|
||||||
;
|
|
||||||
\draw[wireijoin]
|
|
||||||
($([shift={(2,0)}] d)!0.5!([shift={(3,0)}] d)$)
|
|
||||||
circle[radius=0.1] coordinate(dot)
|
|
||||||
;
|
|
||||||
\qubox{e}{2}{e}{3}{$\oplus$};
|
|
||||||
|
|
||||||
\qubox{b}{3}{c}{4}{\rotatebox[origin=c]{90}{$\leftrightarrows$}};
|
|
||||||
|
|
||||||
|
|
||||||
\draw[wire]
|
|
||||||
($([shift={(5,0)}] a)!0.5!([shift={(6,0)}] a)$) --
|
|
||||||
($([shift={(5,0)}] c)!0.5!([shift={(6,0)}] c)$)
|
|
||||||
;
|
|
||||||
\draw[wirejoin]
|
|
||||||
($([shift={(5,0)}] a)!0.5!([shift={(6,0)}] a)$)
|
|
||||||
circle[radius=0.1] coordinate(dot)
|
|
||||||
;
|
|
||||||
\draw[wirejoin]
|
|
||||||
($([shift={(5,0)}] c)!0.5!([shift={(6,0)}] c)$)
|
|
||||||
circle[radius=0.1] coordinate(dot)
|
|
||||||
;
|
|
||||||
\qubox{b}{5}{b}{6}{T};
|
|
||||||
\end{tikzpicture}
|
|
||||||
\end{center}
|
|
||||||
|
|
||||||
In a quantum circuit, the ONLY way two bits can interact is through a gate. \par
|
|
||||||
We cannot add \say{branches} in quantum circuits like we do in classical circuits:
|
|
||||||
|
|
||||||
\begin{center}
|
|
||||||
\begin{tikzpicture}[circuit logic US, scale=1.2]
|
|
||||||
\node[xor gate] (xor) at (0, 0) {\tiny\texttt{xor}};
|
|
||||||
\draw (xor.input 1) ++(-0.5, 0) coordinate (start);
|
|
||||||
\draw (xor.input 1) ++(-0.25, 0) coordinate (startjoin);
|
|
||||||
\draw (xor.input 1) -- (xor.input 1 -| start) node[left] {$x$};
|
|
||||||
\draw (xor.input 2) -| (0,-0.25 -| startjoin) |- (0,-0.25, -| start) node[left] {$y$};
|
|
||||||
\filldraw (0,-0.25, -| startjoin) circle[radius=0.3mm] coordinate(dot);
|
|
||||||
\draw (dot) -- (dot -| 1,0) node[right] {$y_\text{out}$};
|
|
||||||
\draw (xor.output) -- (xor.output -| 1,0) node[right] {$x_\text{out}$};
|
|
||||||
|
|
||||||
\draw[->, line width = 1, ogrape]
|
|
||||||
([shift={(0.3,-0.5)}] dot) node[right] {This is a branch}
|
|
||||||
-| ([shift={(0,-0.2)}] dot)
|
|
||||||
;
|
|
||||||
\end{tikzpicture}
|
|
||||||
\end{center}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
\problem{}
|
|
||||||
Find the values of $\ket{a}$ through $\ket{e}$ in the above circuit.
|
|
||||||
|
|
||||||
\begin{solution}
|
|
||||||
\begin{center}
|
|
||||||
\begin{tikzpicture}[scale=1]
|
|
||||||
\node[qubit] (a) at (0, 0) {$\ket{1}$};
|
|
||||||
\node[qubit] (b) at (0, -1) {$\ket{1}$};
|
|
||||||
\node[qubit] (c) at (0, -2) {$\ket{1}$};
|
|
||||||
\node[qubit] (d) at (0, -3) {$\ket{0}$};
|
|
||||||
\node[qubit] (e) at (0, -4) {$\ket{1}$};
|
|
||||||
|
|
||||||
\draw[wire] (a) -- ([shift={(7, 0)}] a.center) node[qubit] {$\ket{0}$};
|
|
||||||
\draw[wire] (b) -- ([shift={(7, 0)}] b.center) node[qubit] {$\ket{1}$};
|
|
||||||
\draw[wire] (c) -- ([shift={(7, 0)}] c.center) node[qubit] {$\ket{1}$};
|
|
||||||
\draw[wire] (d) -- ([shift={(7, 0)}] d.center) node[qubit] {$\ket{0}$};
|
|
||||||
\draw[wire] (e) -- ([shift={(7, 0)}] e.center) node[qubit] {$\ket{0}$};
|
|
||||||
|
|
||||||
|
|
||||||
\draw[wire]
|
|
||||||
($([shift={(1,0)}] a)!0.5!([shift={(2,0)}] a)$) --
|
|
||||||
($([shift={(1,0)}] c)!0.5!([shift={(2,0)}] c)$)
|
|
||||||
;
|
|
||||||
\draw[wirejoin]
|
|
||||||
($([shift={(1,0)}] b)!0.5!([shift={(2,0)}] b)$)
|
|
||||||
circle[radius=0.1] coordinate(dot)
|
|
||||||
;
|
|
||||||
\draw[wireijoin]
|
|
||||||
($([shift={(1,0)}] c)!0.5!([shift={(2,0)}] c)$)
|
|
||||||
circle[radius=0.1] coordinate(dot)
|
|
||||||
;
|
|
||||||
\qubox{a}{1}{a}{2}{T};
|
|
||||||
|
|
||||||
\qubox{a}{4}{a}{5}{X};
|
|
||||||
|
|
||||||
\draw[wire]
|
|
||||||
($([shift={(2,0)}] e)!0.5!([shift={(3,0)}] e)$) --
|
|
||||||
($([shift={(2,0)}] d)!0.5!([shift={(3,0)}] d)$)
|
|
||||||
;
|
|
||||||
\draw[wireijoin]
|
|
||||||
($([shift={(2,0)}] d)!0.5!([shift={(3,0)}] d)$)
|
|
||||||
circle[radius=0.1] coordinate(dot)
|
|
||||||
;
|
|
||||||
\qubox{e}{2}{e}{3}{$\oplus$};
|
|
||||||
|
|
||||||
\qubox{b}{3}{c}{4}{\rotatebox[origin=c]{90}{$\leftrightarrows$}};
|
|
||||||
|
|
||||||
|
|
||||||
\draw[wire]
|
|
||||||
($([shift={(5,0)}] a)!0.5!([shift={(6,0)}] a)$) --
|
|
||||||
($([shift={(5,0)}] c)!0.5!([shift={(6,0)}] c)$)
|
|
||||||
;
|
|
||||||
\draw[wirejoin]
|
|
||||||
($([shift={(5,0)}] a)!0.5!([shift={(6,0)}] a)$)
|
|
||||||
circle[radius=0.1] coordinate(dot)
|
|
||||||
;
|
|
||||||
\draw[wirejoin]
|
|
||||||
($([shift={(5,0)}] c)!0.5!([shift={(6,0)}] c)$)
|
|
||||||
circle[radius=0.1] coordinate(dot)
|
|
||||||
;
|
|
||||||
\qubox{b}{5}{b}{6}{T};
|
|
||||||
\end{tikzpicture}
|
|
||||||
\end{center}
|
|
||||||
\end{solution}
|
|
||||||
|
|
||||||
|
|
||||||
\vfill
|
|
||||||
\pagebreak
|
|
@ -32,6 +32,11 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
% Macros
|
% Macros
|
||||||
|
|
||||||
|
|
||||||
|
% Do NOT put a semicolon after qubox,
|
||||||
|
% it gives a "character ; not found" error.
|
||||||
|
% LaTeX is odd.
|
||||||
\def\qubox#1#2#3#4#5{
|
\def\qubox#1#2#3#4#5{
|
||||||
% 1: point ne
|
% 1: point ne
|
||||||
% 2: point ne x offset
|
% 2: point ne x offset
|
||||||
|
Loading…
x
Reference in New Issue
Block a user