some more work

This commit is contained in:
Daniel Knüttel 2020-03-25 18:46:32 +01:00
parent e5337201ab
commit bcf9a9cebb
12 changed files with 114 additions and 21 deletions

View File

@ -25,7 +25,7 @@ def measure_all(input_circuits_and_states, **kwargs):
return results return results
def execution_statistics(results, scale=1, **kwargs): def execution_statistics(results, scale=None, **kwargs):
Ns = deque() Ns = deque()
avgs = deque() avgs = deque()
std_devs = deque() std_devs = deque()

View File

@ -6,7 +6,8 @@ chapters=chapters/introduction.tex \
chapters/quantum_computing.tex \ chapters/quantum_computing.tex \
chapters/stabilizer.tex \ chapters/stabilizer.tex \
chapters/implementation.tex \ chapters/implementation.tex \
chapters/conclusion.tex chapters/conclusion.tex \
chapters/appendix.tex
cover=cover.png cover=cover.png

View File

@ -0,0 +1,68 @@
% vim: ft=tex
\section{Appendix}
\subsection{Source Code for the Benchmarks}
\label{ref:code_benchmarks}
The benchmarks used in \ref{ref:performance} are done using this code. Note
that the execution time is measured which is inherently noisy. To account for
the noise several strategies are used:
\begin{enumerate}[1]
\item{The same circuit is applied to the starting state several times. The
minimal result is used as the noise must be positive}
\item{Several circuits are applied to the starting state. The remaining
noise is mixed with the variance due to the different circuits.}
\item{Because the noise can be timely correlated (i.e. another process
requires processor time for a longer period) the tests have been
randomized such that the time correlated noise is distributed randomly over
several uncorrelated measurements.}
\end{enumerate}
The code used to benchmark the three regimes is analogous and not included here.
\lstinputlisting[title={Generating Data for the Dense State Vector vs. Graphical Simulator Benchmark}, language=Python, breaklines=true]{../performance/generate_data_scaling_qbits.py}
\lstinputlisting[title={Code for Measuring and Computing the Execution Time and Statistics}, language=Python, breaklines=true]{../performance/measure_circuit.py}
\subsection{Complete Graphical States from the Three Regimes}
\label{ref:complete_graphs}
Because the whole graphs are barely percetible windows have been used
in Figure \ref{fig:graph_high_linear_regime} and Figure \ref{fig:graph_intermediate_regime}.
For the sake of completeness the whole graphs are included here in Figure \ref{fig:graph_low_linear_regime_full},
Figure \ref{fig:graph_intermediate_regime_full} and Figure \ref{fig:graph_high_linear_regime_full}.
\begin{figure}[H]
\centering
\includegraphics[width=\linewidth]{graphics/graph_low_linear_regime.png}
\caption[Typical Graphical State in the Low-Linear Regime]{Typical Graphical State in the Low-Linear Regime}
\label{fig:graph_low_linear_regime_full}
\end{figure}
\begin{figure}[H]
\centering
\includegraphics[width=\linewidth]{graphics/graph_intermediate_regime.png}
\caption[Typical Graphical State in the Intermediate Regime]{Typical Graphical State in the Intermediate Regime}
\label{fig:graph_intermediate_regime_full}
\end{figure}
\begin{figure}[H]
\centering
\includegraphics[width=\linewidth]{graphics/graph_high_linear_regime.png}
\caption[Typical Graphical State in the High-Linear Regime]{Typical Graphical State in the High-Linear Regime}
\label{fig:graph_high_linear_regime_full}
\end{figure}
\subsection{Code to Generate the Example Graphs}
\label{ref:code_example_graphs}
This code has been used to generate the example graphs used in
\ref{ref:performance}. Note that generating the graph is done using a random
circuit as used in \ref{ref:code_benchmarks}. The generated \lstinline{dot}
code is converted to an image using
\lstinline{dot i_regime.dot -Tpng -o i_regime.png}.
\lstinputlisting[title={Code used to Generate the Example Graphs}, language=Python, breaklines=true]{../performance/regimes/graph_intermediate_regime.py}

View File

