# Creation and manipulation of surface code defects with quantum optimal
control

Omar Raii  Blackett Laboratory, Imperial College London, SW7 2AZ, United
Kingdom  School of Mathematical and Physical Sciences, Macquarie University,
NSW 2109, Australia  Anirban Dey  School of Mathematical and Physical
Sciences, Macquarie University, NSW 2109, Australia  ARC Centre of Excellence
for Engineered Quantum Systems, Macquarie University, NSW 2109, Australia
Florian Mintert  Blackett Laboratory, Imperial College London, SW7 2AZ, United
Kingdom  Helmholtz-Zentrum Dresden-Rossendorf, Bautzner Landstraße 400, 01328
Dresden, Germany  Daniel Burgarth  School of Mathematical and Physical
Sciences, Macquarie University, NSW 2109, Australia  Physics Department,
Friedrich-Alexander Universität of Erlangen-Nuremberg, Staudtstr. 7, 91058
Erlangen, Germany

(2024)

###### Abstract

The surface code is a spin-1/2 lattice system that can exhibit non-trivial
topological order when defects are punctured in the lattice and thus can be
used as a stabiliser code. The protocols developed to create defects in the
system have previously relied on adiabatic dynamics. In this work we use
techniques of quantum optimal control to overcome the requirement for
adiabaticity and achieve defect creation and implemention of other important
operations required for quantum computation at much faster timescales.

## Introduction

Of the many varied proposals for the hardware of systems for quantum
computation, topological quantum systems, that is, systems with non-trivial
topological order, present numerous advantages from a structural point of view
Cesare2015AdiabaticComputing ; Brennen2007WhyAnyons ; Nayak2008 ;
Lahtinen2017AComputation ; Sarma2015 . The inherently non-local nature of
topologically encoded logical qubits as well as the nature of quantum logical
gate implementation through braiding implies an inherent robustness to local
noise Nakamura2020DirectStatistics ; Manna2022AnyonHamiltonian .

The surface code, a generalisation of the toric double quantum code Kitaev1997
that does not require periodic boundary conditions, is a spin-qubit lattice
that provides an appealing example of a physical system that can exhibit non-
trivial topological order. It can be defined by a Hamiltonian comprising
primarily of four-body interactions known as stabilisers. When certain
stabilisers are removed by a process known as ‘puncturing’
Cesare2015AdiabaticComputing ; Brown2017PokingCode , defects are created in
the code wherein quantum information may be encoded.

As with other examples of topological systems which have shown potential in
terms of suitability for quantum computation, the realisation of anyons and
anyon-like defects has relied on using adiabatic dynamics
Lahtinen2011InteractingModel ; Cesare2015AdiabaticComputing  and therefore
requires long timescales. Such requirements amount to a limitation on the
experimental realisation of the system given the necessity of implementing
quantum algorithms quickly with respect to decoherence times. In this work we
seek to overcome this limitation via the use of time-optimal quantum control.

The techniques of quantum optimal control have been shown to successfully
effect desired dynamics while bypassing adiabatic, therefore slow, timescales
He2016EfficientDriving ; Zhou2017AcceleratedSystem ; Xu2019BreakingGeodesics ;
Wang2012AdiabaticControl ; Simsek2021QuantumInvariant ; Raii2022ScalableModel
. Quantum control in general relies on determining specific chosen time-
dependent Hamiltonians in order to implement desired dynamics DAlessandro2008
; Chen2021QuantumIntroduction . We seek to use numerical quantum optimal
control to successfully carry out operations required for encoding and
processing logical qubits in the surface code within timescales that are much
shorter than those which would be required by adiabatic protocols.

One potentially significant obstacle to numerical solving of dynamics in
lattice systems is the large Hilbert space size when operating with many
spins. Our work presents a method where conserved quantities are used to break
down the control problem into many smaller control problems which are each
solvable separably.

The problem then essentially becomes an ensemble control problem, where we
want each system to achieve a different target unitary using a single control
pulse simultaneously. Each individual system in the ensemble is made up of a
drift Hamiltonian and a control Hamiltonian specific to the drift Hamiltonian.
We employ a gradient based optimization algorithm, to find a control pulse
that minimizes the average fidelity error across the ensemble. We aim for the
average error to get below a predefined target error, $\varepsilon$. For each
system in the ensemble, we calculate the individual fidelity against its
corresponding target unitary using a phase-sensitive fidelity function.

Section I of this work presents a brief overview of the surface code, followed
by a description in Section II of how adiabatically changing Hamiltonians
allows for defects in the surface code to be created and manipulated, as
described in more detail in the literature Cesare2015AdiabaticComputing . In
Section III we describe in detail the quantum control methods used and present
our optimisation results for the four major operations required for encoding
and manipulating quantum information in the surface code. For three of the
four operations this is comprised of numerical optimisation while for the
fourth operation, known as surface code detachment, the aforementioned
technique of using conserved quantities is applied and this is described in
detail in Section IV.

