diff --git a/tests/graph_storage/runtime_all_array_graph_add_edges.png b/tests/graph_storage/runtime_all_array_graph_add_edges.png new file mode 100644 index 0000000..0afbb38 Binary files /dev/null and b/tests/graph_storage/runtime_all_array_graph_add_edges.png differ diff --git a/tests/graph_storage/runtime_all_array_graph_construction.png b/tests/graph_storage/runtime_all_array_graph_construction.png new file mode 100644 index 0000000..826f858 Binary files /dev/null and b/tests/graph_storage/runtime_all_array_graph_construction.png differ diff --git a/tests/graph_storage/runtime_dok_matrix_graph_add_edges.png b/tests/graph_storage/runtime_dok_matrix_graph_add_edges.png new file mode 100644 index 0000000..d384f55 Binary files /dev/null and b/tests/graph_storage/runtime_dok_matrix_graph_add_edges.png differ diff --git a/tests/graph_storage/runtime_dok_matrix_graph_construction.png b/tests/graph_storage/runtime_dok_matrix_graph_construction.png new file mode 100644 index 0000000..13fb20e Binary files /dev/null and b/tests/graph_storage/runtime_dok_matrix_graph_construction.png differ diff --git a/tests/graph_storage/runtime_networkx_graph_add_edges.png b/tests/graph_storage/runtime_networkx_graph_add_edges.png new file mode 100644 index 0000000..5055fb8 Binary files /dev/null and b/tests/graph_storage/runtime_networkx_graph_add_edges.png differ diff --git a/tests/graph_storage/runtime_networkx_graph_construction.png b/tests/graph_storage/runtime_networkx_graph_construction.png new file mode 100644 index 0000000..96d5072 Binary files /dev/null and b/tests/graph_storage/runtime_networkx_graph_construction.png differ diff --git a/thesis/chapters/introduction_qc.tex b/thesis/chapters/introduction_qc.tex new file mode 100644 index 0000000..66d2b5b --- /dev/null +++ b/thesis/chapters/introduction_qc.tex @@ -0,0 +1,81 @@ +% vim: ft=tex +\section{Introduction to Binary Quantum Computing} + +\subsection{Single Qbits} + +A qbit is a two-level quantum mechanical system $ \{\ket{\uparrow} \equiv \ket{1}, \ket{\downarrow} \equiv \ket{0}\} $ +with $\braket{\uparrow}{\downarrow} = 0$. One can associate +$\ket{\uparrow} \equiv \left(\begin{array}{c} 0 \\ 1\end{array} \right)$ and +$\ket{\downarrow} \equiv \left(\begin{array}{c} 1 \\ 0 \end{array} \right)$ which +is helpful in the following discussion. + +A gate operating on a qbit is a unitary operator $G \in U(2)$. One can show that +$\forall G \in U(2)$ $G$ can be expressed as a product of unitary generator matrices, +common choices for the generators are $ X, H, R_{\phi}$ and $Z, H, R_{\phi}$ with +\label{ref:singleqbitgates} + +$$X := \left(\begin{array}{cc} 0 & 1 \\ 1 & 0\end{array}\right) $$ +$$Z := \left(\begin{array}{cc} 1 & 0 \\ 0 & -1\end{array}\right) $$ +$$H := \frac{1}{\sqrt{2}}\left(\begin{array}{cc} 1 & 1 \\ 1 & -1\end{array}\right) $$ +$$R_{\phi} := \left(\begin{array}{cc} 1 & 0 \\ 0 & \exp(i\phi)\end{array}\right) $$ + +\subsection{$N$ Qbit Systems} +\label{ref:nqbitsystems} + +A system of $N$ identical qbits is described by the kronecker product of the +single qbit states. A nice definition for this product is: + +\begin{definition} + +Let $M$, $N$ be complex matrices, $M = \left(\begin{array}{cc} M_1 & M_2 \\ M_3 & M_4 \end{array}\right)$ +. Then the kronecker product is defined as + +$$M \otimes N = \left(\begin{array}{cc} M_1 \otimes N & M_2 \otimes N \\ M_3 \otimes N & M_4 \otimes N \end{array}\right)$$ + +Where for any $c \in \mathbb{C}$ $ c \otimes N := cN$. +\end{definition} + + +\begin{postulate} +A $N$ qbit quantum mechanical state is the kronecker product of the $N$ single qbit +state. +\end{postulate} + +Let $\ket{0}_s := \left(\begin{array}{c} 1 \\ 0 \end{array} \right)$ and $\ket{1}_s := \left(\begin{array}{c} 0 \\ 1 \end{array} \right)$ +be the basis of the one-qbit systems. Then two-qbit states are defined as + +$$ \ket{0} := \ket{0b00} := \ket{0}_s \otimes \ket{0}_s := \left(\begin{array}{c} 1 \\ 0 \\ 0 \\ 0 \end{array} \right)$$ +$$ \ket{1} := \ket{0b01} := \ket{0}_s \otimes \ket{1}_s := \left(\begin{array}{c} 0 \\ 1 \\ 0 \\ 0 \end{array} \right)$$ +$$ \ket{2} := \ket{0b10} := \ket{1}_s \otimes \ket{0}_s := \left(\begin{array}{c} 0 \\ 0 \\ 1 \\ 0 \end{array} \right)$$ +$$ \ket{3} := \ket{0b11} := \ket{1}_s \otimes \ket{1}_s := \left(\begin{array}{c} 0 \\ 0 \\ 0 \\ 1 \end{array} \right)$$ + +The $N$ qbit basis states can then be constructed in a similar manner. +A general $N$ qbit state can then be written as a superposition of the +basis states: + +$$ \ket{\psi} = \sum\limits_{i = 0}^{2^N - 1} c_i \ket{i} $$ +$$ \sum\limits_{i = 0}^{2^N - 1} |c_i|^2 = 1$$ + +One can show that the gates in \ref{ref:singleqbitgates} together with an entanglement gate, such as $CX$ or $CZ$ are enough +to generate an arbitrary $N$ qbit gate. + + +$$ CX(1, 0) = \left(\begin{array}{cccc} 1 & 0 & 0 & 0\\ 0 & 1 & 0 & 0\\ 0 & 0 & 0 & 1\\ 0 & 0 & 1 & 0 \end{array}\right)$$ +$$ CZ(1, 0) = \left(\begin{array}{cccc} 1 & 0 & 0 & 0\\ 0 & 1 & 0 & 0\\ 0 & 0 & 1 & 0\\ 0 & 0 & 0 & -1 \end{array}\right)$$ + + +Where $1$ is the act-qbit and $0$ the control-qbit. + +\subsection{Measurement} + +\begin{postulate} + + Let $\ket{\psi} = \alpha\ket{\phi_1} \otimes \ket{1}_n + \beta\ket{\phi_0} \otimes \ket{0}_n$ be a state + where $\ket{1}_n, \ket{0}_n$ denote the $n$-th qbit state and $|\alpha|^2 + |\beta|^2 = 1$. + Then the measurement of the $n$-th qbit will yield $\ket{\phi_1} \otimes \ket{1}_n$ with probability + $|\alpha|^2$ and $\ket{\phi_0} \otimes \ket{0}_n$ with probability $|\beta|^2$. + + This is called collapse of the wave function. +\end{postulate} + +Measuring a qbit will also yield a classical result $0$ or $1$ with the respective probabilities.