\documentclass[10pt]{beamer}

\usepackage[utf8]{inputenc} 
\usepackage{graphicx} 
\usepackage{amssymb, amsthm}
\usepackage{setspace} 
\usepackage{amsmath} 
\usepackage{hyperref}
\usepackage{geometry} 
\usepackage{enumerate}
\usepackage{physics}
\usepackage{listings}
%\usepackage{struktex}
\usepackage{qcircuit}
\usepackage{adjustbox}


\usetheme{metropolis}

\setbeamercolor{background canvas}{bg=white!20}

\title{An Efficient Quantum Computing Simulator using a Graphical Description for Many-Qbit Systems}
\subtitle{Simulation in the Stabilizer Formalism}
\author{Daniel Knüttel} 
\date{21.02.2020}
\institute{Universität Regensburg}

\titlegraphic{\small\center Universität Regensburg\\
    Faculty of the Institute of Theoretical Physics
    \vspace{-11mm}\flushright\includegraphics[height=1.0cm]{logo.png}}


%\logo{\includegraphics[width=1cm]{logo.png}\hfill}
%\newcommand{\nologo}{\setbeamertemplate{logo}{}} % command to set the logo to nothing
%\newcommand{\congress}{Faculty of the Institute of Theoretical Physics}

%% footer
\makeatletter
\setbeamertemplate{footline}
{
  %\leavevmode%
  \hbox{%

  \begin{beamercolorbox}[wd=.9\paperwidth,ht=2.25ex,dp=1ex,left]{Faculty of the Institute of Theoretical Physics}%
  \end{beamercolorbox}%

  \begin{beamercolorbox}[wd=.1\paperwidth,ht=2.25ex,dp=1ex,right]{Faculty of the Institute of Theoretical Physics}%
    \insertframenumber{} / \inserttotalframenumber\hspace*{2ex} 
  \end{beamercolorbox}}%
  
}
\makeatother

\begin{document}

\maketitle

\section{Introduction}

{
\begin{frame}{Motivation}

    \begin{itemize}
        \item Some (physical) problems are classically hard to solve.
        \pause
        \item The quantum simulator: Mapping a hard problem to quantum hardware that can simulate this specific problem.
        \pause
        \item The (universal) quantum computer: able to simulate any unitary transformation on the system.
    \end{itemize}

\end{frame}
}

{
\begin{frame}{Quantum Errors and Quantum Error Correction}
    \begin{itemize}
        \item Quantum systems at non-zero temperature often have dephasing effects and a finite population lifetime (relaxation).
        \pause
        \item Fault tolerant QC needs a way to correct for those errors.
        \pause
        \item Several strategies exist; one important class of quantum error correction codes are \textbf{stabilizer codes}.
    \end{itemize}

\end{frame}
}

\section{Binary Quantum Computing}

{
\begin{frame}{Qbits}

    \textbf{Definition}
    {\itshape
        A qbit is a two-level quantum mechanical system $\ket{0}, \ket{1}$ with $\braket{0}{1} = 0$.

        In the following $Z = \sigma_Z, X = \sigma_X, Y = \sigma_Y$ will be used. $I$ is the identity matrix.
    }
    
    Where $Z\ket{0} = +1\ket{0}$ and $Z\ket{1} = -1\ket{1}$.


\end{frame}
}
{
\begin{frame}{Qbits and Gates}
    \begin{itemize}
        \item{
            \textbf{Postulate}
            {\itshape
                A $n$-qbit system is the tensor product of the single-qbit systems.
            }
        }
    \pause
        %\item{
        %        For $n$ qbits define the integer state $\ket{j}$ as

        %    \begin{equation}
        %        \ket{j} := \ket{\mbox{0b}i_0i_1...i_{n-1}} := \ket{i_0}_s \otimes \ket{i_1}_s \otimes ... \otimes \ket{i_{n-1}}_s
        %    \end{equation}
        %}
        \item{
            A transformation $U \in SU(2^n)$ is called \textit{gate} acting on the system. 
            For $\bar{U} \in SU(2)$ the gate $U_i$ acting on qbit $i$ is given by
            \begin{equation}
                U_i := \left(\bigotimes\limits_{k < i} I\right) \otimes \bar{U} \otimes \left(\bigotimes\limits_{k > i} I\right)
            \end{equation}
        }
    \pause
        \item{
            For $\bar{U} \in SU(2)$ and qbits $i \neq j$ 
            \begin{equation}
                CU_{i,j} := \ket{1}\bra{1}_j \otimes U_i + \ket{0}\bra{0}_j \otimes I
            \end{equation}
            is the controlled $\ket{U}$ gate acting on $i$ with control-qbit $j$.
        }
    \pause
    \end{itemize}
\end{frame}
}