For those familiar with the surface code and adiabatic procedures on it,
Sections I and II are for review purposes and are not essential.

##  I surface code

As with the toric code Kitaev1997 , the surface code lattice comprises of a
large number of spin-1/2 degrees of freedom on the edges of a square lattice
as shown in Fig. 1. Stabiliser operators are defined by four-body Pauli $X$
interactions on vertices and Pauli $Z$ operators on plaquettes. The vertex and
plaquette operators, $A_{v}$ and $B_{p}$ are respectively defined on a vertex
$v$ and plaquette $p$ as

$\displaystyle A_{v}:$ $\displaystyle=X_{v_{1},v_{2},v_{3},v_{4}}$ (1)
$\displaystyle B_{p}:$ $\displaystyle=Z_{p_{1},p_{2},p_{3},p_{4}}$ (2)

where $X_{v_{1},v_{2},v_{3},v_{4}}:=X_{v_{1}}X_{v_{2}}X_{v_{3}}X_{v_{4}}$ and
$Z_{p_{1},p_{2},p_{3},p_{4}}:=Z_{p_{1}}Z_{p_{2}}Z_{p_{3}}Z_{p_{4}}$.

Lattices may include ‘rough sides’ where plaquette operators on the edge are
defined only with three-body terms, as well as ‘smooth sides’ where vertex
operators on such edges are defined with three-body terms. If both smooth and
rough sides are present then for two of the four corners of the lattice (in
the example shown in Fig. 1 these would be the top right corner and the bottom
left corner) there is defined for each a corresponding two-body stabiliser,
either a vertex or plaquette operator.

With the stabilisers defined, one can see that as a plaquette stabiliser
$B_{p}$ and a vertex stabiliser $A_{v}$ can overlap only on an even number of
qubits, all stabilisers must therefore commute with one another. Additionally
each stabiliser squares to the identity. Defining the system Hamiltonian

$\displaystyle H_{0}$
$\displaystyle=-\frac{\Delta}{2}\left(\sum_{v}A_{v}+\sum_{p}B_{p}\right)$ (3)

with $\Delta$ being the spectral gap, the ground state up to normalisation is
then same as the toric code

$\displaystyle\ket{g_{0}}$
$\displaystyle=\prod_{v}(\textbf{1}+A_{v})\ket{0}^{\otimes N}.$ (4)

Unlike the toric code however, the ground state space is non-degenerate which
would initially seems to make it unfeasible for use as a system for
topological quantum computation. However the required degeneracies are
introduced through ‘puncturing’ of the lattice, an operation amounting to the
removal of certain stabilisers from the Hamiltonian. Each puncture doubles the
size of the ground state degeneracy.

##  II Hamiltonians, stabiliser formalism and adiabaticity

Quantum information is encoded in the lattice via the stabiliser formalism
whereby a logical qubit is defined by a set of stabiliser operators such that
the qubit corresponds to a physical state which is simultaneously in a $+1$
eigenstate of the entire stabiliser set. If we were to start with a full
surface code lattice and implement a defect, that is we remove either a
plaquette ($Z$ defect) or a vertex ($X$ defect) stabiliser, we would create a
code whereby the logical gate $\bar{Z}$ corresponds to a string of Pauli $Z$
operations on the lattice around the defect. The logical gate $\bar{X}$ would
then correspond to a string of Pauli $X$ operations from the smooth defect to
a smooth edge. The aim therefore is, when beginning in the ground state of an
initial Hamiltonian $H_{i}$, to end up in the corresponding state of a final
Hamiltonian $H_{f}$ which amounts logically to an encoding of a specific
logical quantum state. Each Hamiltonian comprises of the stabiliser set of a
different configuration of logical quantum information. The deformation of
these codes is studied in the literature as physically being implemented
through ‘adiabatic dragging’ Cesare2015AdiabaticComputing ;
Bacon2009AdiabaticTeleportation ; Bacon2010AdiabaticComputing  between the
initial and final Hamiltonians of each particular procedure. (see
Cesare2015AdiabaticComputing  for an in-depth description).

There are four major operations that can be implemented in order to create
defects in the surface code, encode logical qubits within them, and manipulate
their location or grow them in size to give the encoded qubits further
protection.

###  II.1 Defect creation

Described here is the creation of a pair of smooth ($Z$-type) defects and
logical $\ket{\bar{0}}$ states in the surface code. The creation of rough
defects is an analogous procedure, with the roles of $X$ and $Z$ interactions
reversed. Labelling of spins throughout the work will follow a convention of
numbering sites from rows going top to bottom and from left to right within
each row, such as that which is shown in Fig. 1.

