% vim: ft=tex iskeyword=@,48-57,_,-,192-255,\: dictionary=bibkeys.lst,labels.lst:
\chapter{Quantum Information in Open Quantum Systems}
\label{chap:quantum}

\enlargethispage{\baselineskip}
The central focus of this thesis is the numerical realization of quantum
gates that are robust with respect to dissipation.
While the numerical tools are presented in chapter~\ref{chap:numerics},
here, a concise overview of the theoretical foundations is given.
We touch upon two sub-fields of quantum theory. The first
is quantum computing, i.e., the theory of how information can be
encoded and processed in quantum systems.
After introducing the basic terminology of quantum
mechanics in section~\ref{sec:qm_postulates} and defining quantum bits (qubits)
in section~\ref{sec:qubit}, we discuss single-qubit and two-qubit gates in
sections~\ref{sec:quantum_computing}--\ref{sec:C_LI}.
The second field is the theory of open quantum systems, i.e., of quantum systems
undergoing dissipation. The state of such a system can no longer be described as
a vector in Hilbert space. Instead, the \emph{density
matrix formalism} reviewed in section~\ref{sec:density_matrix_formalism} is
used. The time-evolution within this formalism is presented in
section~\ref{sec:quantum_master_eq}, before discussing some of the techniques
for countering decoherence in section~\ref{sec:quantum_counter_decoherence}.

The material presented here is not a complete review of either topic by far;
the intention is to define the central terms,
introduce the notation used throughout this thesis, and to provide a point of
reference for the following chapters. The description of the fundamental
concepts of quantum mechanics follow the book by Sakurai and
Napolitano~\cite{SakuraiBook}, whereas the discussion on quantum computation and
open quantum systems is mostly based on the textbooks by Nielsen and
Chuang~\cite{NielsenChuang}, and Breuer and Petruccione~\cite{BreuerBook},
respectively.

\section{The Postulates of Quantum Mechanics}
\label{sec:qm_postulates}

The fundamental postulate of quantum mechanics is that the state of a system is
completely described by a wave function $\ket{\Psi}$,
element of a Hilbert space,
\index{Hilbert space}%
and that every physical quantity, or \emph{observable}, is associated with
a Hermitian operator
$\Op{A}$.
\index{operator}%
We also define the dual $\Bra{\Psi}$
\index{dual space}
that allows to formulate the
inner product $(\cdot,\cdot) \rightarrow \Complex$.
\index{inner product}
For two states $\ket{\Psi}$,
$\ket{\phi}$, their inner product, or \emph{overlap}, is written as
$\Braket{\Psi | \phi}$. All states are normalized as
$\Norm{\ket{\Psi}} = \sqrt{\Braket{\Psi|\Psi}} = 1$.

Quantum mechanics is inherently probabilistic; knowledge of a quantum state
$\ket{\Psi}$ does not in general determine a unique value for an observable, but
only predicts the \emph{expectation value}
\index{expectation value}%
\begin{equation}
  \Avg{\Op{A}}
  = \Braket{\Psi | \Op{A} | \Psi}
  = \left(\Ket{\Psi}, \Op{A} \Ket{\Psi} \right)\,.
\end{equation}
Since the operator $\Op{A}$ is Hermitian, its expectation value is real, as
required for a physically meaningful quantity.
Of particular interest is the Hamiltonian,
whose expectation value is the total energy $E$ of the system, as expressed by
the time-independent Schrödinger equation,
\index{Schrödinger equation!time-independent}%
\begin{equation}
  \Op{H} \Ket{\Psi} = E \Ket{\Psi}\,.
  \label{eq:tise_continuous}
\end{equation}
Eq.~\eqref{eq:tise_continuous} takes the form of an eigenvalue problem, where
\ket{\Psi} is the eigenstate associated with the eigenvalue $E$.
For bound states, i.e., those that are localized by a potential to a finite
region of space, the spectrum of the Hamiltonian is discrete. That is,
Eq.~\eqref{eq:tise_continuous} can be fulfilled only for a set of $N$
eigenstates,
\begin{equation}
  \Op{H} \Ket{\phi_n} = E_n \Ket{\phi_n}\,, \quad n = 1\dots N\,.
  \label{eq:tise_discrete}
\end{equation}
The discrete, or ``quantized'' energy levels are what gives quantum
theory its name.

The set of eigenstates $\{ \ket{\phi_n} \}$ is \emph{complete}, i.e., any
state \ket{\Psi} can be expanded as
\begin{equation}
  \Ket{\Psi} = \sum_{n=1}^{N} a_n \Ket{\phi_n}\,, \quad
  \sum_{n=1}^{N} \Abs{a_n}^2 = 1\,,
  \label{eq:qm_basis_expansion}
\end{equation}
with complex coefficients $a_n$. Equivalently, introducing the
\emph{dyadic product} $\Op{P}_{i,j} = \KetBra{\phi_{i}}{\phi_{j}}$, defined as
\index{dyadic product}%
\begin{equation}
  \Op{P}_{i,j} \Ket{\Psi}
  = \left( \KetBra{\phi_i}{\phi_j} \right) \Ket{\Psi}
  = \Braket{\phi_j|\Psi} \Ket{\phi_i}\,,
\end{equation}
we can write the completeness relation
\index{completeness relation}%
\begin{equation}
  \sum_{n=1}^{N} \KetBra{\phi_n}{\phi_n} = \unity\,.
\end{equation}
$\Op{P}_n = \KetBra{\phi_n}{\phi_n}$ is also called the \emph{projector}
\index{projector}%
onto the eigenstate state $\ket{\phi_n}$.

By definition, eigenstates are also linearly independent and thus pair-wise
orthogonal, $\Braket{\phi_i | \phi_j} = \delta_{ij}$, where $\delta_{ij}$ is the
Kronecker-Delta.
\index{Kronecker-Delta}%
The set of eigenstates $\{ \ket{\phi_1} \dots \ket{\phi_N} \}$ is therefore
a complete orthonormal basis of the Hilbert space of dimension $N$.
Note that the basis is not unique; any unitary transformation \Op{U}, with
$\Op{U}\Op{U}^\dagger = \unity$, will generate a ``rotated'' basis.

Having expanded an arbitrary state $\ket{\Psi}$ in the eigenbasis of an operator
in Eq.~\eqref{eq:qm_basis_expansion}, we define the \emph{measurement} process
\index{quantum measurement}%
according to the Copenhagen interpretation:
\index{Copenhagen interpretation}%
The ``projective'' measurement of an
operator $\Op{A}$ in a given basis instantaneously ``collapses'' the state
$\ket{\Psi}$ to one of the operator's eigenstates $\ket{\phi_n}$. The
probability of obtaining any specific eigenstate is given by the absolute-square
of the expansion coefficient $a_n$.  This motivates the normalization of the
coefficients as $\sum \Abs{a_{n}}^2 = 1$, since the sum of all probabilities
must be 1.  The result of the measurement (and any subsequent measurement in the
same basis) is the eigenvalue associated with $\ket{\phi_n}$.

For a finite and discrete Hilbert space as described above, it is useful to
represent
states as complex vectors with $N$ components, and the operators as
$N \times N$ matrices, relative to a fixed basis
$\{ \ket{\phi_n}\}$. The entries in the vector representation of $\ket{\Psi}$
\index{state space vector}%
are the expansion coefficients $a_n$ of Eq.~\eqref{eq:qm_basis_expansion}. The
entries $A_{ij}$ of the operator-matrix are given by
\begin{equation}
  A_{ij} = \Braket{\phi_i | \Op{A} | \phi_j}\,.
\end{equation}

\section{Storing Information in Quantum Systems}
\label{sec:qubit}

Having a discrete and finite Hilbert space raises the possibility of using it to
encode information digitally. In classical computing, it has proven most
practical to work in a binary representation, using the logical values 0 and
1 (implemented as low and high voltage in an electrical circuit). A single
logical value is called a \emph{bit} (binary digit). In analogy, we
consider a 2-dimensional Hilbert space and label its basis states $\ket{0}$ and
$\ket{1}$. An arbitrary state of this system, called \emph{quantum bit}
(qubit), is
\index{qubit}%
\begin{equation}
  \Ket{\Psi}_{1q} = a_0 \Ket{0} + a_1 \Ket{1} \,,
  \quad \Abs{a_0}^2 + \Abs{a_1}^2 = 1\,.
  \label{eq:single_qubit_def}
\end{equation}
Whereas the classical bit is in a state of either 0 or 1, the qubit can be in
any superposition of $\ket{0}$ and $\ket{1}$.

The theory of quantum mechanics is universal in the sense that
it describes \emph{any} quantum system on an abstract level with the same
formalism. In practice, the
systems can be extremely diverse, from nuclear spins to the electronic states of
atoms and molecules, quantum dots, Bose-Einstein-condensates, nano-mechanical
devices, photons (free or in optical cavities), or superconducting circuits.
Mathematically, these only differ in the structure of their Hamiltonian.
From an experimentalist's points of view, of course, they are vastly
different. All of these systems are in principle candidates for the
implementation of a quantum computer.  However, in order to be practically
useful for quantum computation, a quantum system must
fulfill the five DiVincenzo criteria~\cite{DiVincenzoFP00}:
\index{DiVincezo criteria}%
\begin{enumerate}
  \item a scalable physical system with well characterized qubits,
        \label{DVC:qubits}
  \item the ability to initialize the state of the qubits,
        \label{DVC:initialization}
  \item long relevant decoherence times,
        \label{DVC:decoherence}
  \item a ``universal'' set of quantum gates, and
        \label{DVC:universal}
  \item a qubit-specific measurement capability.
        \label{DVC:measurement}
\end{enumerate}

Already the first requirement puts severe restrictions on a candidate system.
While spin-$\frac{1}{2}$ particles have two possible states (spin-up and
spin-down) and thus provide a ``natural qubit'', this is not the case in
general. Most systems have a Hilbert space of dimension larger than 2. In this
case, two of the levels must be well-separated from the remainder of the Hilbert
space, forming a \emph{logical subspace}.
\index{logical subspace}%
An example for a system that is \emph{not} suitable in
this regard is the quantum harmonic oscillator, which has all equidistant energy
levels. Thus, no two levels can be addressed separately from the others and
could provide a qubit. On the other hand, if there is sufficient anharmonicity
in the levels, the system can provide a well-defined qubit. In many cases, the
additional levels can be exploited as ancillas to implement quantum information
tasks, as we will see in the examples in
chapters~\ref{chap:robust}--\ref{chap:3states}. However, if the entire population
does not eventually return to the logical subspace, this introduces an error
into the quantum operation.

Scalability means that the system must \emph{coherently} support a large number
of qubits (at least several hundred). Mathematically, the $n$-qubit Hilbert
space is constructed from the tensor product of the $n$ single-qubit Hilbert
spaces,
\begin{equation}
\begin{split}
  \Ket{\Psi}_{nq}
  & = \sum_{b_i = 0,1}
      a_{b_1 b_2 \dots b_n}
      \Ket{b_1} \otimes \Ket{b_2} \otimes \dots \otimes \Ket{b_n} \\
  & = \sum_{b_i = 0,1}
      a_{b_1 b_2 \dots b_n}
      \Ket{b_1 b_2 \dots b_n}\,,
\end{split}
\end{equation}
\index{tensor product!of vectors}%
where $\ket{b_i}$ represents the two basis states $\ket{0}$, $\ket{1}$ of the
$i$'th qubit.  For example, for a two-qubit state,
\begin{equation}
  \Ket{\Psi}_{2q} =   a_{00} \Ket{00} + a_{01} \Ket{01}
                    + a_{10} \Ket{10} + a_{11} \Ket{11}\,.
  \label{eq:2q_state_general}
\end{equation}
In general, it is \emph{not} possible to write
\begin{equation}
\begin{split}
  \Ket{\Psi}_{2q}
  & =         \left( a_{0} \Ket{0} + a_{1} \Ket{1} \right)
      \otimes \left( b_{0} \Ket{0} + b_{1} \Ket{1} \right)
  \\ &
    = \underbrace{a_0 b_0}_{a_{00}} \Ket{00}
    + \underbrace{a_0 b_1}_{a_{01}} \Ket{01}
    + \underbrace{a_1 b_0}_{a_{10}} \Ket{10}
    + \underbrace{a_1 b_1}_{a_{11}} \Ket{11}\,.
  \label{eq:2q_state_separable}
