In Lemma 10, we provide several inequalities, connecting the number of faults with the weight of the produced errors (see Fig. 13). We will use these equalities later in the proof of Lemma 11.

**Lemma 10.** The following inequalities hold at the $k^{th}$ level of recursion,

$$ \mathrm{wt}(e_X^I) = t_k^I. \qquad (\mathrm{D}28) $$

$$ \mathrm{wt}(e_X^M) = t_k^M. \qquad (\mathrm{D}29) $$

$$ \mathrm{wt}(e_X^{C_i(i)} \oplus e_X^{C_i(3)}) = t_k^{C_i}(X), i \in \{1, 2\}. \qquad (\mathrm{D}30) $$

$$ \mathrm{wt}(e_X^{C_i(i)}) + \mathrm{wt}(e_X^{C_i(3)}) = t_k^{C_i}(X) + 2t_k^{C_i}(XX), i \in \{1, 2\}. \qquad (\mathrm{D}31) $$

$$ \mathrm{wt}(e_Z^{C_i(i)} \oplus e_Z^{C_i(3)}) = t_k^{C_i}(Z), i \in \{1, 2\}. \qquad (\mathrm{D}32) $$

$$ \mathrm{wt}(e_Z^{C_i(i)}) + \mathrm{wt}(e_Z^{C_i(3)}) = t_k^{C_i}(Z) + 2t_k^{C_i}(ZZ), i \in \{1, 2\}. \qquad (\mathrm{D}33) $$

*Proof.* The equalities in (D28) and (D29) simply follow from the fact a failure in Pauli Z basis initialization or measurement produces a single qubit X error on the output.

Suppose the $j^{th}$, $j \in \{1, \dots, K/2\}$-CNOT gate in $CNOT_{S_i \to S_3}$ failed. If it produces a single qubit X error on the output, the $j^{th}$ component of either $e_X^{C_i(i)}$ or $e_X^{C_i(3)}$ is equal to 1. If it produces a two qubit X error on the output, the $j^{th}$ component of both $e_X^{C_i(i)}$ and $e_X^{C_i(3)}$ is equal to 1. This observation directly implies (D30) and (D31). Similarly, it can be seen that (D32) and (D33) hold. $\square$

**Lemma 11.** Suppose that $T_{k-1}^1$ faults occur during the (successful) preparation of $|q_{K/2}\rangle_{S_1}$ in (D8) and $T_{k-2}^2$ faults occur during the preparation of $|q_{K/2}\rangle_{S_2}$ in (D9), using the measurement-based procedure incorporated with the error detection. Further, suppose that the following holds for $i \in \{1, 2\}$

$$ \mathrm{wt}(e_X^i) \le T_{k-1}^i. \qquad (\mathrm{D}34) $$

$$ \mathrm{wt}(e_Z^i) \le T_{k-1}^i. \qquad (\mathrm{D}35) $$

Consider the prepared state $|q'_K\rangle$ according to (D16). Then, there exist equivalent errors $e_X'^f \equiv e_X^f, e_Z'^f \equiv e_Z^f$, satisfying,

$$ \mathrm{wt}(e_X'^f) \le T_k, \qquad (\mathrm{D}36) $$

$$ \mathrm{wt}(e_Z'^f) \le T_k, \qquad (\mathrm{D}37) $$

where $T_k = T_{k-1}^1 + T_{k-1}^2 + t_k$, where $t_k$ is from (D25), is the total number of failures after the $k^{th}$ level of recursion.

*Proof.* We first prove (D36). Let $e_X$ be the measurement error in (D10), so that its syndrome is zero according to (D14). Then the syndrome of $(e_X, e_X)$ is also zero, that is,

$P_N(e_X, e_X)|_{Z(k)} = 0$. It can be seen as follows. We have that

$$ \begin{aligned} (e_X, e_X) &= (P_{K/2}(0, P_{\frac{K}{2}}(e_X)|_{\mathcal{X}(n-1)}), \\ & \qquad P_{K/2}(0, P_{\frac{K}{2}}(e_X)|_{\mathcal{X}(n-1)})) \qquad (\mathrm{D}38) \\ &= P_K(0, 0, 0, P_{\frac{K}{2}}(e_X)|_{\mathcal{X}(n-1)}) \end{aligned} $$

Using $|\mathcal{X}(n-1)| = |\mathcal{X}(n)|$ and (D38), it follows that $P_N(e_X, e_X)|_{Z(k)} = 0$. Therefore, $(e_X, e_X)$ gives a stabilizer (up to a sign factor) of the quantum state $|q'_K\rangle$ in (D16), implying that $e_X'^f := \tilde{e}_X + (0, e_X)$ is an equivalent error to $e_X^f = \tilde{e}_X + (e_X, 0)$ in (D16).

We now provide upper bounds on $\mathrm{wt}(e_X^f)$ and $\mathrm{wt}(e_X'^f)$.

From (D10) and (D12), we have that

$$ \begin{aligned} e_X^f = & (e_X^2 \oplus e_X^I \oplus e_X^{C_1(1)} \oplus e_X^{C_1(3)} \oplus e_X^{C_2(3)} \oplus e_X^M, \\ & e_X^2 \oplus e_X^{C_2(2)}). \end{aligned} \qquad (\mathrm{D}39) $$

Further,

$$ \begin{aligned} \mathrm{wt}(e_X^f) &\le 2 \mathrm{wt}(e_X^2) + \mathrm{wt}(e_X^I) + \mathrm{wt}(e_X^{C_1(1)} \oplus e_X^{C_1(3)}) \\ & \quad + \mathrm{wt}(e_X^{C_2(2)}) \oplus \mathrm{wt}(e_X^{C_2(3)}) + \mathrm{wt}(e_X^I) \\ &\le 2(\mathrm{wt}(e_X^2) + t_k^{C_2}(XX)) + t_k^I + t_k^{C_1}(X) \\ & \quad + t_k^{C_2}(X) + t_k^M, \end{aligned} \qquad (\mathrm{D}40) $$

where the first equality follows from (D39) and using $\mathrm{wt}(\sum_i u_i) \le \sum_i \mathrm{wt}(u)_i$, and the second equality follows from (D30)-(D31). Similarly, it can be shown that

$$ \mathrm{wt}(e_X'^f) \le 2(\mathrm{wt}(e_X^1) + t_k^{C_1}(XX)) + t_k^I + t_k^{C_1}(X) + t_k^{C_2}(X) + t_k^M \qquad (\mathrm{D}41) $$

Without loss of generality, we may assume that $\mathrm{wt}(e_X^1) + t_k^{C_1}(XX) \le \mathrm{wt}(e_X^2) + t_k^{C_2}(XX)$. Therefore, we have that

$$ \begin{aligned} \mathrm{wt}(e_X'^f) &\le \mathrm{wt}(e_X^1) + t_k^{C_1}(XX) + \mathrm{wt}(e_X^2) + t_k^{C_2}(XX) \\ & \quad + t_k^I + t_k^{C_1}(X) + t_k^{C_2}(X) + t_k^M \\ &\le \mathrm{wt}(e_X^1) + \mathrm{wt}(e_X^2) + t_k^I + (t_k^{C_1}(X) + t_k^{C_1}(XX)) \\ & \quad + (t_k^{C_2}(X) + t_k^{C_2}(XX)) + t_k^M \\ &\le T_{k-1}^1 + T_{k-1}^2 + t_k^I + t_k^{C_1} + t_k^{C_2} + t_k^M \\ &\le T_{k-1}^1 + T_{k-1}^2 + t_k, \end{aligned} \qquad (\mathrm{D}42) $$

where the third equality follows from (D34) and (D26), and the fourth equality follows from (D25).

We now prove (D37). Using (D13), we get for $e_Z^f$ in (D16),

$$ e_Z^f = (e_Z^1 \oplus e_Z^{C_1(1)}, e_Z^2 \oplus e_Z^{C_1(3)} \oplus e_Z^{C_2(2)}). \qquad (\mathrm{D}43) $$
In Lemma 10, we provide several inequalities, connecting the number of faults with the weight of the produced errors (see Fig. 13). We will use these equalities later in the proof of Lemma 11.

**Lemma 10.** The following inequalities hold at the k^th level of recursion,

$$ \mathrm{wt}(e_X^I) = t_k^I. \qquad (\mathrm{D}28) $$

$$ \mathrm{wt}(e_X^M) = t_k^M. \qquad (\mathrm{D}29) $$

$$ \mathrm{wt}(e_X^{C_i(i)} \oplus e_X^{C_i(3)}) = t_k^{C_i}(X), i \in \{1, 2\}. \qquad (\mathrm{D}30) $$

$$ \mathrm{wt}(e_X^{C_i(i)}) + \mathrm{wt}(e_X^{C_i(3)}) = t_k^{C_i}(X) + 2t_k^{C_i}(XX), i \in \{1, 2\}. \qquad (\mathrm{D}31) $$

$$ \mathrm{wt}(e_Z^{C_i(i)} \oplus e_Z^{C_i(3)}) = t_k^{C_i}(Z), i \in \{1, 2\}. \qquad (\mathrm{D}32) $$

$$ \mathrm{wt}(e_Z^{C_i(i)}) + \mathrm{wt}(e_Z^{C_i(3)}) = t_k^{C_i}(Z) + 2t_k^{C_i}(ZZ), i \in \{1, 2\}. \qquad (\mathrm{D}33) $$

*Proof.* The equalities in (D28) and (D29) simply follow from the fact a failure in Pauli Z basis initialization or measurement produces a single qubit X error on the output.

Suppose the j^th, j ∈ {1, ..., K/2}-CNOT gate in CNOT_{S_i→S_3} failed. If it produces a single qubit X error on the output, the j^th component of either e_X^{C_i(i)} or e_X^{C_i(3)} is equal to 1. If it produces a two qubit X error on the output, the j^th component of both e_X^{C_i(i)} and e_X^{C_i(3)} is equal to 1. This observation directly implies (D30) and (D31). Similarly, it can be seen that (D32) and (D33) hold. □

**Lemma 11.** Suppose that $T_{k-1}^1$ faults occur during the (successful) preparation of $|q_{K/2}\rangle_{S_1}$ in (D8) and $T_{k-2}^2$ faults occur during the preparation of $|q_{K/2}\rangle_{S_2}$ in (D9), using the measurement-based procedure incorporated with the error detection. Further, suppose that the following holds for $i \in \{1, 2\}$

$$ \mathrm{wt}(e_X^i) \le T_{k-1}^i. \qquad (\mathrm{D}34) $$

$$ \mathrm{wt}(e_Z^i) \le T_{k-1}^i. \qquad (\mathrm{D}35) $$

Consider the prepared state $|q'_K\rangle$ according to (D16). Then, there exist equivalent errors $e'_X \equiv e_X^f, e'_Z \equiv e_Z^f$, satisfying,

$$ \mathrm{wt}(e'_X) \le T_k, \qquad (\mathrm{D}36) $$

$$ \mathrm{wt}(e'_Z) \le T_k, \qquad (\mathrm{D}37) $$

where $T_k = T_{k-1}^1 + T_{k-1}^2 + t_k$, where $t_k$ is from (D25), is the total number of failures after the k^th level of recursion.

*Proof.* We first prove (D36). Let $e_X$ be the measurement error in (D10), so that its syndrome is zero according to (D14). Then the syndrome of $(e_X, e_X)$ is also zero, that is,

$P_N(e_X, e_X)|_{Z(k)} = 0$. It can be seen as follows. We have that

$$ \begin{aligned} (e_X, e_X) &= (P_{K/2}(0, P_{\frac{K}{2}}(e_X)|_{\mathcal{X}(n-1)}), \\ & \qquad P_{K/2}(0, P_{\frac{K}{2}}(e_X)|_{\mathcal{X}(n-1)})) \qquad (\mathrm{D}38) \\ &= P_K(0, 0, 0, P_{\frac{K}{2}}(e_X)|_{\mathcal{X}(n-1)}) \end{aligned} $$

Using $|\mathcal{X}(n-1)| = |\mathcal{X}(n)|$ and (D38), it follows that $P_N(e_X, e_X)|_{Z(k)} = 0$. Therefore, $(e_X, e_X)$ gives a stabilizer (up to a sign factor) of the quantum state $|q'_K\rangle$ in (D16), implying that $e'_X := \tilde{e}_X + (0, e_X)$ is an equivalent error to $e'_X = \tilde{e}_X + (e_X, 0)$ in (D16).

We now provide upper bounds on $\mathrm{wt}(e_X^f)$ and $\mathrm{wt}(e'_X)$.

From (D10) and (D12), we have that

$$ \begin{aligned} e_X^f = & (e_X^2 \oplus e_X^I \oplus e_X^{C_1(1)} \oplus e_X^{C_1(3)} \oplus e_X^{C_2(3)} \oplus e_X^M, \\ & e_X^2 \oplus e_X^{C_2(2)}). \end{aligned} \qquad (\mathrm{D}39) $$

Further,

$$ \begin{aligned} \mathrm{wt}(e_X^f) &\le 2 \mathrm{wt}(e_X^2) + \mathrm{wt}(e_X^I) + \mathrm{wt}(e_X^{C_1(1)} \oplus e_X^{C_1(3)}) \\ & \phantom{\le 2 \mathrm{wt}(e_X^2)} + \mathrm{wt}(e_X^{C_2(2)} \oplus \mathrm{wt}(e_X^{C_2(3)})) + \mathrm{wt}(e_X^I) \\ &\le 2(\mathrm{wt}(e_X^2) + t_k^{C_2}(XX)) + t_k^I + t_k^{C_1}(X) \\ & \phantom{\le 2(\mathrm{wt}(e_X^2))} + t_k^{C_2}(X) + t_k^M, \end{aligned} \qquad (\mathrm{D}40) $$

where the first equality follows from (D39) and using $\mathrm{wt}(\sum_i u_i) \le \sum_i \mathrm{wt}(u)_i$, and the second equality follows from (D30)-(D31). Similarly, it can be shown that

$$ \mathrm{wt}(e_X^{f'}) \le 2(\mathrm{wt}(e_X^1) + t_k^{C_1}(XX)) + t_k^I + t_k^{C_1}(X) + t_k^{C_2}(X) + t_k^M \qquad (\mathrm{D}41) $$

Without loss of generality, we may assume that $\mathrm{wt}(e_X^1) + t_k^{C_1}(XX) \le \mathrm{wt}(e_X^2) + t_k^{C_2}(XX)$. Therefore, we have that

$$ \begin{aligned} \mathrm{wt}(e_X^{f'}) &\le \mathrm{wt}(e_X^1) + t_k^{C_1}(XX) + \mathrm{wt}(e_X^2) + t_k^{C_2}(XX) \\ & \phantom{\le \mathrm{wt}(e_X^1)} + t_k^I + t_k^{C_1}(X) + t_k^{C_2}(X) + t_k^M \\ &\le \mathrm{wt}(e_X^1) + \mathrm{wt}(e_X^2) + t_k^I + (t_k^{C_1}(X) + t_k^{C_1}(XX)) \\ & \phantom{\le \mathrm{wt}(e_X^1)} + (t_k^{C_2}(X) + t_k^{C_2}(XX)) + t_k^M \\ &\le T_{k-1}^1 + T_{k-1}^2 + t_k^I + t_k^{C_1} + t_k^{C_2} + t_k^M \\ &\le T_{k-1}^1 + T_{k-1}^2 + t_k, \end{aligned} \qquad (\mathrm{D}42) $$

where the third equality follows from (D34) and (D26), and the fourth equality follows from (D25).

We now prove (D37). Using (D13), we get for $e_Z^f$ in (D16),

$$ e_Z^f = (e_Z^1 \oplus e_Z^{C_1(1)}, e_Z^2 \oplus e_Z^{C_1(3)} \oplus e_Z^{C_2(2)}). \qquad (\mathrm{D}43) $$
As $Z \otimes Z$ on the corresponding qubits of $S_1$ and $S_2$ is a stabilizer generator, it follows that the following error is equivalent to $e_Z^f$ in (D43),

$$ \begin{aligned} e'_Z &= e_Z^f \oplus (e_Z^{C_1(3)}, e_Z^{C_1(3)}) \\ &= (e_Z^1 \oplus e_Z^{C_1(1)} \oplus e_Z^{C_1(3)}, e_Z^2 \oplus e_Z^{C_2(2)}). \end{aligned} \quad (D44) $$

We have,

$$ \begin{aligned} \mathrm{wt}(e'_Z^f) &\le \mathrm{wt}(e_Z^1) + \mathrm{wt}(e_Z^2) + \mathrm{wt}(e_Z^{C_1(1)} \oplus e_Z^{C_1(3)}) \\ &\quad + \mathrm{wt}(e_Z^{C_2(2)}) \\ &\le T_{k-1}^1 + T_{k-1}^2 + t_k^{C_1}(Z) + t_k^{C_2}(Z) + 2t_k^{C_2}(ZZ) \\ &\le T_{k-1}^1 + T_{k-1}^2 + t_k^{C_1} + t_k^{C_2} \\ &\le T_{k-1}^1 + T_{k-1}^2 + t_k, \end{aligned} \quad (D45) $$

where the first inequality follows from (D44) and using $\mathrm{wt}(\sum_i u_i) \le \sum_i \mathrm{wt}(u)_i$, the second inequality follows from (D35), and (D32)-(D33), the third inequality follows from (D27), and finally the fourth inequality follows from (D25). $\square$

## E. Numerical Results on Fault Tolerant Error Correction

In this section, we provide details about the methods used to generate numerical results regarding the logical error rates of $Q_1$ codes, under Steane error correction in conjunction with the proposed measurement-based preparation with error detection. In this context, we also provide new simulation results on the rate of successful preparation of $Q_1$ code states, for the measurement-based preparation with error detection.

We start by presenting first the noise model used to produce errors during the simulation of the measurement-based preparation procedure and the Steane error-correction scheme. Note that we consider the implementation of Pauli $Z \otimes Z$ and Pauli $X \otimes X$ measurements according to circuits in Fig. 10a and Fig. 10b, respectively. However, for the Pauli $X \otimes X$ measurement in Fig. 10b, we consider the initialization in Pauli $Z$ basis followed by the Hadamard gate as one operation, corresponding to the initialization in Pauli $X$ basis, and similarly, we consider the last Hadamard gate followed by the Pauli $X$ measurement as one operation, corresponding to a Pauli $X$ measurement.

### E.1. Noise Model

We only need noise models for the basic components of the procedure, i.e, initialization operations and single-

qubit measurements, in either $Z$ or $X$ basis, and CNOT gates. We consider the following types of errors, corresponding to the circuit based depolarizing noise model from [10]. The probability parameter $p$ below, is referred to as the physical error rate.

(1) The noisy initialization in Pauli $Z$ basis is equal to perfectly initializing a qubit in a Pauli $Z$ basis state, then applying a Pauli $X$ error on the qubit, with probability $p$. Similarly, the noisy initialization in Pauli $X$ basis is equal to perfectly initializing a qubit in a Pauli $X$ basis state, then applying a Pauli $Z$ error on the qubit, with probability $p$.

(2) The noisy Pauli $Z$ measurement is equal to first applying a Pauli $X$ error, with probability $p$, on the qubit we want to measure, and then applying the perfect Pauli $Z$ measurement. Similarly, the noisy Pauli $X$ measurement is equal to first applying a Pauli $Z$ error, with probability $p$, and then applying the perfect Pauli $X$ measurement.

(3) The noisy CNOT gate is equal to the perfect CNOT followed by a two-qubit depolarizing channel, with error probability $p$. Precisely, after the perfect CNOT, any one of the 15 two qubit Pauli errors $I \otimes X, I \otimes Y, I \otimes Z, X \otimes I, X \otimes X, X \otimes Y, X \otimes Z, Y \otimes I, Y \otimes X, Y \otimes Y, Y \otimes Z, Z \otimes I, Z \otimes X, Z \otimes Y, Z \otimes Z$, may occur with probability $p/15$.

### E.2. Simulation of the Preparation Procedure

Consider the $Q_1$ code state $|q_N\rangle_S$ on the $N = 2^n$ qubit system $S = \{1, \dots, N\}$. To prepare $|q_N\rangle_S$, we first initialize the $N$ qubits in a Pauli $Z$ basis state (using the noisy initialization defined above), and then follow the recursive preparation procedure based on two qubit Pauli measurements. During the recursive procedure, initialization operations, CNOT gates, and single-qubit measurements are replaced by their noisy versions, and errors generated at some point by noisy operations are propagated throughout the rest of the procedure. If an error is detected at any recursion level (according to the error detection method from Procedure 2), then we discard the whole procedure and restart from the beginning, by initializing the $N$ qubits in a Pauli $Z$ basis state. See also the example in Fig. 15.

As qubits are initialized in Pauli $Z$ basis, we may ignore the first $k, 1 \le k \le n$ levels of recursion in case Pauli $Z \otimes Z$ measurements are needed to be applied consecutively for the first $k$ levels of recursion correspond to applying Pauli
As $Z \otimes Z$ on the corresponding qubits of $S_1$ and $S_2$ is a stabilizer generator, it follows that the following error is equivalent to $e_Z^f$ in (D43),

$$ \begin{aligned} e'_Z &= e_Z^f \oplus (e_Z^{C_1(3)}, e_Z^{C_1(3)}) \\ &= (e_Z^1 \oplus e_Z^{C_1(1)} \oplus e_Z^{C_1(3)}, e_Z^2 \oplus e_Z^{C_2(2)}). \end{aligned} \quad (D44) $$

We have,

$$ \begin{aligned} \text{wt}(e'_Z^f) &\le \text{wt}(e_Z^1) + \text{wt}(e_Z^2) + \text{wt}(e_Z^{C_1(1)} \oplus e_Z^{C_1(3)}) \\ &\quad + \text{wt}(e_Z^{C_2(2)}) \\ &\le T_{k-1}^1 + T_{k-1}^2 + t_k^{C_1}(Z) + t_k^{C_2}(Z) + 2t_k^{C_2}(ZZ) \\ &\le T_{k-1}^1 + T_{k-1}^2 + t_k^{C_1} + t_k^{C_2} \\ &\le T_{k-1}^1 + T_{k-1}^2 + t_k, \end{aligned} \quad (D45) $$

where the first inequality follows from (D44) and using $\text{wt}(\sum_i u_i) \le \sum_i \text{wt}(u)_i$, the second inequality follows from (D35), and (D32)-(D33), the third inequality follows from (D27), and finally the fourth inequality follows from (D25). $\square$

## E. Numerical Results on Fault Tolerant Error Correction

In this section, we provide details about the methods used to generate numerical results regarding the logical error rates of $Q_1$ codes, under Steane error correction in conjunction with the proposed measurement-based preparation with error detection. In this context, we also provide new simulation results on the rate of successful preparation of $Q_1$ code states, for the measurement-based preparation with error detection.

We start by presenting first the noise model used to produce errors during the simulation of the measurement-based preparation procedure and the Steane error-correction scheme. Note that we consider the implementation of Pauli $Z \otimes Z$ and Pauli $X \otimes X$ measurements according to circuits in Fig. 10a and Fig. 10b, respectively. However, for the Pauli $X \otimes X$ measurement in Fig. 10b, we consider the initialization in Pauli $Z$ basis followed by the Hadamard gate as one operation, corresponding to the initialization in Pauli $X$ basis, and similarly, we consider the last Hadamard gate followed by the Pauli $X$ measurement as one operation, corresponding to a Pauli $X$ measurement.

### E.1. Noise Model

We only need noise models for the basic components of the procedure, i.e, initialization operations and single-

qubit measurements, in either $Z$ or $X$ basis, and CNOT gates. We consider the following types of errors, corresponding to the circuit based depolarizing noise model from [10]. The probability parameter $p$ below, is referred to as the physical error rate.

(1) The noisy initialization in Pauli $Z$ basis is equal to perfectly initializing a qubit in a Pauli $Z$ basis state, then applying a Pauli $X$ error on the qubit, with probability $p$. Similarly, the noisy initialization in Pauli $X$ basis is equal to perfectly initializing a qubit in a Pauli $X$ basis state, then applying a Pauli $Z$ error on the qubit, with probability $p$.

(2) The noisy Pauli $Z$ measurement is equal to first applying a Pauli $X$ error, with probability $p$, on the qubit we want to measure, and then applying the perfect Pauli $Z$ measurement. Similarly, the noisy Pauli $X$ measurement is equal to first applying a Pauli $Z$ error, with probability $p$, and then applying the perfect Pauli $X$ measurement.

(3) The noisy CNOT gate is equal to the perfect CNOT followed by a two-qubit depolarizing channel, with error probability $p$. Precisely, after the perfect CNOT, any one of the 15 two qubit Pauli errors $I \otimes X, I \otimes Y, I \otimes Z, X \otimes I, X \otimes X, X \otimes Y, X \otimes Z, Y \otimes I, Y \otimes X, Y \otimes Y, Y \otimes Z, Z \otimes I, Z \otimes X, Z \otimes Y, Z \otimes Z$, may occur with probability $p/15$.

### E.2. Simulation of the Preparation Procedure

Consider the $Q_1$ code state $|q_N\rangle_S$ on the $N = 2^n$ qubit system $S = \{1, \dots, N\}$. To prepare $|q_N\rangle_S$, we first initialize the $N$ qubits in a Pauli $Z$ basis state (using the noisy initialization defined above), and then follow the recursive preparation procedure based on two qubit Pauli measurements. During the recursive procedure, initialization operations, CNOT gates, and single-qubit measurements are replaced by their noisy versions, and errors generated at some point by noisy operations are propagated throughout the rest of the procedure. If an error is detected at any recursion level (according to the error detection method from Procedure 2), then we discard the whole procedure and restart from the beginning, by initializing the $N$ qubits in a Pauli $Z$ basis state. See also the example in Fig. 15.

As qubits are initialized in Pauli $Z$ basis, we may ignore the first $k, 1 \le k \le n$ levels of recursion in case Pauli $Z \otimes Z$ measurements are needed to be applied consecutively for the first $k$ levels of recursion correspond to applying Pauli
<figure><img src="image_21.png" /><figcaption>Fig. 15: measurement-based preparation for the $Q_1(N = 8, i(n) = 3)$, with Pauli $Z \otimes Z$ and Pauli $X \otimes X$ measurements implemented according to Fig. 10a and Fig. 10b. Initialization operations are shown as ket states. For single-qubit measurement operations, the Pauli basis is also indicated. Initialization operations, measurements, and CNOT gates are noisy, according to the assumed circuit level depolarizing noise model. Note that errors are generated only by the above noisy operations (we do not consider errors that might occur while the qubits are idle). Error detection is performed after each recursion level (one round of measurements of the four ancilla qubits), and the procedure is restarted from the beginning if an error is detected. Error detection after the first level of recursion is useless, hence it is not performed.</figcaption></figure>

Z $\otimes$ Z measurements. This reduces the number of component in the preparation circuit, hence improving the probability that the preparation succeeds.

At the end of recursion, we have the knowledge of the $|u\rangle_{Z(n)}$ and $|v\rangle_{X(n)}$, hence the knowledge of prepared $Q_1$ code state. Further, we also know the total X and Z type errors on the prepared state, which we will use for simulating Steane's error correction in the next sections.

Further, we determine the preparation rate of the measurement-based procedure as follows. We run the preparation procedure $R > 0$ times, and denote by $t$ the number of times the preparation completed (that is, no error has been detected during the preparation procedure). Then, the preparation rate, denoted by $p_{\text{prep}}$, is defined as follows,

$$p_{\text{prep}} = \lim_{R \to \infty} \frac{t}{R}. \qquad (\text{E1})$$

*Prepared Codes.* We consider $Q_1$ codes of length $N = 16$ and $N = 64$ qubits. We choose the information position $i$ according to the results in Table II (best positions of the corresponding lengths, for sufficiently low error rate), assuming a depolarizing noise model and ignoring correlations between X and Z errors. Thus, for $N = 16$, we take the information position $i = 7$, and for $N = 64$, we take $i = 23$.

<figure><img src="image_22.png" /><figcaption>Fig. 16: Preparation rate for the logical X and logical Z code states of $Q_1$ codes ($N = 16, i = 7$) and ($N = 64, i = 23$).</figcaption></figure>

The fact that the $Q_1$ code construction ignores correlations between X and Z errors is due to the Steane error correction. Indeed, X and Z errors are corrected independently, considering ancilla states prepared in either a logical X basis state $|\tilde{w}'\rangle_{S'}$, or a logical Z basis state $|\tilde{w}'\rangle_{S'}$, respectively. During the X-error correction step (Fig. 7a), Z errors that happened on the ancilla system $S'$ while preparing $|\tilde{w}'\rangle_{S'}$, are copied to the original system $S$. Similarly, during the Z-error correction step (Fig. 7b), X errors that happened on the ancilla system $S'$ while preparing $|\tilde{w}'\rangle_{S'}$, are copied to $S$. Clearly, these X and Z errors are decorrelated, since they happened during the preparation of different logical states.

Fig. 16 shows the preparation rate $p_{\text{prep}}$, for the logical Z and logical X code states of $Q_1$ and Shor codes of length $N = 16, 64$, with respect to the physical error rate $p$. Here,
<figure><img src="image_21.png" /><figcaption>Fig. 15: measurement-based preparation for the $Q_1(N = 8, i(n) = 3)$, with Pauli $Z \otimes Z$ and Pauli $X \otimes X$ measurements implemented according to Fig. 10a and Fig. 10b. Initialization operations are shown as ket states. For single-qubit measurement operations, the Pauli basis is also indicated. Initialization operations, measurements, and CNOT gates are noisy, according to the assumed circuit level depolarizing noise model. Note that errors are generated only by the above noisy operations (we do not consider errors that might occur while the qubits are idle). Error detection is performed after each recursion level (one round of measurements of the four ancilla qubits), and the procedure is restarted from the beginning if an error is detected. Error detection after the first level of recursion is useless, hence it is not performed.</figcaption></figure>

<figure><img src="image_22.png" /><figcaption>Fig. 16: Preparation rate for the logical X and logical Z code states of $Q_1$ codes ($N = 16, i = 7$) and ($N = 64, i = 23$).</figcaption></figure>

Z $\otimes$ Z measurements. This reduces the number of component in the preparation circuit, hence improving the probability that the preparation succeeds.

At the end of recursion, we have the knowledge of the $|u\rangle_{Z(n)}$ and $|v\rangle_{X(n)}$, hence the knowledge of prepared $Q_1$ code state. Further, we also know the total X and Z type errors on the prepared state, which we will use for simulating Steane's error correction in the next sections.

Further, we determine the preparation rate of the measurement-based procedure as follows. We run the preparation procedure $R > 0$ times, and denote by $t$ the number of times the preparation completed (that is, no error has been detected during the preparation procedure). Then, the preparation rate, denoted by $p_{\text{prep}}$, is defined as follows,

$$p_{\text{prep}} = \lim_{R \to \infty} \frac{t}{R}. \qquad (\text{E1})$$

*Prepared Codes.* We consider $Q_1$ codes of length $N = 16$ and $N = 64$ qubits. We choose the information position $i$ according to the results in Table II (best positions of the corresponding lengths, for sufficiently low error rate), assuming a depolarizing noise model and ignoring correlations between X and Z errors. Thus, for $N = 16$, we take the information position $i = 7$, and for $N = 64$, we take $i = 23$.

The fact that the $Q_1$ code construction ignores correlations between X and Z errors is due to the Steane error correction. Indeed, X and Z errors are corrected independently, considering ancilla states prepared in either a logical X basis state $|\tilde{w}'\rangle_{S'}$, or a logical Z basis state $|\tilde{w}'\rangle_{S'}$, respectively. During the X-error correction step (Fig. 7a), Z errors that happened on the ancilla system $S'$ while preparing $|\tilde{w}'\rangle_{S'}$, are copied to the original system $S$. Similarly, during the Z-error correction step (Fig. 7b), X errors that happened on the ancilla system $S'$ while preparing $|\tilde{w}'\rangle_{S'}$, are copied to $S$. Clearly, these X and Z errors are decorrelated, since they happened during the preparation of different logical states.

Fig. 16 shows the preparation rate $p_{\text{prep}}$, for the logical Z and logical X code states of $Q_1$ and Shor codes of length $N = 16, 64$, with respect to the physical error rate $p$. Here,
the total number of runs is $R = 10^5$. We observe that $p_{\text{prep}}$ is non-zero for sufficiently low $p$ and it approaches to 1 as $p$ goes to zero, for all the $Q_1$ code states. Further, for $p$ close to zero, $p_{\text{prep}}$ is symmetric, in the sense that it is virtually the same for all code states for a given $N$. For bigger values of $p$, the difference in $p_{\text{prep}}$ for different code states of the same length is explained by the fact that for some code states, we have Pauli $Z \otimes Z$ measurements at the first levels of recursion, which may be ignored, hence, reducing the number of components in the preparation circuit, as explained before. For example, for $Z$ logical states of Shor codes $N = 16$, $i = 4$ and $N = 64$, $i = 23$, we may ignore the first two and three levels of recursions, respectively, explaining their higher $p_{\text{prep}}$ compared to other code states of the same length. Furthermore, $p_{\text{prep}}$ is much lower for codes states of length $N = 64$, compared to that of length $N = 16$, especially at higher values of $p$. This is also explained by the fact that the preparation circuit, in general, consists of much larger number of components for $N = 64$ than $N = 16$.

### E.3. Monte-Carlo Based Estimates of the Logical Error Rates

In this section, we provide a practical method to estimate logical error rates of $Q_1$ codes (given in Fig. 4 of the main text and see also Fig. 17), under the Steane's error correction. We consider a $Q_1$ code of length $N$, with information position $i$, and consider the following notation $\mathcal{I} = \{i\}$, $\mathcal{Z} = \{1, \dots, i-1\}$, $\mathcal{X} = \{i+1, \dots, N\}$, and $\mathcal{S} = \mathcal{Z} \cup \mathcal{I} \cup \mathcal{X}$.

**Logical X Error Rate.** To determine the logical $X$ error rate, we prepare a logical Pauli $Z$ basis code state $|\tilde{w}\rangle_S = Q_N(|u\rangle_Z \otimes |w\rangle_\mathcal{I} \otimes |\tilde{v}\rangle_\mathcal{X})$, $w \in \{0, 1\}$, that we want to protect against $X$ errors. Further, we prepare a logical Pauli $X$ basis code state $|\tilde{w}'\rangle_{S'} = Q_N(|u'\rangle_{Z'} \otimes |\tilde{w}'\rangle_{\mathcal{I}'} \otimes |\tilde{v}'\rangle_{\mathcal{X}'})$, $w' \in \{0, 1\}$, to be used as the ancilla system for syndrome extraction (see Fig. 7a).

The logical $X$ error rate is determined as follows.

(1) **Preparing $Q_1$ code states:** We first simulate the measurement-based preparation of $|\tilde{w}\rangle_S$ and $|\tilde{w}'\rangle_{S'}$ states, as described before (in case of error detection, we restart the preparation procedure until it completes). After the preparation completes, we know the frozen vectors $u, u' \in \{0, 1\}^{i-1}$, corresponding to the frozen sets $\mathcal{Z}$ and $\mathcal{Z}'$, and the frozen vectors $v, v' \in \{0, 1\}^{N-i}$ corresponding to the frozen sets $\mathcal{X}$ and $\mathcal{X}'$. Further, for $|\tilde{w}\rangle_{S'}$, we know the logical $Z$ value $w$, and for $|\tilde{w}'\rangle_{S'}$, we know the logical $X$ value $w'$. Moreover, we also have

the final errors $e_X$ and $e'_X$ on systems $\mathcal{S}$ and $\mathcal{S}'$, respectively.

(2) **Generating the syndrome:** We generate the syndrome according to Steane's procedure (Fig. 7a). According to Lemma 4, the syndrome $\mathcal{m}$ consists of a noisy version of a random codeword of the classical polar code $P(N, \mathcal{Z}, u \oplus u')$. We generate $\mathcal{m}$ as the sum of the random codeword from (2.1) and the three error terms from (2.2), below.

(2.1) First, we generate a random codeword $P_N(u \oplus u', a', x')$, by taking random values $a' \in \{0, 1\}$ and $x' \in \{0, 1\}^{N-i}$.

(2.2) We then add to the generated codeword, the following

* The first error term is $e_X \oplus e'_X$, where $e_X$ and $e'_X$ are given in step (1) (see also (B19)).

* The second term corresponds to the $X$ error generated on the system $\mathcal{S}'$ during the implementation of the qubitwise CNOT$_{S \to S'}$.

* The third error term is due to Pauli $Z$ measurements on the system $\mathcal{S}'$.

Let $e_X^C$ and $e'_X^C$ be the error produced by CNOT$_{S \to S'}$ on $\mathcal{S}$ and $\mathcal{S}'$, respectively. Further, let $e_X^{M'}$ is the error produced by Pauli $Z$ measurements on $\mathcal{S}'$. Then, we have that

$$ \mathbf{m} = P_N(\mathbf{u} \oplus \mathbf{u}', a', \mathbf{x}') \oplus \mathbf{e}_X^{\text{tot}}, \quad (E2) $$

where $\mathbf{e}_X^{\text{tot}} := e_X \oplus e'_X \oplus e_X^{C'} \oplus e_X^{M'}$ is the total $X$-error that happened on the system $\mathcal{S}'$.

Further, we also update the error on system $\mathcal{S}$, by adding $e_X^C$ to $e_X$, i.e., adding the $X$ error that happened on system $\mathcal{S}$ during the implementation of the qubitwise CNOT$_{S \to S'}$.

(3) **Error correction:** Given the frozen value $u \oplus u'$ from step (1), and the extracted syndrome $\mathcal{m}$ from step (2), we use SC decoding [42] to get an estimate $\hat{a}' \in \{0, 1\}$ of $a'$, and then generate an estimate of the total error $e_X^{\text{tot}}$ in (E2), as follows

$$ \hat{e}_X^{\text{tot}} = \mathbf{m} \oplus P_N(\mathbf{u} \oplus \mathbf{u}', \hat{a}', \mathbf{0}). \quad (E3) $$

Note that we do not need to estimate $\mathbf{x}'$ here, since the induced logical error corresponds to an $X$-type stabilizer operator, acting trivially on the code space (see also the discussion after Lemma 4).
the total number of runs is $R = 10^5$. We observe that $p_{\text{prep}}$ is non-zero for sufficiently low $p$ and it approaches to 1 as $p$ goes to zero, for all the $Q_1$ code states. Further, for $p$ close to zero, $p_{\text{prep}}$ is symmetric, in the sense that it is virtually the same for all code states for a given $N$. For bigger values of $p$, the difference in $p_{\text{prep}}$ for different code states of the same length is explained by the fact that for some code states, we have Pauli $Z \otimes Z$ measurements at the first levels of recursion, which may be ignored, hence, reducing the number of components in the preparation circuit, as explained before. For example, for $Z$ logical states of Shor codes $N = 16$, $i = 4$ and $N = 64$, $i = 23$, we may ignore the first two and three levels of recursions, respectively, explaining their higher $p_{\text{prep}}$ compared to other code states of the same length. Furthermore, $p_{\text{prep}}$ is much lower for codes states of length $N = 64$, compared to that of length $N = 16$, especially at higher values of $p$. This is also explained by the fact that the preparation circuit, in general, consists of much larger number of components for $N = 64$ than $N = 16$.

### E.3. Monte-Carlo Based Estimates of the Logical Error Rates

In this section, we provide a practical method to estimate logical error rates of $Q_1$ codes (given in Fig. 4 of the main text and see also Fig. 17), under the Steane's error correction. We consider a $Q_1$ code of length $N$, with information position $i$, and consider the following notation $\mathcal{I} = \{i\}$, $\mathcal{Z} = \{1, \dots, i-1\}$, $\mathcal{X} = \{i+1, \dots, N\}$, and $\mathcal{S} = \mathcal{Z} \cup \mathcal{I} \cup \mathcal{X}$.

**Logical X Error Rate.** To determine the logical $X$ error rate, we prepare a logical Pauli $Z$ basis code state $|\tilde{w}\rangle_S = Q_N(|u\rangle_Z \otimes |w\rangle_I \otimes |\tilde{v}\rangle_\mathcal{X})$, $w \in \{0, 1\}$, that we want to protect against $X$ errors. Further, we prepare a logical Pauli $X$ basis code state $|\tilde{w}'\rangle_{S'} = Q_N(|u'\rangle_{Z'} \otimes |\tilde{w}'\rangle_{I'} \otimes |\tilde{v}'\rangle_{\mathcal{X}'})$, $w' \in \{0, 1\}$, to be used as the ancilla system for syndrome extraction (see Fig. 7a).

The logical $X$ error rate is determined as follows.

(1) **Preparing $Q_1$ code states:** We first simulate the measurement-based preparation of $|\tilde{w}\rangle_S$ and $|\tilde{w}'\rangle_{S'}$ states, as described before (in case of error detection, we restart the preparation procedure until it completes). After the preparation completes, we know the frozen vectors $u, u' \in \{0, 1\}^{i-1}$, corresponding to the frozen sets $\mathcal{Z}$ and $\mathcal{Z}'$, and the frozen vectors $v, v' \in \{0, 1\}^{N-i}$ corresponding to the frozen sets $\mathcal{X}$ and $\mathcal{X}'$. Further, for $|\tilde{w}\rangle_{S'}$, we know the logical $Z$ value $w$, and for $|\tilde{w}'\rangle_{S'}$, we know the logical $X$ value $w'$. Moreover, we also have

the final errors $e_X$ and $e'_X$ on systems $\mathcal{S}$ and $\mathcal{S}'$, respectively.

(2) **Generating the syndrome:** We generate the syndrome according to Steane's procedure (Fig. 7a). According to Lemma 4, the syndrome $\mathcal{m}$ consists of a noisy version of a random codeword of the classical polar code $P(N, \mathcal{Z}, u \oplus u')$. We generate $\mathcal{m}$ as the sum of the random codeword from (2.1) and the three error terms from (2.2), below.

(2.1) First, we generate a random codeword $P_N(u \oplus u', a', x')$, by taking random values $a' \in \{0, 1\}$ and $x' \in \{0, 1\}^{N-i}$.

(2.2) We then add to the generated codeword, the following

* The first error term is $e_X \oplus e'_X$, where $e_X$ and $e'_X$ are given in step (1) (see also (B19)).

* The second term corresponds to the $X$ error generated on the system $\mathcal{S}'$ during the implementation of the qubitwise CNOT$_{S \to S'}$.

* The third error term is due to Pauli $Z$ measurements on the system $\mathcal{S}'$.

Let $e_X^C$ and $e'_X^C$ be the error produced by CNOT$_{S \to S'}$ on $\mathcal{S}$ and $\mathcal{S}'$, respectively. Further, let $e_X^{M'}$ is the error produced by Pauli $Z$ measurements on $\mathcal{S}'$. Then, we have that