Figure 1: Depiction of the spin-qubits acted on during defect creation. Only 9
spin-qubits are affected. The two plaquettes $B_{p_{1}}=Z_{2,4,5,7}$ and
$B_{p_{2}}=Z_{3,5,6,8}$ are removed from the Hamiltonian and turn from
stabilisers into logical gates ($\bar{Z}$) on the encoded qubits. The upper
vertex $v_{1}$ consists of qubits 1,2,3 and 5 while the lower vertex $v_{2}$
corresponds to qubits 5,7,8 and 9.

The procedure consists of starting with the Hamiltonian described in Equation
(3) as an initial Hamiltonian and transforming it into a final Hamiltonian
where particular stabilisers are removed. Given that all of the vertex and
plaquette stabilisers which are not involved in the defect creation commute
with all the terms in the initial and final Hamiltonian, the Hilbert space of
the dynamics of interest reduces to $2^{9}$ and thus it suffices to consider
the initial and final Hamiltonians

$\displaystyle\tilde{H}_{i}$
$\displaystyle=-\frac{\Delta}{2}(X_{1,2,3,5}+X_{5,7,8,9}+Z_{2,4,5,7}+Z_{3,5,6,8})$
(5) $\displaystyle\tilde{H}_{f}$
$\displaystyle=-\frac{\Delta}{2}(X_{1,2,3}+X_{7,8,9})-\frac{\Delta}{2}X_{5}$
(6)

where the spectral gap $\Delta$ remains unaltered despite the system size
reduction.

Qualitatively, this amounts to turning off the plaquette stabilisers
$Z_{2,4,5,7}$ and $Z_{3,5,6,8}$ from the Hamiltonian, which would then define
these operators as logical gates $\bar{Z}$ of the two logical qubits encoded
in the ground state of the final Hamiltonian. When the two plaquette
stabilisers are removed in addition the overlapping vertex stabilisers
$X_{1,2,3,5}$ and $X_{5,7,8,9}$ are modified from four-body operators to
three-body ones. For a smooth defect, a logical $X$ gate is then simply a
string of Pauli $X$ operators defined on a string traversing the geometrically
dual lattice starting from the defect and ending at a smooth edge. These two
$\bar{X}$ gate strings can be made to overlap on just a single spin such as
spin 5 as labelled in Fig. 1 and this accounts for the single $X_{5}$ term in
the final Hamiltonian

In summary, in defect creation the system begins in the unique ground state of
$H_{0}$ and ends up in the logical state $\ket{\bar{0}}$ for each of the two
defects that have been created, each of which have corresponding $\bar{Z}$ and
$\bar{X}$ gates.

###  II.2 Deformation of defects

While logical qubits can be encoded onto defects, these defects need to be
moved around on the lattice in order to implement logical gates. A typical
example is the CNOT gate which is implemented by the braiding of one defect
around another. It is also desirable for the defect to be grown so that the
defect spans multiple plaquettes (or vertices) which gives greater protection
against unwanted logical gate errors. The deformation of defects can involve
four possible scenarios depending on the number of interior spins, from 1 to
4, within a defect that need to be acted on.

Each scenario differs slightly from the others and we describe the first
scenario here as a concrete example. This operation only involves interaction
with 7 qubits with the aim of growing a smooth defect such that it transforms
from being localised on a two-by-two square of plaquettes to a defect covering
five plaquettes. After labelling with the qubits following the same convention
as previously mentioned, the initial and final Hamiltonians are given
respectively as

$\displaystyle H_{i}$
$\displaystyle=-\frac{\Delta}{2}(Z_{3,5,6,7}+X_{2,3,5}+X_{1,3,4,6})$ (7)

and

$\displaystyle H_{f}$
$\displaystyle=-\frac{\Delta}{2}(X_{3}+X_{2,5}+X_{1,4,6}).$ (8)

The other three scenarios are conceptually similar except that they only
involve interactions with 8, 8 and 4 spins respectively.

Figure 2: The areas are to be separated through the removal of stabiliser
connecting them. The four, surrounding, four-body vertex operators then become
three-body terms.

Multi-step operations such as state injection (described below) require
detachment and attachment of surface code areas containing defects. Looking at
the example of detachment, the removal of an area is shown in Fig. 2; this
amounts to the removal of a plaquette stabiliser operator on the plaquette
connecting the two regions.

Explicitly this corresponds to starting with an initial Hamiltonian

$\displaystyle\begin{split}H_{i}=-\frac{\Delta}{2}(&X_{1,3,4,6}+X_{2,4,5,7}+X_{6,8,9,11}\\\
+&X_{7,9,10,12}+X_{4,9}+Z_{4,6,7,9})\end{split}$ (9)