\end{split}
\end{equation}
If Eq.~\eqref{eq:2q_state_separable} holds, $\Ket{\Psi}_{2q}$ is said to be
\emph{separable}.
\index{state!separable}%
Otherwise, $\Ket{\Psi}_{2q}$ is entangled. The entanglement of a given two-qubit
state can be quantified through the \emph{concurrence}~\cite{WoottersPRL1998}
\index{concurrence!of a state}%
\begin{equation}
  C\left( \Ket{\Psi}_{2q}\right)
  = \Abs{\Braket{\Psi_{2q} |
                 \Op{\sigma}_y \otimes \Op{\sigma}_y  |
                 \Psi_{2q}^* } }\,,
  \label{eq:state_concurrence}
\end{equation}
where $\Op{\sigma}_y$ is the Pauli-y matrix, see~Eq.~\eqref{eq:pauli_matrices}
below, and $\ket{\Psi^*}_{2q}$ is the complex conjugate of $\ket{\Psi}_{2q}$ (in
a given vector representation). The concurrence takes values in the range
$[0,1]$, where a state for which $C\left( \ket{\Psi}_{2q} \right) = 1$ is called
\emph{maximally entangled}.
\index{state!entangled}%
The standard example for maximally entangled states are the \emph{Bell states}
\index{state!Bell}%
\begin{align}
  \Ket{\Phi^+} &= \frac{1}{\sqrt{2}} \left( \Ket{00} + \Ket{11} \right)\,, &
  \Ket{\Phi^-} &= \frac{1}{\sqrt{2}} \left( \Ket{00} - \Ket{11} \right)\,, \\
  \Ket{\Psi^+} &= \frac{1}{\sqrt{2}} \left( \Ket{01} + \Ket{10} \right)\,, &
  \Ket{\Psi^-} &= \frac{1}{\sqrt{2}} \left( \Ket{00} - \Ket{11} \right)\,.
  \label{eq:bell_states}
\end{align}

Even though DiVincenzo's criterion~\ref{DVC:qubits} requires the system to scale
to a large number of qubits, we have focused here on the description of
two-qubit systems. The reason for this is that any operation on more than two
qubits can be expressed as a series of operations where in each operation, at
most two of the qubits interact~\cite{DiVincenzoPRA1995}.

Criteria~\ref{DVC:initialization} and~\ref{DVC:measurement} concern the
input-output of a quantum computer. For most implementations, this is less of
a fundamental concern than a (possibly difficult) technical challenge. It can be
useful to employ the methods of quantum control discussed in
chapter~\ref{chap:intro} to bring the system into a desired initial state.
Measurement and detection are primarily an experimentalist's task, although
theory can certainly contribute relevant aspects. For example, the ideas
on which the results of chapter~\ref{chap:3states} build have been applied to
significantly reduce the number of measurements required for the
characterization of unitary processes~\cite{ReichKochPRA13, ReichKochPRL13}.
Also, for superconducting qubits, optimal control has been applied to the
measurement process~\cite{EggerPRA2014}.

\enlargethispage{\baselineskip}
On the other hand, the implementation of
quantum gates, i.e., a unitary transformation on all the eigenstates of the
logical subspace
\index{quantum gate}%
(criterion~\ref{DVC:universal}), is where numerical optimization
techniques shine, and it is the central focus of the remainder of the thesis.
Lastly, the long decoherence times required by criterion~\ref{DVC:decoherence} are
a significant inherent challenge. The effects of decoherence are discussed in
sections~\ref{sec:density_matrix_formalism}--\ref{sec:quantum_counter_decoherence}
below; implementing quantum gates in the presence of decoherence is the focus of
chapters~\ref{chap:robust} and~\ref{chap:3states}.

\section{Gate-Based Quantum Computing}
\label{sec:quantum_computing}

\subsection{Single-Qubit Gates}

While the \emph{encoding} of information only relies on the existence of
quantized energy levels in quantum systems, its \emph{processing} implies
time-dependence.  From a given input state at time zero, a quantum computer
applies a series of logical transformations, eventually resulting in a
state at time $T$. Physically, the input state undergoes the
time evolution of the system's Hamiltonian. For
a system of qubits, we call the resulting time evolution operator $\Op{U}(T,0)$
a quantum gate $U$. For a static Hamiltonian, the time evolution operator
\begin{equation}
  \Op{U}(t,0) = \ee^{-\frac{\ii}{\hbar} \Op{H} t}
  \label{eq:time_evolution_op}
\end{equation}
is the solution of the time-dependent Schrödinger equation
\begin{equation}
  \ii \hbar \frac{\partial}{\partial t} \Ket{\Psi}
  = \Op{H} \Ket{\Psi}\,.
  \label{eq:tdse}
\end{equation}

A quantum gate operating on a single qubit can be any unitary
$2 \times 2$ matrix. Their mathematical properties are best understood with the
help of the three Pauli matrices
\begin{equation}
  \label{eq:pauli_matrices}
  \SigmaX = \begin{pmatrix}
    0 & 1 \\
    1 & 0
  \end{pmatrix}\,,
  \quad
  \SigmaY = \begin{pmatrix}
    0 & -\ii \\
    \ii & 0
  \end{pmatrix}\,,
  \quad
  \SigmaZ = \begin{pmatrix}
    1 & 0 \\
    0 & -1
  \end{pmatrix}\,.
\end{equation}
\index{Pauli matrices}%
First, the Pauli matrices are important single-qubit quantum gates themselves.
In this context, they are also written as $X$, $Y$, and $Z$,
respectively. The $X$ gate flips a qubit (analogously to a classical
logical NOT operation on a bit), whereas $Z$ creates a $\pi$ phase shift
between \ket{0} and \ket{1}.

Even more importantly, though, we can use the Pauli matrices (together with the
identity $\unity$) to describe any single-qubit Hamiltonian
\begin{equation}
  \Op{H}_{1q} = c_0 \unity + c_1 \Op{\sigma}_x
               + c_2 \Op{\sigma}_y + c_3 \Op{\sigma}_z
  \label{eq:1q_pauli_decomposition}
\end{equation}
with coefficients $c_i \in \Real$.
The gate $U$ induced by the Hamiltonian $\Op{H}_{1q}$ acting for a duration $t$
is
\begin{equation}
\begin{split}
U = \Op{U}[t,0] = \ee^{-\ii c_0 t} \;
                  \ee^{-\ii (c_1 \Op{\sigma}_x + c_2 \Op{\sigma}_y t + c_3 \Op{\sigma}_z) t}\,.
\label{eq:1q_U_Pauli}
\end{split}
\end{equation}
 From
\begin{equation}
  X = \ee^{-\ii \frac{\pi}{4} \left( \Op{\sigma}_x - \unity \right)}\,,
\end{equation}
and equivalently for $\SigmaY$ and $\SigmaZ$, we see that the Pauli matrices
are their own generators.
The contribution by the identity, defined by $c_0$, only induces a global phase,
which is physically irrelevant.
Beyond the Pauli matrices, frequently encountered single-qubit gates are the
Hadamard gate,
\index{Hadamard gate}%
\begin{equation}
  H = \frac{1}{\sqrt{2}} \left(X + Y\right)
    = \frac{1}{\sqrt{2}} \begin{pmatrix}
      1 & 1 \\
      1 & -1
    \end{pmatrix}\,,
\end{equation}
which brings the logical eigenstates into superposition, and the single-qubit
phase gate as a generalization of the Z gate,
\begin{equation}
 S_{\phi} = \begin{pmatrix}
  1 & 0 \\
  0 & \ee^{\ii \phi}
 \end{pmatrix}\,,
\end{equation}
generating a relative phase between \ket{0} and \ket{1}.

\begin{figure}[tb]
  \centering
  \includegraphics{blochsphere}
  \caption{Bloch sphere with Bloch vector for the qubit state
  $\ket{\Psi} = \frac{3}{11} \ket{0} + \frac{1+\ii}{11} \ket{1}$. The precession
  induced by a Hamiltonian proportional to $\SigmaX$, $\SigmaY$, and $\SigmaZ$
  is indicated by the orange, blue and red circles, respectively}
  \label{fig:blochsphere}
\end{figure}

An arbitrary quantum state \ket{\Psi} can be associated with the
\emph{density matrix}
\begin{equation}
  \Op{\rho} = \KetBra{\Psi}{\Psi}\,,
  \label{eq:rho_for_bloch}
\end{equation}
\index{density matrix!of a pure state}%
i.e., the projector onto that specific state. If we expand this matrix into the
three Pauli matrices, we obtain a vector $\vec{r} \in \Real^{3}$ that represents
the state up to a global phase. This vector is
called the \emph{Bloch vector}.
\index{Bloch vector}%
We have already encountered the Bloch vector in chapter~\ref{chap:intro} under
the name ``Feynman-Vernon-Hellwarth representation''.
Since for a properly normalized qubit state, $\Abs{\vec{r}} = 1$, the
Bloch vector is on the unit sphere, called \emph{Bloch
sphere} in this context.
\index{Bloch sphere}%
Like in chapter~\ref{chap:intro}, $\vec{r}$ precesses around the vector
$(c_1, c_2, c_3)$ representing the Hamiltonian, obtained from
Eq.~\eqref{eq:1q_U_Pauli}.
Specifically, Eq.~\eqref{eq:1q_U_Pauli} corresponds to the solution of
Eq.~\eqref{eq:bloch_precession}. The Bloch sphere is illustrated in
Fig~\ref{fig:blochsphere} for an arbitrary qubit state. A term proportional to
$\SigmaX$ induces a rotation around the $x$-axis, shown in orange, and
correspondingly $\SigmaY$ and $\SigmaZ$ around the $y$- and $z$-axes (blue and red,
respectively).

\subsection{Two-Qubit Gates}

For a composite system of multiple qubits, the total Hilbert space is the tensor
product of the single-qubit Hilbert spaces. Since for a single-qubit state the
Pauli matrices (including the identity) form a complete basis according to
Eq.~\eqref{eq:1q_pauli_decomposition}, for a two-qubit Hilbert space, this
means that any Hamiltonian is of the form
\begin{equation}
  \Op{H}_{2q} = \sum_{i,j} c_{ij} \Op{\sigma}_i \otimes \Op{\sigma}_j\,,
  \label{eq:2q_pauli_decomposition}
\end{equation}
generated by the sixteen operators $\Op{\sigma}_i
\otimes \Op{\sigma}_j$, for $\Op{\sigma}_{i,j} \in
\left\{ \Op{\sigma}_x, \Op{\sigma}_y, \Op{\sigma}_z, \unity \right\}$, with
the expansion coefficients
\begin{equation}
  c_{ij} = \frac{1}{4} \trace\left[
              (\Op{\sigma}_i \otimes \Op{\sigma}_j)^\dagger \Op{H}_{2q}
           \right]\,.
\end{equation}
This is analogous to Eq.~\eqref{eq:2q_state_general} for states. If there is
no interaction between the two qubits, the Hamiltonian for the two-qubit system
is
\begin{equation}
  \Op{H}_{0}
  = \Op{H}_{1q} \otimes \unity + \unity \otimes \Op{H}_{1q}\,.
\end{equation}
In matrix representation, for two operators of dimension $N$, the tensor
product is defined as
%\begin{equation}
%\Op{A} \otimes \Op{B}
%= \begin{pmatrix}
%  a_{11}b_{11} & \dots & a_{11}b_{1N} & \dots & a_{1N}b_{11} & \dots & a_{1N}b_{1N} \\
%      \vdots   &\ddots &    \vdots    &\ddots &   \vdots     &\ddots &   \vdots     \\
%  a_{11}b_{N1} & \dots & a_{11}b_{NN} & \dots & a_{1N}b_{N1} & \dots & a_{1N}b_{NN} \\
%      \vdots   &\ddots &    \vdots    &\ddots &   \vdots     &\ddots &   \vdots     \\
%  a_{N1}b_{11} & \dots & a_{N1}b_{1N} & \dots & a_{NN}b_{11} & \dots & a_{NN}b_{1N} \\
%      \vdots   &\ddots &    \vdots    &\ddots &   \vdots     &\ddots &   \vdots     \\
%  a_{N1}b_{N1} & \dots & a_{N1}b_{NN} & \dots & a_{NN}b_{N1} & \dots & a_{NN}b_{NN}
%\end{pmatrix}\,.
%\end{equation}
\begin{equation}
\Op{A} \otimes \Op{B}
= \begin{pmatrix}
  a_{11} \Op{B} & \dots  & a_{1N} \Op{B} \\
  \vdots        & \ddots & \vdots        \\
  a_{N1} \Op{B} & \dots  & a_{NN} \Op{B}