{
\begin{frame}{Gates}
     Some notable gates are
    \begin{itemize}
        \item{
            the Hadamard gate
            \begin{equation}
                H := \frac{1}{\sqrt{2}}\left(\begin{array}{cc} 1 & 1 \\ 1 & -1\end{array}\right)
            \end{equation}
             which transforms from the $Z$ to the $X$ basis}
        \pause
        \item{the rotation gate
             \begin{equation}
                R_{\phi} := \left(\begin{array}{cc} 1 & 0 \\ 0 & \exp(i\phi)\end{array}\right)
             \end{equation}
             that performs a rotation around the $Z$ axis.}
            \pause

    \end{itemize}
\end{frame}
}
{
\begin{frame}{Gates}
    \begin{itemize}
        \item{The $Z$ and $S$ gates are given by:
             \begin{equation}
                 Z := \left(\begin{array}{cc} 1 & 0 \\ 0 & -1\end{array}\right) = R_{\pi}
             \end{equation}
             \begin{equation}
                S := \left(\begin{array}{cc} 1 & 0 \\ 0 & i\end{array}\right) = R_{\frac{\pi}{2}}
             \end{equation}

             The $S$ gate transforms from $X$ to $Y$ basis.

            }
        \pause
        \item{
            \textbf{Theorem}
            {\itshape
                Any gate $U \in SU(2^n)$ can be approximated arbitrarely good using the $H$, $R_\phi$
                and $CZ_{i,j}$ gate.
            }

        }
    \end{itemize}
\end{frame}
}
{
\begin{frame}{Integer States}
    \begin{itemize}
        \item{
            The eigenstates of the $Z_i$ are called integer states. They have the form
            \begin{equation}
                \ket{j} = \ket{\mbox{0b}l_1...l_n} = \ket{l_1}_s \otimes ... \otimes \ket{l_n}s
            \end{equation}
            }
        \pause
        \item{
            For $n$ qbits there exist $2^n$ such states and they form a basis

            \begin{equation}
                \ket{\psi} = \sum\limits_{i=0}^{n-1} \ket{i}\braket{i}{\psi} = \sum\limits_{i=0}^{n-1} c_i\ket{i}
            \end{equation}

            with the condition $\sum\limits_{i=0}^{n-1} c_i^2 = 1$.
        }
    \end{itemize}
\end{frame}
}
{
\begin{frame}{Measurement}
    \begin{itemize}
        \item{Measurements are performed in $Z$ basis, i.e. for a qbit $i$ 
            $Z_i$ is measured. 
            }
        \item{
            The results of the measurements are associated with a classical result $s \in \{0, 1\}$
            using

            \begin{equation}
                Z_i\ket{\psi'} = (-1)^s \ket{\psi'}
            \end{equation}

            after the measurement.
        }
    \end{itemize}
\end{frame}
}
{
\begin{frame}{Quantum Circuits}
    \begin{itemize}
        \item{
            Writing a unitary transformation as a product of the generator gates is unreadable.
            To fix this problem quantum circuits have been introduced.
            }
        \pause
        \item{
            Qbits are represented by horizontal lines.
        }
    \pause
        \item{
            Gates acting on a qbit are boxes on the lines.
        }
    \pause
    \item{
            Control-qbits are connected to the gate via a vertical line.
        }
    \pause
    \item{
            Circuits are read left to right.
        }
    \pause
    \item{
            Example:
            \Qcircuit @C=1em @R=.7em {
            & \gate{H} & \ctrl{1} & \qw &\qw \\
            & \gate{H} & \gate{Z} & \gate{H} &\qw \\
            }
        }
    \end{itemize}
\end{frame}
}