and ending with a final Hamiltonian

$\displaystyle\begin{split}H_{f}=-\frac{\Delta}{2}(&X_{1,3,6}+X_{2,5,7}+X_{6,8,11}\\\
+&X_{7,10,12}+X_{4}+X_{9})\end{split}$ (10)

Here the initial Hamiltonian $H_{i}$ is the negative of the sum of the four
body terms, one of which is the plaquette stabiliser that is to be turned off,
as well as a two-body check term $X_{4}X_{9}$. The final Hamiltonian $H_{f}$
is then comprised of each four-body stabiliser turned into a three-body
stabiliser, the plaquette stabiliser removed, and the two-body check term
replaced by two single body terms.

This operation requires all overlapping vertex stabiliser operators, of which
there are four, to be modified from four-body terms into three-body terms,
such that if we wish to remove the plaquette operator and modify the vertex
operators in one go, this would affect 12 spin and so the Hilbert space size
where the dynamics are implemented is large compared with the other
operations.

###  II.3 State injection

This scenario involves turning the logical states that have been encoded upon
the defects, whether $\ket{\bar{0}}$ or $\ket{\bar{+}}$, into various fiducial
states such as the canonical example of $\bar{T}\ket{\bar{+}}$ where $T$ is
the phase gate such that $T^{4}=Z$.

This comprises several steps, including: i) Creating a pair of rough defects
in an eigenstate of $X$; this procedure is analagous to that of creating
smooth defects described previously. ii) Ensuring that the defect is in a
region which is smoothly detached from the rest of the surface code. This
involves the detachment procedure described in the detachment/attachment
section. iii) Adiabatically or otherwise ‘injecting’ the desired logical state
onto the spin qubit located between the pair of defects. This simply means
evolving the state of the spin qubit from $\ket{\psi}$ to $TX\ket{\psi}$. iv)
Deforming the pair of defects from rough to smooth by turning off the two
adjoining (three-body) plaquette stabilisers and turning on the vertex
stabilisers.

Out of these, the first procedure which is distinct from the other three
operations is the actual state injection which is carried out on a single
qubit in the interior of a pair of rough defects. The second such procedure
consists of turning on the adjoining vertex operators and turning off the
overlapping three-body plaquette operators. Hence we can define initial and
final Hamiltonians

$\displaystyle H_{i}$
$\displaystyle=-\frac{\Delta}{2}\left(Z_{1,2,3}+Z_{7,8,9}\right)$ (11)
$\displaystyle H_{f}$
$\displaystyle=-\frac{\Delta}{2}\left(X_{2,4,5,7}+X_{3,5,6,8}\right)$ (12)

respectively. Solving the dynamics of this second procedure is more
numerically challenging than for the first procedure as the latter takes place
within a $2^{9}$-dimensional Hilbert space.

##  III Quantum optimal control

###  III.1 Defining the control problem

Considering the implementation of these operations as quantum control problems
involves reformulating the initial and final Hamiltonians into a more general
time-dependent Hamiltonian with a control $f(t)$. Typically such a time-
dependent Hamiltonian includes a time-independent part known as the drift
Hamiltonian and a control function $f(t)$ which is coupled to a control
Hamiltonian. Analogously, two Hamiltonians are chosen

$\displaystyle H_{1}$ $\displaystyle=\tilde{H}_{i}$ (13) $\displaystyle H_{2}$
$\displaystyle=\tilde{H}_{f}-\tilde{H}_{i}$ (14)

so that we have the control problem defined as

$\displaystyle H(t)=H_{1}+f(t)H_{2}.$ (15)

In the adiabatic regime $f(t)$ may simply be a linear ramp with a very small
slope such that $f(0)=0$ and $f(T)=1$ for $T$ being long timescale, thereby
ensuring adiabatic dynamics. We call such a pulse a linear ramp $f_{a}(t)$

We define an initial state $\ket{g_{1}}$ being a ground state of $H_{1}$ and
this in turn defines a target state $\ket{g_{\text{targ}}}$ by

$\displaystyle\ket{g_{\text{targ}}}=U(f_{a}(T))\ket{g_{1}}$ (16)

where adiabaticity ensures that $\ket{g_{\text{targ}}}$ is a ground state of
the final Hamiltonian $H_{1}+H_{2}$. This allows for the definition of a
target fidelity, as a function of the control pulse

$\displaystyle\mathcal{F}(U(f,t))=\left|\bra{g_{\text{targ}}}U(f(t))\ket{g_{1}}\right|^{2}.$
(17)

The closely associated target infidelity $\mathcal{I}=1-\mathcal{F}$ is the
figure of merit which is often sought to be minimised.

For some other operations, where the goal is to implement desired dynamics in
full rather than specific state transfer, a similar unitary gate fidelity
defined by

$\displaystyle\mathcal{F}(U)=\frac{1}{d}\left|\Tr(U_{\text{targ}}^{\dagger}U)\right|$
(18)

may instead be considered.

In order to optimise for infidelities, we use a gradient ascent pulse
engineering algorithm (GRAPE) Khaneja2005OptimalAlgorithms ;
Rowland2012ImplementingPracticalities . This procedure uses piecewise constant
control pulses where, after an initial random control is picked, the
parameters such as pulse magnitude are varied in order for infidelity to go
down in the control space until acceptable minima are found. The direction of
descent in control space is determined by second derivatives of the infidelity
which are calculated using the limited memory version of the
Broyden–Fletcher–Goldfarb–Shanno method (BFGS) Broyden1970TheConsiderations ;
Fletcher1970AAlgorithms ; Goldfarb1970AMeans ;
Shanno1970ConditioningMinimization ; Liu1989OnOptimization . This method uses
an estimate of the Hessian matrix of second derivatives of the figure of merit
and allows for a parabola to be used for approximating the control space and
descending towards local minima.

GRAPE is used to find appropriate piecewise constant control pulses and choose
the best fidelity for a given time period. Numerous parameters may be varied
such as initial pulse guess and number of pulse time steps.

###  III.2 Non-adiabatic optimisation

The result of our optimisations on three of the four major surface code
operations, presented in Fig. 4 and Table 1, indicate that quantum optimal
control can indeed allow for an improvement of multiple orders of magnitude in
timescale required for achieving the appropriate target states of the
operations.

In Fig. 3 are presented the state infidelities between the ideal target state,
which corresponds to defect pair creation on the surface code, and the state
achieved by using a linear control that goes from $0$ to $1$ in time $T$. Here
as with elsewhere in this work timescales are understood to be in units of
$\Delta^{-1}$ where $\Delta$ is the spectral gap in the initial Hamiltonian
$H_{1}$. The logarithmic plot displays the improving fidelity that is achieved
with linear controls of longer timescales. In particular, when $T<1$ there is
a comparatively high infidelity that stays effectively constant whereas for
timescales longer than this, the infidelity improves steadily. Considering an
infidelity of $10^{-7}$ as a standard for sufficiently good infidelity we see
that this is achieved for timescales of $T\gtrsim 1000$. This is indeed
consistent with the spectral gap of $1$ in the units of $\Delta^{-1}$ as an
effectively perfect fidelity is expected when adiabaticity is achieved which
can only occur according to the adiabatic theorem when the timescale is much
longer than the inverse of the spectral gap Avron1987AdiabaticEffect .

In Fig. 4 are presented the results of using optimisation of state infidelity
to find non-linear controls that can achieve high fidelities. Good fidelities
were achieved with only two time steps in the optimised pulses and this is
compared with the Each data point corresponds to the minimum of 1000
optimisation attempts with random initial pulse guess. The results show that
successfully creating the defect pair state, that is, to achieve a good
infidelity of $10^{-7}$ as mentioned previously, can be achieved at a
timescale of $T\approx 1.15$. The earliest timescale at which effectively
perfect fidelity is achieved hereafter is referred to as drop time.
Furthermore we see the comparison between use of non-optimised linear control
ramps and the optimised pulses when comparing fidelities (plotted in blue and
orange respectively) as there is a marked improvement, particularly after the
drop time where infidelities are shown to improve by over 10 orders of
magnitude.

Figure 3: Defect creation with linear control pulses. Fidelity when using
linear ramps only becomes good at long timescales, where adiabaticity is
achieved. Time units are $\Delta^{-1}$.

Figure 4: Defect creation with optimised non-linear control pulses. The
timescale for defect creation with high fidelity is around $T=1.15$. Time
units are $\Delta^{-1}$. The optimised fidelities are shown in orange as
compared with the infidelity for a linear ramp at the corresponding time,
shown in blue. This is an orders of magnitude improvement compared with using
linear adiabatic pulses.

The results of carrying out the same optimisation procedure for defect
creation and for two other operations, namely defect deformation and state
injection, are qualitatively similar and are presented in Table. 1. The
results show that there is a variance of the drop time but all operations
achieve effectively perfect fidelity at times much smaller than the adiabatic
timescale. An appropriate measure of this is comparison between optimised
infidelity at drop time with the infidelity using a linear control pulse with
same duration. Quantum control optimisation methods can be seen therefore to
give an infidelity improvement generally on the order of 10 orders of
magnitude.