\end{pmatrix}\,.
\end{equation}
\index{tensor product!of matrices}%
The ``local'' Hamiltonian $\Op{H}_{0}$ consists only of  terms
proportional to the 6 operators
$\Op{\sigma}_x^{(1)}$,
$\Op{\sigma}_y^{(1)}$,
$\Op{\sigma}_z^{(1)}$,
$\Op{\sigma}_x^{(2)}$,
$\Op{\sigma}_y^{(2)}$,
$\Op{\sigma}_z^{(2)}$, and
$\unity$, where $\Op{\sigma}_{i}^{(1)} = \Op{\sigma}_{i} \otimes \unity$ acts
only on the first qubit, and equivalently $\Op{\sigma}_{i}^{(2)}$ acts only on
the second qubit. Starting from a non-entangled state, evolution under
$\Op{H}_0$ does not yield an entangled state. In order to generate
entanglement, there needs to exist a physical interaction between the two
qubits, reflected in an interaction Hamiltonian $\Op{H}_I$,
\begin{equation}
  \Op{H}_{2q}
  = \Op{H}_{1q} \otimes \unity + \unity \otimes \Op{H}_{1q} + \Op{H}_{I}\,,
\end{equation}
where $\Op{H}_I$ is spanned by the remaining 9 terms  $\Op{\sigma}_i \otimes
\Op{\sigma}_j$, $i,j = x,y,z$.  From hereon, we abbreviate $\Op{\sigma}_i \otimes
\Op{\sigma}_j$ as $\Op{\sigma}_i \Op{\sigma}_j$ in the context of
two-qubit Hilbert spaces.

Two very common interactions found in physical systems are $\SigmaZ\SigmaZ$ and
$\SigmaX\SigmaX + \SigmaY\SigmaY$. The former means that the interaction between
two qubits induces a relative shift on one or more of the energy levels,
resulting in a diagonal gate
\begin{equation}
  D = \diag\left\{
        \ee^{\ii \phi_{00}},
        \ee^{\ii \phi_{01}},
        \ee^{\ii \phi_{10}},
        \ee^{\ii \phi_{11}}
     \right\}\,,
     \label{eq:general_diagonal_gate}
\end{equation}
where $\phi_i = \Delta E_i t$ is a phase induced by the shift $\Delta E_i$ of the
level $i$ relative to the evolution under $\Op{H}_0$. Defining the non-local
phase
\begin{equation}
  \gamma = \phi_{00} - \phi_{01} - \phi_{10} + \phi_{11}\,,
  \label{eq:entangling_phase}
\end{equation}
\index{entangling phase}%
this gate induces the entanglement~\cite{GoerzDipl10, GoerzJPB11}
\begin{equation}
  C(D) = \Abs{\sin\frac{\gamma}{2}}\,.
\end{equation}
In general, the entanglement generated by a gate $\Op{U}$ is defined as the
maximum concurrence according to Eq.~\eqref{eq:state_concurrence} that the state
$\Op{U} \ket{\Psi}$ can have, assuming the input state $\ket{\Psi}$ is separable
\cite{KrausPRA01}.
\index{concurrence!of a gate}

For $\gamma = \pi$, the gate is a perfect entangler, i.e. $C(D)$ takes the maximum
value 1 and there exists a separable state that is mapped to a maximally
entangled state.
\index{perfect entangler}%
The canonical form in this case is the Controlled-Phase (CPHASE) gate,
\begin{equation}
  \text{CPHASE} = \diag\{1,1,1,-1\}\,.
\end{equation}
\index{CPHASE gate}

In the taxonomy of two-qubit gates, the CPHASE is one in the large class of
``controlled-unitary'' gates.
\index{controlled unitary}%
In this type of gate, the first qubit acts as
a ``control'' qubit. If the control qubit is in the state \ket{1}, the
single-qubit gate $U$ is performed on the second ``target'' qubit. If the
control qubit is in the state \ket{0}, the target qubit remains unchanged. In
the case of the CPHASE, $U$ is the single-qubit phase gate $Z = \Op{\sigma}_z$.
Probably the most well-known controlled-unitary is the CNOT
gate~\cite{FeynmanFP1986},
\begin{equation}
\text{CNOT} =
  \begin{pmatrix}
  1 & 0 & 0 & 0 \\
  0 & 1 & 0 & 0 \\
  0 & 0 & 0 & 1 \\
  0 & 0 & 1 & 0
  \end{pmatrix}\,.
\end{equation}
\index{CNOT gate}%
In this case, $U$ is the logical-not operation implemented by
$X = \Op{\sigma}_x$.

To understand the $\SigmaX\SigmaX + \SigmaY\SigmaY$ interaction, we introduce
\begin{gather}
  \SigmaPlus = \SigmaX + \ii \SigmaY\,, \\
  \SigmaMinus = \SigmaX - \ii \SigmaY\,.
  \label{eq:SigmaPlusMinus}
\end{gather}
These are the raising and lowering operators on the qubit. The interaction
is then written as
\begin{equation}
  \SigmaX\SigmaX + \SigmaY\SigmaY
  = \frac{1}{2} \left(\SigmaPlus\SigmaMinus + \SigmaMinus\SigmaPlus \right)\,.
  \label{eq:sigma_exchange}
\end{equation}
We see that this can be interpreted as an \emph{exchange interaction}, where an
\index{exchange interaction}%
excitation moves from one qubit to the other. This interaction induces the
iSWAP gate
\begin{equation}
\text{iSWAP} =
  \begin{pmatrix}
  1 & 0 & 0 & 0 \\      % 00 -> 00
  0 & 0 & \ii & 0 \\    % 01 -> i 10
  0 & \ii & 0 & 0 \\    % 10 -> i 01
  0 & 0 & 0 & 1 \\      % 11 -> 11
  \end{pmatrix}\,.
\end{equation}
\index{iSWAP gate}%
It is equivalent two consecutive CNOT operations, where the target
qubit for the second CNOT is the control qubit from the first CNOT. Therefore,
iSWAP is also called the Double-CNOT (DCNOT) gate.
\index{DCNOT gate}%
A summary of the most relevant two-qubit gates and the Hamiltonians inducing
them is given in appendix~\ref{AppendixGates}.

In a physical implementation not based on actual spins we often have to include
additional levels beyond \ket{0} and \ket{1} in the description of the system.
For a time evolution $\Op{U}(T,0)$, the implemented quantum gate is
\begin{equation}
  U = \Op{P} \Op{U}(T,0)\,,
\end{equation}
where \Op{P} is the projector onto the logical subspace,
\begin{equation}
  \Op{P} = \KetBra{0}{0} + \KetBra{1}{1}\,,
\end{equation}
and equivalently for a two-qubit system. The gate $U$ will only be unitary if
at time $T$, all population returns to the logical subspace. This does not imply
that the population must also remain in the logical subspace during the entire
duration of the dynamics. In fact, it may be necessary to leave the logical
subspace in order to implement a quantum gate. An example is the implementation
of a two-qubit gate using trapped Rydberg atoms, as is the focus of
chapter~\ref{chap:robust}. The logical subspace is defined by two low-lying
electronic states of the atoms. However, the atoms can be excited to a
Rydberg state \ket{r}, i.e., a state with large principal quantum number. When
both atoms are in \ket{r}, they feel a dipole-dipole interaction, shifting the
\ket{rr} level and thus creating the necessary entanglement for a quantum gate.
While the Hamiltonian can no longer be expressed in terms of Pauli matrices,
the intuition for the implementation of gates remains: the simple shift of the
\ket{rr} level can be mapped onto the logical subspace as a $\SigmaZ\SigmaZ$
interaction and allows the implementation of a CPHASE.

For superconducting qubits, discussed in chapter~\ref{chap:transmon}, the
logical subspace consists of the two lowest levels of an anharmonic ladder. The
Hamiltonian includes the term $\Op{b}_1^{\dagger} \Op{b}_2
+ \Op{b}_1 \Op{b}_2^{\dagger}$, where $\Op{b}_{1,2}$ is the lowering operator
for the first and second (multilevel) qubit and works analogously to the
interaction in Eq.~\eqref{eq:sigma_exchange}, allowing for the implementation of
an iSWAP gate, among others.

\subsection{Controllability}
\label{subsec:controllability}

So far, we have only considered a static interaction Hamiltonian. The situation
becomes more interesting if the Hamiltonian includes one or more time-dependent
controls $u_i(t)$,
\begin{equation}
\Op{H} = \Op{H}_0 + \sum_{i=1}^{m} u_i(t) \Op{H}_i\,.
\label{eq:H_with_controls}
\end{equation}
If we restrict ourselves to the logical subspace such that each $\Op{H}_i$
takes the form of Eq.~\eqref{eq:2q_pauli_decomposition}, understanding which
gates are induced by Eq.~\eqref{eq:H_with_controls} relies on the theory of
dynamical Lie algebras and groups~\cite{DAlessandroBook}.
\index{Lie group}%
In practical terms, the procedure for determining which gates can be implemented
in a given system, is as follows:
\begin{enumerate}
  \item Start from the set of independent terms in the Hamiltonian,
        \begin{equation}
          \Lie = \{\Op{H}_0, \Op{H}_1, \dots \Op{H}_{m}\}\,.
        \end{equation}
  \item Calculate all commutators of the elements of $\Lie$. Extend $\Lie$ by
        those commutators that are linearly independent from the existing
        elements.
  \item Repeat the procedure, building nested commutators, until it yields no
        further new elements.
\end{enumerate}
The reachable gates are those in the span of the dynamical Lie algebra,
\begin{equation}
  \ee^{-\ii \Lie t}
  \equiv
  \left\{ \prod_{\Op{A}_i \in \Lie} \ee^{-\ii \Op{A}_i t} \right\}\,.
  \label{eq:lie_algebra}
\end{equation}
If the dimension of the dynamical Lie algebra is full, i.e., it contains 16
linearly independent elements for a two-qubit Hamiltonian, the system is
\emph{fully controllable}, i.e., every quantum gate can be implemented in
principle. An example for such a controllability analysis is given in
section~\ref{sec:pe_controllability} of chapter~\ref{chap:pe}.
\index{controllability}

From a control perspective, it is essential to have a measure for whether
a unitary evolution $\Op{U}(T,0)$ implements a specific quantum gate $\Op{O}$ at
time $T$. The gate fidelity in this case is defined as
\index{fidelity!gate}%
\begin{equation}
  F(\Op{U}(T,0))
  = \frac{1}{N^2} \Abs{\Tr\left[\Op{O}^\dagger  \Op{P} \Op{U}(T,0) \right]}^2\,,
  \label{eq:gate_fidelity}
