An iterative transversal CNOT decoder

Kwok Ho Wan
Mark Webber
Universal Quantum Ltd, Gemini House, Mill Green Business Estate, Haywards Heath, RH16 1XQ, United Kingdom

Austin G. Fowler
Google Inc., Santa Barbara, 93117 CA, USA

Winfried K. Hensinger
Sussex Centre for Quantum Technologies, University of Sussex, Brighton, BN1 9RH, United Kingdom
Universal Quantum Ltd, Gemini House, Mill Green Business Estate, Haywards Heath, RH16 1XQ, United Kingdom

Modern platforms for potential qubit candidates, such as trapped ions or neutral atoms, allow long range connectivity between distant physical qubits through shuttling. This opens up an avenue for transversal logical CNOT gates between distant logical qubits, whereby physical CNOT gates are performed between each corresponding physical qubit on the control and target logical qubits. However, the transversal CNOT can propagate errors from one logical qubit to another, leading to correlated errors between logical qubits. We have developed a multi-pass iterative decoder that decodes each logical qubit separately to deal with this correlated error. We show that under circuit-level noise and only $\mathcal{O}(1)$ code cycles, a threshold can still persist, and the logical error rate will not be significantly degraded, matching the sub-threshold logical error rate scaling of $p^{\floor{\frac{d}{2}}}$ for a distance $d$ rotated surface code.

§ INTRODUCTION

Quantum error correction (QEC) is essential for realising fault-tolerant quantum computation. The threshold theorem states that if the error rate per quantum gate is below a certain threshold, arbitrarily long quantum computations become possible [Gottesman, 2009]. The surface code, known for its high error threshold and ability to correct both bit-flip and phase-flip errors through local interactions, is a leading QEC candidate. It arranges qubits on a two-dimensional lattice and uses stabilizer measurements for error detection. The minimum weight perfect matching (MWPM) algorithm is an effective decoding method for the surface code [Higgott and Gidney, 2022, Higgott and Gidney, 2023, Wu and Zhong, 2023].

[scale=.7,every node/.style=minimum size=1cm,on grid]
[yshift=0,every node/.append style=yslant=0.5,xslant=-1,yslant=0.5,xslant=-1,rotate=5]
[white,fill opacity=0.0] (0,0) rectangle (10,4);
[fill=white,shape=circle,draw=black] (n4) at (2,18) ${4}$;
[fill=white,shape=circle,draw=black] (n3) at (2,14) ${3}$;
[fill=white,shape=circle,draw=black] (n2) at (2,10) ${2}$;
[fill=white,shape=circle,draw=black] (n1) at (2,6) ${1}$;
[fill=white,shape=circle,draw=black] (n0) at (2,2) ${0}$;

[fill=white,shape=circle,draw=black] (n9) at (6,18) ${9}$;
[fill=white,shape=circle,draw=black] (n8) at (6,14) ${8}$;
[fill=white,shape=circle,draw=black] (n7) at (6,10) ${7}$;
[fill=white,shape=circle,draw=black] (n6) at (6,6) ${6}$;
[fill=white,shape=circle,draw=black] (n5) at (6,2) ${5}$;

[fill=white,shape=circle,draw=black] (n14) at (10,18) ${14}$;
[fill=white,shape=circle,draw=black] (n13) at (10,14) ${13}$;
[fill=white,shape=circle,draw=black] (n12) at (10,10) ${12}$;
[fill=white,shape=circle,draw=black] (n11) at (10,6) ${11}$;
[fill=white,shape=circle,draw=black] (n10) at (10,2) ${10}$;

[fill=white,shape=circle,draw=black] (n19) at (14,18) ${19}$;
[fill=white,shape=circle,draw=black] (n18) at (14,14) ${18}$;
[fill=white,shape=circle,draw=black] (n17) at (14,10) ${17}$;
[fill=white,shape=circle,draw=black] (n16) at (14,6) ${16}$;
[fill=white,shape=circle,draw=black] (n15) at (14,2) ${15}$;

[fill=white,shape=circle,draw=black] (n24) at (18,18) ${24}$;
[fill=white,shape=circle,draw=black] (n23) at (18,14) ${23}$;
[fill=white,shape=circle,draw=black] (n22) at (18,10) ${22}$;
[fill=white,shape=circle,draw=black] (n21) at (18,6) ${21}$;
[fill=white,shape=circle,draw=black] (n20) at (18,2) ${20}$;

[blue,fill=blue,opacity=0.65](1.8,2.2) to[curve through=(0,4)](1.8,5.8);
[fill=red, opacity=0.65, draw=red] (2.2,2.2) rectangle (5.8,5.8);
[fill=blue, opacity=0.65, draw=blue] (2.2,6.2) rectangle (5.8,9.8);
[fill=red, opacity=0.65, draw=red] (2.2,10.2) rectangle (5.8,13.8);
[blue,fill=blue,opacity=0.65](1.8,10.2) to[curve through=(0,12)](1.8,13.8);
[fill=blue, opacity=0.65, draw=blue] (2.2,14.2) rectangle (5.8,17.8);
[red,fill=red,opacity=0.65](2.2,18.2) to[curve through=(4,20)](5.8,18.2);

[red,fill=red,opacity=0.65](9.8,1.8) to[curve through=(8,0)](6.2,1.8);
[fill=blue, opacity=0.65, draw=blue] (6.2,2.2) rectangle (9.8,5.8);
[fill=red, opacity=0.65, draw=red] (6.2,6.2) rectangle (9.8,9.8);
[fill=blue, opacity=0.65, draw=blue] (6.2,10.2) rectangle (9.8,13.8);
[fill=red, opacity=0.65, draw=red] (6.2,14.2) rectangle (9.8,17.8);

[fill=red, opacity=0.65, draw=red] (10.2,2.2) rectangle (13.8,5.8);
[fill=blue, opacity=0.65, draw=blue] (10.2,6.2) rectangle (13.8,9.8);
[fill=red, opacity=0.65, draw=red] (10.2,10.2) rectangle (13.8,13.8);
[fill=blue, opacity=0.65, draw=blue] (10.2,14.2) rectangle (13.8,17.8);
[red,fill=red,opacity=0.65](10.2,18.2) to[curve through=(12,20)](13.8,18.2);

[red,fill=red,opacity=0.65](17.8,1.8) to[curve through=(17,0)](14.2,1.8);
[fill=blue, opacity=0.65, draw=blue] (14.2,2.2) rectangle (17.8,5.8);
[fill=red, opacity=0.65, draw=red] (14.2,6.2) rectangle (17.8,9.8);
[blue,fill=blue,opacity=0.65](18.2,9.8) to[curve through=(20,8)](18.2,6.2);
[fill=blue, opacity=0.65, draw=blue] (14.2,10.2) rectangle (17.8,13.8);
[fill=red, opacity=0.65, draw=red] (14.2,14.2) rectangle (17.8,17.8);
[blue,fill=blue,opacity=0.65](18.2,17.8) to[curve through=(20,16)](18.2,14.2);

[yshift=560,every node/.append style=yslant=0.5,xslant=-1,yslant=0.5,xslant=-1,rotate=5]
[white,fill opacity=0.0] (0,0) rectangle (10,4);
[fill=white,shape=circle,draw=black] (n29) at (2,18) ${29}$;
[fill=white,shape=circle,draw=black] (n28) at (2,14) ${28}$;
[fill=white,shape=circle,draw=black] (n27) at (2,10) ${27}$;
[fill=white,shape=circle,draw=black] (n26) at (2,6) ${26}$;
[fill=white,shape=circle,draw=black] (n25) at (2,2) ${25}$;

[fill=white,shape=circle,draw=black] (n34) at (6,18) ${34}$;
[fill=white,shape=circle,draw=black] (n33) at (6,14) $33$;
[fill=white,shape=circle,draw=black] (n32) at (6,10) $32$;
[fill=white,shape=circle,draw=black] (n31) at (6,6) $31$;
[fill=white,shape=circle,draw=black] (n30) at (6,2) $30$;

[fill=white,shape=circle,draw=black] (n39) at (10,18) $39$;
[fill=white,shape=circle,draw=black] (n38) at (10,14) $38$;
[fill=white,shape=circle,draw=black] (n37) at (10,10) $37$;
[fill=white,shape=circle,draw=black] (n36) at (10,6) $36$;
[fill=white,shape=circle,draw=black] (n35) at (10,2) $35$;

[fill=white,shape=circle,draw=black] (n44) at (14,18) $44$;
[fill=white,shape=circle,draw=black] (n43) at (14,14) $43$;
[fill=white,shape=circle,draw=black] (n42) at (14,10) $42$;
[fill=white,shape=circle,draw=black] (n41) at (14,6) $41$;
[fill=white,shape=circle,draw=black] (n40) at (14,2) $40$;

[fill=white,shape=circle,draw=black] (n49) at (18,18) $49$;
[fill=white,shape=circle,draw=black] (n48) at (18,14) $48$;
[fill=white,shape=circle,draw=black] (n47) at (18,10) $47$;
[fill=white,shape=circle,draw=black] (n46) at (18,6) $46$;
[fill=white,shape=circle,draw=black] (n45) at (18,2) $45$;

[blue,fill=blue,opacity=0.65](1.8,2.2) to[curve through=(0,4)](1.8,5.8);
[fill=red, opacity=0.65, draw=red] (2.2,2.2) rectangle (5.8,5.8);
[fill=blue, opacity=0.65, draw=blue] (2.2,6.2) rectangle (5.8,9.8);
[fill=red, opacity=0.65, draw=red] (2.2,10.2) rectangle (5.8,13.8);
[blue,fill=blue,opacity=0.65](1.8,10.2) to[curve through=(0,12)](1.8,13.8);
[fill=blue, opacity=0.65, draw=blue] (2.2,14.2) rectangle (5.8,17.8);
[red,fill=red,opacity=0.65](2.2,18.2) to[curve through=(4,20)](5.8,18.2);

[red,fill=red,opacity=0.65](9.8,1.8) to[curve through=(8,0)](6.2,1.8);
[fill=blue, opacity=0.65, draw=blue] (6.2,2.2) rectangle (9.8,5.8);
[fill=red, opacity=0.65, draw=red] (6.2,6.2) rectangle (9.8,9.8);
[fill=blue, opacity=0.65, draw=blue] (6.2,10.2) rectangle (9.8,13.8);
[fill=red, opacity=0.65, draw=red] (6.2,14.2) rectangle (9.8,17.8);

[fill=red, opacity=0.65, draw=red] (10.2,2.2) rectangle (13.8,5.8);
[fill=blue, opacity=0.65, draw=blue] (10.2,6.2) rectangle (13.8,9.8);
[fill=red, opacity=0.65, draw=red] (10.2,10.2) rectangle (13.8,13.8);
[fill=blue, opacity=0.65, draw=blue] (10.2,14.2) rectangle (13.8,17.8);
[red,fill=red,opacity=0.65](10.2,18.2) to[curve through=(12,20)](13.8,18.2);

[red,fill=red,opacity=0.65](17.8,1.8) to[curve through=(17,0)](14.2,1.8);
[fill=blue, opacity=0.65, draw=blue] (14.2,2.2) rectangle (17.8,5.8);
[fill=red, opacity=0.65, draw=red] (14.2,6.2) rectangle (17.8,9.8);
[blue,fill=blue,opacity=0.65](18.2,9.8) to[curve through=(20,8)](18.2,6.2);
[fill=blue, opacity=0.65, draw=blue] (14.2,10.2) rectangle (17.8,13.8);
[fill=red, opacity=0.65, draw=red] (14.2,14.2) rectangle (17.8,17.8);
[blue,fill=blue,opacity=0.65](18.2,17.8) to[curve through=(20,16)](18.2,14.2);

phase/.style = draw,fill,shape=circle,minimum size=10pt,inner sep=0pt,
surround/.style = fill=blue!10,thick,draw=black,rounded corners=2mm,
circlewc/.style=draw,circle,cross,minimum width=0.3 cm,

in 0,...,24

+ 25
[-,line width=1cm,black,opacity=0.1] (n) edge node  (n);
[circlewc] (target_0) at ([yshift=535]n) ;
[phase] (control_0) at ([yshift=25]n) ;
[-,line width=0.1cm,black,opacity=0.65] (control_0) edge node  (target_0);

Two patches/copies of distance 5 rotated surface codes. A transversal logical CNOT operation is performed by apply physical CNOT gates between the corresponding physical qubits of the two patches.

Quantum computing hardware varies in connectivity capabilities. Superconducting qubits typically have fixed, limited connectivity which is imposed by the chip topology, while platforms like trapped ions, neutral atoms, and photonics allow for long-range connectivity. For example, in the trapped ion paradigm, ion shuttling operations enable arbitrary connectivity [Webber et al., 2020]. The variability of connectivity influences QEC implementation and efficiency across different systems.

Lattice surgery is a common technique for performing logical operations in the surface code while relying only on nearest neighbour operations. It involves merging and splitting logical qubits to facilitate operations such as the logical CNOT gate. The time complexity of lattice surgery scales with the code distance, typically requiring $\mathcal{O}(d^3)$ volume, where $d$ is the code distance. One possible implementation requires a time complexity of $2d$ and three logical qubits, one of which is an ancilla patch for mediating the merging and splitting operations [Horsman et al., 2012, Chatterjee et al., 2024]. Note that all Clifford operations can be done in 0 time given sufficient qubits [Fowler, 2013].

The transversal CNOT gate offers an alternative approach. It requires performing a physical CNOT operation between every corresponding physical qubit of the logical qubits. For $N$ data qubits per logical qubit, $N$ CNOT operations are needed, often involving long-range interactions. The transversal CNOT deterministically maps Pauli errors between patches: X errors are mapped from control to target, and Z errors are mapped from target to control. This mapping, if uncorrected, leads to spurious detection events which will greatly degrade logical qubit performance if standard decoding methods like MWPM are used.

Recent research has focused on developing specialized decoders for transversal CNOT gates [Beverland et al., 2021, Bluvstein et al., 2024, Cain et al., 2024, Zhou et al., 2024, Hangleiter et al., 2024, Kim et al., 2024, Sahay, 2024, Hetényi and Wootton, 2024]. Our work significantly expands upon a concept briefly mentioned[As a long footnote.] in [Beverland et al., 2021], by developing a multi-pass iterative decoder that addresses the correlated errors spread by the transversal CNOT. This decoder processes each logical patch separately in multiple passes to correct these correlated errors.

Modern qubit platforms supporting long-range connectivity make transversal CNOT gates feasible, potentially improving resource estimates for quantum computing. Our multi-pass iterative decoder demonstrates that, even under circuit-level noise and only $\mathcal{O}(1)$ code cycles, a threshold can persist without significant degradation of the logical error rate. This matches the sub-threshold logical error rate scaling of $p^{\lfloor d/2 \rfloor}$ for a distance $d$ rotated surface code.

This paper presents an analysis of our multi-pass iterative decoder for transversal CNOT gates, including its design, implementation, and performance characteristics.

Specifically, we illustrate a simple method to separately decode two different patches of surface codes that had undergone transversal CNOT operations, we assume:

* error-free and instantaneous transversal CNOT operations and

* standard circuit-level depolarising noise model on all other gates - SD6 [Albert and Faist, 2024].

We argue that the error-free transversal operation should not significantly impact the overall behavior of the logical error rates, as the realistic transversal CNOT error is expected to contribute only a marginally higher circuit-level noise error rate [Higgott and Gidney, 2022] for some hardware platforms [Webber et al., 2020]. Furthermore, the idealized transversal CNOT operation suffices for the primary purposes of our investigation here, i.e. the performance of a new approach to decoding. A detailed analysis into hardware realistic connectivity error models and its impact on the performance of the transversal CNOT operation relative to lattice surgery is in preparation [18].

Our work has significant implications for resource estimation in quantum advantage applications, where there exists a trade-off space between run times and the number of magic state distillation factories. Previous work [Fowler and Gidney, 2019, Gidney and Fowler, 2019, Tan et al., 2024] has assumed lattice surgery operations and demonstrated the benefits of fast code cycle times when other factors are held constant. For instance, trapped ion hardware, with code cycle times potentially three orders of magnitude slower than superconducting qubits, would traditionally require substantially more physical qubits to achieve comparable quantum advantage run times [Webber et al., 2022]. This comparison assumes the same QEC methods and physical error rates across both platforms.

However, transversal operations offer potential improvements in both the volume scaling of magic state factories and the overhead associated with parallelized magic state consumption. By leveraging these advantages along with enhanced connectivity and higher baseline fidelities on physical gates, slower hardware architectures may be able to bridge the gap in physical qubit requirements to reach runtime parity with faster but locally-connected systems. Our findings suggest that the integration of transversal CNOT gates and specialized decoding techniques could significantly impact the resource landscape across diverse quantum computing platforms, potentially altering the balance between speed and qubit count in the pursuit of quantum advantage.

§ THE REPETITION CODE

In the following sections, we illustrate our iterative transversal CNOT decoding method with the repetition code. Due to the surface code's symmetry in suppressing Pauli-X and -Z error, it is sufficient to study the repetition code for the intuition behind our method. For simplicity, we also assume no mid-circuit errors for the visualisation of this decoding procedure. However, it should be noted that this method easily generalises to accommodate mid-circuit errors.

A distance $d$ repetition code has code words $\ket{\bar{0}}=\ket{0}^{\otimes d},\ket{\bar{1}}=\ket{1}^{\otimes d}$ and can be represented with the following stabiliser generators, $\mathcal{G}$, and logical operators $\bar{X}$ and $\bar{Z}$:

\begin{equation}
\begin{split}
\mathcal{G}=\Bigg\langle \bigcup_{j=0}^{d-2} Z_jZ_{j+1} \Bigg\rangle, \ \bar{X} = \prod_{i=0}^{d-1} X_i \ , \ \bar{Z} = Z_k \ ,
\end{split}
\end{equation}

where $Z_j$($X_j$) are Pauli-Z(X) operator acting on physical qubit $j$. If we were to repeatedly measure the stabiliser generators of this code, we can detect and correct for Pauli-X errors only. In the particular example in figure <ref>, we initialise the repetition code and measure the parity checks for 3 rounds before subsequently measuring all the data qubits. We can then construct the syndrome of this quantum memory experiment [Fowler and Gidney, 2019] (in this case a classical code). For $t=1,2$, the syndrome data/detector clicks can be constructed by the calculating the modulo 2 difference ($\oplus$) of the same parity check measurement separate by one step in time.

[scale=1,every node/.style=minimum size=1cm,on grid]
[xshift=0,every node/.append style=yslant=0,xslant=0,yslant=0,xslant=0]
[white,fill opacity=0.0] (0,0) rectangle (10,6);
[fill=none,draw=none] (t0) at (-1,0) $t=0:$;
[fill=white,shape=circle,draw=none] (N0T0) at (0,0) ;
[fill=white,shape=circle,draw=black] (N1T0) at (2,0) ;
[fill=white,shape=circle,draw=black] (N2T0) at (4,0) ;
[fill=white,shape=circle,draw=black] (N3T0) at (6,0) ;
[fill=white,shape=circle,draw=black] (N4T0) at (8,0) ;
[fill=white,shape=circle,draw=none] (N5T0) at (10,0) ;

[-,line width=0.01cm,black,opacity=1] (N0T0) edge node  (N1T0);
[-,line width=0.01cm,black,opacity=1] (N1T0) edge node  (N2T0);
[-,line width=0.01cm,black,opacity=1] (N2T0) edge node  (N3T0);
[-,line width=0.01cm,black,opacity=1] (N3T0) edge node  (N4T0);
[-,line width=0.01cm,black,opacity=1] (N4T0) edge node  (N5T0);

[fill=none,draw=none,text=black] (qb0) at (1,0.25)
[fill=none,draw=none,text=black] (qb1) at (3,0.25)
[fill=none,draw=none,text=black] (qb2) at (5,0.25)
[fill=none,draw=none,text=black] (qb3) at (7,0.25)
[fill=none,draw=none,text=black] (qb4) at (9,0.25)

[fill=none,draw=none] (t1) at (-1,2) $t=1:$;
[fill=white,shape=circle,draw=none] (N0T1) at (0,2) ;
[fill=white,shape=circle,draw=black] (N1T1) at (2,2) ;
[fill=white,shape=circle,draw=black] (N2T1) at (4,2) ;
[fill=white,shape=circle,draw=black] (N3T1) at (6,2) ;
[fill=white,shape=circle,draw=black] (N4T1) at (8,2) ;
[fill=white,shape=circle,draw=none] (N5T1) at (10,2) ;

[-,line width=0.01cm,black,opacity=1] (N0T1) edge node  (N1T1);
[-,line width=0.01cm,black,opacity=1] (N1T1) edge node  (N2T1);
[-,line width=0.01cm,black,opacity=1] (N2T1) edge node  (N3T1);
[-,line width=0.01cm,black,opacity=1] (N3T1) edge node  (N4T1);
[-,line width=0.01cm,black,opacity=1] (N4T1) edge node  (N5T1);

[fill=none,draw=none] (t2) at (-1,4) $t=2:$;
[fill=white,shape=circle,draw=none] (N0T2) at (0,4) ;
[fill=white,shape=circle,draw=black] (N1T2) at (2,4) ;
[fill=white,shape=circle,draw=black] (N2T2) at (4,4) ;
[fill=white,shape=circle,draw=black] (N3T2) at (6,4) ;
[fill=white,shape=circle,draw=black] (N4T2) at (8,4) ;
[fill=white,shape=circle,draw=none] (N5T2) at (10,4) ;

[-,line width=0.01cm,black,opacity=1] (N0T2) edge node  (N1T2);
[-,line width=0.01cm,black,opacity=1] (N1T2) edge node  (N2T2);
[-,line width=0.01cm,black,opacity=1] (N2T2) edge node  (N3T2);
[-,line width=0.01cm,black,opacity=1] (N3T2) edge node  (N4T2);
[-,line width=0.01cm,black,opacity=1] (N4T2) edge node  (N5T2);

[fill=none,draw=none] (t3) at (-1,6) $t=3:$;
[fill=white,shape=circle,draw=none] (N0T3) at (0,6) ;
[fill=white,shape=circle,draw=black] (N1T3) at (2,6) ;
[fill=white,shape=circle,draw=black] (N2T3) at (4,6) ;
[fill=white,shape=circle,draw=black] (N3T3) at (6,6) ;
[fill=white,shape=circle,draw=black] (N4T3) at (8,6) ;
[fill=white,shape=circle,draw=none] (N5T3) at (10,6) ;

[-,line width=0.01cm,black,opacity=1] (N0T3) edge node  (N1T3);
[-,line width=0.01cm,black,opacity=1] (N1T3) edge node  (N2T3);
[-,line width=0.01cm,black,opacity=1] (N2T3) edge node  (N3T3);
[-,line width=0.01cm,black,opacity=1] (N3T3) edge node  (N4T3);
[-,line width=0.01cm,black,opacity=1] (N4T3) edge node  (N5T3);

[-,line width=0.01cm,black,opacity=1] (N1T0) edge node  (N1T1);
[-,line width=0.01cm,black,opacity=1] (N1T1) edge node  (N1T2);
[-,line width=0.01cm,black,opacity=1] (N1T2) edge node  (N1T3);

[-,line width=0.01cm,black,opacity=1] (N2T0) edge node  (N2T1);
[-,line width=0.01cm,black,opacity=1] (N2T1) edge node  (N2T2);
[-,line width=0.01cm,black,opacity=1] (N2T2) edge node  (N2T3);

[-,line width=0.01cm,black,opacity=1] (N3T0) edge node  (N3T1);
[-,line width=0.01cm,black,opacity=1] (N3T1) edge node  (N3T2);
[-,line width=0.01cm,black,opacity=1] (N3T2) edge node  (N3T3);

[-,line width=0.01cm,black,opacity=1] (N4T0) edge node  (N4T1);
[-,line width=0.01cm,black,opacity=1] (N4T1) edge node  (N4T2);
[-,line width=0.01cm,black,opacity=1] (N4T2) edge node  (N4T3);

Distance 5 repetition code (can tolerate $\floor{d/2}=2$ errors before failing) decoding graph for 4 time steps, assuming no mid-circuit errors (no diagonal edges in the syndrome graph).

Figure <ref> is a syndrome graph for this quantum memory experiment with 3 rounds of syndrome extractions. The horizontal edges at each time slices of this graph represents the qubits and vertical edges between time slices correspond to the possibility of measurement errors. Detectors are the nodes of this graph, carrying the syndrome information and will be coloured if the parity of the measurements associated with the detected differs from that expected.

§ CORRELATED ERRORS

A CNOT operation inherently spread errors between the control and target modes. X errors will flow from the control to target modes (shown in equation <ref>) and Z errors will flow from the target to control mode (see equation <ref>).

