the pseudo-threshold of an error correction protocol to be the value of $p$ such that

$$\begin{aligned}
\tilde{p}(p) = p^{(C)}_{L}(p).
\label{Def:PseudoThreshDef}\end{aligned}$$

Note that it is important to have $\tilde{p}$ on the left of \[Def:PseudoThreshDef\] instead of $p$ since we want an encoded qubit to have a lower logical failure rate than an unencoded idle qubit. From the above noise model, a resting qubit will fail with probability $\tilde{p}$.

Flag error correction for small distance codes {#sec:Section1}
==============================================

In this and the next section, we present a $t$-fault-tolerant flag error correction protocol with distance-$(2t+1)$ codes satisfying a certain condition. Our approach extends that introduced by Chao and Reichardt [@CR17v1] for distance three codes, which we first review using our terminology in \[subsec:ReviewChaoReichardt\]. In \[subsec:Distance5protocol\] we present the protocol for distance five CSS codes which contains most of the main ideas of the general case (which is provided in \[app:GeneralFTEC\]). Lastly, in section \[subsec:ApplicationProtocolColorCode\] we provide examples of how the protocol is applied to the [$[\![19,1,5]\!]$]{} and [$[\![17,1,5]\!]$]{} color codes.

Definitions and Flag $1$-FTEC with distance-3 codes {#subsec:ReviewChaoReichardt}
---------------------------------------------------

In what follows, we use the term location to refer to a gate, state preparation, measurement or idle qubit where a fault may occur. 