did some work

This commit is contained in:
Daniel Knüttel 2019-11-01 19:07:45 +01:00
parent f834babb45
commit c2a01d0c19
9 changed files with 1382 additions and 83 deletions

View File

@ -160,7 +160,7 @@
}, },
{ {
"cell_type": "code", "cell_type": "code",
"execution_count": 7, "execution_count": 6,
"metadata": {}, "metadata": {},
"outputs": [ "outputs": [
{ {
@ -211,7 +211,7 @@
" ⎦⎦" " ⎦⎦"
] ]
}, },
"execution_count": 7, "execution_count": 6,
"metadata": {}, "metadata": {},
"output_type": "execute_result" "output_type": "execute_result"
} }
@ -230,7 +230,7 @@
}, },
{ {
"cell_type": "code", "cell_type": "code",
"execution_count": 9, "execution_count": 7,
"metadata": {}, "metadata": {},
"outputs": [], "outputs": [],
"source": [ "source": [
@ -250,7 +250,7 @@
}, },
{ {
"cell_type": "code", "cell_type": "code",
"execution_count": 12, "execution_count": 8,
"metadata": {}, "metadata": {},
"outputs": [ "outputs": [
{ {
@ -288,7 +288,7 @@
"4, 21, 15, 7, 16, 19, 10, 14, 0, 20, 8, 9, 23, 6, 2, 11, 13, 1, 3, 17, 5]]" "4, 21, 15, 7, 16, 19, 10, 14, 0, 20, 8, 9, 23, 6, 2, 11, 13, 1, 3, 17, 5]]"
] ]
}, },
"execution_count": 12, "execution_count": 8,
"metadata": {}, "metadata": {},
"output_type": "execute_result" "output_type": "execute_result"
} }

View File

@ -6,10 +6,147 @@
"metadata": {}, "metadata": {},
"outputs": [], "outputs": [],
"source": [ "source": [
"from itertools import product\n",
"from functools import reduce\n",
"from operator import iconcat\n",
"import sympy\n", "import sympy\n",
"i = sympy.I\n", "i = sympy.I\n",
"exp = sympy.exp\n", "exp = sympy.exp\n",
"M = sympy.Matrix" "M = sympy.Matrix\n",
"simplify = sympy.simplify\n",
"from sympy.physics.quantum.dagger import Dagger\n",
"\n",
"sympy.init_printing()"
]
},
{
"cell_type": "code",
"execution_count": 2,
"metadata": {},
"outputs": [],
"source": [
"I = M([[1, 0], [0, 1]])\n",
"X = M([[0, 1], [1, 0]])\n",
"Y = M([[0, -i], [i, 0]])\n",
"Z = M([[1, 0], [0, -1]])\n",
"O = M([[0, 0], [0, 0]])"
]
},
{
"cell_type": "code",
"execution_count": 3,
"metadata": {},
"outputs": [],
"source": [
"H = M([[1, 1], [1, -1]]) / sympy.sqrt(2)\n",
"S = M([[1, 0], [0, i]])\n"
]
},
{
"cell_type": "code",
"execution_count": 4,
"metadata": {},
"outputs": [],
"source": [
"s2m = {\"H\": H, \"S\": S}\n",
"def evalstr(s):\n",
" m = I\n",
" \n",
" for c in s:\n",
" m *= s2m[c]\n",
" \n",
" m.simplify()\n",
" return m"
]
},
{
"cell_type": "code",
"execution_count": 5,
"metadata": {},
"outputs": [
{
"data": {
"image/png": "iVBORw0KGgoAAAANSUhEUgAAAG8AAAA/CAYAAADuS5aXAAAACXBIWXMAAA7EAAAOxAGVKw4bAAAGWklEQVR4Ae1bi3HUMBDNZSgAUsLRAZ8Ojg6SEhI6gKECBjqAFlIC0AGhA9IBIR0c7ykrjaTzR469kizOMzrrr3162rUt3W5OTk52CN8Q4ut2v98/jzOP6bwzsNlsbjDii45RL554mW+8OKN3UfqYLDMDlxj2LBraKJsjD1r2PaqgnsSq2o8NArk2Y3XWVA7M15D3fExmixv3X3Fd9HHPvNO4IFcaAlxhrLcUcijkkifHOIL52xBeW5Yij9O8lMoL17mAoLGpHhwC4J+iwhna3Q5WrLdwMuYhKEXIAwnvINQXCiaEfBAht3K/BEHGNEja3ljvD8Jnm7GWu4+ZMk/E3QtzhxLM1Z4/WQLGo+kwYyH+xcZ5Zxrht5/XQhyYHGaL08c1BTfq/kUwz82s5GFQat25FRxxMrbz0tQ+5r2weWu/A0uAmXgE46Nwo60hL6vZFFPxBsL7z7q3EOYn0fRdaMcFxm+d12h70VevxvwezBR1FHcKnkU1DwNSc666tAX5nxDcahuoE5hNaceXFS7Zp13tSuZBplmYKTsuzk2Auw8T6i1vNtEpFwKFOJhk5HHyA7sfC4dyatdv1rVliHNi2JY2PgmcbZvjDplm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TyVqM6LCDIlYfKIoyWxmHgPcNVMHlcqVxCFdloVCyx1qFVB8OuhjJpb3IsIMiRhEvKIPcDEtI+rL456RvOyHwlhYHfhNbo5L6IcmDAGyct/JOSYe4hk86iJxtVMZsM0+pEuH5k/gPbgAHVgBrgBG/wbDP3QRHReKOMJwqIXxlc/3NXClCr7KHno6B6zOvvfXakCLcqgcmelMZ0q4zt2rzgDo5qnOHZn12KmZx+VdHaeOVMbS3XkYX5VnTMy86eKpUazqeqckZk8VSw1kqfqnJGZPFUs1ZlNvME144iijaVGzXPKgQc+t8645TT7U8V1WiiigaVa8gB2i3luwhFFC0t1ZpOKYcHC7KzeEUUTS3WaJ2B5NLJ6RxRtLEVPFahl8QXA3DE/2EctvRUVy5mS1sIi/RY/VTiYA5DUjCOKNhZnNsFm7NTBs7bjVXgGwMtNzA1EMpaJZpORVx0y3mHlBMc6HXWOWcozAOL4uXTWMczPf3VNWc9gofJvAAAAAElFTkSuQmCC\n",
"text/latex": [
"$\\displaystyle \\left[\\begin{matrix}\\frac{\\sqrt{2} i}{2} & \\frac{\\sqrt{2}}{2}\\\\- \\frac{\\sqrt{2} i}{2} & \\frac{\\sqrt{2}}{2}\\end{matrix}\\right]$"
],
"text/plain": [
"⎡ √2⋅ √2⎤\n",
"⎢ ──── ──⎥\n",
"⎢ 2 2 ⎥\n",
"⎢ ⎥\n",
"⎢-√2⋅ √2⎥\n",
"⎢────── ──⎥\n",
"⎣ 2 2 ⎦"
]
},
"execution_count": 5,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"evalstr(\"HSHSSH\")"
]
},
{
"cell_type": "code",
"execution_count": 7,
"metadata": {},
"outputs": [
{
"data": {
"image/png": "iVBORw0KGgoAAAANSUhEUgAAAG8AAAA/CAYAAADuS5aXAAAACXBIWXMAAA7EAAAOxAGVKw4bAAAGrklEQVR4Ae2bjXHcNhCFdRoV4KiESwd20sG5A6sEyR044woyTgdOCyrBSQdWOrA7iK0Ozt+jAQxJ8Qc4LEmQO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SV+69DxG6MoLIt01J+LZrAAxOmv13WHqM8/AMxjWc93eaBGAAAAAElFTkSuQmCC\n",
"text/latex": [
"$\\displaystyle \\left[\\begin{matrix}\\frac{\\sqrt{2}}{2} & \\frac{\\sqrt{2} i}{2}\\\\\\frac{\\sqrt{2}}{2} & - \\frac{\\sqrt{2} i}{2}\\end{matrix}\\right]$"
],
"text/plain": [
"⎡√2 √2⋅ ⎤\n",
"⎢── ──── ⎥\n",
"⎢2 2 ⎥\n",
"⎢ ⎥\n",
"⎢√2 -√2⋅ ⎥\n",
"⎢── ──────⎥\n",
"⎣2 2 ⎦"
]
},
"execution_count": 7,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"evalstr(\"HS\")"
]
},
{
"cell_type": "code",
"execution_count": 8,
"metadata": {},
"outputs": [
{
"data": {
"image/png": "iVBORw0KGgoAAAANSUhEUgAAAHkAAAA/CAYAAADE+2c4AAAACXBIWXMAAA7EAAAOxAGVKw4bAAAFIklEQVR4Ae2cjXXTMBSFEw4DQEcIGwAjpBuUEQIbwGECTkeAFRihsEHLBjACdIPwXdc2qurGJNF7UizrHNWW/6R7r96TLeV1uVgs1uQrcpx+bbfbF/HBuVwmA8vl8oaWvRxo3ZunwcHzYF+7v6PyXCybgQ3NO4ua2BhvLzJW+y26wLxI79uOVUK7lmPXTPX8PvzA04+YB+6/1bEn8QmvMg14S13vJOKu7NWe0upJyU9vyRlAvkHceIjI0Ixiq0zGTxaR6aXvofaz6GX/GZuP2iet7jaLDR2gcTVtuapNan6yiIxi54EVX7L/rlMRgBJfb4o1v9kn52cNofC81R/zTF2y4ouuLtVNXgdlWbOOveyO1bQFdzJ+eNYf8oWrJbeuOeyltGEhK77WTu3Jip/kb9c0dEXWm/NQ0th7GZ7ASr+Qw/FXomsi5sEnQXjfqe7n4ieZu4Z4PUsiyt0+C92syuSr8Fi8z3nN2PzUtfG5KZTB5coP9TXumm1TMRymG495pl6c9ELVj/GU9UL16DjLOY3FmqGZpMARFy78wKWpyBd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CokHqFZMqgyKs8LePjf7KlSvMy662qA4a+y9u0b1bZS11junE2EA7W4i/fTzm8Yzyl1r5/UAlt/0sHv/H3LgmvlQIQwgsD479W+n43T9FyVSzpC8C/88AAAAAElFTkSuQmCC\n",
"text/latex": [
"$\\displaystyle \\left[\\begin{matrix}\\frac{\\sqrt{2}}{2} & - \\frac{\\sqrt{2}}{2}\\\\- \\frac{\\sqrt{2}}{2} & - \\frac{\\sqrt{2}}{2}\\end{matrix}\\right]$"
],
"text/plain": [
"⎡ √2 -√2 ⎤\n",
"⎢ ── ────⎥\n",
"⎢ 2 2 ⎥\n",
"⎢ ⎥\n",
"⎢-√2 -√2 ⎥\n",
"⎢──── ────⎥\n",
"⎣ 2 2 ⎦"
]
},
"execution_count": 8,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"evalstr(\"SSHSS\")"
] ]
} }
], ],

File diff suppressed because one or more lines are too long

View File

@ -4,7 +4,8 @@ bibtex=bibtex
chapters = chapters/introduction.tex \ chapters = chapters/introduction.tex \
chapters/naive_simulator.tex \ chapters/naive_simulator.tex \
chapters/introduction_qc.tex chapters/introduction_qc.tex \
chapters/graph_simulator.tex
all: main.pdf all: main.pdf

View File

@ -1,11 +1,130 @@
\section{The graph Simulator} \section{The Graph Simulator}
\subsection{Introduction to the Graph Formalism} \subsection{Introduction to the Graph Formalism}
The first step towards the simulation in the graph formalism has been The first step towards the simulation in the graph formalism has been
the discovery of the stabilizer states and stabilizer circuits \cite{gottesman2009}\cite{gottesman1997}. the discovery of the stabilizer states and stabilizer circuits \cite{gottesman2009}\cite{gottesman1997}.
They led to the faster simulation using stabilizer tableaux\cite{gottesman_aaronson2008} and later They led to the faster simulation using stabilizer tableaux\cite{gottesman_aaronson2008} and later
to the graph formalism . to the graph formalism\cite{schlingenmann2001}\cite{andersbriegel2005}\cite{vandennest_ea2004}.
The following discussion eludicates the graph formalism and explains how the graph simulator works.
Some parts will be kept short as they can be looked up in \cite{andersbriegel2005}.
\begin{definition}
\begin{equation}
p \in P_n \Rightarrow p = \bigotimes\limits_{i=0}^n p_i \\
\forall i: p_i \in P := \{\pm 1, \pm i\} \cdot \{I, X, Y, Z\}
\end{equation}
Where $X = \left(\begin{array}{cc} 0 & 1 \\ 1 & 0\end{array}\right)$,
$Y = \left(\begin{array}{cc} 0 & i \\ -i & 0\end{array}\right)$ and
$Z = \left(\begin{array}{cc} 1 & 0 \\ 0 & -1\end{array}\right)$ are the Pauli matrices and
$I$ is the identity.
\end{definition}
\begin{definition}
Let $p_i \in P_n \forall i = 1, ..., n$, $[p_i, p_j] = 0 \forall i,j$ be commuting multi-local Pauli operators.
Then a $n$ qbit state $\ket{\psi}$ is called a stabilizer state iff
\begin{equation}
\forall i: p_i\ket{\psi} = +1\ket{\psi}
\end{equation}
\end{definition}
%A $n$ qbit graph or stabilizer state is a $+1$ eigenstate of some $ p \in P_n$ where $P_n$ is the Pauli group\cite{andersbriegel2005}.
\begin{definition}
\begin{equation}
C_n := \{U \in SU(2) | UpU^\dagger \in P_n \forall p \in P_n\}
\end{equation}
is called the Clifford group on $n$ qbits.
$C_1 =: C_L$ is called the local Clifford group.
\end{definition}
One can show that the Clifford group $C_n$ can be generated using the elements of $C_L$ acting on all qbits and
the controlled phase gate $CZ$ between all qbits\cite{andersbriegel2005}. It is worth noting that the $CX$ gate can be
generated using $CZ$ and $C_L$ gates.
\begin{lemma}
Let $a \in C_L$ then $\forall \phi \in [0, 2\pi)$ also $\exp(i\phi)a \in C_L$.
\textbf{Note}: This is also true for $C_n \forall n >= 1$.
\end{lemma}
\begin{proof}
Let $a' := \exp(i\phi)a$. $a' \in C_L$ iff $a'pa^{\prime\dagger} \in P \forall p \in P$.
\begin{equation}
\begin{aligned}
a'pa^{\prime\dagger} &= (\exp(i\phi)a)p(\exp(i\phi)a)^\dagger \\
& = \exp(i\phi)ap\exp(-i\phi)a^\dagger \\
& = \exp(i\phi)\exp(-i\phi) apa^\dagger \\
& = apa^\dagger \in P
\end{aligned}
\end{equation}
\end{proof}
\begin{lemma}
One cannot measure phases by projecting states.
\end{lemma}
\begin{proof}
Let $\ket{\psi}$ be a state, $\ket{\varphi}\bra{\varphi}$ a projector. $\ket{\psi'} := \exp(i\phi)\ket{\psi}$ for some $\phi \in [0, 2\pi)$.
\begin{equation}
\begin{aligned}
\bra{\psi'}\ket{\varphi}\bra{\varphi}\ket{\psi'} &= \exp(-i\phi)\bra{\psi}\ket{\varphi}\bra{\varphi}\exp(i\phi)\ket{\psi} \\
& = \exp(-i\phi)\exp(i\phi)\bra{\psi}\ket{\varphi}\bra{\varphi}\ket{\psi} \\
& = \bra{\psi}\ket{\varphi}\bra{\varphi}\ket{\psi}
\end{aligned}
\end{equation}
\end{proof}
\begin{definition}
A phase $\phi \in [0, 2\pi)$ is called qbit-global, if for some qbit states $\ket{\psi}, \ket{\varphi}$ $\ket{\psi} = \exp(i\phi)\ket{\varphi}$.
\end{definition}
\begin{lemma}
When entangling qbits via projections one can disregard qbit-global phases.
Two qbits are entangled via projection, if for some single qbit gates $M,N$
and two orthonormal states $\ket{a}, \ket{b}$
\begin{equation}
C^{M,N}(i,j) = \ket{a}\bra{a}_j \otimes M_i + \ket{b}\bra{b}_j \otimes N_i
\end{equation}
\textbf{Remark.}
In particular when entangling states using $CX$ and $CZ$ one can disregard qbit-global phases.
This is immideatly clear when recalling \eqref{eq:CX_pr} and \eqref{eq:CZ_pr}.
\end{lemma}
\begin{proof}
Let $\alpha, \beta \in [0, 2\pi)$ be some phases, $\ket{\psi}, \ket{\varphi}, \ket{\psi'} := \exp(i\alpha)\ket{\psi}, \ket{\varphi'} := \exp(i\beta)\ket{\varphi}$ some single qbit states,
$M, N, \ket{a}, \ket{b}, C^{M,N}(i,j)$ as defined above.
\begin{equation}
\begin{aligned}
C^{M,N}(1, 0) (\ket{\psi'}\otimes\ket{\varphi'}) & = \ket{a}\braket{a}{\varphi'}\otimes M\ket{\psi'} + \ket{b}\braket{b}{\varphi'} \otimes N\ket{\psi'} \\
& = \exp(i\beta)\ket{a}\braket{a}{\varphi}\otimes\exp(i\alpha)M\ket{\phi} + \exp(i\beta)\ket{b}\braket{b}{\varphi}\otimes\exp(i\alpha)N\ket{\phi}\\
& = \exp(i(\beta + \alpha))(\ket{a}\braket{a}{\varphi}\otimes M\ket{\psi} + \ket{b}\braket{b}{\varphi} \otimes N\ket{\psi})\\
& = \exp(i(\beta + \alpha))C^{M,N}(1, 0) (\ket{\psi}\otimes\ket{\varphi})
\end{aligned}
\end{equation}
Where $\exp(i(\beta + \alpha))$ is a multi-qbit-global phase which can be (following the above argumentation) disregarded.
\end{proof}
\begin{corrolary}
One can disregard global phases of elements of the $C_L$ group.
\end{corrolary}
\begin{proof}
As it has been shown above a quantum computer cannot measure global phases. Also
the entanglement gates $CX, CZ$ map qbit-global phases to multi-qbit-global phases which cannot
be measured. It has been shown above that one can choose the $C_L$ operators such that they do not yield
a phase.
\end{proof}
\subsection{Graph Storage} \subsection{Graph Storage}
@ -14,3 +133,11 @@ in simulation performance and a lower memory requirement. The simulation of
at least $10^6$ qbits on a common desktop computer should be possible\cite{andersbriegel2005}. at least $10^6$ qbits on a common desktop computer should be possible\cite{andersbriegel2005}.
Therefore one has to take care when choosing a representation of the graph state. Therefore one has to take care when choosing a representation of the graph state.
The following The following
FIXME
\subsection{Usage}
FIXME
\subsection{Performance}
FIXME

View File

@ -2,6 +2,7 @@
\section{Introduction to Binary Quantum Computing} \section{Introduction to Binary Quantum Computing}
\subsection{Single Qbits} \subsection{Single Qbits}
\label{ref:singleqbitsystems}
A qbit is a two-level quantum mechanical system $ \{\ket{\uparrow} \equiv \ket{1}, \ket{\downarrow} \equiv \ket{0}\} $ 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 with $\braket{\uparrow}{\downarrow} = 0$. One can associate
@ -14,10 +15,18 @@ $\forall G \in U(2)$ $G$ can be arbitrarily good as a product of unitary generat
common choices for the generators are $ X, H, R_{\phi}$ and $Z, H, R_{\phi}$ with common choices for the generators are $ X, H, R_{\phi}$ and $Z, H, R_{\phi}$ with
\label{ref:singleqbitgates} \label{ref:singleqbitgates}
$$X := \left(\begin{array}{cc} 0 & 1 \\ 1 & 0\end{array}\right) $$ \begin{equation}
$$Z := \left(\begin{array}{cc} 1 & 0 \\ 0 & -1\end{array}\right) $$ X := \left(\begin{array}{cc} 0 & 1 \\ 1 & 0\end{array}\right)
$$H := \frac{1}{\sqrt{2}}\left(\begin{array}{cc} 1 & 1 \\ 1 & -1\end{array}\right) $$ \end{equation}
$$R_{\phi} := \left(\begin{array}{cc} 1 & 0 \\ 0 & \exp(i\phi)\end{array}\right)$$ \begin{equation}
Z := \left(\begin{array}{cc} 1 & 0 \\ 0 & -1\end{array}\right)
\end{equation}
\begin{equation}
H := \frac{1}{\sqrt{2}}\left(\begin{array}{cc} 1 & 1 \\ 1 & -1\end{array}\right)
\end{equation}
\begin{equation}
R_{\phi} := \left(\begin{array}{cc} 1 & 0 \\ 0 & \exp(i\phi)\end{array}\right)
\end{equation}
\subsection{$N$ Qbit Systems} \subsection{$N$ Qbit Systems}
\label{ref:nqbitsystems} \label{ref:nqbitsystems}
@ -30,29 +39,60 @@ states. The $N$ qbit operators are the tensor product of the $N$ single qbit ope
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)$ 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 basis states are be the basis of the one-qbit systems. Then two-qbit basis states are
$$ \ket{0} := \ket{0b00} := \ket{0}_s \otimes \ket{0}_s := \left(\begin{array}{c} 1 \\ 0 \\ 0 \\ 0 \end{array} \right)$$ \begin{equation}
$$ \ket{1} := \ket{0b01} := \ket{0}_s \otimes \ket{1}_s := \left(\begin{array}{c} 0 \\ 1 \\ 0 \\ 0 \end{array} \right)$$ \ket{0} := \ket{0b00} := \ket{0}_s \otimes \ket{0}_s := \left(\begin{array}{c} 1 \\ 0 \\ 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)$$ \end{equation}
$$ \ket{3} := \ket{0b11} := \ket{1}_s \otimes \ket{1}_s := \left(\begin{array}{c} 0 \\ 0 \\ 0 \\ 1 \end{array} \right)$$ \begin{equation}
\ket{1} := \ket{0b01} := \ket{0}_s \otimes \ket{1}_s := \left(\begin{array}{c} 0 \\ 1 \\ 0 \\ 0 \end{array} \right)
\end{equation}
\begin{equation}
\ket{2} := \ket{0b10} := \ket{1}_s \otimes \ket{0}_s := \left(\begin{array}{c} 0 \\ 0 \\ 1 \\ 0 \end{array} \right)
\end{equation}
\begin{equation}
\ket{3} := \ket{0b11} := \ket{1}_s \otimes \ket{1}_s := \left(\begin{array}{c} 0 \\ 0 \\ 0 \\ 1 \end{array} \right)
\end{equation}
The $N$ qbit basis states can then be constructed in a similar manner. 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 A general $N$ qbit state can then be written as a superposition of the
basis states: basis states:
$$ \ket{\psi} = \sum\limits_{i = 0}^{2^N - 1} c_i \ket{i} $$ \begin{equation}
$$ \sum\limits_{i = 0}^{2^N - 1} |c_i|^2 = 1$$ \ket{\psi} = \sum\limits_{i = 0}^{2^N - 1} c_i \ket{i}
\end{equation}
\begin{equation}
\sum\limits_{i = 0}^{2^N - 1} |c_i|^2 = 1
\end{equation}
FIXME: rewrite this.
One can show that the gates in \ref{ref:singleqbitgates} together with an entanglement gate, such as $CX$ or $CZ$ are enough 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\cite[Chapter 4.3]{kaye_ea2007}. to generate an arbitrary $N$ qbit gate\cite[Chapter 4.3]{kaye_ea2007}.
The matrix representation of $CX$ and $CZ$ for two qbits is given by
$$ 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)$$ \begin{equation}
$$ 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)$$ 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)
\end{equation}
\begin{equation}
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)
\end{equation}
Where $1$ is the act-qbit and $0$ the control-qbit. In words $CX$ ($CZ$) apply an $X$ ($Z$) gate on the act-qbit, Where $1$ is the act-qbit and $0$ the control-qbit. In words $CX$ ($CZ$) apply an $X$ ($Z$) gate on the act-qbit,
if the control-qbit is set. if the control-qbit is set.
The following notation\cite{dahlberg_ea2019} can be more handy when discussing more qbits:
\begin{equation}\label{eq:CX_pr}
CX(i, j) = \ket{0}\bra{0}_j\otimes I_i + \ket{1}\bra{1}_j \otimes X_i
\end{equation}
\begin{equation}\label{eq:CZ_pr}
CZ(i, j) = \ket{0}\bra{0}_j\otimes I_i + \ket{1}\bra{1}_j \otimes Z_i
\end{equation}
Where $i$ is the act-qbit, $j$ the control-qbit and $I_i$, $Z_i$ are the identity and Pauli $Z$ gate
operating on qbit i.
\subsection{Measurement} \subsection{Measurement}
\begin{postulate} \begin{postulate}
@ -75,4 +115,6 @@ Measuring a qbit will also yield a classical result $0$ or $1$ with the respecti
\begin{proof} \begin{proof}
The measuerment in not injective: Measuring both The measuerment in not injective: Measuring both
$\ket{0}$ and $\frac{1}{\sqrt{2}}(\ket{0} + \ket{1}$ (can) map to $\ket{0}$. $\ket{0}$ and $\frac{1}{\sqrt{2}}(\ket{0} + \ket{1}$ (can) map to $\ket{0}$.
Any unitary matrix $U$ has the inverse $U^\dagger \equiv U^{-1}$.
\end{proof} \end{proof}

View File

@ -8,15 +8,46 @@ such an algorithm is essential for education.
\subsection{Simulator Core} \subsection{Simulator Core}
Recalling \ref{ref:nqbitsystems} an arbitrary state $\ket{\psi}$ can be written as such: Recalling \ref{ref:nqbitsystems} an arbitrary $N$ qbit state $\ket{\psi}$ can be written as such:
$$ \ket{\psi} = \sum\limits_{i = 0}^{2^N - 1} c_i \ket{i} $$ \begin{equation}
\ket{\psi} = \sum\limits_{i = 0}^{2^N - 1} c_i \ket{i}
\end{equation}
Which yields $2^N$ coefficients $c_i = \braket{\psi}{i}$. These coefficients are used to 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}. 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 They can be modified and viewed without overhead
using python and allow fast modification using so-called NumPy ufuncs\cite{numpy_ufunc}. 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 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$. the measured classical bits with a default value of $-1$.
The gates are implemented as NumPy ufuncs which allows The gates are implemented as NumPy ufuncs which allows an efficient
manipulation of NumPy arrays using C code. Every gate maps a length $2^N$
\lstinline[basicstyle=\ttfamily, language=Python]{numpy.cdouble} and a length
$N$ \lstinline[basicstyle=\ttfamily, language=Python]{numpy.int8} array to
a length $2^N$ \lstinline[basicstyle=\ttfamily,
language=Python]{numpy.cdouble}, a length $N$ \lstinline[basicstyle=\ttfamily,
language=Python]{numpy.int8} and a \lstinline[basicstyle=\ttfamily,
language=Python]{numpy.uint64} scalar. The \lstinline[basicstyle=\ttfamily,
language=Python]{numpy.cdouble} arrays are the quantum mechanical state before
and after the gate; the \lstinline[basicstyle=\ttfamily,
language=Python]{numpy.int8} arrays are the respective classical states and the
\lstinline[basicstyle=\ttfamily, language=Python]{numpy.uint64} scalar has
a logical one at every bit that has been measured.
\subsection{Implemented Gates}
As stated in \ref{ref:singleqbitsystems} and \ref{ref:nqbitsystems} a just a small set of gates is required to
approximate an arbitrary unitary matrix arbitrarily good. In principle just the $X$, $R_\phi$, $H$ and $CNOT$ gate
would be sufficient for a simulator. As however both $X$ and $Z$ are often used in practice FIXME: CITATION NEEDED
$X$, $Z$, $R_\phi$, $H$ and $CNOT$ are implemented. They can be accessed using
\lstinline[basicstyle=\ttfamily]{pyqcs.X}, \lstinline[basicstyle=\ttfamily]{pyqcs.Z}, \lstinline[basicstyle=\ttfamily]{pyqcs.R},
\lstinline[basicstyle=\ttfamily]{pyqcs.H} and \lstinline[basicstyle=\ttfamily]{pyqcs.C}.
\subsection{Usage}
FIXME
\subsection{Performance}
FIXME

View File

@ -62,8 +62,32 @@
@article{ @article{
gottesman_aaronson2008, gottesman_aaronson2008,
title={Improved Simulation of Stabilizer Circuits} title={Improved Simulation of Stabilizer Circuits},
year=2008, year=2008,
author={Daniel Gottesman, Scott Aaronson} author={Daniel Gottesman, Scott Aaronson},
note={https://arxiv.org/abs/quant-ph/0406196v5} note={https://arxiv.org/abs/quant-ph/0406196v5}
} }
@article{
schlingenmann2001,
title={Stabilizer codes can be realized as graph codes},
year=2001,
author={D. Schlingemann},
note={https://arxiv.org/abs/quant-ph/0111080v1}
}
@article{
vandennest_ea2004,
title={Graphical description of the action of local Clifford transformations on graph states},
year=2004,
author={Maarten Van den Nest et al.},
note={PhysRevA.69.022316}
}
@article{
dahlberg_ea2019,
title={Counting single-qubit Clifford equivalent graph states is \#P-Complete},
year=2019,
author={Axel Dahlberg et al.},
note={https://arxiv.org/abs/1907.08024v1}
}

View File

@ -9,12 +9,16 @@
\usepackage{geometry} \usepackage{geometry}
\usepackage{enumerate} \usepackage{enumerate}
\usepackage{physics} \usepackage{physics}
\usepackage{listings}
\geometry{left=2.5cm,right=2.5cm,top=2.5cm,bottom=2.5cm} \geometry{left=2.5cm,right=2.5cm,top=2.5cm,bottom=2.5cm}
\newtheorem{definition}{Definition} \newtheorem{definition}{Definition}
\newtheorem{postulate}{Postulate} \newtheorem{postulate}{Postulate}
\newtheorem{corrolary}{Corrolary} \newtheorem{corrolary}{Corrolary}
\newtheorem{lemma}{Lemma}
\numberwithin{equation}{section}
\title{Development of an Extensible Quantum Computing \title{Development of an Extensible Quantum Computing
Simulator with a Focus on Simulation in the Graph Formalism } Simulator with a Focus on Simulation in the Graph Formalism }
@ -42,6 +46,8 @@ Simulator with a Focus on Simulation in the Graph Formalism }
\include{chapters/naive_simulator} \include{chapters/naive_simulator}
\include{chapters/graph_simulator}
%\backmatter %\backmatter
\bibliographystyle{unsrt} \bibliographystyle{unsrt}