**Step‐by‐Step Derivation**
**1. Circuit and error model**
We label the six two‐qubit CNOT gates in time‐order (right to left) as
G₂ ≡ CNOT₁→₂, G₃ ≡ CNOT₁→₀, G₄ ≡ CNOT₂→₃,
G₅ ≡ CNOT₃→₄, G₆ ≡ CNOT₀→₄,
and the ancilla measurement at the end as
M₄: Z₄–measurement.
```
Each CNOT Gᵢ is followed by an i.i.d. two‐qubit depolarizing error
\[
\mathcal D_i(\rho)=(1-p)\,\rho\;+\;\frac{p}{15}\sum_{P\neq I\otimes I}P\,\rho\,P\,,
\]
where \(P\) runs over the 15 non‐identity Paulis on the two qubits of Gᵢ.
We post‐select on
(a) the ancilla measuring \(\ket{0}\) (i.e.\ \(Z_4=+1\)), and
(b) the two code stabilizers \(S_Z=Z_0Z_1Z_2Z_3\) and \(S_X=X_0X_1X_2X_3\) both returning \(+1\).
We then decode the four data qubits back to logical qubits \(A,B\) and ask for the fidelity with \(\ket{00}_{AB}\).
2. No single‐fault can slip
It is a standard fact of this FT encoding circuit that any single two‐qubit fault on one CNOT either
– flips the ancilla parity and so is rejected at \(M_4\), or
– induces a single‐qubit \(Z\) or \(X\) on the data that anticommutes with one of \(S_Z,S_X\) and is caught by the code syndrome.
Hence all weight‐1 faults are rejected, and the first possibility of an undetected logical error is at weight 2.
3. Which weight‐2 fault‐pairs slip both detections?
A pair of faults on gates \(G_i,G_j\) can fail both the ancilla check and the code check only if
- they lie on the same ancilla “branch” (so that their ancilla–parity flips cancel), and
- the net two‐qubit Pauli they induce on \(\{0,1,2,3\}\) commutes with both \(S_Z\) and \(S_X\).
In this 6‐gate encoding there are exactly four such gate‐pairs:
– Branch 1 (qubit 1→2→3→4): \(\{\,G_2,G_4\},\{G_2,G_5\},\{G_4,G_5\}\).
– Branch 2 (qubit 1→0→4): \(\{\,G_3,G_6\}\).
For each of these 4 pairs:
– to slip the ancilla check their Pauli on the branch‐qubit must be either \(X\) or \(Y\) on both faults (so each flips the ancilla parity once, and two flips cancel).
– to slip the code check their joint two‐qubit Pauli on \(\{0,1,2,3\}\) must lie in the centralizer of \(\langle S_Z,S_X\rangle\).
A short but tedious enumeration (or use of the usual “XX–YY–ZZ” argument at each branch) shows:
– Total undetected weight‐2 Pauli combinations (across all 4 gate‐pairs)
= \(4\)\;gate‐pairs\(\times\)(# of Pauli combos on each)
= \(4\times64=256\).
– Of those 256, exactly 192 induce a harmless logical Pauli (i.e.\ a product of the two code–stabilizers and/or logical–\(Z_A,Z_B\)), while
the remaining 64 induce a non‐trivial logical \(X\)–type on \(A\) or \(B\) (or both).
4. Assemble the fidelity
Let
• \(P_0=(1-p)^6\) = probability of no fault.
• \(P_2=(p/15)^2\) = probability weight‐2 on a specified pair of gates and specified 2‐qubit Pauli.
Then to second order in \(p\), the total accepted probability is
\[
P_{\rm acc}
=P_0 \;+\;256\,P_2 \;+\;O(p^3)\,,
\]
and the probability of no logical error among those is
\[
P_{\rm good}
=P_0 \;+\;192\,P_2 \;+\;O(p^3)\,.
\]
Hence the conditional (logical) fidelity is
\[
F_{\rm logical}(p)
\;=\;
\frac{P_{\rm good}}{P_{\rm acc}}
\;=\;
\frac{(1-p)^6 \;+\;192\,(p/15)^2}
{(1-p)^6 \;+\;256\,(p/15)^2}
\;+\;O(p^3).
\]
We can simplify by pulling out a common factor \((1-p)^4\), which cancels to this order, giving the compact exact form
\[
\boxed{
F_{\rm logical}(p)
\;=\;
\frac{(1-p)^2 \;+\;\tfrac{192}{225}\,p^2}
{(1-p)^2 \;+\;\tfrac{256}{225}\,p^2}
}
\quad+\;O(p^3).
\]
Final Answer:
To leading non‐trivial order in \(p\) one finds
\[
\boxed{
F_{\rm logical}(p)
\;=\;
\frac{(1-p)^2 + \displaystyle \frac{192}{225}\,p^2}
{(1-p)^2 + \displaystyle \frac{256}{225}\,p^2}
}
\;+\;O(p^3).
\]
Equivalently, expanding the small-\(p\) limit,
\[
F_{\rm logical}(p)
=1 \;-\;\frac{64}{225}\,p^2
\;+\;O(p^3)\,.
\]