Operation | spins | $T_{d}$ | $N_{\tau}$ |  $\mathcal{I}$ linear |  $\mathcal{I}$ optimised
---|---|---|---|---|---
Creation | 9 | 1.15 | 2 | 0.3251 | 5.13e-13
Deformation 1 | 7 | 2.0 | 4 | 0.323 | 5.50e-12
Deformation 2 | 8 | 3.2 | 4 | 0.379 | 8.11e-13
Deformation 3 | 8 | 10.0 | 12 | 0.166 | 2.41e-11
Deformation 4 | 4 | 5.0 | 10 | 0.927 | 3.32e-12
State injection pt.1 | 1 | 2.4 | 4 | 0.177 | 4.37e-14
State injection pt.2 | 9 | 1.3 | 15 | 0.358 | 2.23e-12
Table 1: Results of quantum control optimisation on three surface code
operations, namely defect creation, defect deformation and state injection.
Shown in the table are: number of spins acted on in the operation, drop time,
minimum required number of time steps in optimised pulses, infidelity with
linear pulse at time $T_{d}$, optimised infidelity.

##  IV Surface code detachment as a control problem

The operation of detachment and attachment of surface code regions is
sufficiently distinct from the other three operation that it requires an
alternative approach if we wish to use quantum control to implement it without
resorting to adiabaticity. Two spins within the lattice require removal to
implement code detachment. It is therefore necessary for all overlapping
vertex stabiliser operators (of which there are four; see Fig. 2) to be
modified from four-body terms into three-body terms, and so in order to remove
the plaquette operator and modify the vertex operators, 12 spins must be
affected. The effective Hilbert space size of this operation therefore is much
larger than for any of the other operations. Moreover, as the primary goal
here is to find controls that mimic the behaviour of adiabatic dynamics no
matter the initial state, unitary gate fidelity must be optimised rather than
the simpler case of state fidelity.

Attempting to solve the dynamics in such a Hilbert space is more challenging
than in previous examples and, as optimisation must be carried out many times,
this therefore requires large computational resources. In order to overcome
this obstacle, we exploit the fact that the Hamiltonian
$H(t)=H_{i}+f(t)H_{f}$, where $H_{i}$ and $H_{f}$ are defined as in 9 and 10,
commutes with the operator $X_{1,2,3,5,8,10,11,12}$ for all time $t$. This
means that $H(t)$ can be block-diagonalised into $2^{8}$ blocks each of which
are of size $2^{4}$-by-$2^{4}$. The number of blocks correspond to the number
of possible tuples of eigenvalues of the eight operators $X_{j},$ which
commute with $H(t)$ for all time, where $j\in\\{1,2,3,5,8,10,11,12\\}$.

Many of these blocks are in fact identical with each other due to the fact
that the eigenvalues $x_{j}$ of the operators $X_{j}$ always come in the
following multiplied pairs: $x_{1}x_{3},x_{2}x_{5},x_{8}x_{11}$ and
$x_{10}x_{12}$. Therefore only $2^{4}$ sub-systems will be distinct control
problems.

In practice however, arising from the fact that for some systems, the
spectrums of the drift, control and corresponding target unitary, are the
same, only 8 systems are distinct up to unitary equivalence. As a consequence,
optimisation will only require consideration of 8 sub-systems, drastically
reducing the difficulty of numerical optimisation.

This method allows us to achieve a similar result as with the other major
operations on the surface code, where high fidelities are realised without
resorting to long timescales or scaling of the Hamiltonian with large
amplitude control pulses.

###  IV.1 Reduced control problems and averaging phase-sensitive fidelity

The full time-dependent Hamiltonian of the control problem can be reformulated
in terms of a time-independent drift Hamiltonian $H_{d}$ and a time-dependent
control $H_{c}$ such that $H(t)=H_{d}+f(t)H_{c}$. As $H(t)$ can be block
diagonalised such that

$\displaystyle H(t)=\bigoplus_{j=1}^{2^{8}}\tilde{H}_{j},$ (19)

then the full dynamics of the system can be given as the direct sum of the
dynamics induced by each separate smaller Hamiltonian, such that

$\displaystyle U=\bigoplus_{j=1}^{2^{8}}\tilde{U}_{j},$ (20)

where $U$ is the dynamics that solves the Schrödinger equation with
Hamiltonian $H(t)$ and $\tilde{U}_{j}$ correspond to the dynamics of the
reduced systems with Hamiltonians $\tilde{H}_{j}$.

In order to find the fidelity between a target dynamics and dynamics induced
by Hamiltonian with a given time-dependent control function, we may consider
the magnitude of the average of a phase-sensitive fidelity between the unitary
dynamics of corresponding blocks. If we define a phase-sensitive fidelity as

$\displaystyle\tilde{\mathcal{F}}(U,V)$
$\displaystyle=\frac{1}{d}\Tr(U^{\dagger}V),$ (21)

then the full fidelity can be given by