\end{equation}
where $\Op{P}$ is the projector to the logical subspace. The square-modulus
ensures that the gate $\Op{O}$ only has to be implemented up to a global phase.
The gate fidelity is not necessarily the best functional to be used for the
purpose of optimization, as will be discussed in chapter~\ref{chap:numerics}.
%However, for a closed quantum system, it does provide a physically meaningful
%measure, in the sense that $F(\Op{U}(T,0)$ is the expectation for the population
%of the state $\Op{O}\ket{\Psi}$

\subsection{Universal Sets of Gates}
\label{sec:universal_gates}
\index{universal gates}

\begin{figure}[tb]
  \centering
  \includegraphics{fouriercircuit}
  \caption{Exemplary circuit diagram, showing the implementation of a quantum
  Fourier transform on three qubits.}
  \label{fig:fouriercircuit}
\end{figure}

Any practical quantum computer will operate on a large number of qubits. In
principle, a quantum algorithm could be described as a \emph{black box} unitary
transformation acting on the entire Hilbert space $\Hilbert^N$ for $N$ qubits.
However, this approach would hardly be practical. The logical circuits in
a classical computer are decomposed into small logical elements. Indeed, it can
be shown that any logical function can be implemented using only the classical
NAND gate,
\index{NAND}%
taking two bits as input and returning \emph{true} unless both of
the inputs are \emph{true}. This greatly simplifies the production of integrated
circuits, as only a single logical element needs to be repeated over and over
again on the circuit board. In a gate-based quantum computer, we follow the same
approach~\cite{FeynmanFP1986}. Unlike in the classical case, there is no single
gate that can be used to implement an arbitrary quantum transformation.

However, it has been shown that any quantum transformation can be decomposed into the set
of all single-qubit gates, together with one two-qubit quantum gate, most commonly
CNOT~\cite{BarencoPRA1995}. This is the motivation to restricting any discussion
about the implementation of gates to single- and two-qubit gates. The
decomposition of a larger gate into single- and two-qubit gates is commonly in
the form of a quantum circuit diagram.
\index{quantum circuit}%
An example is shown in Fig~\ref{fig:fouriercircuit}, giving a decomposition for
a quantum-Fourier transform on three qubits. In many physical implementations,
\index{Fourier transform!quantum}%
single-qubit gates are relatively easy to implement, since they require only
local manipulation of a qubit. In contrast, the implementation of an entangling
two-qubit gate is usually non-trivial.

Instead of requiring arbitrary single-qubit gates, one can also find a finite
set of single-qubit gates that, together with an entangling gate such as CNOT,
can implement an arbitrary unitary up to a predefined precision. There are several
such possible sets; one example consists of the Hadamard gate $H$, the phase
gate $S_{\frac{\pi}{4}}$, and the CNOT gate. With $H$ and $S_{\frac{\pi}{4}}$
alone, any single-qubit gate can be approximated to arbitrary precision, and in
fact with relatively good efficiency: in order to approximate a single-qubit
gate with an error of $\varepsilon$, on the order of
$O\left[\log^{4}\left(1/\varepsilon\right)\right]$
operations are required~\cite{DawsonQIC2006}.

The question of efficiency arises also for the choice of the two-qubit gate
included in the universal set. While the use of CNOT is standard, it has been
shown that nearly \emph{any} non-local two-qubit gate is universal in
combination with single-qubit gates~\cite{DeutschPRSA1995, ZhangPRL2003}, albeit
not necessarily with high efficiency. Using the CNOT gate and single-qubit
operations, any other two-qubit gate can be implemented using at most three
applications of CNOT~\cite{VidalPRA2004}. However, the
\begin{equation}
\text{B-GATE} =
  \begin{pmatrix}
  \cos\frac{\pi}{8} & 0 & 0  & \ii \sin\frac{\pi}{8} \\
  0 & \cos\frac{3\pi}{8} & \ii \sin\frac{3\pi}{8} & 0 \\
  0 & \ii \sin\frac{3\pi}{8} & \cos\frac{3\pi}{8} & 0 \\
  \ii \sin\frac{\pi}{8} & 0 & 0 & \cos\frac{\pi}{8}
  \end{pmatrix}
\end{equation}
\index{B-GATE}%
has been shown~\cite{ZhangPRL2004} to require only two applications for
universality.

\section{Two-Qubit Gates in the Weyl Chamber}
\label{sec:C_LI}

Even more important than theoretical considerations about which single-qubit
and two-qubit gates are good candidates for efficient universal quantum
computing, is the question which gates can easily and with high fidelity be
implemented in a given physical implementation. Also, it might be beneficial to
include a small number of additional gates for the implementation of a specific
algorithm, rather than insisting on a standard set.
It is not always obvious which gates are easiest to implement for a given
physical system. For the Rydberg Hamiltonian discussed in chapter~\ref{chap:robust},
only diagonal gates are possible, and thus neither CNOT nor the B-GATE could be
included in a universal set on this platform.

The theory of local invariants~\cite{MakhlinQIP2002, ZhangPRA03} provides a way
to address this issue. Under the assumption that single-qubit gates are easily
available, we characterize a quantum gate only by its nonlocal component. For
example, a CNOT gate can easily be obtained from a CPHASE using only two
additional Hadamard gates,
\begin{equation}
\begin{pmatrix}
  1 & 0 & 0 & 0 \\
  0 & 1 & 0 & 0 \\
  0 & 0 & 0 & 1 \\
  0 & 0 & 1 & 0
\end{pmatrix}
=
\left(\unity \otimes \op{H}\right)
    \begin{pmatrix}
      1 & 0 & 0 & 0 \\
      0 & 1 & 0 & 0 \\
      0 & 0 & 1 & 0 \\
      0 & 0 & 0 & -1
    \end{pmatrix}
\left(\unity \otimes \op{H}\right)\,.
\label{eq:CNOT_CPHASE_equivalent}
\end{equation}
\index{CPHASE gate}%
\index{CNOT gate}%
In this sense, CPHASE and CNOT are \emph{locally equivalent}, i.e., they only
differ by local operations. All gates fulfilling this property are considered to
be in a single local equivalence class. We denote the equivalence class as e.g.\
$[\text{CNOT}]$.
\index{local equivalence}

\begin{figure}[tb]
  \centering
  \includegraphics{weylchamber}
  \caption{Weyl chamber of two-qubit gates. The labeled vertices and midpoints
  correspond to the equivalence class of prominent gates, with $O$ and $A_2$ for
  the identity (i.e., all local gates), $L$ for $[\text{CNOT/CPHASE}]$,
  $Q$ and $M$ for $[\sqrt{\text{iSWAP}}]$, $P$ and $N$ for two different
  $[\sqrt{\text{SWAP}}]$, $A_2$ for $[\text{iSWAP/DCNOT}]$, $B$ for
  $[\text{B-GATE}]$ and $A_3$ for $[\text{SWAP}]$.
  The shaded polyhedron at the center contains all gates that
  are perfect entanglers, cf.~appendix~\ref{AppendixGates}.}
  \label{fig:weylchamber}
\end{figure}
The notion of the local equivalence class is based on the Cartan decomposition
\index{Cartan decomposition}%
of the general dynamical Lie group of the two-qubit Hilbert space, which yields
that any two-qubit gate can be written (up to a global phase)
as~\cite{ZhangPRA03}
\begin{equation}
  \Op{U} = \Op{k}_1 \exp\left[ \frac{\ii}{2} \left(
              c_1 \SigmaX\SigmaX + c_2 \SigmaY\SigmaY + c_3 \SigmaZ\SigmaZ
            \right) \right] \Op{k}_2\,,
  \label{eq:cartan_decomposition}
\end{equation}
for real coefficients $(c_1, c_2, c_3)$, where $\Op{k}_1$ and $\Op{k}_2$
contain only local operations. Every point in $\Real^3$ given by the coordinates
$(c_1, c_2, c_3)$ represents a local equivalence class. Removing symmetries in
the coefficients results in the geometric shape shown in
Fig.~\ref{fig:weylchamber}, named the \emph{Weyl chamber}.
\index{Weyl chamber}%
There is one remaining mirror symmetry through the $L$--$A_2$ line on the ground
surface of the Weyl chamber, such that e.g. $O$ and $A_1$, and $Q$ and $M$ are
associated with the same local equivalence class. Otherwise, every point in the
Weyl chamber uniquely corresponds to a set of gates that differ only by local
transformations.  The $c_1$ axis describes the diagonal gates in
Eq.~\eqref{eq:general_diagonal_gate}, with $c_1 = \gamma$
-- or, more generally, all controlled-unitaries. The gates at any point except
$O$, $A_2$ (local gates), and $A_3$ (gates equivalent to the SWAP gate) create
non-zero entanglement. Most two-qubit gates, those indicated by the
shaded polyhedron in Fig.~\ref{fig:weylchamber} are perfect entanglers
\cite{WattsE2013}. Based on the Weyl chamber coordinates $(c_1, c_2, c_3)$,
the \emph{local invariants} $(g_1, g_2, g_3)$ can be derived as
\index{local invariants}%
\begin{subequations}
\label{eq:li_from_c}
\begin{align}
g_1
&= \frac{1}{4}\big[\cos\left(2c_1\right)+\cos\left(2c_2\right)
     +\cos\left(2c_3\right)
+ \nonumber \\ & \qquad
     +\cos\left(2c_1\right)\cos\left(2c_2\right)
     \cos\left(2c_3\right)\big]\,,
\\
g_2
&= \frac{1}{4}\sin\left(2c_1\right)\sin\left(2c_2\right)
   \sin\left(2c_3\right)\,,
\\
g_3
&= \cos\left(2c_1\right)+\cos\left(2c_2\right)+\cos\left(2c_3\right)\,,
\end{align}
\end{subequations}
uniquely identifying a gate's local equivalence class. That is, two gates with
the same values $(g_1, g_2, g_3)$ differ only by single-qubit operations.

The local invariants have the additional benefit that they can be calculated
analytically directly from the gate \Op{U}, whereas the procedure for
determining the Weyl chamber coordinates~\cite{ChildsPRA2003} requires numerical
diagonalization and branch-selection of the complex logarithm. As an
alternative to Eq.~\eqref{eq:li_from_c}, the local invariants may also be
written as
\begin{subequations}
\label{eq:local_invariants}
\begin{align}
g_1 &=\frac{1}{16}\Re\left\{\tr^2(\Op{m})\right\}\,,\\
g_2 &=\frac{1}{16}\Im\left\{\tr^2(\Op{m})\right\}\,,\\
g_3 &=\frac{1}{4}\left[\tr^2(\Op{m})-\tr\left(\Op{m}^2\right)\right]\,,
\end{align}
\end{subequations}
where
\begin{equation}
  \Op{m} = \Op{U}_B^T \Op{U}_B\,,
\end{equation}
and
\begin{equation}
  \Op{U}_B = \Op{Q} \Op{U} \Op{Q}^\dagger
\end{equation}
is the gate written in the \emph{magic Bell basis},
\index{magic basis}%
\begin{equation}
  \Op{Q} = \frac{1}{\sqrt{2}} \begin{pmatrix}
    1 &   0 &  0 & \ii \\
    0 & \ii &  1 & 0 \\
    0 & \ii & -1 & 0 \\
    1 &   0 &  0 & -\ii
  \end{pmatrix}\,.
  \label{eq:qmagic}
\end{equation}

\section{Density Matrix Formalism}
\label{sec:density_matrix_formalism}

In the context of the Bloch sphere, we have already introduced the \emph{pure
state density operator},
\begin{equation}
  \Op{\rho}  = \KetBra{\Psi}{\Psi}
  \label{eq:rho_pure_state}
\end{equation}
for an arbitrary quantum state $\ket{\Psi}$.
When \ket{\Psi} is written as a Hilbert space vector with respect to a fixed
basis $\{ \ket{\phi_i} \}$, we obtain the \emph{density matrix} representation
in that basis, with
\begin{equation}
  \rho_{ij} = \Braket{\phi_i | \Op{\rho} | \phi_j}\,.
\end{equation}
\index{density matrix!of a pure state}%
The density matrix is completely equivalent to the state space vector in Hilbert
space. Via a simple
application of the chain rule in the time-dependent Schrödinger
equation~\eqref{eq:tdse}, the equation of motion of the density matrix is
derived as the Liouville-von Neumann equation
\begin{equation}
  \ii \hbar \frac{\partial}{\partial t}  \Op{\rho}
  = \left[\Op{H}, \Op{\rho} \right]\,.
  \label{eq:LvN_unitary}
\end{equation}
\index{Liouville-von Neumann equation}%
Furthermore, the expectation value of any Hermitian Hilbert space operator
\Op{A} is
\begin{equation}
  \Avg{\Op{A}}  = \Tr\left[\Op{A}\Op{\rho}\right]\,.
\end{equation}

The measurement process exposes the probabilistic aspect of quantum mechanics.
For example, a measurement in the canonical basis of the state $\ket{\Psi}
= \frac{1}{\sqrt{2}} \left( \ket{0} + \ket{1} \right)$ of a two-level system
yields the statistical ensemble $\{(\frac{1}{2}, \ket{0}), (\frac{1}{2}, \ket{1})\}$.
That is, after the measurement the system is in the state \ket{0} \emph{or} in
the state \ket{1}, each with 50\% probability. The concept of the density matrix
can be extended to describe the state of the system after the measurement. For a
statistical ensemble of $N$ quantum states $\ket{\Psi_i}$, $i \in [1, N]$, each
occurring with probability $p_i$, the \emph{mixed state density matrix} is
defined as
\index{density matrix!of a mixed state}%
\begin{equation}
  \Op{\rho} = \sum_{i=1}^{N} p_i \KetBra{\Psi_i}{\Psi_i}\,.
\end{equation}

Given an arbitrary density matrix $\Op{\rho}$, the expectation value for the
result of a population measurement with regard to a given state \ket{\Psi} is
\begin{equation}
  p = \Braket{\Psi | \Op{\rho} | \Psi}\,.
\end{equation}
This probability for finding the system in the state \ket{\Psi} now
combines both the \emph{inherent} quantum mechanical probability due to the
projective measurement, and as well as the simple (classical) lack of knowledge
of the quantum state, e.g.\ through previous non-recorded measurements of the
system.

The generalized density matrix has the following properties:
\begin{enumerate}
  \item $\Op{\rho}$ is Hermitian and positive-semidefinite.
  \item $\Tr\left[\Op{\rho}\right] = 1$, i.e., the total population is
  normalized to 1
  \item $\frac{1}{N} \le \Tr\left[\Op{\rho}^2\right] \le 1$, where $N$ is the
  dimension of the Hilbert space. A purity of $\frac{1}{N}$ is obtained for the
  completely mixed state $\Op{\rho} = \frac{1}{N} \unity$, whereas a purity of
  1 is obtained for any pure state $\Op{\rho} = \KetBra{\Psi}{\Psi}$.
\end{enumerate}

With respect to a given basis $\{\ket{\phi_i}\}$, the diagonal elements of the
density matrix give the population in each of the basis states. The off-diagonal
elements $\rho_{ij}$ are called \emph{coherences}; they express the phase
relationship between the basis states $\ket{\phi_i}$ and $\ket{\phi_j}$,
assuming both states have non-zero population. When a coherence is zero, this
indicates an \emph{incoherent} superposition of those two basis states.

Mathematically, the density matrices are the elements of \emph{Liouville space}.
\index{Liouville space}%
The inner product of Liouville space is defined via the Hilbert-Schmidt product
\begin{equation}
  \left( \Op{\rho}_1, \Op{\rho}_2 \right)
  = \Tr[\Op{\rho}_1^\dagger \Op{\rho}_2]
  = \Tr[\Op{\rho}_1 \Op{\rho}_2]\,.
\end{equation}
Thus, the proper mathematical (``induced'') norm of a density matrix is
\begin{equation}
  \Norm{\Op{\rho}} = \sqrt{\Tr{\Op{\rho}^2}}\,.
\end{equation}
\index{density matrix!norm}%
Since $\Norm{\Op{\rho}}^2$ is identical to the purity, only pure states have
norm one. This sometimes causes confusion, as it is common to
consider $\Tr[\Op{\rho}] = 1$ as the ``normalization condition''
for a density matrix. However, this refers to the normalization of
probabilities, not the norm of the state.
A basis of Liouville space is given by all the dyadic products
$\{ \KetBra{\phi_i}{\phi_j} \}$ for the eigenstates $\{\ket{\phi_i}\}$ of the
associated Hilbert space.
The dimension of Liouville space is therefore $N^2$ if
$N$ is the dimension of the Hilbert space. Note, however, that the matrices
$\KetBra{\phi_i}{\phi_j}$ for $i \neq j$ are not themselves density matrices,
since they are not Hermitian.

For a composite system in the Hilbert space $\Hilbert = \Hilbert_A \otimes
\Hilbert_B$ where $N_A$ and $N_B$ is the dimension of $\Hilbert_A$ and
$\Hilbert_B$, respectively, an arbitrary density matrix takes the form
\begin{equation}
  \Op{\rho}
  = \sum_{i,i'=1}^{N_A} \sum_{j,j'=1}^{N_B}
    \rho_{ij,i'j'} \KetBra{ij}{i'j'}\,,
\end{equation}
where $\{\ket{i}\}$ and $\{\ket{j}\}$ are a basis of $\Hilbert_A$ and
$\Hilbert_B$. The density matrix formalism allows to describe the
state of only subsystem $\Hilbert_A$ as the reduced density matrix
\begin{equation}
\Op{\rho}_A
=
\Tr_B\left[\Op{\rho}\right]
=
\sum_{i,i'=1}^{N_A} \underbrace{\left[
  \sum_{j,j'=1}^{N_B}
  \sum_{j''=1}^{N_B}
    \rho_{ij,i'j'} \Braket{j''|j}\Braket{j'|j''}
\right]}_{\left(\Op{\rho}_A\right)_{i,i'}}
\KetBra{i}{i'}\,.
\end{equation}
\index{partial trace}%
The result of this partial trace is a state where all
knowledge of subsystem B has been erased. The resulting density matrix
$\Op{\rho}_A$ will have purity one only if the subsystems A and B in $\Op{\rho}$
were not entangled.

Typically, we are interested in some relatively small quantum system (a qubit,
for example), which is not completely isolated from its environment.  While the
qubit and the environment are initially in the separable state $\Op{\rho}_S
\otimes \Op{\rho}_E$ (otherwise, the qubit would not be considered well-defined
as required by the DiVincenzo criteria), the non-zero interaction between them
will lead to entanglement between system and environment at later times $t$.  We
consider the qubit in this case to be an \emph{open quantum system}.
\index{open quantum system}%

\begin{figure}[tb]
  \centering
  \includegraphics{dynmap}
  \caption{Diagram showing how the dynamical map $\DynMap(t,0)$ is obtained by
  tracing out the environment from the unitary evolution of the total state.
  Adapted from~\cite{BreuerBook}.}
  \label{fig:dynmap}
\end{figure}

In principle, we could simply extend the model to include the environment.
In practice, this is usually not feasible due to the large or infinite number of
degrees of freedom of the environment. However, at least formally,
the time evolution in this composite Hilbert space is unitary with
Eq.~\eqref{eq:LvN_unitary}, and the state of the qubit could be obtained by
taking a partial trace over the environment, giving the equation of motion
\begin{equation}
  \ii \hbar \partdifquo{t} \Op{\rho}_S
  = \Tr_E \left[\Op{H}, \Op{\rho} \right]\,.
  \label{eq:LvN_partial_trace}
\end{equation}
The solution of Eq.~\eqref{eq:LvN_partial_trace} is called the
\emph{dynamical map},
\index{dynamical map}%
\begin{equation}
  \Op{\rho}_S(t)
  = \DynMap(t,0) \Op{\rho}_S(0)
  = \Tr_E \left[ \Op{U}(t,0)\, \Op{\rho}_{SE}(0)\, \Op{U}^\dagger(t,0)\right]\,.
  \label{eq:dynmap}
\end{equation}
The relationship between the unitary evolution in the composite
system-environment Hilbert space and the dynamical map is illustrated in
Fig.~\ref{fig:dynmap}. Since tracing out the environment can bring the system to
a mixed state, the interaction with the environment is the source of
decoherence on the system.

%we must find an effective equation of motion for the system by itself, taking
%the form
%\begin{equation}
%  \ii \hbar \frac{\partial}{\partial t} \Op{\rho}_S
%  = \left[ \Op{H}, \Op{\rho}_S \right]
%    + \Liouville_D\left[ \Op{\rho}_S \right]\,,
%\end{equation}
%where the first term describes the coherent part of the evolution, and the
%non-Hermitian operator $\Liouville_D$ includes all the dissipative effects
%originating from the system-bath interaction.

\section{Master Equation in Lindblad Form}
\label{sec:quantum_master_eq}

While the approach of including the environment in the total Hilbert space is
formally correct, an accurate model
often has to include so many degrees of freedom of the environment that an exact
treatment of the full system-environment-dynamics is intractable.
Therefore, we must find an \emph{effective} description of the system dynamics
by itself, i.e., determine an explicit expression for the dynamical map
$\DynMap(t,0)$ that only includes operators acting on $\Hilbert_S$.

\subsection{Kraus Operator Representation}

From Eq.~\eqref{eq:dynmap},
expanding the state of the environment as
\begin{equation}
\Op{\rho}_E
= \sum_{\beta=1}^{N_E}
  \lambda_{\beta} \KetBra{\phi_\beta}{\phi_\beta}\,,
\end{equation}
where $\left\{\Ket{\phi_\beta}\right\}$ is a complete basis of $\Hilbert_E$, and
writing out the partial trace yields
\begin{equation}
\begin{split}
  \Op{\rho}_S(t)
  &
  = \sum_{\alpha}
  \Big\langle  \phi_{\alpha} \Big\vert \;
     \Op{U}(t,0) \left(
     \Op{\rho}_{S}(0)
     \otimes
     \sum_{\beta} \lambda_{\beta}
                  \KetBra{\phi_\beta}{\phi_\beta}
     \right) \Op{U}^\dagger(t,0) \;
  \Big\vert  \phi_{\alpha} \Big\rangle
 \\ &
  = \sum_{\alpha\beta}
    \underbrace{\sqrt{\lambda_{\beta}} \Braket{\phi_{\alpha} | \Op{U}(t,0) | \phi_{\beta}}}
    _{\Op{K}_{i}(t)}
    \;
    \Op{\rho}_S(0) \;
    \underbrace{\sqrt{\lambda_{\beta}}^* \Braket{\phi_{\beta} | \Op{U}(t,0)^\dagger | \phi_{\alpha}}}
    _{\Op{K}_{i}(t)^\dagger}\,.
  \label{eq:kraus_definition}
\end{split}
\end{equation}
The resulting expression
\begin{equation}
  \DynMap(t,0)\Op{\rho}(0)
  = \sum_{i=1}^{N_E^2}
    \Op{K}_{i}(t) \Op{\rho}_S \Op{K}_{i}^\dagger(t)
  \label{eq:krauss_decomposition}
\end{equation}
for the dynamical map is a \emph{Kraus decomposition}, the operators
$\Op{K}_i$ acting on the elements of $\Hilbert_S$ are the \emph{Kraus
operators}.
\index{Kraus operators}%
The only assumption has been that system and environment are initially
separable. If the Kraus operators fulfill the condition
$\sum_i \Op{K}_i^\dagger \Op{K} = \unity$, the resulting $\Op{\rho}(t)$ has
trace 1, as required for a proper density matrix.
The specific Kraus operators defined in Eq.~\eqref{eq:kraus_definition} are not
the only choice of Kraus operators describing the dynamical map. Any unitary
transformation of the Kraus operators yields another set of Kraus operators
\cite{NielsenChuang}. The minimum number $1\leq K \leq N_S^2$ of non-zero Kraus
operators that can be found this way is called the \emph{Kraus rank} of the
dynamical map.
\index{Kraus rank}

\subsection{The Quantum Dynamical Semigroup}

If the action of the dynamical map is independent from any previous evolution of
the total Hilbert space, a dynamical map where the time interval $t$ is split
into $t_1$ and $t_2$ can be written as
\begin{equation}
  \DynMap(t_1+t_2,0) = \DynMap(t_2,0) \DynMap(t_1,0)
  \label{eq:semigroup_property}
\end{equation}
This independence property is a strong assumption.
Whether it is justified depends very much on the specific structure of the
environment and the system-environment interaction. An immediate implication
is that the dynamical map is ``contracting'', i.e.\ the distance
(distinguishability) between two initial state never increases.
A general dynamical map does not have an
inverse if it induces decoherence. Together with
Eq.~\eqref{eq:semigroup_property}, this can be shown to imply~\cite{BreuerBook}
that $\left\{\DynMap(t,0)\right\}$ has
the mathematical structure of a ``continuous one-parameter semi-group''.
\index{semi-group!quantum dynamical}

It follows from the semi-group structure~\cite{BreuerBook} that the dynamical
map can be written in the form
\begin{equation}
  \DynMap(t,0) = \ee^{-\frac{\ii}{\hbar} \Liouville t}\,,
\end{equation}
where the factor $\frac{-\ii}{\hbar}$ has been factored out of $\Liouville$ in
order to yield the same structure as the time evolution operator in Hilbert
space in Eq.~\eqref{eq:time_evolution_op}.
The equation of motion for the state of the system is then
\begin{equation}
  \ii \hbar \partdifquo{t} \Op{\rho}_S(t)
  = \Liouville\left[\Op{\rho}_S(t)\right]
  \equiv
    \lim_{t \rightarrow 0} \frac{1}{t}
    \left( \DynMap(t,0)\Op{\rho}_S - \Op{\rho}_S \right)\,.
\end{equation}
We choose a complete basis $\{\Op{F_i}\}$ of $N_S^2$ operators of dimension $N_S$,
acting on the elements of $\Hilbert_S$, such that
$\Tr\left[\Op{F}_{N_S^2}\right] = 1$ and $\Tr\left[\Op{F}_i\right] = 0$
for $i<N_S^2$. These operators can be expanded in the
set of Kraus operators, Eq.~\eqref{eq:krauss_decomposition}. After some algebraic
manipulation~\cite{BreuerBook}, the equation of motion can be shown to take the
form
\begin{equation}
  \Liouville\left[\Op{\rho}_{S}\right]
  = \left[ \Op{H}, \Op{\rho}_S \right]
    + \ii \sum_{i,j=1}^{N_S^2-1} a_{ij} \left(
        \Op{F}_{i} \Op{\rho}_S \Op{F}_{j}^\dagger
        - \frac{1}{2} \left\{ \Op{F}_j^{\dagger} \Op{F}_i, \Op{\rho}_S \right\}
      \right)\,,
  \label{eq:lindblad_nondiag}
\end{equation}
where $\{\cdot,\cdot\}$ denotes the anti-commutator, and $\Op{H}$ is
a particular Hermitian operator constructed from $\{\Op{F}_i\}$.
As a last step, one can once more rotate the operator basis $\{ \Op{F}_i \}$ to
a new set $\{ \Op{A}_k \}$ such that the coefficient matrix $a_{ij}$ in
Eq.~\eqref{eq:lindblad_nondiag} is diagonalized with eigenvalues $\gamma_k$, and
arrive at the master equation in Lindblad form
\cite{LindbladCMP1976, GoriniJMP1976},
\index{master equation!in Lindblad form}%
\begin{equation}
  \Liouville\left[\Op{\rho}_{S}\right]
  = \left[ \Op{H}, \Op{\rho}_S \right]
    + \ii \sum_{k} \gamma_k \left(
      \Op{A}_k \Op{\rho}_S \Op{A}_k^{\dagger}
      - \frac{1}{2} \left\{
          \Op{A}_k^\dagger \Op{A}_k, \Op{\rho}_S
        \right\}\right)\,.
  \label{eq:MELindblad}
\end{equation}
The operators $\{ \Op{A}_k \}$ are the \emph{Lindblad operators} describing the
dissipative process.
In comparison with the unitary Liouville-von-Neumann
equation~\eqref{eq:LvN_unitary}, we see that we have obtained an additional
\emph{dissipator} $\Dissipator$ that captures the non-unitary effects of the
system-environment interaction,
\index{dissipator}%
\begin{equation}
  \ii \hbar \frac{\partial}{\partial t}  \Op{\rho}_S
  = \Liouville\left[\Op{\rho}_S\right]
  = \left[\Op{H}, \Op{\rho}_S \right]
    + \ii \Dissipator\left[ \Op{\rho}_S \right]\,.
  \label{eq:LvN_dissipator}
\end{equation}
Each Lindblad operator $\Op{A}_{k}$ can be interpreted as a \emph{decoherence
channel},
and the associated $\gamma_k$ is the \emph{rate} at which this channel acts. It
is common to absorb $\gamma_k$ in the Lindblad operators, and to write the
dissipator as either
\begin{equation}
  \Dissipator\left[ \Op{\rho} \right]
   = \sum_{k}
     \Op{A}_{\gamma_k} \Op{\rho}_S \Op{A}_{\gamma_k}^\dagger
      - \frac{1}{2} \left(
          \Op{A}_{\gamma_k}^\dagger \Op{A}_{\gamma_k} \Op{\rho}_S
         + \Op{\rho}_S \Op{A}_{\gamma_k}^\dagger \Op{A}_{\gamma_k}
       \right)
   \label{eq:dissipator}
\end{equation}
with $\Op{A}_{\gamma_k} = \sqrt{\gamma_k} \Op{A}_k$, or
\begin{equation}
  \Dissipator\left[ \Op{\rho} \right]
   = \sum_{k}
     2\Op{A}_{\frac{\gamma_k}{2}} \Op{\rho}_S \Op{A}_{\frac{\gamma_k}{2}}^\dagger
      - \Op{A}_{\frac{\gamma_k}{2}}^\dagger \Op{A}_{\frac{\gamma_k}{2}} \Op{\rho}_S
      - \Op{\rho}_S \Op{A}_{\frac{\gamma_k}{2}}^\dagger
      \Op{A}_{\frac{\gamma_k}{2}}
\end{equation}
with $\Op{A}_{\frac{\gamma_k}{2}} = \sqrt{\frac{\gamma_k}{2}} \Op{A}_k$.

% XXX Connect to DiVinenzo: needs lots of gate for quantum circuit

\subsection{Decay and Dephasing}
\label{sec:decay_and_dephasing}

While the derivation of the master equation from the semi-group
properties of the dynamical map yields the general structure of the dissipator,
it does not provide any practical way of obtaining the Lindblad operators
$\Op{A}_i$. However, we can adopt a phenomenological perspective to determine
the $\Op{A}_i$ that are associated with decoherence channels. In
a system with the eigenbasis $\{\ket{i}\}$, we consider the dissipator in
Eq.~\eqref{eq:dissipator} and two fundamental decoherence processes:
\begin{itemize}
   \item $\Op{A}_{\gamma_1} = \sqrt{\gamma_1} \KetBra{0}{1}$. This is
   a \emph{jump operator} from level \ket{1} to \ket{0}, representing a decrease
   in the energy of the system.
   \index{jump operator}%
   \item $\Op{A}_{\gamma_2^*} = \sqrt{2\gamma_2^*} \KetBra{1}{1}$. The time
   evolution under this projector does not change the energy of the system,
   but induces a phase on the level \ket{1}.
\end{itemize}

Inserting $\Op{A}_{\gamma_1}$ into Eq.~\eqref{eq:MELindblad} with $\Op{H} = 0$
and solving the resulting set of coupled differential equations for all entries
of $\Op{\rho}(t) = \Op{\rho}_S(t)$ yields
\begin{subequations}
\begin{align}
\rho_{00}(t) &= \rho_{00}(0) + \left(1-\ee^{-\gamma_1 t}\right) \rho_{11}(t)\,,\\
\rho_{11}(t) &= \rho_{11}(0)\; \ee^{-\gamma_1 t}\,,\\
\rho_{1,j\neq 1}(t)
             &= \rho_{1j}(0)\; \ee^{-\frac{\gamma_1}{2} t}\,,\label{eq:decay_deph1}\\
\rho_{i\neq 1,1}(t)
             &= \rho_{i1}(0)\; \ee^{-\frac{\gamma_1}{2} t}\,,\label{eq:decay_deph2}
\end{align}
\end{subequations}
with all other entries remaining constant.
Thus, the channel results in an exponential decay of population from level
\ket{1} to level \ket{0} with a decay rate of $\gamma_1$. This \emph{incoherent}
population transfer is associated with the loss of phase information, described
by Eqs.~(\ref{eq:decay_deph1},~\ref{eq:decay_deph2}), the decay-induced dephasing.

Similarly, for $\Op{A}_{\gamma_2}$, we obtain
\begin{subequations}
\begin{align}
\rho_{1,j\neq 1}(t)
             &= \rho_{1j}(0)\; \ee^{-\gamma_2 t}\,,\\
\rho_{i\neq 1,1}(t)
             &= \rho_{i1}(0)\; \ee^{-\gamma_2 t}\,.
\end{align}
\end{subequations}
i.e., an exponential decrease in all coherences related to level
\ket{1}, without any effect in the populations. We therefore label this
dissipative channel \emph{pure dephasing}.
\index{pure dephasing}

For the example of a two-level system starting in the initial state
$\ket{\Psi} =  \frac{1}{\sqrt{2}} \left(\ket{0}  + \ket{1} \right)$,
the time evolution for the combination of both of these channels reads
\begin{equation}
\Op{\rho}(t) = \frac{1}{2} \begin{pmatrix}
  2 -  \ee^{-\gamma_1 t} &
  \ee^{- \left( \frac{\gamma_1}{2} + \gamma_2 \right) t} \\
  \ee^{- \left( \frac{\gamma_1}{2} + \gamma_2 \right) t} &
  \ee^{-\gamma_1 t}
\end{pmatrix}\,.
\end{equation}
Borrowing from the terminology of nuclear magnetic resonance (NMR), we introduce
the longitudinal and transversal relaxation times $T_1$ and $T_2$ as the
characteristic time of the exponential decline of the population and coherences,
respectively~\cite{BlochPR1946},
\begin{equation}
  T_1 = \frac{1}{\gamma_1}, \qquad
  T_2 = \frac{1}{\frac{\gamma_1}{2}+\gamma_2}\,.
\end{equation}
For a spin in the Bloch sphere, see Fig~\ref{fig:blochsphere}, $T_1$ is measured
from the decay of the component of the spin in the direction of the magnetic
field (in the direction of the $z$-axis), whereas $T_2$ is measured as the decay
of the spin-component perpendicular to the magnetic field. With the
pure-dephasing time
\begin{equation}
  T_2^* = \frac{1}{\gamma_2}\,,
\end{equation}
the relationship
\begin{equation}
  \frac{1}{T_2} = \frac{1}{2 T_1} + \frac{1}{T_2^*}
\end{equation}
holds.
Even outside of NMR, it is extremely common to find the decoherence of a quantum
system characterized in terms of $T_1$ and $T_2^*$ times.

In the context of this thesis, the terms ``decoherence'' and
``dissipation'' are used interchangeably to refer to any process that lowers the
purity of a quantum state. Especially in NMR, a distinction between
``decoherence'' and ``dissipation'' is sometimes made, where the
term ``dissipation'' indicates that energy is exchanged with environment,
whereas ``decoherence'' strictly refers to the loss of phase information.

\subsection{A Microscopic View}
\label{subsec:markov_microscopic}

The master equation in Lindblad form has been derived using only the
mathematical property of the dynamical semigroup defined in
Eq.~\eqref{eq:semigroup_property}. What does the requirement that the dynamical
maps over two time intervals are independent mean physically? Is there a general
method for obtaining the Lindblad operators? These questions can be answered by
a rigorous derivation of the equation of motion from a microscopic model of the
system and the environment. We consider the full Hamiltonian $\Op{H}$ acting on
the elements of $\Hilbert_{SE}$,
\begin{equation}
  \Op{H} = \Op{H}_S + \Op{H}_E + \Op{H}_{SE}\,,
\end{equation}
where $\Op{H}_S$ is the Hamiltonian of only the system, $\Op{H}_E$ is the
Hamiltonian of only the environment, and $\Op{H}_{SE}$ models the
system-environment interaction. Based on the definition of the dynamical map in
Eq.~\eqref{eq:dynmap} and a series of approximations, a master equation of
Lindblad form~\eqref{eq:MELindblad} for $\Op{\rho}_S(t)$ can be
obtained~\cite{BreuerBook, SuominenGlasgow}. A review of the steps
typically taken in that derivation illuminates the underlying physical
assumptions of the master equation in Lindblad form:
\begin{enumerate}

  \item \emph{Separability}. \label{markov_cond_first}
  The system and the environment must initially be in a separable state,
  $\Op{\rho}(0) = \Op{\rho}_S(0) \otimes \Op{\rho}_E(0)$.

  \item \emph{Weak system-environment coupling}. A weak coupling allows for
  a perturbative approach, where the Liouville-von Neumann
  equation~\eqref{eq:LvN_unitary} is integrated once and inserted into
  Eq.~\eqref{eq:LvN_partial_trace} to give the first order equation (in the
  interaction picture)
  \begin{equation}
    \partdifquo{t} \Op{\rho}_S(t)
    = -\int_{0}^{t}  \Tr_E
       \left[ \Op{H}_{SE}(t),
        \left[ \Op{H}_{SE}(t'), \Op{\rho}_{SE}(t') \right]
      \right] \dd t'\,.
      \label{eq:LvN_perturb}
  \end{equation}

  \item \emph{Born approximation}.                \index{Born approximation}%
  As a further consequence of the weak system-environment coupling, and if the
  environment is much larger than the system, the environment will remain in its
  original state. The total state is separable at all times,
  \begin{equation}
    \Op{\rho}_{SE}(t) \approx \Op{\rho}_S(t) \otimes \Op{\rho}_E\;,
    \qquad
    \Op{\rho}_E \equiv \Op{\rho}_E(0)\,.
  \end{equation}

  \item \emph{Time locality}. Under the assumption that the environment retains
  no memory, it is valid to say that past states have no influence on the
  dynamics and set $\Op{\rho}_S(t') = \Op{\rho}_S(t)$ in
  Eq.~\eqref{eq:LvN_perturb}. The equation of motion obtained thereby is known
  as the \emph{Redfield equation}.
  \index{Redfield equation}%
  It is possible to derive a master equation of a very similar form to
  Eq.~\eqref{eq:MELindblad}, but with time-dependent and possibly negative decay
  rates~\cite{SuominenGlasgow}.

  \item \emph{Markov approximation}.              \index{Markov approximation}%
  Correlations in the environment are assumed to decay much faster than the time
  scale on which the system evolves. Mathematically, this allows to take the
  limit of the integration to infinity.  This is a further ``no memory'' effect.
  In combination, all of the above approximations yield the \emph{Born-Markov}
  master equation,
  \begin{equation}
    \partdifquo{t} \Op{\rho}_S(t)
    = -\int_{0}^{\infty}  \Tr_E
       \left[ \Op{H}_{SE}(t),
        \left[ \Op{H}_{SE}(t-s), \Op{\rho}_S(t) \otimes \Op{\rho}_E \right]
      \right] \dd s\,,
      \label{eq:ME_BornMarkov}
  \end{equation}
  with $s \equiv t - t'$.

  \item \emph{Secular approximation}.             \index{secular approximation}%
    \label{markov_cond_last}
    In order to arrive from Eq.~\eqref{eq:ME_BornMarkov} to the master equation
    in Lindblad form, fast-rotating terms in the interaction
    frame~\cite{BreuerBook} must be negligible, in the sense of the rotating
    wave approximation outlined in appendix~\ref{AppendixRWA}.

\end{enumerate}

\enlargethispage{\baselineskip}
A system for which the Born-Markov approximation is particularly well fulfilled
is an atom interacting with a quantized electromagnetic field~\cite{BreuerBook,
WallsMilburn}. For the specific example of a two-level system, the system and
environment are modeled as~\cite{SuominenGlasgow}
\begin{equation}
  \Op{H}_S = \frac{\hbar \omega_0}{2} \SigmaZ\,,
  \qquad
  \Op{H}_E = \sum_{k} \hbar \omega_k \Op{b}_k^\dagger \Op{b}_k\,,
\end{equation}
and the interaction between system and environment as
\begin{equation}
  \Op{H}_{SE} = \sum_{k} \left(g_k \Op{b}_k + g_k \Op{b}_k^\dagger\right)
                         \left(\SigmaPlus + \SigmaMinus\right)\,,
\end{equation}
where $\SigmaZ$, $\SigmaPlus$, and $\SigmaMinus$ are the Pauli matrices defined in
Eq.~\eqref{eq:pauli_matrices} and Eq.~\eqref{eq:SigmaPlusMinus}, $\omega_0$ is
the energy spacing in the two-level system, $\omega_k$ is the energy of mode $k$
of the electromagnetic field, and $g_k$ is the coupling strength between the
atom and the environment.
The derivation of the master equation in Lindblad form, using the approximations
listed above, yields~\cite{BreuerBook}
\begin{equation}
\begin{split}
  \partdifquo{t} \Op{\rho}_S(t)
  &
  = \gamma_0 (M+1) \left(
      \SigmaMinus \Op{\rho}_S(t) \SigmaPlus
      - \frac{1}{2} \SigmaPlus\SigmaMinus \Op{\rho}_S(t)
      - \frac{1}{2} \Op{\rho}_S(t) \SigmaPlus\SigmaMinus
    \right)
  + \\ & \quad
  + \gamma_0 M \left(
      \SigmaPlus \Op{\rho}_S(t) \SigmaMinus
      - \frac{1}{2} \SigmaMinus\SigmaPlus \Op{\rho}_S(t)
      - \frac{1}{2} \Op{\rho}_S(t) \SigmaMinus \SigmaPlus
    \right)\,,
\end{split}
\label{eq:optical_bloch}
\end{equation}
with the decoherence rate $\gamma_0$ and $M$ being the expectation value for the
number of photons in the field. At non-zero temperature, $M > 0$, and
Eq.~\eqref{eq:optical_bloch} describes the processes of spontaneous emission,
\index{spontaneous emission}%
stimulated emission,
\index{stimulated emission}%
and absorption. At zero temperature, $M = 0$, only
spontaneous emission remains, taking a form identical to the phenomenological
decay in section~\ref{sec:decay_and_dephasing}.

All dissipation in the following chapters will be assumed to be Markovian,
allowing the dynamics to be modeled by Eq.~\eqref{eq:MELindblad}. This does not
imply that non-Markovian system-bath interactions do not also commonly occur.
Markovianity implies that information that has passed from the system to the
environment is lost, whereas in a non-Markovian setting, there may be a backflow
of information~\cite{BreuerPRL2009,BreuerJPB2012}, opening up additional
potential for control. However, the treatment of non-Markovian dynamics is
beyond the scope of this thesis; we will briefly return to it in the outlook in
chapter~\ref{chap:outlook}.

\section{Implementing Quantum Gates in Open Quantum Systems}
\label{sec:quantum_counter_decoherence}

For some quantum control tasks, the presence of decoherence is not detrimental
and can even be exploited. For example, for a number of biological processes
such as photosynthesis and the ``chemical compass'' in the retina of birds, the
role of quantum effects have been demonstrated, with some evidence that these
processes are assisted by noise~\cite{HuelgaCP2013}.
Another typical example is cooling, where dissipation is
used to remove entropy from the system to the environment~\cite{BartanaJCP93}.
A similar concept is employed for the so-called ``quantum
governor''~\cite{KallushPRA06}, where the system is stabilized by transferring
fluctuations to the environment.

For the implementation of quantum gates, however, the presence of (Markovian)
decoherence is always pernicious, since by definition, the desired process is
unitary. The goal is therefore to avoid dissipative processes as much as
possible. If suitable symmetries are present in the system, it may be possible
to find \emph{decoherence free subspaces}~\cite{LidarPRL1998}
\index{decoherence free subspace}%
in which a qubit can be encoded; an approach that has been verified
experimentally~\cite{ViolaS2001}. In the context of NMR,
\emph{dynamical decoupling}~\cite{ViolaPRL1999} is a popular method, where
\index{dynamical decoupling}%
a series of short pulses are applied to the system.
The implementation of fast gates is an obvious requirement in open quantum
systems; by operating at the \emph{quantum speed limit}
\cite{CampoPRL2013,DeffnerPRL2013,LevitinPRL2009,MargolusPD1998,BhattacharyyaJPA1983},
\index{quantum speed limit}%
the effects of decoherence are minimized. This makes the use of numerical
methods of optimal control especially important, as they are able to reach this
limit~\cite{CanevaPRL09, GoerzJPB11}.
If the error due to decoherence in the gate implementation can be kept below
a certain threshold of $10^{-3}$--$10^{-4}$, depending on the system, quantum
error correction can be applied~\cite[and references therein]{DevittRPP2013}.
The basic idea of quantum error correction is to encode the information of one
\emph{logical} qubit in a system of multiple \emph{physical} qubits.
\index{quantum error correction}%

In an open quantum system, the gate fidelity defined in
Eq.~\eqref{eq:gate_fidelity} is no longer a well-defined quantity, since instead
of a time evolution operator $\Op{U}(T,0)$, the dynamics is now described by the
dynamical map $\DynMap(T,0)\Op{\rho}$. The \emph{average
fidelity}~\cite{NielsenPLA2002}
\index{fidelity!average}%
\begin{equation}
  F_{\avg} = \int \langle \Psi | \Op{O}^{\dagger}
              \DynMap(T,0)[\ket{\Psi}\!\bra{\Psi}]
             \Op{O} | \Psi \rangle \dd \Psi\,,
  \label{eq:Favg}
\end{equation}
is a measure for how much the dynamical map corresponds to a desired unitary
gate $\Op{O}$. It is defined via the Haar measure
\index{Haar measure}%
that averages over all possible states.
In practice, the gate fidelity can be evaluated as~\cite{PedersenPLA07}
\begin{equation}
\begin{split}
  F_{\avg}
  &
  = \frac{1}{N (N+1)} \sum_{i,j=1}^N \Bigg(
              \langle \varphi_i |
                \Op{O}^\dagger
                \DynMap(T,0)\left[\Ket{\varphi_i}\!\Bra{\varphi_j}\right]
                \Op{O} |
              \varphi_j \rangle
  + \\ & \qquad \qquad
              + \Tr\left[
                \Op{O}\Ket{\varphi_i}\!\Bra{\varphi_i}\Op{O}^{\dagger}
                \DynMap(T,0)\left[\Ket{\varphi_j}\!\Bra{\varphi_j}\right]
              \right]
           \Bigg)\,,
\end{split}
\label{eq:Favg_evaluation}
\end{equation}
where $N$ is the dimension of the Hilbert space, and $\{\ket{\varphi_i}\}$ are
the logical basis states. Since the average fidelity is more general than the
gate fidelity in Eq.~\eqref{eq:gate_fidelity}, it can also be used in the
unitary case, where the dynamical map is given by
\begin{equation}
  \DynMap_U(T,0) \left[\KetBra{\Psi}{\Psi}\right]
  = \Op{U}(T,0) \KetBra{\Psi}{\Psi} \Op{U}^\dagger(T,0)\,.
\end{equation}
Specifically for a two-qubit gate with unitary evolution, the average gate
fidelity can also be written as
\begin{equation}
  F_{\avg} = \frac{1}{20} % \frac{1}{n(n+1)}
      \bigg(
        \Big\vert \trace \left[ \Op{O}^\dagger \Op{U} \right] \Big\vert^2
        + \trace \left[ \Op{O}^\dagger \Op{U} \Op{U}^\dagger \Op{O} \right]
      \bigg)\,.
 \label{eq:Favg_2q_unitary}
\end{equation}
In the following chapters, we will consider several functionals that may be used
to to steer the optimization of a quantum gate. While these functionals have
advantages over Eq.~\eqref{eq:Favg} for the purpose of optimization, they are
not easily comparable. The average fidelity therefore serves as a well-defined
and  experimentally accessible benchmark that can be used to characterize the
result of an optimization, independent of the optimization functional.


\section{Background}

In this section, we give the necessary background from the probabilistic knowledge base backed question answering system.
We first describe the data sets that underly this work.
We then give a brief description of Markov Logic Networks followed by our definition of a probabilistic knowledgebase.

\subsection{Data Sets}
\label{sec:probqa-dataset}

In this demo, we use Freebase, Reverb, and NELL as the underlying knowledge bases.
These knowledge bases store collection of facts as (subject, predicate, object) triples,
representing facts related to real-world entities (people, places, and things).
Each knowledge base differs in scale, schema and construction methods.

\noindent\textbf{Freebase.} Freebase is a web-scale, human-crafted, high precision knowledge base of
well-known topics (entities) and facts~\cite{bollacker2008freebase}.
As of current writing, it contains 47.5 million entities
and 2.9 billion facts, spanning a variety of areas including People, Sports, Music, Internet,
Books, etc, organized into domains. The Freebase KB is publicly accessible as RDF triples.

\noindent\textbf{ReVerb.} ReVerb is an automatic knowledge base construction system
that extracts entities and facts from natural language text~\cite{fader2011identifying}.
It is a universal schema extraction system, extracting both entities and predicates (relations).
The extracted tuples are publicly available, and we use
its ClueWeb extractions, which contains 14.7 million facts, annotated by their confidence
and source URLs.

\noindent\textbf{NELL.} NELL is a never-ending knowledge extraction system~\cite{mitchell2015never}.
It extracts facts and updates its knowledge base every day.
As of current writing, it has extracted 84.6 million facts, of
which 2.2 million are believed to have high confidence.
Like ReVerb, each fact is annotated by its confidence and source URLs.
It also contains information on which extraction
algorithms are used to extract each fact.

In both ReVerb and NELL KBs, recent works have tried to mine \emph{first-order inference rules}.
An inference rule states causal relationships among facts, for example, we have
\[
\text{bornIn}(x, y), \text{locatedIn}(y, z) \rightarrow \text{bornIn}(x, z).
\]
This rule states that if a person \(x\) was born in location \(y\), and location \(y\)
is located within another location \(z\), then person \(x\) is also born in location \(z\).
The Sherlock-Holmes system~\cite{schoenmackers2010learning} mines 30,912 inference rules from ReVerb, and NELL also
has 2 thousand rules with an inference engine as one of its extraction component.

\subsection{Markov Logic Networks}

Markov Logic Networks (MLNs) are the standard method of modeling uncertainty.
MLNs consist of a set of weighted first-order formulae \(\{F_i, W_i\}\),
where \(F_i\) is a first-order formula and \(W_i\) is a weight
specifying how likely the formula is true.

For example, the MLN clauses below state two pieces of information:

\vspace{5pt}
\noindent\begin{tabular}{l l}
\(0.96\) & bornInState(Obama, Hawaii)\\
\(1.40\) & $\forall x\in\text{Person}, \forall y\in\text{State}, \forall z\in\text{Country}$:\\
         & bornState$(x,y) \wedge$ isState$(y,z) \rightarrow$ bornCountry$(x,z)$
\end{tabular}

The first clause states that that Obama was born in the state of Hawaii.
The second formulate is an inference rule that states that if a person \(x\) is born in a state \(y\), and a state \(y\) is in a part of a country \(z\),
then that person \(x\) is born in the country \(z\).
These formula do not necessitate that the formula apply.
The weights of 0.96 and 1.40 specify the strength of the formula; stronger rules have a lower chance of being violated.
Deterministic rules, or rules that can never be violated are given an infinite weights of \(\infty\).

\subsubsection{Grounding and Inference}

MLNs are a template generating ground factor graphs.
A factor graph is a set of factors \(\Phi = \{ \phi_1, \ldots, \phi_{|\Phi|} \} \),
where each factor \(\phi_i\) is a function \(\phi_i (\mathbf{X}_i)\) over a
vector of random variables \(\mathbf{X}_i\).
%\ceg{Maybe add figure of ground factor graph}
The random variables correspond to facts (\(F_i\)) and factors a correspond to rules.

We use the term grounding to refer to the processes of creating the factor graph from an
MLN and a set of clauses.
Each node in the factor graph is a ground atom and has a boolean variable that represents its truth value.
We an perform the grounding step inside the database using a simple series of database queries~\cite{chen2014knowledge}.

For each possible grounding of formula \(F_i\) we create a ground factor
\(\phi_i(\mathbf{X}_i)\) with a value of 1 if the grounding is true, otherwise
\(e^{W_i}\). The marginal probability distribution of a set of grounded atoms \(\mathbf{X}\) is defined as
\begin{equation}
\label{eq:probqa-marginal}
P(\mathbf{X} = x) = \frac{1}{Z} \prod_i \phi_i (\mathbf{X}_i) = \frac{1}{Z} \text{exp} \left( \sum_i W_i n_i(x) \right),
\end{equation}
where \(n_i(x)\) is the number of true groundings of rule \(F_i\) in x, \(W_i\) is its weight, and \(Z\) is the partition function.
This probability gives use the probability of one particular state of a knowledge base.

%\subsubsection{Rule Generation}

%\subsubsection{Inference}

\subsection{Probabilistic Knowledge Bases}

We use a definition of probabilistic knowledge bases derived in previous work~\cite{chen2014knowledge}.
A probabilistic knowledge base is a 5-tuples \(\Gamma = (\mathcal{E}, \mathcal{C}, \mathcal{R}, \Pi, \mathcal{L})\), where
\begin{enumerate}[itemsep=2pt,topsep=3pt,parsep=0pt,partopsep=0pt,
                  leftmargin=0pt,labelindent=0pt,itemindent=12pt]
\item \(\mathcal{E} = \{ e_1, \ldots, e_{|\mathcal{E}|} \} \) is the set of entities.
Each entitie \( e \in \mathcal{E} \) refers to a real-world object.

\item \(\mathcal{C} = \{ c_1, \ldots, c_{|\mathcal{C}|} \} \) is the set of classes (or types).
Each class \( C \in \mathcal{C} \) maybe be a subset of \(\mathcal{E} : C \subseteq \mathcal{E}\), or an unknown class.

\item \(\mathcal{R} = \{ R_1, \ldots, R_{|\mathcal{R}|} \} \) is the set of relations.
Each \(R \in \mathcal{R} \) defines a binary relation on \(C_i, C_j \in \mathcal{C}: R: \subseteq C_i \times C_j\).
We call \(C_i, C_j\) the domain and range of \(R\) and use \(R(C_i,C_j)\) to denote the relation and its domain and range.

\item \(\Pi = \{(r_1, w_1), \ldots, (r_{|\Pi|}, w_{\Pi|})\} \) is a set of weighted facts.
For each \( (r,w) \in \Pi\), \(r\) is a tuple  \((R,x,y)\),
where \(R(C_i,C_j) \in \mathcal{R}, x \in C_i \in C, y \in C_j \in C\), and \((x,y) \in R\);
\(w \in \mathbb{R}\) is a weight indicating how likely it is that \(r\) is true.

\item \(\mathcal{L} = \{(F_1,W_1),\ldots, (F_{|\mathcal{L}|}, W_{|\mathcal{L}|}) \} \) is a set of weighted rules.
For each \((F, W) \in \mathcal{L} \), \(F\) is a first-order logic clause, and
\(W \in \mathbb{R} \) us a weight indicating how likely the formula \(F\)
holds.

\end{enumerate}

\subsubsection{Question Answering}

To answer questions, a mapping must be developed between a known
natural language utterance and a subset of all possible facts.
We assume that the knowledge base contains the complete set of facts necessary
to find the answer to the question.
Additionally, in order to quantify the confidence of each fact, it is
important to enumerate the facts that support the final answer.

In this work, we leverage a question answering system named SEMPRE which uses supervised
learning of question answer pairs to create a Lambda Dependency-Based
Compositional Semantics language (\(\lambda\)-DCS)~\cite{berant2013semantic}.
The translation to a logical form, such as a \(\lambda\)-DCS, allows the
semantics to be executed and produce a denotation, or an answer to the utterance.
The \(\lambda\)-DCS can be translated to a SPARQL query for execution over
Freebase or a similar knowledge base where it can be evaluated.
To achieve this, SEMPRE needs to be provided training examples specific to each source answer.
%In the following sections, we describe how the questions answering system uses
%facts from the probabilistic knowledge base to derive truthfulness to each
%candidate answer.


\documentclass[a4paper,10pt]{report}

\title{User Manual \\ Kinematics \& Dynamics Library}
\author{Ruben Smits, Herman Bruyninckx}

\usepackage{listings}
\usepackage{amsmath}
\usepackage{url}
\usepackage{todo}
\usepackage{hyperref}

\begin{document}
\lstset{language=c++}

\maketitle

\chapter{Introduction to KDL}
\label{cha:introduction-kdl}

\section{What is KDL?}
\label{sec:what-kdl}
Kinematics \& Dynamics Library is a c++ library that offers

\begin{itemize}
\item classes for geometric primitives and their operations
\item classes for kinematic descriptions of chains (robots)
\item (realtime) kinematic solvers for these kinematic chains
\end{itemize}

\section{Getting support - the Orocos community}
\label{sec:gett-supp-oroc}

\begin{itemize}
\item This document!
\item The website : \url{http://www.orocos.org/kdl}.
\item The mailinglist. \todo{add link to mailinglist}
\end{itemize}

\section{Getting Orocos KDL}
\label{sec:getting-orocos-kdl}

First off all you need to succesfully install the KDL-library. This is
explained in the \textbf{Installation Manual}, it can be found on
\url{http://www.orocos.org/kdl/Installation_Manual}

\chapter{Tutorial}
\label{cha:tutorial}

\paragraph{Important remarks}
\label{sec:important-remarks}
\begin{itemize}
\item All geometric primitives and there operations can be used in
  realtime. None of the operations lead to dynamic memory allocations
  and all of the operations are deterministic in time.
\item All values are in [m] for translational components and [rad] for
  rotational components.
\end{itemize}

\section{Geometric Primitives}
\label{sec:geometric-primitives}

\paragraph{Headers}
\label{sec:headers}

\begin{itemize}
\item \lstinline$frames.hpp$: Definition of all geometric primitives
  and there transformations/operators.
\item \lstinline$frames_io.hpp$: Definition of the input/output
  operators.
\end{itemize}

The following primitives are available:
\begin{itemize}
\item Vector~\ref{sec:vector}
\item Rotation~\ref{sec:rotation}
\item Frame~\ref{sec:frame}
\item Twist~\ref{sec:twist}
\item Wrench~\ref{sec:wrench}
\end{itemize}

\subsection{Vector}
\label{sec:vector}
Represents the 3D position of a point/object. It contains
three values, representing the X,Y,Z position of the point/object with
respect to the reference frame:

$\mathrm{Vector} = \left[\begin{array}{c} x \\ y \\ z \end{array} \right]$

\paragraph{Creating Vectors}
\label{sec:creating-vectors}
There are different ways to create a vector:
\begin{lstlisting}
  Vector v1; //The default constructor, X-Y-Z are initialized to zero
  Vector v2(x,y,z); //X-Y-Z are initialized with the given values
  Vector v3(v2); //The copy constructor
  Vector v4=Vector::Zero(); //All values are set to zero
\end{lstlisting}

\paragraph{Get/Set individual elements}
\label{sec:gets-indiv-elem}
The operators \lstinline$[]$ and \lstinline$()$ use indeces from 0..2,
index checking is enabled/disabled by the DEBUG/NDEBUG definitions:
\begin{lstlisting}
  v1[0]=v2[1];//copy y value of v2 to x value of v1
  v2(1)=v3(3);//copy z value of v3 to y value of v2
  v3.x( v4.y() );//copy y value of v4 to x value of v3
\end{lstlisting}

\paragraph{Multiply/Divide with a scalar}
\label{sec:mult-with-scal}
You can multiply or divide a Vector with a double using the operator
\lstinline$*$ and \lstinline$/$:
\begin{lstlisting}
  v2=2*v1;
  v3=v1/2;
\end{lstlisting}

\paragraph{Add and subtract vectors}
\label{sec:add-subtract-vectors}
You can add or substract a vector with another vector:
\begin{lstlisting}
  v2+=v1;
  v3-=v1;
  v4=v1+v2;
  v5=v2-v3;
\end{lstlisting}

\paragraph{Cross and scalar product}
\label{sec:cross-scalar-product}
You can calculate the cross product of two vectors, which results in
new vector or calculate the scalar(dot) product of two vectors:
\begin{lstlisting}
  v3=v1*v2; //Cross product
  double a=dot(v1,v2)//Scalar product
\end{lstlisting}

\paragraph{Resetting}
\label{sec:resetting}
You can reset the values of a vector to zero:
\begin{lstlisting}
  SetToZero(v1);
\end{lstlisting}

\paragraph{Comparing vectors}
\label{sec:comparing-vectors}
With or without giving an accuracy:
\begin{lstlisting}
  v1==v2;
  v2!=v3;
  Equal(v3,v4,eps);//with accuracy eps
\end{lstlisting}

\subsection{Rotation}
\label{sec:rotation}

Represents the 3D rotation of an object wrt the reference
frame. Internally it is represented by a 3x3 matrix which is a
non-minimal representation:

$\mathrm{Rotation} =
\left[\begin{array}{ccc}
    Xx&Yx&Zx\\
    Xy&Yy&Zy\\
    Xz&Yz&Zz
  \end{array}\right]
$

\paragraph{Creating Rotations}
\label{sec:creating-rotations}

\subparagraph{Safe ways to create a Rotation}
\label{sec:safe-ways-create}

The following result always in consistent Rotations. This means the
rows/columns are always normalized and orthogonal:

\begin{lstlisting}
  Rotation r1; //The default constructor, initializes to an 3x3 identity matrix
  Rotation r1 = Rotation::Identity();//Identity Rotation = zero rotation
  Rotation r2 = Rotation::RPY(roll,pitch,yaw); //Rotation build out off Roll-Pitch-Yaw angles
  Rotation r3 = Rotation::EulerZYZ(alpha,beta,gamma); //Rotation build out off Euler Z-Y-Z angles
  Rotation r4 = Rotation::EulerZYX(alpha,beta,gamma); //Rotation build out off Euler Z-Y-X angles
  Rotation r5 = Rotation::Rot(vector,angle); //Rotation build out off an equivalent axis(vector) and an angle.
\end{lstlisting}

\subparagraph{Other ways}
\label{sec:other-ways}
The following should be used with care, they can result in
inconsistent rotation matrices, since there is no checking if
columns/rows are normalized or orthogonal
\begin{lstlisting}
  Rotation r6( Xx,Yx,Zx,Xy,Yy,Zy,Xz,Yz,Zz);//Give each individual element (Column-Major)
  Rotation r7(vectorX,vectorY,vectorZ);//Give each individual column
\end{lstlisting}

\paragraph{Getting values}
\label{sec:getting-values}
Individual values, the indices go from 0..2:

\subsection{Frame}
\label{sec:frame}

\subsection{Twist}
\label{sec:twist}

\subsection{Wrench}
\label{sec:wrench}

\section{Kinematic Structures}
\label{sec:kinematic-structures}

\subsection{Joint}
\label{sec:joint}

\subsection{Segment}
\label{sec:segment}

\subsection{Chain}
\label{sec:chain}

\section{Kinematic Solvers}
\label{sec:kinematic-solvers}

\subsection{Forward position kinematics}
\label{sec:forw-posit-kinem}

\subsection{Forward velocity kinematics}
\label{sec:forw-veloc-kinem}

\subsection{Jacobian calculation}
\label{sec:jacobian-calculation}

\subsection{Inverse velocity kinematics}
\label{sec:inverse-veloc-kinem}

\subsection{Inverse position kinematics}
\label{sec:inverse-posit-kinem}

\section{Motion Specification Primitives}
\label{sec:moti-spec-prim}

\subsection{Path}
\label{sec:path}

\subsection{Velocity profile}
\label{sec:velocity-profile}

\subsection{Trajectory}
\label{sec:trajectory}

\end{document}

%%% Local Variables:
%%% mode: latex
%%% TeX-master: t
%%% End: