\section{One Bit}
Before we discuss quantum computation, we first need to construct a few tools. \par
To keep things simple, we'll use regular (usually called \textit{classical}) bits for now.





\definition{Binary Digits}
$\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 the set of integers mod 2.}

\vspace{2mm}






\definition{Cartesian Products}
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
As usual, we can write $A \times A \times A$ as $A^3$. \par

\vspace{2mm}

In this handout, we'll often see the following sets:
\begin{itemize}
	\item $\mathbb{R}^2$, a two-dimensional plane
	\item $\mathbb{R}^n$, an n-dimensional space
	\item $\mathbb{B}^2$, the set
	$\{(\texttt{0},\texttt{0}), (\texttt{0},\texttt{1}), (\texttt{1},\texttt{0}), (\texttt{1},\texttt{1})\}$
	\item $\mathbb{B}^n$, the set of all possible states of $n$ bits.
\end{itemize}









\problem{}
What is the size of $\mathbb{B}^n$?

\vfill
\pagebreak







% NOTE: this is time-travelled later in the handout.
% if you edit this, edit that too.
\generic{Remark:}
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
We'll therefore say that \texttt{0} and \texttt{1} \textit{orthogonal} (or equivalently, \textit{perpendicular}). \par

\vspace{2mm}

We can draw $\vec{e}_0$ and $\vec{e}_1$ as perpendicular axis on a plane to represent this:

\begin{center}
	\begin{tikzpicture}[scale=1.5]
		\fill[color = black] (0, 0) circle[radius=0.05];

		\draw[->] (0, 0) -- (1.5, 0);
		\node[right] at (1.5, 0) {$\vec{e}_0$ axis};
		\fill[color = oblue] (1, 0) circle[radius=0.05];
		\node[below] at (1, 0) {\texttt{0}};

		\draw[->] (0, 0) -- (0, 1.5);
		\node[above] at (0, 1.5) {$\vec{e}_1$ axis};
		\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 $\vec{e}_0$, and all parts $\vec{e}_1$. \par
Of course, we can say something similar about the point marked $0$: \par
It is at $[1, 0] = (1 \times \vec{e}_0) + (0 \times \vec{e}_1)$, and is thus all $\vec{e}_0$ and no $\vec{e}_1$. \par

\vspace{2mm}

Naturally, the coordinates $[0, 1]$ and $[1, 0]$ denote how much of each axis a point \say{contains.} \par
We could, of course, mark the point \texttt{x} at $[1, 1]$, which is equal parts $\vec{e}_0$ and $\vec{e}_1$: \par
\note[Note]{
	We could also write $\texttt{x} = \vec{e}_0 + \vec{e}_1$ explicitly. \\
	I've drawn \texttt{x} as a point on the left, and as a sum on the right.
}

\null\hfill
\begin{minipage}{0.48\textwidth}
\begin{center}
	\begin{tikzpicture}[scale=1.5]
		\fill[color = black] (0, 0) circle[radius=0.05];

		\draw[->] (0, 0) -- (1.5, 0);
		\node[right] at (1.5, 0) {$\vec{e}_0$ axis};

		\draw[->] (0, 0) -- (0, 1.5);
		\node[above] at (0, 1.5) {$\vec{e}_1$ axis};

		\fill[color = oblue] (1, 0) circle[radius=0.05];
		\node[below] at (1, 0) {\texttt{0}};

		\fill[color = oblue] (0, 1) circle[radius=0.05];
		\node[left] at (0, 1) {\texttt{1}};

		\draw[dashed, color = gray, ->] (0, 0) -- (0.9, 0.9);
		\fill[color = oblue] (1, 1) circle[radius=0.05];
		\node[above right] at (1, 1) {\texttt{x}};
	\end{tikzpicture}
\end{center}
\end{minipage}
\hfill
\begin{minipage}{0.48\textwidth}
	\begin{center}
		\begin{tikzpicture}[scale=1.5]
			\fill[color = black] (0, 0) circle[radius=0.05];

			\fill[color = oblue] (1, 0) circle[radius=0.05];
			\node[below] at (1, 0) {\texttt{0}};

			\fill[color = oblue] (0, 1) circle[radius=0.05];
			\node[left] at (0, 1) {\texttt{1}};

			\draw[dashed, color = gray, ->] (0, 0) -- (0.9, 0.0);
			\draw[dashed, color = gray, ->] (1, 0.1) -- (1, 0.9);
			\fill[color = oblue] (1, 1) circle[radius=0.05];
			\node[above right] at (1, 1) {\texttt{x}};
		\end{tikzpicture}
	\end{center}
\end{minipage}
\hfill\null

\vspace{4mm}

But \texttt{x} isn't a member of $\mathbb{B}$, it's not a valid state. \par
Our bit is fully $\vec{e}_0$ or fully $\vec{e}_1$. By our current definitions, there's nothing in between. \par
\note{
	Note that the unit vectors $\vec{e}_0$ and $\vec{e}_1$ form an \textit{orthonormal basis} of the plane $\mathbb{R}^2$.
}

\vfill

\pagebreak

















\definition{Vectored Bits}
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

\null\hfill
\begin{minipage}{0.48\textwidth}
	\[ \ket{0} = \begin{bmatrix} 1 \\ 0 \end{bmatrix} = (1 \times \vec{e}_0) + (0 \times \vec{e}_1) \]
\end{minipage}
\hfill
\begin{minipage}{0.48\textwidth}
	\[ \ket{1} = \begin{bmatrix} 0 \\ 1 \end{bmatrix} = (0 \times \vec{e}_0) + (1 \times \vec{e}_1) \]
\end{minipage}
\hfill\null

\vspace{2mm}

This may seem needlessly complex---and it is, for classical bits. \par
We'll see why this is useful soon enough.

\generic{One more thing:}
The $\ket{~}$ you see in the two 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.} \par
This is called bra-ket notation. $\bra{0}$ is called a \say{bra,} but we won't worry about that for now.










\problem{}
Write \texttt{x} and \texttt{y} in the diagram below in terms of $\ket{0}$ and $\ket{1}$. \par

\begin{center}
\begin{tikzpicture}[scale=1.5]
	\fill[color = black] (0, 0) circle[radius=0.05];

	\draw[->] (0, 0) -- (1.5, 0);
	\node[right] at (1.5, 0) {$\vec{e}_0$ axis};

	\draw[->] (0, 0) -- (0, 1.5);
	\node[above] at (0, 1.5) {$\vec{e}_1$ axis};

	\fill[color = oblue] (1, 0) circle[radius=0.05];
	\node[below] at (1, 0) {$\ket{0}$};

	\fill[color = oblue] (0, 1) circle[radius=0.05];
	\node[left] at (0, 1) {$\ket{1}$};

	\draw[dashed, color = gray, ->] (0, 0) -- (0.9, 0.9);
	\fill[color = ored] (1, 1) circle[radius=0.05];
	\node[above right] at (1, 1) {\texttt{x}};

	\draw[dashed, color = gray, ->] (0, 0) -- (-0.9, 0.9);
	\fill[color = ored] (-1, 1) circle[radius=0.05];
	\node[above right] at (-1, 1) {\texttt{y}};
\end{tikzpicture}
\end{center}

\vfill
\pagebreak