$\displaystyle\mathcal{F}(U,V)$
$\displaystyle=\frac{1}{k}\left|\sum_{j=1}^{k}\tilde{\mathcal{F}}(\tilde{U}_{j},\tilde{V}_{j})\right|.$
(22)

As the dynamics are ultimately a function of a time-dependent control
function, such that $U=U[f(t)]$, the aim is to use the GRAPE algorithm to find
a control function that maximises the fidelity (or minimises the
correspondingly defined infidelity) compared with a target unitary defined by
adiabatic dynamics. This method effectively means attempting to optimise many
small control problems with the same time-dependent control $f(t)$ at the same
time.

###  IV.2 Numerical results

Fig. 5 displays the total infidelity $\log(\varepsilon)$ for increasing
evolution time $T$. The target infidelity of $10^{-7}$ was achieved at a time
$T_{d}=3.075$, indicating an improvement of two orders of magnitude in the
timescale compared to the adiabatic dynamics, which requires $T=1000$ to
obtain an infidelity of $10^{-7}$ for the successful implementation of the
surface code detachment operation.

Figure 5: Infidelities for the surface code detachment operation after
optimisation for different timescales $T$. The teal line indicates the target
infidelity of $10^{-7}$ and the black dashed line indicates the minimum time
in which this target infidelity is achieved is $T_{d}=3.075$ which is much
lower than the adiabatic timescale.

For the case of the pulse leading to the target infidelity of $10^{-7}$ at the
minimum time $T=3.075$, we compare the 8 individual infidelities of unitarily
inequivalent sub-blocks within the full dynamics
$\tilde{\mathcal{F}}(\tilde{U}_{j},\tilde{V}_{j})$, as shown in Fig. 6. The
comparison indicates that infidelities never differ by more than one order of
magnitude and that the average of the magnitudes of the individual
infidelities is on the order of $10^{-7}$ after optimisation.

##  V Conclusion

Figure 6: Figure showing the 8 individual infidelities for the case of the
optimised pulse for $T=3.075$. The teal dashed line indicates the average
individual error in the target unitary matrix and the blue line indicates the
average error we got after optimisation. This optimised average error lies
below target error.

The results presented show that using quantum optimal control methods, it is
possible to achieve the same high fidelities corresponding to successful
encoding and processing of quantum information, as compared with using
adiabatic dragging protocols. The methods presented allow for this to be
achieved without resorting to the long timescales required by adiabaticity.

Additionally it has been shown that it is possible to overcome the difficulty
of implementing quantum control for a system where control is required on many
spins within a lattice system, such as with the example of surface code
detachment. Successfully using commuting operators and conserved quantities,
it has been shown how to break down the control problem into many smaller
control problems and implement quantum optimal control on the small control
problems at once. Optimising for an average phase-sensitive fidelitiy with the
smaller problems, has led to achieving high total infidelity on the order of
$10^{-7}$ at a much faster time scale compared to the ideal adiabatic
dynamics.

## Acknowledgements

OR acknowledges funding from EPSRC Quantum Systems Engineering Hub and support
from MQCQE. The authors would also like to thank Benjamin Brown and Lauritz
van Luijk for their advice and useful discussion regarding the topics in the
work. AD acknowledges funding from Sydney quantum academy (SQA) through
primary PhD scholarship. DB acknowledges funding by the Australian Research
Council (project numbers FT190100106, DP210101367, CE170100009).