\begin{equation}
\label{eq:X_spread}
\begin{split}
\begin{tikzpicture}
\begin{yquantgroup}
\registers{
qubit {} q[2];
\circuit{
X q[0];
cnot q[1] | q[0];
\equals
\circuit{
cnot q[1] | q[0];
X -;
\end{yquantgroup}
\end{tikzpicture}
\\
\begin{tikzpicture}
\begin{yquantgroup}
\registers{
qubit {} q[2];
\circuit{
X q[1];
cnot q[1] | q[0];
\equals
\circuit{
cnot q[1] | q[0];
X q[1];
\end{yquantgroup}
\end{tikzpicture}
\end{split}
\end{equation}

\begin{equation}
\label{eq:Z_spread}
\begin{split}
\begin{tikzpicture}
\begin{yquantgroup}
\registers{
qubit {} q[2];
\circuit{
Z q[0];
cnot q[1] | q[0];
\equals
\circuit{
cnot q[1] | q[0];
Z q[0];
\end{yquantgroup}
\end{tikzpicture}
\\
\begin{tikzpicture}
\begin{yquantgroup}
\registers{
qubit {} q[2];
\circuit{
Z q[1];
cnot q[1] | q[0];
\equals
\circuit{
cnot q[1] | q[0];
Z -;
\end{yquantgroup}
\end{tikzpicture}
\end{split}
\end{equation}

For simplicity, in this discussion we focus on the X errors only and note that by symmetry, the argument is valid for the Z errors with the control and target modes reversed. The transversal CNOT will deterministically map X errors from the control to target patch. If this propagated error is not corrected for, it will cause spurious detection events appearing on the target node right after the transversal CNOT.  Ultimately, this has the overall effect of  a degraded logical error rate. However, if we can first decode the control patch, and have a suitable guess for the locations of the X errors, we can use that to cancel out the propagated X error on the target patch. The motivation behind our decoder is to use a conventional memory experiment decoder for a single logical qubit memory experiment, which decodes each logical qubit separately, updates the syndrome data and Pauli-frame of each individual logical qubit and then propagates that information before decoding again iteratively. This process repeats until the Pauli-frames converge to a stable state. The number of iterations required is a function of the circuit structure, where simple circuits only ever require one iteration.

§ ITERATIVE DECODER FOR THE REPETITION CODE

We shall illustrate our approach with two examples concerning the repetition code. The first example (Example 1) involves a single transversal CNOT, requiring only a single-pass decoder, whereas the multiple CNOT version (Example 2) requires multiple rounds of iterative decoding.

We use the following notation and conventions to separate different detectors and edges by colour.

* “Natural” errors (edges) and detectors (nodes) are coloured  red, 0.2!
[scale=1,every node/.style=minimum size=1cm,on grid]
[xshift=0,every node/.append style=yslant=0,xslant=0,yslant=0,xslant=0]
[white,fill opacity=0.0] (0,0) rectangle (5,1);
[fill=none,shape=circle,draw=none] (N0T0) at (0,0) ;
[fill=red,shape=circle,draw=black] (N1T0) at (2,0) ;
[fill=none,shape=circle,draw=none] (N2T0) at (4,0) ;

[-,line width=0.1cm,red,opacity=1] (N0T0) edge node  (N1T0);
[-,line width=0.01cm,black,opacity=1] (N1T0) edge node  (N2T0);

, they are the errored edges and detectors that occur genuinely, and are not due to the propagation effects of the CNOT.

* Propagated errors (edges) and detectors (nodes) are coloured  brown, 0.2!
[scale=1,every node/.style=minimum size=1cm,on grid]
[xshift=0,every node/.append style=yslant=0,xslant=0,yslant=0,xslant=0]
[white,fill opacity=0.0] (0,0) rectangle (5,1);
[fill=none,shape=circle,draw=none] (N0T0) at (0,0) ;
[fill=brown,shape=circle,draw=black] (N1T0) at (2,0) ;
[fill=none,shape=circle,draw=none] (N2T0) at (4,0) ;

[-,line width=0.1cm,brown,opacity=1] (N0T0) edge node  (N1T0);
[-,line width=0.01cm,black,opacity=1] (N1T0) edge node  (N2T0);

, they are the errored edges and detectors that are caused solely by the propagation of errors due to the CNOT.

* Decoded matched edges are coloured  blue, they are the edges returned by the MWPM decoding algorithm,
[scale=1,every node/.style=minimum size=1cm,on grid]
[xshift=0,every node/.append style=yslant=0,xslant=0,yslant=0,xslant=0]
[white,fill opacity=0.0] (0,0) rectangle (5,1);
[fill=none,shape=circle,draw=none] (N0T0) at (0,0) ;
[fill=red,shape=circle,draw=black] (N1T0) at (2,0) ;
[fill=none,shape=circle,draw=none] (N2T0) at (4,0) ;

[-,line width=0.1cm,red,opacity=1] (N0T0) edge node  (N1T0);
[-,line width=0.01cm,black,opacity=1] (N1T0) edge node  (N2T0);

[-,line width=0.1cm,blue,opacity=1] ($(N0T0.east) + (0,0.5)$) edge node  ($(N1T0) +(0,0.5)$);

, in this case the blue decoded edge had correctly corrected for the red corrupted edge.

* The stored propagated edges are coloured  green, they are the recorded edges perceived to be propagated by the error spreading effects of the CNOT,
[scale=1,every node/.style=minimum size=1cm,on grid]
[xshift=0,every node/.append style=yslant=0,xslant=0,yslant=0,xslant=0]
[white,fill opacity=0.0] (0,0) rectangle (5,1);
[fill=none,shape=circle,draw=none] (N0T0) at (0,0) ;
[fill=brown,shape=circle,draw=black] (N1T0) at (2,0) ;
[fill=none,shape=circle,draw=none] (N2T0) at (4,0) ;

[-,line width=0.1cm,brown,opacity=1] (N0T0) edge node  (N1T0);
[-,line width=0.01cm,black,opacity=1] (N1T0) edge node  (N2T0);

[-,line width=0.1cm,green,opacity=1] ($(N0T0.east) + (0,0.5)$) edge node  ($(N1T0) +(0,0.5)$);

, in this case the green propagated edge had correctly corrected for the brown propagated edge.

The core part of the method relies on propagating Pauli errors and detection events between the patches. For example with X errors, the Pauli frame of the control patch directly before the CNOT operation is determined, and propagated in the round following the CNOT into a separate stored list corresponding to the target patch. Next the associated detectors of the control Pauli Patch are propagated modulo 2 into the detector pattern of the target patch. The procedure acts to recover the detector pattern corresponding to only the natural errors while the Pauli errors determined to be propagated are stored separately. The logical observable is determined by combining the detector pattern decoded Pauli frame with the propagated Pauli frame.

Each CNOT is addressed in this manner sequentially. For more complex circuits, like those with alternating directions of CNOT operations, more than one iteration may be required, where each iteration involves addressing every CNOT in the circuit, first undoing the impact of this particular CNOT from the prior iteration, and then again performing the propagation of Pauli errors and detectors. The termination clause is when the combined Pauli frame for each logical qubit converges to a stable state, i.e. equality between this iteration and the prior. For circuits with two alternating direction CNOT operations, at most two iterations are ever required. A flowchart illustrating the iterative method is found in appendix <ref>.

§.§ Example 1: Single pass decoder

In figure <ref>s and <ref>s, chronologically in time from figure <ref> to figure <ref>, we show a method to modify syndromes and record propagated edges to decode a single logical transversal CNOT acting between two logical qubits (left and right).

Firstly, in figure <ref>, we see a detector pattern, and have annotated the propagated detectors and edges with the brown nodes and edges respectively, and also labelled the errored qubits with red edges for illustrative purposes. However in an actual experiment, this information is not available.

[ Original detector pattern without any modifications.]
[scale=1,every node/.style=minimum size=1cm,on grid]
[xshift=0,every node/.append style=yslant=0,xslant=0,yslant=0,xslant=0]
[white,fill opacity=0.0] (0,0) rectangle (10,2);
[fill=white,draw=none] (t0) at (-2,0) $t=0:$;
[fill=white,shape=circle,draw=none] (N0T0) at (0,0) ;
[fill=white,shape=circle,draw=black] (N1T0) at (2,0) ;
[fill=red,shape=circle,draw=black] (N2T0) at (4,0) ;
[fill=white,shape=circle,draw=black] (N3T0) at (6,0) ;
[fill=white,shape=circle,draw=black] (N4T0) at (8,0) ;
[fill=white,shape=circle,draw=none] (N5T0) at (10,0) ;

[-,line width=0.1cm,red,opacity=1] (N0T0) edge node  (N1T0);
[-,line width=0.1cm,red,opacity=1] (N1T0) edge node  (N2T0);
[-,line width=0.01cm,black,opacity=1] (N2T0) edge node  (N3T0);
[-,line width=0.01cm,black,opacity=1] (N3T0) edge node  (N4T0);
[-,line width=0.01cm,black,opacity=1] (N4T0) edge node  (N5T0);

[fill=white,draw=none] (t1) at (-2,2) $t=1:$;
[fill=white,shape=circle,draw=none] (N0T1) at (0,2) ;
[fill=white,shape=circle,draw=black] (N1T1) at (2,2) ;
[fill=white,shape=circle,draw=black] (N2T1) at (4,2) ;
[fill=white,shape=circle,draw=black] (N3T1) at (6,2) ;
[fill=white,shape=circle,draw=black] (N4T1) at (8,2) ;
[fill=white,shape=circle,draw=none] (N5T1) at (10,2) ;

[-,line width=0.01cm,black,opacity=1] (N0T1) edge node  (N1T1);
[-,line width=0.01cm,black,opacity=1] (N1T1) edge node  (N2T1);
[-,line width=0.01cm,black,opacity=1] (N2T1) edge node  (N3T1);
[-,line width=0.01cm,black,opacity=1] (N3T1) edge node  (N4T1);
[-,line width=0.01cm,black,opacity=1] (N4T1) edge node  (N5T1);

[-,line width=0.01cm,black,opacity=1] (N1T0) edge node  (N1T1);

[-,line width=0.01cm,black,opacity=1] (N2T0) edge node  (N2T1);

[-,line width=0.01cm,black,opacity=1] (N3T0) edge node  (N3T1);

[-,line width=0.01cm,black,opacity=1] (N4T0) edge node  (N4T1);

[xshift=300,every node/.append style=yslant=0,xslant=0,yslant=0,xslant=0]
[white,fill opacity=0.0] (0,0) rectangle (10,2);

[fill=white,shape=circle,draw=none] (N0T0) at (0,0) ;
[fill=white,shape=circle,draw=black] (N1T0) at (2,0) ;
[fill=white,shape=circle,draw=black] (N2T0) at (4,0) ;
[fill=white,shape=circle,draw=black] (N3T0) at (6,0) ;
[fill=white,shape=circle,draw=black] (N4T0) at (8,0) ;
[fill=white,shape=circle,draw=none] (N5T0) at (10,0) ;

[-,line width=0.01cm,black,opacity=1] (N0T0) edge node  (N1T0);
[-,line width=0.01cm,black,opacity=1] (N1T0) edge node  (N2T0);
[-,line width=0.01cm,black,opacity=1] (N2T0) edge node  (N3T0);
[-,line width=0.01cm,black,opacity=1] (N3T0) edge node  (N4T0);
[-,line width=0.01cm,black,opacity=1] (N4T0) edge node  (N5T0);

[fill=white,shape=circle,draw=none] (N0T1) at (0,2) ;
[fill=white,shape=circle,draw=black] (N1T1) at (2,2) ;
[fill=brown,shape=circle,draw=black] (N2T1) at (4,2) ;
[fill=white,shape=circle,draw=black] (N3T1) at (6,2) ;
[fill=red,shape=circle,draw=black] (N4T1) at (8,2) ;
[fill=white,shape=circle,draw=none] (N5T1) at (10,2) ;

[-,line width=0.1cm,brown,opacity=1] (N0T1) edge node  (N1T1);
[-,line width=0.1cm,brown,opacity=1] (N1T1) edge node  (N2T1);
[-,line width=0.01cm,black,opacity=1] (N2T1) edge node  (N3T1);
[-,line width=0.01cm,black,opacity=1] (N3T1) edge node  (N4T1);
[-,line width=0.1cm,red,opacity=1] (N4T1) edge node  (N5T1);

[-,line width=0.01cm,black,opacity=1] (N1T0) edge node  (N1T1);

[-,line width=0.01cm,black,opacity=1] (N2T0) edge node  (N2T1);

[-,line width=0.01cm,black,opacity=1] (N3T0) edge node  (N3T1);

[-,line width=0.01cm,black,opacity=1] (N4T0) edge node  (N4T1);

[xshift=320,every node/.append style=yslant=0,xslant=0,yslant=0,xslant=0]
[circlewc] (target_4) at (0,1) ;
[phase] (control_4) at (-2,1) ;

[-,line width=0.01cm,black,opacity=1] (target_4) edge node  (control_4);

[ Decode both logical qubits and record the blue decoded edges, we can see that we have arrived at incorrectly decoded edges.]
[scale=1,every node/.style=minimum size=1cm,on grid]
[xshift=0,every node/.append style=yslant=0,xslant=0,yslant=0,xslant=0]
[white,fill opacity=0.0] (0,0) rectangle (10,2);
[fill=none,draw=none] (t0) at (-2,0) $t=0:$;
[fill=white,shape=circle,draw=none] (N0T0) at (0,0) ;
[fill=white,shape=circle,draw=black] (N1T0) at (2,0) ;
[fill=red,shape=circle,draw=black] (N2T0) at (4,0) ;
[fill=white,shape=circle,draw=black] (N3T0) at (6,0) ;
[fill=white,shape=circle,draw=black] (N4T0) at (8,0) ;
[fill=white,shape=circle,draw=none] (N5T0) at (10,0) ;

[-,line width=0.1cm,red,opacity=1] (N0T0) edge node  (N1T0);
[-,line width=0.1cm,red,opacity=1] (N1T0) edge node  (N2T0);
[-,line width=0.01cm,black,opacity=1] (N2T0) edge node  (N3T0);
[-,line width=0.01cm,black,opacity=1] (N3T0) edge node  (N4T0);
[-,line width=0.01cm,black,opacity=1] (N4T0) edge node  (N5T0);

[-,line width=0.1cm,blue,opacity=1] ($(N0T0.east) + (0,0.5)$) edge node  ($(N1T0) +(0,0.5)$);
[-,line width=0.1cm,blue,opacity=1] ($(N1T0) + (0,0.5)$) edge node  ($(N2T0) +(0,0.5)$);

[fill=none,draw=none] (t1) at (-2,2) $t=1:$;
[fill=white,shape=circle,draw=none] (N0T1) at (0,2) ;
[fill=white,shape=circle,draw=black] (N1T1) at (2,2) ;
[fill=white,shape=circle,draw=black] (N2T1) at (4,2) ;
[fill=white,shape=circle,draw=black] (N3T1) at (6,2) ;
[fill=white,shape=circle,draw=black] (N4T1) at (8,2) ;
[fill=white,shape=circle,draw=none] (N5T1) at (10,2) ;

[-,line width=0.01cm,black,opacity=1] (N0T1) edge node  (N1T1);
[-,line width=0.01cm,black,opacity=1] (N1T1) edge node  (N2T1);
[-,line width=0.01cm,black,opacity=1] (N2T1) edge node  (N3T1);
[-,line width=0.01cm,black,opacity=1] (N3T1) edge node  (N4T1);
[-,line width=0.01cm,black,opacity=1] (N4T1) edge node  (N5T1);

[-,line width=0.01cm,black,opacity=1] (N1T0) edge node  (N1T1);

[-,line width=0.01cm,black,opacity=1] (N2T0) edge node  (N2T1);

[-,line width=0.01cm,black,opacity=1] (N3T0) edge node  (N3T1);

[-,line width=0.01cm,black,opacity=1] (N4T0) edge node  (N4T1);

[blue,fill=none,shape=rectangle,draw=none]() at ($(N1T0) +(8,-2)$) Decode both patches and record decoded edges.;

[xshift=300,every node/.append style=yslant=0,xslant=0,yslant=0,xslant=0]
[white,fill opacity=0.0] (0,0) rectangle (10,2);

[fill=white,shape=circle,draw=none] (N0T0) at (0,0) ;
[fill=white,shape=circle,draw=black] (N1T0) at (2,0) ;
[fill=white,shape=circle,draw=black] (N2T0) at (4,0) ;
[fill=white,shape=circle,draw=black] (N3T0) at (6,0) ;
[fill=white,shape=circle,draw=black] (N4T0) at (8,0) ;
[fill=white,shape=circle,draw=none] (N5T0) at (10,0) ;

[-,line width=0.01cm,black,opacity=1] (N0T0) edge node  (N1T0);
[-,line width=0.01cm,black,opacity=1] (N1T0) edge node  (N2T0);
[-,line width=0.01cm,black,opacity=1] (N2T0) edge node  (N3T0);
[-,line width=0.01cm,black,opacity=1] (N3T0) edge node  (N4T0);
[-,line width=0.01cm,black,opacity=1] (N4T0) edge node  (N5T0);

[fill=white,shape=circle,draw=none] (N0T1) at (0,2) ;
[fill=white,shape=circle,draw=black] (N1T1) at (2,2) ;
[fill=brown,shape=circle,draw=black] (N2T1) at (4,2) ;
[fill=white,shape=circle,draw=black] (N3T1) at (6,2) ;
[fill=red,shape=circle,draw=black] (N4T1) at (8,2) ;
[fill=white,shape=circle,draw=none] (N5T1) at (10,2) ;

[-,line width=0.1cm,brown,opacity=1] (N0T1) edge node  (N1T1);
[-,line width=0.1cm,brown,opacity=1] (N1T1) edge node  (N2T1);
[-,line width=0.01cm,black,opacity=1] (N2T1) edge node  (N3T1);
[-,line width=0.01cm,black,opacity=1] (N3T1) edge node  (N4T1);
[-,line width=0.1cm,red,opacity=1] (N4T1) edge node  (N5T1);

[-,line width=0.01cm,black,opacity=1] (N1T0) edge node  (N1T1);

[-,line width=0.01cm,black,opacity=1] (N2T0) edge node  (N2T1);

[-,line width=0.01cm,black,opacity=1] (N3T0) edge node  (N3T1);

[-,line width=0.01cm,black,opacity=1] (N4T0) edge node  (N4T1);

[-,line width=0.1cm,blue,opacity=1] ($(N2T1) + (0,0.5)$) edge node  ($(N3T1) +(0,0.5)$);
[-,line width=0.1cm,blue,opacity=1] ($(N3T1) + (0,0.5)$) edge node  ($(N4T1) +(0,0.5)$);

[xshift=320,every node/.append style=yslant=0,xslant=0,yslant=0,xslant=0]
[circlewc] (target_4) at (0,1) ;
[phase] (control_4) at (-2,1) ;

[-,line width=0.01cm,black,opacity=1] (target_4) edge node  (control_4);

Figures <ref> and <ref> show the decoding procedure before the propagation of the Pauli-frame from the left to the right logical qubit in order to reduce the number of spurious detectors resulting from the transversal logical CNOT. We can observe that in this case, we have decoded and arrived at incorrect edges.

In figure <ref>, we decode the left and right logical qubits and record the blue decoded edges in figure <ref>. In this case, decoding has chosen some edges incorrectly.

[ The Pauli-frame is propagated over to the right logical qubit, removing spurious events and with green propagated edges recorded.]
[scale=1,every node/.style=minimum size=1cm,on grid]
[xshift=0,every node/.append style=yslant=0,xslant=0,yslant=0,xslant=0]
[white,fill opacity=0.0] (0,0) rectangle (10,2);
[fill=white,draw=none] (t0) at (-2,0) $t=0:$;
[fill=white,shape=circle,draw=none] (N0T0) at (0,0) ;
[fill=white,shape=circle,draw=black] (N1T0) at (2,0) ;
[fill=red,shape=circle,draw=black] (N2T0) at (4,0) ;
[fill=white,shape=circle,draw=black] (N3T0) at (6,0) ;
[fill=white,shape=circle,draw=black] (N4T0) at (8,0) ;
[fill=white,shape=circle,draw=none] (N5T0) at (10,0) ;

[-,line width=0.1cm,red,opacity=1] (N0T0) edge node  (N1T0);
[-,line width=0.1cm,red,opacity=1] (N1T0) edge node  (N2T0);
[-,line width=0.01cm,black,opacity=1] (N2T0) edge node  (N3T0);
[-,line width=0.01cm,black,opacity=1] (N3T0) edge node  (N4T0);
[-,line width=0.01cm,black,opacity=1] (N4T0) edge node  (N5T0);

[-,line width=0.1cm,blue,opacity=1] ($(N0T0.east) + (0,0.5)$) edge node  ($(N1T0) +(0,0.5)$);
[-,line width=0.1cm,blue,opacity=1] ($(N1T0) + (0,0.5)$) edge node  ($(N2T0) +(0,0.5)$);

[fill=white,draw=none] (t1) at (-2,2) $t=1:$;
[fill=white,shape=circle,draw=none] (N0T1) at (0,2) ;
[fill=white,shape=circle,draw=black] (N1T1) at (2,2) ;
[fill=white,shape=circle,draw=black] (N2T1) at (4,2) ;
[fill=white,shape=circle,draw=black] (N3T1) at (6,2) ;
[fill=white,shape=circle,draw=black] (N4T1) at (8,2) ;
[fill=white,shape=circle,draw=none] (N5T1) at (10,2) ;

[-,line width=0.01cm,black,opacity=1] (N0T1) edge node  (N1T1);
[-,line width=0.01cm,black,opacity=1] (N1T1) edge node  (N2T1);
[-,line width=0.01cm,black,opacity=1] (N2T1) edge node  (N3T1);
[-,line width=0.01cm,black,opacity=1] (N3T1) edge node  (N4T1);
[-,line width=0.01cm,black,opacity=1] (N4T1) edge node  (N5T1);

[-,line width=0.01cm,black,opacity=1] (N1T0) edge node  (N1T1);

[-,line width=0.01cm,black,opacity=1] (N2T0) edge node  (N2T1);

[-,line width=0.01cm,black,opacity=1] (N3T0) edge node  (N3T1);

[-,line width=0.01cm,black,opacity=1] (N4T0) edge node  (N4T1);

[xshift=300,every node/.append style=yslant=0,xslant=0,yslant=0,xslant=0]
[white,fill opacity=0.0] (0,0) rectangle (10,2);

[fill=white,shape=circle,draw=none] (N0T0) at (0,0) ;
[fill=white,shape=circle,draw=black] (N1T0) at (2,0) ;
[fill=white,shape=circle,draw=black] (N2T0) at (4,0) ;
[fill=white,shape=circle,draw=black] (N3T0) at (6,0) ;
[fill=white,shape=circle,draw=black] (N4T0) at (8,0) ;
[fill=white,shape=circle,draw=none] (N5T0) at (10,0) ;

[-,line width=0.01cm,black,opacity=1] (N0T0) edge node  (N1T0);
[-,line width=0.01cm,black,opacity=1] (N1T0) edge node  (N2T0);
[-,line width=0.01cm,black,opacity=1] (N2T0) edge node  (N3T0);
[-,line width=0.01cm,black,opacity=1] (N3T0) edge node  (N4T0);
[-,line width=0.01cm,black,opacity=1] (N4T0) edge node  (N5T0);

[fill=white,shape=circle,draw=none] (N0T1) at (0,2) ;
[fill=white,shape=circle,draw=black] (N1T1) at (2,2) ;
[fill=brown,shape=circle,draw=black] (N2T1) at (4,2) ;
[fill=white,shape=circle,draw=black] (N3T1) at (6,2) ;
[fill=red,shape=circle,draw=black] (N4T1) at (8,2) ;
[fill=white,shape=circle,draw=none] (N5T1) at (10,2) ;

[-,line width=0.1cm,brown,opacity=1] (N0T1) edge node  (N1T1);
[-,line width=0.1cm,brown,opacity=1] (N1T1) edge node  (N2T1);
[-,line width=0.01cm,black,opacity=1] (N2T1) edge node  (N3T1);
[-,line width=0.01cm,black,opacity=1] (N3T1) edge node  (N4T1);
[-,line width=0.1cm,red,opacity=1] (N4T1) edge node  (N5T1);

[-,line width=0.1cm,green,opacity=1] ($(N0T1.east) + (0,0.5)$) edge node  ($(N1T1) +(0,0.5)$);
[-,line width=0.1cm,green,opacity=1] ($(N1T1) + (0,0.5)$) edge node  ($(N2T1) +(0,0.5)$);

[green, fill=none,shape=rectangle,draw=none]() at ($(N1T0) +(2,-1)$) 2) Record propagated edges.;

[-,line width=0.01cm,black,opacity=1] (N1T0) edge node  (N1T1);

[-,line width=0.01cm,black,opacity=1] (N2T0) edge node  (N2T1);

[-,line width=0.01cm,black,opacity=1] (N3T0) edge node  (N3T1);

[-,line width=0.01cm,black,opacity=1] (N4T0) edge node  (N4T1);

[xshift=320,every node/.append style=yslant=0,xslant=0,yslant=0,xslant=0]
[circlewc] (target_4) at (0,1) ;
[phase] (control_4) at (-2,1) ;

[-,line width=0.01cm,black,opacity=1] (target_4) edge node  (control_4);

[xshift=300,every node/.append style=yslant=0,xslant=0,yslant=0,xslant=0]
[draw=blue,line width = 0.05cm] (0,1.2) rectangle ++(5,1.8);
[blue,shape=rectangle,fill=none] () at (4,4) 1) Remove spurious events.;

[ The right logical qubit is then decoded via MWPM.]
[scale=1,every node/.style=minimum size=1cm,on grid]
[xshift=0,every node/.append style=yslant=0,xslant=0,yslant=0,xslant=0]
[white,fill opacity=0.0] (0,0) rectangle (10,2);
[fill=white,draw=none] (t0) at (-2,0) $t=0:$;
[fill=white,shape=circle,draw=none] (N0T0) at (0,0) ;
[fill=white,shape=circle,draw=black] (N1T0) at (2,0) ;
[fill=red,shape=circle,draw=black] (N2T0) at (4,0) ;
[fill=white,shape=circle,draw=black] (N3T0) at (6,0) ;
[fill=white,shape=circle,draw=black] (N4T0) at (8,0) ;
[fill=white,shape=circle,draw=none] (N5T0) at (10,0) ;

[-,line width=0.1cm,red,opacity=1] (N0T0) edge node  (N1T0);
[-,line width=0.1cm,red,opacity=1] (N1T0) edge node  (N2T0);
[-,line width=0.01cm,black,opacity=1] (N2T0) edge node  (N3T0);
[-,line width=0.01cm,black,opacity=1] (N3T0) edge node  (N4T0);
[-,line width=0.01cm,black,opacity=1] (N4T0) edge node  (N5T0);

[-,line width=0.1cm,blue,opacity=1] ($(N0T0.east) + (0,0.5)$) edge node  ($(N1T0) +(0,0.5)$);
[-,line width=0.1cm,blue,opacity=1] ($(N1T0) + (0,0.5)$) edge node  ($(N2T0) +(0,0.5)$);

[fill=white,draw=none] (t1) at (-2,2) $t=1:$;
[fill=white,shape=circle,draw=none] (N0T1) at (0,2) ;
[fill=white,shape=circle,draw=black] (N1T1) at (2,2) ;
[fill=white,shape=circle,draw=black] (N2T1) at (4,2) ;
[fill=white,shape=circle,draw=black] (N3T1) at (6,2) ;
[fill=white,shape=circle,draw=black] (N4T1) at (8,2) ;
[fill=white,shape=circle,draw=none] (N5T1) at (10,2) ;

[-,line width=0.01cm,black,opacity=1] (N0T1) edge node  (N1T1);
[-,line width=0.01cm,black,opacity=1] (N1T1) edge node  (N2T1);
[-,line width=0.01cm,black,opacity=1] (N2T1) edge node  (N3T1);
[-,line width=0.01cm,black,opacity=1] (N3T1) edge node  (N4T1);
[-,line width=0.01cm,black,opacity=1] (N4T1) edge node  (N5T1);

[-,line width=0.01cm,black,opacity=1] (N1T0) edge node  (N1T1);

[-,line width=0.01cm,black,opacity=1] (N2T0) edge node  (N2T1);

[-,line width=0.01cm,black,opacity=1] (N3T0) edge node  (N3T1);

[-,line width=0.01cm,black,opacity=1] (N4T0) edge node  (N4T1);

[xshift=300,every node/.append style=yslant=0,xslant=0,yslant=0,xslant=0]
[white,fill opacity=0.0] (0,0) rectangle (10,2);

[fill=white,shape=circle,draw=none] (N0T0) at (0,0) ;
[fill=white,shape=circle,draw=black] (N1T0) at (2,0) ;
[fill=white,shape=circle,draw=black] (N2T0) at (4,0) ;
[fill=white,shape=circle,draw=black] (N3T0) at (6,0) ;
[fill=white,shape=circle,draw=black] (N4T0) at (8,0) ;
[fill=white,shape=circle,draw=none] (N5T0) at (10,0) ;

[-,line width=0.01cm,black,opacity=1] (N0T0) edge node  (N1T0);
[-,line width=0.01cm,black,opacity=1] (N1T0) edge node  (N2T0);
[-,line width=0.01cm,black,opacity=1] (N2T0) edge node  (N3T0);
[-,line width=0.01cm,black,opacity=1] (N3T0) edge node  (N4T0);
[-,line width=0.01cm,black,opacity=1] (N4T0) edge node  (N5T0);

[fill=white,shape=circle,draw=none] (N0T1) at (0,2) ;
[fill=white,shape=circle,draw=black] (N1T1) at (2,2) ;
[fill=none,shape=circle,draw=black] (N2T1) at (4,2) ;
[fill=white,shape=circle,draw=black] (N3T1) at (6,2) ;
[fill=red,shape=circle,draw=black] (N4T1) at (8,2) ;
[fill=white,shape=circle,draw=none] (N5T1) at (10,2) ;

[-,line width=0.1cm,brown,opacity=1] (N0T1) edge node  (N1T1);
[-,line width=0.1cm,brown,opacity=1] (N1T1) edge node  (N2T1);
[-,line width=0.01cm,black,opacity=1] (N2T1) edge node  (N3T1);
[-,line width=0.01cm,black,opacity=1] (N3T1) edge node  (N4T1);
[-,line width=0.1cm,red,opacity=1] (N4T1) edge node  (N5T1);

[-,line width=0.1cm,green,opacity=1] ($(N0T1.east) + (0,0.5)$) edge node  ($(N1T1) +(0,0.5)$);
[-,line width=0.1cm,green,opacity=1] ($(N1T1) + (0,0.5)$) edge node  ($(N2T1) +(0,0.5)$);

[blue, fill=none,shape=rectangle,draw=none]() at ($(N2T0) +(0,-1.5)$) Decode patch.;

[-,line width=0.01cm,black,opacity=1] (N1T0) edge node  (N1T1);

[-,line width=0.01cm,black,opacity=1] (N2T0) edge node  (N2T1);

[-,line width=0.01cm,black,opacity=1] (N3T0) edge node  (N3T1);

[-,line width=0.01cm,black,opacity=1] (N4T0) edge node  (N4T1);

[xshift=320,every node/.append style=yslant=0,xslant=0,yslant=0,xslant=0]
[circlewc] (target_4) at (0,1) ;
[phase] (control_4) at (-2,1) ;

[-,line width=0.01cm,black,opacity=1] (target_4) edge node  (control_4);

[ The decoding from MWPM, leading to the blue coloured edges on the right logical qubit.]
[scale=1,every node/.style=minimum size=1cm,on grid]
[xshift=0,every node/.append style=yslant=0,xslant=0,yslant=0,xslant=0]
[white,fill opacity=0.0] (0,0) rectangle (10,2);
[fill=white,draw=none] (t0) at (-2,0) $t=0:$;
[fill=white,shape=circle,draw=none] (N0T0) at (0,0) ;
[fill=white,shape=circle,draw=black] (N1T0) at (2,0) ;
[fill=red,shape=circle,draw=black] (N2T0) at (4,0) ;
[fill=white,shape=circle,draw=black] (N3T0) at (6,0) ;
[fill=white,shape=circle,draw=black] (N4T0) at (8,0) ;
[fill=white,shape=circle,draw=none] (N5T0) at (10,0) ;

[-,line width=0.1cm,red,opacity=1] (N0T0) edge node  (N1T0);
[-,line width=0.1cm,red,opacity=1] (N1T0) edge node  (N2T0);
[-,line width=0.01cm,black,opacity=1] (N2T0) edge node  (N3T0);
[-,line width=0.01cm,black,opacity=1] (N3T0) edge node  (N4T0);
[-,line width=0.01cm,black,opacity=1] (N4T0) edge node  (N5T0);

[-,line width=0.1cm,blue,opacity=1] ($(N0T0.east) + (0,0.5)$) edge node  ($(N1T0) +(0,0.5)$);
[-,line width=0.1cm,blue,opacity=1] ($(N1T0) + (0,0.5)$) edge node  ($(N2T0) +(0,0.5)$);

[fill=white,draw=none] (t1) at (-2,2) $t=1:$;
[fill=white,shape=circle,draw=none] (N0T1) at (0,2) ;
[fill=white,shape=circle,draw=black] (N1T1) at (2,2) ;
[fill=white,shape=circle,draw=black] (N2T1) at (4,2) ;
[fill=white,shape=circle,draw=black] (N3T1) at (6,2) ;
[fill=white,shape=circle,draw=black] (N4T1) at (8,2) ;
[fill=white,shape=circle,draw=none] (N5T1) at (10,2) ;

[-,line width=0.01cm,black,opacity=1] (N0T1) edge node  (N1T1);
[-,line width=0.01cm,black,opacity=1] (N1T1) edge node  (N2T1);
[-,line width=0.01cm,black,opacity=1] (N2T1) edge node  (N3T1);
[-,line width=0.01cm,black,opacity=1] (N3T1) edge node  (N4T1);
[-,line width=0.01cm,black,opacity=1] (N4T1) edge node  (N5T1);

[-,line width=0.01cm,black,opacity=1] (N1T0) edge node  (N1T1);

[-,line width=0.01cm,black,opacity=1] (N2T0) edge node  (N2T1);

[-,line width=0.01cm,black,opacity=1] (N3T0) edge node  (N3T1);

[-,line width=0.01cm,black,opacity=1] (N4T0) edge node  (N4T1);

[xshift=300,every node/.append style=yslant=0,xslant=0,yslant=0,xslant=0]
[white,fill opacity=0.0] (0,0) rectangle (10,2);

[fill=white,shape=circle,draw=none] (N0T0) at (0,0) ;
[fill=white,shape=circle,draw=black] (N1T0) at (2,0) ;
[fill=white,shape=circle,draw=black] (N2T0) at (4,0) ;
[fill=white,shape=circle,draw=black] (N3T0) at (6,0) ;
[fill=white,shape=circle,draw=black] (N4T0) at (8,0) ;
[fill=white,shape=circle,draw=none] (N5T0) at (10,0) ;

[-,line width=0.01cm,black,opacity=1] (N0T0) edge node  (N1T0);
[-,line width=0.01cm,black,opacity=1] (N1T0) edge node  (N2T0);
[-,line width=0.01cm,black,opacity=1] (N2T0) edge node  (N3T0);
[-,line width=0.01cm,black,opacity=1] (N3T0) edge node  (N4T0);
[-,line width=0.01cm,black,opacity=1] (N4T0) edge node  (N5T0);

[fill=white,shape=circle,draw=none] (N0T1) at (0,2) ;
[fill=white,shape=circle,draw=black] (N1T1) at (2,2) ;
[fill=none,shape=circle,draw=black] (N2T1) at (4,2) ;
[fill=white,shape=circle,draw=black] (N3T1) at (6,2) ;
[fill=red,shape=circle,draw=black] (N4T1) at (8,2) ;
[fill=white,shape=circle,draw=none] (N5T1) at (10,2) ;

[-,line width=0.1cm,brown,opacity=1] (N0T1) edge node  (N1T1);
[-,line width=0.1cm,brown,opacity=1] (N1T1) edge node  (N2T1);
[-,line width=0.01cm,black,opacity=1] (N2T1) edge node  (N3T1);
[-,line width=0.01cm,black,opacity=1] (N3T1) edge node  (N4T1);
[-,line width=0.1cm,red,opacity=1] (N4T1) edge node  (N5T1);

[-,line width=0.1cm,green,opacity=1] ($(N0T1.east) + (0,0.5)$) edge node  ($(N1T1) +(0,0.5)$);
[-,line width=0.1cm,green,opacity=1] ($(N1T1) + (0,0.5)$) edge node  ($(N2T1) +(0,0.5)$);

[-,line width=0.1cm,blue,opacity=1] ($(N4T1) + (0,0.5)$) edge node  ($(N5T1.west) +(0,0.5)$);

[blue, fill=none,shape=rectangle,draw=none]() at ($(N2T0) +(2,-1.5)$) Record decoded edges.;

[-,line width=0.01cm,black,opacity=1] (N1T0) edge node  (N1T1);

[-,line width=0.01cm,black,opacity=1] (N2T0) edge node  (N2T1);

[-,line width=0.01cm,black,opacity=1] (N3T0) edge node  (N3T1);

[-,line width=0.01cm,black,opacity=1] (N4T0) edge node  (N4T1);

[xshift=320,every node/.append style=yslant=0,xslant=0,yslant=0,xslant=0]
[circlewc] (target_4) at (0,1) ;
[phase] (control_4) at (-2,1) ;

[-,line width=0.01cm,black,opacity=1] (target_4) edge node  (control_4);

Steps in figure <ref> to figure <ref> show the decoding procedure required to decode and propagate the Pauli-frame from the left logical qubit to the right logical qubit.

In order to decode correctly, we reset the blue decoded edges on the right patch, then, the predicted Pauli-frame for the left logical qubit is propagated to the right logical qubit in figure <ref>, removing spurious detection events and recording the propagated edges in green  at $t=1$. We then proceed to decode the right logical qubit with MWPM and record its decoded edges in figure <ref>.

With this syndrome modification and Pauli-frame propagation procedure, we are able to correctly identify the “natural errors” and the propagated errors with all the spurious detection events removed. For an instantaneous and error-free transversal CNOT operation, the logical error rate of failure after the application of a transversal CNOT should be as close as possible to the memory experiment case as possible. This can be interpreted as an enhanced memory experiment with a transversal CNOT sandwiched in between patches.

§.§ Example 2: Multi-pass decoder

We will now show a more complicated example which includes two alternating transversal CNOTs. Multiple iterations of frame propagation are required, and we see that this naturally follows from the mapping behaviour of the transversal CNOT. In the case of two alternating transversal CNOT's, we observe that an X error spreading from control to target in the first instance will be reflected back after the second transversal CNOT. If not correctly decoded, this would lead to an amplification of errors that will severely affect the overall logical error rate.

§.§.§ $1^{\text{st}}$ iteration

In the first iteration, we follow similar methods outlined in Example 1. The detector pattern from experiment can be seen in figure <ref>, the series of two alternating transversal CNOTs with a round of syndrome extraction in between leads to the brown propagated edges and nodes. We first decode the left logical qubit and record its blue decoded edges in <ref>. We then propagate the Pauli-frame at $t=0$ in the left patch to the right patch to remove spurious events, in this case no data (spatial) edges are matched in the left patch at $t=0$, hence no spurious events are propagated over to the right. These are the incorrectly decoded edges on the left, we shall see how iterating the process in the $2^{\text{nd}}$ iteration solves this.

[Original syndrome detector signal without any modifications for Example 2 with two alternating CNOTs.]
[scale=1,every node/.style=minimum size=1cm,on grid]
[xshift=0,every node/.append style=yslant=0,xslant=0,yslant=0,xslant=0]
[white,fill opacity=0.0] (0,0) rectangle (10,4);
[fill=white,draw=none] (t0) at (-2,0) $t=0:$;
[fill=white,shape=circle,draw=none] (N0T0) at (0,0) ;
[fill=white,shape=circle,draw=black] (N1T0) at (2,0) ;
[fill=red,shape=circle,draw=black] (N2T0) at (4,0) ;
[fill=white,shape=circle,draw=black] (N3T0) at (6,0) ;
[fill=white,shape=circle,draw=black] (N4T0) at (8,0) ;
[fill=white,shape=circle,draw=none] (N5T0) at (10,0) ;

[-,line width=0.1cm,red,opacity=1] (N0T0) edge node  (N1T0);
[-,line width=0.1cm,red,opacity=1] (N1T0) edge node  (N2T0);
[-,line width=0.01cm,black,opacity=1] (N2T0) edge node  (N3T0);
[-,line width=0.01cm,black,opacity=1] (N3T0) edge node  (N4T0);
[-,line width=0.01cm,black,opacity=1] (N4T0) edge node  (N5T0);

[fill=white,draw=none] (t1) at (-2,2) $t=1:$;
[fill=white,shape=circle,draw=none] (N0T1) at (0,2) ;
[fill=white,shape=circle,draw=black] (N1T1) at (2,2) ;
[fill=white,shape=circle,draw=black] (N2T1) at (4,2) ;
[fill=white,shape=circle,draw=black] (N3T1) at (6,2) ;
[fill=white,shape=circle,draw=black] (N4T1) at (8,2) ;
[fill=white,shape=circle,draw=none] (N5T1) at (10,2) ;

[-,line width=0.01cm,black,opacity=1] (N0T1) edge node  (N1T1);
[-,line width=0.01cm,black,opacity=1] (N1T1) edge node  (N2T1);
[-,line width=0.01cm,black,opacity=1] (N2T1) edge node  (N3T1);
[-,line width=0.01cm,black,opacity=1] (N3T1) edge node  (N4T1);
[-,line width=0.01cm,black,opacity=1] (N4T1) edge node  (N5T1);

[fill=white,draw=none] (t2) at (-2,4) $t=2:$;
[fill=white,shape=circle,draw=none] (N0T2) at (0,4) ;
[fill=white,shape=circle,draw=black] (N1T2) at (2,4) ;
[fill=brown,shape=circle,draw=black] (N2T2) at (4,4) ;
[fill=white,shape=circle,draw=black] (N3T2) at (6,4) ;
[fill=brown,shape=circle,draw=black] (N4T2) at (8,4) ;
[fill=white,shape=circle,draw=none] (N5T2) at (10,4) ;

[-,line width=0.1cm,brown,opacity=1] (N0T2) edge node  (N1T2);
[-,line width=0.1cm,brown,opacity=1] (N1T2) edge node  (N2T2);
[-,line width=0.01cm,black,opacity=1] (N2T2) edge node  (N3T2);
[-,line width=0.01cm,black,opacity=1] (N3T2) edge node  (N4T2);
[-,line width=0.1cm,brown,opacity=1] (N4T2) edge node  (N5T2);

[fill=white,draw=none] (t3) at (-2,6) $t=3:$;
[fill=white,shape=circle,draw=none] (N0T3) at (0,6) ;
[fill=white,shape=circle,draw=black] (N1T3) at (2,6) ;
[fill=white,shape=circle,draw=black] (N2T3) at (4,6) ;
[fill=white,shape=circle,draw=black] (N3T3) at (6,6) ;
[fill=white,shape=circle,draw=black] (N4T3) at (8,6) ;
[fill=white,shape=circle,draw=none] (N5T3) at (10,6) ;

[-,line width=0.01cm,black,opacity=1] (N0T3) edge node  (N1T3);
[-,line width=0.01cm,black,opacity=1] (N1T3) edge node  (N2T3);
[-,line width=0.01cm,black,opacity=1] (N2T3) edge node  (N3T3);
[-,line width=0.01cm,black,opacity=1] (N3T3) edge node  (N4T3);
[-,line width=0.01cm,black,opacity=1] (N4T3) edge node  (N5T3);

[-,line width=0.01cm,black,opacity=1] (N1T0) edge node  (N1T1);
[-,line width=0.01cm,black,opacity=1] (N1T1) edge node  (N1T2);
[-,line width=0.01cm,black,opacity=1] (N1T2) edge node  (N1T3);

[-,line width=0.01cm,black,opacity=1] (N2T0) edge node  (N2T1);
[-,line width=0.01cm,black,opacity=1] (N2T1) edge node  (N2T2);
[-,line width=0.01cm,black,opacity=1] (N2T2) edge node  (N2T3);

[-,line width=0.01cm,black,opacity=1] (N3T0) edge node  (N3T1);
[-,line width=0.01cm,black,opacity=1] (N3T1) edge node  (N3T2);
[-,line width=0.01cm,black,opacity=1] (N3T2) edge node  (N3T3);

[-,line width=0.01cm,black,opacity=1] (N4T0) edge node  (N4T1);
[-,line width=0.01cm,black,opacity=1] (N4T1) edge node  (N4T2);
[-,line width=0.01cm,black,opacity=1] (N4T2) edge node  (N4T3);

[xshift=300,every node/.append style=yslant=0,xslant=0,yslant=0,xslant=0]
[white,fill opacity=0.0] (0,0) rectangle (10,4);

[fill=white,shape=circle,draw=none] (N0T0) at (0,0) ;
[fill=white,shape=circle,draw=black] (N1T0) at (2,0) ;
[fill=white,shape=circle,draw=black] (N2T0) at (4,0) ;
[fill=white,shape=circle,draw=black] (N3T0) at (6,0) ;
[fill=white,shape=circle,draw=black] (N4T0) at (8,0) ;
[fill=white,shape=circle,draw=none] (N5T0) at (10,0) ;

[-,line width=0.01cm,black,opacity=1] (N0T0) edge node  (N1T0);
[-,line width=0.01cm,black,opacity=1] (N1T0) edge node  (N2T0);
[-,line width=0.01cm,black,opacity=1] (N2T0) edge node  (N3T0);
[-,line width=0.01cm,black,opacity=1] (N3T0) edge node  (N4T0);
[-,line width=0.01cm,black,opacity=1] (N4T0) edge node  (N5T0);

[fill=white,shape=circle,draw=none] (N0T1) at (0,2) ;
[fill=white,shape=circle,draw=black] (N1T1) at (2,2) ;
[fill=brown,shape=circle,draw=black] (N2T1) at (4,2) ;
[fill=white,shape=circle,draw=black] (N3T1) at (6,2) ;
[fill=red,shape=circle,draw=black] (N4T1) at (8,2) ;
[fill=white,shape=circle,draw=none] (N5T1) at (10,2) ;

[-,line width=0.1cm,brown,opacity=1] (N0T1) edge node  (N1T1);
[-,line width=0.1cm,brown,opacity=1] (N1T1) edge node  (N2T1);
[-,line width=0.01cm,black,opacity=1] (N2T1) edge node  (N3T1);
[-,line width=0.01cm,black,opacity=1] (N3T1) edge node  (N4T1);
[-,line width=0.1cm,red,opacity=1] (N4T1) edge node  (N5T1);

[fill=white,shape=circle,draw=none] (N0T2) at (0,4) ;
[fill=white,shape=circle,draw=black] (N1T2) at (2,4) ;
[fill=white,shape=circle,draw=black] (N2T2) at (4,4) ;
[fill=white,shape=circle,draw=black] (N3T2) at (6,4) ;
[fill=white,shape=circle,draw=black] (N4T2) at (8,4) ;
[fill=white,shape=circle,draw=none] (N5T2) at (10,4) ;

[-,line width=0.01cm,black,opacity=1] (N0T2) edge node  (N1T2);
[-,line width=0.01cm,black,opacity=1] (N1T2) edge node  (N2T2);
[-,line width=0.01cm,black,opacity=1] (N2T2) edge node  (N3T2);
[-,line width=0.01cm,black,opacity=1] (N3T2) edge node  (N4T2);
[-,line width=0.01cm,black,opacity=1] (N4T2) edge node  (N5T2);

[fill=white,shape=circle,draw=none] (N0T3) at (0,6) ;
[fill=white,shape=circle,draw=black] (N1T3) at (2,6) ;
[fill=white,shape=circle,draw=black] (N2T3) at (4,6) ;
[fill=white,shape=circle,draw=black] (N3T3) at (6,6) ;
[fill=white,shape=circle,draw=black] (N4T3) at (8,6) ;
[fill=white,shape=circle,draw=none] (N5T3) at (10,6) ;

[-,line width=0.01cm,black,opacity=1] (N0T3) edge node  (N1T3);
[-,line width=0.01cm,black,opacity=1] (N1T3) edge node  (N2T3);
[-,line width=0.01cm,black,opacity=1] (N2T3) edge node  (N3T3);
[-,line width=0.01cm,black,opacity=1] (N3T3) edge node  (N4T3);
[-,line width=0.01cm,black,opacity=1] (N4T3) edge node  (N5T3);

[-,line width=0.01cm,black,opacity=1] (N1T0) edge node  (N1T1);
[-,line width=0.01cm,black,opacity=1] (N1T1) edge node  (N1T2);
[-,line width=0.01cm,black,opacity=1] (N1T2) edge node  (N1T3);

[-,line width=0.01cm,black,opacity=1] (N2T0) edge node  (N2T1);
[-,line width=0.01cm,black,opacity=1] (N2T1) edge node  (N2T2);
[-,line width=0.01cm,black,opacity=1] (N2T2) edge node  (N2T3);

[-,line width=0.01cm,black,opacity=1] (N3T0) edge node  (N3T1);
[-,line width=0.01cm,black,opacity=1] (N3T1) edge node  (N3T2);
[-,line width=0.01cm,black,opacity=1] (N3T2) edge node  (N3T3);

[-,line width=0.01cm,black,opacity=1] (N4T0) edge node  (N4T1);
[-,line width=0.01cm,black,opacity=1] (N4T1) edge node  (N4T2);
[-,line width=0.01cm,black,opacity=1] (N4T2) edge node  (N4T3);

[xshift=320,every node/.append style=yslant=0,xslant=0,yslant=0,xslant=0]
[circlewc] (target_4) at (0,1) ;
[phase] (control_4) at (-2,1) ;

[-,line width=0.01cm,black,opacity=1] (target_4) edge node  (control_4);

[xshift=320,every node/.append style=yslant=0,xslant=0,yslant=0,xslant=0]
[circlewc] (target_4) at (-2,3) ;
[phase] (control_4) at (0,3) ;

[-,line width=0.01cm,black,opacity=1] (target_4) edge node  (control_4);

[We decode the left patch and propagate the Pauli-frame to the right patch, in this case, no errors were detected, so no spurious events or propagation of green edges were formed on the right patch.]
[scale=1,every node/.style=minimum size=1cm,on grid]
[xshift=0,every node/.append style=yslant=0,xslant=0,yslant=0,xslant=0]
[white,fill opacity=0.0] (0,0) rectangle (10,4);
[fill=white,draw=none] (t0) at (-2,0) $t=0:$;
[fill=white,shape=circle,draw=none] (N0T0) at (0,0) ;
[fill=white,shape=circle,draw=black] (N1T0) at (2,0) ;
[fill=red,shape=circle,draw=black] (N2T0) at (4,0) ;
[fill=white,shape=circle,draw=black] (N3T0) at (6,0) ;
[fill=white,shape=circle,draw=black] (N4T0) at (8,0) ;
[fill=white,shape=circle,draw=none] (N5T0) at (10,0) ;

[-,line width=0.1cm,red,opacity=1] (N0T0) edge node  (N1T0);
[-,line width=0.1cm,red,opacity=1] (N1T0) edge node  (N2T0);
[-,line width=0.01cm,black,opacity=1] (N2T0) edge node  (N3T0);
[-,line width=0.01cm,black,opacity=1] (N3T0) edge node  (N4T0);
[-,line width=0.01cm,black,opacity=1] (N4T0) edge node  (N5T0);

[fill=white,draw=none] (t1) at (-2,2) $t=1:$;
[fill=white,shape=circle,draw=none] (N0T1) at (0,2) ;
[fill=white,shape=circle,draw=black] (N1T1) at (2,2) ;
[fill=white,shape=circle,draw=black] (N2T1) at (4,2) ;
[fill=white,shape=circle,draw=black] (N3T1) at (6,2) ;
[fill=white,shape=circle,draw=black] (N4T1) at (8,2) ;
[fill=white,shape=circle,draw=none] (N5T1) at (10,2) ;

[-,line width=0.01cm,black,opacity=1] (N0T1) edge node  (N1T1);
[-,line width=0.01cm,black,opacity=1] (N1T1) edge node  (N2T1);
[-,line width=0.01cm,black,opacity=1] (N2T1) edge node  (N3T1);
[-,line width=0.01cm,black,opacity=1] (N3T1) edge node  (N4T1);
[-,line width=0.01cm,black,opacity=1] (N4T1) edge node  (N5T1);

[fill=white,draw=none] (t2) at (-2,4) $t=2:$;
[fill=white,shape=circle,draw=none] (N0T2) at (0,4) ;
[fill=white,shape=circle,draw=black] (N1T2) at (2,4) ;
[fill=brown,shape=circle,draw=black] (N2T2) at (4,4) ;
[fill=white,shape=circle,draw=black] (N3T2) at (6,4) ;
[fill=brown,shape=circle,draw=black] (N4T2) at (8,4) ;
[fill=white,shape=circle,draw=none] (N5T2) at (10,4) ;

[-,line width=0.1cm,brown,opacity=1] (N0T2) edge node  (N1T2);
[-,line width=0.1cm,brown,opacity=1] (N1T2) edge node  (N2T2);
[-,line width=0.01cm,black,opacity=1] (N2T2) edge node  (N3T2);
[-,line width=0.01cm,black,opacity=1] (N3T2) edge node  (N4T2);
[-,line width=0.1cm,brown,opacity=1] (N4T2) edge node  (N5T2);

[fill=white,draw=none] (t3) at (-2,6) $t=3:$;
[fill=white,shape=circle,draw=none] (N0T3) at (0,6) ;
[fill=white,shape=circle,draw=black] (N1T3) at (2,6) ;
[fill=white,shape=circle,draw=black] (N2T3) at (4,6) ;
[fill=white,shape=circle,draw=black] (N3T3) at (6,6) ;
[fill=white,shape=circle,draw=black] (N4T3) at (8,6) ;
[fill=white,shape=circle,draw=none] (N5T3) at (10,6) ;

[-,line width=0.01cm,black,opacity=1] (N0T3) edge node  (N1T3);
[-,line width=0.01cm,black,opacity=1] (N1T3) edge node  (N2T3);
[-,line width=0.01cm,black,opacity=1] (N2T3) edge node  (N3T3);
[-,line width=0.01cm,black,opacity=1] (N3T3) edge node  (N4T3);
[-,line width=0.01cm,black,opacity=1] (N4T3) edge node  (N5T3);

[-,line width=0.01cm,black,opacity=1] (N1T0) edge node  (N1T1);
[-,line width=0.01cm,black,opacity=1] (N1T1) edge node  (N1T2);
[-,line width=0.01cm,black,opacity=1] (N1T2) edge node  (N1T3);

[-,line width=0.1cm,blue,opacity=1] (N2T0) edge node  (N2T1);
[-,line width=0.1cm,blue,opacity=1] (N2T1) edge node  (N2T2);
[-,line width=0.01cm,black,opacity=1] (N2T2) edge node  (N2T3);

[-,line width=0.01cm,black,opacity=1] (N3T0) edge node  (N3T1);
[-,line width=0.01cm,black,opacity=1] (N3T1) edge node  (N3T2);
[-,line width=0.01cm,black,opacity=1] (N3T2) edge node  (N3T3);

[-,line width=0.01cm,black,opacity=1] (N4T0) edge node  (N4T1);
[-,line width=0.01cm,black,opacity=1] (N4T1) edge node  (N4T2);
[-,line width=0.01cm,black,opacity=1] (N4T2) edge node  (N4T3);

[blue,shape = rectangle] () at (1.8,-1.5) 1) Record decoded edges.;

[-,line width=0.1cm,blue,opacity=1] ($(N4T2) + (0,0.5)$) edge node  ($(N5T2.west) +(0,0.5)$);

[xshift=300,every node/.append style=yslant=0,xslant=0,yslant=0,xslant=0]
[white,fill opacity=0.0] (0,0) rectangle (10,4);

[fill=white,shape=circle,draw=none] (N0T0) at (0,0) ;
[fill=white,shape=circle,draw=black] (N1T0) at (2,0) ;
[fill=white,shape=circle,draw=black] (N2T0) at (4,0) ;
[fill=white,shape=circle,draw=black] (N3T0) at (6,0) ;
[fill=white,shape=circle,draw=black] (N4T0) at (8,0) ;
[fill=white,shape=circle,draw=none] (N5T0) at (10,0) ;

[-,line width=0.01cm,black,opacity=1] (N0T0) edge node  (N1T0);
[-,line width=0.01cm,black,opacity=1] (N1T0) edge node  (N2T0);
[-,line width=0.01cm,black,opacity=1] (N2T0) edge node  (N3T0);
[-,line width=0.01cm,black,opacity=1] (N3T0) edge node  (N4T0);
[-,line width=0.01cm,black,opacity=1] (N4T0) edge node  (N5T0);

[fill=white,shape=circle,draw=none] (N0T1) at (0,2) ;
[fill=white,shape=circle,draw=black] (N1T1) at (2,2) ;
[fill=brown,shape=circle,draw=black] (N2T1) at (4,2) ;
[fill=white,shape=circle,draw=black] (N3T1) at (6,2) ;
[fill=red,shape=circle,draw=black] (N4T1) at (8,2) ;
[fill=white,shape=circle,draw=none] (N5T1) at (10,2) ;

[-,line width=0.1cm,brown,opacity=1] (N0T1) edge node  (N1T1);
[-,line width=0.1cm,brown,opacity=1] (N1T1) edge node  (N2T1);
[-,line width=0.01cm,black,opacity=1] (N2T1) edge node  (N3T1);
[-,line width=0.01cm,black,opacity=1] (N3T1) edge node  (N4T1);
[-,line width=0.1cm,red,opacity=1] (N4T1) edge node  (N5T1);

[fill=white,shape=circle,draw=none] (N0T2) at (0,4) ;
[fill=white,shape=circle,draw=black] (N1T2) at (2,4) ;
[fill=white,shape=circle,draw=black] (N2T2) at (4,4) ;
[fill=white,shape=circle,draw=black] (N3T2) at (6,4) ;
[fill=white,shape=circle,draw=black] (N4T2) at (8,4) ;
[fill=white,shape=circle,draw=none] (N5T2) at (10,4) ;

[-,line width=0.01cm,black,opacity=1] (N0T2) edge node  (N1T2);
[-,line width=0.01cm,black,opacity=1] (N1T2) edge node  (N2T2);
[-,line width=0.01cm,black,opacity=1] (N2T2) edge node  (N3T2);
[-,line width=0.01cm,black,opacity=1] (N3T2) edge node  (N4T2);
[-,line width=0.01cm,black,opacity=1] (N4T2) edge node  (N5T2);

[fill=white,shape=circle,draw=none] (N0T3) at (0,6) ;
[fill=white,shape=circle,draw=black] (N1T3) at (2,6) ;
[fill=white,shape=circle,draw=black] (N2T3) at (4,6) ;
[fill=white,shape=circle,draw=black] (N3T3) at (6,6) ;
[fill=white,shape=circle,draw=black] (N4T3) at (8,6) ;
[fill=white,shape=circle,draw=none] (N5T3) at (10,6) ;

[-,line width=0.01cm,black,opacity=1] (N0T3) edge node  (N1T3);
[-,line width=0.01cm,black,opacity=1] (N1T3) edge node  (N2T3);
[-,line width=0.01cm,black,opacity=1] (N2T3) edge node  (N3T3);
[-,line width=0.01cm,black,opacity=1] (N3T3) edge node  (N4T3);
[-,line width=0.01cm,black,opacity=1] (N4T3) edge node  (N5T3);

[-,line width=0.01cm,black,opacity=1] (N1T0) edge node  (N1T1);
[-,line width=0.01cm,black,opacity=1] (N1T1) edge node  (N1T2);
[-,line width=0.01cm,black,opacity=1] (N1T2) edge node  (N1T3);

[-,line width=0.01cm,black,opacity=1] (N2T0) edge node  (N2T1);
[-,line width=0.01cm,black,opacity=1] (N2T1) edge node  (N2T2);
[-,line width=0.01cm,black,opacity=1] (N2T2) edge node  (N2T3);

[-,line width=0.01cm,black,opacity=1] (N3T0) edge node  (N3T1);
[-,line width=0.01cm,black,opacity=1] (N3T1) edge node  (N3T2);
[-,line width=0.01cm,black,opacity=1] (N3T2) edge node  (N3T3);

[-,line width=0.01cm,black,opacity=1] (N4T0) edge node  (N4T1);
[-,line width=0.01cm,black,opacity=1] (N4T1) edge node  (N4T2);
[-,line width=0.01cm,black,opacity=1] (N4T2) edge node  (N4T3);

[blue,shape=rectangle] () at (5.8,-1.5) 2) Remove no spurious events.;

[xshift=320,every node/.append style=yslant=0,xslant=0,yslant=0,xslant=0]
[circlewc] (target_4) at (0,1) ;
[phase] (control_4) at (-2,1) ;

[-,line width=0.01cm,black,opacity=1] (target_4) edge node  (control_4);

[xshift=320,every node/.append style=yslant=0,xslant=0,yslant=0,xslant=0]
[circlewc] (target_4) at (-2,3) ;
[phase] (control_4) at (0,3) ;

[-,line width=0.01cm,black,opacity=1] (target_4) edge node  (control_4);

The original syndrome detection pattern of the two alternating CNOT example, following by the first iteration's first Pauli-frame propagation through the first CNOT.

[Decode the logical qubit on the right and record its decoded blue coloured edges.]
[scale=1,every node/.style=minimum size=1cm,on grid]
[xshift=0,every node/.append style=yslant=0,xslant=0,yslant=0,xslant=0]
[white,fill opacity=0.0] (0,0) rectangle (10,4);
[fill=white,draw=none] (t0) at (-2,0) $t=0:$;
[fill=white,shape=circle,draw=none] (N0T0) at (0,0) ;
[fill=white,shape=circle,draw=black] (N1T0) at (2,0) ;
[fill=red,shape=circle,draw=black] (N2T0) at (4,0) ;
[fill=white,shape=circle,draw=black] (N3T0) at (6,0) ;
[fill=white,shape=circle,draw=black] (N4T0) at (8,0) ;
[fill=white,shape=circle,draw=none] (N5T0) at (10,0) ;

[-,line width=0.1cm,red,opacity=1] (N0T0) edge node  (N1T0);
[-,line width=0.1cm,red,opacity=1] (N1T0) edge node  (N2T0);
[-,line width=0.01cm,black,opacity=1] (N2T0) edge node  (N3T0);
[-,line width=0.01cm,black,opacity=1] (N3T0) edge node  (N4T0);
[-,line width=0.01cm,black,opacity=1] (N4T0) edge node  (N5T0);

[fill=white,draw=none] (t1) at (-2,2) $t=1:$;
[fill=white,shape=circle,draw=none] (N0T1) at (0,2) ;
[fill=white,shape=circle,draw=black] (N1T1) at (2,2) ;
[fill=white,shape=circle,draw=black] (N2T1) at (4,2) ;
[fill=white,shape=circle,draw=black] (N3T1) at (6,2) ;
[fill=white,shape=circle,draw=black] (N4T1) at (8,2) ;
[fill=white,shape=circle,draw=none] (N5T1) at (10,2) ;

[-,line width=0.01cm,black,opacity=1] (N0T1) edge node  (N1T1);
[-,line width=0.01cm,black,opacity=1] (N1T1) edge node  (N2T1);
[-,line width=0.01cm,black,opacity=1] (N2T1) edge node  (N3T1);
[-,line width=0.01cm,black,opacity=1] (N3T1) edge node  (N4T1);
[-,line width=0.01cm,black,opacity=1] (N4T1) edge node  (N5T1);

[fill=white,draw=none] (t2) at (-2,4) $t=2:$;
[fill=white,shape=circle,draw=none] (N0T2) at (0,4) ;
[fill=white,shape=circle,draw=black] (N1T2) at (2,4) ;
[fill=brown,shape=circle,draw=black] (N2T2) at (4,4) ;
[fill=white,shape=circle,draw=black] (N3T2) at (6,4) ;
[fill=brown,shape=circle,draw=black] (N4T2) at (8,4) ;
[fill=white,shape=circle,draw=none] (N5T2) at (10,4) ;

[-,line width=0.1cm,brown,opacity=1] (N0T2) edge node  (N1T2);
[-,line width=0.1cm,brown,opacity=1] (N1T2) edge node  (N2T2);
[-,line width=0.01cm,black,opacity=1] (N2T2) edge node  (N3T2);
[-,line width=0.01cm,black,opacity=1] (N3T2) edge node  (N4T2);
[-,line width=0.1cm,brown,opacity=1] (N4T2) edge node  (N5T2);

[fill=white,draw=none] (t3) at (-2,6) $t=3:$;
[fill=white,shape=circle,draw=none] (N0T3) at (0,6) ;
[fill=white,shape=circle,draw=black] (N1T3) at (2,6) ;
[fill=white,shape=circle,draw=black] (N2T3) at (4,6) ;
[fill=white,shape=circle,draw=black] (N3T3) at (6,6) ;
[fill=white,shape=circle,draw=black] (N4T3) at (8,6) ;
[fill=white,shape=circle,draw=none] (N5T3) at (10,6) ;

[-,line width=0.01cm,black,opacity=1] (N0T3) edge node  (N1T3);
[-,line width=0.01cm,black,opacity=1] (N1T3) edge node  (N2T3);
[-,line width=0.01cm,black,opacity=1] (N2T3) edge node  (N3T3);
[-,line width=0.01cm,black,opacity=1] (N3T3) edge node  (N4T3);
[-,line width=0.01cm,black,opacity=1] (N4T3) edge node  (N5T3);

[-,line width=0.01cm,black,opacity=1] (N1T0) edge node  (N1T1);
[-,line width=0.01cm,black,opacity=1] (N1T1) edge node  (N1T2);
[-,line width=0.01cm,black,opacity=1] (N1T2) edge node  (N1T3);

[-,line width=0.1cm,blue,opacity=1] (N2T0) edge node  (N2T1);
[-,line width=0.1cm,blue,opacity=1] (N2T1) edge node  (N2T2);
[-,line width=0.01cm,black,opacity=1] (N2T2) edge node  (N2T3);

[-,line width=0.01cm,black,opacity=1] (N3T0) edge node  (N3T1);
[-,line width=0.01cm,black,opacity=1] (N3T1) edge node  (N3T2);
[-,line width=0.01cm,black,opacity=1] (N3T2) edge node  (N3T3);

[-,line width=0.01cm,black,opacity=1] (N4T0) edge node  (N4T1);
[-,line width=0.01cm,black,opacity=1] (N4T1) edge node  (N4T2);
[-,line width=0.01cm,black,opacity=1] (N4T2) edge node  (N4T3);

[-,line width=0.1cm,blue,opacity=1] ($(N4T2) + (0,0.5)$) edge node  ($(N5T2.west) +(0,0.5)$);

[xshift=300,every node/.append style=yslant=0,xslant=0,yslant=0,xslant=0]
[white,fill opacity=0.0] (0,0) rectangle (10,4);

[fill=white,shape=circle,draw=none] (N0T0) at (0,0) ;
[fill=white,shape=circle,draw=black] (N1T0) at (2,0) ;
[fill=white,shape=circle,draw=black] (N2T0) at (4,0) ;
[fill=white,shape=circle,draw=black] (N3T0) at (6,0) ;
[fill=white,shape=circle,draw=black] (N4T0) at (8,0) ;
[fill=white,shape=circle,draw=none] (N5T0) at (10,0) ;

[-,line width=0.01cm,black,opacity=1] (N0T0) edge node  (N1T0);
[-,line width=0.01cm,black,opacity=1] (N1T0) edge node  (N2T0);
[-,line width=0.01cm,black,opacity=1] (N2T0) edge node  (N3T0);
[-,line width=0.01cm,black,opacity=1] (N3T0) edge node  (N4T0);
[-,line width=0.01cm,black,opacity=1] (N4T0) edge node  (N5T0);

[fill=white,shape=circle,draw=none] (N0T1) at (0,2) ;
[fill=white,shape=circle,draw=black] (N1T1) at (2,2) ;
[fill=brown,shape=circle,draw=black] (N2T1) at (4,2) ;
[fill=white,shape=circle,draw=black] (N3T1) at (6,2) ;
[fill=red,shape=circle,draw=black] (N4T1) at (8,2) ;
[fill=white,shape=circle,draw=none] (N5T1) at (10,2) ;

[-,line width=0.1cm,brown,opacity=1] (N0T1) edge node  (N1T1);
[-,line width=0.1cm,brown,opacity=1] (N1T1) edge node  (N2T1);
[-,line width=0.1cm,blue,opacity=1] (N2T1) edge node  (N3T1);
[-,line width=0.1cm,blue,opacity=1] (N3T1) edge node  (N4T1);
[-,line width=0.1cm,red,opacity=1] (N4T1) edge node  (N5T1);

[fill=white,shape=circle,draw=none] (N0T2) at (0,4) ;
[fill=white,shape=circle,draw=black] (N1T2) at (2,4) ;
[fill=white,shape=circle,draw=black] (N2T2) at (4,4) ;
[fill=white,shape=circle,draw=black] (N3T2) at (6,4) ;
[fill=white,shape=circle,draw=black] (N4T2) at (8,4) ;
[fill=white,shape=circle,draw=none] (N5T2) at (10,4) ;

[-,line width=0.01cm,black,opacity=1] (N0T2) edge node  (N1T2);
[-,line width=0.01cm,black,opacity=1] (N1T2) edge node  (N2T2);
[-,line width=0.01cm,black,opacity=1] (N2T2) edge node  (N3T2);
[-,line width=0.01cm,black,opacity=1] (N3T2) edge node  (N4T2);
[-,line width=0.01cm,black,opacity=1] (N4T2) edge node  (N5T2);

[fill=white,shape=circle,draw=none] (N0T3) at (0,6) ;
[fill=white,shape=circle,draw=black] (N1T3) at (2,6) ;
[fill=white,shape=circle,draw=black] (N2T3) at (4,6) ;
[fill=white,shape=circle,draw=black] (N3T3) at (6,6) ;
[fill=white,shape=circle,draw=black] (N4T3) at (8,6) ;
[fill=white,shape=circle,draw=none] (N5T3) at (10,6) ;

[-,line width=0.01cm,black,opacity=1] (N0T3) edge node  (N1T3);
[-,line width=0.01cm,black,opacity=1] (N1T3) edge node  (N2T3);
[-,line width=0.01cm,black,opacity=1] (N2T3) edge node  (N3T3);
[-,line width=0.01cm,black,opacity=1] (N3T3) edge node  (N4T3);
[-,line width=0.01cm,black,opacity=1] (N4T3) edge node  (N5T3);

[-,line width=0.01cm,black,opacity=1] (N1T0) edge node  (N1T1);
[-,line width=0.01cm,black,opacity=1] (N1T1) edge node  (N1T2);
[-,line width=0.01cm,black,opacity=1] (N1T2) edge node  (N1T3);

[-,line width=0.01cm,black,opacity=1] (N2T0) edge node  (N2T1);
[-,line width=0.01cm,black,opacity=1] (N2T1) edge node  (N2T2);
[-,line width=0.01cm,black,opacity=1] (N2T2) edge node  (N2T3);

[-,line width=0.01cm,black,opacity=1] (N3T0) edge node  (N3T1);
[-,line width=0.01cm,black,opacity=1] (N3T1) edge node  (N3T2);
[-,line width=0.01cm,black,opacity=1] (N3T2) edge node  (N3T3);

[-,line width=0.01cm,black,opacity=1] (N4T0) edge node  (N4T1);
[-,line width=0.01cm,black,opacity=1] (N4T1) edge node  (N4T2);
[-,line width=0.01cm,black,opacity=1] (N4T2) edge node  (N4T3);

[blue,shape=rectangle] () at (5.8,-1.5) Record decoded edges.;

[xshift=320,every node/.append style=yslant=0,xslant=0,yslant=0,xslant=0]
[circlewc] (target_4) at (0,1) ;
[phase] (control_4) at (-2,1) ;

[-,line width=0.01cm,black,opacity=1] (target_4) edge node  (control_4);

[xshift=320,every node/.append style=yslant=0,xslant=0,yslant=0,xslant=0]
[circlewc] (target_4) at (-2,3) ;
[phase] (control_4) at (0,3) ;

[-,line width=0.01cm,black,opacity=1] (target_4) edge node  (control_4);

[ Using the Pauli-frame of the right patch up to $t=1$, propagated the frame over to the left, record the propagated edges and remove the spurious events. Note that the propagated edges and the removed spurious event are incorrect and will be fixed in the second iteration.]
[scale=1,every node/.style=minimum size=1cm,on grid]
[xshift=0,every node/.append style=yslant=0,xslant=0,yslant=0,xslant=0]
[white,fill opacity=0.0] (0,0) rectangle (10,4);
[fill=white,draw=none] (t0) at (-2,0) $t=0:$;
[fill=white,shape=circle,draw=none] (N0T0) at (0,0) ;
[fill=white,shape=circle,draw=black] (N1T0) at (2,0) ;
[fill=red,shape=circle,draw=black] (N2T0) at (4,0) ;
[fill=white,shape=circle,draw=black] (N3T0) at (6,0) ;
[fill=white,shape=circle,draw=black] (N4T0) at (8,0) ;
[fill=white,shape=circle,draw=none] (N5T0) at (10,0) ;

[-,line width=0.1cm,red,opacity=1] (N0T0) edge node  (N1T0);
[-,line width=0.1cm,red,opacity=1] (N1T0) edge node  (N2T0);
[-,line width=0.01cm,black,opacity=1] (N2T0) edge node  (N3T0);
[-,line width=0.01cm,black,opacity=1] (N3T0) edge node  (N4T0);
[-,line width=0.01cm,black,opacity=1] (N4T0) edge node  (N5T0);

[fill=white,draw=none] (t1) at (-2,2) $t=1:$;
[fill=white,shape=circle,draw=none] (N0T1) at (0,2) ;
[fill=white,shape=circle,draw=black] (N1T1) at (2,2) ;
[fill=white,shape=circle,draw=black] (N2T1) at (4,2) ;
[fill=white,shape=circle,draw=black] (N3T1) at (6,2) ;
[fill=white,shape=circle,draw=black] (N4T1) at (8,2) ;
[fill=white,shape=circle,draw=none] (N5T1) at (10,2) ;

[-,line width=0.01cm,black,opacity=1] (N0T1) edge node  (N1T1);
[-,line width=0.01cm,black,opacity=1] (N1T1) edge node  (N2T1);
[-,line width=0.01cm,black,opacity=1] (N2T1) edge node  (N3T1);
[-,line width=0.01cm,black,opacity=1] (N3T1) edge node  (N4T1);
[-,line width=0.01cm,black,opacity=1] (N4T1) edge node  (N5T1);

[fill=white,draw=none] (t2) at (-2,4) $t=2:$;
[fill=white,shape=circle,draw=none] (N0T2) at (0,4) ;
[fill=white,shape=circle,draw=black] (N1T2) at (2,4) ;
[fill=brown,shape=circle,draw=black] (N2T2) at (4,4) ;
[fill=white,shape=circle,draw=black] (N3T2) at (6,4) ;
[fill=brown,shape=circle,draw=black] (N4T2) at (8,4) ;
[fill=white,shape=circle,draw=none] (N5T2) at (10,4) ;

[-,line width=0.1cm,brown,opacity=1] (N0T2) edge node  (N1T2);
[-,line width=0.1cm,brown,opacity=1] (N1T2) edge node  (N2T2);
[-,line width=0.1cm,green,opacity=1] (N2T2) edge node  (N3T2);
[-,line width=0.1cm,green,opacity=1] (N3T2) edge node  (N4T2);
[-,line width=0.1cm,brown,opacity=1] (N4T2) edge node  (N5T2);

[fill=white,draw=none] (t3) at (-2,6) $t=3:$;
[fill=white,shape=circle,draw=none] (N0T3) at (0,6) ;
[fill=white,shape=circle,draw=black] (N1T3) at (2,6) ;
[fill=white,shape=circle,draw=black] (N2T3) at (4,6) ;
[fill=white,shape=circle,draw=black] (N3T3) at (6,6) ;
[fill=white,shape=circle,draw=black] (N4T3) at (8,6) ;
[fill=white,shape=circle,draw=none] (N5T3) at (10,6) ;

[-,line width=0.01cm,black,opacity=1] (N0T3) edge node  (N1T3);
[-,line width=0.01cm,black,opacity=1] (N1T3) edge node  (N2T3);
[-,line width=0.01cm,black,opacity=1] (N2T3) edge node  (N3T3);
[-,line width=0.01cm,black,opacity=1] (N3T3) edge node  (N4T3);
[-,line width=0.01cm,black,opacity=1] (N4T3) edge node  (N5T3);

[-,line width=0.01cm,black,opacity=1] (N1T0) edge node  (N1T1);
[-,line width=0.01cm,black,opacity=1] (N1T1) edge node  (N1T2);
[-,line width=0.01cm,black,opacity=1] (N1T2) edge node  (N1T3);

[-,line width=0.1cm,blue,opacity=1] (N2T0) edge node  (N2T1);
[-,line width=0.1cm,blue,opacity=1] (N2T1) edge node  (N2T2);
[-,line width=0.01cm,black,opacity=1] (N2T2) edge node  (N2T3);

[-,line width=0.01cm,black,opacity=1] (N3T0) edge node  (N3T1);
[-,line width=0.01cm,black,opacity=1] (N3T1) edge node  (N3T2);
[-,line width=0.01cm,black,opacity=1] (N3T2) edge node  (N3T3);

[-,line width=0.01cm,black,opacity=1] (N4T0) edge node  (N4T1);
[-,line width=0.01cm,black,opacity=1] (N4T1) edge node  (N4T2);
[-,line width=0.01cm,black,opacity=1] (N4T2) edge node  (N4T3);

[-,line width=0.1cm,blue,opacity=1] ($(N4T2) + (0,0.5)$) edge node  ($(N5T2.west) +(0,0.5)$);

[xshift=300,every node/.append style=yslant=0,xslant=0,yslant=0,xslant=0]
[white,fill opacity=0.0] (0,0) rectangle (10,4);

[fill=white,shape=circle,draw=none] (N0T0) at (0,0) ;
[fill=white,shape=circle,draw=black] (N1T0) at (2,0) ;
[fill=white,shape=circle,draw=black] (N2T0) at (4,0) ;
[fill=white,shape=circle,draw=black] (N3T0) at (6,0) ;
[fill=white,shape=circle,draw=black] (N4T0) at (8,0) ;
[fill=white,shape=circle,draw=none] (N5T0) at (10,0) ;

[-,line width=0.01cm,black,opacity=1] (N0T0) edge node  (N1T0);
[-,line width=0.01cm,black,opacity=1] (N1T0) edge node  (N2T0);
[-,line width=0.01cm,black,opacity=1] (N2T0) edge node  (N3T0);
[-,line width=0.01cm,black,opacity=1] (N3T0) edge node  (N4T0);
[-,line width=0.01cm,black,opacity=1] (N4T0) edge node  (N5T0);

[fill=white,shape=circle,draw=none] (N0T1) at (0,2) ;
[fill=white,shape=circle,draw=black] (N1T1) at (2,2) ;
[fill=brown,shape=circle,draw=black] (N2T1) at (4,2) ;
[fill=white,shape=circle,draw=black] (N3T1) at (6,2) ;
[fill=red,shape=circle,draw=black] (N4T1) at (8,2) ;
[fill=white,shape=circle,draw=none] (N5T1) at (10,2) ;

[-,line width=0.1cm,brown,opacity=1] (N0T1) edge node  (N1T1);
[-,line width=0.1cm,brown,opacity=1] (N1T1) edge node  (N2T1);
[-,line width=0.1cm,blue,opacity=1] (N2T1) edge node  (N3T1);
[-,line width=0.1cm,blue,opacity=1] (N3T1) edge node  (N4T1);
[-,line width=0.1cm,red,opacity=1] (N4T1) edge node  (N5T1);

[fill=white,shape=circle,draw=none] (N0T2) at (0,4) ;
[fill=white,shape=circle,draw=black] (N1T2) at (2,4) ;
[fill=white,shape=circle,draw=black] (N2T2) at (4,4) ;
[fill=white,shape=circle,draw=black] (N3T2) at (6,4) ;
[fill=white,shape=circle,draw=black] (N4T2) at (8,4) ;
[fill=white,shape=circle,draw=none] (N5T2) at (10,4) ;

[-,line width=0.01cm,black,opacity=1] (N0T2) edge node  (N1T2);
[-,line width=0.01cm,black,opacity=1] (N1T2) edge node  (N2T2);
[-,line width=0.01cm,black,opacity=1] (N2T2) edge node  (N3T2);
[-,line width=0.01cm,black,opacity=1] (N3T2) edge node  (N4T2);
[-,line width=0.01cm,black,opacity=1] (N4T2) edge node  (N5T2);

[fill=white,shape=circle,draw=none] (N0T3) at (0,6) ;
[fill=white,shape=circle,draw=black] (N1T3) at (2,6) ;
[fill=white,shape=circle,draw=black] (N2T3) at (4,6) ;
[fill=white,shape=circle,draw=black] (N3T3) at (6,6) ;
[fill=white,shape=circle,draw=black] (N4T3) at (8,6) ;
[fill=white,shape=circle,draw=none] (N5T3) at (10,6) ;

[-,line width=0.01cm,black,opacity=1] (N0T3) edge node  (N1T3);
[-,line width=0.01cm,black,opacity=1] (N1T3) edge node  (N2T3);
[-,line width=0.01cm,black,opacity=1] (N2T3) edge node  (N3T3);
[-,line width=0.01cm,black,opacity=1] (N3T3) edge node  (N4T3);
[-,line width=0.01cm,black,opacity=1] (N4T3) edge node  (N5T3);

[-,line width=0.01cm,black,opacity=1] (N1T0) edge node  (N1T1);
[-,line width=0.01cm,black,opacity=1] (N1T1) edge node  (N1T2);
[-,line width=0.01cm,black,opacity=1] (N1T2) edge node  (N1T3);

[-,line width=0.01cm,black,opacity=1] (N2T0) edge node  (N2T1);
[-,line width=0.01cm,black,opacity=1] (N2T1) edge node  (N2T2);
[-,line width=0.01cm,black,opacity=1] (N2T2) edge node  (N2T3);

[-,line width=0.01cm,black,opacity=1] (N3T0) edge node  (N3T1);
[-,line width=0.01cm,black,opacity=1] (N3T1) edge node  (N3T2);
[-,line width=0.01cm,black,opacity=1] (N3T2) edge node  (N3T3);

[-,line width=0.01cm,black,opacity=1] (N4T0) edge node  (N4T1);
[-,line width=0.01cm,black,opacity=1] (N4T1) edge node  (N4T2);
[-,line width=0.01cm,black,opacity=1] (N4T2) edge node  (N4T3);

[xshift=320,every node/.append style=yslant=0,xslant=0,yslant=0,xslant=0]
[circlewc] (target_4) at (0,1) ;
[phase] (control_4) at (-2,1) ;

[-,line width=0.01cm,black,opacity=1] (target_4) edge node  (control_4);

[xshift=320,every node/.append style=yslant=0,xslant=0,yslant=0,xslant=0]
[circlewc] (target_4) at (-2,3) ;
[phase] (control_4) at (0,3) ;

[-,line width=0.01cm,black,opacity=1] (target_4) edge node  (control_4);

[xshift=0,every node/.append style=yslant=0,xslant=0,yslant=0,xslant=0]
[draw=blue,line width = 0.05cm] (3.2,3.2) rectangle ++(5.5,1.8);
[blue,shape=rectangle] () at (5.75,7.25) 1) Remove “spurious” events.;

[xshift=0,every node/.append style=yslant=0,xslant=0,yslant=0,xslant=0]

[green,shape=rectangle] () at (5.5,-1.5) 2) Record propagated edges.;

The procedure outlining the first iteration's second Pauli-frame propagation through the second CNOT.

Then, we decode the logical qubit on the right, leading to the blue decoded edges in figure <ref>. Again these matched edges are incorrect, we will still propagate the frame over from the right at $t=1$ to the left at $t=2$, removing spurious events and recording the green decoded edges (figure <ref>). At the end of the first iteration, we arrive at a series of matched edges as shown in figure <ref>. The pattern of detection events has changed, and this triggers another round of decoding.

[scale=1,every node/.style=minimum size=1cm,on grid]
[xshift=0,every node/.append style=yslant=0,xslant=0,yslant=0,xslant=0]
[white,fill opacity=0.0] (0,0) rectangle (10,4);
[fill=white,draw=none] (t0) at (-2,0) $t=0:$;
[fill=white,shape=circle,draw=none] (N0T0) at (0,0) ;
[fill=white,shape=circle,draw=black] (N1T0) at (2,0) ;
[fill=red,shape=circle,draw=black] (N2T0) at (4,0) ;
[fill=white,shape=circle,draw=black] (N3T0) at (6,0) ;
[fill=white,shape=circle,draw=black] (N4T0) at (8,0) ;
[fill=white,shape=circle,draw=none] (N5T0) at (10,0) ;

[-,line width=0.1cm,red,opacity=1] (N0T0) edge node  (N1T0);
[-,line width=0.1cm,red,opacity=1] (N1T0) edge node  (N2T0);
[-,line width=0.01cm,black,opacity=1] (N2T0) edge node  (N3T0);
[-,line width=0.01cm,black,opacity=1] (N3T0) edge node  (N4T0);
[-,line width=0.01cm,black,opacity=1] (N4T0) edge node  (N5T0);

[fill=white,draw=none] (t1) at (-2,2) $t=1:$;
[fill=white,shape=circle,draw=none] (N0T1) at (0,2) ;
[fill=white,shape=circle,draw=black] (N1T1) at (2,2) ;
[fill=white,shape=circle,draw=black] (N2T1) at (4,2) ;
[fill=white,shape=circle,draw=black] (N3T1) at (6,2) ;
[fill=white,shape=circle,draw=black] (N4T1) at (8,2) ;
[fill=white,shape=circle,draw=none] (N5T1) at (10,2) ;

[-,line width=0.01cm,black,opacity=1] (N0T1) edge node  (N1T1);
[-,line width=0.01cm,black,opacity=1] (N1T1) edge node  (N2T1);
[-,line width=0.01cm,black,opacity=1] (N2T1) edge node  (N3T1);
[-,line width=0.01cm,black,opacity=1] (N3T1) edge node  (N4T1);
[-,line width=0.01cm,black,opacity=1] (N4T1) edge node  (N5T1);

[fill=white,draw=none] (t2) at (-2,4) $t=2:$;
[fill=white,shape=circle,draw=none] (N0T2) at (0,4) ;
[fill=white,shape=circle,draw=black] (N1T2) at (2,4) ;
[fill=white,shape=circle,draw=black] (N2T2) at (4,4) ;
[fill=white,shape=circle,draw=black] (N3T2) at (6,4) ;
[fill=white,shape=circle,draw=black] (N4T2) at (8,4) ;
[fill=white,shape=circle,draw=none] (N5T2) at (10,4) ;

[-,line width=0.1cm,brown,opacity=1] (N0T2) edge node  (N1T2);
[-,line width=0.1cm,brown,opacity=1] (N1T2) edge node  (N2T2);
[-,line width=0.1cm,green,opacity=1] (N2T2) edge node  (N3T2);
[-,line width=0.1cm,green,opacity=1] (N3T2) edge node  (N4T2);
[-,line width=0.1cm,brown,opacity=1] (N4T2) edge node  (N5T2);

[fill=white,draw=none] (t3) at (-2,6) $t=3:$;
[fill=white,shape=circle,draw=none] (N0T3) at (0,6) ;
[fill=white,shape=circle,draw=black] (N1T3) at (2,6) ;
[fill=white,shape=circle,draw=black] (N2T3) at (4,6) ;
[fill=white,shape=circle,draw=black] (N3T3) at (6,6) ;
[fill=white,shape=circle,draw=black] (N4T3) at (8,6) ;
[fill=white,shape=circle,draw=none] (N5T3) at (10,6) ;

[-,line width=0.01cm,black,opacity=1] (N0T3) edge node  (N1T3);
[-,line width=0.01cm,black,opacity=1] (N1T3) edge node  (N2T3);
[-,line width=0.01cm,black,opacity=1] (N2T3) edge node  (N3T3);
[-,line width=0.01cm,black,opacity=1] (N3T3) edge node  (N4T3);
[-,line width=0.01cm,black,opacity=1] (N4T3) edge node  (N5T3);

[-,line width=0.01cm,black,opacity=1] (N1T0) edge node  (N1T1);
[-,line width=0.01cm,black,opacity=1] (N1T1) edge node  (N1T2);
[-,line width=0.01cm,black,opacity=1] (N1T2) edge node  (N1T3);

[-,line width=0.1cm,blue,opacity=1] (N2T0) edge node  (N2T1);
[-,line width=0.1cm,blue,opacity=1] (N2T1) edge node  (N2T2);
[-,line width=0.01cm,black,opacity=1] (N2T2) edge node  (N2T3);

[-,line width=0.01cm,black,opacity=1] (N3T0) edge node  (N3T1);
[-,line width=0.01cm,black,opacity=1] (N3T1) edge node  (N3T2);
[-,line width=0.01cm,black,opacity=1] (N3T2) edge node  (N3T3);

[-,line width=0.01cm,black,opacity=1] (N4T0) edge node  (N4T1);
[-,line width=0.01cm,black,opacity=1] (N4T1) edge node  (N4T2);
[-,line width=0.01cm,black,opacity=1] (N4T2) edge node  (N4T3);

[-,line width=0.1cm,blue,opacity=1] ($(N4T2) + (0,0.5)$) edge node  ($(N5T2.west) +(0,0.5)$);

[xshift=300,every node/.append style=yslant=0,xslant=0,yslant=0,xslant=0]
[white,fill opacity=0.0] (0,0) rectangle (10,4);

[fill=white,shape=circle,draw=none] (N0T0) at (0,0) ;
[fill=white,shape=circle,draw=black] (N1T0) at (2,0) ;
[fill=white,shape=circle,draw=black] (N2T0) at (4,0) ;
[fill=white,shape=circle,draw=black] (N3T0) at (6,0) ;
[fill=white,shape=circle,draw=black] (N4T0) at (8,0) ;
[fill=white,shape=circle,draw=none] (N5T0) at (10,0) ;

[-,line width=0.01cm,black,opacity=1] (N0T0) edge node  (N1T0);
[-,line width=0.01cm,black,opacity=1] (N1T0) edge node  (N2T0);
[-,line width=0.01cm,black,opacity=1] (N2T0) edge node  (N3T0);
[-,line width=0.01cm,black,opacity=1] (N3T0) edge node  (N4T0);
[-,line width=0.01cm,black,opacity=1] (N4T0) edge node  (N5T0);

[fill=white,shape=circle,draw=none] (N0T1) at (0,2) ;
[fill=white,shape=circle,draw=black] (N1T1) at (2,2) ;
[fill=brown,shape=circle,draw=black] (N2T1) at (4,2) ;
[fill=white,shape=circle,draw=black] (N3T1) at (6,2) ;
[fill=red,shape=circle,draw=black] (N4T1) at (8,2) ;
[fill=white,shape=circle,draw=none] (N5T1) at (10,2) ;

[-,line width=0.1cm,brown,opacity=1] (N0T1) edge node  (N1T1);
[-,line width=0.1cm,brown,opacity=1] (N1T1) edge node  (N2T1);
[-,line width=0.1cm,blue,opacity=1] (N2T1) edge node  (N3T1);
[-,line width=0.1cm,blue,opacity=1] (N3T1) edge node  (N4T1);
[-,line width=0.1cm,red,opacity=1] (N4T1) edge node  (N5T1);

[fill=white,shape=circle,draw=none] (N0T2) at (0,4) ;
[fill=white,shape=circle,draw=black] (N1T2) at (2,4) ;
[fill=white,shape=circle,draw=black] (N2T2) at (4,4) ;
[fill=white,shape=circle,draw=black] (N3T2) at (6,4) ;
[fill=white,shape=circle,draw=black] (N4T2) at (8,4) ;
[fill=white,shape=circle,draw=none] (N5T2) at (10,4) ;

[-,line width=0.01cm,black,opacity=1] (N0T2) edge node  (N1T2);
[-,line width=0.01cm,black,opacity=1] (N1T2) edge node  (N2T2);
[-,line width=0.01cm,black,opacity=1] (N2T2) edge node  (N3T2);
[-,line width=0.01cm,black,opacity=1] (N3T2) edge node  (N4T2);
[-,line width=0.01cm,black,opacity=1] (N4T2) edge node  (N5T2);

[fill=white,shape=circle,draw=none] (N0T3) at (0,6) ;
[fill=white,shape=circle,draw=black] (N1T3) at (2,6) ;
[fill=white,shape=circle,draw=black] (N2T3) at (4,6) ;
[fill=white,shape=circle,draw=black] (N3T3) at (6,6) ;
[fill=white,shape=circle,draw=black] (N4T3) at (8,6) ;
[fill=white,shape=circle,draw=none] (N5T3) at (10,6) ;

[-,line width=0.01cm,black,opacity=1] (N0T3) edge node  (N1T3);
[-,line width=0.01cm,black,opacity=1] (N1T3) edge node  (N2T3);
[-,line width=0.01cm,black,opacity=1] (N2T3) edge node  (N3T3);
[-,line width=0.01cm,black,opacity=1] (N3T3) edge node  (N4T3);
[-,line width=0.01cm,black,opacity=1] (N4T3) edge node  (N5T3);

[-,line width=0.01cm,black,opacity=1] (N1T0) edge node  (N1T1);
[-,line width=0.01cm,black,opacity=1] (N1T1) edge node  (N1T2);
[-,line width=0.01cm,black,opacity=1] (N1T2) edge node  (N1T3);

[-,line width=0.01cm,black,opacity=1] (N2T0) edge node  (N2T1);
[-,line width=0.01cm,black,opacity=1] (N2T1) edge node  (N2T2);
[-,line width=0.01cm,black,opacity=1] (N2T2) edge node  (N2T3);

[-,line width=0.01cm,black,opacity=1] (N3T0) edge node  (N3T1);
[-,line width=0.01cm,black,opacity=1] (N3T1) edge node  (N3T2);
[-,line width=0.01cm,black,opacity=1] (N3T2) edge node  (N3T3);

[-,line width=0.01cm,black,opacity=1] (N4T0) edge node  (N4T1);
[-,line width=0.01cm,black,opacity=1] (N4T1) edge node  (N4T2);
[-,line width=0.01cm,black,opacity=1] (N4T2) edge node  (N4T3);

[xshift=320,every node/.append style=yslant=0,xslant=0,yslant=0,xslant=0]
[circlewc] (target_4) at (0,1) ;
[phase] (control_4) at (-2,1) ;

[-,line width=0.01cm,black,opacity=1] (target_4) edge node  (control_4);

[xshift=320,every node/.append style=yslant=0,xslant=0,yslant=0,xslant=0]
[circlewc] (target_4) at (-2,3) ;
[phase] (control_4) at (0,3) ;

[-,line width=0.01cm,black,opacity=1] (target_4) edge node  (control_4);

The decoded and propagated edge record after the first iteration, note that we have removed two spurious detection events but at this stage introduced a logical error. This will be rectified in the second iteration.

§.§.§ $2^{\text{nd}}$ iteration

It's clear that a single iteration of frame propagation will not be sufficient to find good decoded edges in this case. In the second iteration, we reset the magneta edges on the left qubit and decode again leading to new blue edges at $t=0$ (figure <ref>). Propagate the Pauli-frame over to $t=1$ of the logical qubit on the right, removing the spurious events and record the newly propagated green edges (figure <ref>).

[Reset the decoded blue edges on the left logical qubit and then re-decode.]
[scale=1,every node/.style=minimum size=1cm,on grid]
[xshift=0,every node/.append style=yslant=0,xslant=0,yslant=0,xslant=0]
[white,fill opacity=0.0] (0,0) rectangle (10,4);
[fill=white,draw=none] (t0) at (-2,0) $t=0:$;
[fill=white,shape=circle,draw=none] (N0T0) at (0,0) ;
[fill=white,shape=circle,draw=black] (N1T0) at (2,0) ;
[fill=red,shape=circle,draw=black] (N2T0) at (4,0) ;
[fill=white,shape=circle,draw=black] (N3T0) at (6,0) ;
[fill=white,shape=circle,draw=black] (N4T0) at (8,0) ;
[fill=white,shape=circle,draw=none] (N5T0) at (10,0) ;

[-,line width=0.1cm,red,opacity=1] (N0T0) edge node  (N1T0);
[-,line width=0.1cm,red,opacity=1] (N1T0) edge node  (N2T0);
[-,line width=0.01cm,black,opacity=1] (N2T0) edge node  (N3T0);
[-,line width=0.01cm,black,opacity=1] (N3T0) edge node  (N4T0);
[-,line width=0.01cm,black,opacity=1] (N4T0) edge node  (N5T0);

[fill=white,draw=none] (t1) at (-2,2) $t=1:$;
[fill=white,shape=circle,draw=none] (N0T1) at (0,2) ;
[fill=white,shape=circle,draw=black] (N1T1) at (2,2) ;
[fill=white,shape=circle,draw=black] (N2T1) at (4,2) ;
[fill=white,shape=circle,draw=black] (N3T1) at (6,2) ;
[fill=white,shape=circle,draw=black] (N4T1) at (8,2) ;
[fill=white,shape=circle,draw=none] (N5T1) at (10,2) ;

[-,line width=0.01cm,black,opacity=1] (N0T1) edge node  (N1T1);
[-,line width=0.01cm,black,opacity=1] (N1T1) edge node  (N2T1);
[-,line width=0.01cm,black,opacity=1] (N2T1) edge node  (N3T1);
[-,line width=0.01cm,black,opacity=1] (N3T1) edge node  (N4T1);
[-,line width=0.01cm,black,opacity=1] (N4T1) edge node  (N5T1);

[fill=white,draw=none] (t2) at (-2,4) $t=2:$;
[fill=white,shape=circle,draw=none] (N0T2) at (0,4) ;
[fill=white,shape=circle,draw=black] (N1T2) at (2,4) ;
[fill=white,shape=circle,draw=black] (N2T2) at (4,4) ;
[fill=white,shape=circle,draw=black] (N3T2) at (6,4) ;
[fill=white,shape=circle,draw=black] (N4T2) at (8,4) ;
[fill=white,shape=circle,draw=none] (N5T2) at (10,4) ;

[-,line width=0.1cm,brown,opacity=1] (N0T2) edge node  (N1T2);
[-,line width=0.1cm,brown,opacity=1] (N1T2) edge node  (N2T2);
[-,line width=0.1cm,green,opacity=1] (N2T2) edge node  (N3T2);
[-,line width=0.1cm,green,opacity=1] (N3T2) edge node  (N4T2);
[-,line width=0.1cm,brown,opacity=1] (N4T2) edge node  (N5T2);

[fill=white,draw=none] (t3) at (-2,6) $t=3:$;
[fill=white,shape=circle,draw=none] (N0T3) at (0,6) ;
[fill=white,shape=circle,draw=black] (N1T3) at (2,6) ;
[fill=white,shape=circle,draw=black] (N2T3) at (4,6) ;
[fill=white,shape=circle,draw=black] (N3T3) at (6,6) ;
[fill=white,shape=circle,draw=black] (N4T3) at (8,6) ;
[fill=white,shape=circle,draw=none] (N5T3) at (10,6) ;

[-,line width=0.01cm,black,opacity=1] (N0T3) edge node  (N1T3);
[-,line width=0.01cm,black,opacity=1] (N1T3) edge node  (N2T3);
[-,line width=0.01cm,black,opacity=1] (N2T3) edge node  (N3T3);
[-,line width=0.01cm,black,opacity=1] (N3T3) edge node  (N4T3);
[-,line width=0.01cm,black,opacity=1] (N4T3) edge node  (N5T3);

[-,line width=0.01cm,black,opacity=1] (N1T0) edge node  (N1T1);
[-,line width=0.01cm,black,opacity=1] (N1T1) edge node  (N1T2);
[-,line width=0.01cm,black,opacity=1] (N1T2) edge node  (N1T3);

[-,line width=0.01cm,black,opacity=1] (N2T0) edge node  (N2T1);
[-,line width=0.01cm,black,opacity=1] (N2T1) edge node  (N2T2);
[-,line width=0.01cm,black,opacity=1] (N2T2) edge node  (N2T3);

[-,line width=0.01cm,black,opacity=1] (N3T0) edge node  (N3T1);
[-,line width=0.01cm,black,opacity=1] (N3T1) edge node  (N3T2);
[-,line width=0.01cm,black,opacity=1] (N3T2) edge node  (N3T3);

[-,line width=0.01cm,black,opacity=1] (N4T0) edge node  (N4T1);
[-,line width=0.01cm,black,opacity=1] (N4T1) edge node  (N4T2);
[-,line width=0.01cm,black,opacity=1] (N4T2) edge node  (N4T3);

[blue,shape=rectangle] () at (2.5,-1.5) Record decoded edges.;

[-,line width=0.1cm,blue,opacity=1] ($(N0T0.east) + (0,0.5)$) edge node  ($(N1T0) +(0,0.5)$);

[-,line width=0.1cm,blue,opacity=1] ($(N0T0.east) + (0,0.5)$) edge node  ($(N1T0) +(0,0.5)$);

[-,line width=0.1cm,blue,opacity=1] ($(N1T0) + (0,0.5)$) edge node  ($(N2T0) +(0,0.5)$);

[xshift=300,every node/.append style=yslant=0,xslant=0,yslant=0,xslant=0]
[white,fill opacity=0.0] (0,0) rectangle (10,4);

[fill=white,shape=circle,draw=none] (N0T0) at (0,0) ;
[fill=white,shape=circle,draw=black] (N1T0) at (2,0) ;
[fill=white,shape=circle,draw=black] (N2T0) at (4,0) ;
[fill=white,shape=circle,draw=black] (N3T0) at (6,0) ;
[fill=white,shape=circle,draw=black] (N4T0) at (8,0) ;
[fill=white,shape=circle,draw=none] (N5T0) at (10,0) ;

[-,line width=0.01cm,black,opacity=1] (N0T0) edge node  (N1T0);
[-,line width=0.01cm,black,opacity=1] (N1T0) edge node  (N2T0);
[-,line width=0.01cm,black,opacity=1] (N2T0) edge node  (N3T0);
[-,line width=0.01cm,black,opacity=1] (N3T0) edge node  (N4T0);
[-,line width=0.01cm,black,opacity=1] (N4T0) edge node  (N5T0);

[fill=white,shape=circle,draw=none] (N0T1) at (0,2) ;
[fill=white,shape=circle,draw=black] (N1T1) at (2,2) ;
[fill=brown,shape=circle,draw=black] (N2T1) at (4,2) ;
[fill=white,shape=circle,draw=black] (N3T1) at (6,2) ;
[fill=red,shape=circle,draw=black] (N4T1) at (8,2) ;
[fill=white,shape=circle,draw=none] (N5T1) at (10,2) ;

[-,line width=0.1cm,brown,opacity=1] (N0T1) edge node  (N1T1);
[-,line width=0.1cm,brown,opacity=1] (N1T1) edge node  (N2T1);
[-,line width=0.1cm,blue,opacity=1] (N2T1) edge node  (N3T1);
[-,line width=0.1cm,blue,opacity=1] (N3T1) edge node  (N4T1);
[-,line width=0.1cm,red,opacity=1] (N4T1) edge node  (N5T1);

[fill=white,shape=circle,draw=none] (N0T2) at (0,4) ;
[fill=white,shape=circle,draw=black] (N1T2) at (2,4) ;
[fill=white,shape=circle,draw=black] (N2T2) at (4,4) ;
[fill=white,shape=circle,draw=black] (N3T2) at (6,4) ;
[fill=white,shape=circle,draw=black] (N4T2) at (8,4) ;
[fill=white,shape=circle,draw=none] (N5T2) at (10,4) ;

[-,line width=0.01cm,black,opacity=1] (N0T2) edge node  (N1T2);
[-,line width=0.01cm,black,opacity=1] (N1T2) edge node  (N2T2);
[-,line width=0.01cm,black,opacity=1] (N2T2) edge node  (N3T2);
[-,line width=0.01cm,black,opacity=1] (N3T2) edge node  (N4T2);
[-,line width=0.01cm,black,opacity=1] (N4T2) edge node  (N5T2);

[fill=white,shape=circle,draw=none] (N0T3) at (0,6) ;
[fill=white,shape=circle,draw=black] (N1T3) at (2,6) ;
[fill=white,shape=circle,draw=black] (N2T3) at (4,6) ;
[fill=white,shape=circle,draw=black] (N3T3) at (6,6) ;
[fill=white,shape=circle,draw=black] (N4T3) at (8,6) ;
[fill=white,shape=circle,draw=none] (N5T3) at (10,6) ;

[-,line width=0.01cm,black,opacity=1] (N0T3) edge node  (N1T3);
[-,line width=0.01cm,black,opacity=1] (N1T3) edge node  (N2T3);
[-,line width=0.01cm,black,opacity=1] (N2T3) edge node  (N3T3);
[-,line width=0.01cm,black,opacity=1] (N3T3) edge node  (N4T3);
[-,line width=0.01cm,black,opacity=1] (N4T3) edge node  (N5T3);

[-,line width=0.01cm,black,opacity=1] (N1T0) edge node  (N1T1);
[-,line width=0.01cm,black,opacity=1] (N1T1) edge node  (N1T2);
[-,line width=0.01cm,black,opacity=1] (N1T2) edge node  (N1T3);

[-,line width=0.01cm,black,opacity=1] (N2T0) edge node  (N2T1);
[-,line width=0.01cm,black,opacity=1] (N2T1) edge node  (N2T2);
[-,line width=0.01cm,black,opacity=1] (N2T2) edge node  (N2T3);

[-,line width=0.01cm,black,opacity=1] (N3T0) edge node  (N3T1);
[-,line width=0.01cm,black,opacity=1] (N3T1) edge node  (N3T2);
[-,line width=0.01cm,black,opacity=1] (N3T2) edge node  (N3T3);

[-,line width=0.01cm,black,opacity=1] (N4T0) edge node  (N4T1);
[-,line width=0.01cm,black,opacity=1] (N4T1) edge node  (N4T2);
[-,line width=0.01cm,black,opacity=1] (N4T2) edge node  (N4T3);

[xshift=320,every node/.append style=yslant=0,xslant=0,yslant=0,xslant=0]
[circlewc] (target_4) at (0,1) ;
[phase] (control_4) at (-2,1) ;

[-,line width=0.01cm,black,opacity=1] (target_4) edge node  (control_4);

[xshift=320,every node/.append style=yslant=0,xslant=0,yslant=0,xslant=0]
[circlewc] (target_4) at (-2,3) ;
[phase] (control_4) at (0,3) ;

[-,line width=0.01cm,black,opacity=1] (target_4) edge node  (control_4);

[Propagate the Pauli-frame up till $t=0$ from the left logical qubit from figure <ref> to the right logical qubit at $t=1$.]
[scale=1,every node/.style=minimum size=1cm,on grid]
[xshift=0,every node/.append style=yslant=0,xslant=0,yslant=0,xslant=0]
[white,fill opacity=0.0] (0,0) rectangle (10,4);
[fill=white,draw=none] (t0) at (-2,0) $t=0:$;
[fill=white,shape=circle,draw=none] (N0T0) at (0,0) ;
[fill=white,shape=circle,draw=black] (N1T0) at (2,0) ;
[fill=red,shape=circle,draw=black] (N2T0) at (4,0) ;
[fill=white,shape=circle,draw=black] (N3T0) at (6,0) ;
[fill=white,shape=circle,draw=black] (N4T0) at (8,0) ;
[fill=white,shape=circle,draw=none] (N5T0) at (10,0) ;

[-,line width=0.1cm,red,opacity=1] (N0T0) edge node  (N1T0);
[-,line width=0.1cm,red,opacity=1] (N1T0) edge node  (N2T0);
[-,line width=0.01cm,black,opacity=1] (N2T0) edge node  (N3T0);
[-,line width=0.01cm,black,opacity=1] (N3T0) edge node  (N4T0);
[-,line width=0.01cm,black,opacity=1] (N4T0) edge node  (N5T0);

[fill=white,draw=none] (t1) at (-2,2) $t=1:$;
[fill=white,shape=circle,draw=none] (N0T1) at (0,2) ;
[fill=white,shape=circle,draw=black] (N1T1) at (2,2) ;
[fill=white,shape=circle,draw=black] (N2T1) at (4,2) ;
[fill=white,shape=circle,draw=black] (N3T1) at (6,2) ;
[fill=white,shape=circle,draw=black] (N4T1) at (8,2) ;
[fill=white,shape=circle,draw=none] (N5T1) at (10,2) ;

[-,line width=0.01cm,black,opacity=1] (N0T1) edge node  (N1T1);
[-,line width=0.01cm,black,opacity=1] (N1T1) edge node  (N2T1);
[-,line width=0.01cm,black,opacity=1] (N2T1) edge node  (N3T1);
[-,line width=0.01cm,black,opacity=1] (N3T1) edge node  (N4T1);
[-,line width=0.01cm,black,opacity=1] (N4T1) edge node  (N5T1);

[fill=white,draw=none] (t2) at (-2,4) $t=2:$;
[fill=white,shape=circle,draw=none] (N0T2) at (0,4) ;
[fill=white,shape=circle,draw=black] (N1T2) at (2,4) ;
[fill=white,shape=circle,draw=black] (N2T2) at (4,4) ;
[fill=white,shape=circle,draw=black] (N3T2) at (6,4) ;
[fill=white,shape=circle,draw=black] (N4T2) at (8,4) ;
[fill=white,shape=circle,draw=none] (N5T2) at (10,4) ;

[-,line width=0.1cm,brown,opacity=1] (N0T2) edge node  (N1T2);
[-,line width=0.1cm,brown,opacity=1] (N1T2) edge node  (N2T2);
[-,line width=0.1cm,green,opacity=1] (N2T2) edge node  (N3T2);
[-,line width=0.1cm,green,opacity=1] (N3T2) edge node  (N4T2);
[-,line width=0.1cm,brown,opacity=1] (N4T2) edge node  (N5T2);

[fill=white,draw=none] (t3) at (-2,6) $t=3:$;
[fill=white,shape=circle,draw=none] (N0T3) at (0,6) ;
[fill=white,shape=circle,draw=black] (N1T3) at (2,6) ;
[fill=white,shape=circle,draw=black] (N2T3) at (4,6) ;
[fill=white,shape=circle,draw=black] (N3T3) at (6,6) ;
[fill=white,shape=circle,draw=black] (N4T3) at (8,6) ;
[fill=white,shape=circle,draw=none] (N5T3) at (10,6) ;

[-,line width=0.01cm,black,opacity=1] (N0T3) edge node  (N1T3);
[-,line width=0.01cm,black,opacity=1] (N1T3) edge node  (N2T3);
[-,line width=0.01cm,black,opacity=1] (N2T3) edge node  (N3T3);
[-,line width=0.01cm,black,opacity=1] (N3T3) edge node  (N4T3);
[-,line width=0.01cm,black,opacity=1] (N4T3) edge node  (N5T3);

[-,line width=0.01cm,black,opacity=1] (N1T0) edge node  (N1T1);
[-,line width=0.01cm,black,opacity=1] (N1T1) edge node  (N1T2);
[-,line width=0.01cm,black,opacity=1] (N1T2) edge node  (N1T3);

[-,line width=0.01cm,black,opacity=1] (N2T0) edge node  (N2T1);
[-,line width=0.01cm,black,opacity=1] (N2T1) edge node  (N2T2);
[-,line width=0.01cm,black,opacity=1] (N2T2) edge node  (N2T3);

[-,line width=0.01cm,black,opacity=1] (N3T0) edge node  (N3T1);
[-,line width=0.01cm,black,opacity=1] (N3T1) edge node  (N3T2);
[-,line width=0.01cm,black,opacity=1] (N3T2) edge node  (N3T3);

[-,line width=0.01cm,black,opacity=1] (N4T0) edge node  (N4T1);
[-,line width=0.01cm,black,opacity=1] (N4T1) edge node  (N4T2);
[-,line width=0.01cm,black,opacity=1] (N4T2) edge node  (N4T3);

[-,line width=0.1cm,blue,opacity=1] ($(N0T0.east) + (0,0.5)$) edge node  ($(N1T0) +(0,0.5)$);

[-,line width=0.1cm,blue,opacity=1] ($(N0T0.east) + (0,0.5)$) edge node  ($(N1T0) +(0,0.5)$);

[-,line width=0.1cm,blue,opacity=1] ($(N1T0) + (0,0.5)$) edge node  ($(N2T0) +(0,0.5)$);

[xshift=300,every node/.append style=yslant=0,xslant=0,yslant=0,xslant=0]
[white,fill opacity=0.0] (0,0) rectangle (10,4);

[fill=white,shape=circle,draw=none] (N0T0) at (0,0) ;
[fill=white,shape=circle,draw=black] (N1T0) at (2,0) ;
[fill=white,shape=circle,draw=black] (N2T0) at (4,0) ;
[fill=white,shape=circle,draw=black] (N3T0) at (6,0) ;
[fill=white,shape=circle,draw=black] (N4T0) at (8,0) ;
[fill=white,shape=circle,draw=none] (N5T0) at (10,0) ;

[-,line width=0.01cm,black,opacity=1] (N0T0) edge node  (N1T0);
[-,line width=0.01cm,black,opacity=1] (N1T0) edge node  (N2T0);
[-,line width=0.01cm,black,opacity=1] (N2T0) edge node  (N3T0);
[-,line width=0.01cm,black,opacity=1] (N3T0) edge node  (N4T0);
[-,line width=0.01cm,black,opacity=1] (N4T0) edge node  (N5T0);

[fill=white,shape=circle,draw=none] (N0T1) at (0,2) ;
[fill=white,shape=circle,draw=black] (N1T1) at (2,2) ;
[fill=brown,shape=circle,draw=black] (N2T1) at (4,2) ;
[fill=white,shape=circle,draw=black] (N3T1) at (6,2) ;
[fill=red,shape=circle,draw=black] (N4T1) at (8,2) ;
[fill=white,shape=circle,draw=none] (N5T1) at (10,2) ;

[-,line width=0.1cm,brown,opacity=1] (N0T1) edge node  (N1T1);
[-,line width=0.1cm,brown,opacity=1] (N1T1) edge node  (N2T1);
[-,line width=0.1cm,blue,opacity=1] (N2T1) edge node  (N3T1);
[-,line width=0.1cm,blue,opacity=1] (N3T1) edge node  (N4T1);
[-,line width=0.1cm,red,opacity=1] (N4T1) edge node  (N5T1);

[fill=white,shape=circle,draw=none] (N0T2) at (0,4) ;
[fill=white,shape=circle,draw=black] (N1T2) at (2,4) ;
[fill=white,shape=circle,draw=black] (N2T2) at (4,4) ;
[fill=white,shape=circle,draw=black] (N3T2) at (6,4) ;
[fill=white,shape=circle,draw=black] (N4T2) at (8,4) ;
[fill=white,shape=circle,draw=none] (N5T2) at (10,4) ;

[-,line width=0.01cm,black,opacity=1] (N0T2) edge node  (N1T2);
[-,line width=0.01cm,black,opacity=1] (N1T2) edge node  (N2T2);
[-,line width=0.01cm,black,opacity=1] (N2T2) edge node  (N3T2);
[-,line width=0.01cm,black,opacity=1] (N3T2) edge node  (N4T2);
[-,line width=0.01cm,black,opacity=1] (N4T2) edge node  (N5T2);

[fill=white,shape=circle,draw=none] (N0T3) at (0,6) ;
[fill=white,shape=circle,draw=black] (N1T3) at (2,6) ;
[fill=white,shape=circle,draw=black] (N2T3) at (4,6) ;
[fill=white,shape=circle,draw=black] (N3T3) at (6,6) ;
[fill=white,shape=circle,draw=black] (N4T3) at (8,6) ;
[fill=white,shape=circle,draw=none] (N5T3) at (10,6) ;

[-,line width=0.01cm,black,opacity=1] (N0T3) edge node  (N1T3);
[-,line width=0.01cm,black,opacity=1] (N1T3) edge node  (N2T3);
[-,line width=0.01cm,black,opacity=1] (N2T3) edge node  (N3T3);
[-,line width=0.01cm,black,opacity=1] (N3T3) edge node  (N4T3);
[-,line width=0.01cm,black,opacity=1] (N4T3) edge node  (N5T3);

[-,line width=0.01cm,black,opacity=1] (N1T0) edge node  (N1T1);
[-,line width=0.01cm,black,opacity=1] (N1T1) edge node  (N1T2);
[-,line width=0.01cm,black,opacity=1] (N1T2) edge node  (N1T3);

[-,line width=0.01cm,black,opacity=1] (N2T0) edge node  (N2T1);
[-,line width=0.01cm,black,opacity=1] (N2T1) edge node  (N2T2);
[-,line width=0.01cm,black,opacity=1] (N2T2) edge node  (N2T3);

[-,line width=0.01cm,black,opacity=1] (N3T0) edge node  (N3T1);
[-,line width=0.01cm,black,opacity=1] (N3T1) edge node  (N3T2);
[-,line width=0.01cm,black,opacity=1] (N3T2) edge node  (N3T3);

[-,line width=0.01cm,black,opacity=1] (N4T0) edge node  (N4T1);
[-,line width=0.01cm,black,opacity=1] (N4T1) edge node  (N4T2);
[-,line width=0.01cm,black,opacity=1] (N4T2) edge node  (N4T3);

[-,line width=0.1cm,green,opacity=1] ($(N0T1.east) + (0,0.5)$) edge node  ($(N1T1) +(0,0.5)$);

[-,line width=0.1cm,green,opacity=1] ($(N1T1) + (0,0.5)$) edge node  ($(N2T1) +(0,0.5)$);

[xshift=320,every node/.append style=yslant=0,xslant=0,yslant=0,xslant=0]
[circlewc] (target_4) at (0,1) ;
[phase] (control_4) at (-2,1) ;

[-,line width=0.01cm,black,opacity=1] (target_4) edge node  (control_4);

[xshift=320,every node/.append style=yslant=0,xslant=0,yslant=0,xslant=0]
[circlewc] (target_4) at (-2,3) ;
[phase] (control_4) at (0,3) ;

[-,line width=0.01cm,black,opacity=1] (target_4) edge node  (control_4);

[xshift=300,every node/.append style=yslant=0,xslant=0,yslant=0,xslant=0]
[draw=blue,line width = 0.05cm] (0.5,1.2) rectangle ++(4.5,1.8);
[blue] () at (4.5,7.5) 1) Remove spurious events.;

[xshift=300,every node/.append style=yslant=0,xslant=0,yslant=0,xslant=0]

[green,shape=rectangle] () at (3.5,-1.5) 2) Record propagated edges.;

In the second iteration of the Pauli-frame through the first CNOT, we can see that we have correctly identified some more of the errored edges.

Next, the right logical qubit is decoded, leading to blue edges at $t=1$ in figure <ref>. Before propagating the frame from $t=1$ on the right to left, we need to remove the previously propagated edges and spurious events at $t=2$ on the left from the first iteration (see figure <ref>). We then reset the decoded blue edges on the left, before following the conventional frame propagation shown in figure <ref> to <ref>.

[ Reset the decoded blue edges on the right patch and re-decode.]
[scale=1,every node/.style=minimum size=1cm,on grid]
[xshift=0,every node/.append style=yslant=0,xslant=0,yslant=0,xslant=0]
[white,fill opacity=0.0] (0,0) rectangle (10,4);
[fill=white,draw=none] (t0) at (-2,0) $t=0:$;
[fill=white,shape=circle,draw=none] (N0T0) at (0,0) ;
[fill=white,shape=circle,draw=black] (N1T0) at (2,0) ;
[fill=red,shape=circle,draw=black] (N2T0) at (4,0) ;
[fill=white,shape=circle,draw=black] (N3T0) at (6,0) ;
[fill=white,shape=circle,draw=black] (N4T0) at (8,0) ;
[fill=white,shape=circle,draw=none] (N5T0) at (10,0) ;

[-,line width=0.1cm,red,opacity=1] (N0T0) edge node  (N1T0);
[-,line width=0.1cm,red,opacity=1] (N1T0) edge node  (N2T0);
[-,line width=0.01cm,black,opacity=1] (N2T0) edge node  (N3T0);
[-,line width=0.01cm,black,opacity=1] (N3T0) edge node  (N4T0);
[-,line width=0.01cm,black,opacity=1] (N4T0) edge node  (N5T0);

[fill=white,draw=none] (t1) at (-2,2) $t=1:$;
[fill=white,shape=circle,draw=none] (N0T1) at (0,2) ;
[fill=white,shape=circle,draw=black] (N1T1) at (2,2) ;
[fill=white,shape=circle,draw=black] (N2T1) at (4,2) ;
[fill=white,shape=circle,draw=black] (N3T1) at (6,2) ;
[fill=white,shape=circle,draw=black] (N4T1) at (8,2) ;
[fill=white,shape=circle,draw=none] (N5T1) at (10,2) ;

[-,line width=0.01cm,black,opacity=1] (N0T1) edge node  (N1T1);
[-,line width=0.01cm,black,opacity=1] (N1T1) edge node  (N2T1);
[-,line width=0.01cm,black,opacity=1] (N2T1) edge node  (N3T1);
[-,line width=0.01cm,black,opacity=1] (N3T1) edge node  (N4T1);
[-,line width=0.01cm,black,opacity=1] (N4T1) edge node  (N5T1);

[fill=white,draw=none] (t2) at (-2,4) $t=2:$;
[fill=white,shape=circle,draw=none] (N0T2) at (0,4) ;
[fill=white,shape=circle,draw=black] (N1T2) at (2,4) ;
[fill=white,shape=circle,draw=black] (N2T2) at (4,4) ;
[fill=white,shape=circle,draw=black] (N3T2) at (6,4) ;
[fill=white,shape=circle,draw=black] (N4T2) at (8,4) ;
[fill=white,shape=circle,draw=none] (N5T2) at (10,4) ;

[-,line width=0.1cm,brown,opacity=1] (N0T2) edge node  (N1T2);
[-,line width=0.1cm,brown,opacity=1] (N1T2) edge node  (N2T2);
[-,line width=0.1cm,green,opacity=1] (N2T2) edge node  (N3T2);
[-,line width=0.1cm,green,opacity=1] (N3T2) edge node  (N4T2);
[-,line width=0.1cm,brown,opacity=1] (N4T2) edge node  (N5T2);

[fill=white,draw=none] (t3) at (-2,6) $t=3:$;
[fill=white,shape=circle,draw=none] (N0T3) at (0,6) ;
[fill=white,shape=circle,draw=black] (N1T3) at (2,6) ;
[fill=white,shape=circle,draw=black] (N2T3) at (4,6) ;
[fill=white,shape=circle,draw=black] (N3T3) at (6,6) ;
[fill=white,shape=circle,draw=black] (N4T3) at (8,6) ;
[fill=white,shape=circle,draw=none] (N5T3) at (10,6) ;

[-,line width=0.01cm,black,opacity=1] (N0T3) edge node  (N1T3);
[-,line width=0.01cm,black,opacity=1] (N1T3) edge node  (N2T3);
[-,line width=0.01cm,black,opacity=1] (N2T3) edge node  (N3T3);
[-,line width=0.01cm,black,opacity=1] (N3T3) edge node  (N4T3);
[-,line width=0.01cm,black,opacity=1] (N4T3) edge node  (N5T3);

[-,line width=0.01cm,black,opacity=1] (N1T0) edge node  (N1T1);
[-,line width=0.01cm,black,opacity=1] (N1T1) edge node  (N1T2);
[-,line width=0.01cm,black,opacity=1] (N1T2) edge node  (N1T3);

[-,line width=0.01cm,black,opacity=1] (N2T0) edge node  (N2T1);
[-,line width=0.01cm,black,opacity=1] (N2T1) edge node  (N2T2);
[-,line width=0.01cm,black,opacity=1] (N2T2) edge node  (N2T3);

[-,line width=0.01cm,black,opacity=1] (N3T0) edge node  (N3T1);
[-,line width=0.01cm,black,opacity=1] (N3T1) edge node  (N3T2);
[-,line width=0.01cm,black,opacity=1] (N3T2) edge node  (N3T3);

[-,line width=0.01cm,black,opacity=1] (N4T0) edge node  (N4T1);
[-,line width=0.01cm,black,opacity=1] (N4T1) edge node  (N4T2);
[-,line width=0.01cm,black,opacity=1] (N4T2) edge node  (N4T3);

[-,line width=0.1cm,blue,opacity=1] ($(N0T0.east) + (0,0.5)$) edge node  ($(N1T0) +(0,0.5)$);

[-,line width=0.1cm,blue,opacity=1] ($(N0T0.east) + (0,0.5)$) edge node  ($(N1T0) +(0,0.5)$);

[-,line width=0.1cm,blue,opacity=1] ($(N1T0) + (0,0.5)$) edge node  ($(N2T0) +(0,0.5)$);

[xshift=300,every node/.append style=yslant=0,xslant=0,yslant=0,xslant=0]
[white,fill opacity=0.0] (0,0) rectangle (10,4);

[fill=white,shape=circle,draw=none] (N0T0) at (0,0) ;
[fill=white,shape=circle,draw=black] (N1T0) at (2,0) ;
[fill=white,shape=circle,draw=black] (N2T0) at (4,0) ;
[fill=white,shape=circle,draw=black] (N3T0) at (6,0) ;
[fill=white,shape=circle,draw=black] (N4T0) at (8,0) ;
[fill=white,shape=circle,draw=none] (N5T0) at (10,0) ;

[-,line width=0.01cm,black,opacity=1] (N0T0) edge node  (N1T0);
[-,line width=0.01cm,black,opacity=1] (N1T0) edge node  (N2T0);
[-,line width=0.01cm,black,opacity=1] (N2T0) edge node  (N3T0);
[-,line width=0.01cm,black,opacity=1] (N3T0) edge node  (N4T0);
[-,line width=0.01cm,black,opacity=1] (N4T0) edge node  (N5T0);

[fill=white,shape=circle,draw=none] (N0T1) at (0,2) ;
[fill=white,shape=circle,draw=black] (N1T1) at (2,2) ;
[fill=white,shape=circle,draw=black] (N2T1) at (4,2) ;
[fill=white,shape=circle,draw=black] (N3T1) at (6,2) ;
[fill=red,shape=circle,draw=black] (N4T1) at (8,2) ;
[fill=white,shape=circle,draw=none] (N5T1) at (10,2) ;

[-,line width=0.1cm,brown,opacity=1] (N0T1) edge node  (N1T1);
[-,line width=0.1cm,brown,opacity=1] (N1T1) edge node  (N2T1);
[-,line width=0.01cm,black,opacity=1] (N2T1) edge node  (N3T1);
[-,line width=0.01cm,black,opacity=1] (N3T1) edge node  (N4T1);
[-,line width=0.1cm,red,opacity=1] (N4T1) edge node  (N5T1);

[fill=white,shape=circle,draw=none] (N0T2) at (0,4) ;
[fill=white,shape=circle,draw=black] (N1T2) at (2,4) ;
[fill=white,shape=circle,draw=black] (N2T2) at (4,4) ;
[fill=white,shape=circle,draw=black] (N3T2) at (6,4) ;
[fill=white,shape=circle,draw=black] (N4T2) at (8,4) ;
[fill=white,shape=circle,draw=none] (N5T2) at (10,4) ;

[-,line width=0.01cm,black,opacity=1] (N0T2) edge node  (N1T2);
[-,line width=0.01cm,black,opacity=1] (N1T2) edge node  (N2T2);
[-,line width=0.01cm,black,opacity=1] (N2T2) edge node  (N3T2);
[-,line width=0.01cm,black,opacity=1] (N3T2) edge node  (N4T2);
[-,line width=0.01cm,black,opacity=1] (N4T2) edge node  (N5T2);

[fill=white,shape=circle,draw=none] (N0T3) at (0,6) ;
[fill=white,shape=circle,draw=black] (N1T3) at (2,6) ;
[fill=white,shape=circle,draw=black] (N2T3) at (4,6) ;
[fill=white,shape=circle,draw=black] (N3T3) at (6,6) ;
[fill=white,shape=circle,draw=black] (N4T3) at (8,6) ;
[fill=white,shape=circle,draw=none] (N5T3) at (10,6) ;

[-,line width=0.01cm,black,opacity=1] (N0T3) edge node  (N1T3);
[-,line width=0.01cm,black,opacity=1] (N1T3) edge node  (N2T3);
[-,line width=0.01cm,black,opacity=1] (N2T3) edge node  (N3T3);
[-,line width=0.01cm,black,opacity=1] (N3T3) edge node  (N4T3);
[-,line width=0.01cm,black,opacity=1] (N4T3) edge node  (N5T3);

[-,line width=0.01cm,black,opacity=1] (N1T0) edge node  (N1T1);
[-,line width=0.01cm,black,opacity=1] (N1T1) edge node  (N1T2);
[-,line width=0.01cm,black,opacity=1] (N1T2) edge node  (N1T3);

[-,line width=0.01cm,black,opacity=1] (N2T0) edge node  (N2T1);
[-,line width=0.01cm,black,opacity=1] (N2T1) edge node  (N2T2);
[-,line width=0.01cm,black,opacity=1] (N2T2) edge node  (N2T3);

[-,line width=0.01cm,black,opacity=1] (N3T0) edge node  (N3T1);
[-,line width=0.01cm,black,opacity=1] (N3T1) edge node  (N3T2);
[-,line width=0.01cm,black,opacity=1] (N3T2) edge node  (N3T3);

[-,line width=0.01cm,black,opacity=1] (N4T0) edge node  (N4T1);
[-,line width=0.01cm,black,opacity=1] (N4T1) edge node  (N4T2);
[-,line width=0.01cm,black,opacity=1] (N4T2) edge node  (N4T3);

[blue] () at (5.8,-1.5) Record decoded edges.;

[-,line width=0.1cm,green,opacity=1] ($(N0T1.east) + (0,0.5)$) edge node  ($(N1T1) +(0,0.5)$);

[-,line width=0.1cm,green,opacity=1] ($(N1T1) + (0,0.5)$) edge node  ($(N2T1) +(0,0.5)$);

[-,line width=0.1cm,blue,opacity=1] ($(N4T1) + (0,0.5)$) edge node  ($(N5T1.west) +(0,0.5)$);

[xshift=320,every node/.append style=yslant=0,xslant=0,yslant=0,xslant=0]
[circlewc] (target_4) at (0,1) ;
[phase] (control_4) at (-2,1) ;

[-,line width=0.01cm,black,opacity=1] (target_4) edge node  (control_4);

[xshift=320,every node/.append style=yslant=0,xslant=0,yslant=0,xslant=0]
[circlewc] (target_4) at (-2,3) ;
[phase] (control_4) at (0,3) ;

[-,line width=0.01cm,black,opacity=1] (target_4) edge node  (control_4);

[ Firstly, we remove the previously modified spurious events and propagated green edge at $t=2$ on the left logical qubit from the previous iteration.]
[scale=1,every node/.style=minimum size=1cm,on grid]
[xshift=0,every node/.append style=yslant=0,xslant=0,yslant=0,xslant=0]
[white,fill opacity=0.0] (0,0) rectangle (10,4);
[fill=white,draw=none] (t0) at (-2,0) $t=0:$;
[fill=white,shape=circle,draw=none] (N0T0) at (0,0) ;
[fill=white,shape=circle,draw=black] (N1T0) at (2,0) ;
[fill=red,shape=circle,draw=black] (N2T0) at (4,0) ;
[fill=white,shape=circle,draw=black] (N3T0) at (6,0) ;
[fill=white,shape=circle,draw=black] (N4T0) at (8,0) ;
[fill=white,shape=circle,draw=none] (N5T0) at (10,0) ;

[-,line width=0.1cm,red,opacity=1] (N0T0) edge node  (N1T0);
[-,line width=0.1cm,red,opacity=1] (N1T0) edge node  (N2T0);
[-,line width=0.01cm,black,opacity=1] (N2T0) edge node  (N3T0);
[-,line width=0.01cm,black,opacity=1] (N3T0) edge node  (N4T0);
[-,line width=0.01cm,black,opacity=1] (N4T0) edge node  (N5T0);

[fill=white,draw=none] (t1) at (-2,2) $t=1:$;
[fill=white,shape=circle,draw=none] (N0T1) at (0,2) ;
[fill=white,shape=circle,draw=black] (N1T1) at (2,2) ;
[fill=white,shape=circle,draw=black] (N2T1) at (4,2) ;
[fill=white,shape=circle,draw=black] (N3T1) at (6,2) ;
[fill=white,shape=circle,draw=black] (N4T1) at (8,2) ;
[fill=white,shape=circle,draw=none] (N5T1) at (10,2) ;

[-,line width=0.01cm,black,opacity=1] (N0T1) edge node  (N1T1);
[-,line width=0.01cm,black,opacity=1] (N1T1) edge node  (N2T1);
[-,line width=0.01cm,black,opacity=1] (N2T1) edge node  (N3T1);
[-,line width=0.01cm,black,opacity=1] (N3T1) edge node  (N4T1);
[-,line width=0.01cm,black,opacity=1] (N4T1) edge node  (N5T1);

[fill=white,draw=none] (t2) at (-2,4) $t=2:$;
[fill=white,shape=circle,draw=none] (N0T2) at (0,4) ;
[fill=white,shape=circle,draw=black] (N1T2) at (2,4) ;
[fill=white,shape=circle,draw=black] (N2T2) at (4,4) ;
[fill=white,shape=circle,draw=black] (N3T2) at (6,4) ;
[fill=white,shape=circle,draw=black] (N4T2) at (8,4) ;
[fill=white,shape=circle,draw=none] (N5T2) at (10,4) ;

[-,line width=0.1cm,brown,opacity=1] (N0T2) edge node  (N1T2);
[-,line width=0.1cm,brown,opacity=1] (N1T2) edge node  (N2T2);
[-,line width=0.1cm,green,opacity=1] (N2T2) edge node  (N3T2);
[-,line width=0.1cm,green,opacity=1] (N3T2) edge node  (N4T2);
[-,line width=0.1cm,brown,opacity=1] (N4T2) edge node  (N5T2);

[fill=white,draw=none] (t3) at (-2,6) $t=3:$;
[fill=white,shape=circle,draw=none] (N0T3) at (0,6) ;
[fill=white,shape=circle,draw=black] (N1T3) at (2,6) ;
[fill=white,shape=circle,draw=black] (N2T3) at (4,6) ;
[fill=white,shape=circle,draw=black] (N3T3) at (6,6) ;
[fill=white,shape=circle,draw=black] (N4T3) at (8,6) ;
[fill=white,shape=circle,draw=none] (N5T3) at (10,6) ;

[-,line width=0.01cm,black,opacity=1] (N0T3) edge node  (N1T3);
[-,line width=0.01cm,black,opacity=1] (N1T3) edge node  (N2T3);
[-,line width=0.01cm,black,opacity=1] (N2T3) edge node  (N3T3);
[-,line width=0.01cm,black,opacity=1] (N3T3) edge node  (N4T3);
[-,line width=0.01cm,black,opacity=1] (N4T3) edge node  (N5T3);

[-,line width=0.01cm,black,opacity=1] (N1T0) edge node  (N1T1);
[-,line width=0.01cm,black,opacity=1] (N1T1) edge node  (N1T2);
[-,line width=0.01cm,black,opacity=1] (N1T2) edge node  (N1T3);

[-,line width=0.01cm,black,opacity=1] (N2T0) edge node  (N2T1);
[-,line width=0.01cm,black,opacity=1] (N2T1) edge node  (N2T2);
[-,line width=0.01cm,black,opacity=1] (N2T2) edge node  (N2T3);

[-,line width=0.01cm,black,opacity=1] (N3T0) edge node  (N3T1);
[-,line width=0.01cm,black,opacity=1] (N3T1) edge node  (N3T2);
[-,line width=0.01cm,black,opacity=1] (N3T2) edge node  (N3T3);

[-,line width=0.01cm,black,opacity=1] (N4T0) edge node  (N4T1);
[-,line width=0.01cm,black,opacity=1] (N4T1) edge node  (N4T2);
[-,line width=0.01cm,black,opacity=1] (N4T2) edge node  (N4T3);

[blue, shape= rectangle] () at (4,-1.5) 3) Reset decoded blue edges.;

[xshift=0,every node/.append style=yslant=0,xslant=0,yslant=0,xslant=0]
[draw=blue,line width = 0.05cm] ($(N4T2) + (-1,-1)$) rectangle ++(2,1.8);
[draw=blue,line width = 0.05cm] ($(N2T2) + (-1,-1)$) rectangle ++(2,1.8);
[blue,shape=rectangle] () at (3.5,7.75) 2) Remove previously modified spurious events.;

[xshift=300,every node/.append style=yslant=0,xslant=0,yslant=0,xslant=0]
[white,fill opacity=0.0] (0,0) rectangle (10,4);

[fill=white,shape=circle,draw=none] (N0T0) at (0,0) ;
[fill=white,shape=circle,draw=black] (N1T0) at (2,0) ;
[fill=white,shape=circle,draw=black] (N2T0) at (4,0) ;
[fill=white,shape=circle,draw=black] (N3T0) at (6,0) ;
[fill=white,shape=circle,draw=black] (N4T0) at (8,0) ;
[fill=white,shape=circle,draw=none] (N5T0) at (10,0) ;

[-,line width=0.01cm,black,opacity=1] (N0T0) edge node  (N1T0);
[-,line width=0.01cm,black,opacity=1] (N1T0) edge node  (N2T0);
[-,line width=0.01cm,black,opacity=1] (N2T0) edge node  (N3T0);
[-,line width=0.01cm,black,opacity=1] (N3T0) edge node  (N4T0);
[-,line width=0.01cm,black,opacity=1] (N4T0) edge node  (N5T0);

[fill=white,shape=circle,draw=none] (N0T1) at (0,2) ;
[fill=white,shape=circle,draw=black] (N1T1) at (2,2) ;
[fill=white,shape=circle,draw=black] (N2T1) at (4,2) ;
[fill=white,shape=circle,draw=black] (N3T1) at (6,2) ;
[fill=red,shape=circle,draw=black] (N4T1) at (8,2) ;
[fill=white,shape=circle,draw=none] (N5T1) at (10,2) ;

[-,line width=0.1cm,brown,opacity=1] (N0T1) edge node  (N1T1);
[-,line width=0.1cm,brown,opacity=1] (N1T1) edge node  (N2T1);
[-,line width=0.01cm,black,opacity=1] (N2T1) edge node  (N3T1);
[-,line width=0.01cm,black,opacity=1] (N3T1) edge node  (N4T1);
[-,line width=0.1cm,red,opacity=1] (N4T1) edge node  (N5T1);

[fill=white,shape=circle,draw=none] (N0T2) at (0,4) ;
[fill=white,shape=circle,draw=black] (N1T2) at (2,4) ;
[fill=white,shape=circle,draw=black] (N2T2) at (4,4) ;
[fill=white,shape=circle,draw=black] (N3T2) at (6,4) ;
[fill=white,shape=circle,draw=black] (N4T2) at (8,4) ;
[fill=white,shape=circle,draw=none] (N5T2) at (10,4) ;

[-,line width=0.01cm,black,opacity=1] (N0T2) edge node  (N1T2);
[-,line width=0.01cm,black,opacity=1] (N1T2) edge node  (N2T2);
[-,line width=0.01cm,black,opacity=1] (N2T2) edge node  (N3T2);
[-,line width=0.01cm,black,opacity=1] (N3T2) edge node  (N4T2);
[-,line width=0.01cm,black,opacity=1] (N4T2) edge node  (N5T2);

[fill=white,shape=circle,draw=none] (N0T3) at (0,6) ;
[fill=white,shape=circle,draw=black] (N1T3) at (2,6) ;
[fill=white,shape=circle,draw=black] (N2T3) at (4,6) ;
[fill=white,shape=circle,draw=black] (N3T3) at (6,6) ;
[fill=white,shape=circle,draw=black] (N4T3) at (8,6) ;
[fill=white,shape=circle,draw=none] (N5T3) at (10,6) ;

[-,line width=0.01cm,black,opacity=1] (N0T3) edge node  (N1T3);
[-,line width=0.01cm,black,opacity=1] (N1T3) edge node  (N2T3);
[-,line width=0.01cm,black,opacity=1] (N2T3) edge node  (N3T3);
[-,line width=0.01cm,black,opacity=1] (N3T3) edge node  (N4T3);
[-,line width=0.01cm,black,opacity=1] (N4T3) edge node  (N5T3);

[-,line width=0.01cm,black,opacity=1] (N1T0) edge node  (N1T1);
[-,line width=0.01cm,black,opacity=1] (N1T1) edge node  (N1T2);
[-,line width=0.01cm,black,opacity=1] (N1T2) edge node  (N1T3);

[-,line width=0.01cm,black,opacity=1] (N2T0) edge node  (N2T1);
[-,line width=0.01cm,black,opacity=1] (N2T1) edge node  (N2T2);
[-,line width=0.01cm,black,opacity=1] (N2T2) edge node  (N2T3);

[-,line width=0.01cm,black,opacity=1] (N3T0) edge node  (N3T1);
[-,line width=0.01cm,black,opacity=1] (N3T1) edge node  (N3T2);
[-,line width=0.01cm,black,opacity=1] (N3T2) edge node  (N3T3);

[-,line width=0.01cm,black,opacity=1] (N4T0) edge node  (N4T1);
[-,line width=0.01cm,black,opacity=1] (N4T1) edge node  (N4T2);
[-,line width=0.01cm,black,opacity=1] (N4T2) edge node  (N4T3);

[-,line width=0.1cm,green,opacity=1] ($(N0T1.east) + (0,0.5)$) edge node  ($(N1T1) +(0,0.5)$);

[-,line width=0.1cm,green,opacity=1] ($(N1T1) + (0,0.5)$) edge node  ($(N2T1) +(0,0.5)$);