Step-by-Step Derivation
We label the two noisy CNOT channels as acting on qubit‐pairs \((2,1)\) and \((0,3)\) respectively. After the ideal circuit prepares the code‐space GHZ state
\[
\]
on the four physical qubits, the two depolarizing errors produce a final mixed state
\[
\rho_{\rm final}
=\sum_{E_{21},\,E_{03}}
P(E_{21})\,P(E_{03})\;
\bigl(E_{03}\,E_{21}\bigr)\;
|\psi_{\rm ideal}\>\<\psi_{\rm ideal}|\;
\bigl(E_{03}\,E_{21}\bigr)\!,
\]
where each \(E_{ij}\) is one of the 16 two‐qubit Paulis on qubits \(i,j\), with
\[
P(E)=\begin{cases}
1-p,&E=I\otimes I,\\
\dfrac p{15},&E\neq I\otimes I~.
\end{cases}
\]
We then measure the two code‐stabilizers
\[
S_X=XXXX,\quad S_Z=ZZZZ
\]
and post‐select on the “+1” outcome for both. Finally we decode the two logical qubits. Because decoding is unitary on the code‐space, the fidelity of the {\it logical} two‐qubit state with the ideal GHZ is
\[
F_{\rm logical}
=\frac{\bigl\<\psi_{\rm ideal}\bigr|\,
\Pi_{S_X=+1,S_Z=+1}\,\rho_{\rm final}\,
\Pi_{S_X=+1,S_Z=+1}\,
\bigl|\psi_{\rm ideal}\bigr\>}
{\Tr\!\bigl[\Pi_{S_X=+1,S_Z=+1}\,\rho_{\rm final}\bigr]}
\;=\;
\frac{\sum_{E\in\mathcal C(S)}P(E)\,\bigl|\<\psi_{\rm ideal}|E|\psi_{\rm ideal}\>\bigr|^2}
{\sum_{E\in\mathcal C(S)}P(E)}\!,
\]
where \(\mathcal C(S)\) is the set of Pauli errors commuting with both \(S_X,S_Z\), and \(P(E)=P(E_{21})P(E_{03})\).
- Denominator \(P_{\rm accept}=\sum_{E\in\mathcal C(S)}P(E)\).
Since \(E=E_{03}\,E_{21}\) acts on disjoint pairs, define for each channel the random parity bits
\[
A_X =\sum_{i\in\{2,1\}}f\bigl(E_{21,i},X\bigr)\bmod2,\qquad
A_Z =\sum_{i\in\{2,1\}}f\bigl(E_{21,i},Z\bigr)\bmod2,
\]
and similarly \(B_X,B_Z\) for \((0,3)\), where
\[
\quad
\]
Commutation with \(S_X=S_{X_0}S_{X_1}S_{X_2}S_{X_3}\) requires \(A_X+B_X=0\pmod2\), and with \(S_Z\) requires \(A_Z+B_Z=0\).
One finds for a single channel
\[
q(a_x,a_z)\;=\;\Pr\!\bigl[(A_X,A_Z)=(a_x,a_z)\bigr]
=\begin{cases}
1-\frac45\,p,&(a_x,a_z)=(0,0),\\[6pt]
\frac{4}{15}\,p,&(a_x,a_z)\in\{(0,1),(1,0),(1,1)\}.
\end{cases}
\]
Hence by independence
\[
P_{\rm accept}
=\sum_{a_x,a_z}q(a_x,a_z)\,q(a_x,a_z)
=\Bigl(1-\tfrac45p\Bigr)^2
\;+\;3\Bigl(\tfrac{4}{15}p\Bigr)^2
\;=\;
1-\tfrac85\,p\;+\;\tfrac{64}{75}\,p^2\,.
\]
- Numerator
Only those \(E\in\mathcal C(S)\) that also preserve the GHZ up to phase contribute
\(|\<\psi_{\rm ideal}|E|\psi_{\rm ideal}\>|^2=1\).
The GHZ‐stabilizer group (within the code‐centralizer) is generated by the logical operators
\(X_A X_B\) and \(Z_A Z_B\), which act (up to phase) as
\[
\]
Thus the only errors in \(\mathcal C(S)\) that act trivially on the GHZ are
\[
E_{03}=I\otimes I,\qquad
E_{21}\in\{\,I\otimes I,\;X\otimes X,\;Z\otimes Z,\;Y\otimes Y\}_{(2,1)}.
\]
Their total probability is
\[
\sum_{E_{21}\in\{II,XX,ZZ,YY\}}P(E_{21})\;P(E_{03}=II)
=\bigl(1-p\bigr)\!\Bigl[(1-p)+3\frac p{15}\Bigr]
=1-\tfrac95\,p+\tfrac45\,p^2.
\]
- Putting it together
\[
F_{\rm logical}(p)
=\frac{1-\tfrac95\,p+\tfrac45\,p^2}
{1-\tfrac85\,p+\tfrac{64}{75}\,p^2}
=\frac{75-135\,p+60\,p^2}{75-120\,p+64\,p^2}\,.
\]
Final Answer:
\[
\boxed{
F_{\rm logical}(p)
\;=\;
\frac{1 - \tfrac{9}{5}\,p + \tfrac{4}{5}\,p^2}
{1 - \tfrac{8}{5}\,p + \tfrac{64}{75}\,p^2}
\;=\;
\frac{75 - 135\,p + 60\,p^2}{75 -120\,p +64\,p^2}.
\]