described in [@Gottesman13LDPC].

In \[subsec:ReviewChaoReichardt,subsec:Distance5protocol\] we provide important definitions and introduce flag FTEC for distance-three and -five codes. In \[subsec:ApplicationProtocolColorCode\] we apply the protocol to two examples: the [$[\![19,1,5]\!]$]{} and [$[\![17,1,5]\!]$]{} color codes, which importantly have a variety of different weight stabilizers. The general flag FTEC protocol for arbitrary distance codes is given in \[subsec:GeneralProtocol\]. A proof that the general protocol satisfies the fault-tolerance criteria is given in \[app:ProtocolGeneralProof\]. In \[subsec:Remarks\] we provide examples of codes that satisfy the conditions that we required for flag FTEC. Flag circuit constructions for measuring stabilizers of the codes in \[subsec:Remarks\] are given \[app:GeneralTflaggedCircuitConstruction\]. We also provide a candidate circuit construction for measuring arbitrary weight stabilizers in \[App:GeneralwFlagCircuitConstruction\]. In \[sec:CircuitLevelNoiseFTEC\], we analyze numerically a number of flag EC schemes and compare with other FTEC schemes under various types of circuit level noise. We find that flag EC schemes, which have large numbers of idle qubit locations, behave best in error models in which idle qubit errors occur with a lower probability than CNOT errors. The remainder of this section is devoted to FTEC and noise model/simulation methods.

Fault-tolerant error correction {#subsec:Section0}
-------------------------------

Throughout this paper, we assume a simple depolarizing noise model in which 