$$m = P_N(u \oplus u', a', x') \oplus e_X^{\text{tot}}, \quad (E2)$$

where $e_X^{\text{tot}} := e_X \oplus e'_X \oplus e_X^{C'} \oplus e_X^{M'}$ is the total $X$-error that happened on the system $\mathcal{S}'$.

Further, we also update the error on system $\mathcal{S}$, by adding $e_X^C$ to $e_X$, i.e., adding the $X$ error that happened on system $\mathcal{S}$ during the implementation of the qubitwise CNOT$_{S \to S'}$.

(3) **Error correction:** Given the frozen value $u \oplus u'$ from step (1), and the extracted syndrome $\mathcal{m}$ from step (2), we use SC decoding [42] to get an estimate $\hat{a}' \in \{0, 1\}$ of $a'$, and then generate an estimate of the total error $e_X^{\text{tot}}$ in (E2), as follows

$$\hat{e}_X^{\text{tot}} = m \oplus P_N(u \oplus u', \hat{a}', \mathbf{0}). \quad (E3)$$

Note that we do not need to estimate $x'$ here, since the induced logical error corresponds to an $X$-type stabilizer operator, acting trivially on the code space (see also the discussion after Lemma 4).
<figure><img src="image_23.png" /><figcaption>(a) Monte-Carlo (MC) and Density-evolution (DE) based estimates of the X/Z logical error rates of $Q_1$ and Shor codes of length $N=16$ and $N=64$.</figcaption></figure>

<figure><img src="image_24.png" /><figcaption>(b) Monte-Carlo (MC) and Density-evolution (DE) based estimates of the logical error rate of $Q_1$ and Shor codes of length $N=16$ and $N=64$ (here, the logical error rate $P_e^L = P_X^L + P_Z^L - P_X^L P_Z^L$, where $P_X^L$ and $P_Z^L$ are given in (a) above).</figcaption></figure>

<caption>Fig. 17: Numerical results for $Q_1$ and Shor codes of length $N=16$ and $N=64$.</caption>

We then perform error correction on the state of the system $S$, and update the $X$ error on $S$, by adding the estimated total error $\hat{e}_X^{\text{tot}}$. Let $e_X^{\text{corc}}$ be the error on system $S$ after correction. From (E2) and (E3), it follows that $e_X^{\text{corc}}$ is equivalent to the following error,

$$e_X^{\text{corc}} = e'_X \oplus e_X^C \oplus e'_X \oplus e_X^{M'} \oplus P_N(0, a' \oplus \hat{a}', 0, 0). \quad (\text{E4})$$

(4) **Guessing the logical value:** The error correction is successful if we can successfully recover the logical $Z$ value from the state of the system $S$, after error correction.

To get the logical $Z$ value, we need to perform

single-qubit Pauli $Z$ measurements on system $S$, and then estimate the logical value from the measurement outcome.

It can be seen that the measurement outcome of Pauli $Z$ measurements gives a noisy version of a random codeword of the classical polar code $P(N, Z, u \oplus u')$, as follows,

$$m = P_N(u \oplus u', w, x) \oplus e_X^{\text{corc}} \oplus e_X^M, \quad (\text{E5})$$

where $w$ is the logical $Z$ value corresponding to the initial state on the system $S$, $x$ is a random vector, $e_X^{\text{corc}}$ is the $X$ error on the system $S$ after the error correction from (E4), and $e_X^M$ is the error caused by
<figure><img src="image_23.png" /><figcaption>(a) Monte-Carlo (MC) and Density-evolution (DE) based estimates of the X/Z logical error rates of $Q_1$ and Shor codes of length $N=16$ and $N=64$.</figcaption></figure>

<figure><img src="image_24.png" /><figcaption>(b) Monte-Carlo (MC) and Density-evolution (DE) based estimates of the logical error rate of $Q_1$ and Shor codes of length $N=16$ and $N=64$ (here, the logical error rate $P_e^L = P_X^L + P_Z^L - P_X^L P_Z^L$, where $P_X^L$ and $P_Z^L$ are given in (a) above).</figcaption></figure>

<caption>Fig. 17: Numerical results for $Q_1$ and Shor codes of length $N=16$ and $N=64$.</caption>

We then perform error correction on the state of the system $S$, and update the $X$ error on $S$, by adding the estimated total error $\hat{e}_X^{\text{tot}}$. Let $e_X^{\text{corc}}$ be the error on system $S$ after correction. From (E2) and (E3), it follows that $e_X^{\text{corc}}$ is equivalent to the following error,

$$e_X^{\text{corc}} = e'_X \oplus e_X^C \oplus e_X^{C'} \oplus e_X^{M'} \oplus P_N(0, a' \oplus \hat{a}', 0, 0). \quad (\text{E4})$$

(4) **Guessing the logical value:** The error correction is successful if we can successfully recover the logical $Z$ value from the state of the system $S$, after error correction.

To get the logical $Z$ value, we need to perform

single-qubit Pauli $Z$ measurements on system $S$, and then estimate the logical value from the measurement outcome.

It can be seen that the measurement outcome of Pauli $Z$ measurements gives a noisy version of a random codeword of the classical polar code $P(N, Z, u \oplus u')$, as follows,

$$m = P_N(u \oplus u', w, x) \oplus e_X^{\text{corc}} \oplus e_X^M, \quad (\text{E5})$$

where $w$ is the logical $Z$ value corresponding to the initial state on the system $S$, $x$ is a random vector, $e_X^{\text{corc}}$ is the $X$ error on the system $S$ after the error correction from (E4), and $e_X^M$ is the error caused by
the single-qubit Pauli Z measurements on system S. From the frozen vector $u \oplus u'$ and the noisy code-word m in (E5), we generate an estimate $\hat{w}$ of w, using the SC decoding. If $\hat{w} \neq w$, we report a decoding failure, otherwise the decoding succeeds.

We run the above steps (1)-(4), until we report $f > 0$ decoding failures. Let R be the number of runs for f decoding failures, then the logical X error rate, denoted by $P_X^L$, is computed as follows,

$$P_X^L = \frac{f}{R}. \qquad (E6)$$

For our numerical simulations, the value of f varies between 50 to 200, depending on the physical error rate p of our noise model.

**Logical Z Error Rate.** To determine the logical Z error rate, we consider a logical Pauli X basis code state $|\tilde{w}\rangle_S = Q_N(|u\rangle_Z \otimes |\tilde{w}\rangle_I \otimes |\tilde{v}\rangle_\chi)$, $w \in \{0, 1\}$, that we want to protect against Z errors. Further, we consider a logical Pauli Z basis code state $|\tilde{w}'\rangle_{S'} = Q_N(|u'\rangle_{Z'} \otimes |w'\rangle_{\mathcal{I}'} \otimes |\tilde{v}'\rangle_{\chi'})$, $w' \in \{0, 1\}$, to be used as the ancilla system for syndrome extraction (Fig. 7b.) The logical Z error rate is then determined similarly to the above description for logical X error rate, while inverting X and Z bases, and using Lemma 5 instead of Lemma 4. The logical Z error rate is denoted by $P_Z^L$.

Finally, the logical error rate (accounting for both X and Z errors), denoted by $P_e^L$, is given as follows,

$$P_e^L = P_X^L + P_Z^L - P_X^L P_Z^L. \qquad (E7)$$

### E.4. Density-Evolution Based Estimates of the Logical Error Rates

To reliably estimate the logical error rate value, the Monte-Carlo method described in Section E.3 requires an increasingly large number of simulations as the logical error rate decreases. Hence, as p decreases, this requires increasingly more computational time (or resources) and becomes practically unfeasible for small values of p. In this section, we provide a theoretical method to estimate the logical error rate, based on density evolution [24] (see also Fig. 17).

Consider the Steane's error correction for X errors from Section E.3. Note that it involves two steps of decoding; the first during Step (3) for error correction and the second during Step (4) for guessing the logical value. Each failure in decoding introduces a logical X error, hence, the logical value is incorrectly determined if and only if one of the two decoders fail.

For a given realization of errors (i.e., $e_X^{\text{tot}}$ in (E2), or $e_X^{\text{core}} \oplus e_X^M$ in (E5)), the SC decoding works by propagating the corresponding log-likelihood ratio (LLR) values throughout the polar encoding graph (from the right-hand side of the graph, corresponding to the encoded information, to the left-hand side of the graph, corresponding to the uncoded information; see also footnote E.4). Rather than propagating LLR values for a given sample (realization of errors), the density evolution method propagates their probability density functions, thus averaging over all the sample space. To determine the probability distribution of the input LLRs, one needs to estimate the input error probability of the decoder (i.e., $P(e_X^{\text{tot}}(i) = 1)$ for the SC decoding in Step (3), or $P(e_X^{\text{core}}(i) \oplus e_X^M(i) = 1)$ for the SC decoding in Step (4)).

Accordingly, we determine the logical X error rate in the following two steps.

(1) **Input error probabilities of decoders:** To determine the input error probabilities of the decoders in Step (3) and (4), we need to generate statistics for the error terms $e_X^{\text{tot}}$ in (E2) and $e_X^{\text{core}} \oplus e_X^M$ in (E5). In particular, we need to estimate the output X error probabilities of the Z and X logical states, by numerical simulation. This is done as follows.

For a given physical error rate p, we run the measurement-based preparation with the error detection for logical Z and X states until we have R successful preparations for each one of them [43]. Let $e_X^r, e_X^{r'} \in \{0, 1\}^N$, $1 \le r \le R$, be the X errors corresponding to the rth successful preparation of the logical Z and X states, respectively. Then, the average output X error rate for Z and X logical states are estimated as follows,

$$p_X^{\text{prep}} = \frac{1}{RN} \sum_{r=1}^{R} \text{wt}(e_X^r). \qquad (E8)$$

$$p_X^{\text{prep}} = \frac{1}{RN} \sum_{r=1}^{R} \text{wt}(e_X^{r'}) \qquad (E9)$$

Let $p_X^{\text{in1}}$ and $p_X^{\text{in2}}$ be the input error rate of the first and second decoders, respectively. From (E2), we have that

$$p_X^{\text{in1}} = 1 - (1 - p_X^{\text{prep}})(1 - p_X^{\text{prep}})(1 - \frac{8p}{15})(1 - p) \qquad (E10)$$

Further, for the sake of simplicity, we compute the input error rate of the second decoder, assuming that the first decoder has succeeded. Then, from (E4) and (E5), we have that

$$p_X^{\text{in2}} = 1 - (1 - p_X^{\text{prep}})(1 - \frac{8p}{15})(1 - p)^2. \qquad (E11)$$
the single-qubit Pauli Z measurements on system S. From the frozen vector $\mathbf{u} \oplus \mathbf{u}'$ and the noisy code-word $\mathbf{m}$ in (E5), we generate an estimate $\hat{\mathbf{w}}$ of $\mathbf{w}$, using the SC decoding. If $\hat{\mathbf{w}} \neq \mathbf{w}$, we report a decoding failure, otherwise the decoding succeeds.

We run the above steps (1)-(4), until we report $f > 0$ decoding failures. Let $R$ be the number of runs for $f$ decoding failures, then the logical $X$ error rate, denoted by $P_X^L$, is computed as follows,

$$P_X^L = \frac{f}{R}. \qquad (E6)$$

For our numerical simulations, the value of $f$ varies between 50 to 200, depending on the physical error rate $p$ of our noise model.

**Logical Z Error Rate.** To determine the logical Z error rate, we consider a logical Pauli $X$ basis code state $|\tilde{\mathbf{w}}\rangle_S = Q_N(|\mathbf{u}\rangle_Z \otimes |\tilde{\mathbf{w}}\rangle_I \otimes |\tilde{\mathbf{v}}\rangle_\chi)$, $w \in \{0, 1\}$, that we want to protect against Z errors. Further, we consider a logical Pauli Z basis code state $|\tilde{\mathbf{w}}'\rangle_{S'} = Q_N(|\mathbf{u}'\rangle_{Z'} \otimes |\mathbf{w}'\rangle_{I'} \otimes |\tilde{\mathbf{v}}'\rangle_{\chi'})$, $w' \in \{0, 1\}$, to be used as the ancilla system for syndrome extraction (Fig. 7b.) The logical Z error rate is then determined similarly to the above description for logical $X$ error rate, while inverting $X$ and $Z$ bases, and using Lemma 5 instead of Lemma 4. The logical Z error rate is denoted by $P_Z^L$.

Finally, the logical error rate (accounting for both $X$ and $Z$ errors), denoted by $P_e^L$, is given as follows,

$$P_e^L = P_X^L + P_Z^L - P_X^L P_Z^L. \qquad (E7)$$

## E.4. Density-Evolution Based Estimates of the Logical Error Rates

To reliably estimate the logical error rate value, the Monte-Carlo method described in Section E.3 requires an increasingly large number of simulations as the logical error rate decreases. Hence, as $p$ decreases, this requires increasingly more computational time (or resources) and becomes practically unfeasible for small values of $p$. In this section, we provide a theoretical method to estimate the logical error rate, based on density evolution [24] (see also Fig. 17).

Consider the Steane's error correction for $X$ errors from Section E.3. Note that it involves two steps of decoding; the first during Step (3) for error correction and the second during Step (4) for guessing the logical value. Each failure in decoding introduces a logical $X$ error, hence, the logical value is incorrectly determined if and only if one of the two decoders fail.

For a given realization of errors (i.e., $e_X^{\text{tot}}$ in (E2), or $e_X^{\text{core}} \oplus e_X^M$ in (E5)), the SC decoding works by propagating the corresponding log-likelihood ratio (LLR) values throughout the polar encoding graph (from the right-hand side of the graph, corresponding to the encoded information, to the left-hand side of the graph, corresponding to the uncoded information; see also footnote E.4). Rather than propagating LLR values for a given sample (realization of errors), the density evolution method propagates their probability density functions, thus averaging over all the sample space. To determine the probability distribution of the input LLRs, one needs to estimate the input error probability of the decoder (i.e., $P(e_X^{\text{tot}}(i) = 1)$ for the SC decoding in Step (3), or $P(e_X^{\text{core}}(i) \oplus e_X^M(i) = 1)$ for the SC decoding in Step (4)).

Accordingly, we determine the logical $X$ error rate in the following two steps.

(1) **Input error probabilities of decoders:** To determine the input error probabilities of the decoders in Step (3) and (4), we need to generate statistics for the error terms $e_X^{\text{tot}}$ in (E2) and $e_X^{\text{core}} \oplus e_X^M$ in (E5). In particular, we need to estimate the output $X$ error probabilities of the $Z$ and $X$ logical states, by numerical simulation. This is done as follows.

For a given physical error rate $p$, we run the measurement-based preparation with the error detection for logical $Z$ and $X$ states until we have $R$ successful preparations for each one of them [43]. Let $e_X^r, e_X^{r'} \in \{0, 1\}^N$, $1 \le r \le R$, be the $X$ errors corresponding to the $r^{\text{th}}$ successful preparation of the logical $Z$ and $X$ states, respectively. Then, the average output $X$ error rate for $Z$ and $X$ logical states are estimated as follows,

$$p_X^{\text{prep}} = \frac{1}{RN} \sum_{r=1}^{R} \text{wt}(e_X^r). \qquad (E8)$$

$$p_X^{\text{prep}} = \frac{1}{RN} \sum_{r=1}^{R} \text{wt}(e_X^{r}). \qquad (E9)$$

Let $p_X^{\text{in1}}$ and $p_X^{\text{in2}}$ be the input error rate of the first and second decoders, respectively. From (E2), we have that

$$p_X^{\text{in1}} = 1 - (1 - p_X^{\text{prep}})(1 - p_X^{\text{prep}})(1 - \frac{8p}{15})(1 - p) \qquad (E10)$$

Further, for the sake of simplicity, we compute the input error rate of the second decoder, assuming that the first decoder has succeeded. Then, from (E4) and (E5), we have that

$$p_X^{\text{in2}} = 1 - (1 - p_X^{\text{prep}})(1 - \frac{8p}{15})(1 - p)^2. \qquad (E11)$$
Note that as long as the first decoder succeeds with a probability close to one, (E11) approximates well the input error rate of the second decoder.

(2) X logical error rate: After obtaining the input error probabilities $p_X^{in1}$ and $p_X^{in2}$, we compute output error rates of the decoders [44], using density evolution. Let $P_X^{out1}$ and $P_X^{out2}$ be the output error probabilities of the first and second decoders, respectively. Then, we determine the X logical error rate of the Steane's

error correction as follows,

$$P_X^L = 1 - ((1 - p_X^{out1})(1 - p_X^{out2}) + p_X^{out1}p_X^{out2}). \quad (E12)$$

We may similarly determine the Z input error probabilities for the first and second decoder, estimate their output probabilities using density evolution, and then determine $P_Z^L$, i.e., the Z logical error rate of the Steane's error correction. Finally, using $P_X^L$ and $P_Z^L$, we may determine the logical error rate $P_e^L$ as in (E7).

Numerical results for the logical error rates of $Q_1(N = 16, i = 7)$ and $Q_1(N = 64, i = 23)$ codes, based on either Monte-Carlo simulation or density evolution, are provided in Fig. 17.

[1] John Preskill. Fault-tolerant quantum computation. In *Introduction to quantum computation and information*, pages 213–269. World Scientific, 1998.

[2] Daniel Gottesman. An introduction to quantum error correction and fault-tolerant quantum computation. In *Quantum information science and its contributions to mathematics, Proceedings of Symposia in Applied Mathematics*, volume 68, pages 13–58, 2010.

[3] Erdal Arikan. Channel polarization: A method for constructing capacity-achieving codes for symmetric binary-input memoryless channels. *IEEE Transactions on Information Theory*, 55(7):3051–3073, 2009.

[4] Joseph M. Renes, Frédéric Dupuis, and Renato Renner. Efficient polar coding of quantum information. *Physical Review Letters*, 109(5):050504, August 2012.

[5] Mark M. Wilde and Saikat Guha. Polar codes for degradable quantum channels. *IEEE Transactions on Information Theory*, 59(7):4718–4729, July 2013.

[6] Joseph M. Renes and Mark M. Wilde. Polar codes for private and quantum communication over arbitrary channels. *IEEE Transactions on Information Theory*, 60(6):3090–3103, June 2014.

[7] Frédéric Dupuis, Ashutosh Goswami, Mehdi Mhalla, and Valentin Savin. Polarization of quantum channels using Clifford-based channel combining. *IEEE Transactions on Information Theory*, 67(5):2857–2877, 2021. arXiv:1904.04713.

[8] Adam Holmes, Mohammad Reza Jokar, Ghasem Pasandi, Yongshan Ding, Massoud Pedram, and Frederic T Chong. NISQ+: Boosting quantum computing power by approximating quantum error correction. *arXiv:2004.04794*, 2020.

[9] A Yu Kitaev. Fault-tolerant quantum computation by anyons. *Annals of Physics*, 303(1), 2003.

[10] Austin G Fowler, Matteo Mariantoni, John M Martinis, and Andrew N Cleland. Surface codes: Towards practical large-scale quantum computation. *Physical Review A*, 86(3):032324, 2012.

[11] Andrew J Landahl, Jonas T Anderson, and Patrick R

Rice. Fault-tolerant quantum computing with color codes. *arXiv:1108.5738*, 2011.

[12] Jean-Pierre Tillich and Gilles Zémor. Quantum LDPC codes with positive rate and minimum distance proportional to the square root of the blocklength. *IEEE Transactions on Information Theory*, 60(2):1193–1202, 2013. arXiv:0903.0566.

[13] Daniel Gottesman. Fault-tolerant quantum computation with constant overhead. *Quantum Information & Computation*, 14(15-16):1338–1372, 2014.

[14] Pavel Panteleev and Gleb Kalachev. Asymptotically good quantum and locally testable classical ldpc codes. In *Proceedings of the 54th Annual ACM SIGACT Symposium on Theory of Computing*, pages 375–388, 2022.

[15] Anthony Leverrier and Gilles Zémor. Quantum Tanner codes. *arXiv:2202.13641*, 2022.

[16] Anirudh Krishna and Jean-Pierre Tillich. Magic state distillation with punctured polar codes. *arXiv preprint arXiv:1811.03112*, 2018.

[17] Measurement repetition can be avoided by using codes with the single-shot error correction property [45, 46], which allows correcting physical errors using only a single round of noisy measurements, e.g., 3D/4D toric codes, 3D/4D hypergraph product codes, 4D hyperbolic codes, and quantum expander codes.

[18] Note that the error detection gadget is a built-in feature of the proposed preparation procedure, with errors being detected on a block of measurement outcomes, as opposed to an external gadget detecting errors on individual measurement outcomes, e.g. the flag-qubit approach [47].

[19] Andrew M Steane. Active stabilization, quantum computation, and quantum state synthesis. *Physical Review Letters*, 78(11):2252, 1997.

[20] Andrew M Steane. Fast fault-tolerant filtering of quantum codewords. *arXiv quant-ph/0202036*, 2002.

[21] Virtual channels are part of polar code construction, as explained in Appendix A and B.

[22] Peter W Shor. Scheme for reducing decoherence in quantum error correction.
Note that as long as the first decoder succeeds with a probability close to one, (E11) approximates well the input error rate of the second decoder.

(2) X logical error rate: After obtaining the input error probabilities $p_X^{in1}$ and $p_X^{in2}$, we compute output error rates of the decoders [44], using density evolution. Let $P_X^{out1}$ and $P_X^{out2}$ be the output error probabilities of the first and second decoders, respectively. Then, we determine the X logical error rate of the Steane's

error correction as follows,

$$P_X^L = 1 - ((1 - p_X^{out1})(1 - p_X^{out2}) + p_X^{out1}p_X^{out2}). \quad (E12)$$

We may similarly determine the Z input error probabilities for the first and second decoder, estimate their output probabilities using density evolution, and then determine $P_Z^L$, i.e., the Z logical error rate of the Steane's error correction. Finally, using $P_X^L$ and $P_Z^L$, we may determine the logical error rate $P_e^L$ as in (E7).

Numerical results for the logical error rates of $Q_1(N = 16, i = 7)$ and $Q_1(N = 64, i = 23)$ codes, based on either Monte-Carlo simulation or density evolution, are provided in Fig. 17.

[1] John Preskill. Fault-tolerant quantum computation. In *Introduction to quantum computation and information*, pages 213–269. World Scientific, 1998.

[2] Daniel Gottesman. An introduction to quantum error correction and fault-tolerant quantum computation. In *Quantum information science and its contributions to mathematics, Proceedings of Symposia in Applied Mathematics*, volume 68, pages 13–58, 2010.

[3] Erdal Arikan. Channel polarization: A method for constructing capacity-achieving codes for symmetric binary-input memoryless channels. *IEEE Transactions on Information Theory*, 55(7):3051–3073, 2009.

[4] Joseph M. Renes, Frédéric Dupuis, and Renato Renner. Efficient polar coding of quantum information. *Physical Review Letters*, 109(5):050504, August 2012.

[5] Mark M. Wilde and Saikat Guha. Polar codes for degradable quantum channels. *IEEE Transactions on Information Theory*, 59(7):4718–4729, July 2013.

[6] Joseph M. Renes and Mark M. Wilde. Polar codes for private and quantum communication over arbitrary channels. *IEEE Transactions on Information Theory*, 60(6):3090–3103, June 2014.

[7] Frédéric Dupuis, Ashutosh Goswami, Mehdi Mhalla, and Valentin Savin. Polarization of quantum channels using Clifford-based channel combining. *IEEE Transactions on Information Theory*, 67(5):2857–2877, 2021. arXiv:1904.04713.

[8] Adam Holmes, Mohammad Reza Jokar, Ghasem Pasandi, Yongshan Ding, Massoud Pedram, and Frederic T Chong. NISQ+: Boosting quantum computing power by approximating quantum error correction. *arXiv:2004.04794*, 2020.

[9] A Yu Kitaev. Fault-tolerant quantum computation by anyons. *Annals of Physics*, 303(1), 2003.

[10] Austin G Fowler, Matteo Mariantoni, John M Martinis, and Andrew N Cleland. Surface codes: Towards practical large-scale quantum computation. *Physical Review A*, 86(3):032324, 2012.

[11] Andrew J Landahl, Jonas T Anderson, and Patrick R

Rice. Fault-tolerant quantum computing with color codes. *arXiv:1108.5738*, 2011.

[12] Jean-Pierre Tillich and Gilles Zémor. Quantum LDPC codes with positive rate and minimum distance proportional to the square root of the blocklength. *IEEE Transactions on Information Theory*, 60(2):1193–1202, 2013. arXiv:0903.0566.

[13] Daniel Gottesman. Fault-tolerant quantum computation with constant overhead. *Quantum Information & Computation*, 14(15-16):1338–1372, 2014.

[14] Pavel Panteleev and Gleb Kalachev. Asymptotically good quantum and locally testable classical ldpc codes. In *Proceedings of the 54th Annual ACM SIGACT Symposium on Theory of Computing*, pages 375–388, 2022.

[15] Anthony Leverrier and Gilles Zémor. Quantum Tanner codes. *arXiv:2202.13641*, 2022.

[16] Anirudh Krishna and Jean-Pierre Tillich. Magic state distillation with punctured polar codes. *arXiv preprint arXiv:1811.03112*, 2018.

[17] Measurement repetition can be avoided by using codes with the single-shot error correction property [45, 46], which allows correcting physical errors using only a single round of noisy measurements, e.g., 3D/4D toric codes, 3D/4D hypergraph product codes, 4D hyperbolic codes, and quantum expander codes.

[18] Note that the error detection gadget is a built-in feature of the proposed preparation procedure, with errors being detected on a block of measurement outcomes, as opposed to an external gadget detecting errors on individual measurement outcomes, e.g. the flag-qubit approach [47].

[19] Andrew M Steane. Active stabilization, quantum computation, and quantum state synthesis. *Physical Review Letters*, 78(11):2252, 1997.

[20] Andrew M Steane. Fast fault-tolerant filtering of quantum codewords. *arXiv quant-ph/0202036*, 2002.

[21] Virtual channels are part of polar code construction, as explained in Appendix A and B.

[22] Peter W Shor. Scheme for reducing decoherence in quantum
tum computer memory. *Physical review A*, 52(4):R2493, 1995.

[23] Dave Bacon. Operator quantum error-correcting subsystems for self-correcting quantum memories. *Physical Review A*, 73(1):012340, 2006.

[24] Ido Tal and Alexander Vardy. How to construct polar codes. *IEEE Transactions on Information Theory*, 59(10):6562–6582, 2013.

[25] Krysta M Svore, Andrew W Cross, Isaac L Chuang, and Alfred V Aho. A flow-map model for analyzing pseudothresholds in fault-tolerant quantum computing. *Quantum Information & Computation*, 6(3):193–212, 2006.

[26] Yu Tomita and Krysta M Svore. Low-distance surface codes under realistic quantum noise. *Physical Review A*, 90(6):062320, 2014.

[27] Theerapat Tansuwannont, Balint Pato, and Kenneth R Brown. Adaptive syndrome measurements for shor-style error correction. *Quantum*, 7:1075, 2023.

[28] Christopher Chamberland, Aleksander Kubica, Theodore J Yoder, and Guanyu Zhu. Triangular color codes on trivalent graphs with flag qubits. *New Journal of Physics*, 22(2):023019, 2020.

[29] Dorit Aharonov and Michael Ben-Or. Fault-tolerant quantum computation with constant error. In *Proceedings of the twenty-ninth annual ACM symposium on Theory of computing*, pages 176–188, 1997.

[30] Panos Aliferis, Daniel Gottesman, and John Preskill. Quantum accuracy threshold for concatenated distance-3 codes. *arXiv preprint quant-ph/0504218*, 2005.

[31] Markus Reiher, Nathan Wiebe, Krysta M Svore, Dave Wecker, and Matthias Troyer. Elucidating reaction mechanisms on quantum computers. *Proceedings of the national academy of sciences*, 114(29):7555–7560, 2017.

[32] Joe O’Gorman and Earl T Campbell. Quantum computation with realistic magic-state factories. *Physical Review A*, 95(3):032338, 2017.

[33] Daniel Litinski. Magic state distillation: Not as costly as you think. *Quantum*, 3:205, 2019.

[34] Ciaran Ryan-Anderson, JG Bohnet, Kenny Lee, Daniel Gresh, Aaron Hankin, JP Gaebler, David Francois, Alexander Chernoguzov, Dominic Lucchetti, NC Brown, et al. Realization of real-time fault-tolerant quantum error correction. *Physical Review X*, 11(4):041058, 2021.

[35] Prakash Murali, Dripto M Debroy, Kenneth R Brown, and Margaret Martonosi. Architecting noisy intermediate-scale trapped ion quantum computers. In *2020 ACM/IEEE 47th Annual International Symposium on Computer Architecture (ISCA)*, pages 529–542. IEEE, 2020.

[36] AJ Sigillito, MJ Gullans, LF Edge, M Borselli, and JR Petta. Coherent transfer of quantum information in a silicon double quantum dot using resonant swap gates. *npj Quantum Information*, 5(1):110, 2019.

[37] Hidehiro Asai, Shota Iizuka, Tohru Mogami, Junichi Hatori, Koichi Fukuda, Tsutomu Ikegami, Kimihiko Kato, Hiroshi Oka, and Takahiro Mori. Device structure and fabrication process for silicon spin qubit realizing process-variation-robust swap gate operation. *Japanese Journal of Applied Physics*, 62(SC):SC1088, 2023.

[38] Baptiste Jadot, Pierre-André Mortemousque, Emmanuel Chanrion, Vivien Thiney, Arne Ludwig, Andreas D Wieck, Matias Urdampilleta, Christopher Bäuerle, and Tristan Munier. Distant spin entanglement via fast and coherent electron shuttling. *Nature Nanotechnology*, 16(5):570–575, 2021.

[39] Inga Seidler, Tom Struck, Ran Xue, Niels Focke, Stefan Trel lenkamp, Hendrik Bluhm, and Lars R Schreiber. Conveyormode single-electron shuttling in si/sige for a scalable quantum computing architecture. *npj Quantum Information*, 8(1):100, 2022.

[40] Jelmer M Boter, Juan P Dehollain, Jeroen PG Van Dijk, Yuanxing Xu, Toivo Hensgens, Richard Versluis, Henricus WL Naus, James S Clarke, Menno Veldhorst, Fabio Sebastiano, et al. Spiderweb array: a sparse spin-qubit array. *Physical Review Applied*, 18(2):024053, 2022.

[41] Strictly speaking, the classical information obtained at step (3) is not an error syndrome, but an error corrupted version of a random codeword (of course, if needed, one may classically compute the corresponding error syndrome).

[42] The SC decoding assumes that $e_X^{\text{tot}}$ is a vector of independent and identically distributed Bernoulli variables, that is $P(e_X^{\text{tot}}(i) = 1) = p_X^{\text{in}}$, for all $i = 1, \dots, N$, and for some probability value $p_X^{\text{in}} \in (0, 1)$, which is referred to as the *input error probability of the decoder*. While the “belief-propagation” variant of the SC decoding needs an estimate of $p_X^{\text{in}}$ (in order to calculate the input log-likelihood ratios of the decoder, LLR($i$) := $(-1)^{m(i)} \log((1-p_X^{\text{in}})/p_X^{\text{in}})$, $\forall i = 1, \dots, N$), here we use the so-called “min-sum” approximation of the SC decoding, which does not need such an estimate (in this case, the input log-likelihood ratio values of the decoder may be simply set to LLR($i$) := $(-1)^{m(i)}$, $\forall i = 1, \dots, N$)..

[43] In our numerical simulation, we have taken $R = 100/p$.

[44] Precisely, we determine the probability distributions of the input LLRs of the decoder, propagate these probability distributions numerically throughout the polar encoding graph, then take the corresponding output error rates.

[45] Héctor Bombín. Single-shot fault-tolerant quantum error correction. *Physical Review X*, 5(3):031043, 2015.

[46] Earl T Campbell. A theory of single-shot error correction for adversarial noise. *Quantum Science and Technology*, 4(2):025006, 2019.

[47] Rui Chao and Ben W Reichardt. Quantum error correction with only two extra qubits. *Physical review letters*, 121(5):050502, 2018.
tum computer memory. *Physical review A*, 52(4):R2493, 1995.

[23] Dave Bacon. Operator quantum error-correcting subsystems for self-correcting quantum memories. *Physical Review A*, 73(1):012340, 2006.

[24] Ido Tal and Alexander Vardy. How to construct polar codes. *IEEE Transactions on Information Theory*, 59(10):6562–6582, 2013.

[25] Krysta M Svore, Andrew W Cross, Isaac L Chuang, and Alfred V Aho. A flow-map model for analyzing pseudothresholds in fault-tolerant quantum computing. *Quantum Information & Computation*, 6(3):193–212, 2006.

[26] Yu Tomita and Krysta M Svore. Low-distance surface codes under realistic quantum noise. *Physical Review A*, 90(6):062320, 2014.

[27] Theerapat Tansuwannont, Balint Pato, and Kenneth R Brown. Adaptive syndrome measurements for shor-style error correction. *Quantum*, 7:1075, 2023.

[28] Christopher Chamberland, Aleksander Kubica, Theodore J Yoder, and Guanyu Zhu. Triangular color codes on trivalent graphs with flag qubits. *New Journal of Physics*, 22(2):023019, 2020.

[29] Dorit Aharonov and Michael Ben-Or. Fault-tolerant quantum computation with constant error. In *Proceedings of the twenty-ninth annual ACM symposium on Theory of computing*, pages 176–188, 1997.

[30] Panos Aliferis, Daniel Gottesman, and John Preskill. Quantum accuracy threshold for concatenated distance-3 codes. *arXiv preprint quant-ph/0504218*, 2005.

[31] Markus Reiher, Nathan Wiebe, Krysta M Svore, Dave Wecker, and Matthias Troyer. Elucidating reaction mechanisms on quantum computers. *Proceedings of the national academy of sciences*, 114(29):7555–7560, 2017.

[32] Joe O’Gorman and Earl T Campbell. Quantum computation with realistic magic-state factories. *Physical Review A*, 95(3):032338, 2017.

[33] Daniel Litinski. Magic state distillation: Not as costly as you think. *Quantum*, 3:205, 2019.

[34] Ciaran Ryan-Anderson, JG Bohnet, Kenny Lee, Daniel Gresh, Aaron Hankin, JP Gaebler, David Francois, Alexander Chernoguzov, Dominic Lucchetti, NC Brown, et al. Realization of real-time fault-tolerant quantum error correction. *Physical Review X*, 11(4):041058, 2021.

[35] Prakash Murali, Dripto M Debroy, Kenneth R Brown, and Margaret Martonosi. Architecting noisy intermediate-scale trapped ion quantum computers. In *2020 ACM/IEEE 47th Annual International Symposium on Computer Architecture (ISCA)*, pages 529–542. IEEE, 2020.

[36] AJ Sigillito, MJ Gullans, LF Edge, M Borselli, and JR Petta. Coherent transfer of quantum information in a silicon double quantum dot using resonant swap gates. *npj Quantum Information*, 5(1):110, 2019.

[37] Hidehiro Asai, Shota Iizuka, Tohru Mogami, Junichi Hatori, Koichi Fukuda, Tsutomu Ikegami, Kimihiko Kato, Hiroshi Oka, and Takahiro Mori. Device structure and fabrication process for silicon spin qubit realizing process-variation-robust swap gate operation. *Japanese Journal of Applied Physics*, 62(SC):SC1088, 2023.

[38] Baptiste Jadot, Pierre-André Mortemousque, Emmanuel Chanrion, Vivien Thiney, Arne Ludwig, Andreas D Wieck, Matias Urdampilleta, Christopher Bäuerle, and Tristan Munier. Distant spin entanglement via fast and coherent electron shuttling. *Nature Nanotechnology*, 16(5):570–575, 2021.

[39] Inga Seidler, Tom Struck, Ran Xue, Niels Focke, Stefan Trelenkamp, Hendrik Bluhm, and Lars R Schreiber. Conveyormode single-electron shuttling in si/sige for a scalable quantum computing architecture. *npj Quantum Information*, 8(1):100, 2022.

[40] Jelmer M Boter, Juan P Dehollain, Jeroen PG Van Dijk, Yuanxing Xu, Toivo Hensgens, Richard Versluis, Hendricus WL Naus, James S Clarke, Menno Veldhorst, Fabio Sebastiano, et al. Spiderweb array: a sparse spin-qubit array. *Physical Review Applied*, 18(2):024053, 2022.

[41] Strictly speaking, the classical information obtained at step (3) is not an error syndrome, but an error corrupted version of a random codeword (of course, if needed, one may classically compute the corresponding error syndrome).

[42] The SC decoding assumes that $e_X^{\text{tot}}$ is a vector of independent and identically distributed Bernoulli variables, that is $P(e_X^{\text{tot}}(i) = 1) = p_X^{\text{in}}$, for all $i = 1, \dots, N$, and for some probability value $p_X^{\text{in}} \in (0, 1)$, which is referred to as the *input error probability of the decoder*. While the “belief-propagation” variant of the SC decoding needs an estimate of $p_X^{\text{in}}$ (in order to calculate the input log-likelihood ratios of the decoder, LLR($i$) := $(-1)^{m(i)} \log((1-p_X^{\text{in}})/p_X^{\text{in}})$, $\forall i = 1, \dots, N$), here we use the so-called “min-sum” approximation of the SC decoding, which does not need such an estimate (in this case, the input log-likelihood ratio values of the decoder may be simply set to LLR($i$) := $(-1)^{m(i)}$, $\forall i = 1, \dots, N$)..

[43] In our numerical simulation, we have taken $R = 100/p$.

[44] Precisely, we determine the probability distributions of the input LLRs of the decoder, propagate these probability distributions numerically throughout the polar encoding graph, then take the corresponding output error rates.

[45] Héctor Bombín. Single-shot fault-tolerant quantum error correction. *Physical Review X*, 5(3):031043, 2015.

[46] Earl T Campbell. A theory of single-shot error correction for adversarial noise. *Quantum Science and Technology*, 4(2):025006, 2019.

[47] Rui Chao and Ben W Reichardt. Quantum error correction with only two extra qubits. *Physical review letters*, 121(5):050502, 2018.