SciPostPhysLectNotes 49
SciPostPhysLectNotes 49
SciPostPhysLectNotes 49
Notes 49 (2022)
anc@uchicago.edu
Abstract
This chapter provides an introduction to the surface code, discussing details about how
physical qubits are connected and operated to create logical qubits, how errors are han-
dled, and what performance metrics are needed to generate logical qubits with perfor-
mance that exceeds their underlying physical qubit performance.
1
SciPost Phys. Lect. Notes 49 (2022)
Contents
1 Overview 3
1.1 Experimental progress in implementing a surface code 5
3 Quantum Circuits 10
3.1 Measurement 13
5 Error correction 22
5.1 Three-bit encoding 22
5.2 Bit-flip qubit encoding 23
5.3 The Shor 9-qubit code 26
9 Error detection 34
9.1 Statistical model for the logical error rate 35
9.2 Logical error rate for different error classes 37
12 Moving qubits 46
12.1 One-cell logical qubit move 46
12.2 Byproduct operators 47
12.3 Multi-cell logical qubit move 48
12.4 Errors during move transformations 50
16 Conclusion 63
References 64
2
SciPost Phys. Lect. Notes 49 (2022)
1 Overview
The surface codes, of which there are a number of variants, provide an appealing architecture
for building a quantum computer [4, 6]. This is primarily because the surface codes provide
a simple architecture that promises, under certain assumptions, an exponential reduction in
the error rate for logical qubits as one scales up the number of physical qubits that define
each logical qubit. The surface codes originated in the toric codes, invented by Alexei Kitaev
[1–3], which in turn evolved from Kitaev’s models for supporting topological order, using
qubits distributed on the surface of a toroid, a two-dimensional surface with periodic boundary
conditions along both in-plane directions. Kitaev’s toroidal geometry ultimately turned out to
be unnecessary, and the planar versions, known as the surface codes, were primarily developed
by Bravyi and Kitaev as well as Freedman and Meyer [4, 5].
Error-protection schemes such as the surface codes rely on assemblies of physical qubits
that are called logical qubits. The physical qubits that make up a logical qubit are operated
in a cyclically-repeated quantum circuit that detects errors in the physical qubits as they occur.
If the quantum gates in this circuit are sufficiently accurate, then the logical qubit will have
a lower error rate than its underlying physical qubits. The error-protecting architecture has
a certain threshold for the physical qubit error rate; for error rates above this threshold, the
error-protection scheme fails (spectacularly). In general there is an assumption that local
errors dominate, i.e. errors occurring in the individual physical qubits, uncorrelated with
those occurring in other qubits; and errors in the CNOT entangling gates between pairs of
physical qubits. Long-distance correlated errors, between pairs or larger groups of qubits, are
in general assumed not to occur; numerical tests indicate that to some extent, such correlated
errors are not disastrous, but the full panoply of possible long-range correlated errors has not
been explored, and certainly some types of errors can cause propagation and failure of the
surface code protection.
Note that in general errors are not corrected as they occur and are detected in the surface
code cycle; instead, the overall control software accounts for these errors in measurement
outcomes, propagating errors through the single qubit and two-qubit gates where possible.
Surface codes are unusually tolerant to local physical qubit errors. In one early estimate
[7], the authors found that one type of surface code could handle error rates of almost 3%
per cycle of the surface code circuit, although the authors assumed certain capabilities in the
qubits that turn out to be difficult to implement in the currently available qubit technologies.
Following this promising result, Raussendorf and co-workers discovered further that a logical
CNOT operation, between logical qubits, could be implemented in an error-protected fashion
by braiding transformations on a single surface, significantly simplifying the architecture for
the surface code [8–10]. These authors also arrived at an error threshold of 0.75% per physical
qubit operation, assuming only simple nearest-neighbor one- and two-qubit gates, lower than
the threshold of Preskill et al., but with significantly simpler hardware requirements.
The tolerance of surface codes to errors, withstanding error rates of order 1% [11, 12], is
far higher than that of other error-protecting approaches. The Steane and Bacon-Shor codes
implemented on two-dimensional lattices with nearest-neighbor coupling, for example, have
thresholds of about 2 × 10−5 [13, 14], three orders of magnitude lower than the surface code
(i.e. the qubits need to perform three orders of magnitude better to enable implementation
using e.g. a Steane code). As a result, there has been significant interest in developing further
the surface codes [11, 12, 15, 16]. A number of authors are also working on improving the
classical processing associated with the surface code [17–21], where error identification forms
a significant software challenge. There are also a number of other two-dimensional topological
codes that have appealing error thresholds and scaling, although these all tend to require
physical qubits with additional capabilities [22–25].
3
SciPost Phys. Lect. Notes 49 (2022)
Error protection always seems to involve large numbers of physical qubits [13, 14]; the
surface code is no exception. It takes a minimum of thirteen physical qubits to implement a
single surface code logical qubit (even with zero physical qubit error rate). As the local error
rate increases, the number of physical qubits needed to achieve a certain logical qubit error
rate increases as well. Above an error rate threshold of around 1%, the surface code no longer
provides protection; however, this threshold depends on the particular error source: For ex-
ample, errors in the projective measurement of physical qubits can approach 50% without
ruining the surface code protection, while errors in the physical qubit controlled-NOT must be
kept below 1%. Given current physical qubit performance, it is likely that a reasonably fault-
tolerant logical qubit will require of order 103 to 104 physical qubits; however, each factor
reduction in the error rate for the critical CNOT gate would reduce the number of required
physical qubits by about the same factor (up to a limit). The number of physical qubits needed
to factor a “interesting” number using Shor’s algorithm [26] depends on a tradeoff between the
quantum circuit’s physical size and the amount of time considered acceptable for the compu-
tation: Larger circuits take less time, but are more expensive to build and operate. Estimates
for surface-code circuit sizes are provided in Ref. [27], depending on the size of the number to
be factored. For a 2,000 bit number (about 600 decimal digits), if we are willing to wait about
one day for the result, the computational part of Shor’s algorithm will need about 4,000 logical
qubits; if we assume about 3,500 physical qubits per logical qubit, this corresponds to about 15
million physical qubits. However, Shor’s algorithm has to perform modular exponentiation,
which requires large numbers of what are known as |A〉 states, with |A〉 L = |0〉 L + e iπ/4 |1〉 L
(the L subscript indicates these are logical qubit states). These states must be prepared very
precisely, with a precision given by the overall surface code requirement. For a 2,000 bit num-
ber, this means precision of order 1 part in 1016 or 1017 . This can be achieved using a method
called “magic state distillation” [28–30]. Producing these high-precision states at a sufficiently
high rate and purity consumes the majority of a quantum computer’s resources; here roughly
10 times the number of logical qubits, and thus 10 times the number of physical qubits, are
required to produce these states at a rate sufficient to complete the computation in one day.
Thus of order 2 × 108 physical qubits are needed to factor a 2,000 bit number, accounting for
the need for |A〉 states.
Note that using the most powerful classical supercomputer and the best classical factor-
ing algorithm, factoring such a number would require more time than the age of the universe
and more electrical power than is available on the Earth. You can try: a company called RSA
Laboratories (now called RSA Security LLC) published a 617 decimal digit number that is the
product of two primes, and offered 200,000 USD to whoever could factor it. That number is
called RSA-617 or RSA-2048 (it has 2048 binary digits), and is equal to
251959084756578934940271832400483985714292821262040320277771378360436620
207075955562640185258807844069182906412495150821892985591491761845028084
891200728449926873928072877767359714183472702618963750149718246911650776
133798590957000973304597488084284017974291006424586918171951187461215151
726546322822168699875491824224336372590851418654620435767984233871847744
479207399342365848238242811981638150106748104516603773060562016196762561
338441436038339044149526344321901146575444541784240209246165157233507787
077498171257724679629263863563732899121548314381678998850404453640235273
81951378636564391212010397122822120720357.
Give it a try!
4
SciPost Phys. Lect. Notes 49 (2022)
5
SciPost Phys. Lect. Notes 49 (2022)
of order 99.9 percent and two-qubit gate fidelities of order 99 percent, with measurement
fidelities above 90 percent, roughly speaking above the large-circuit limit for the surface code
error threshold.
There has also been work on larger circuits implementing the surface code. The Google
AI team has published a number of papers in this regard, the most relevant being Refs. [41]
and [42], using a circuit with 54 total superconducting qubits and conducting experiments
using a subset of these. In [41], researchers implement one-dimensional repetition codes
for a line of qubits embedded in a two-dimensional circuit, and demonstrate the exponential
suppression of either bit- or phase-flip errors, reducing logical error rates by more than two
orders of magnitude per measurement cycle when increasing the number of qubits from five to
21, a result that is stable over 50 rounds of error correction. In [42], in a second advance using
a similar circuit, researchers prepared the ground state of the surface code Hamiltonian, and
measured a topological entanglement entropy near the expected value of − ln 2, and further
simulated anyon interferometry to explore the excitation braiding statistics. They also explored
key aspects of the surface code, including logical state injection and the decay of the non-local
order parameter.
These various results, which by no means include all experiments exploring the surface
code implemented using superconducting qubits, not to mention other qubit hardware plat-
forms, point to steadily advancing capabilities in experimental implementations of the surface
code. As qubit energy and phase lifetimes improve, and correspondingly the single and two-
qubit fidelities improve, the fundamental error rates will likely continue to improve beyond
the surface code threshold, and researchers will then have to begin to deal with long-range
errors, either due to circuit design or due to external influences [47–49].
Using this basis, the most important single qubit operators (called “gates” in quantum com-
6
SciPost Phys. Lect. Notes 49 (2022)
puting) are most easily represented by matrices, given here in the Z basis for completeness:
1 0
Identity or Î = , (2)
0 1
0 1
σ̂X or X̂ = , (3)
1 0
0 −i
σ̂Y or Ŷ = , (4)
i 0
1 0
σˆZ or Ẑ = (5)
0 −1
(you can check that the column vectors for |0〉 and |1〉 are indeed the eigenvectors of the Ẑ
operator with the correct eigenvalues). Note that the eigenstates of the X̂ operator are
1 1 1
|+〉 = p (|0〉 + |1〉) ↔ p , (6)
2 2 1
and
1 1 1
|−〉 = p (|0〉 − |1〉) ↔ p , (7)
2 2 −1
with eigenvalues +1 and −1 respectively. Note we also have
1
|0〉 = p (|+〉 + |−〉) (8)
2
and
1
|1〉 = p (|+〉 − |−〉) . (9)
2
Note also that in some quantum computing texts the imaginary i is dropped in the Ŷ operator,
which can cause some confusion.
The Hadamard operator is
1 1 1
Ĥ = p , (10)
2 1 −1
not to be confused with the Hamiltonian. The Ŝ gate (also called the π/4 gate) is given by
e−iπ/4
1 0 0
Ŝ = =e iπ/4
, (11)
0 i 0 e iπ/4
Problem 1: Find the eigenvectors and eigenvalues for the Ĥ, Ŝ and T̂ operators.
We will be dealing with multi-qubit states. A two-qubit product state for qubits a and b,
where qubit a is in the state |u〉 and qubit b is in the state |v〉, can be written |ua 〉⊗|vb 〉 = |ua vb 〉
(here ⊗ means outer product). This is a state vector living in a 2 × 2 = 4 dimensional vector
space. We will use the shorthand |uv〉 to represent this state, where the order of the letters
corresponds to the order of the qubits; hence |vu〉 would represent the state |va 〉 ⊗ |u b 〉. Most
7
SciPost Phys. Lect. Notes 49 (2022)
p
two-qubit states are not product states; for example (|uv〉+|vu〉)/ 2 is an entangled state that
cannot be written as the product of two one-qubit states. The existence of these kinds of states
was the subject of a famous and prolonged discussion between Neils Bohr and Einstein, and
gave rise to the latter’s involvement in the writing of the “EPR paradox” paper [50] as well as
a series of letters between Einstein and Schrödinger (for an interesting discussion, see [51]).
We can now discuss the controlled-not (CNOT) gate, which operates on two qubits. For
a CNOT, the first qubit is called the control qubit, and performs a conditional X̂ gate on the
second qubit, which is called the target. The X̂ gate is performed if the control qubit is in its |1〉
state, otherwise nothing (an Î gate) is done to the target qubit. As an X̂ gate can be seen as a
NOT gate, flipping the state of its target qubit, the controlled application of this gate provides
the name for the CNOT gate.
Using the canonical two-qubit basis {|00〉, |01〉, |10〉, |11〉}, the matrix representation of the
CNOT gate is
1 0 0 0
0 1 0 0
C N OT ↔ . (13)
0 0 0 1
0 0 1 0
You can check that the CNOT gates performs the controlled-X operation |10〉 → |11〉 and
|11〉 → |10〉, leaving the other states unchanged.
Which set of gates one actually needs depends on what is most easily implemented with
the physical qubits. The Solovay-Kitaev theorem [2, 52] implies that a complete set of gates
to build a quantum computer comprises the single-qubit operators Î, X̂ , Ẑ, the Hadamard Ĥ,
the Ŝ and Ŝ † phase gates, and the T̂ and T̂ † gates. A two-qubit entangling gate is also needed,
which is usually chosen to be the CNOT gate (any two-qubit gate from which a CNOT can
be constructed is of course acceptable). Note that as we have the identities T̂ 2 = Ŝ, T̂ 4 = Ẑ,
Ĥ Ẑ Ĥ = X̂ , Ẑ Ŝ = Ŝ † , and T̂ 7 = T̂ † , the minimal set of gates is {T, H, C N OT }.
Note: From hereon in, we will drop the X̂ notation in favor of the simpler X notation,
where the context will hopefully always be clear.
In the surface code, we must be able to swap the states of two qubits, an operation that is
imaginatively called a SWAP operation. A SWAP operation, taking the two qubit state |uv〉 to
|vu〉, can be performed with three CNOT operations. This is shown (and discussed) later; see
Fig. 11.
All of the gates we have discussed so far are unitary. In case your quantum mechanics is
rusty, a unitary operator U is one where U times its adjoint U † is the identity operator I, i.e.
U U† = U†U = I . (14)
To form the adjoint of an operator, you take the complex conjugate transpose of the operator’s
matrix representation. As you can see, except for the S and T gates, the operators we have
introduced so far are all their own adjoints, and their squares are the identity matrix. These
are thus by definition Hermitian.
Products of operators appear frequently. The order of a product matters, as in general
AB 6= BA when dealing with operators (i.e. matrices). If AB = BA, then A and B are said to
commute:
[A, B] = AB − BA = 0 , (15)
where [A, B] is the commutator of A and B.
8
SciPost Phys. Lect. Notes 49 (2022)
Qubit operators in general do not commute. The identity I commutes with all operators.
However, you can easily show by multiplying the matrices for X and Z that
X Z = −Z X , (16)
X a X b Za Z b = X a Za X b Z b = (−Za X a ) (−Z b X b )
= Za X a Z b X b = Za Z b X a X b , (18)
using the fact that operators on different qubits always commute. Hence
[X a X b , Za Z b ] = 0 . (19)
Note that when we write Z X without subscripts, the Z and X operators act on the same
qubit, so Z X is represented by a 2×2 matrix resulting from the matrix product of the two 2×2
matrices representing Z and X . Thus
0 1
ZX ↔ . (20)
−1 0
0 1 0 0
−1 0 0 0
Za X b ↔ . (21)
0 0 0 −1
0 0 1 0
2.1 Measurement
We haven’t talked about measurement. In the surface code, all measurements are projective;
you should recall from your quantum mechanics classes that this means that a measurement
of an operator projects the qubit onto an eigenstate of the measurement operator, and the
measurement value that is returned is the corresponding operator eigenvalue. For the surface
code, you only need to be able to perform single-qubit Z measurements, projecting the qubit
9
SciPost Phys. Lect. Notes 49 (2022)
onto the |0〉 or |1〉 state with a measurement result of +1 and −1, respectively. It is useful
(but not necessary) to also be able to perform p single-qubit X measurements, returning +1 and
leaving the qubit in the p |+〉 = (|0〉 + |1〉) / 2 state, or returning −1 and leaving the qubit in
the |−〉 = (|0〉 − |1〉) / 2 state. In fact, however, an X measurement capability is not needed
because the Hadamard H operator very conveniently maps |+〉 ↔ |0〉 and |−〉 ↔ |1〉 (a second
applications of H gives the identity). Hence, if an X measurement is needed, you simply
apply H to the qubit, do a Z measurement, and perform H on the state resulting from the
measurement. The final state is then an X eigenstate and the measurement value corresponds
to that eigenstate.
If two operators commute, then quantum mechanics guarantees that there is a ba-
sis that comprises eigenvectors for both operators. Consider our two-qubit commuting
operators X a X b and Za Z b . The first pair has an eigenstate | + +〉 and the second an
eigenstate |11〉 (dropping the subscripts a and b and relying on order only), but these
are not eigenstates for the other pair. However, as you p can easily show, the Bell states
{|00〉+|11〉, |01〉+|10〉, |01〉−|10〉, |00〉−|11〉} (divide by 2 to normalize) are all eigenstates of
both operators, with eigenvalues {+1, −1, −1, +1} for Za Z b as can easily be seen, and eigenval-
ues {+1, +1, −1, −1} for X a X b . The eigenvalues for X a X b are most easily seen by re-writing the
eigenstates as {|00〉+|11〉 = |++〉+|−−〉, |01〉+|10〉 p = |++〉−|−−〉, |01〉−|10〉 = |+−〉−|−+〉,
|00〉 − |11〉 = | − +〉 + | + −〉} (all divided by 2). Note that the two eigenvalues (for Za Z b and
X a X b ) identify the precise Bell state.
Problem 5: Show that the Bell states can be written as claimed using the {|+〉, |−〉} basis
vectors.
3 Quantum Circuits
A quantum circuit comprises a sequence of gates that operate on a population of qubits. They
are the method by which a quantum algorithm is implemented, and provide a kind of “machine
language” for a quantum computer. They are usually represented graphically. Figure 1 displays
the operation |u0 〉 = H|u〉. The qubit evolution is represented by a horizontal time-line, where
time moves forward from left (starting with |u〉) to the right through one or more boxes (here,
the Hadamard H) that represent the gates applied to each qubit, ending in the final qubit state
(|u0 〉). A one-qubit gate has one qubit time-line entering and one emerging; a two-qubit gate
has two such lines.
u H u’
Figure 1: Quantum circuit for a single qubit, where a single Hadamard gate transforms |u〉 to
|u0 〉 = H|u〉.
In Fig. 2 we add a second gate after the Hadamard, representing the operation |u0 〉 = X H|u〉.
Note that as H is applied first to the qubit, it appears to the left of (earlier than) the second
operation X .
For multiple qubits you run lines in parallel, one for each qubit. The circuit in Fig. 3 has
two qubits, giving for the upper qubit time-line |u01 〉 = X H|u1 〉 and for the lower |u02 〉 = H X |u2 〉.
Next we look at a two-qubit CNOT, which is a single box interrupting the timelines of
both qubits. The quantum circuit graphical representation of a CNOT is shown in Fig. 4. This
circuit represents the operation |u0 〉 = C N OT (|u1 〉, |u2 〉), where |u0 〉 is the two-qubit (bipartite)
10
SciPost Phys. Lect. Notes 49 (2022)
u H X u‘
u1 H X u’1
u2 X H u’2
output state, and |u1 〉 the state of the control qubit while |u2 〉 the state of the target qubit.
u1
u’
u2
Figure 4: Quantum circuit for a CNOT; the smaller solid circle indicates the control qubit,
and the larger cross-circle the target qubit.
The operator representation for the CNOT gate, as mentioned earlier, can be written
u1 u1
u2 u2
u3 u3
u4 u4
Figure 5: A multi-target, single control circuit (left) can be compacted into the circuit on the
right.
where I j is the identity for the jth qubit and X 3 the X operator for the target qubit.
The Toffoli can be constructed from single qubit gates and a few CNOTs; the minimal cir-
cuit to implement the Toffoli involves six CNOTs and a number of Hadamard and T and T †
gates, shown in Fig. 7. Hence in principle the Toffoli gate itself is not needed, i.e. it is not a
11
SciPost Phys. Lect. Notes 49 (2022)
u1
u2
u3
Figure 6: Quantum circuit for a Toffoli gate; the first two qubits |u1 〉 and |u2 〉 are the combined
controls, and the third qubit |u3 〉 the target.
“fundamental” gate; however, it is very useful, and “expensive” to implement with more fun-
damental gates, so a hardware system that supports the Toffoli can afford some computational
efficiency.
T T†
H T† T T† T H
A general two-qubit unitary gate is drawn as shown in Fig. 8, where the circuit is drawn
assuming the two qubits entering the gate are in a product state, although this is not necessary,
while the output state |u0 〉 would in general be a two-qubit entangled state.
u1
U u’
u2
Next in Fig. 9 we show a controlled-U (cU) gate, where the unitary U operation is per-
formed when the control qubit is in the |1〉 state, but if the control is in |0〉, the identity I is
applied.
u1
u’
u2 U
We’re now ready to do some examples. Consider the circuit shown in Fig. 10. Both qubits
start in some state |x y〉 (where x and y are each either 0 or 1), a Hadamard is applied to
the first qubit, and then a CNOT is performed with the first qubit as control and the second
12
SciPost Phys. Lect. Notes 49 (2022)
as target. What does this circuit do? Obviously from the caption it generates Bell states; how
does this work?
x H
u
y
First consider what the circuit does for two possible choices of x and y, with the arrows
indicating the outcome after each gate (first after applying the Hadamard, then after applying
the CNOT):
p p
|00〉 ⇒ (|00〉 + |10〉)/ 2 ⇒ (|00〉 + |11〉)/ 2 = |β00 〉, (25)
p p
|01〉 ⇒ (|01〉 + |11〉)/ 2 ⇒ (|01〉 + |10〉)/ 2 = |β01 〉 . (26)
Can you figure out what the outcomes are for the other values of x and y? A certain pattern
should emerge.
Another way to analyze this circuit is using operator representations, combining the Hada-
mard on the first qubit with nothing on the second (UHI = H ⊗ I), followed by a CNOT on the
second qubit, UCNOT = |0〉〈0| ⊗ I + |1〉〈1| ⊗ X :
You can check that gives the correct results for different input states. Note to get this result, we
operated with the Hadamard from the right on the bras on the left. What the notation means
is that if you apply this operator to the input state |x y〉, the first part of the operator projects
out the |+〉 component of |x〉, and that component is output as |0 y〉, while the second part
projects out the |−〉 component of |x〉 and outputs |1, X y〉, using this shorthand to indicate
applying an X operator to the | y〉 state.
Finally, we look at the circuit that implements a SWAP gate, a necessary operation for the
surface code, using only two-qubit CNOT gates. This is shown in Fig. 11. This will take a
product state |uv〉 and generate the state |vu〉, and works in general, i.e. will also successfully
swap the qubits in an entangled state.
a
b
Problem 6: Show that the circuit in Fig. 11 indeed performs a SWAP operation as claimed.
3.1 Measurement
Measurement is a process we have discussed earlier. We previously stated that, for the surface
code, a measurement of a particle’s (or qubit’s) quantum state is projective, and depending
13
SciPost Phys. Lect. Notes 49 (2022)
on the measurement result the qubit ends up in one of two corresponding eigenstates. As a
result, the qubit no longer has any useful (unknown) information in it, and from the point
of view of a quantum algorithm, the qubit has effectively been destroyed. While the physical
qubit of course can be re-used, the quantum circuit representation of a qubit measurement is
a qubit time-line entering from the left, which then ends in the circuit element that represents
measurement. This is shown in Fig. 12, where the classical information that emerges from
the measurement is represented by two light-weight lines, in contrast to the single heavy line
used for the qubit.
Figure 12: Measurement circuit. A quantum state |u〉 (single line) enters from left, and
classical information (two lines) emerges from the right. Note this process is irreversible,
unlike almost all the other quantum gates.
If we prefer the Bloch sphere representation, we can write a = |a|e iα = cos(θ /2) e iα and
b = |b|e i(α+φ) = sin(θ /2)e i(α+φ) , so that Angelina’s state, dropping the overall un-measurable
angle α, is
|A〉 = cos(θ /2)|0〉 + sin(θ /2)e iφ |1〉 . (30)
This is a vector of unit magnitude pointing somewhere on the Bloch sphere, as in Fig. 13.
14
SciPost Phys. Lect. Notes 49 (2022)
|A
θ
y
φ
x
This describes Angelina when she is in a pure state |A〉, i.e. when we know exactly what
state |A〉 she is in. However, we may not have enough information about Angelina to know
what her exact state is; instead, we may know that she is in state |A1 〉 with probability p1 , state
|A2 〉 with probability p2 , etc., in other words in a mixed state. In this situation we represent
Angelina’s quantum state via the density operator ρ, given by
X
ρ= p j |A j 〉〈A j | , (31)
j
involving the weighted sum of the kets |A j 〉 in outer product with the bras 〈A j |, with weights
given by the probabilities p j . Don’t confuse the states |A j 〉 with the basis states: The mixed state
can involve more than the two states it takes to span the Hilbert space, and correspondingly the
states do not have to be mutually orthogonal. The density matrix representation, introduced
by von Neumann, is useful in part because the expectation value for measuring some operator
B is simply given by X
〈B〉 = t r(ρB) = (ρB) j j , (32)
j
taking the matrix product of the representations for ρ and B and summing its diagonal ele-
ments (that’s the meaning of the trace t r).
For the pure state |A〉, Angelina’s density operator is simply
Note that the trace of ρ is unity for both the pure and the mixed states, as you can easily show,
but the trace of ρ 2 is unity only for a pure state, and is less than 1 for a mixed state.
Problem 7: Prove that a mixed state with density matrix ρ has t r(ρ 2 ) < 1.
15
SciPost Phys. Lect. Notes 49 (2022)
How does Angelina’s state become mixed, if we start with a pure state? Certainly this
won’t happen if all we do is operate on Angelina with unitary operators U, as unitary operators
always take pure states to pure states.
So how does Angelina’s state become mixed? One way this could happen is if we turn our
backs, and our “friend” comes and, based on some coin flips, either does or does not do some
unitary operations on Angelina. If the probability to perform U j is p j , where U j is a unitary,
then Angelina’s initially pure state density operator ρ = |A〉〈A| will be transformed to
X X
ρ0 = p j U j ρU †j = p j |A j 〉〈A j | , (36)
j j
where |A j 〉 = U j |A〉 and 〈A j | = 〈A|U †j . Hence, for example, say there is a 50% chance our
frenemy did nothing, and a 50% chance he did an X gate. After this probabilistic manipulation,
Angelina’s state is given by the density matrix ρ 0 , where
1 1
ρ0 = |A〉〈A| + X |A〉〈A|X , (37)
2 2
(note X = X † ). The trace of ρ 0 is still unity, but the trace of ρ 02 is 1/2 (do you see why?), so
this is now a mixed state.
We of course do not have to rely on a friend to come to transform Angelina’s state to a
mixed one. Angelina will be interacting with her environment, which will involve many small
interactions with a very complex system, very much like a classical Brownian particle inter-
acting with its surrounding fluid. In the latter case, the Brownian particle is visibly affected
by the thousands of fluid molecules that interact with it; however the accompanying particle’s
reaction on the fluid is not easily detected. The resulting motion, to first order, is the random
walk and thermalization of the Brownian particle. Here, we similarly need to understand how
Angelina interacts with the environment that surrounds her, and how she becomes entangled
with that environment. How can we hope to get a handle on something we know so little
about?
Let’s begin by looking at something simpler. Let’s introduce a second qubit, which we’ll
call Brad. Let’s assume Angelina and Brad interact through a simple exchange Hamiltonian:
Hint = ħ
h g X AX B , (38)
where X A,B are the X operators on Angelina and Brad, respectively, and g is the interaction
strength in frequency units. If we start in the state |01〉, where Angelina is in |0〉 and Brad in
|1〉, then an application of the Hamiltonian generates the result
Hint |01〉 = ħ
h g|10〉 , (39)
swapping Angelina and Brad’s states. Of course, if we start in the reverse situation, we get the
reverse outcome. Note that the eigenstates of this Hamiltonian are the entangled Bell states
|B x y 〉,
1
|B00 〉 = p (|00〉 + |11〉) ,
2
1
|B01 〉 = p (|01〉 + |10〉) ,
2
1
|B10 〉 = p (|00〉 − |11〉) ,
2
1
|B11 〉 = p (|01〉 − |10〉) . (40)
2
16
SciPost Phys. Lect. Notes 49 (2022)
d|M (t)〉
iħ
h = Hint |M (t)〉 = ħ
h g X A X B |M (t)〉 . (41)
dt
The four entangled Bell states are stationary states, with
1
p e i g t |B01 〉 − e−i g t |B11 〉
|M (t)〉 = (43)
2
igt
e
p |B01 〉 − e−2i g t |B11 〉 .
= (44)
2
Problem 8: Show that this is indeed the solution to Schrödinger’s equation, Eq. 41.
p
The state transforms periodically to the state |01〉 = (|B01 〉+B11 〉)/ 2 (with a phase factor),
every t n = (n + 1/2)π/g, and returns to the initial state |10〉 every t n0 = nπ/g: The “swap
time” is Ts = π/g. Other than at these precise times, however, Angelina and Brad are in
an entangled state. For times ∆t very short compared to the swap time, the entanglement
is weak, with a state approximately given by |10〉 + 2i g∆t|01〉 (needing normalization, of
course), with 2g∆t = 2π∆t/Ts 1. From the point of view of Angelina, this is a small X A
error; measuring her state (ignoring that of Brad) after the time ∆t will return the (erroneous)
state |0〉A with probability p = |2π∆t/Ts |2 1, and will otherwise return the original state
|1〉A with probability 1 − p ≈ 1.
Problem 9: Write the matrix that represents the Angelina-Brad interaction Hamiltonian Hint
in the canonical basis {|00〉, |01〉, |10〉, |11〉}. Now write the Hamiltonian in the Bell state basis.
Discuss what you find.
The evolution we have seen holds for a general state, regardless of the initial states of
Angelina and Brad: After a short interaction time ∆t Ts , the probability that Angelina’s
state suffers an X A error is p = |2π∆t/Ts |2 1, while the probability the original state is
instead recovered on measurement is 1 − p.
For this example, we chose the interaction between Angelina and Brad to be an X X in-
teraction, and the interaction was deterministic: We know exactly the Hamiltonian through
which they interact. We could instead have chosen for example a Z Z or Y Y interaction, each
of which would have given a comparable result, generateing small ZA or YA errors, respectively.
Problem 11: Demonstrate that a Z Z interaction will give a ZA error, of similar form to the X X
interaction.
Another assumption we made is that Brad was in a pure state when we started the inter-
action. Can we inject some uncertainty by instead saying that we don’t know Brad’s state, that
17
SciPost Phys. Lect. Notes 49 (2022)
instead Brad is in a mixed state? In that case, we have to use a density matrix ρB to describe
Brad, but it turns out this doesn’t really change things in a substantial way. We can use a
procedure known as purification to handle this situation.
The way purification works is as follows: Say in our original basis {|p〉, |r〉}, Brad’s
density matrix is
|a|2 b
ρB = , (45)
b? |c|2
where |a|2 + |c|2 = 1 and the density matrix is Hermitian (note this is not meant
to be the density matrix for a pure state). The Hermitian property of ρB means
we can find another basis {|s〉, |t〉} in which the density matrix is diagonal:
0 | f |2 0
ρB = , (46)
0 |g|2
with | f |2 +|g|2 = 1. Note the diagonal elements are real and non-negative. Written
in outer product form, this is
We extend the vector space {|s〉, |t〉} to a four-dimensional one, adding two addi-
tional basis vectors |u〉 and |v〉, such that the set {|s〉, |t〉, |u〉, |v〉} is an orthonormal
spanning set. We define the pure state |B 0 〉 for Brad in this extended space as
Note we only pair up |s〉 with |u〉 and |t〉 with |v〉, and we have taken the square
roots of the 2 × 2 density matrix elements. The corresponding pure state density
matrix is
If we trace out the two imaginary degrees of freedom |u〉 and |v〉, we recover the
original mixed state density matrix:
as desired.
How does Brad’s extended state interact with Angelina? If we consider the X A X B
interaction, we’ve done two things that affect the X B part of this: We’ve changed
basis vectors to make Brad’s density matrix diagonal, and we’ve extended Brad’s
Hilbert space from two to four dimensions. Specifically, the new basis vectors are
18
SciPost Phys. Lect. Notes 49 (2022)
showing that the components of |s〉 in the {|p〉, |r〉} basis are the first column of
the matrix representation of U in that same basis. A similar calculation shows that
the components of |t〉 are the second column of that matrix representation.
The representation of X B in the new basis will no longer look like an X Pauli matrix,
but instead will be some weighted sum of the four Pauli matrices I B , X B , YB and ZB
(now in the new basis), because these span the space of Hermitian 2 × 2 matrices.
To deal with the extension of Brad’s vector space to four dimensions, we define in
the extended space the extended X B0 operator
X B,11 X B,12 0 0
X X B,22 0 0
X B0 = X B ⊗ I = B,21 , (55)
0 0 X B,11 X B,12
0 0 X B,21 X B,22
where I is the identity in the extension space, and in the expression on the right,
the non-zero sub-matrices are the representation of X B in the new {|s〉, |t〉} ba-
sis that diagonalizes the density matrix. The interaction X A X B ⇒ X A X B0 , and for
example the expectation value 〈X A X B 〉 would be calculated as
〈X A X B 〉 ⇒ t rA,B0 ρAσB X A X B0 ,
(56)
What about more generally? What if Angelina interacted with two two-level systems at
the same time, say with Brad and Charlie, through a similarly deterministic Hamiltonian in-
teraction? Or, more likely, what if she interacts with a set of harmonic oscillators, at different
frequencies and with different types of interactions? Clearly these questions can go on indefi-
nitely, building more and more complex models for an environment that in fact we know very
little about. What we really want is a generic method to treat Angelina’s interaction with her
environment, without having to invoke specific microscopic models.
Interaction of the worst (entangling) kind (worst in the sense that these will tend to reduce
the off-diagonal elements in Anglina’s density matrix, which is where all of her “quantum-ness”
resides) happen all the time, between qubits and the environment in which they are embedded:
Energy exchange, change of phase, all lead to errors in the qubit evolution. The most general
way this kind of error occurs can be understood in the following simple way: We prepare the
qubit of interest (Angelina) in a pure state |A〉. We assume we can write the environment (the
universe outside the qubit) as a quantum state |e〉, initially not entangled with the qubit. If
you object that the environment should be described by a density matrix, because we don’t
know what state it is in, we can use purification of the environment to generate a pure-state
description of the environment. See the detailed description that follows if you are interested.
19
SciPost Phys. Lect. Notes 49 (2022)
The way purification for the environment works is very similar to that for the
two-state system discussed earlier. We place the environment in a (for sim-
plicity, at most countably infinite) vector space, spanned by the basis vectors
{|u j 〉, j = 1, . . . , N }. The density matrix is a Hermitian matrix, so we can always
find another basis {|v j 〉, j = 1, . . . , N } in which the density matrix is diagonal,
N
X
ρ= |a j |2 |v j 〉〈v j | . (57)
j=1
We double the size of the Hilbert space, we span the increased space by adding N
additional orthonormal basis vectors {|w j 〉, j = 1, . . . , N }, then define the extended
state of the environment as
N
X N
X
|e〉 = |a j ||v j 〉|w j 〉 = |a j ||v j w j 〉 , (58)
j=1 j=1
To recover the original density matrix, we trace out the additional imaginary states
we created to make the state pure,
N
X
ρ = t rw` (σ) = |a j ||ak |〈w` |v j w j 〉〈vk w k |w` 〉 (60)
j,k,`=1
N
X
= |a j ||ak |δ`, j δ`,k |v j 〉〈vk | (61)
j,k,`=1
N
X
= |a j |2 |v j 〉〈v j |, (62)
j=1
as desired.
Let’s take the outer product of the initial environment state |e〉 with the qubit state. Let’s
first assume the qubit starts in the state |0〉: This gives us the product state |e〉⊗|0〉 = |e0〉 (note
we’re writing the environment state first). Next, we allow these to interact for a short time.
The initial environment evolves in this time to |e1 〉, and the interaction causes an admixture
of the orthogonal qubit state |1〉, with the environment in a different state |e2 〉. Hence we can
write
|e0〉 ⇒ a|e1 0〉 + b|e2 1〉 , (63)
The interaction not only changes the qubit, but modifies the environment as well. For a qubit
starting instead in the |1〉 state, we have
We usually assume the environmental changes are small, so the corresponding error-associated
amplitudes are small, i.e. we assume that |b|, |c| 1 and that |a|, |d| are just slightly smaller
than 1.
20
SciPost Phys. Lect. Notes 49 (2022)
We can generalize by using the qubit projection operators P0 and P1 , written in our {|0〉, |1〉},
basis as
1 0 1
P0 = |0〉〈0| ↔ = (I + Z) , (65)
0 0 2
written on the right in terms of the Pauli operators, and
0 0 1
P1 = |1〉〈1| ↔ = (I − Z) . (66)
0 1 2
Using these projection operators we can write the evolution for a general state |u〉 = x|0〉+ y|1〉
as
|eu〉 ⇒ (a |e1 〉I + b |e2 〉X ) P0 |u〉 + c |e3 〉X + d |e4 〉I P1 |u〉 , (67)
where the Pauli operators I and X on the qubit state. The operators P0 , P1 pull out the ap-
propriate components of |u〉, and I and X then either leave these as they are, or flip them,
|0〉 ↔ |1〉. Note that the notation here is somewhat sloppy, the terms should be written more
precisely as e.g. b |e2 〉 ⊗ X P0 |u〉 and so on. The meaning however should be clear.
Equation (67) can be written
I+Z I−Z
|e〉|u〉 ⇒ (a |e1 〉I + b |e2 〉X ) |u〉 + c |e3 〉X + d |e4 〉I |u〉
2 2
a|e1 〉 + d|e4 〉 a|e1 〉 − d|e4 〉 b|e2 〉 + c|e3 〉 b|e2 〉 − c|e3 〉
= I+ Z+ X+ X Z |u〉 . (68)
2 2 2 2
Now we can write
0 −1
XZ = = −iY , (69)
1 0
so we can write this as
a|e1 〉 + d|e4 〉 a|e1 〉 − d|e4 〉 b|e2 〉 + c|e3 〉 c|e4 〉 − b|e2 〉
|e〉|u〉 ⇒ I+ Z+ X +i Y |u〉 . (70)
2 2 2 2
Note that the amplitudes b and c in the terms with the operators X and Y are assumed small.
Furthermore, a and d should be nearly equal, and the environmental states |e1 〉 and |e4 〉 should
be very nearly equal, so the term with operator Z should also be small. We can schematically
rewrite this as
|eu〉 ⇒ a0 |e0 〉I + ε x |e x 〉X + ε y |e y 〉Y + εz |ez 〉Z |u〉 , (71)
where the amplitudes |ε x |, |ε y |, and |εz |, which correspond to X , Y and Z errors in the qubit
are all small, and |a0 | ≈ 1 is very close to unity, which represents no error in the qubit. We
see that without many assumptions, and some hand-waving, a general interaction of a qubit
with its environment can be written as a no-error outcome, with large amplitude, superposed
with small-amplitude environmental interactions that cause X , Z and Y errors. These are
known as bit-flip, phase-flip and combined bit-and-phase-flip errors, respectively. Note that
further, the amplitude of the errors will scale with the interaction time that the qubit and the
environment are interacting, as we saw for the Angelina-Brad interaction: The longer the qubit
and environment interacts, the larger the amplitudes for the X , Y and Z errors, thus the more
likely that such errors will occur. If the error amplitudes become too large, then our simple
model will break down, because the qubit will begin to suffer multiple errors that generate
more complex states.
We now have a handle on what a qubit does when interacting with its environment: We can
model short, weak interactions as leaving the qubit state unchanged, superposed with states
where the qubit suffered single X , Y and Z errors. These errors leave the qubit entangled with
21
SciPost Phys. Lect. Notes 49 (2022)
its environment. In principle, if we know what state the qubit is supposed to be in (here |u〉),
we could build a projective measurement operator that projects onto |u〉, Pu = |u〉〈u|, which
returns the value 1. This can be combined with its counterpart that projects onto the “not |u〉”
space, Pnot u = I − Pu , which returns the value −1. With a probability |a0 |2 ≈ 1 we would
return the value 1 and the qubit would be returned to its desired state, dis-entangled from
the environment; with a probability 1 − |a0 |2 1 we would instead get the value −1, and we
would know we have to correct the state of the qubit. However, this is only useful if we know
|u〉, and also only if the qubit is not entangled with other computational qubits. How do we
deal more generally with these errors, in a way that doesn’t require knowing anything about
the state of the qubit, and avoiding having to dis-entangle the qubit from its computational
partners?
5 Error correction
Error correction is a fascinating topic in quantum computation. Peter Shor’s discovery of a nine-
qubit encoding that allows the detection and correction of errors in the encoded qubit state,
without knowing the state of the qubit, is a landmark in the evolution of quantum computation.
We will introduce this topic by first describing the most simple quantum error-correcting code,
a circuit that can detect and correct bit-flip errors without knowing the encoded state.
22
SciPost Phys. Lect. Notes 49 (2022)
When Bob takes the bits he’s received and votes them against one another, a communica-
tion error only occurs when there are two- or three-bit errors, so the probability of a commu-
nication error goes from p when sending a single bit, to 3(1 − p)p2 + p3 when sending three
bits. This probability is less than p, if p < 1/2; if p is very small, then this error is of order
3p2 p. If for example the error probability p is one percent (0.01), then the probabilities of
the various errors are shown in the table below. The rate of communication errors falls from
one percent to roughly 0.03 percent by using this simple code, a reduction by a factor of 30
at the cost of having to send three times as many bits. Using more bits in the same manner
reduces the rate further, in an exponential fashion.
Problem 12: Find the communication error rate using a majority voting scheme for a 5-bit
encoding, given a one-bit error rate p.
23
SciPost Phys. Lect. Notes 49 (2022)
u u
s u
Figure 14: A box that purports to clone the state |u〉 cannot exist by the no-cloning theorem.
The proof is by negation: Assume there is such a box, so |u〉|s〉 → |u〉|u〉 through a
unitary transformation (see Fig. 14):
Now copy another state |v〉 (the unitary U should work for any state):
Taking the inner product of these two expressions, using the identity U † U = I and
〈s|s〉 = 1 and remembering that (AB)? = B ? A? , we have
Then either |v〉 = |u〉, or |v〉 and |u〉 are orthogonal. Hence a proposed transforma-
tion U that copies a general quantum state is impossible; a general U can at most
copy one state and its orthogonal partner (but not a superposition of the two).
How would Angelina generate a GHZ state from the state |u〉? The circuit to do this shown
in Fig. 15: Angelina starts with the first qubit in the state |u〉 = a|0〉 + b|1〉, with the accom-
panying second and third qubits each in the state |0〉. Alice then does a controlled-NOT using
the first qubit as the control and the second qubit as the target, yielding the two-qubit state
a|00〉 + b|11〉 as the output. She then does a second controlled-NOT with the third qubit,
generating the desired three-qubit GHZ state a|000〉 + b|111〉.
ψ
0
0
Brad receives the state sent by Angelina, but subject to random bit-flip errors on each qubit.
He wants to check if there were any errors in transmission. To do this, Brad uses two additional
qubits, known as ancilla qubits, to “vote” the communication qubits against one another, using
the circuit in Fig. 16. This kind of circuit performs what is known as a “parity check”.
The way this circuit works is that the first and second qubits control sequential CNOTs on
the first ancilla, which effectively makes these two qubits “vote” against one another; if they
are not in the same state, the result is that the first ancilla is flipped. Then the second and
third qubits do the same to the second ancilla, flipping that ancilla if these two qubits differ.
24
SciPost Phys. Lect. Notes 49 (2022)
q1
ψ q2
q3
0 a1
0 a2
Figure 16: Circuit to generate an error syndrome in two ancilla qubits, using three-qubit en-
coding. The three communication qubits (q1−3 , in the state |ψ〉) are effectively “voted” against
one another using the two ancilla qubits (a1,2 , both set to |0〉) at the bottom of the circuit. This
kind of circuit does what is called a “parity check.”
Finally, the two ancillas are compared, thus effectively comparing one and two against two
and three, which is the same as one voting against three. The result is that the two ancillas
report not only an error, but indicate in binary form where the error occurred; note the circuit
only works if at most one qubit suffered an error.
Let’s work through this circuit, following its operation step by step. We assume that a
single X error has occurred to the second qubit during transmission, so the state Brad receives
is a|010〉 + b|101〉 instead of the error-free a|000〉 + b|111〉. The states following each of the
gates in the circuit are then:
At the end of the process, the ancilla qubits encode the binary number 10, which indicates
an error on the second qubit; the measurement of the two ancillas at the end of this process
would identify this error to Brad, and he could then apply a corrective X gate to the second
qubit, recovering the state Angelina had sent.
You can work through the other possible errors and see how the circuit works. Table 1
summarizes the outcomes, where q1 through q3 are the communicated qubits and A1 and A2
are the ancillas; an X in the column for q j means that that qubit suffered an X error. You can
see that, as mentioned above, A1 A2 is a binary-encoded indicator of where the error occurred.
If two or three qubits suffer errors, the circuit does not work, so we didn’t tabulate those errors.
The ancillas A1 and A2 are called an error syndrome, indicating what error occurred.
Table 1: Three-qubit error encoding ancilla results, for single bit-flip errors.
q1 q2 q3 A1 A2
0 0 0 0 0
X 0 0 0 1
0 X 0 1 0
0 0 X 1 1
You can work out how to extend this table for what happens with the ancillas for multiple
qubit errors.
25
SciPost Phys. Lect. Notes 49 (2022)
We can now add to the circuit in Fig. 16 so that we use the error syndromes from the
two ancillas to automatically correct any single-qubit errors, as shown in Fig. 17, which now
includes the error-correcting circuit as well as the error-syndrome circuit.
q1
ψ q2
q3
0 a1
0 a2
Figure 17: Circuit to detect and correct errors in the three-qubit bit-flip error code. Here we
introduce a new set of gates, double-control CNOT gates (these are versions of the Toffoli
gate). When the two controls are filled circles, the CNOT is applied when both controls are in
the |1〉 state, while an empty circle means that control qubit must be in the |0〉 state for the
CNOT to act.
This quite interesting circuit unfortunately only corrects bit-flip (X ) errors. As we have
seen with quantum bits, you can also suffer from Y and Z errors, and as you can check, this
circuit does not protect against these. Hence this is not sufficient to correct all single qubit
errors.
Problem 13: Work out what happens if a Z error occurs on one of the three qubits in the code.
Does the error detection circuit signal an error?
We can build a circuit that detects phase-flip instead of bit-flip errors, by instead encoding
the qubits in a GHZ state in the |±〉 basis:
This could easily be implemented by adding a Hadamard to each of the three qubits after the
double-CNOT circuit has created the three-qubit GHZ encoding. However, as you can verify
for yourself, this circuit no longer protects against bit-flip errors!
1
a|0〉 + b|1〉 ⇒ a p (|000〉 + |111〉) (|000〉 + |111〉) (|000〉 + |111〉) (84)
2 2
1
+ b p (|000〉 − |111〉) (|000〉 − |111〉) (|000〉 − |111〉) . (85)
2 2
This is called, quite imaginatively, Shor’s nine-qubit code. The encoding is done using the
circuit shown in Fig. 18. Shor’s code has since been improved with a handful of smaller, more
efficient codes, and the error-syndrome analysis has been worked out in much greater detail.
The way the Shor code works is that each set of three initial qubits in Fig. 18 are first
encoded in the bit-flip code a|000〉 + b|111〉 that we already looked at. Each qubit in this
26
SciPost Phys. Lect. Notes 49 (2022)
a 0 +b 1 H
0
0
0 H
0
0
0 H
0
0
Figure 18: Circuit to generate Shor 9-qubit error-protected state from that of a single qubit.
code is then the basis for a three-qubit block, where a qubit in |0〉 is encoded as | + ++〉 and a
qubit in |1〉 becomes | − −−〉. This allows detection and correction of both bit- and phase-flips.
In fact, this code can protect against up to one bit-flip error in each block, and any number
of phase-flips in one block. A circuit similar to that shown in Fig. 17 is used to detect X
errors in any of the three-qubit blocks; the circuit shown in Fig. 19 is used to detect phase-flip
errors in the blocks. The first set of six CNOTs compares the signs of the qubits in blocks 1
and 2, and the second set compares those in blocks 2 and 3. A phase-flip error on any qubit
in one of the blocks gives the same outcome, thus the Shor code is known as a degenerate
code: Different errors can lead to the same outcome, while in a non-degenerate code each
error can be uniquely identified. If the Shor code suffers a Y error, both the X -correcting and
Z-correcting codes will work to fix that error, so this is a fully error-protected code.
Figure 19: Circuit to detect phase-flip (Z) errors in the Shor 9-qubit codeword.
A number of more sophisticated and compact encoding schemes have been developed since
the 9-qubit Shor code. These include the seven-qubit Steane code and a class of five-qubit codes
discovered by Ray Laflamme and co-workers. These have been generalized as the CSS codes,
27
SciPost Phys. Lect. Notes 49 (2022)
named after their inventors, A. Robert Calderbank, Peter Shor and Andrew Steane. There are
also a class of stabilizer codes, discovered by Daniel Gottesman and separately by A. Robert
Calderbank, Eric Rains, Peter Shor, and Neil Sloane. We now turn to the surface code, which
is a kind of stabilizer code.
28
SciPost Phys. Lect. Notes 49 (2022)
(a) Z Z Z Z Z Z Z Z Z Z
X Z X Z X Z X Z X Z X
X X X X X X X X X X
X Z X Z X Z X Z X Z X
Z Z Z Z Z Z Z Z Z Z
X Z X Z X Z X Z X Z X
X X X X X X X X X X
X Z X Z X Z X Z X Z X
Z Z Z Z Z Z Z Z Z Z
X Z X Z X Z X Z X Z X
X X X X X X X X X X
X Z X Z X Z X Z X Z X
Z Z Z Z Z Z Z Z Z Z
1 2 3 4 5 6 7 8
(b) a I g -+ I
Z a
b Z Z c b +1: <Z+
Z c 1: <Z-
d d
repeat
(c) a g H H - +
X a
b X X c b +1: <X+
X c <X-
d d
repeat
Figure 20: (a) The surface code. Data qubits are open circles (◦), measurement qubits are
filled circles (•), with measure-Z qubits colored green and measure-X qubits colored orange.
Away from the boundaries, each data qubit contacts four measure qubits, and each measure
qubit contacts four data qubits; the measure qubits perform four-terminal measurements. On
the boundaries, the measure qubits contact only three data qubits and perform three-terminal
measurements, and the data qubits contact either two or three measure qubits. The solid line
surrounding the array indicates the array boundary. (b) Geometric sequence of operations
(left), and quantum circuit (right) for one surface code cycle for a measure-Z qubit, which
stabilizes Za Z b Zc Zd . (c) Geometry and quantum circuit for a measure-X qubit, which stabilizes
X a X b X c X d . The two identity I operators for the measure-Z process, which are performed by
simply waiting, ensure that the timing on the measure-X qubit matches that of the measure-Z
qubit, the former undergoing two Hadamard H operations. The identity operators come at
the beginning and end of the sequence, reducing the impact of any errors during these steps.
Figure from Ref. (Fowler, Mariantoni, Martinis and Cleland, 2012a).
29
SciPost Phys. Lect. Notes 49 (2022)
Problem 14: Show that the surface code cycle shown in Fig. 20b for a measure-Z qubit indeed
forces the four data qubits into an eigenstate of Za Z b Zc Zd .
After the projective measurement of all the measure qubits in the array, the state |ψ〉
of all the data qubits simultaneously satisfies Za Z b Zc Zd |ψ〉 = Zabcd |ψ〉, with eigenvalues
Za bcd = ±1, and X a X b X c X d |ψ〉 = X a bcd |ψ〉 with eigenvalues X abcd = ±1. This holds for every
four-qubit collection a bcd of data qubits, for the entire surface code array. Following each
measurement of the measure-Z and measure-X qubits, the cycle of resets, CNOTs and mea-
surement is repeated. The measure qubits in Fig. 20b and c all operate in lock-step, so that
every step in the cycle shown in the figure is completed over the entire 2D array before the next
step begins. We note that the particular zig-zag sequence a bcd for each of the measure qubits
is quite particular, and cannot easily be modified while preserving the stabilizer outcomes. It
ensures, in part, that no measure-X is interacting at the same time on a particular data qubit
as any measure-Z or other measure-X, and similarly for all the measure-Zs. Also, the timing in
the surface code sequence shows that measurements of the measure-X and measure-Z qubits
happen more or less at the same time, certainly these should all be completed before starting
the next surface code cycle, but they do not need to be simultaneous across the array.
The Z Z Z Z and X X X X measurements, starting with the very first complete measurement
cycle when starting up a surface code, take whatever initial state the data qubits are in, and
project from that state a complex entangled state |ψ〉 that is a simultaneous eigenstate of
all the measurements across the array; we call this entangled state the quiescent state. The
particular quiescent state |ψ〉 that results is selected at random from the enormous number of
possible outcomes. Given the measurement outcomes, depending on the detailed structure of
the overall array (which we discuss later), there may or may not be more than one possible
state for the data qubits; this depends on the number of degrees of freedom left by the set of
measurement outcomes.
Once selected, in the absence of errors, the same state |ψ〉 will be maintained by each
subsequent cycle of the sequence, with each measure qubit yielding the same measurement
outcome as it measured in the previous cycle, because all the X and Z stabilizer measurements
commute with one another. This is trivial for stabilizers that do not have any qubits in common,
as single-qubit operators on different qubits always commute. Stabilizers that have qubits in
common will always share two such qubits, so every X stabilizer shares two data qubits with
each neighboring Z stabilizer and vice versa. As we discussed earlier, X and Z measurements
that share two qubits in common still commute, even though the individual X and Z operators
on one qubit do not commute.
In Table 2 we show the Z Z Z Z and X X X X eigenstates and their corresponding stabilizer
eigenvalues. For any set of four data qubits, measured by say a measure-Z qubit, the eigenvalue
returned by the measure-Z stabilizer restricts the four data qubits to some linear superposition
of the eight four-qubit states with the corresponding eigenvalue. The same holds for the four
data qubits stabilized by a measure-X qubit. If we consider a set of six adjoining data qubits,
two measured only by a measure-Z, two measured by both a measure-Z and a measure-X,
and two measured only by a measure-X, we know that the two that are measured by both
measure qubits will be in a linear superposition of Bell states, entangled with the other qubits,
as the Bell states can be simultaneous eigenstates of both Z Z and X X . The Bell state is not
specified, because the nature of the four-fold measurement constrains only the product of the
four qubits, not of any pair. How constrained would such a set of qubits be? Each data qubit
has two degrees of freedom, the relative amplitude and the phase of its |0〉 and |1〉 basis states
(i.e. the two angles on the Bloch sphere). With six qubits there are 2 × 6 = 12 degrees of
freedom. We only have two measurements, which impose four constraints (fixing the real and
imaginary parts of the corresponding operator eigenvalue), so we still have eight degrees of
30
SciPost Phys. Lect. Notes 49 (2022)
freedom.
Consider now a larger piece of the surface code, such as that in Fig. 21. This has been
drawn with two types of boundaries, terminating with measure-X qubits on the right and left,
which we call X boundaries, and measure-Z qubits on the top and bottom, which we call Z
boundaries. The X boundaries are also called smooth boundaries and the Z boundaries are
called rough boundaries [15].
If we count the number of data and measure qubits in the array, we find there are 41 data
qubits and 40 measure qubits, so there are 2 × 41 degrees of freedom (with 241 distinct states)
in the data qubits, with 2 × 40 constraints from the stabilizer measurements, which are all
linearly independent. To see this, you need to realize that each stabilizer measurement picks
one of two possible outcomes (±1) so reduces the number of degrees of freedom by a factor
of two. Hence there are net two unconstrained degrees of freedom in this piece of surface
code array: This is equivalent to a qubit, and in fact, this patch of the surface code forms a
logical qubit, as we will see later. If we had instead drawn this array with only X or only Z
boundaries, instead of half X and half Z boundaries, then it turns out that one of the Z or X
stabilizers can be written as a product of all the other Z or X stabilizers. As the stabilizers all
commute, this means that this stabilizer does not impose an additional constraint, so with N
measure qubits you only have 2N − 2 constraints. However, in these arrays (as you can easily
convince yourself) there are only N − 1 data qubits, so in these arrays there are no additional
degrees of freedom: The stabilizer measurements completely determine the quiescent state,
there is no freedom given a set of measurement outcomes, so such patch of the surface code
array could not serve as a logical qubit.
31
SciPost Phys. Lect. Notes 49 (2022)
Problem 15: Prove that X L Z L = −Z L X L by commuting the individual qubit operators that
make up these logical operators.
Problem 16: Try defining X L0 and Z L0 as chains of X j and Z j operators that link the Z and
X boundaries respectively (i.e. perpendicular to the chains we defined for X L and Z L ). Why
doesn’t this work?
It may seem that we could choose other chains of single qubit operator products to define
different X L or Z L operators. Consider X L0 = X 1 X 10 X 11 X 12 X 3 X 4 X 5 , shown in Fig. 21. This
satisfies the same conditions as X L , as the X j data qubit operators are paired so as to bracket
each measure-Z qubit, so X L0 commutes with all the stabilizers, and will generate a quiescent
state |ψX 0 〉 = X L0 |ψ〉 with the same measurement outcomes as |ψ〉 and |ψX 〉. However the
state |ψX 0 〉 is actually trivially related to |ψX 〉: First, note that we can manipulate the set of
operators appearing in X L0 , as
X L0 = X 1 X 10 X 11 X 12 X 3 X 4 X 5
= (X 2 X 10 X 11 X 12 ) X 1 X 2 X 3 X 4 X 5 (87)
= (X 2 X 10 X 11 X 12 ) X L ,
where we have used X 22 = I. The operator in parentheses in the third line of Eq. (87) is the
stabilizer outlined in black in Fig. 21: We have shown that X L0 is just X L multiplied by an
operator product that is stabilized to one of its ±1 eigenvalues by the surface code stabilizers.
If we operate on a quiescent state |ψ〉 with X L0 , we can simply replace this operator product by
its eigenvalue:
X L0 |ψ〉 = X 2,10,11,12 X L |ψ〉 = ±X L |ψ〉 . (88)
Hence X L0 is trivially related to X L . This holds for any operator X L0 that can be written as a
stabilized operator product times X L . Any X L0 chain that crosses the array in Fig. 21 can be
written as X L multiplied by a product of X X X X stabilizers: There is only one non-trivially
distinct X L operator for this array.
32
SciPost Phys. Lect. Notes 49 (2022)
ZL
Z Z Z Z ZZ6 Z Z Z
X Z X Z X Z X Z X
X X X X X X X X
X Z XX11 Z X Z X Z X
Z Z Z Z ZZ7 Z Z Z
X Z X Z X Z X Z X
X10
X X X XX X X X X
X Z X Z
12X Z Z X Z X
3
XL Z Z Z Z Z Z Z Z d=5
XX1 Z XX2 Z X3 X Z XX4 Z XX5
X X X X X X X X
X Z X Z X Z X Z X
Z Z Z Z ZZ8 Z Z Z
X Z X Z X Z X Z X
X X X X X X X X
X Z X Z X Z X Z X
Z Z Z Z ZZ9 Z Z Z
Figure 21: A square 2D array of data qubits, with X boundaries on the left and right, and Z
boundaries on the top and bottom. The array has 41 data qubits, but only 40 X X X X and Z Z Z Z
stabilizers. A product chain X L = X 1 X 2 X 3 X 4 X 5 of X j operators connects the two X boundaries
and commutes with all the array stabilizers . The product chain Z L = Z6 Z7 Z3 Z8 Z9 connects the
two Z boundaries and also commutes with the array stabilizers. A modification of the X L chain
to the chain X L0 = X 1 X 10 X 11 X 12 X 3 X 4 X 5 generates a quiescent state |ψX 0 〉 = X 2,10,11,12 |ψX 〉,
equal to ±1 times |ψX 〉, as determined by the result of the measurement X 2,10,11,12 = ±1
of the encircled measure-X qubit (outlined in black). Figure from Ref. (Fowler, Mariantoni,
Martinis and Cleland, 2012a).
This result may seem odd: If we operate with a loop of X X X X operators corresponding
to a stabilizer, we are bit-flipping four data qubits, so the state X X X X |ψ〉 should be different
from |ψ〉. However, the fact that X X X X is equal to a stabilizer means that |ψ〉 already includes
superposition states of the un-bit-flipped and the bit-flipped states of the data qubits involved
in X X X X , so the loop operators is essentially just swapping states already in |ψ〉, with no net
effect.
The same argument applies to alternative Z L0 operators: Any such operator is equal to the
original Z L multiplied by a product of Z Z Z Z stabilizers, and thus any Z L0 |ψ〉 differs from Z L |ψ〉
by ±1. Hence there is also only one linearly independent Z L operator for this array.
Our array only gives us two degrees of freedom unconstrained by the stabilizers, and only
defines a single logical qubit. Even if we make the array larger, while maintaining the half-X
and half-Z boundaries, the array will only have two degrees of freedom, so won’t allow us to
define more logical qubits. Later, we will show how to make larger numbers of logical qubits
within an array, by adding more degrees of freedom within the array by turning off stabilizer
measurements. Each logical qubit increases the size of the logical Hilbert space by a factor of
two, and concomitantly reduces the size of the stabilizer Hilbert space of by a factor of two.
33
SciPost Phys. Lect. Notes 49 (2022)
9 Error detection
We now consider errors in the surface code. Possible errors include erroneous single qubit
gates, measurement errors, initialization errors, and CNOT errors. These can comprise con-
catenated errors, which involve by chance multiple neighboring data qubits; such concatenated
errors are called error chains. We do not consider here long-range correlated errors, i.e. errors
which link distant physical qubits. These are tolerated to some extent in the surface code,
meaning in some cases they can be corrected, but depending on the details, these can also
lead to serious logical errors. Single qubit errors, and local chains of errors, as long as they
can be identified correctly, can be corrected for by tracking them and correcting any subse-
quent measurement outcomes using classical control software. Edmonds’ minimum-weight
perfect-matching algorithm [54, 55] provides an automated method for doing this, and works
perfectly for sufficiently sparse errors, but begins to fail as the error density increases, and
as the length of the error chains increases. Numerical simulations provide estimates of the
tolerance of the surface code to different types of errors, such as shown in Fig. 22.
The simulations used to generate Fig. 22 include the following types of errors, occurring
during the surface code cycle shown in Fig. 20:
1. Attempting to perform a data qubit identity I, but instead performing a single qubit
operation X , Y , or Z; the probability for any one of these is p/3.
2. Attempting to initialize a qubit to |0〉, but instead generating |1〉 with probability p.
4. Performing a measure qubit Z measurement, but reporting the wrong value and project-
ing to the wrong state with probability p.
5. Attempting to perform a measure qubit-data qubit CNOT, but instead performing any
one of the fifteen two-qubit operations I ⊗ X , . . . , Z ⊗ Z, each with probability p/15 (only
fifteen because I × I can be ignored).
The errors occur randomly during the simulation. The probability p is per step in the surface
code cycle (there are eight steps in the cycle), so the overall rate per cycle of the surface code
is approximately 8p. Edmonds’ matching algorithm maps changes detected in the stabilizer
outcomes to physical qubit errors; the rate at which the algorithm makes mistakes, meaning
it misidentifies the source of a particular error report, is displayed as the logical error rate PL ,
defined as the number of logical X L errors appearing anywhere in the array, per surface code
cycle. There are of course also Z L errors, which occur at about the same rate as X L errors, and
for which the scaling with p is very similar; here we only look at X L errors.
The relation between PL and p depends very strongly on the array size d, termed the
distance of the array: d is the minimum number of physical qubit bit-flips or phase-flips needed
to define an X L or Z L operator. In Fig. 21, for example, we need a minimum of five physical
operators to define a logical operator, so that array has a distance d = 5.
For small physical error rates p, the logical error rate PL is small, and gets smaller as
the array distance d increases. For large p, PL is larger, and gets larger as d increases. The
cross-over between these two regimes occurs when p crosses the threshold error rate pth : For
p < pth , the logical error rate falls approximately exponentially with d, while for p > pth , PL
increases with d. In Fig. 22, the threshold rate is pth = 0.57%.
For error rates p < pth , the simulations show that the logical error rate scales with p
according to the power law PL ∼ p de , where we define the error dimension de for odd d as
de = (d + 1)/2 . (89)
34
SciPost Phys. Lect. Notes 49 (2022)
(a)
10-1
d=7
d=11
10-3 d=25
d=55
10-5
Figure 22: (a) Surface code logical error rate PL as a function of per-step error rate p, for
different distance d square arrays. Per-step error rates p that are below the threshold error
rate pth = 0.57% (dashed line) yield surface code logical error rates PL that scale roughly as
p d . The threshold corresponds to roughly a 0.0057 × 8 ≈ 4% error rate for the entire surface
code measurement cycle. (b) Estimated error rates, using statistical arguments given in main
text, for array distances d = 3, 7, 11, 25 and 55. Simple estimate is qualitatively similar to
detailed simulations. Figure from Ref. (Fowler, Mariantoni, Martinis and Cleland, 2012a).
For even d, we round down, so de = d/2. Using this, the error rate PL is approximately
PL ∼ d
= 0.03 (p/pth ) e . (90)
35
SciPost Phys. Lect. Notes 49 (2022)
Z Z Z Z
(a) Z E Z Z Z Z E Z Z Z
Z Z Z Z
Z E Z E Z Z
(b) Z Z Z Z Z Z Z Z
Z Z Z Z
X X
E Z Z Z E Z E
(c) Z Z Z Z Z Z Z Z
Z Z Z Z
X X X
Figure 23: (a) Two measure-Z qubits report errors (E) in a row of a 2D array. This could
be generated by (b) two X errors appearing in one surface code cycle, or (c) three X errors
appearing in the other three data qubits. Figure from Ref. (Fowler, Mariantoni, Martinis and
Cleland, 2012a).
surface code, misidentification of qubit errors causes logical errors, and that large d arrays are
thus less error-prone than small arrays (when operating below the error rate threshold).
The logical error rate can be estimated using statistical arguments. Chains of errors will
give the same measurement outcomes if they are complementary, as in Fig. 23: Two chains
of errors are complementary if their product is an array-crossing chain that commutes with
all the stabilizers (in other words, the complementary chains’ product is a logical operator, or
equivalent to a logical operator). Since shorter error chains are more likely, we only consider
minimum-length chains that cross the array. These have d operators, and can cross the array
in any one of the d data qubit rows. The most likely mistakes occur for error chains with length
de −1 = (d −1)/2 that are complementary to error chains of length de = (d +1)/2. For a chain
of errors in a given row, the number of possible de -fold errors is d(d − 1) . . . de /de !. Given a
per-step error rate p, the per-cycle individual error rate is pe ∼
= 8p, as there are eight steps per
cycle. The total X L error rate PL from these statistical arguments is then
d!
PL = d × × pede , (91)
(de − 1)!de !
where the factor of d accounts for the d independent rows in the array. A plot of this prediction
is shown in Fig. 22b, and scales in the same way as the more complete simulations in Fig. 22a.
We can estimate the number of qubits needed to obtain a desired logical error rate. Using
Eq. (90) for the error probability, we plot in Fig. 24 the total number nq of data and mea-
surement qubits, nq = (2d − 1)2 , versus the per-step error rate normalized to the threshold
p/pth < 1, for three values of the logical error rate PL . We find that nq increases rapidly as
p approaches the threshold pth . For a uniform gate fidelity of 99.9% (p = 10−3 ), we have
p/p th = 0.18. In this case, a logical qubit will need to contain 103 − 104 physical qubits in
order to achieve logical error rates below 10−14 −10−15 , just barely sufficient to perform Shor’s
algorithm for a 500-digit number with a reasonable chance of success.
A similar discussion applies to errors occurring in time instead of the spatially-correlated
errors we have discussed so far. A particular pattern of errors in time will suffer misidentifi-
cations with the same scaling as in Eq. (91), so we need roughly the same distance d in time
(measured in complete surface code cycles) as we do in space to obtain the same logical error
rate. Hence a d = 5 array needs to execute the surface code cycle five times to achieve the
same error distance in time. See Ref. [56].
36
SciPost Phys. Lect. Notes 49 (2022)
10 5
d=
10 4
40
Number of qubits nq P L = 10-20
20
10 3 -10
10
10
10 2 5
10-5
10 1
10-2 10-1 10-0
Single-step error rate p/pth
Figure 24: Estimated number of physical qubits nq per logical qubit as a function of the per-
step error rate p, normalized to the threshold error rate pth . This is plotted for different logical
error rates PL . Figure from Ref. (Fowler, Mariantoni, Martinis and Cleland, 2012a).
37
SciPost Phys. Lect. Notes 49 (2022)
10-1
Logical X error rate (PL)
d=3
d=5
10-2 d=7
d=9
d=11
d=15
10-3 d=25
d=35
d=45
(a) Class 0 d=55
10-4
0.6
Logical Z error rate (PL)
0.4 d=3
d=5
d=7
d=9
d=11
0.2 d=15
d=25
d=35
(b) Class 1
0.1
Logical X error rate (PL)
10-1
d=3
d=5
10-2 d=7
d=9
d=11
d=15
10-3 d=25
d=35
d=45
(c) Class 2 d=55
10-4
10-2 10-1
Physical qubit error rate p
Figure 25: Logical X L error rate PL per surface code cycle as a function of the per-step physical
error rate p, considering only (a) class-0 (data qubit) errors, (b) class-1 (measure qubit) errors
and (c) class-2 (CNOT) errors. Figure from Ref. (Fowler, Mariantoni, Martinis and Cleland,
2012a).
38
SciPost Phys. Lect. Notes 49 (2022)
0.012
0.004
Figure 26: Contours of the three classes’ error rates p0 , p1 and p2 that combine to give the error
threshold, corresponding to the total logical error rate PL = 0.02. Data are from a distance
d = 9 numerical simulation, and lines are guides to the eye. The green dot (upper vertical
axis) is the class-2 error rate giving PL = 0.02 with no class-0 or class-1 errors. Figure from
Ref. (Fowler, Mariantoni, Martinis and Cleland, 2012a).
stabilizers. However, this construct only gives us a single logical qubit. To add more logical
qubits, we need to recognize that the qubit degrees of freedom come from the boundaries in the
surface code; for our “swatch,” the outer boundary provides the needed freedom. However,
we can create more boundaries interior to the swatch, in other words we can create holes
within the fabric of the surface code. The holes, known as defects in the published literature,
are created by simply turning off one or more of the internal measure-X and measure-Z qubits
- here, “turning off” means that the measure qubits inside a hole no longer perform their
stabilizer measurement cycles; the qubits are not physically removed or otherwise disturbed.
As long as we preserve the required error-protecting distance d, we can create any number of
logical qubits in this way, each with their respective logical operators. We will see later that
these “internal” qubits further offer a way to create a logical controlled-NOT gate that is itself
protected by the surface code stabilizer cycle.
In Fig. 27 we show one way to do this, where we turn off a single measure-Z qubit, thereby
creating a hole. As the Z-cut stabilizer no longer performs its surface code cycle, releasing
the constraint on the product Za Z b Zc Zd of its neighboring data qubits, we have created two
additional degrees of freedom in the surface code array. These degrees of freedom can be
manipulated in a way similar to the way we manipulate our previous array qubit, by defining
logical operators X L and Z L that anti-commute. The hole we call a “Z-cut hole”, and the qubit
that corresponds to it is called a “Z-cut qubit”.
In the figure, the Z-cut hole is near an X boundary of the array. The hole is surrounded by
measure-X qubits, in other words making the Z-cut hole has created an internal X boundary. We
define a logical X operator as X L = X 1 X 2 X 3 , which connects the array’s outer X boundary with
the internal X boundary of the hole. This logical operator is a chain of operators that are paired
across each Z stabilizer, so it commutes with all the Z stabilizers in the array, and trivially
commutes as well with the X stabilizers. We also define a logical Z operator as Z L = Z3 Z4 Z5 Z6 ,
which comprises a loop of Z operators surrounding the Z-cut hole. These Z operators are paired
across each X stabilizer, so commutes with each of these, and trivially with all the Z stabilizers
as well. This operator loop is not constrained to an eigenstate of a Z stabilizer as it would be
39
SciPost Phys. Lect. Notes 49 (2022)
X1
X X X X
Z X Z X Z
Z Z Z Z Z Z
Z X Z X Z
X2 XL
X X X X
Z X Z X Z
Z Z Z Z Z Z
X3
Z X Z X Z
X X X X
Z X
Z3 X Z
Z4 Z5 ZL
Z Z Z Z
Z6
Z X X Z
X X X X
Z X Z X Z
Z Z Z Z Z Z
Z Z Z
Figure 27: A single Z-cut qubit. The array boundary is indicated by a solid black line (top),
while the other three sides of the array continue outwards indefinitely. Two logical operators,
X L = X 1 X 2 X 3 from the array’s outer X boundary to the internal X boundary of the Z-cut hole,
and Z L = Z3 Z4 Z5 Z6 surrounding the Z-cut hole, are shown. Note that the operator chains for
X L and Z L have one physical data qubit in common (data qubit 3). Figure from Ref. (Fowler,
Mariantoni, Martinis and Cleland, 2012a).
without the Z-cut hole, so this operator can change the quiescent state |ψ〉 of the array in a
non-trivial way.
The X L chain and the Z L loop share one data qubit, number 3 in Fig. 27. These two opera-
tors therefore anti-commute, as you can easily prove to yourself. You can also easily show that
X L2 = Z L2 = I, and we can define YL = Z L X L . We have thus created a set of anti-commuting
single-qubit Bloch operators associated with this Z-cut hole, so the Z-cut hole is a logical qubit.
We note that if the outer perimeter of the swatch of surface code were a single Z boundary,
there would be no way to build an appropriate X L chain for the Z-cut hole. Equivalently, the
product of all the Z stabilizers in the array would fix the value of Z L , so creating a Z-cut hole
in a Z-boundary swatch would not create any additional degrees of freedom: At least one X
boundary is needed. Note the distance d of this qubit is d = 3, limited by the length of the
X L chain from the hole to the swatch boundary. The distance could be increased to d = 4 by
moving the hole one stabilizer cell further away from the array boundary. However d would
then be limited to 4 by the size of the Z-cut hole, which limits the Z L operator to a product
of four operators. Turning off more Z stabilizers in the hole would make it possible to have
a larger distance qubit. A single Z-cut qubit is called a smooth defect or a dual defect in the
literature.
An X-cut qubit can be formed in an analogous way, by turning off a single measure-X qubit
in an array that has at least one Z boundary; this logical qubit’s Z L operator is then a chain of
Z operators from the array Z boundary to the internal Z boundary created by turning off the
measure-X qubit, and the X L operator is the loop of X bit-flips surrounding the X-cut hole. An
X-cut qubit is called a rough defect or a primal defect in the published literature.
This concept can be made even more general by creating the qubits in pairs, i.e. creating
two Z-cut or two X-cut qubits. The logical operators for these paired qubits then are created
by a chain of operators linking the qubits (an X chain for Z-cut qubits, a Z chain for X-cut
qubits), combined with a loop of operators surrounding the hole (a Z loop for a Z-cut qubit,
and an X loop for an X-cut qubit). An example of a “double Z-cut qubit,” achieved by turning
off two measure-Z qubits in a swatch, is shown in Fig. 28. Making these two Z-cut holes adds
40
SciPost Phys. Lect. Notes 49 (2022)
Z Z Z Z Z Z Z Z Z Z
X Z X Z X Z X Z X Z X
X X X X X X X X X X
X Z X Z X X Z XXL1 Z X
Z Z Z ZL1Z Z Z Z Z
X Z X Z X X Z X Z X
X X X X X X X X X X
X Z X Z X Z X Z X Z X
Z Z Z Z Z Z Z Z Z Z
X Z X Z X Z X Z X Z X
X
X X X X XLX X X X X X
Z X Z X Z X Z X Z X
Z Z Z Z Z Z Z Z Z Z
X Z X Z X Z X Z X Z X
X X X X X X X X X X
X Z X Z X X Z X Z X
Z Z Z ZL2Z Z Z Z Z
X Z X Z X X Z X Z X
X X X X X X X X XL2X X
X Z X Z X Z X Z X Z X
Z Z Z Z Z Z Z Z Z Z
Figure 28: A double Z-cut qubit. Each Z-cut hole has the logical operators X L1 and Z L1 , X L2
and Z L2 . We can replace X L1 (dashed blue line) by X L1 X L2 , which with X L2 is equivalent to the
two separate X operators. However, X L1 X L2 can be multiplied by all the outlined X stabilizers,
which at most give a sign change to the operator, to yield the equivalent operator X L (solid
blue line) that links the two qubit holes. Figure from Ref. (Fowler, Mariantoni, Martinis and
Cleland, 2012a).
four additional degrees of freedom to the array. We define X L1 and Z L1 for the upper (first)
Z-cut hole, and X L2 and Z L2 for the lower (second) Z-cut hole, as shown in the figure. These
four linearly independent operators manipulate all four degrees of freedom, with each logical
operator pair (X L j , Z L j ) commuting with the other pair but anti-commuting with each other.
We can manipulate the two qubit holes together by replacing X L1 by the product X L1 X L2 ;
this anti-commutes with both Z L1 and Z L2 , and together with X L2 provides the same function-
ality as X L1 and X L2 . Now we define a new X L operator linking the two qubit holes, shown in
Fig. 28; this is the product of three data qubit X operators, and links the internal X boundary
of the upper qubit to the internal X boundary of the lower qubit. Note that X L X L1 X L2 is equal
to the product of all the stabilizers enclosed by these operators (these stabilizers have black
outlines in Fig. 28). Hence, if we multiply X L1 X L2 by all these stabilizers, the result is X L , so
X L is equivalent to X L1 X L2 to within ±1 (the sign is equal to the product of all the enclosed
stabilizers). Hence we can replace X L1 X L2 by X L .
We now have the operator set {X L , X L2 , Z L1 , Z L2 }, where the logical X operators commute
with one another, as do the logical Z operators, but X L anti-commutes with both Z L1 and Z L2 ;
X L2 anti-commutes only with Z L2 .
However, we are only interested in using two of the degrees of freedom in the double
qubit, the two that can be manipulated with “local” operator chains (ones that do not extend
to the swatch edge). We therefore use X L along with either Z L1 or Z L2 . If we choose to use
Z L2 ≡ Z L , and define YL = Z L X L , we have a complete set {X L , Z L , YL } of logical qubit operators.
By restricting ourselves to this set of logical operators, we are manipulating half of the degrees
of freedom provided by the two qubit holes. Hence effectively we are manipulating a single
logical qubit. We write the state of this logical qubit in the usual way, as e.g. α|g L 〉 + β|e L 〉.
The advantage this concept provides is that now our double Z-cut qubit can be manipulated
using only local operator chains: We are not longer required to build chains that link the qubit
to the edge of the surface code patch. This will be very significant when we look at braiding
operations between pairs of qubits.
41
SciPost Phys. Lect. Notes 49 (2022)
Z Z Z X X X
(a) Z Z Z Z Z Z (b) X X X X X X
Z X Z X Z X Z X Z X
X X X X Z Z Z Z
Z X X Z X Z Z X
Z Z Z Z X X X X
Z X X Z X Z Z X
X XX1 X X Z ZZ1 Z Z
Z X Z X Z X Z X Z X
Z Z Z Z Z Z X X X X X X
Z X Z X Z X Z X Z X
X XX2 XL
X X Z ZZ2 ZL
Z Z
Z X Z X Z X Z X Z X
Z Z Z Z Z Z X X X X X X
Z X X3 Z X Z X Z Z3 X Z X
X X X X Z Z Z Z
Z X
Z3 X Z X Z X3 Z X
Z Z Z4 Z5 ZL
Z Z X X X4 X5 X
X
LX
X
Z X Z6 X Z X Z X6 Z
X X X X Z Z Z Z
Z X Z X Z X Z X Z X
Z Z Z Z Z Z X X X X X X
Z Z Z X X X
Figure 29: (a) A double Z-cut and (b) a double X-cut qubit, formed by turning off two measure-
Z and two measure-X qubits, respectively. For the double Z-cut qubit the logical operators are
X L = X 1 X 2 X 3 , a chain that links one Z-cut hole’s internal X boundary to the other, and a
Z L = Z3 Z4 Z5 Z6 loop that encloses the lower Z-cut hole. For the X-cut qubit, Z L = Z1 Z2 Z3 ,
a chain that links the two internal X-cut holes’ Z boundaries, and X L = X 3 X 4 X 5 X 6 loop that
encloses the lower X-cut hole. X L and X L share one data qubit (qubit 3), so the operators
anti-commute. Note that the loop operators can be defined to surround either of the two holes
in the qubit. Figure from Ref. (Fowler, Mariantoni, Martinis and Cleland, 2012a).
We can create a double X-cut qubit in a similar fashion, by turning off two measure-X
qubits. Both the double Z-cut and double X-cut qubit types are shown in Fig. 29. The logical
operators for the double X-cut qubit are defined in a similar way: Z L is a chain linking the two
X-cut holes, and either X L = X L1 or X L = X L2 , the operator loops that surround one or the
other of the X-cut holes. It is easy to show that these anti-commute.
As we will see later, the two different types of logical qubits (X-cut and Z-cut) are both
needed to perform the topological braid transformation that provide the logical CNOT opera-
tion in the surface code: Only braids between mixed qubit types give the needed functionality.
However, as we discuss below, a topological CNOT can be performed between two Z-cut qubits,
by using an X-cut qubit as an intermediary; similarly, a CNOT between two X-cut qubits can be
performed using a Z-cut as an intermediary. An arbitrary quantum computation can therefore
be completed using mostly one flavor of logical qubit, with the other qubit type only making
appearances in a supporting role.
The error-protection distance for the logical qubits we’ve been discussing is only d = 3,
meaning these are relatively fault-intolerant. Moving the two holes further apart by one sur-
face code unit cell increases the distance to d = 4, limited by the length of the Z L or X L
loops; increasing the size of the holes in parallel with the hole distance will increase the dis-
tance d further, as long as measurements are repeated d times in time in tandem with the
increased physical distance. The repetition in time provides protection from errors that occur
in the measure-Z and measure-X qubit measurement cycles, where e.g. an isolated error in the
measure-Z surface code cycle would be detected by repeated measurement cycles, providing
a distance d in time equivalent to the distance d in space.
42
SciPost Phys. Lect. Notes 49 (2022)
(a) (b)
XL
ZL
Figure 30: “Easy” initialization of an X-cut logical qubit, where the stable measure-X outcome
just prior to creating the qubit hole is equal to the initial logical eigenvalue of the qubit. Figure
from Ref. (Fowler, Mariantoni, Martinis and Cleland, 2012a).
11.1 Initialization.
There are two distinct ways to initialize a logical qubit state: The “easy” way and the “difficult”
way. The easy method is to initialize the qubit in an eigenstate of the qubit cut, so for an X-cut
qubit, easy initialization is in the |+ L 〉 or |− L 〉 eigenstates of X L , while for a Z-cut qubit, easy
initialization is in the |0 L 〉 or |1 L 〉 eigenstates. This is illustrated for an X-cut qubit in Fig. 30,
starting with a 2D array with no cuts, and stepping immediately to one with a double-X cut
qubit, achieved by turning off two measure-X qubits to create two X-cut holes. If we define X L
as the loop surrounding the upper qubit hole, the initial state of the qubit is the measurement
outcome of the upper measure-X qubit just before it was turned off (sampled and voted d
times to provide error protection). If the initial state is not the desired one, we can apply a Z L
phase-flip to get the desired state.
The alternative is to perform a “difficult” initialization of the X-cut qubit in the Z L basis,
i.e. to initialize the qubit in either |0 L 〉 or |1 L 〉. This can be done using a logical Hadamard
after initializing in the X L basis. Logical Hadamards are however somewhat complicated, as
we will see later; it is actually simpler to initialize in the Z L basis directly. This is shown in
Fig. 31. Starting with a fully-stabilized array, a strip of X stabilizers is turned off, where each
end of the strip becomes one of the two qubit holes. The Z stabilizers that border the strip are
also switched from measuring four adjacent data qubits to measuring three qubits. In Fig. 31b,
there are six Z stabilizers that are switched from four- to three-terminal operation. Note that
the stabilizer measurements still all commute, as you can check. The three isolated data qubits
(numbered 1, 2 and 3 in Fig. 31) are measured once along Z to maintain error correction, and
then the data qubits are set to the ground |0〉 state as in Fig. 31c. Setting these three qubits to
their ground state ensures that the quiescent state |ψ〉 that results will be in the logical ground
state of the Z L = Z1 Z2 Z3 operator. Finally the two X stabilizers internal to the strip are turned
43
SciPost Phys. Lect. Notes 49 (2022)
(a) (b)
MZ
1
MZ
2
MZ
3
(c) (d)
g XL
1
g
2
g ZL
3
Figure 31: A “difficult” Z eigenstate initialization of an X-cut logical qubit. (a) Starting with
a fully stabilized array, (b) turn off a column of four measure-X qubits, switch the adjacent
measure-Z qubits from 4- to 3-terminal measurements, and perform Z measurements of the
data qubits numbered 1, 2 and 3, to maintain error tracking. (c) Reset the data qubits 1, 2
and 3 to |g〉, and (d) turn two of the measure-X qubits back on, switch the adjacent measure-Z
qubits back to 4-terminal measurements, resulting in a logical qubit initialized in |g L 〉 due to
step (c). Figure from Ref. (Fowler, Mariantoni, Martinis and Cleland, 2012a).
back on, and the three-terminal Z stabilizers switched back to four-terminal measurements,
completing the process. If instead a |1 L 〉 is desired, an X L is applied (in software) to bit-flip
the logical qubit.
Note that the projective measurements of the two X stabilizers that were turned back on
at the end of the initialization will leave the three data qubits in a +1 eigenstate of Z L , in other
words a |0 L 〉 eigenstate, even though the data qubits themselves will no longer be in their indi-
vidual ground states |0〉. We can see this as follows: After the ground state re-set, the quiescent
state |ψ〉 is transformed to |ψ0 〉 = |000〉⊗|φ〉, where |000〉 is the state of the three data qubits,
and |φ〉 the state of all the other data qubits in the array. The state |ψ0 〉 is a +1 eigenstate
of Z L , but is not an eigenstate of all the X stabilizers, as you can easily verify. However, we
know that Z L commutes with all the X stabilizers, so there are common eigenstates of both
Z L and these stabilizers. The state |ψ0 〉 can be written as a superposition of these X stabilizer
eigenstates, which are all +1 eigenstates eigenstates of Z L , so the logical qubit remains in |0 L 〉.
The X stabilizer measurements will project |ψ0 〉 onto one of these eigenstates, leaving us with
a state |ψ00 〉 that is still a +1 eigenstate of Z L but is also an eigenstate of all the X (and Z)
stabilizers in the array.
Initializing a Z-cut qubit is completely analogous to the initialization of an X-cut qubit.
44
SciPost Phys. Lect. Notes 49 (2022)
(a) (b)
XL MZ
MZ
ZL
MZ
(c) (d)
Figure 32: A Z-axis (“difficult”) measurement process for an X-cut logical qubit. (a) Start-
ing with an X-cut qubit, (b) turn off the measure-X qubits between the two qubit cuts while
also switching the neighboring measure-Z qubits from four- to three-terminal measurements.
Measure the un-stabilized data qubits along Z. The product of the measurement outcomes is
the measurement of Z L . (c) Reset the qubits to their ground states |g〉 and (d) destroy the
logical qubit by turning on all the stabilizers. Figure from Ref. (Fowler, Mariantoni, Martinis
and Cleland, 2012a).
11.2 Measurement
Measuring a logical qubit is almost the inverse of initialization. As with initializing, logical
measurements can be classified as “easy” or “difficult”. For an easy measurement, the measure
qubits in the qubit holes are simply turned on, with the stabilizer measurement projecting
the logical qubit onto a stabilizer eigenstate, with the stabilizer eigenvalue equal to the log-
ical qubit measurement outcome (after completing d surface code cycles and voting). For
the X-cut qubit shown in Fig. 32a, we turn on the two measure-X qubits in the holes, whose
measurement projects the data qubits adjacent to them into an X a X b X c X d product eigenstate.
This constitutes an X L measurement of the logical qubit, with the X L eigenvalue equal to the
(time-stable) value of X a bcd .
For a difficult measurement, used to e.g. measure the X-cut qubit in the Z L basis, we use
the measurement process illustrated in Fig. 32.
A completely analogous process is used to perform an “easy” measurement of Z L or a
“difficult” measurement of X L for a Z-cut qubit.
45
SciPost Phys. Lect. Notes 49 (2022)
12 Moving qubits
We turn now to the very interesting method used to entangle logical qubits. This is done by
physically moving the qubit holes in the 2D array, providing a central and unique functionality
of the surface code. By passing one hole of a two-hole qubit between the two holes of a second
qubit, “braiding” the logical qubits together, you perform a logical CNOT of the two qubits!
We first cover how to move a logical qubit hole while preserving the surface code error
protection. The corresponding transformations of the logical operators associated with the
moving qubit are described in the Heisenberg representation. We briefly review the Heisenberg
representation of quantum mechanics (see e.g. [57] for a more complete introduction, and
[58] in relation to quantum computing).
Many processes comprise unitary transformations U, with U U † = U † U = I. These include
changes of basis, changes of representation, and temporal evolution. In the Schrödinger rep-
resentation, these transformations are applied to the wavefunction, so that |ψ〉 ⇒ U|ψ〉, with
the operators kept static. Hence for example wavefunctions are time-dependent, arising from
the application of the evolution operator U(t), while operators are time-independent. Inner
products are invariant under a unitary transformation.
In the Schrödinger picture, the matrix elements of an operator A transform according to
〈φ|A|ψ〉 ⇒ 〈φ|U † A(U|ψ〉)
(92)
= 〈φ| U † AU |ψ〉 .
As in general A 6= U † AU, the matrix elements can change under a unitary transformation, even
though the operators do not. The second line in Eq. (92) provides the basis for the Heisenberg
representation: We can equivalently assume the wavefunctions |ψ〉 do not change under the
unitary transformation U, and instead we modify the operator A ⇒ A0 = U † AU. Hence in
the Heisenberg picture, operators rather than wavefunctions are modified under a change of
basis, and operators are time-dependent. The evolution of any measurable quantity will be
the same in the Heisenberg representation as in the Schrödinger representation, so there is no
detectable difference between the two pictures: They are thus completely equivalent from the
point of view of measurement outcomes.
In the surface code, moving and braiding qubits are transformations that affect both the
physical array of qubits as well as the logical operators. The physical transformations are not
unitary, as these involve projective measurements of the data qubits, but the transformations
of the logical operators are unitary, and are most easily described using the Heisenberg repre-
sentation.
46
SciPost Phys. Lect. Notes 49 (2022)
measurement cycle. The two measure-X qubits that monitor data qubit 6 are also switched back
to four-terminal measurements. The next surface code cycle is executed, which completes the
physical operation for the move. To establish all stabilizer values in time takes an additional
d − 1 surface code cycles. Altogether this one-cell move takes 1 + d surface code cycles.
While performing the physical operations, the two logical operators Z L and X L need to be
redefined to preserve their functionality. We redefine Z L so that it encloses two stabilizer cells,
its original cell plus the one below it, by multiplying Z L by the four Z operators, Z6 Z7 Z8 Z9 ,
that make up the Z stabilizer below the qubit hole. We term the new extended operator Z Le ,
given by
Z Le = (Z3 Z4 Z5 Z6 ) × (Z6 Z7 Z8 Z9 )
(93)
= Z3 Z4 Z5 Z7 Z8 Z9 ,
as shown in Fig. 33a. We complete the first surface code cycle of the move, turning off the
lower Z stabilizer and measuring data qubit 6. We redefine the X L operator by multiplying it
by X 6 , giving
X L0 = X 1 X 2 X 3 X 6 ; (94)
see Fig. 33b.
The original qubit hole stabilizer is turned back on, and the second surface code cycle of
the move completed. The Z Le operator is redefined by multiplying it by the four Z operators
that make up the stabilizer that was just turned on, Z3 Z4 Z5 Z6 , giving
Z L0 = (Z3 Z4 Z5 Z6 ) × Z Le
= (Z3 Z4 Z5 Z6 ) × (Z3 Z4 Z5 Z7 Z8 Z9 ) (95)
= Z6 Z7 Z8 Z9 .
The two new logical operators X L0 and Z L0 are as drawn in Fig. 33c. Note that, as required, they
still share a single data qubit and commute with all the stabilizers.
47
SciPost Phys. Lect. Notes 49 (2022)
X1 X1 X1
X2 XL X2 X2
X3 X3
XL’
X3
Z3 Z3
Z4 Z5 ZL Z4 Z5
X6
Z6
X6 ZLe Z6
7 9 Z7 Z9 Z7 Z9 ZL’
Z8 Z8
8
Figure 33: Moving a Z-cut logical qubit hole down by one cell. (a) Logical qubit with
X L = X 1 X 2 X 3 and Z L = Z3 Z4 Z5 Z6 . (b) Z L extended by multiplying it by the Z stabilizer just
below the lower qubit hole: Z Le = (Z6 Z7 Z8 Z9 )Z L = Z3 Z4 Z5 Z7 Z8 Z9 . This Z stabilizer is turned
off along with converting the surrounding four-terminal X stabilizers into three-terminal sta-
bilizers, leaving data qubit 6 un-stabilized. An X measurement of data qubit 6 is performed.
(c) Extend operator X L0 by multiplying X L by X 6 : X L0 = X 6 X L = X 1 X 2 X 3 X 6 . The Z stabilizer
just above qubit 6 is turned on, we wait d surface code cycles. Define Z L0 as the product of
this Z stabilizer and Z Le : Z L0 = Z6 Z7 Z8 Z9 . Figure from Ref. (Fowler, Mariantoni, Martinis and
Cleland, 2012a).
The byproduct operators only affect the logical state, so we can write the equivalent to Eq. (96)
as
0p 0p
|q L 〉 → X L Z Z L X |q0L 〉 , (97)
where |q0L 〉 is the desired logical state.
Here each stabilizer operator Zs j represents the product of the four Z operators on the four data
qubits surrounding the jth stabilizer cell. These stabilizers are then turned off, and the four-
terminal X stabilizers adjacent to the strip switched to three-terminal measurements. The un-
stabilized data qubits in the strip are all measured along X , and X L is extended by multiplying
it by all the X operators on these data qubits,
X L0 = (X 1 . . . X n−1 )X L . (99)
We complete the move for Z L by then multiplying Z Le by all the stabilizers except the one that
48
SciPost Phys. Lect. Notes 49 (2022)
X̂ L X̂ L X̂ ’L
Ẑ L X 1e Z s1f
Z s2i X 2e Z s2f
Z s3i Ẑ Le
…
e
X n-1 Z s,f n-1
…
i
Z s,n Ẑ L’
Figure 34: Moving a Z-cut qubit hole through multiple cells. The X L chain is a blue (light)
line linking the logical qubit holes and passing through the data qubits (open circles), and
the Z L loop is in red (gray). The upper (gray) and lower (white) Z-cut holes enclose idle Z
stabilizers; the outlines have measure-X qubits on the vertices with data qubits on the edges.
(a) Initial state, showing the logical operators X L and Z L , with the initial (pre-move) software-
i i i
corrected Z stabilizer measurement outcomes Zs2 , Zs3 . . . Zs,n . The Z stabilizers involved in the
next step are shown with thin black outlines; the jth stabilizer Zs, j is the stabilizer cell marked
by that stabilizer’s initial measurement outcome Zs,i j . (b) Extension of Z L to Z Le , with X mea-
surements of the isolated data qubits yielding the measurement eigenvalues X 1e , X 2e , . . . X n−1 e
0
(data qubits filled in blue (light)). (c) Final state, with Z L the shifted Z L logical operator and
X L0 the extended chain for X L , with the Z stabilizers (thin black outlines) turned back on; af-
ter waiting d surface code cycles, we establish the final (post-move) measurement outcomes
f f f
Zs1 , Zs2 , . . . Zs,n−1 . Figure from Ref. (Fowler, Mariantoni, Martinis and Cleland, 2012a).
where we use the fact that Zs2j = I and that Z L = Zs1, i.e. the original Z L is just the set of four
Z data qubit operators that define Zs1 . After the move, we wait an additional d − 1 surface
code cycles to establish all stabilizer values in time.
A completely analogous process is used to move X-cut logical qubit holes, exchanging the
roles of the X and Z stabilizers and measurements.
We note that multi-cell moves can be done very quickly, as a very long cut can be made
in just one step of the surface code cycle, and the qubit holes moved in d + 1 surface code
cycles, the same as for a one-cell move. This therefore enables long-distance interaction and
communication between logical qubits, a very powerful capability.
49
SciPost Phys. Lect. Notes 49 (2022)
50
SciPost Phys. Lect. Notes 49 (2022)
X̂ L X̂L’’’
e
X12e X11e X10
e
X1
Xsf1 X s 2 Xsf3
f
e
X2 X 9e
e
X3 X e X̂L’ X̂L’’ Xsf4 Xsf5 Xsf6
8
e e e e Xsf7 Xsf8 Xsf9
X4 X 5 X 6 X 7
Figure 35: Braid transformation of a single Z-cut qubit. (a) Z-cut qubit with the operator X L ,
showing the three data qubits that define the operator. (b) Extended opening (heavy grey)
for first move in the braid. Data qubits isolated by the extension are measured in X with
outcomes X 1e , . . . , X 8e . (c) The X L operator (blue, dark) is extended to X L0 = X 1 . . . X 8 X L . (d)
The second move again involves measuring isolated data qubits in X . (e) The X L0 operator is
extended to X L00 and now includes the original chain linking the two qubit holes, and in addition
a closed loop of operators. (f) The closed loop is completely stabilized by the nine X stabilizers
X s1 . . . X s9 (blue (dark) squares). We can thus reduce the operator chain X L00 to a chain X L000 that
is identical to the original X L (other than sign difference). The signs are captured by defining
f f f
the power pX through (−1) pX ≡ X s1 X s2 . . . X s9 = ±1, given by the product of all the X stabilizer
00
measurements enclosed by the X L loop. Figure from Ref. (Fowler, Mariantoni, Martinis and
Cleland, 2012a).
The Z L operator is the loop of qubit Z operators that encloses the lower qubit hole. As
shown in Fig. 36, the braid transformation alternately extends and then collapses the operator
loop that surrounds the Z-cut hole, once for each of the two moves; other than sign changes
from Z stabilizers that the loop passes over, the final Z L loop is the same as the initial loop.
The difference between the transformation of X L and Z L is the key to how the braid acts as a
CNOT.
Details of the braid transformation involving just one logical qubit are given in the captions
for Figs. 35 and 36. Note that in Figs. 35 and 36, while we separate the actions that affect the
X L operator from those that affect Z L , all X measurements of the isolated data qubits and
measurements of the Z stabilizers are performed as part of the braid.
The braid transforms each two-qubit operator into some other two-qubit operator, with
51
SciPost Phys. Lect. Notes 49 (2022)
ZˆLe ’
ẐL Z
f
s1 Zs13 Zs12 Zsi11 Zsi10
i i
Ẑ ’’L Z sf12 Z sf11 Z sf10
i
Zs 2 Z
i
s9
f
Zs 2 Ẑ L’ Z sf9
i i f
ẐLe Zsi3 Zs 8 Zs3 Z f
s8
i
Zs 4 Z i
s5
i
Z Z
s6 s7 Z Z Z
f
s4
f
s5
f
s6 Z s7f
Figure 36: Braid transformation of a Z L operator on a single Z-cut qubit. (a) Double Z-
cut qubit with Z L in red; data qubits are open circles; dashed line linking the two qubit
holes does not represent an operator. (b) Extended opening (solid red loop) for first move
i i
in braid. The pre-move Z stabilizer outcomes Zs2 , . . . , Zs9 are all equal to ±1. The Z Le op-
e
erator (solid red loop) is extended from Z L , Z L ≡ Zs2 . . . Zs9 Z L . (c) The extended opening
is closed up by turning on the stabilizers Zs1 , . . . , Zs8 , and waiting d surface code cycles
to obtain the error-corrected outcomes Zs1 e e
, . . . , Zs8 . The new Z L0 operator is the red (gray)
loop formed by four data qubit Z operators, equal to Z L0 = (Zs1 . . . Zs8 )(Zs2 . . . Zs9 )Z L . (d)
0
Second move in the braid, which involves extending Z L0 to Z Le , using the associated Z sta-
bilizer outcomes. (e) The final Z L00 is a closed loop of four data qubit operators identical
to the original Z L , although Z L00 may differ in sign with respect to Z L , captured by defining
f f f f
(−1) pZ ≡ (Zs9 . . . Zs12 )(Zs10
i i
. . . Zs13 )(Zs1 . . . Zs8 )(Zs2
i i
. . . Zs9 ) = ±1. Figure from Ref. (Fowler,
Mariantoni, Martinis and Cleland, 2012a).
the outcome depending on the specific operators, and on the order in which they appear (so
X L ⊗ Z L does not transform the same way as Z L ⊗X L ). The outcome of a braid depends on what
types of qubits we are braiding; we focus here on braiding a Z-cut qubit through an X-cut qubit,
as shown in Fig. 37. As we will see, only a braid between a Z-cut and an X-cut qubit yields an
operator transformation that is equivalent to a logical CNOT. It is not possible to obtain the
desired CNOT transformations when braiding two Z-cut qubits together, or two X-cut qubits;
we discuss these situations later.
In Fig. 37, the Z-cut qubit is in the upper part of the figure, with the braid moving the
lower Z-cut hole of this qubit around a closed loop. The X-cut qubit is in the lower part of
the figure, with the braid taking the Z-cut hole between the two X-cut holes, enclosing the
upper X-cut hole. As we show later, demonstrating that a braid is equivalent to a CNOT only
involves showing that four of the sixteen possible two-qubit operator combinations transform
correctly; these are X L ⊗ I L , I L ⊗ X L , Z L ⊗ I L and I L ⊗ Z L . The transformations for all the other
two-qubit combinations of X L , Z L and I L can be constructed from these four. Here we give a
brief outline of these transformations.
X L1 ⊗ I L2 ⇒ X L1 ⊗ X L2 : Figure 37 shows the transformation of X L1 on the first, Z-cut qubit,
with no operation on the second qubit. As with the empty loop braid, the extension of the
00
X L1 operator chain in the two moves creates an operator X L1 that comprises a closed loop of
X operators in addition to the original operator chain X L1 . The loop encloses the X-cut qubit’s
upper hole. For the empty loop braid, we could move the loop through all the enclosed cells,
as these were all stabilized, so the loop operator resolves to a simple product of measurement
outcomes. Here, we cannot do this, as the X-cut hole is inside the loop and is not stabilized;
instead, we can transform the loop through each stabilized cell, until it wraps tightly around
the X-cut hole. This loop of X operators is then equivalent to X L2 , a logical X operation on the
000
second qubit. The remaining chain of operators in X L1 is the same as the original X L1 chain
52
SciPost Phys. Lect. Notes 49 (2022)
Z-cut X̂ L1 X̂L1
’’’
e
X X11e X
e e
X1 12 10
Xsf1 X s 2 Xsf3
f
e
X2 X 9e
e
X3 X8e X̂L1’ X̂L1’’ Xs 4
f
Xsf6
IˆL2 e e e e Xs 7 Xs 8 Xsf9
f f
X-cut X X X X
4 5 6 7
X̂L2
Figure 37: A braid on a Z-cut qubit, where the lower Z-cut hole is passed around the upper
X-cut hole of an X-cut qubit. The braid’s effect on X L1 operator of the Z-cut qubit 1 is shown.
(a) Z-cut qubit (above) and X-cut qubit (below) with corresponding logical operators; data
qubits are shown as open circles. (b) Extension for first move in braid, where data qubits are
measured along X , with measurement outcomes X 1e , X 2e , . . . X 8e . (c) X L1 operator is extended in
0
length to X L1 . (d) Extension for second move in braid, where data qubits are measured along
00
X with measurement outcomes X 9e , . . . X 12
e
. (e) X L1 operator is extended in length, comprising
the original chain plus a closed loop of data qubit operators, the loop enclosing the upper
00
hole of the X-cut qubit. (f) The loop part of the X L1 operator is moved through the enclosed
stabilized cells, leaving a loop of X data qubit operators that is equal to X L2 on the second
qubit, with X L1 unchanged from before the braid (other than possible sign changes). Figure
from Ref. (Fowler, Mariantoni, Martinis and Cleland, 2012a).
X L1 ⊗ I L2 ⇒ X L1 ⊗ X L2 . (102)
I L1 ⊗ X L2 ⇒ I L1 ⊗ X L2 . (103)
IˆL1
IˆL1
X̂ L2 X̂ L2
X̂ L2 X̂ L2
X-cut
Figure 38: (a)-(d) Illustration of the braid transformation of I L1 ⊗ X L2 . After the move, there is
no net change of either operator. Figure from Ref. (Fowler, Mariantoni, Martinis and Cleland,
2012a).
53
SciPost Phys. Lect. Notes 49 (2022)
(a) (b)
Z-cut
ÎL1
X-cut Ẑ L2
(c) (d)
Figure 39: Braid transformation of I L1 ⊗ Z L2 . (a) Prior to the move, displaying I L1 on qubit 1
and Z L2 on qubit 2. Data qubits are shown as open circles where relevant. (b) The Z L2 operator
is extended by multiplying it by a set of stabilizers (dotted boxes), resulting in the heavy red
line that is equivalent to the original Z L2 , with the exception of possible sign changes. (c)
Qubit 1’s hole is moved through the path opened up by extending Z L2 . (d) Z L2 is moved back
to its original form, leaving behind a loop of Z physical qubit operators that comprise a Z L1
operator on qubit 1. Figure from Ref. (Fowler, Mariantoni, Martinis and Cleland, 2012a).
Z L2 is then multiplied by all the stabilizers shown in the dashed boxes (Fig. 39d), leaving
behind a loop of Z operators surrounding the first qubit’s hole, a loop that is exactly a Z L1
operation on the first Z-cut qubit, as well as the original Z L2 on qubit 2, unchanged from prior to
the braid (other than possible sign changes). The braid therefore performs the transformation
I L1 ⊗ Z L2 ⇒ Z L1 ⊗ Z L2 . (104)
Z L1 ⊗ I L2 ⇒ Z L1 ⊗ I L2 : This transformation involves braiding the first qubit hole through
the second qubit, which drags the loop of Z operators along as it did for the empty loop braid,
but as the loop preserves its closed form during the two moves, it does not generate a chain or
loop of operators that can act on the second qubit, so the braid transformation does nothing
(other than sign changes). Hence we find
Z L1 ⊗ I L2 ⇒ Z L1 ⊗ I L2 . (105)
In general, a braid transformation leaves logical operators that are built from closed loops
of data qubit operators unchanged, and there is no braid-induced interaction with the other
qubit hole. By contrast, logical operators that are built from open chains of data qubit operators
linking the two qubit holes end up leaving a loop of operators surrounding the other qubit hole.
The different braid outcomes arise because the first logical qubit is a Z-cut qubit, for which
54
SciPost Phys. Lect. Notes 49 (2022)
the X L operator is an open chain that interacts with the second qubit, while the second logical
qubit is an X-cut qubit, for which the Z L operator is an open chain that interacts with the first
qubit.
The braid is made of two move transformations that induce sign changes in the first qubit’s
logical operators, which appear as byproduct logical operators X L1 and Z L1 acting on the array
wavefunction, as was discussed for the one-cell and multi-cell moves. The braid transformation
also generates sign changes in the second qubit’s logical operators, even though that qubit is
not displaced during the braid. These sign changes generate the byproduct logical operators
X L2 and Z L2 acting on the array wavefunction.
We now turn to a discussion of the CNOT gate, and make clear why the transformations
we have detailed actually identify the braid as a CNOT between two logical qubits.
55
SciPost Phys. Lect. Notes 49 (2022)
Other combinations involving Y can be worked out using the identity Y = Z X ; hence
C † (Y ⊗ I) C = C † (Z X ⊗ I) C
= C † (Z ⊗ I) (X ⊗ I) C
= C † (Z ⊗ I) C C † (X ⊗ I) C
(112)
= (Z ⊗ I) (X ⊗ X )
= ZX ⊗ IX
= Y ⊗X .
We can therefore validate a CNOT implementation by verifying that it satisfies the four
relations given by Eqs. (107-110). However, these are precisely the four transformations that
we worked out for the braid, so indeed a braid is a CNOT.
Note that the full braid transformation, including all the operations on the physical data
qubits, involves a number of projective measurements and is therefore not unitary. However,
if we consider the effect of the braid on the product |Q〉|q L 〉, while the transformation of the
stabilized state |Q〉 is not unitary, the transformation of the logical state |q L 〉 is indeed a unitary
one.
Problem 17: Verify that the circuit in Fig. 40(a)-(c) works as promised.
56
SciPost Phys. Lect. Notes 49 (2022)
〉 control in
|+ 〉 target out |+ 〉
target in target in target out
Figure 40: (a) Logical CNOT between two Z-cut qubits. The control, target in, and the second
ancilla (in |+ L 〉) are all Z-cut qubits, while the first ancilla is an X-cut qubit. The logical CNOTs
are all between Z- and X-cut qubits, generated by braiding transformations. The measure
outcomes M Z and MX signal how the output state should be interpreted, as described in the
main text. (b) Simplified representation using braids, with black lines for Z-cut qubits and blue
(light) lines for the X-cut qubit. There are a pair of lines for each logical qubit, one line for
each qubit hole. The two lines join when a logical qubit is created or measured. (c) Even more
condensed representation. (d) Logical CNOT between two X-cut qubits. The control, target in,
and the first ancilla are all X-cut qubits, while the second ancilla is a Z-cut qubit. The logical
CNOTs are all between X- and Z-cut qubits, generated by braiding transformations with the
Z-cut as the control. The measure outcomes M Z and MX signal how the output state should
be interpreted. (e) Simplified representation, with black lines for the Z-cut qubits and blue
(light) for the X-cut qubit. (f) Even more simplified representation. Figure from Ref. (Fowler,
Mariantoni, Martinis and Cleland, 2012a).
In the Heisenberg representation, the Hadamard takes X to Z and vice versa, i.e.
H†X H = Z,
(114)
H†Z H = X.
A logical Hadamard is implemented in the surface code as shown in Figs. 41, 42 and 43;
see Ref. [59]. We start in Fig. 41 with an array of d = 7 logical qubits. Next we isolate the
57
SciPost Phys. Lect. Notes 49 (2022)
XL
ZL
Figure 41: Executing the logical Hadamard. The spacing and size of the Z-cut qubit holes
corresponds to a distance d = 7. The two holes in the center of the array form the logical
qubit that is the target for the logical Hadamard, and for which we display the X L and Z L
logical operators. The dashed box outlines the limits for what is shown in Figs. 42 and 43.
Figure from Ref. (Fowler, Mariantoni, Martinis and Cleland, 2012a).
58
SciPost Phys. Lect. Notes 49 (2022)
logical qubit in a separate patch of the 2D array, shown in Fig. 42a. The Z L operator loop is
transformed to a patch-crossing chain by multiplying it by a number of stabilizers in the patch.
By widening the ring that isolates the logical qubit into a “moat”, so that the moat engulfs
the two qubit holes, the logical qubit is transformed to a simple “patch” qubit as shown in
Fig. 42b-d, similar to the d = 5 array qubit we discussed earlier.
The key to the logical Hadamard is now implemented, by performing physical Hadamards
on all the data qubits in the patch; this exchanges the X L operator for Z L and vice versa, as
well as swapping the identities of the X and Z stabilizers (Fig. 42e). This however results
in a misalignment of the stabilizers in the patch with those in the larger 2D array, so we
then perform two swaps, from data qubit to measure qubit, then from measure qubit to data
qubit, shifting the patch by one stabilizer cell and realigning the stabilizers (Fig. 42f). The
two Z-cut holes are then recreated (Fig. 43g), positioned so that the Hadamard-transformed
X L chain ends on the internal boundary of each hole, and the Z L chain is multiplied by a set
of stabilizers that returns it to a loop around one of the qubit holes. The qubit holes are then
moved to realign them with their original positions (Fig. 43h-j), a move that is split into two
steps to preserve the array distance d. In the final step, the qubits are rejoined with the main
array (as in Fig. 41).
and
1 0
TL = . (116)
0 e iπ/4
The S L gate is also called the P or phase gate, and TL the π/8 gate.
As we will see, the circuit used to implement TL is probabilistic, and half the time generates
TL† . As you can easily check using Eq. (115), when this occurs TL† can be converted to TL by
application of an S L gate. TL can be similarly converted to TL† by application of S L , where
S L TL |ψ L 〉 = Z L TL† |ψ L 〉, and the Z L byproduct operator is handled in software.
A high-fidelity logical implementation of these two gates involves special ancilla states.
Implementing S L relies on the |YL 〉 ancilla state
1
|YL 〉 = p (|g L 〉 + i|e L 〉) , (117)
2
while implementing TL relies on the |A L 〉 ancilla state
1
|A L 〉 = p |g L 〉 + e iπ/4 |e L 〉 . (118)
2
The |YL 〉 and |A L 〉 ancilla states are created in a special “short qubit,” which can be put in an
arbitrary but concomitantly imperfect state, a process known as “state injection.” Once the
state has been injected, the “short qubit” is increased to the standard distance d to make it
less error-prone, and the imperfect logical state of the standard-distance qubit is then purified
by a high-fidelity process known as “magic distillation”, a process that can be found in the
59
SciPost Phys. Lect. Notes 49 (2022)
(a) (b)
XL
XL
ZL
ZL
(c) (d)
MX
XL XL
ZL ZL
MX
(e) (f)
ZL ZL
XL
XL
Figure 42: (a) In the first cycle, a ring of X stabilizers surrounding the target qubit is turned
off, and the bordering Z stabilizers reduced to three- and two-terminal measurements. The
data qubits within the ring are measured in the Z basis to maintain error tracking. This mea-
surement pattern is applied three times (see Ref. (Fowler, Mariantoni, Martinis and Cleland,
2012a)). (b) The Z L operator is multiplied by all the black outline Z stabilizers, transforming
Z L to the chain going from left to right. (c) In the next cycle, all X and Z stabilizers outside
the dashed box are turned off, creating a “moat” as in (d), eliminating the two qubit holes. In
the same cycle, all isolated data qubits are measured in Z, except those colored blue (light),
which are measured in the X basis to preserve error tracking. The other un-stabilized data
qubits do not need to be measured, as changes in their quantum states will be accounted for
later. (e) Before the next surface code cycle starts, a physical Hadamard is performed on all
data qubits, swapping X L and Z L . (f) Following the Hadamard, a pair of swaps is performed
between each patch data qubit and its neighboring measure qubits, first between each data
qubit and the measure qubit above it, then between each measure qubit and the data qubit to
its left. This shifts the patch by one stabilizer cell in the array, aligning the measure qubits.
The dashed box shows the location of the patch prior to these swaps. This sequence continues
in Fig. 43. Figure from Ref. (Fowler, Mariantoni, Martinis and Cleland, 2012a).
60
SciPost Phys. Lect. Notes 49 (2022)
(g) (h)
XL
XL
ZL
ZL
(i) (j)
XL XL
ZL ZL
Figure 43: (continued from Fig. 42) (g) In the next surface code cycle, most of the X and Z
stabilizers are turned back on, leaving two Z-cut enlarged holes and a ring, one stabilizer cell
wide, isolating the 2D patch from the array, as in (a). The Z-cut holes are positioned so that
the X L chain ends on the internal boundary of each hole. The Z L chain (dashed red line) is
multiplied by all the black outline Z stabilizers, leaving a Z L loop (solid red line) that encloses
the right Z-cut hole. (h) In the subsequent surface code cycle, and the first step of returning the
Z-cut holes to original locations, the Z-cut holes are expanded and Z L and X L modified accord-
ingly. This move is split in two steps to preserve the distance d during this process; the process
pauses here for d surface code cycles to establish all values in time. (i) In the second step of
returning the Z-cut holes to their original locations, the Z-cuts are expanded to encompass the
original positions. The stabilizer measurements are performed twice. (j) In the final step, the
cuts are reduced to their original size, as in Fig. 41. This stabilizer measurement pattern is ap-
plied three times (see Ref. Ref. (Fowler, Mariantoni, Martinis and Cleland, 2012a)). Following
this, the isolated patch is reconnected by turning on the appropriate stabilizers. Figure from
Ref. (Fowler, Mariantoni, Martinis and Cleland, 2012a).
literature. The S L and TL gates are then implemented with circuits using logical CNOTs and
Hadamards involving these ancilla states, as shown in Fig. 44 and Fig. 45, respectively.
The S L gate implementation shown in Fig. 44 involves two logical CNOTs and two logical
Hadamard operations. An input state |ψ L 〉 in one logical qubit is deterministically transformed
into S L |ψ L 〉 by interacting with the ancilla qubit in the |YL 〉 state. This can be most easily seen
by testing the circuit with the input state |ψ L 〉 = α|g〉 + β|e〉.
To instead apply S †L , we use the identity S †L = Z L S L , which means we use the circuit shown
in Fig. 44 and have a byproduct Z L appear on the output, in other words |ψ L 〉 transforms to
Z L (S †L |ψ L 〉).
Problem 19: Show that the circuit in Fig. 44 performs an S operation as claimed.
61
SciPost Phys. Lect. Notes 49 (2022)
Figure 44: Logic circuit p that implements the S L gate. The circuit uses the ancilla state
|YL 〉 = (|g L 〉 + i|e L 〉)/ 2, on which two controlled logical CNOTs and two logical Hadamards
are performed, resulting in the input state |ψ L 〉 being transformed to S L |ψ L 〉. Note that as
S †L = Z L S L , the same circuit transforms |ψ L 〉 to Z L S †L |ψ L 〉 where Z L is a byproduct operator.
Figure from Ref. (Fowler, Mariantoni, Martinis and Cleland, 2012a).
The TL gate is implemented with the non-deterministic circuit shown in Fig. 45. Given the
input ancilla state |θ L 〉 = |g L 〉 + e iθ |e L 〉, the output |φ L 〉 of this circuit is
p
|φ L 〉 = X L Z R Z ((−1) pZ θ ) |ψ L 〉 . (119)
The first operator is a byproduct operator, whose power p Z is equal to 0(1) if the Z L measure-
ment M Z of the logical qubit state is +1(−1). The second operator is a rotation by the angle
θ,
1 0
R Z (θ ) = . (120)
0 e iθ
For the TL gate, the rotation angle is θ = +π/4(−π/4) depending on the sign +1(−1) of the
Z L measurement.
Approximately half of the times we run the circuit we will succeed in generating TL |ψ L 〉,
heralded by the measurement M Z = +1. However, the other times we run the circuit the
measurement M Z = −1 will herald the output state
In this case we fix the output using S L TL† = TL . There is a slight complication if there are
byproduct X L or Z L operators; here we assume there are no byproduct operators. The correc-
tion to the output is achieved by applying S L to |φ L 〉:
S L |φ L 〉 = S L (X L TL† |ψ L 〉)
= X L S †L TL† |ψ L 〉
(122)
= X L (Z L S L )TL† |ψ L 〉
= (X L Z L )TL |ψ L 〉 ,
where we use the identity S L X L = i X L S †L and drop the unimportant phase factor of i. Hence
passing the output state |φ L 〉 through the S L circuit gives the result (X L Z L )TL |ψ L 〉, where X L Z L
are byproduct operators that are handled by the control software.
If we need to perform TL† , we use the circuit in Fig. 45, and about half the time we will
get the measurement outcome M Z = −1, which indicates the circuit produced X L TL† , which
is the desired output (with a byproduct operator X L ). The other half of the time we get the
measurement outcome M Z = +1, and we can correct the circuit output TL |ψ L 〉 by applying
S L , as S L TL = Z L TL† ; this is done using the S L circuit, with the output including the byproduct
operator Z L that is handled by the control software.
62
SciPost Phys. Lect. Notes 49 (2022)
IL
AL SL T
XLZL L
Figure 45: Logic circuit p for the TL gate. The circuit uses the ancilla state
|A L 〉 = (|g L 〉 + e iπ/4
|e L 〉)/ 2, which is used to control a CNOT on the target state |ψ L 〉, trans-
forming the ancilla to the output state |φ L 〉. The CNOT target state is measured along Z L ,
resulting in a projective, probabilistic outcome. Following this, the CNOT control qubit is pro-
cessed by a conditional S L gate: If the Z L measurement M Z yields a +1 outcome, the output
state is the desired one, |φ L 〉 = TL |ψ L 〉, and the S L gate is not applied. If however the mea-
surement yields a −1 outcome, the output is |φ L 〉 = X L TL† and the S L gate is applied, resulting
in the output X L Z L TL |ψ L 〉. Note the double lines represent the classical measurement data
with a probabilistic outcome, with these data controlling the S L gate. The bracketed operators
in the output correspond to M Z = +1 (I L ) and M Z = −1 (X L Z L ). Figure from Ref. (Fowler,
Mariantoni, Martinis and Cleland, 2012a).
We leave some important topics for the interested reader to learn about in the literature,
including the methods in the surface code for generating high-precision |A L 〉 and |YL 〉 states
using magic distillation circuits, to the level of precision as needed for whatever problem is at
hand.
16 Conclusion
We have now covered all the basic aspects of the surface code approach to quantum comput-
ing. We have described all the gates that are required to implement e.g. Shor’s algorithm or
Grover’s search algorithm. The discussion has been mostly theoretical, while the motivation
for developing the surface code is of course to find a realistic and practical physical implemen-
tation for a quantum computer. There are a number of physical systems in which this scheme
could in principle be implemented, ranging from cold atoms [60, 61] and ions [62–64], to
semiconductor-based approaches [65], to superconducting integrated circuits [66–71]. Each
of these systems has certain advantages and certain disadvantages. For any system to be a can-
didate for a surface code implementation, it must of course meet the requirements for single-
qubit and two-qubit gate and measurement fidelities, which is not true for any system to date,
although a number of systems are close to these requirements. The surface code clearly also
requires a very large number of physical qubits (of order 108 is probably the smallest number
needed for a practical factoring computer), so a separate requirement is the ability to assemble
and integrate a large number of nominally identical qubits. Furthermore, the operation and
error detection of the surface code assumes classical logic support, with the classical logic op-
erating significantly faster than the qubits, in order that state preparation, qubit interactions,
and error tracking can be maintained with a high level of fidelity.
An outstanding challenge for experimentalists, at this point, is to show the ability to assem-
ble large (of order 100) numbers of high-fidelity qubits, and then to demonstrate that one or
two cycles of error detection of the type used in the surface code can actually be implemented
in a way that improves the effective qubit lifetimes. If this can be achieved, then one can
begin to consider scaling up; it may be possible, using of order 1000 qubits, to demonstrate
significant extensions of the lifetime of the logical qubits defined in this array compared to the
lifetime of the underlying physical qubits. The lifetime of the logical qubits can then hopefully
63
SciPost Phys. Lect. Notes 49 (2022)
References
[1] A. Y. Kitaev, Quantum error correction with imperfect gates, in O. Hirota, A. S. Holevo
and C. M. Caves, eds., Quantum communication, computing and measurement, Plenum
Publishing Corporation, New York, US, ISBN 9780306456855 (1997).
[2] A. Yu Kitaev, Quantum computations: Algorithms and error correction, Russ. Math. Surv.
52, 1191 (1997), doi:10.1070/RM1997v052n06ABEH002155.
[3] A. Yu. Kitaev, Fault-tolerant quantum computation by anyons, Ann. Phys. 303, 2 (2003),
doi:10.1016/S0003-4916(02)00018-0.
[4] S. B. Bravyi and A. Y. Kitaev, Quantum codes on a lattice with boundary, (1998),
doi:10.48550/arXiv.quant-ph/9811052.
[5] M. H. Freedman and D. A. Meyer, Projective plane and planar quantum codes, Found.
Comput. Math. 1, 325 (2001), doi:10.1007/s102080010013.
[6] E. Dennis, A. Kitaev, A. Landahl and J. Preskill, Topological quantum memory, J. Math.
Phys. 43, 4452 (2002), doi:10.1063/1.1499754.
[11] D. S. Wang, A. G. Fowler and L. C. L. Hollenberg, Surface code quantum computing with
error rates over 1%, Phys. Rev. A 83, 020302 (2011), doi:10.1103/PhysRevA.83.020302.
64
SciPost Phys. Lect. Notes 49 (2022)
[16] A. G. Fowler, D. S. Wang and L. C. L. Hollenberg, Surface code quantum error cor-
rection incorporating accurate error propagation, Quant. Inf. Comput. 11, 8 (2011),
doi:10.26421/QIC11.1-2-2.
[17] G. Duclos-Cianci and D. Poulin, Fast decoders for topological quantum codes, Phys. Rev.
Lett. 104, 050504 (2010), doi:10.1103/PhysRevLett.104.050504.
[20] J. R. Wootton and D. Loss, High threshold error correction for the surface code, Phys. Rev.
Lett. 109, 160503 (2012), doi:10.1103/PhysRevLett.109.160503.
[24] A. J. Landahl, J. T. Anderson and P. R. Rice, Fault-tolerant quantum computing with color
codes, (2011), doi:10.48550/arXiv.1108.5738.
[25] P. Sarvepalli and R. Raussendorf, Efficient decoding of topological color codes, Phys. Rev. A
85, 022317 (2012), doi:10.1103/PhysRevA.85.022317.
[26] P. W. Shor, Polynomial time algorithms for discrete logarithms and factoring on a quantum
computer, in Algorithmic number theory: First international symposium ANTS-I, Springer
Berlin Heidelberg, Berlin, Heidelberg, ISBN 9783540586913 (1994), doi:10.1007/3-
540-58691-1_68.
65
SciPost Phys. Lect. Notes 49 (2022)
[28] S. Bravyi and A. Kitaev, Universal quantum computation based on a magic states distilla-
tion, (2004), doi:10.48550/arXiv.quant-ph/0403025.
[29] B. W. Reichardt, Quantum universality from magic states distillation applied to CSS codes,
Quant. Inf. Proc. 4, 251 (2005), doi:10.1007/s11128-005-7654-8.
[30] E. T. Campbell and D. E. Browne, On the Structure of Protocols for Magic State Distillation,
in lecture notes in computer science 5906 theory of quantum computation, communica-
tion and cryptography 4th workshop, Springer Berlin Heidelberg, ISBN 9783642106972
(2009), doi:10.1007/978-3-642-10698-9_3.
[31] J. Koch et al., Charge-insensitive qubit design derived from the Cooper pair box, Phys. Rev.
A 76, 042319 (2007), doi:10.1103/PhysRevA.76.042319.
[32] R. Barends et al., Superconducting quantum circuits at the surface code threshold for fault
tolerance, Nature 508, 500 (2014), doi:10.1038/nature13171.
[34] C.-Y. Lu, W.-B. Gao, O. Gühne, X.-Q. Zhou, Z.-B. Chen and J.-W. Pan, Demonstrating any-
onic fractional statistics with a six-qubit quantum simulator, Phys. Rev. Lett. 102, 030502
(2009), doi:10.1103/PhysRevLett.102.030502.
[36] G. Feng, G. Long and R. Laflamme, Experimental simulation of anyonic fractional statis-
tics with an NMR quantum-information processor, Phys. Rev. A 88, 022305 (2013),
doi:10.1103/PhysRevA.88.022305.
[37] A. J. Park, E. McKay, D. Lu and R. Laflamme, Simulation of anyonic statistics and its
topological path independence using a seven-qubit quantum simulator, New J. Phys. 18,
043043 (2016), doi:10.1088/1367-2630/18/4/043043.
[41] Z Chen et al., Exponential suppression of bit or phase errors with cyclic error correction,
Nature 595, 383 (2021), doi:10.1038/s41586-021-03588-y.
[42] K. J. Satzinger et al., Realizing topologically ordered states on a quantum processor, Science
374, 1237 (2021), doi:10.1126/science.abi8378.
[43] J. F. Marques et al., Logical-qubit operations in an error-detecting surface code, Nat. Phys.
18, 80 (2021), doi:10.1038/s41567-021-01423-9.
66
SciPost Phys. Lect. Notes 49 (2022)
[44] S. Krinner et al., Realizing repeated quantum error correction in a distance-three surface
code (2021), doi:10.48550/arXiv.2112.03708.
[45] Y. Zhao et al., Realization of an error-correcting surface code with superconducting qubits,
(2021), doi:10.48550/arXiv.2112.13505.
[46] J. Kelly et al., State preservation by repetitive error detection in a superconducting quantum
circuit, Nature 519, 66 (2015), doi:10.1038/nature14270.
[47] C. D. Wilen et al., Correlated charge noise and relaxation errors in superconducting qubits,
Nature 594, 369 (2021), doi:10.1038/s41586-021-03557-5.
[48] J. M. Martinis, Saving superconducting quantum processors from decay and corre-
lated errors generated by gamma and cosmic rays, npj Quant. Inf. 7, 90 (2021),
doi:10.1038/s41534-021-00431-0.
[49] M. McEwen et al., Resolving catastrophic error bursts from cosmic rays in large arrays of
superconducting qubits, Nat. Phys. 18, 107 (2021), doi:10.1038/s41567-021-01432-8.
[51] D. Howard, Einstein on locality and separability, Stud. Hist. Phil. Sci. 16, 171 (1985),
doi:10.1016/0039-3681(85)90001-9.
[52] M. A. Nielsen and I. L. Chuang, Quantum computation and quantum information, Cam-
bridge University Press, Cambridge, UK, ISBN 9781107002173 (2000).
[53] G. Chaucer, The canterbury tales, Oxford University Press, Oxford, UK, ISBN 0199535620
(1476).
[54] J. Edmonds, Paths, trees, and flowers, Can. J. Math. 17, 449 (1965), doi:10.4153/CJM-
1965-045-4.
[55] J. Edmonds, Maximum matching and a polyhedron with 0,1-vertices, J. Res. Nat. Bur.
Standards 69B, 125 (1965).
[56] A. G. Fowler, Analytic asymptotic performance of topological codes, Phys. Rev. A 87, 040301
(2013), doi:10.1103/PhysRevA.87.040301.
[57] J. J. Sakurai, Modern quantum mechanics, Addison Wesley, Boston, US, ISBN 0201539292
(1994).
[60] I. Bloch, J. Dalibard and W. Zwerger, Many-body physics with ultracold gases, Rev. Mod.
Phys. 80, 885 (2008), doi:10.1103/RevModPhys.80.885.
[61] I. Bloch, J. Dalibard and S. Nascimbène, Quantum simulations with ultracold quantum
gases, Nat. Phys. 8, 267 (2012), doi:10.1038/nphys2259.
[62] D. Leibfried, R. Blatt, C. Monroe and D. Wineland, Quantum dynamics of single trapped
ions, Rev. Mod. Phys. 75, 281 (2003), doi:10.1103/RevModPhys.75.281.
67
SciPost Phys. Lect. Notes 49 (2022)
[63] R. Blatt and D. Wineland, Entangled states of trapped atomic ions, Nature 453, 1008
(2008), doi:10.1038/nature07125.
[64] D. Kielpinski, C. Monroe and D. J. Wineland, Architecture for a large-scale ion-trap quan-
tum computer, Nature 417, 709 (2002), doi:10.1038/nature00784.
[65] M. A. Eriksson et al., Spin-based quantum dot quantum computing in silicon, Quant. Inf.
Process. 3, 133 (2004), doi:10.1007/s11128-004-2224-z.
[68] J. Q. You and F. Nori, Superconducting Circuits and Quantum Information, Physics Today
58, 42 (2005), doi:10.1063/1.2155757.
[69] J. Clarke and F. K. Wilhelm, Superconducting quantum bits, Nature 453, 1031 (2008),
doi:10.1038/nature07128.
[70] R. J. Schoelkopf and S. M. Girvin, Wiring up quantum systems, Nature 451, 664 (2008),
doi:10.1038/451664a.
[71] D. P. DiVincenzo, Fault-tolerant architectures for superconducting qubits, Phys. Scr. T137,
014020 (2009), doi:10.1088/0031-8949/2009/T137/014020.
68