## References

  * [1] Chris Cesare, Andrew J. Landahl, Dave Bacon, Steven T. Flammia, and Alice Neels.  Adiabatic topological quantum computing.  Physical Review A - Atomic, Molecular, and Optical Physics, 92(1):012336, 7 2015.
  * [2] Gavin K. Brennen and Jiannis K. Pachos.  Why should anyone care about computing with anyons?  Proceedings of the Royal Society A: Mathematical, Physical and Engineering Sciences, 464(2089):1–24, 10 2007.
  * [3] Chetan Nayak, Steven H. Simon, Ady Stern, Michael Freedman, and Sankar Das Sarma.  Non-Abelian anyons and topological quantum computation.  Reviews of Modern Physics, 80(3):1083–1159, 2008.
  * [4] Ville T. Lahtinen and Jiannis K. Pachos.  A short introduction to topological quantum computation.  SciPost Physics, 3(3):021, 9 2017.
  * [5] S. Das Sarma, Michael Freedman, and Chetan Nayak.  Majorana Zero Modes and Topological Quantum Computation.  Nature Publishing Group, (December 2014), 2015.
  * [6] J. Nakamura, S. Liang, G. C. Gardner, and M. J. Manfra.  Direct observation of anyonic braiding statistics.  Nature Physics 2020 16:9, 16(9):931–936, 9 2020.
  * [7] Sourav Manna, Callum W. Duncan, Carrie A. Weidner, Jacob F. Sherson, and Anne E.B. Nielsen.  Anyon braiding on a fractal lattice with a local Hamiltonian.  Physical Review A, 105(2):L021302, 2 2022.
  * [8] A. Yu. Kitaev.  Fault-tolerant quantum computation by anyons.  Annals of Physics, 303(1):2–30, 1 2003.
  * [9] Benjamin J. Brown, Katharina Laubscher, Markus S. Kesselring, and James R. Wootton.  Poking holes and cutting corners to achieve clifford gates with the surface code.  Physical Review X, 7(2):021029, 5 2017.
  * [10] Ville Lahtinen.  Interacting non-Abelian anyons as Majorana fermions in the honeycomb lattice model.  New Journal of Physics, 13(7):075009, 7 2011.
  * [11] Shuang He, Shi Lei Su, Dong Yang Wang, Wen Mei Sun, Cheng Hua Bai, Ai Dong Zhu, Hong Fu Wang, and Shou Zhang.  Efficient shortcuts to adiabatic passage for three-dimensional entanglement generation via transitionless quantum driving.  Scientific Reports, 6(1):1–11, 8 2016.
  * [12] Brian B. Zhou, Alexandre Baksic, Hugo Ribeiro, Christopher G. Yale, F. Joseph Heremans, Paul C. Jerger, Adrian Auer, Guido Burkard, Aashish A. Clerk, and David D. Awschalom.  Accelerated quantum control using superadiabatic dynamics in a solid-state lambda system.  Nature Physics, 13(4):330–334, 4 2017.
  * [13] Kebiao Xu, Tianyu Xie, Fazhan Shi, Zhen Yu Wang, Xiangkun Xu, Pengfei Wang, Ya Wang, Martin B. Plenio, and Jiangfeng Du.  Breaking the quantum adiabatic speed limit by jumping along geodesics.  Science Advances, 5(6), 2019.
  * [14] W. Wang, S. C. Hou, and X. X. Yi.  Adiabatic evolution under quantum control.  Annals of Physics, 327(5):1293–1303, 5 2012.
  * [15] Selwyn Simsek and Florian Mintert.  Quantum control with a multi-dimensional Gaussian quantum invariant.  Quantum, 5:409, 3 2021.
  * [16] Omar Raii, Florian Mintert, and Daniel Burgarth.  Scalable quantum control and non-Abelian anyon creation in the Kitaev honeycomb model.  Physical Review A, 106(6):062401, 12 2022.
  * [17] Domenico D’Alessandro.  Introduction to Quantum Control and Dynamics.  pages 1–340, 2008.
  * [18] Binbin Chen, Jing Wang, and Yunsen Zhou.  Quantum Control and Its Application: A Brief Introduction.  Journal of Physics: Conference Series, 1802(2):022068, 3 2021.
  * [19] Dave Bacon and Steven T. Flammia.  Adiabatic Gate Teleportation.  Physical Review Letters, 103(12):120504, 9 2009.
  * [20] Dave Bacon and Steven T. Flammia.  Adiabatic cluster-state quantum computing.  Physical Review A, 82(3):030303, 9 2010.
  * [21] Navin Khaneja, Timo Reiss, Cindie Kehlet, Thomas Schulte-Herbrüggen, and Steffen J. Glaser.  Optimal control of coupled spin dynamics: Design of NMR pulse sequences by gradient ascent algorithms.  Journal of Magnetic Resonance, 172(2):296–305, 2 2005.
  * [22] Benjamin Rowland and Jonathan A. Jones.  Implementing quantum logic gates with gradient ascent pulse engineering: principles and practicalities.  Philosophical Transactions of the Royal Society A: Mathematical, Physical and Engineering Sciences, 370(1976):4636–4650, 10 2012.
  * [23] C. G. Broyden.  The Convergence of a Class of Double-rank Minimization Algorithms 1. General Considerations.  IMA Journal of Applied Mathematics, 6(1):76–90, 3 1970.
  * [24] Roger Fletcher.  A new approach to variable metric algorithms.  The Computer Journal, 13(3):317–322, 1 1970.
  * [25] Donald Goldfarb.  A family of variable-metric methods derived by variational means.  Mathematics of Computation, 24(109):23–26, 1970.
  * [26] D. F. Shanno.  Conditioning of quasi-Newton methods for function minimization.  Mathematics of Computation, 24(111):647–656, 1970.
  * [27] Dong C. Liu and Jorge Nocedal.  On the limited memory BFGS method for large scale optimization.  Mathematical Programming 1989 45:1, 45(1):503–528, 8 1989.
  * [28] J. E. Avron, R. Seiler, and L. G. Yaffe.  Adiabatic theorems and applications to the quantum hall effect.  Communications in Mathematical Physics, 110(1):33–49, 3 1987.