used to infer the stabilizer outcome is referred to as the *measurement qubit*. We say the circuit has flagged if the eigenvalue of a flag qubit is measured as $-1$. If the eigenvalue of a measurement qubit is measured as $-1$, we will say that the measurement qubit flipped. \[Def:GlagMeasureQubitsDef\]

The purpose of flag qubits is to signal when high weight data qubit errors result from few fault locations during a stabilizer measurement. Two key definitions are:

A circuit[^2] $C(P)$ which, when fault-free, implements a projective measurement of a weight-$w$ Pauli $P$ without flagging is a $t$-flag circuit if the following holds: For any set of $v$ faults at up to $t$ locations in $C(P)$ resulting in an error $E$ with $\text{min}(\text{wt}(E),\text{wt}(E P)) > v$, the circuit flags. \[Def:tFlaggedCircuitDef\]

Note that a $t$-flag circuit for measuring a weight-$t$ stabilizer $P$ is also a $k$-flag circuit for any $k>t$. In \[app:GeneralTflaggedCircuitConstruction\] we give constructions for some $t$-flag circuits.

Let $\mathcal{E}(g_{i})$ be the set of all errors caused by one fault which caused the circuit $C(g_i)$ to flag. \[Def:FlagErrSetDef1\]

Note that the flag error set can contain the identity as well as weight one errors.

Suppose all errors in a flag error 