Step-by-Step Derivation
(Throughout we ignore global phases and denote Pauli products by juxtaposition.
Qubit order is 0-1-2-3.)
- The target state and its full stabiliser
• Code stabilisers \(S_{\text{code}}=\langle XXXX,\,ZZZZ\rangle\)
• Logical operators (up to \(S_{\text{code}}\))
$X_A=X I X I,\;X_B=XX I I,\;Z_A=ZZ I I,\;Z_B=Z I Z I$
For
\[
|\psi_{\rm GHZ}\rangle=\frac{|00\rangle_{AB}+|11\rangle_{AB}}{\sqrt2}
\]
the two extra (logical) stabilisers are
\[
X_A X_B = IXXI ,\qquad Z_A Z_B = IZZI .
\]
Hence the full stabiliser group of the prepared state is
\[
S_{\psi}=\langle XXXX,\,ZZZZ,\,IXXI,\,IZZI\rangle
\]
which has \(2^4=16\) elements. The 16 operators are
\[
\begin{aligned}
&\mathbf 1,\\[1pt]
&XXXX,\;ZZZZ,\;YYYY,\\[1pt]
&IXXI,\;IZZI,\;IYYI,\\
&XIIX,\;Z I I Z,\;Y I I Y,\\
&XYYX,\;ZYYZ,\\
&XYXZ,\;ZXXZ,\\
&\;XZZX,\;ZY YZ .
\end{aligned}
\]
Every member of \(S_{\psi}\) acts on \(|\psi_{\rm GHZ}\rangle\) as \(\pm1\); for every other Pauli \(P\), \(\langle\psi_{\rm GHZ}|P|\psi_{\rm GHZ}\rangle=0\).
- Gate–error model
Two CNOTs are used, hence two independent two-qubit depolarising channels:
\[
\mathcal E_{ij}(\rho)
=(1-p)\rho+\frac{p}{15}\!\!\sum_{P\neq I\!I}P_{ij}\rho P_{ij},
\]
one acting on qubits \((2,1)\), one on \((0,3)\).
Let
\[
P_{21}\,,P_{03}\in\{I,X,Y,Z\}^{\otimes2}\quad (15\ \hbox{non–identity each})
\]
be the Pauli errors drawn from the two channels.
Because the qubit pairs are disjoint and all gates are Clifford, the
combined error operator reaching the end of the circuit is simply
\[
E=P_{03}\,P_{21}\;\;(\hbox{tensor product on }0\!:\!3\hbox{ and }2\!:\!1).
\]
- Detectable versus undetectable errors
An error survives the post-selection iff it commutes with the code
stabilisers \(XXXX\) and \(ZZZZ\). Denote by
\[
\chi(P)=\bigl(\,w_X(P)\bmod 2,\;w_Z(P)\bmod 2\bigr)\in\{0,1\}^2
\]
the parities of the numbers \(w_X,w_Z\) of \(X\)- (\(=\) \(X\) or \(Y\)) and
\(Z\)- (\(=\) \(Z\) or \(Y\)) components in a two-qubit Pauli.
For a single two-qubit Pauli on a fixed pair we find
\[
\#\bigl\{P:\chi(P)=(0,0)\bigr\}=3, \quad
\#\bigl\{P:\chi(P)=(1,0)\bigr\}=4, \quad
\#\bigl\{P:\chi(P)=(0,1)\bigr\}=4, \quad
\#\bigl\{P:\chi(P)=(1,1)\bigr\}=4 .
\]
Because the two error operators act on disjoint pairs, the overall error
\(E=P_{03}P_{21}\) commutes with the code stabilisers iff
\[
\chi(P_{03})=\chi(P_{21}).
\]
Hence among the \(15^2=225\) double-error patterns
\[
\#\{\hbox{undetectable}\}=3^2+3\times4^2=57 .
\]
(The \(3^2\) term corresponds to \((0,0)\), the other three squares to
\((1,0),(0,1),(1,1)\).)
- Which undetectable errors are actually harmless?
\(E\) is harmless (i.e. leaves the logical state unchanged) iff
\(E\in S_{\psi}\). Among the \(57\) undetectable two-error patterns,
exactly \(12\) produce such operators:
• choose \((a,b)\neq(0,0)\) in \((XXXX)^a(ZZZZ)^b\) (\(3\) choices),
• choose \((c,d)\) arbitrarily in \((IXXI)^c(IZZI)^d\) (\(4\) choices).
Therefore
\[
\#\{\hbox{undetectable \&\ harmless}\}=12,\qquad
\#\{\hbox{undetectable but logical error}\}=57-12=45 .
\]
- Probability bookkeeping
Write
\[
T_0=(1-p)^2,\quad
T_1=2(1-p)p\Bigl(\frac{3}{15}\Bigr),\quad
T_{2,\;{\rm tot}}=\frac{57}{225}p^2,\quad
T_{2,\;{\rm good}}=\frac{12}{225}p^2 .
\]
• \(T_0\) : no fault.
• \(T_1\) : one fault, and it must be one of the three Pauli pairs \(\{XX,YY,ZZ\}\), hence passes post-selection and is harmless.
• \(T_{2,\;{\rm tot}}\) : all undetectable double faults.
• \(T_{2,\;{\rm good}}\) : those double faults that land in \(S_{\psi}\).
Success (post-selection) probability:
\[
P_{\rm acc}(p)=T_0+T_1+T_{2,\;{\rm tot}}
=(1-p)^2+\frac{2}{5}p(1-p)+\frac{19}{75}p^2 .
\]
Probability that the accepted state is the correct logical state:
\[
P_{\rm good}(p)=T_0+T_1+T_{2,\;{\rm good}}
=(1-p)^2+\frac{2}{5}p(1-p)+\frac{4}{75}p^2 .
\]
- Logical state fidelity (conditioned on acceptance)
\[
F_{\rm logical}(p)=\frac{P_{\rm good}(p)}{P_{\rm acc}(p)}
=\frac{75-120p+49p^{2}}{75-120p+64p^{2}}
=1-\frac{15p^{2}}{75-120p+64p^{2}} .
\]
Expanding for small \(p\),
\[
F_{\rm logical}(p)=1-\frac{1}{5}p^{2}+O(p^{3}),
\]
so all first-order (\(\propto p\)) logical errors are removed by the
post-selection; the first non-vanishing term is quadratic in the physical
error rate.
Final Answer:
The logical two-qubit fidelity of the post-selected output state is
\[
\boxed{\,F_{\text{logical}}(p)=
\dfrac{75-120\,p+49\,p^{2}}
{75-120\,p+64\,p^{2}}
=1-\frac{15\,p^{2}}{75-120\,p+64\,p^{2}}\,}
\]
and, for small physical error probabilities,
\[
F_{\text{logical}}(p)=1-\frac{1}{5}p^{2}+O(p^{3}).
\]