@ -233,9 +233,6 @@ implemented in \lstinline{C} and are exported to python3 in the class
\lstinline{RawGraphState}. This class has three main methods to implement the \lstinline{RawGraphState}. This class has three main methods to implement the
three classes of operations. three classes of operations.
%
%
%
\begin{description} \begin{description}
\item[\hspace{-1em}]{\lstinline{RawGraphState.apply_C_L}\\ \item[\hspace{-1em}]{\lstinline{RawGraphState.apply_C_L}\\
This method implements local clifford gates. It takes the qbit index This method implements local clifford gates. It takes the qbit index
@ -408,12 +405,14 @@ qbits:
The reason for this scaling will be clear later; one can observe that the The reason for this scaling will be clear later; one can observe that the
performance of the graphical simulator increases in some cases with growing performance of the graphical simulator increases in some cases with growing
number of qbits when the circuit length is constant. number of qbits when the circuit length is constant. The code used to generate the
data for these plots can be found in \ref{ref:code_benchmarks}.
As described by \cite{andersbriegel2005} the graphical simulator is exponentially As described by \cite{andersbriegel2005} the graphical simulator is exponentially
faster than the dense vector simulator. According to \cite{andersbriegel2005} it faster than the dense vector simulator. According to \cite{andersbriegel2005} it
is considerably faster than a simulator using the straight forward approach simulating is considerably faster than a simulator using the straight forward approach simulating
the stabilizer tableaux like CHP \cite{CHP}. the stabilizer tableaux like CHP \cite{CHP} with an average runtime behaviour
of $\mathcal{O}\left(n\log(n)\right)$ instead of $\mathcal{O}\left(n^2\right)$.
One should be aware that the gate execution time (the time required to apply a gate One should be aware that the gate execution time (the time required to apply a gate
to the state) highly depends on the state it is applied to. For the dense vector to the state) highly depends on the state it is applied to. For the dense vector
@ -448,33 +447,36 @@ regimes:
\begin{figure} \begin{figure}
\centering \centering
\includegraphics[width=\linewidth]{../performance/regimes/graph_low_linear_regime.png} \includegraphics[width=\linewidth]{graphics/graph_low_linear_regime.png}
\caption[Typical Graphical State in the Low-Linear Regime]{Typical Graphical State in the Low-Linear Regime} \caption[Typical Graphical State in the Low-Linear Regime]{Typical Graphical State in the Low-Linear Regime}
\label{fig:graph_low_linear_regime} \label{fig:graph_low_linear_regime}
\end{figure} \end{figure}
\begin{figure} \begin{figure}
\centering \centering
\includegraphics[width=\linewidth]{../performance/regimes/graph_intermediate_regime.png} \includegraphics[width=\linewidth]{graphics/graph_intermediate_regime_cut.png}
\caption[Typical Graphical State in the Intermediate Regime]{Typical Graphical State in the Intermediate Regime} \caption[Window of a Typical Graphical State in the Intermediate Regime]{Window of a Typical Graphical State in the Intermediate Regime}
\label{fig:graph_intermediate_regime} \label{fig:graph_intermediate_regime}
\end{figure} \end{figure}
\begin{figure} \begin{figure}
\centering \centering
\includegraphics[width=\linewidth]{../performance/regimes/graph_high_linear_regime.png} \includegraphics[width=\linewidth]{graphics/graph_high_linear_regime_cut.png}
\caption[Typical Graphical State in the High-Linear Regime]{Typical Graphical State in the High-Linear Regime} \caption[Window of a Typical Graphical State in the High-Linear Regime]{Window of a Typical Graphical State in the High-Linear Regime}
\label{fig:graph_high_linear_regime} \label{fig:graph_high_linear_regime}
\end{figure} \end{figure}
These two regimes can be explained when considering the graphical states that These two regimes can be explained when considering the graphical states that
typical live in these regimes. With increased circuit length the amount of typical live in these regimes. With increased circuit length the amount of
edges increases which makes toggling neighbourhoods harder. Graphs from the edges increases which makes toggling neighbourhoods harder. Graphs from the
low-linear, intermediate and high-linear regime can be seen in low-linear, intermediate and high-linear regime can be seen in Figure
Figure \ref{fig:graph_low_linear_regime}, Figure \ref{fig:graph_intermediate_regime} and \ref{fig:graph_low_linear_regime}, Figure \ref{fig:graph_intermediate_regime}
Figure \ref{fig:graph_high_linear_regime}. The latter is hardly visible; this is due and Figure \ref{fig:graph_high_linear_regime}. Due to the great amount of edges
to the great amount of edges in this regime. Further the regimes are not clearly in the intermediate and high-linear regime the pictures show a window of the
visibe for $n>30$ qbits so choosing smaller graphs is not possible. actual graph. The full images are in \ref{ref:complete_graphs}. Further the
regimes are not clearly visibe for $n>30$ qbits so choosing smaller graphs is
not possible. The code that was used to generate these images can be found
in \ref{ref:code_example_graphs}.
The Figure \ref{fig:scaling_circuits_measurements_linear} brings more substance The Figure \ref{fig:scaling_circuits_measurements_linear} brings more substance
to this interpretation. In this simulation the Pauli $X$ gate has been replaced to this interpretation. In this simulation the Pauli $X$ gate has been replaced

Binary file not shown.

After

Width:  |  Height:  |  Size: 12 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.1 MiB

Binary file not shown.

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.8 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 615 KiB

Binary file not shown.

Binary file not shown.

After

Width:  |  Height:  |  Size: 60 KiB

View File

@ -1,4 +1,4 @@
\documentclass[a4paper,draft,12pt]{scrartcl} \documentclass[a4paper,12pt]{scrartcl}
\usepackage[utf8]{inputenc} \usepackage[utf8]{inputenc}
\usepackage{graphicx} \usepackage{graphicx}
\usepackage{amssymb, amsthm} \usepackage{amssymb, amsthm}
@ -12,6 +12,12 @@
%\usepackage{struktex} %\usepackage{struktex}
\usepackage{qcircuit} \usepackage{qcircuit}
\usepackage{adjustbox} \usepackage{adjustbox}
\usepackage[affil-it]{authblk}
\usepackage{tocbibind}
\usepackage[toc,page]{appendix}
\usepackage{float}
%\usepackage{tgcursor} %\usepackage{tgcursor}
%\usepackage{courier} %\usepackage{courier}
%\lstset{basicstyle=\fontfamily{qcr}\selectfont} %\lstset{basicstyle=\fontfamily{qcr}\selectfont}
@ -29,8 +35,10 @@
\numberwithin{equation}{section} \numberwithin{equation}{section}
\title{An Efficient Quantum Computing Simulator using a Graphical Description for Many-Qbit Systems} \title{An Efficient Quantum Computing Simulator using a Graphical Description for Many-Qbit Systems \\
\author{Daniel Knüttel} \large Bachelor Thesis}
\author[1]{Daniel Knüttel}
\affil[1]{Institute I - Theoretical Physics, University of Regensburg}
\date{10.04.2020} \date{10.04.2020}
\begin{document} \begin{document}
\maketitle \maketitle
@ -46,6 +54,20 @@
\include{chapters/implementation} \include{chapters/implementation}
\include{chapters/conclusion} \include{chapters/conclusion}
\appendix
\include{chapters/appendix}
\bibliographystyle{unsrt} \bibliographystyle{unsrt}
\bibliography{main}{} \bibliography{main}{}
\newpage
\textbf{Erklärung zur Anfertigung:}\\
Ich habe die Arbeit selbständig verfasst, keine anderen als die angegebenen Quellen und Hilfsmittel be-
nutzt und bisher keiner anderen Prüfungsbehörde vorgelegt. Außerdem bestätige ich hiermit, dass die
vorgelegten Druckexemplare und die vorgelegte elektronische Version der Arbeit identisch sind, dass ich
über wissenschaftlich korrektes Arbeiten und Zitieren aufgeklärt wurde und dass ich von den in § 24 Abs.
5 vorgesehenen Rechtsfolgen Kenntnis habe.
\\
\\
Unterschrift:
\end{document} \end{document}