2019-10-16 05:37:49 +00:00
|
|
|
% vim: ft=tex
|
2019-10-11 09:47:17 +00:00
|
|
|
\section{The naive Simulator}
|
|
|
|
|
|
|
|
A quite big part of the simulations interesting for students and researchers is not
|
|
|
|
covered by stabilizer states and stabilizer circuits. In particular the
|
|
|
|
phase estimation algorithm is essential for many applications. Being able to simulate
|
|
|
|
such an algorithm is essential for education.
|
|
|
|
|
2019-10-16 05:37:49 +00:00
|
|
|
\subsection{Simulator Core}
|
2019-10-11 09:47:17 +00:00
|
|
|
|
2019-10-16 05:37:49 +00:00
|
|
|
Recalling \ref{ref:nqbitsystems} an arbitrary state $\ket{\psi}$ can be written as such:
|
2019-10-11 09:47:17 +00:00
|
|
|
|
2019-10-16 05:37:49 +00:00
|
|
|
$$ \ket{\psi} = \sum\limits_{i = 0}^{2^N - 1} c_i \ket{i} $$
|
2019-10-11 09:47:17 +00:00
|
|
|
|
2019-10-16 05:37:49 +00:00
|
|
|
Which yields $2^N$ coefficients $c_i = \braket{\psi}{i}$. These coefficients are used to
|
|
|
|
store the quantum mechanical state of the simulator and are stored in numpy arrays \cite{numpy_array}.
|
|
|
|
They can be modified and viewed without overhead
|
|
|
|
using python and allow fast modification using so-called NumPy ufuncs\cite{numpy_ufunc}.
|
|
|
|
A simulator state also contains a classical state which is a length $N$ integer array containing
|
|
|
|
the measured classical bits with a default value of $-1$.
|
2019-10-11 09:47:17 +00:00
|
|
|
|
2019-10-16 05:37:49 +00:00
|
|
|
The gates are implemented as NumPy ufuncs which allows
|