{
\begin{frame}{Case Study: Spin Chain in a Magnetic Field}
    \begin{itemize}
        \item{
            For a set of $n$ spins in a magnetic field one can rescale the Hamiltonian
            of the system to
            \begin{equation}
                H = -\sum\limits_{i=1}^{n-1} Z_i Z_{i-1} + g\sum\limits_{i=0}^{n-1} X_i
            \end{equation}
            }
        \pause
        \item{
            The time evolution of such a system is given by the transfer matrix
            \begin{equation}
                T := \exp(-itH) \in SU(2^n)
            \end{equation}
        }
    \pause
    \item{
            By associating every qbit with one spin (both are two-level systems)
            one should be able to simulate the behaviour of the spin chain using 
            a quantum computer.
        }
    \end{itemize}
\end{frame}
}
{
\begin{frame}{Case Study: Spin Chain in a Magnetic Field}
    \begin{itemize}
        \item{
            Trotterizing the matrix exponential
            \begin{equation}
                \exp(t(A + B)) = \left(\exp(\frac{t}{N}A)\exp(\frac{t}{N}B)\right)^N + \mathcal{O}\left(\frac{t^2}{N^2}\right)
            \end{equation}
            }
        \item{
            For $n=3$ spins one gets a circuit
            {\centering\adjustbox{max width=\textwidth}{
\Qcircuit @C=1em @R=.7em {
& \qw & \gate{X} & \gate{R_{-\frac{t}{2N}}} & \gate{X} & \gate{R_{\frac{t}{2N}}} & \gate{X} & \gate{X} & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \gate{H} & \gate{R_{-2\frac{gt}{2N}}} & \gate{H} & \gate{R_{\frac{gt}{2N}}} & \gate{X} & \gate{R_{\frac{gt}{2N}}} & \gate{X} & \gate{X} & \gate{R_{-\frac{t}{2N}}} & \gate{X} & \gate{R_{\frac{t}{2N}}} & \gate{X} & \gate{X} & \qw & \qw & \qw & \qw & \qw & \qw & \qw &\qw \\
& \qw & \ctrl{-1} & \qw & \qw & \qw & \qw & \ctrl{-1} & \qw & \gate{X} & \gate{R_{-\frac{t}{2N}}} & \gate{X} & \gate{R_{\frac{t}{2N}}} & \gate{X} & \gate{X} & \gate{H} & \gate{R_{-2\frac{gt}{2N}}} & \gate{H} & \gate{R_{\frac{gt}{2N}}} & \gate{X} & \gate{R_{\frac{gt}{2N}}} & \gate{X} & \ctrl{-1} & \qw & \qw & \qw & \qw & \ctrl{-1} & \qw & \gate{X} & \gate{R_{-\frac{t}{2N}}} & \gate{X} & \gate{R_{\frac{t}{2N}}} & \gate{X} & \gate{X} &\qw \\
& \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \ctrl{-1} & \qw & \qw & \qw & \qw & \ctrl{-1} &  \gate{H} & \gate{R_{-2\frac{gt}{2N}}} & \gate{H} & \gate{R_{\frac{gt}{2N}}} & \gate{X} & \gate{R_{\frac{gt}{2N}}} & \gate{X} & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \ctrl{-1} & \qw & \qw & \qw & \qw & \ctrl{-1} &\qw \\
}

            }}
            }
        \item{Applying this circuit $N$ times gives an approximation for the time evolution of a state.}
    \end{itemize}
\end{frame}
}
{
\begin{frame}{Case Study: Spin Chain in a Magnetic Field}
\begin{figure}[h]
\begin{center}
\includegraphics[width=\linewidth]{spin_chain/time_evo_6spin_g3.png}
\end{center}
\end{figure}
\end{frame}
}

\section{Stabilizers}

{
\begin{frame}{The multilocal Pauli Group and the Clifford Group}
    \begin{itemize}
        \item{\textbf{Definition}
            {\itshape
            $P := \{\pm1, \pm i\} \cdot \{X, Y, Z, I\}$ is called the Pauli group.\\
            $P_n := \left\{p_1 \otimes ... \otimes p_n \middle| p_i \in P \right\}$ is called the multilocal Pauli group.
            }}
            \pause
        \item{
            \textbf{Definition}
            {\itshape
            $C_n := \left\{U \in SU(2^n) \middle| \forall p \in P_n: U^\dagger p U \in P_n\right\}$
            is called the Clifford group
            }
            }
            \pause
        \item{
                One can show that $C_n$ is generated by $H, S, CZ_{i,j}$.
            }
    \end{itemize}

\end{frame}
}

{
\begin{frame}{Generators of a Group}
    \begin{itemize}
        \item{
            \textbf{Definition}
            {\itshape
            For a finite group $G$ one says $G$ is generated by $g_1, ..., g_N$ iff any $g \in G$ can be expressed
            as a product of $g_1, ..., g_N$. These generators are chosen to be the minimal set for which this
            condition holds.

            One also writes
            \begin{equation}
                G = \langle g_1,...,g_N \rangle \equiv \langle g_i\rangle_i
            \end{equation}
            }
            }
        \item{
            The generators are not unique. For instance $C_1$ can be generated using $H, S$ or $\sqrt{-iX}, \sqrt{iZ}$.
            }
        \pause
        \item{
            The generators of a group have some kind of independence property.
            }
    \end{itemize}

\end{frame}
}

{
\begin{frame}{Stabilizers and Stabilizer Spaces}
    \begin{itemize}
        \item{
            \textbf{Definition}
            {\itshape
            A finite abelian subgroup $S$ of $P_n$ is called a set of stabilizers iff $-I \notin S$ and
            all elements of $S$ commute.
            }
            }
        \item{
            From $-I \notin S$ follows that all elements of $S$ are hermitian.
            }
        \item{
            From the definition as tensor products of Pauli matrices follows that the
            elements of $S$ have eigenvalues $\pm1$.
            }
        \item{
            These properties together yield that all elements of $S$ can be diagonalized simultaneously.
            Further there exists a vector space $V_S$ with $s \ket{\psi} = +1 \ket{\psi}$ for all $s \in S$
            and all $\ket{\psi} \in V_S$. This space is called the stabilizer space of $S$
            and all $\ket{\psi}$ are called stabilizer states.
            }
    \end{itemize}

\end{frame}
}

