PRXQuantum 5 010348
PRXQuantum 5 010348
(Received 4 October 2023; revised 16 February 2024; accepted 27 February 2024; published 20 March 2024)
Error corrected quantum computers have the potential to change the way we solve computational prob-
lems. Quantum error correction involves repeated rounds of carefully scheduled gates to measure the
stabilizers of a code. A set of scheduling rules is typically imposed on the order of gates to ensure that
the circuit can be rearranged into an equivalent circuit that can be easily seen to measure the stabiliz-
ers. In this work, we ask what would happen if we break these rules and instead use circuit schedules
that we describe as tangled. We find that tangling schedules generates long-range entanglement not
accessible using nearest-neighbor two-qubit gates. Our tangled-schedule method provides a new tool for
building quantum error-correction circuits and we explore applications to design new architectures for
fault-tolerant quantum computers. Notably, we show that, for the widely used Pauli-based model of com-
putation (achieved by lattice surgery), this access to longer-range entanglement can reduce the device
connectivity requirements, without compromising on circuit depth.
DOI: 10.1103/PRXQuantum.5.010348
010348-2
TANGLING SCHEDULES FOR QEC PRX QUANTUM 5, 010348 (2024)
|+ X m |+ X m
P1 P1
P2 P2
=
P3 P3
.. ..
.
.
. .
..
..
Pm Pm
FIG. 2. Two auxiliary circuits for measuring the stabilizer P1 P2 · · · Pj using an auxiliary qubit prepared in the |+ state. The cir-
cuits differ only in their schedules and, assuming that no other circuits are executed simultaneously, the two are equivalent. The
measurements are in the X basis.
We call this the auxiliary syndrome-extraction circuit of g Figs. 15b–15c of Ref. [14], and we also depict two exam-
(see also Fig. 2). Once we have the auxiliary circuit, we ples in Fig. 3.
can compile it to the native gate set of the physical device
[e.g., using only the controlled-Z gate (CZ) as the native
two-qubit gate]. The auxiliary syndrome-extraction circuit III. OUR METHOD
is a standard tool, often used to measure the stabilizers of Now, we are ready to introduce our tangled-schedule
the surface code. We note that, for weight-w stabilizers, technique. We say that the circuits Cj and Ck are tan-
a single-qubit error on the auxiliary qubit can propagate gled if condition (a) is satisfied but condition (b) is not.
to w/2 data qubits (up to stabilizer equivalence) and so, We show that if {Cj }m j =1 contains tangled pairs that sat-
for high-weight stabilizers, it is often modified to use more isfy certain conditions (detailed below), and we change the
auxiliary qubits (e.g., flag qubits) for syndrome extraction. bases of measurements in their combined circuit C , then
Next, consider a set of stabilizers {gj }m j =1 . The commu- the resulting circuit C˜ measures the product h = g1 · · · gm .
tation relations ensure that, in theory, they can be measured Since, in this case, operators gj are no longer stabilizers
simultaneously. This is indeed the case; however, there are themselves, we emphasize this by calling them component
additional restrictions on the schedules. Let us consider operators instead. We start by explaining how this proto-
a schedule fj for each stabilizer gj , defining the auxil- col works for a product of two component operators. Then,
iary syndrome-extraction circuits {Cj }m j =1 . We assume that
they have the same depth, i.e., number of layers including
those with identity gates, and that we use different auxiliary
g1
qubits for different stabilizers. If we combine these circuits, (a) (b)
2 3
so that they all occur simultaneously, the resulting circuit, 1
1 2 1 2
which we denote by C , then has to satisfy the following 1
2
conditions to achieve the desired behavior. 3 4 3 4 4
4 3
g1 g2 g2
(a) No qubit is involved in more than one gate at a time.
(b) For every pair of distinct circuits j = k, the simulta-
neous combination of Cj and Ck is equivalent to the FIG. 3. Examples of schedules for pairs of stabilizers that
serial execution Cj followed by Ck . satisfy condition (b). Panel (a) displays the scheduling that mea-
sures stabilizers g1 = XXXXII and g2 = IIZZZZ and panel (b)
These conditions are equivalent to the following more the scheduling that measures stabilizers g1 = XXXXI and g2 =
formal statements. IZXZX . The coloring of qubits and plaquettes in this figure is
used throughout the paper. Stabilizer X - and Z-Pauli terms are
(a’) For every time step index i and every pair of distinct colored red and blue, respectively. A continuous colored area
indicates a single stabilizer, with the black circles on the edge
schedules j = k, we have fj −1 (i) ∩ fk −1 (i) = ∅.
j j
representing data qubits and the green circle within the shape
(b’) Let gj = P1 P2 · · · and gk = P1k P2k · · · , and consider the auxiliary qubit used for measurement of the stabilizer. Each
j
the set Kj,k of anticommuting pairs {Pα , Pβk } = 0. Then number between a pair of data and auxiliary qubits indicates
we require that fj (α) < fk (β) for an even number of these the layer in which the corresponding entangling gate between
anticommuting pairs. the two qubits is applied during syndrome extraction. In both
examples, there are two joint qubits where the Pauli terms differ;
specifically, for g1 , these are the X and, for g2 , they are the Z. We
The equivalence of (b) and (b’) can be seen, for instance, therefore either need to apply the two CX gates for g1 before we
by using the interchanging identity depicted in Fig. 5(a) apply the CZ gates for g2 , or the other way around. Otherwise, we
below. Conditions (a) and (b) are illustrated in, e.g., would not measure the two desired stabilizers.
010348-3
GEHÉR, CRAWFORD, and CAMPBELL PRX QUANTUM 5, 010348 (2024)
√ √
g1 qubit 1 and g1 = (I + ig1 )/ 2, then on the data qubits
(a) (b) 2 4 we have the postmeasurement state. Therefore, C˜ measures
1
2 1 4 3 1 the stabilizer h = g1 g2 . We also see that, if we execute
3 4 1 2
2 this circuit twice, the two Clifford corrections combine into
3
3 4 a Pauli correction that can be tracked in software. These
g1 g2 g2 circuits are illustrated in Figs. 6 and 7.
Next, we prove that C˜ indeed measures the product g1 g2 .
FIG. 4. Examples of schedules that violate condition (b) and Note the (multiplicative) commutator rules
hence the combined circuits do not measure g1 and g2 . How-
ever, we can exploit this to measure the higher-weight product, [CXc1 ,t , CYc2 ,t ] = [CXc1 ,t , CZc2 ,t ] = [CYc1 ,t , CZc2 ,t ] = CZc1 ,c2
h = g1 g2 . Panel (a) displays the tangled scheduling that measures
the stabilizer h = g1 g2 = −XXYYZZ and panel (b) the tangled
(1)
scheduling that measures the stabilizer h = g1 g2 = −XYIYX .
For an explanation of the different parts of the diagrams, see depicted in Fig. 5(a). In other words, interchanging the
Fig. 3; however, here, each continuous colored area indicates a order of two noncommuting controlled-Pauli gates has the
single component operator. effect of entangling the control qubits with a CZ gate.
This entangling of auxiliary qubits is the main feature of
schedule tangling that we exploit, as shown in Fig. 6.
we state the general method involving an arbitrary number Before proceeding, we prove the circuit pruning identity,
of component operators. shown in Fig. 5(b). We define Ci (gj ) to be a controlled-
Let us assume that g1 and g2 are two component opera- gj gate with qubit i as the control. Using |φ to describe
tors that commute, and call their auxiliary qubits 1 and 2, the initial state of all qubits except the first auxiliary qubit
respectively. Without loss of generality (i.e., by applying (qubit 1), we have
local Clifford equivalence), we may assume that the Pauli
terms of g1 are all of X type, and those Pauli terms of g2 1
that anticommute with any Pauli term of g1 are of Z type. | = CZ1,2 C1 (g1 ) |+1 |φ = √ (|01 + |11 Z2 g1 ) |φ .
2
Note that, as the components commute, the number of (2)
qubits where the Pauli terms anticommute is even. Let us
assume that we scheduled g1 , g2 in a tangled way, i.e., con-
dition (a) is satisfied but condition (b) is not; see Fig. 4 for Performing a measurement in the Y basis on qubit 1
two examples. Now, we claim that if we combine the two √ by m = |im 1 im |1 ,
with outcome m leads to a projection
auxiliary syndrome extractions C1 , C2 and replace the X - where |im := (|0 + i(−1) |1)/ 2. The final state is
m
(b) |+ Y m
Zm S
(a)
equals
g1 g1 I − ig
√ 1 g1m
2
= ..
.
..
.
..
.
FIG. 5. Circuit identities used to analyze tangled schedules. (a) Interchanging rule for noncommuting entangling CX and CZ gates.
Similar rules hold for CX, CY and CY, CZ gate pairs, provided they share the target qubit. (b) The circuit pruning identity for removing
an entangled auxiliary qubit. In the text, we label the top qubit 1 and the next-to-top qubit 2. The blue boxes indicate Clifford cor-
rections. Note that only the Pauli terms depend on the measurement outcome m, so that the (non-Pauli) Clifford term can be applied
nonadaptively and the Pauli correction can also be handled nonadaptively by Pauli frame tracking. An application of this identity is
Fig. 6.
010348-4
TANGLING SCHEDULES FOR QEC PRX QUANTUM 5, 010348 (2024)
|+ Y m1 |+ Y m1
|+ Y m2 |+ Y m2
√ √
g1m1 g1 equals g1m1 g1
g1 = X ⊗ X ⊗ X ⊗ X ⊗ I ⊗ I
g2 = Z ⊗ I ⊗ I ⊗ Z ⊗ Z ⊗ Z
FIG. 6. Circuit for measuring g1 g2 = −XXYYZZ with the outcome given by m1 ⊕ m2 . Left: a circuit requiring low connectivity to
measure the product g1 g2 by violating the (b) condition. This uses the schedule in Fig. 4(a). Right: an equivalent circuit that shows
direct entanglement of auxiliary qubits. In both cases, there is a Clifford correction to achieve the desired postmeasurement state. After
two rounds of the protocol, the Clifford correction becomes a Pauli correction, as shown in Fig. 7.
cacy of our tangled-schedule technique in the case of a correction (I − ig1 )† g1 1 / 2 on the data qubits. There-
two-component stabilizer. Given two auxiliary qubits, 1 fore, after two rounds, the full correction becomes Pauli.
and 2, that have been entangled by a tangled schedule, Indeed, a simple calculation shows that the full correc-
m +n +1
with component operators g1 and g2 , the state prior to tion after the second round is g1 1 1 , where n1 , n2 are
measurement is the measurement outcomes in the second round; see also
Fig. 7.
Having proved the simplest example, we now describe
| = CZ1,2 C1 (g1 )C2 (g2 ) |+1 |+2 |ψ , (5) our general protocol for measuring products of sets of
pairwise commuting component operators.
where |ψ denotes the initial state on the data qubits. Using
the pruning identity [Fig. 5(b)] with qubit 1 as the first aux- Theorem 1. Consider a set of pairwise commuting Pauli
iliary qubit and obtaining measurement outcome m1 , we product operators {gj }m j =1 and a scheduling {fj }j =1 for
m
find that the state on the remaining qubits is each that defines their auxiliary syndrome-extraction cir-
cuits {Cj }m
j =1 . Denote by C the combined circuit. Compose
an (undirected) graph G = (V, E), where V = [1, . . . , m]
1 m m and (j , k) ∈ E if and only if the schedules fj and fk are
| = √ S2 Z2 1 C2 (g1 )C2 (g2 ) |+2 (I − ig1 )g1 1 |ψ
2 tangled. Suppose further that G is a forest whose con-
m
= 12 (|02 + i(−1)m1 |12 g1 g2 )(I − ig1 )g1 1 |ψ . (6) nected (tree) components are T1 , . . . , T . Then there exists
a modification of C where
Now, measuring out qubit 2 in the Y basis with outcome (a) we modify the single-qubit Pauli measurements on
m2 leads to a projection |im2 im2 |2 . Therefore, we obtain the auxiliary qubits, and
the state (b) we apply a Clifford correction on the data qubits,
010348-5
GEHÉR, CRAWFORD, and CAMPBELL PRX QUANTUM 5, 010348 (2024)
|+ Y
m1 |+ Y n1
Y Y
|+ m2 |+ n2
g11+n1 +m1
FIG. 7. Circuit for two rounds of measuring g1 g2 = −XXYYZZ with the outcomes given by m1 ⊕ m2 and n1 ⊕ n2 . The Clifford
1+m +n
correction from the one-round circuit in Fig. 6 has become a Pauli correction g1 1 1 that does not need to be physically implemented
(removing the need for fast feedback) and can instead be accounted for by Pauli frame tracking.
010348-6
TANGLING SCHEDULES FOR QEC PRX QUANTUM 5, 010348 (2024)
|i
2 1 2 1 4 4 2 1 2 1 4 4
1
MY MY MY MY
3 4 3 4 3 2 3 4 3 4 3 1 2
2
FIG. 8. Measuring an elongated XXXX stabilizer (a) using our FIG. 9. Measuring a twist-defect XXYXX stabilizer (a) using
method that requires only a degree-4 connectivity device and (b) our method that requires only a degree-4 connectivity device and
using the method of Ref. [16] that requires a degree-6 connec- (b) using the method of Ref. [16] that requires a degree-6 con-
tivity device. With our method, we initialize the two (accessory) nectivity device. With our method, we initialize one (accessory)
qubits in the middle in the Y basis (in purple), then measure the qubit in the middle in the Y basis (in purple), then measure the
product XXXXII · IIZZXX = −XXYYXX of the two plaquettes product XXXXII · IIZZXX = −XXYYXX of the two plaquettes
by using schedules that do not satisfy condition (b). The clas- by using schedules that do not satisfy condition (b). The clas-
sically flipped outcome of this measurement is then the outcome sically flipped outcome of this measurement is then the outcome
corresponding to the elongated rectangle. Here and in the rest of corresponding to the twist defect.
the paper, the green color on the plaquettes indicates a Y-Pauli
term in the operator we measure.
layer of their combined circuit C , instead of measuring
the auxiliary qubits in X bases, we measure them in Y
possible using only local stabilizers, but XX and ZZ lattice bases, resulting in the circuit C˜. It follows from Theorem
surgeries require long-range stabilizers, we say that they 1 that the sum of these two outcomes is the measure-
are antialigned. ment outcome corresponding to the weight-6 product, in
To enable arbitrary logical X -Z Pauli measurements, our example −XXYYXX . Since we initialized the accessory
we can use elongated rectangles to effectively change qubit(s) in the Y basis, we effectively measured the weight-
the background lattice, thereby enabling arbitrary twist- 4 elongated rectangle XXIIXX or the weight-5 twist defect
free lattice surgery. An example of an elongated rectangle XXIYXX .
is shown in Fig. 8, where we have six data qubits in Note that, after one round, we require a Clifford correc-
a 2 × 3 arrangement on which we measure a weight-4 m √
tion (1 − ig1 )† g1 1 / 2, where g1 = XXXXII . Therefore,
Pauli product supported on the leftmost two and right- without physically applying the correction, the weight-1
most two qubits. The other type of long-range stabilizers, stabilizer IIYIII on the accessory qubit becomes a weight-4
twist defects, are weight-5 stabilizers that enable the merg- stabilizer
ing of a patch with others along both its X and Z logical
sides, thereby enabling Y measurement on the patch. Twist 1 m1 m
g (1 − ig1 ) · IIYIII
2 1
· (1 + ig1 )g1 1
defects, together with elongated rectangles, are needed for
general twist-based lattice surgery. An example is shown in = 12 (XXXXII )m1 (1 − iXXXXII ) · IIYIII
Fig. 9. We have the same 2 × 3 arrangement of data qubits · (1 + iXXXXII )(XXXXII )m1
on which we wish to measure a weight-5 Pauli product
where the Pauli term in the middle is a Y. = (−1)m1 XXZXII . (8)
In order to measure these long-range stabilizers on a
degree-4 connectivity device, we start with two commut- Thus, at this point, measuring any accessory qubit would
ing local weight-4 component operator plaquettes that destroy the postmeasurement state. However, if we do
share two joint data qubits. On each joint qubit, one com- another round of tangled syndrome extraction, we have
m +n +1
ponent operator has X -Pauli terms, while the other has Z. only a Pauli correction g1 1 1 and so the weight-1
For instance, in Figs. 8(a) and 9(a), these are an XXXX and stabilizer IIYIII becomes
a ZZXX plaquette. We also initialize in the Y basis those
data qubits in the middle on which our stabilizer is not (−1)m1 +n1 +1 IIYIII . (9)
supported; we have two of these for elongated rectangles,
and one for twist defects. We call these qubits acces- Therefore, measuring the accessory qubit in the Y basis
sory qubits. Next, we schedule the syndrome-extraction now does not harm the postmeasurement state correspond-
circuits of the two plaquettes in a way that violates con- ing to the elongated rectangle or twist defect. Moreover,
dition (b), thereby tangling them. Furthermore, at the last this outcome is deterministic, m1 + n1 + 1, under noiseless
010348-7
GEHÉR, CRAWFORD, and CAMPBELL PRX QUANTUM 5, 010348 (2024)
execution, and so can be used for error detection during memory, we fixed the physical error rate to be p = 10−3
syndrome extraction. This additional deterministic mea- and performed syndrome extraction for two rounds. Note
surement outcome can be used in decoding and therefore that 2 is the minimum number of rounds in the tangled case
provides extra information about where errors may have due to the Clifford nature of the correction after odd num-
occurred; more details can be found in Appendix A 3. bers of rounds. In the case of stability, we ran experiments
on three patches for four, six and eight rounds, and var-
ied the physical error rate between p = 1.767 × 10−3 and
V. NUMERICAL RESULTS 10−2 .
In this section, we compare the QEC performances
of two types of rotated planar code patches: the default A. Numerical comparison of default and tangled
patches where each stabilizer is local, and their tangled quantum memory simulations
versions where some stabilizers are replaced by elongated
rectangles. We first present our results for quantum mem- A default rotated planar code depends on two parame-
ory and then for the stability experiment [22]. Recall that, ters, namely, the minimal numbers of X - and Z-type data
in quantum memory, the minimum-weight logical error is qubit errors that lead to a logical failure, which we call
spacelike (composed of errors on qubits), while in the sta- the X and Z distances, respectively. We choose to place
bility experiment it is timelike (composed of errors that the planar code in such a way that the horizontal edges
cause measurement failures). Hence, the stability experi- of the patch are of Z type, and hence the logical Z oper-
ment can be used as a prototype to estimate the logical ator is vertical; see Figs. 10(a) and 10(c). Therefore, the
failure rate in an experiment where timelike errors are height h of a patch is equal to its Z distance dzdef , while
an additional source of logical failure, such as in lattice its width w coincides with its X distance dxdef . To extract
surgery or patch moving. the syndromes for the default rotated planar code, we use
For each experiment, we constructed a circuit in terms the usual N- and Z-shaped schedules with four layers of
of the following gates: Z-basis reset; Z-basis measurement; entangling gates. More precisely, the N-shaped schedule is
CZ gate; Hadamard gate, H ; and a variant of the Hadamard
that used for red plaquettes in, e.g., Fig. 10(a), while the
gate that swaps the Y and Z eigenstates (instead of X and Z-shaped schedule is that used for blue plaquettes. Note
Z), HYZ . These circuits can be found in Ref. [24]. The noise that the minimum numbers of fault locations that lead to
model we use is parametrized by p, the physical error rate, a logical error during X - and Z quantum memory using a
and we apply the following noise operations: particular set of schedules are called the effective Z and
X distances, respectively. It is well known that, with the
(a) two-qubit depolarizing channel with strength p after N-Z-shaped schedules, the default patch has the effective
each CZ gate, distances h and w; see, e.g., Ref. [31].
(b) each measurement outcome is flipped classically Two examples of tangled rotated planar codes are shown
with probability p, in Figs. 10(b) and 10(d). Note that, even though we use
(c) one-qubit gates, reset, and measurement are each one additional row of qubits for the tangled case, we still
followed by one-qubit depolarizing channels with use the same number of stabilizers in the vertical direc-
strength p/10, tion and hence we say that the height of the tangled patch
(d) on each idling qubit in each layer, we apply a one- is h instead of h + 1. The scheduling we use for the tan-
qubit depolarizing channel with strength p/10. gled version is also shown. The reader may notice that we
apply four entangling gates on data and accessory qubits in
This noise model captures the idea that, at least for super- the bulk; however, we apply entangling gates in five lay-
conducting hardware [25], the most noisy operations are ers instead of four. Indeed, after an extensive search, we
measurements and two-qubit gates. concluded that a scheduling for the tangled version with
We used stim [26] to obtain samples from the noisy four entangling layers that does not propagate X - or Z-type
circuits and to construct a representation of the decoding errors from the auxiliary qubits of regular stabilizers par-
(hyper)graphs. From the samples, we estimated the log- allel to the corresponding logical operator’s direction does
ical failure probability p of each experiment, for which not exist. The schedules in the tangled case [Figs. 10(b)
we used at least 103s/2 shots, where s = − log10 p . For and 10(d)] follow a similar pattern to the default version
decoding, in the default cases, we used the minimum- for regular stabilizers, and we use two types of N-shaped
weight perfect matching PYTHON library pymatching schedules for the component operators. In fact, after some
[27]. However, we found that, for the tangled version, it initial simulation we found that the particular scheduling
is not possible to define an efficient decoding graph in gen- of component operators has little effect on the effective dis-
eral. Instead, we mapped the circuit-level noise model to tance or the QEC performance of the tangled patch. How-
a Tanner graph (see Ref. [28] for details) and used a more ever, the scheduling of Figs. 10(b) and 10(d) is convenient
general decoder, BPOSD [29,30]. In the case of quantum as it extends very naturally below the bottom boundary
010348-8
TANGLING SCHEDULES FOR QEC PRX QUANTUM 5, 010348 (2024)
(a) (b)
(c) (d)
FIG. 10. Default and tangled versions of two rotated planar code patches. The effective X and Z distances are (a),(b) 3 and 7 and
(c),(d) 5 and 3, respectively. In (b) and (d), the green lines between auxiliary qubits indicate a tangled schedule between the two
corresponding component plaquettes. Furthermore, the accessory qubits are shown in purple.
(see Appendix A 2) and hence is applicable for more gen- more than one auxiliary qubit. For instance, in Fig. 8(b),
eral patches too (e.g., in lattice surgery). Furthermore, we an error from an auxiliary qubit could spread to a weight-
point out that, in each round of syndrome extraction, each 2 XX vertical data qubit error, regardless of the direction
qubit is acted on with at most four entangling gates. Hence, of the logical X operator. Of course, we need to compen-
the five layers of entangling gates only introduce one addi- sate for this effect somehow and, in the next section and
tional idling layer on the qubits, which is less harmful than in Appendix B, we demonstrate how to do that for lat-
additional two-qubit gates would be. tice surgery without increasing the number of qubits of the
For the effective distances of the tangled patches with QPU.
width w and height h, we find the following formulae, on In our simulations, we compared the default h × w
which we give more detail in Appendix A 4: rotated planar code’s X- and Z-memory performance with
the tangled version’s for size h × (2w − 2). Since their
w effective distances agree, we expected to see comparable
dztng =h and dxtng = + 1. (10) results. We fixed the physical error rate to be p = 10−3 ,
2
the number of rounds to be 2, and compared the logical
For instance, the patches in Figs. 10(a) and 10(b) have the failure rates. We present our numerical results below for
same effective distances, as do the patches in Figs. 10(c) three cases: the narrow case when w = 3 is fixed while h
and 10(d). Intuitively, this is approximately what we would varies, the wide case when h = 3 is fixed while w varies,
expect, since each error on an auxiliary qubit can propagate and the squarer case when we vary h and set w = h.
into an at most weight-2 error on data qubits that are not Our results are shown in Fig. 11. For the narrow patch
accessory qubits. Moreover, if this propagated error is of case [Fig. 11(a)], the effective Z distance varies as h =
ZZ type then its direction is always horizontal, i.e., per- 3, 5, 7. We performed a log-linear fit (with base e) for both
pendicular to the logical Z direction. Note that this halving the default and the tangled versions, and found the follow-
of one type of effective distance (X in this case) is typical ing gradients: −1.8063 for default X memory, −1.5075
for other syndrome-extraction techniques as well that use for tangled X memory, 0.2918 for default Z memory, and
010348-9
GEHÉR, CRAWFORD, and CAMPBELL PRX QUANTUM 5, 010348 (2024)
(a) (b)
(c)
FIG. 11. Comparing the default and tangled patches’ quantum memory performance. (a) The narrow case where the effective X
distance, w, is fixed to be 3 and the physical error rate is p = 10−3 . This means that the width is fixed to be 3 for default and 4 for
tangled planar codes, while the height varies as shown on the horizontal axis. (b) The wide case when the effective Z distance, h, is
fixed to be 3, the effective X distance, w, varies as shown on the horizontal axis, and the physical error rate is p = 10−3 . This means
that the height is fixed to be 3 for both default and tangled planar codes, while the width is w for the default and 2w − 2 for the tangled
case. (c) The squarer-shaped case when the joint effective distance, h = w, varies as shown on the horizontal axis. This means that the
default patch is of size h × h, while the tangled patch is of size (2h − 2) × h.
0.1707 for tangled Z memory. Note that we expect the log- effective X distance needs to be 1.0980w for the tangled
ical failure rate to decrease exponentially as h grows for patch.
the case of X memory, and increase in the case of Z mem- For the squarer patch case [Fig. 11(c)] where the effec-
ory. Therefore, under a physical error rate of p = 10−3 , tive X and Z distances are equal, i.e., h = w, and this
these gradients mean the following: in order to match parameter varies as w = 3, 5, 7, we again performed a log-
the logical failure probability for the X quantum memory linear fit. We found the following gradients for this case:
experiment of a default h × 3 patch, we need to choose −1.3384 for default X memory, −1.0114 for tangled X
the effective Z distance of the tangled patch to be approx- memory, −1.3660 for default Z memory, and −1.6800 for
imately e−1.5075+1.8063 h = 1.3482h; while for the case of tangled Z memory. Similarly to the above two cases, we
Z quantum memory, the effective Z distance has to be can conclude that, under a physical error rate of p = 10−3 ,
e0.1707−0.2918 h = 0.8859h in the tangled case. in order to match the logical failure probability of a default
For the wide patch case [Fig. 11(b)] where the effective h × h patch, in the case of X quantum memory we need to
X distance varies as w = 3, 5, 7, we performed a similar use a tangled patch with effective distance 1.3868h; while
log-linear fit as in the narrow case, and found the follow- in the case of Z memory this effective distance needs to be
ing gradients: 0.2980 for default X memory, 0.3348 for 0.7305w for the tangled patch.
tangled X memory, −1.8051 for default Z memory, and We expect the multiplicative factors to decrease when
−1.7116 for tangled Z memory. As for the narrow case, we decrease the physical error rate p and/or increase the
we can conclude similarly the following under a physical parameter (h for the wide or w for the narrow case) of
error rate of p = 10−3 : in order to match the logical failure the patch that was fixed here. From these results we con-
probability of a default 3 × w patch, in the case of X quan- clude that the quantum memory performances of default
tum memory we need to use a tangled patch with effective and tangled cases are approximately the same, as long
X distance 1.0374w; while in the case of Z memory this as the effective distances are matched. Finally, we note
010348-10
TANGLING SCHEDULES FOR QEC PRX QUANTUM 5, 010348 (2024)
that in order to symmetrize the X - and Z-memory perfor- where one type of stabilizer, say the X type, is overdeter-
mances in the squarer case, we may decrease the width of mined, i.e., they multiply into the identity operator. The
the tangled patch by 1 or 2. Then, on the one hand, the stability experiment proceeds as follows: initialize all data
qubit count is less and the effective X distance decreases qubits in the Z basis; perform n rounds of syndrome extrac-
by 1, but, on the other hand, there are fewer minimal- tion; and, finally, measure out all data qubits in the Z basis.
length vertical Z-logical strings present. Therefore, we In the absence of errors, for any round, the product of
expect the X -memory performance to improve and the Z- the X -type stabilizer outcomes has zero parity, and this is
memory performance to get somewhat worse. In this way, our logical observable (say from the first round) we use
we would expect that, for large patches, one could match to validate our experiment after error correction. At least
and symmetrize the logical performance of the tangled n faults (e.g., n measurement errors on the same X -type
case with that of the default case more closely by using stabilizer) are required for an undetectable logical failure
fewer qubits, even though the effective distances are not [22]; hence, the experiment’s effective distance is n. The
exactly matched. stability experiment can be used as a proxy to estimate the
number of rounds needed for lattice surgery in the merge
stage, or in patch movement for the growing step, or essen-
B. Numerical comparison of default and tangled tially in any experiment where a timelike failure is the main
stability experiments cause of logical failure.
The stability experiment [22] was proposed to test for We chose three tangled patches on which we per-
timelike failures, and Gidney calls it the dual of a quan- formed stability experiments: a 2 × 2, a 4 × 6 and a 6 × 4
tum memory experiment. In this subsection, we compare patch; see Figs. 12(b), 12(d) and 12(e). We compared
the stability experiment performances of the default and their stability performances to the stability performance
tangled versions of rotated planar code patches that have of default patches that have the same number of X - and
no logical corners; see Fig. 12. We consider a planar patch Z-type stabilizers; see Figs. 12(a) and 12(c). Note that the
(d) (e)
FIG. 12. Default and tangled rotated planar code patches without logical corners. We chose two default rotated planar patches for
the stability experiment [(a) 2 × 2, (c) 4 × 6] and three tangled rotated planar patches [(b) 2 × 2, (d) 4 × 6, (e) 6 × 4]. The X -type
stabilizers are overdetermined and hence their measurement outcomes sum to 0 (mod 2).
010348-11
GEHÉR, CRAWFORD, and CAMPBELL PRX QUANTUM 5, 010348 (2024)
(a) (b)
FIG. 14. Default (a) and tangled (b) versions of a 5 × 5 unrotated planar code. Their scheduling is also shown.
010348-12
TANGLING SCHEDULES FOR QEC PRX QUANTUM 5, 010348 (2024)
can be scheduled in a uniform manner [Fig. 14(a)], unlike We allocate the logical patches in the bulk, as depicted
in the rotated case. This is because there is no damage in Fig. 15, where four tile units are depicted and which
to the effective distance if we spread errors from auxil- also shows an example of a concrete merge-stage patch
iary qubits in any diagonal direction. This is useful for for twist-based lattice surgery. In Appendix A 5, we give
our tangled schedules, as it becomes possible to design a more details on how to construct the merge-stage patch for
syndrome-extraction circuit with four entangling layers per a general lattice surgery operation. We find that the effec-
QEC round, as shown in Fig. 14(b), instead of five in the tive distance of such a general merge-stage patch is always
rotated planar examples in Sec. V. Because of less idling at least d − 1, given that the logical patches have distance
on qubits, we would expect slightly improved QEC perfor- d. Below, we show this for the example of Fig. 15, but the
mance in this case. Therefore, here, we choose to present general case can be proven similarly.
an architecture using the unrotated code, since we found We consider the effective distance, which depends on
this especially amenable to using tangled schedules. our schedule choice. If we choose the schedules in one of
Inspired by the architecture presented in Figs. 11 and 14 the usual ways for regular stabilizers of the same type,
of Ref.[17], we tile the QPU in the bulk with units that namely, spreading errors from auxiliary qubits to data
could accommodate approximately nine logical patches of qubits in diagonal directions, then the effective distance
the same square size, of which five are used for routing. of a general merge-stage patch is d − 1 in the worst-case
FIG. 15. An example showing the merge-stage patch of a general lattice surgery operation involving several logical qubits as unro-
tated planar code patches. The original patches are outlined in black and labeled with their Pauli terms in the measurement. Here and in
subsequent plots, the purple dots and lines label those outcomes that multiply to give the logical Pauli product we measure. Note that,
at certain places, we could shrink the merge-stage patch (e.g., at the bottom left, we do not need the rectangle-shaped extension) if we
do not wish to involve further patches in our logical measurement. However, we left these extensions here to show how other patches
from adjacent tiles could be merged in easily too. Also, we could omit some of the merging through the boundaries of tile units, e.g.,
in the present case we could simply join at three boundaries instead of four. The (d − 1) × (d − 1) sized yellow square is an area we
need to cross in order to have a logical failure string that connects the yellow square’s top and bottom vertices, thus connecting two
boundaries of the merge-stage patch.
010348-13
GEHÉR, CRAWFORD, and CAMPBELL PRX QUANTUM 5, 010348 (2024)
scenario. Indeed, we only need to be careful along a diag- least d − 1 fault locations to have a logical failure. Sec-
onal array of elongated rectangles and twist defects, and in ond, suppose that regular stabilizers of the relevant type
between two neighboring such diagonal arrays. Note that spread errors in the perpendicular south-west to north-east
the elongated stabilizers in such a diagonal array spread the direction in the yellow area. Then, we can compose a simi-
errors from their auxiliary qubits in the north-west to the lar graph as shown in Fig. 16(c). It is again straightforward
south-east direction. Therefore, along any diagonal array to see that any path connecting A and B has length at least
we need at least l/2 failures to have a logical error string, d − 1 and, therefore, the effective distance is at least d − 1
where l is the number of qubits along the long side of the in this case too.
array. However, this length is always at least l = 2(d − 1) We have shown that, using tangled syndrome extrac-
in our case. tion, we can perform general twist-based lattice surgery on
As for the case in between two neighboring diago- degree-4 connectivity hardware without adding additional
nal arrays of elongated rectangles and twist defects, let qubits, thereby relaxing the hardware requirement. We are
us draw a yellow square that contains (d − 1) × (d − 1) not aware of any previous lattice surgery protocol in the
data qubits, as shown in Fig. 15. This area is depicted literature that provides a method for doing this without
in Fig. 16(a) for clarity. We have two cases depending adding significant qubit overhead. For instance, the pro-
on the scheduling of regular stabilizers. First, assume that tocol of Fig. 4 of Ref. [16] uses degree-6 connectivity (and
regular stabilizers of the relevant type spread errors from may require degree 8 in some situations).
the auxiliary qubits in the north-west to the south-east However, our scheme does incur a time overhead rel-
direction (i.e., the same as the elongated rectangles). We ative to a higher connectivity scheme, as discussed in
observe that a logical failure string connecting one bound- Sec. V B. This means that there is some increased time
ary of the patch to the other has to pass through this cost to achieve the same logical fidelity; however, this
yellow square connecting its top vertex to its bottom ver- decreases as the patch size increases, and as the physical
tex, which are indicated as boundary vertices A and B in error rate decreases.
Fig. 16. More precisely, we can compose the graph shown Note also that in the protocol of Fig. 4 of Ref. [16] one
in Fig. 16(b), where edges correspond to single fault loca- fault location on an elongated stabilizer’s auxiliary qubit
tions and the vertices of each edge to stabilizers whose can lead to a weight-2 data qubit error that aligns with a
outcome is flipped due to that fault. The horizontal and logical string. Fortunately, in the context of Y ⊗ Y lattice
vertical edges correspond to single data qubit Z errors, surgery, the relevant logical operator is of length about 2d
while the north-west to the south-east diagonal edges cor- and so this is not a problem in practice. A similar effect is
respond to auxiliary qubit errors that spread into weight-2 seen with our tangled-schedule approach—the distance is
data qubit errors. A logical error corresponds to a path in halved for small demonstrations, but employing the pro-
this graph connecting A to B. It is clear that such a path tocols described in this work to perform lattice surgery
has length at least d − 1, which implies that we need at operations means that this effect is not relevant.
FIG. 16. (a) The area including the yellow square from Fig. 15. The elongated stabilizers always spread the errors from their auxiliary
qubits from the north-west to the south-east direction. For the regular Z stabilizers we consider two cases. (b) If regular Z stabilizers
also spread errors from their auxiliary qubits in the north-west to the south-east direction (i.e., as the elongated ones), we can compose
the shown graph where each edge corresponds to a single fault location during syndrome extraction, and, as a result, flips the outcome
of the stabilizers that correspond to the vertices of that edge. Vertices A and B are boundary nodes. A logical error is a path in the graph
that connects A and B. This shows that the effective distance of the merge-stage patch in Fig. 15 is d − 1. (c) If regular Z stabilizers
spread errors in the south-west to the north-east direction (i.e., perpendicular to the direction of spreading of the elongated stabilizers),
e.g., as is the case in Fig. 14(b), then this graph can be composed. Again, it is straightforward to see that the effective distance is d − 1.
010348-14
TANGLING SCHEDULES FOR QEC PRX QUANTUM 5, 010348 (2024)
010348-15
GEHÉR, CRAWFORD, and CAMPBELL PRX QUANTUM 5, 010348 (2024)
(a)
(b) (c)
FIG. 17. (a) A QPU with its background lattice colored gray and white, and two aligned patches laid on top of this lattice. (b) Hence,
XX lattice surgery is possible without the need for any long-range stabilizers. The purple auxiliary qubits are those whose joint parity
outcomes give the logical XX -measurement outcome. (c) However, XZ lattice surgery needs some long-range stabilizers, as we need
to change the checkerboard pattern to fit the pattern of those stabilizers that multiply into the logical XZ. The purple auxiliary qubits’
joint parity outcomes give the logical XZ-measurement outcome.
3. Assigning detectors for elongated rectangles and defects. Recall that a detector is simply a combination of
twist defects some measurement outcomes that is deterministic under
Let us now explain how we assign detectors when per- noiseless execution of the circuit; see Ref. [33]. We say
forming syndrome extraction for a rotated planar code that a detector is triggered if this combination of measure-
patch using a set of elongated rectangles and twist ments, when sampled from the noisy circuit, is different to
(a) (b)
D
D2
D3
D1
FIG. 18. (a) The scheduling of the tangled patches in Fig. 10 extends naturally below the elongated rectangles. (b) Three types of
detectors that we assign during syndrome extraction with elongated stabilizers and twist defects. Here D1 − D2 compares the elongated
outcomes from two consecutive rounds, where D2 needs to include accessory qubit outcomes, as those qubits were reset after they
were measured. Detector D3 compares the Y-accessory qubit outcome to the two adjacent Pauli corrections.
010348-16
TANGLING SCHEDULES FOR QEC PRX QUANTUM 5, 010348 (2024)
|+ Y ma |+ ZY ma |+ Y ma ⊕ 1
|+ Y mb |+ Z Y mb |+ Y mb ⊕ 1
= = |i
|i |i
|i Y |i Y Y |i
FIG. 19. A possible error Y happening midcircuit: (left) the original location of the Y error; (middle) propagating to an equivalent
Pauli error; (right) the effect of the error on readout. Since the sum m1 ⊕ m2 is unchanged by the transformations m1 → m1 ⊕ 1 and
m2 → m2 ⊕ 1, this detector goes untriggered. However, the Pauli correction after two rounds is inferred from m1 ⊕ n1 and will have
the incorrect result. This leads to a Pauli error g1 . In the case of the surface code, this leads to two data qubit errors possibly aligned
with a logical operator, a so-called bad hook error. Such a bad hook would also occur if we had directly entangled the auxiliary qubits
and so is an intrinsic property of syndrome extraction with low-connectivity hardware. However, this can be compensated by the fact
that the distance can be locally increased when we do lattice surgery using the same number of qubits (Sec. VI). Note also that the two
detectors associated with the accessory qubits (prepared in state |i) will be triggered after the second round.
the expected deterministic value. Detectors are important qubits). The last type of detectors, D3, we assign to Y-basis
because they signal errors in the circuit that we can then accessory qubit measurement outcomes. These outcomes
correct for. should align with the two Pauli corrections coming from
For planar code patches that contain elongated halves of the elongated stabilizers or twist defects; hence,
rectangles and twist defects, we retain the usual detector they are formed of five measurement outcomes (four aux-
definitions for local stabilizers. As for the nonlocal sta- iliary qubits and one accessory qubit).
bilizers, we have three types of detectors, all depicted in
Fig. 18(b). One type, D1, is the comparison of two nonlo-
cal stabilizer outcomes from two consecutive rounds where 4. Effective distance of tangled rotated planar codes
in the latter round we measure the accessory qubits. Hence, In this section of the appendix, we provide an expla-
these detectors consist of four auxiliary qubit outcomes. nation for the effective distance of tangled rotated planar
Type-D2 detectors are similar, but they compare the non- patches.
local stabilizer outcomes from two consecutive rounds We see from the schedules used for the syndrome extrac-
where in the former round we measure the accessory tion of regular stabilizers [e.g., in Fig. 18(a)] that one error
qubits. Since the accessory qubits are reset after measure- on the auxiliary qubit can propagate to an at most weight-
ment, their measurement outcomes need to be included as 2 error on data qubits, up to stabilizer equivalence. More
well. As such, D2-type detectors consist of six measure- precisely, due to the N-shaped schedule we use for X sta-
ment outcomes (four auxiliary qubits and two accessory bilizers, this propagated XX error on the data qubits is in
*** *** * * Y *
X X I
I I
(d) (e)
Y
Y
* Y * *
I
FIG. 20. Single midcircuit errors that together lead to a logical X failure. The depicted patch’s schedule and qubits are not shown
here, but are the same as in Fig. 10(d). Each subfigure (a)–(e) shows a different midcircuit error occurring after the execution of a CZ
gate, with the specific errors given by the purple-encircled Pauli strings. The purple asterisks show which detectors are triggered by
the corresponding midcircuit error. More precisely, if they are placed in the middle of an elongated rectangle then they are like D1–D2
from Fig. 18(b); otherwise, they are associated with accessory qubits (like D3). An exhaustive search shows that fewer than five fault
locations do not lead to a logical X failure.
010348-17
GEHÉR, CRAWFORD, and CAMPBELL PRX QUANTUM 5, 010348 (2024)
FIG. 21. Four tile units in the bulk of the QPU, each surrounded by green dashed lines. The green dotted lines indicate areas where
we can place elongated rectangles and twist defects. The purple dashed lines show areas where we may join the merge-stage patches
of lattice surgery between tile units. We can continue tiling like this, meaning we shift the patches one row up for the next tile unit to
the right.
the vertical direction, while due to the Z-shaped sched- we apply it in software, we incur an error g1 on the
ule we use for Z stabilizers, the propagated ZZ error is data and accessory qubits. This, however, triggers two
horizontal. Both directions are perpendicular to the types of detectors: (1) the detectors associated with the
direction of the logical operator of the same type. There- accessory qubits on which the component operator g1 is
fore, each midcircuit error happening during the syndrome supported, and (2) detectors that compare the outcomes of
extraction of a regular stabilizer contributes at most weight elongated rectangles from two consecutive rounds. Nev-
1 towards logical failure. ertheless, we now have a weight-2 data qubit error in the
Next, consider the syndrome extraction of elongated horizontal direction, which is aligned with the X logical
rectangles, and note that similar conclusions apply for operator in the case of X -type elongated rectangles.
twist defects. Note that the qubits in the middle are Another example of when the Pauli correction is inferred
accessory qubits, and hence they are not data qubits of incorrectly is a Y-type midcircuit error happening after the
the patch. Therefore, regardless of the schedule, a sin- execution of a two-qubit gate; see Fig. 19. The effect of
gle midcircuit error during syndrome extraction for the this Y error is that the outcomes of both component oper-
elongated rectangle can propagate to both data qubits. An ators are flipped. Therefore, again, the Pauli correction
m +n +1
example of this is when the Pauli correction g1 1 1 is is inferred incorrectly. However, this error triggers fewer
inferred incorrectly from, say, the top component oper- detectors than the above, namely, those associated with
ator due to a classical measurement flip, i.e., we read the accessory qubit outcomes [cf. Fig. 20(c) or 20(d)]. As
out n1 + 1 instead of n1 as the result of a classical mea- above, this also leads to a horizontally aligned weight-2
surement readout failure. This means that the Pauli cor- data qubit error of the same type as the top component
m +n
rection is inferred incorrectly as g1 1 1 ; hence, when operator.
010348-18
TANGLING SCHEDULES FOR QEC PRX QUANTUM 5, 010348 (2024)
(a) (b)
FIG. 22. Lattice surgery examples. (a) Measuring a logical XXXX . In general, to measure a logical Pauli product whose term on a
patch is X , we place plaquettes everywhere except on the gray-white area around that patch in subfigure (a). (b) Measuring a logical
ZZZZ. In general, to measure a logical Pauli product whose term on a patch is Z, we place plaquettes everywhere except on the gray-
white area around that patch in subfigure (b). If the Pauli term is Y, we use all plaquettes around the patch, while if it is I , we avoid
both gray-white areas. For an explanation of all aspects of the figure, see the caption of Fig. 15.
As the above two types of midcircuit errors trigger patch, as shown in Fig. 22(a). If we would like to mea-
detectors associated with accessory qubits, even in the case sure Z on the patch then we follow Fig. 22(b) instead.
where each Pauli correction is inferred incorrectly in either Finally, if we do not involve the patch in our measure-
of the above two ways, we do not have an undetectable log- ment then we reduce the weights of the plaquettes around
ical X failure. However, there exists w/2 + 1 midcircuit it using both Figs. 22(a) and 22(b). Next, we schedule the
errors that cause an undetectable logical failure; we show remaining plaquettes in a way that two plaquettes are tan-
an example of this in Fig. 20. gled if and only if they are within the same dotted area
Our observations of the effective distance have been of Fig. 21, so we have pairs of tangled plaquettes. This
verified using stim [26]. constructs a general merge-stage patch within one tile unit
and, as we argued in Sec. VI, the distance is reduced by
5. General lattice surgery merge patch with the at most one, provided we use the standard N- and/or Z-
unrotated planar code shaped schedulings everywhere, possibly inserting idling
We can tile the QPU in the bulk in a similar way to that layers to make tangling between some pairs possible.
in Ref. [17]. Namely, we can use tile units, each contain- Now, in order to construct a merge-stage patch that may
ing qubits that can accommodate nine logical qubits, but involve patches from various tile units, we start by per-
we only place logical patches at the four corners of each forming the construction above within each tile unit. Then,
tile unit. Figure 21 shows four tile units, each surrounded we place weight-4 plaquettes in between the purple dashed
by green dashed lines. The green dotted lines inside a tile lines of Fig. 21 to connect the relevant adjacent tile units.
unit show where we may place elongated rectangles and This construction covers the general case, but we note that
twist defects for the merge stages; otherwise, we place reg- in many cases there may be room for reducing the num-
ular stabilizer plaquettes during merge. The purple dashed ber of plaquettes involved, which we do not discuss here,
lines indicate where we may join the merge-stage patches but note in Sec. VI. As an example, we refer the reader
of lattice surgery between tile units. to Fig. 15, where the construction of the patch was done
Figure 22 shows a template for constructing a general exactly as described here.
merge-stage patch inside one tile unit. We start by placing
a regular X plaquette on top of each white square, and a
Z plaquette on top of each gray square in the tile unit. We 6. A brief discussion on alternatives to FTQC without
then reduce the weight of some of them (possibly remov- PBC
ing them completely) according to the template. Namely, In this paper, we consider the PBC model for FTQC,
if we intend to measure Y on a patch then we do not do which executes a quantum algorithm via a series of mul-
anything around it. In case we wish to measure X on that tiqubit Pauli measurements. This is a popular model for
patch, we reduce the weights of the plaquettes around the FTQC, as it enables (virtual) logical Clifford gates with
010348-19
GEHÉR, CRAWFORD, and CAMPBELL PRX QUANTUM 5, 010348 (2024)
FIG. 23. The tiling of our QPU in the bulk with rotated planar code patches.
no time cost. As a consequence, logical T gates are imple- the same paper (see Fig. 23 therein) that the logical S gate
mented sequentially (they cannot be performed in parallel) can also be performed via patch deformation on the same
and the algorithm runtime is proportional to the T count QPU. Alternatively, the logical S gate can be performed
(more precisely, the measurement depth). This simplicity via initializing an auxiliary patch in a Y eigenstate and
of algorithm runtime analysis is one of the reasons for performing a ZZ-type lattice surgery operation [15,
the popularity of PBC. Furthermore, assuming only a few Fig. 11b] and, recently, improvements to Y state prepara-
magic state factories, PBC is nearly optimal and faster than tion have been made [35]. Therefore, the logical S gate can
computational models where the logical Clifford gates are be also performed via a lattice surgery operation on the
physically performed. However, in the many-factory limit, square-grid connectivity device. The logical non-Clifford
the trade-offs are more subtle and not well understood. gates are performed using distilled magic states (simi-
Now, we recall some details on the computational model lar to PBC), except now the factories can be distributed
where the logical Cliffords are physically implemented on throughout the architecture.
a square-grid connectivity QPU. Assume that the circuit In summary, we could perform FTQC with the planar
we are to execute is compiled in terms of Hadamard, S, code on a square-grid connectivity device, via executing
controlled-NOT (CNOT), and T gates. It is well known that each logical gate sequentially, although the runtime of such
on planar codes the logical CNOT gate can be performed approaches is poorly understood compared to the PBC
via initializing an auxiliary patch and performing an XX - model.
and a ZZ-type lattice surgery; see, e.g., Ref. [14, Fig. 3].
Therefore, if the patches are aligned with respect to the
background lattice, a logical CNOT gate can be executed on APPENDIX B: AN ARCHITECTURE FOR
the square-grid connectivity QPU (Fig. 1) using only local FAULT-TOLERANT QUANTUM COMPUTATION
stabilizers. If some of these patches are antialigned with WITH THE ROTATED PLANAR CODE
respect to the background lattice than we may use tangled In Sec. VI, we presented a way to perform a general mul-
schedules to measure some elongated rectangles for these tiqubit logical Pauli measurement with the unrotated planar
lattice surgery operations. Next, the logical Hadamard gate code on the square-grid connectivity device using one lat-
can also be executed on a square-grid connectivity QPU tice surgery operation. In this appendix, we present a way
via patch deformation; see, e.g., Ref. [34]. It was shown in to measure a general multiqubit logical Pauli operator with
010348-20
TANGLING SCHEDULES FOR QEC PRX QUANTUM 5, 010348 (2024)
the rotated planar code that uses one or two lattice surgery the distance-halving effect of the tangled-schedule method
operations, depending on the Pauli product we wish to (when using the rotated planar code), we need to widen
measure. In Ref. [17, Section IV], the authors described a part of the merge-stage patch. Finally, we measure out
a scheme, called twist-free lattice surgery, that uses the auxiliary patch in the Z basis and, depending on the
two lattice surgery operations for each multiqubit Pauli outcome, we may apply a Pauli correction in software; the
measurement that involves a Y term, thereby roughly dou- full details are given in Ref. [17, Sec. IV]. Through this
bling the time cost. For that scheme to work, the authors example, the reader can see that this twist-free protocol
introduced a so-called dislocation area in the square-grid indeed works for measuring a general Pauli product.
connectivity hardware (see Ref. [17, Fig. 11]), whose role We note that there is an alternative to the second lattice
is effectively to switch the background lattice. The dislo- surgery step in the twist-free case that is not a possibility
cation area imposes constraints on the merge-stage patch in the rest of the cases considered in the paper. Namely,
of the lattice surgery operations; in particular, they need we could swap the auxiliary patch to the left with one col-
to include an auxiliary patch that is initialized close to the umn of data qubits using two layers of SWAP gates (which
dislocation area, and the second merge-stage patch needs compile to six layers of CZ gates and some further lay-
to include the dislocation area itself. This may result in ers of one-qubit gates, if the SWAP gate is not a native
needing large merge-stage patches even in the case when, gate), and then, as we now have the auxiliary patch on
e.g., we measure a Pauli product on patches that are close a different background lattice, it is enough to use regular
to each other, but far away from the dislocation area. stabilizers for the merge step of the second lattice surgery
In this appendix, we present an alternative protocol that operation. This solution could also be applied in the case
does not need the dislocation area, and hence can be per- of Ref. [17] instead of introducing a dislocation area. Even
formed on the square-grid connectivity hardware; we argue though this adds further noise to the lattice surgery opera-
that the space-time cost remains approximately the same as tion, in some noise regimes it may be beneficial to use this
the twist-free protocol of Ref. [17]. We achieve this by not- method. However, in general, we expect this alternative
ing that certain multiqubit Pauli measurements need only not to be the best option.
one twist-based lattice surgery operation that can be per- An advantage of our tangled syndrome-extraction tech-
formed with tangled schedules, and we perform the rest of nique is that often we do not need to perform two lattice
the Pauli measurements by mimicking the twist-free proto- surgery operations to measure the Pauli product. Indeed,
col of Ref. [17], but using tangled schedules instead of the in many cases it turns out that we can actually do it with
dislocation area. just one lattice surgery operation. This is the case, for
We place the logical patches in a similar way to Fig. 11 instance, for the XYZY measurement of Ref. [17, Fig. 11];
of Ref. [17], which is illustrated in Fig. 23. There are two we illustrate how to do this in Fig. 25.
differences, one being that, for sake of simplicity, we con- Next, we estimate the time cost of the mixed method,
sider square-shaped patches with equal X and Z distances. namely, when we use twist-free lattice surgery whenever
The other difference is that we make the horizontal and the twist-based version is not possible. Assume that we
vertical parts of the routing space two data qubits taller need N Pauli measurements and that qN of these can be
and wider, respectively. Thus we use an additional O(nd) done with the twist-based version, where 0 ≤ q ≤ 1. Then,
qubits, where n denotes the number of logical patches, our time cost is [qR + (1 − q)(1 + R)]/2 times the time
which is negligible compared to the already needed O(nd2 ) cost of twist-free lattice surgery from Ref. [17], where R
qubits. Therefore, we can consider the space cost to be is the time overhead discussed in Sec. V B. For instance,
approximately the same. Padding the routing space this in the q = 12 case, this multiplicative factor is less than 1 if
way, however, makes it possible to connect the logical and only if the time overhead R is less than 1.5. Recall from
patches during merge stages via both the horizontal and Sec. V B that we expect this would be the case for larger
vertical parts of the routing space, which is not the case patches that typically arise here, and, further, we would
in Ref. [17, Figs. 11(c)–11(d)]. Therefore, merge-stage expect the time overhead to decrease with the improvement
patches are potentially able to be smaller. of physical error rates. Therefore, in general, we expect to
Now, as an illustrative example, we perform the same achieve a similar space-time cost for fault-tolerant com-
XYZY measurement from Ref. [17, Fig. 11] with our putation with tangled schedules to that with the twist-free
tangled-schedule method, first via twist-free and then via protocol of Ref. [17]. Furthermore, we also removed the
twist-based lattice surgery. In Fig. 24(a), a |0-state auxil- need to modify the hardware.
iary patch is initialized in the bulk-routing space, between Finally, we compare the space cost (i.e., qubit count)
two logical patches, and we perform an XXIXX -type lat- of our scheme to some previous schemes from the litera-
tice surgery, where we only need to use regular local- ture. We already mentioned that our scheme and that from
range stabilizers. This is then followed by performing the Ref. [17] have approximately the same space cost, i.e., n
IZZZX -type lattice surgery shown in Fig. 24(b), for which logical qubits can be stored with approximately 94 n(2d2 +
we need to use elongated rectangles. In particular, due to O(d)) qubits, where d is the distance of logical patches. We
010348-21
GEHÉR, CRAWFORD, and CAMPBELL PRX QUANTUM 5, 010348 (2024)
(a)
(b)
FIG. 24. Performing the same XYZY measurement as in Ref. [17, Fig. 11], but on the degree-4 hardware shown in Fig. 1 using rotated
planar patches. (a) The first, purely X -type, lattice surgery operation involving the three patches on which we intend to measure either
X or Y, and the auxiliary patch. Local stabilizers are sufficient here. (b) The second lattice surgery operation involving the three patches
on which we intend to measure either Y or Z, and the auxiliary patch. This is a mixed ZZZX -type lattice surgery, and hence we need
elongated rectangles. Because of the distance-halving effect, we need to have a wider area to connect the auxiliary patch to the rest of
the patches.
010348-22
TANGLING SCHEDULES FOR QEC PRX QUANTUM 5, 010348 (2024)
FIG. 25. An alternative way to measure the XYZY operator of Fig. 24 with twist-based lattice surgery with rotated planar patches.
While twist-based lattice surgery is not always possible in this way without losing significant distance, in several cases it is possible.
further compare our scheme to the three schemes presented Fig. 6), so that all gates involving a particular auxiliary
in Ref. [15]: “compact block”, “intermediate block”, and qubit are adjacent. If component circuit Cj is tangled with
“fast block”. As hardware connectivity constraints were component circuit Ck , we gain a term CZj,k between the
not taken into account in Ref. [15], we assume for this relevant auxiliary qubits. Therefore, the reordered circuit
comparison that, for each stabilizer, we always have an includes a block of CZ gates; see the leftmost circuit in
auxiliary qubit available that is connected to its data qubits. Fig. 26. This CZ block is exactly
Then the compact block needs ( 32 n + o(n))(2d2 + O(d)),
while the intermediate block and fast block both need CZG = CZj,k , (C1)
(2n + o(n))(2d2 + O(d)) qubits to store n logical qubits. (j,k)∈E
Our scheme, which takes into account the hardware con-
nectivity constraints, requires approximately 1.5 times the where the graph G = (V, E) is defined in the statement of
space cost of the compact block and 1.125 times the space the theorem in the main text. Our theorem assumes that G
cost of the intermediate and fast blocks. is a forest, i.e., a disjoint union of trees (where a tree is a
connected graph with no cycles).
First, we prove our theorem for the case when G is a sin-
APPENDIX C: PROOF OF THEOREM 1
gle tree, and write T for the graph in this case to emphasize
Here, we prove Theorem 1. For each pair of schedules this. For convenience, we label the vertices with integers
that are tangled, we can reorder the gates (as we did in from 1 to m, where m is the number of vertices in the tree.
010348-23
GEHÉR, CRAWFORD, and CAMPBELL PRX QUANTUM 5, 010348 (2024)
|+ Y m |+ Y m
|+ |+ |+ Zm S
|+ CZ T |+ |+
.. .. .. .. CZ T .. .. CZ T
. . . . . .
|+ |+ |+
equals equals
g1 g2 g3 g3 gn I − ig1 m
gn g1 g2 g3 gn g1 g2 √ g1
2
.. .. .. .. .. ..
. ... . . ... . . ... .
FIG. 26. Pruning a single leaf from a tree of tangled schedules. As a result of pruning, on the right, we see a Clifford correction on
data qubits and additional one-qubit gates on auxiliary qubit 2 (gates in blue boxes).
Recall that we wish to measure the operator h = m j =1 gj , u∈NT,T̃ (v) mu , we get the statement that
where each gj is a multiqubit Pauli component operator
and [gj , gk ] = 0 holds for all j, k.
We identify a leaf vertex, i.e., one that is connected to W(v) = S d(v)−1 Z M (v) . (C4)
only one other vertex by an edge. We may assume that this
leaf is vertex 1 and that it is connected (via an edge) to So that we can apply the pruning identity again, we mea-
vertex 2. Then, we can decompose the CZ block as sure qubit v so that we cancel the accumulated one-qubit
gates and then measure in the Y basis. Therefore, we
CZT = CZT CZ1,2 , (C2) measure qubit v in the conjugated basis
where T is the tree obtained by removing the vertex 1 and
the edge (1, 2). Now, via the pruning identity [Fig. 5(b)], S d(v)−1 Z M (v) YZ M (v) S 1−d(v)
it is straightforward to see the equivalences of the three
(−1)M (v)+[d(v)−1]/2 Y if d(v) is odd,
circuits depicted in Fig. 26. Note that, as the correction on = (C5)
the data qubits is a function of g1 , it commutes with all (−1)M (v)+d(v)/2 X if d(v) is even.
other component operators and can thus be moved to the
right, as shown in the figure. Note that the minus signs can be handled in classical
From here, we iteratively identify a leaf of the current postprocessing.
tree and use the pruning identity to prune that leaf from Now, if we apply the pruning lemma with leaf v, we
the tree. Assume that, after some sequence of prunes, we obtain an additional one-qubit gate on the auxiliary qubit
have a smaller tree, T̃ = (Ṽ, Ẽ). Let v ∈ Ṽ denote the next that was connected to v in T̃. Further to that, the pruning
leaf vertex in T̃ to be pruned. Let NT,T̃ (v) denote the set of also leads to a Clifford correction on the data qubits. It is
vertices in the original tree T such that u ∈ NT,T̃ (v) if and straightforward to see that, after using the pruning identity
only if for the j th time, the total incurred Clifford correction on
the data qubits has the form
(1) u was originally a neighbor of v; formally, (u, v) ∈
E; and
(2) u has since been pruned; formally, u ∈
/ Ṽ.
j
m
Vk Pk k , (C6)
Then, it follows that the accumulated one-qubit gates on k=1
vertex v have come from applications of the pruning iden-
tity on each u ∈ NT,T̃ (v). Therefore, the form of the total √
where Vk = (I − iPk )/ 2, mk is the outcome correspond-
accumulated one-qubit gates is ing to the auxiliary qubit that was pruned during the kth
step, and Pk is a product of some component operators.
|NT,T̃ (v)| u∈N (v) mu
W(v) = S Z T,T̃ , (C3) (For instance, if 2 is a leaf of T after the first pruning step,
we may identify 2 as the next leaf, and then P2 = g1 g2 .)
where mu is the outcome of measuring qubit u. Note Recall that the component operators commute with each
that, since v is a leaf in T̃, it only has a single remain- other; hence, the full correction can be moved to the right
ing neighboring vertex. Letting d(v) denote the vertex of the circuit.
degree of v with respect to the original tree T, we have Let us assume that we have done m − 1 pruning steps,
d(v) = 1 + |NT,T̃ (v)|. Introducing the shorthand M (v) := so that only one vertex, say w, remains. Then, the state on
010348-24
TANGLING SCHEDULES FOR QEC PRX QUANTUM 5, 010348 (2024)
the data qubits and qubit w has the form Troyer, Quantum computing enhanced computational catal-
ysis, Phys. Rev. Res. 3, 033055 (2021).
m−1
m
[10] Aleksei V. Ivanov, Christoph Sünderhauf, Nicole Holz-
| ∝ W(w)Cw (h) |+ ⊗ Vk Pk k |ψ , (C7) mann, Tom Ellaby, Rachel N. Kerber, Glenn Jones,
k=1 and Joan Camps, Quantum computation for periodic
solids in second quantization, Phys. Rev. Res. 5, 013200
where Cw (h) denotes the controlled-Pauli-h gate, with con- (2023).
trol being on w, h = m j =1 gj , and |ψ is the initial state on [11] Joonho Lee, Dominic W. Berry, Craig Gidney, William
the data qubits. We now measure w in the W(w) X W(w)† J. Huggins, Jarrod R. McClean, Nathan Wiebe, and Ryan
basis though, again, it suffices only to measure in the Babbush, Even more efficient quantum computations of
correct basis up to sign, as this sign may be applied classi- chemistry through tensor hypercontraction, PRX Quantum
2, 030305 (2021).
cally. We see that performing such a measurement and then
mk † [12] Ryan Babbush, Craig Gidney, Dominic W. Berry, Nathan
applying the correction ( m−1 k=1 Vk Pk ) to the data qubits is Wiebe, Jarrod McClean, Alexandru Paler, Austin Fowler,
equivalent to measuring the Pauli operator h with outcome and Hartmut Neven, Encoding electronic spectra in quan-
mw . tum circuits with linear T complexity, Phys. Rev. X 8,
We note that, up to sign, the bases of all auxiliary qubit 041015 (2018).
measurements can be determined ahead of time as these [13] Clare Horsman, Austin G. Fowler, Simon Devitt, and Rod-
depend only on the degrees of the corresponding vertices. ney Van Meter, Surface code quantum computing by lattice
The signs can be applied classically when determining the surgery, New J. Phys. 14, 123011 (2012).
[14] Daniel Litinski and Felix von Oppen, Lattice surgery with a
outcome of measuring operator h and the Clifford cor-
twist: Simplifying Clifford gates of surface codes, Quantum
rection. Therefore, all auxiliary qubits can be measured 2, 62 (2018).
simultaneously. [15] Daniel Litinski, A game of surface codes: Large-scale
We conclude the proof by noting that, in the case when quantum computing with lattice surgery, Quantum 3, 128
G is a forest, we can prune each tree as above. Each cor- (2019).
rection on data qubits can be moved to the right, as the [16] Christopher Chamberland and Earl T. Campbell, Circuit-
component operators commute with each other. Finally, level protocol and analysis for twist-based lattice surgery,
we end up with only having single vertices in our graph, Phys. Rev. Res. 4, 023090 (2022).
where the measurements of each remaining qubit will be [17] Christopher Chamberland and Earl T. Campbell, Uni-
versal quantum computing with twist-free and tempo-
equivalent to measuring the product of those component
rally encoded lattice surgery, PRX Quantum 3, 010331
operators that were in the tree of that measured qubit in the (2022).
original graph G. [18] Austin G. Fowler and Craig Gidney, Low overhead quan-
tum computation using lattice surgery, ArXiv:1808.06709
(2018).
[19] IBM Systems, https://quantum-computing.ibm.com/servi-
[1] Earl T. Campbell, Barbara M. Terhal, and Christophe ces/resources?tab=systems (2023), (accessed
Vuillot, Roads towards fault-tolerant universal quantum 01/07/2023).
computation, Nature 549, 172 (2017). [20] Rigetti Systems, https://qcs.rigetti.com/qpus (2023),
[2] Daniel Gottesman, Ph.D. Thesis, California Institute of (accessed 01/07/2023).
Technology (1997). [21] Eyob A. Sete, Nicolas Didier, Angela Q. Chen, Shob-
[3] A. Yu Kitaev, Fault-tolerant quantum computation by han Kulshreshtha, Riccardo Manenti, and Stefano Poletto,
anyons, Ann. Phys. (N. Y.) 303, 2 (2003). Parametric-resonance entangling gates with a tunable cou-
[4] Eric Dennis, Alexei Kitaev, Andrew Landahl, and John pler, Phys. Rev. Appl. 16, 024050 (2021).
Preskill, Topological quantum memory, J. Math. Phys. 43, [22] Craig Gidney, Stability experiments: The overlooked dual
4452 (2002). of memory experiments, Quantum 6, 786 (2022).
[5] Austin G. Fowler, Matteo Mariantoni, John M. Martinis, [23] Sergey Bravyi and Alexei Kitaev, Universal quantum com-
and Andrew N. Cleland, Surface codes: Towards practical putation with ideal Clifford gates and noisy ancillas, Phys.
large-scale quantum computation, Phys. Rev. A 86, 032324 Rev. A 71, 022316 (2005).
(2012). [24] Stim circuits for “Tangling schedules eases hardware
[6] Robert Raussendorf and Jim Harrington, Fault-tolerant connectivity requirements for quantum error correction”
quantum computation with high threshold in two dimen- manuscript (2023).
sions, Phys. Rev. Lett. 98, 190504 (2007). [25] Alexandru Paler and Austin G. Fowler, Pipelined correlated
[7] Google Quantum AI, Suppressing quantum errors by scal- minimum weight perfect matching of the surface code,
ing a surface code logical qubit, Nature 614, 676 (2023). ArXiv:2205.09828 (2022).
[8] Sergey Bravyi, Graeme Smith, and John A. Smolin, Trad- [26] Craig Gidney, Stim: A fast stabilizer circuit simulator,
ing classical and quantum computational resources, Phys. Quantum 5, 497 (2021).
Rev. X 6, 021043 (2016). [27] Oscar Higgott and Craig Gidney, Sparse blossom: Correct-
[9] Vera von Burg, Guang Hao Low, Thomas Häner, Damian ing a million errors per core second with minimum-weight
S. Steiger, Markus Reiher, Martin Roetteler, and Matthias matching, ArXiv:2303.15933 (2023).
010348-25
GEHÉR, CRAWFORD, and CAMPBELL PRX QUANTUM 5, 010348 (2024)
[28] Oscar Higgott, Thomas C. Bohdanowicz, Aleksander [32] Michael E. Beverland, Benjamin J. Brown, Michael J.
Kubica, Steven T. Flammia, and Earl T. Campbell, Fragile Kastoryano, and Quentin Marolleau, The role of entropy
boundaries of tailored surface codes and improved decod- in topological quantum error correction, J. Stat. Mech.:
ing of circuit-level noise, ArXiv:2203.04948 (2022). Theory Exp. 2019, 073404 (2019).
[29] Joschka Roffe, David R. White, Simon Burton, and [33] Matt McEwen, Dave Bacon, and Craig Gidney, Relaxing
Earl Campbell, Decoding across the quantum low-density hardware requirements for surface code circuits using time-
parity-check code landscape, Phys. Rev. Res. 2, 043423 dynamics, ArXiv:2302.02192 (2023).
(2020). [34] Hector Bombin, Chris Dawson, Ryan V. Mishmash, Naomi
[30] Joschka Roffe, LDPC: Python tools for low density parity Nickerson, Fernando Pastawski, and Sam Roberts, Logical
check codes (2022), https://pypi.org/project/ldpc/. blocks for fault-tolerant topological quantum computation,
[31] Yu Tomita and Krysta M. Svore, Low-distance surface PRX Quantum 4, 020303 (2023).
codes under realistic quantum noise, Phys. Rev. A 90, [35] Craig Gidney, Inplace access to the surface code y basis,
062320 (2014). ArXiv:2302.07395 (2023).
010348-26