{
\begin{frame}{Stabilizer States}
    \begin{itemize}
        \item{
            One can show that for $S = \langle S^{(i)} \rangle_{i=1,...,n}$  the stabilizer space $V_S$
            has dimension $1$. 
            }
        \item{
            Therefore the state $\ket{\psi}$ that is the +1 eigenstate of all stabilizers is (up to a 
            global phase) unique.
            }
        \item{Notable stabilizer states are:
            \begin{itemize}
                \item{ $\ket{0b0..0} = \ket{0}\otimes ... \otimes \ket{0}$ and $\ket{0b1..1} = \ket{1}\otimes ... \otimes \ket{1}$
                    which are stabilized by $\langle Z_i \rangle_i$ and $\langle -Z_i \rangle_i$ respectively.
                }
                \item{
                    $\ket{+}$ stabilized by $\langle X_i \rangle_i$ (and $\ket{-}$ analogously).
                }
                \item{
                    $\ket{0b00} + \ket{0b11}$ the Bell/EPR state which is stabilized by $\langle X_1X_2, Z_1Z_2\rangle$.
                }
            \end{itemize}
            }
    \end{itemize}

\end{frame}
}
{
\begin{frame}{Dynamics of Stabilizer States}
    \begin{itemize}
        \item{
            Under a transformation $U \in SU(2^n)$ the state changes to
            \begin{equation}
            \ket{\psi'} = U \ket{\psi}
            \end{equation}
            }
        \item{
            The stabilizers of $\ket{\psi}$ change to 
            \begin{equation}
                \ket{\psi'} = U\ket{\psi} = US^{(i)}\ket{\psi} = US^{(i)}U^\dagger U\ket{\psi} = US^{(i)}U^\dagger\ket{\psi'}
            \end{equation}
            using this it is clear that for $U \in C_n$ the state $\ket{\psi'}$ is a stabilizer state again with the stabilizers
            $S' = \langle US^{(i)}U^\dagger\rangle_{i=1,...,n}$
            }
        \item{
            Under the transformations $C_n$ one can describe the dynamics of the stabilizer states by their
            stabilizers.
            }
        \item{Because the stabilizers are given by $n$ matrices which are the tensor product of $n$ Pauli matrices
            this can be simulated in $\mathcal{O}\left(n^2\right)$ time instead of $\mathcal{O}\left(2^n\right)$.}
    \end{itemize}

\end{frame}
}

{
\begin{frame}{Measurements on Stabilizer States}
    \begin{itemize}
        \item{
                Consider a Pauli observable $g_a \in \{(-1)^s X_a, (-1)^s Y_a, (-1)^s Z_a\}$ and the projector
                onto its eigenspace $\frac{I + g_a}{2}$.
            }
        \item{If $g_a$ commutes with all $S^{(i)}$ the observable $g_a$ is diagonal in this basis and 
            the stabilizer state $\ket{\psi}$ is the $+1$ eigenstate of $g_a$. Therefore the measurement is 
            deterministic and the stabilizers remain unchanged.}
    \end{itemize}

\end{frame}
}
{
\begin{frame}{Measurements on Stabilizer States}
    \begin{itemize}
        \item{If $g_a$ does not commute with all stabilizers $A := \left\{S^{(i)} \middle| \left[g_a, S^{(i)}\right] \neq 0\right\}$
            is the set of stabilizers that anticommute with $g_a$.}
        \item{
                To compute the probability to measure a result of $s=0$ one can use the trace formula
                \begin{equation}
                \begin{aligned}
                    P(s=0) &= \Tr(\frac{I + g_a}{2} \ket{\psi}\bra{\psi}) \\
                            &= \Tr(\frac{I + g_a}{2} S^{(j)} \ket{\psi}\bra{\psi}) \\
                            &= \Tr(S^{(j)}\frac{I - g_a}{2} \ket{\psi}\bra{\psi}) \\
                            &= \Tr(\frac{I - g_a}{2} \ket{\psi}\bra{\psi}) \\
                            &= P(s=1)\\
                \end{aligned}
                \end{equation}

                where $S^{(j)} \in A$. The stabilizer $S^{(j)}$ pulled to the right using the cyclic property of the
                trace and absorbed into the $\bra{\psi}$.
            }
    \end{itemize}

\end{frame}
}

\end{document}
