Error Model and Fidelity Definition:
Each CNOT gate \(C_k\) is followed by a two-qubit depolarizing error channel \(\mathcal{E}_k\).
\(\mathcal{E}_k(\rho) = (1-p)\rho + \frac{p}{15} \sum_{P_{ij} \neq I} P_{ij} \rho P_{ij}\).
We work to first order in \(p\). The state after all operations and error channels is \(\rho_f\).
The fidelity is \(F = \frac{\langle \Phi_L | \text{Tr}_4(P_{code} P_{M_0} \rho_f P_{M_0} P_{code}) | \Phi_L \rangle}{\text{Tr}(\text{Tr}_4(P_{code} P_{M_0} \rho_f P_{M_0} P_{code}))}\), where \(P_{M_0} = I_{0123} \otimes |0\rangle\langle 0|_4\) and \(P_{code} = \frac{1}{4}(I+S_1)(I+S_2)\).
Let \(U_k\) be the \(k\)-th CNOT gate in execution order (from right to left in the problem statement).
\(U_1 = H_1\) (no error channel)
\(U_2 = CNOT_{12}\)
\(U_3 = CNOT_{10}\)
\(U_4 = CNOT_{23}\)
\(U_5 = CNOT_{34}\)
\(U_6 = CNOT_{04}\)
An error \(P_{ij}\) occurring after \(U_k\) is effectively equivalent to an error \(E_{prop} = U_{post,k} P_{ij} U_{post,k}^\dagger\) acting on the ideal state \(|\Psi_{ideal}\rangle\), where \(U_{post,k} = U_6 \dots U_{k+1}\).
\(E_{prop}\) is a 5-qubit Pauli operator, \(E_{prop} = E_{0123} \otimes E_4\).
We are interested in errors that are not detected by post-selection:
1. The ancilla measurement \(M_4\) yields \(|0\rangle\). This means \(E_4 \in \{I_4, Z_4\}\).
2. The state must be in the code space. This means \(E_{0123}\) must commute with both stabilizers \(S_1\) and \(S_2\). If \(E_{0123}\) anti-commutes with \(S_1\) or \(S_2\), it’s detected.
Among these undetected errors:
- If \(E_{0123}|\Phi_L\rangle = |\Phi_L\rangle\) (e.g., \(E_{0123}\) is a product of stabilizers and logical Z operators), it contributes to the numerator (\(N_0\)).
- If \(E_{0123}|\Phi_L\rangle \neq |\Phi_L\rangle\) but is still a valid logical state (e.g., \(E_{0123}\) is a logical X operator), it contributes only to the denominator (\(N_L\)).
The infidelity is \(p \frac{N_L}{15}\), where \(N_L\) is the total count of errors from all 5 CNOT gates that satisfy conditions 1 and 2, but result in a logical state different from \(|\Phi_L\rangle\).
Let’s use the \((\vec{x}, \vec{z})\) formalism for Pauli propagation. A Pauli \(P\) on 5 qubits is represented by two binary vectors \((\vec{x}, \vec{z})\), where \(P = \prod_{j=0}^4 X_j^{x_j} Z_j^{z_j}\).
The transformation for \(CNOT_{c,t}\) on an error \(E=(\vec{x},\vec{z})\) is:
\(x_c \to x_c \oplus x_t\)
\(z_c \to z_c\)
\(x_t \to x_t\)
\(z_t \to z_t \oplus z_c\)
Let’s analyze each CNOT gate:
1. Errors after \(CNOT_{04}\) (qubits 0,4, \(U_{post,6}=I\))
An original error \(P_{04}\) (on qubits 0 and 4) is directly \(E_{prop} = P_{04}\).
- \(E_4 \in \{X_4, Y_4\}\) (8 errors): These flip qubit 4, so they are detected by \(M_4\).
- \(E_4 \in \{I_4, Z_4\}\) (7 errors, e.g. \(X_0 I_4, Y_0 I_4, Z_0 I_4, I_0 Z_4, X_0 Z_4, Y_0 Z_4, Z_0 Z_4\)).
For these, \(E_{0123}\) is \(P_0\).
- \(P_0=X_0\): anti-commutes with \(S_1=XXXX\). Detected.
- \(P_0=Y_0\): anti-commutes with \(S_1=XXXX\) and \(S_2=ZZZZ\). Detected.
- \(P_0=Z_0\): anti-commutes with \(S_2=ZZZZ\). Detected.
Therefore, for \(CNOT_{04}\), \(N_0=0\) and \(N_L=0\).
2. Errors after \(CNOT_{34}\) (qubits 3,4, \(U_{post,5}=CNOT_{04}\))
Original error \(P_{34}\) on qubits 3,4. Initial \((\vec{x},\vec{z})=(0,0,0,x_3,x_4), (0,0,0,z_3,z_4)\).
Applying \(CNOT_{04}\) (control 0, target 4):
\(x_0^{new} = x_0 \oplus x_4 = 0 \oplus x_4 = x_4\).
\(z_0^{new} = z_0 = 0\).
\(x_4^{new} = x_4\).
\(z_4^{new} = z_4 \oplus z_0 = z_4 \oplus 0 = z_4\).
Propagated error \((\vec{x}',\vec{z}')=(x_4,0,0,x_3,x_4), (0,0,0,z_3,z_4)\).
So \(E_{0123} = X_0^{x_4} X_3^{x_3} Z_3^{z_3}\). And \(E_4 = X_4^{x_4} Z_4^{z_4}\).
- Ancilla detection (\(x_4=1\)): If \(x_4=1\), \(E_4\) contains \(X_4\) or \(Y_4\), detected by \(M_4\). (8 errors)
- No ancilla detection (\(x_4=0\)): \(P_4 \in \{I_4, Z_4\}\). \(E_4 = Z_4^{z_4}\). \(E_{0123} = X_3^{x_3} Z_3^{z_3} = P_3\). (7 errors: \(X_3 I_4, Y_3 I_4, Z_3 I_4, I_3 Z_4, X_3 Z_4, Y_3 Z_4, Z_3 Z_4\)).
We check \(P_3\) for detection by code (\(S_1, S_2\)) and logical state change (\(Z_A, Z_B\)).
- \(P_3 = I_3\): (error \(I_3 Z_4\), \(x_3=0, z_3=0\)) \(E_{0123}=I\). Commutes with \(S_1, S_2, Z_A, Z_B\). \(N_0 \leftarrow N_0+1\).
- \(P_3 = X_3\): Anti-commutes \(S_1\). Detected.
- \(P_3 = Y_3\): Anti-commutes \(S_1, S_2\). Detected.
- \(P_3 = Z_3\): Anti-commutes \(S_2\). Detected.
For \(CNOT_{34}\), \(N_0=1\), \(N_L=0\).
3. Errors after \(CNOT_{23}\) (qubits 2,3, \(U_{post,4}=CNOT_{34} CNOT_{04}\))
Original error \(P_{23}\). Initial \((\vec{x},\vec{z})=(0,0,x_2,x_3,0), (0,0,z_2,z_3,0)\).
Applying \(CNOT_{34}\) (control 3, target 4):
\(x_3^{new} = x_3\). \(z_3^{new} = z_3\). \(x_4^{new} = x_4=0\). \(z_4^{new} = z_4 \oplus z_3 = 0 \oplus z_3 = z_3\).
Intermediate \((\vec{x}_a,\vec{z}_a)=(0,0,x_2,x_3,0), (0,0,z_2,z_3,z_3)\).
Applying \(CNOT_{04}\) (control 0, target 4):
\(x_0^{new} = x_0 \oplus x_4 = 0 \oplus 0 = 0\). \(z_0^{new} = z_0 = 0\).
\(x_4^{new} = x_4 = 0\). \(z_4^{new} = z_4 \oplus z_0 = z_3 \oplus 0 = z_3\).
Propagated error \((\vec{x}',\vec{z}')=(0,0,x_2,x_3,0), (0,0,z_2,z_3,z_3)\).
So \(E_{0123} = X_2^{x_2} Z_2^{z_2} X_3^{x_3} Z_3^{z_3} = P_{23}\). And \(E_4 = Z_4^{z_3}\).
- Ancilla detection: \(E_4=Z_4^{z_3}\). No \(X_4\) component, so no ancilla detection. All 15 errors pass.
- Code detection & logical change: We check \(P_{23}\). Commutes with \(S_1=XXXX\) (even \(X/Y\) count on \(Q_2, Q_3\)) and \(S_2=ZZZZ\) (even \(Z/Y\) count on \(Q_2, Q_3\)).
- \(I_2 I_3\): (\(x_2=0,z_2=0,x_3=0,z_3=0\)) \(E_{0123}=I\). \(E_4=I_4\). Contributes to \(N_0\). \(N_0 \leftarrow N_0+1\).
- \(X_2 X_3\): (\(x_2=1,z_2=0,x_3=1,z_3=0\)) \(E_{0123}=X_2 X_3\). \(E_4=I_4\). Commutes \(S_1, S_2\). Anti-commutes \(Z_B=Z_0 I_1 Z_2 I_3\) (\(X_2, Z_2\)). Contributes to \(N_L\). \(N_L \leftarrow N_L+1\).
- \(Y_2 Y_3\): (\(x_2=1,z_2=1,x_3=1,z_3=1\)) \(E_{0123}=Y_2 Y_3\). \(E_4=Z_4\). Commutes \(S_1, S_2\). Anti-commutes \(Z_B=Z_0 I_1 Z_2 I_3\) (\(Y_2, Z_2\)). Contributes to \(N_L\). \(N_L \leftarrow N_L+1\).
- \(Z_2 Z_3\): (\(x_2=0,z_2=1,x_3=0,z_3=1\)) \(E_{0123}=Z_2 Z_3\). \(E_4=Z_4\). Commutes \(S_1, S_2\). Commutes \(Z_A=Z_0 Z_1\), \(Z_B=Z_0 Z_2\). Contributes to \(N_0\). \(N_0 \leftarrow N_0+1\).
All other 11 errors on \(P_{23}\) anti-commute with \(S_1\) or \(S_2\). Detected by code.
For \(CNOT_{23}\), \(N_0=2\), \(N_L=2\).
Cumulative: \(N_0=1+2=3\). \(N_L=0+2=2\).
4. Errors after \(CNOT_{10}\) (qubits 1,0, \(U_{post,3}=CNOT_{23} CNOT_{34} CNOT_{04}\))
Original error \(P_{10}\). Initial \((\vec{x},\vec{z})=(x_0,x_1,0,0,0), (z_0,z_1,0,0,0)\).
The three gates \(CNOT_{23}, CNOT_{34}, CNOT_{04}\) are applied.
\(CNOT_{23}\) (c=2, t=3): No change as it acts on qubits 2,3.
\(CNOT_{34}\) (c=3, t=4): No change.
\(CNOT_{04}\) (c=0, t=4):
\(x_0^{new} = x_0 \oplus x_4 = x_0 \oplus 0 = x_0\). \(z_0^{new} = z_0\).
\(x_4^{new} = x_4 = 0\). \(z_4^{new} = z_4 \oplus z_0 = 0 \oplus z_0 = z_0\).
Propagated error \((\vec{x}',\vec{z}')=(x_0,x_1,0,0,0), (z_0,z_1,0,0,z_0)\).
So \(E_{0123} = X_0^{x_0} Z_0^{z_0} X_1^{x_1} Z_1^{z_1} = P_{10}\). And \(E_4 = Z_4^{z_0}\).
- Ancilla detection: \(E_4=Z_4^{z_0}\). No \(X_4\) component, so no ancilla detection. All 15 errors pass.
- Code detection & logical change: We check \(P_{10}\). Commutes with \(S_1=XXXX\) (even \(X/Y\) count on \(Q_0, Q_1\)) and \(S_2=ZZZZ\) (even \(Z/Y\) count on \(Q_0, Q_1\)).
- \(I_0 I_1\): (\(x_0=0,z_0=0,x_1=0,z_1=0\)) \(E_{0123}=I\). \(E_4=I_4\). Contributes to \(N_0\). \(N_0 \leftarrow N_0+1\).
- \(X_0 X_1\): (\(x_0=1,z_0=0,x_1=1,z_1=0\)) \(E_{0123}=X_0 X_1\). \(E_4=I_4\). Commutes \(S_1, S_2\). Anti-commutes \(Z_A=Z_0 Z_1\) (\(X_0, Z_0\)). Contributes to \(N_L\). \(N_L \leftarrow N_L+1\).
- \(Y_0 Y_1\): (\(x_0=1,z_0=1,x_1=1,z_1=1\)) \(E_{0123}=Y_0 Y_1\). \(E_4=Z_4\). Commutes \(S_1, S_2\). Anti-commutes \(Z_A=Z_0 Z_1\) (\(Y_0, Z_0\)). Contributes to \(N_L\). \(N_L \leftarrow N_L+1\).
- \(Z_0 Z_1\): (\(x_0=0,z_0=1,x_1=0,z_1=1\)) \(E_{0123}=Z_0 Z_1\). \(E_4=Z_4\). Commutes \(S_1, S_2\). Commutes \(Z_A, Z_B\). Contributes to \(N_0\). \(N_0 \leftarrow N_0+1\).
All other 11 errors on \(P_{10}\) anti-commute with \(S_1\) or \(S_2\). Detected by code.
For \(CNOT_{10}\), \(N_0=2\), \(N_L=2\).
Cumulative: \(N_0=3+2=5\). \(N_L=2+2=4\).
5. Errors after \(CNOT_{12}\) (qubits 1,2, \(U_{post,2}=CNOT_{10} CNOT_{23} CNOT_{34} CNOT_{04}\))
Original error \(P_{12}\). Initial \((\vec{x},\vec{z})=(0,x_1,x_2,0,0), (0,z_1,z_2,0,0)\).
Applying \(CNOT_{10}\) (c=1, t=0):
\(x_1^{new} = x_1 \oplus x_0 = x_1\). \(z_1^{new} = z_1\). \(x_0^{new} = x_0=0\). \(z_0^{new} = z_0 \oplus z_1 = z_1\).
\((\vec{x}_a,\vec{z}_a)=(0,x_1,x_2,0,0), (z_1,z_1,z_2,0,0)\).
Applying \(CNOT_{23}\) (c=2, t=3):
\(x_2^{new} = x_2 \oplus x_3 = x_2\). \(z_2^{new} = z_2\). \(x_3^{new} = x_3=0\). \(z_3^{new} = z_3 \oplus z_2 = z_2\).
\((\vec{x}_b,\vec{z}_b)=(0,x_1,x_2,0,0), (z_1,z_1,z_2,z_2,0)\).
Applying \(CNOT_{34}\) (c=3, t=4):
\(x_3^{new} = x_3 \oplus x_4 = 0\). \(z_3^{new} = z_3 = z_2\). \(x_4^{new} = x_4=0\). \(z_4^{new} = z_4 \oplus z_3 = 0 \oplus z_2 = z_2\).
\((\vec{x}_c,\vec{z}_c)=(0,x_1,x_2,0,0), (z_1,z_1,z_2,z_2,z_2)\).
Applying \(CNOT_{04}\) (c=0, t=4):
\(x_0^{new} = x_0 \oplus x_4 = 0 \oplus 0 = 0\). \(z_0^{new} = z_0 = z_1\).
\(x_4^{new} = x_4 = 0\). \(z_4^{new} = z_4 \oplus z_0 = z_2 \oplus z_1\).
Propagated error \((\vec{x}',\vec{z}')=(0,x_1,x_2,0,0), (z_1,z_1,z_2,z_2,z_1 \oplus z_2)\).
So \(E_{0123} = Z_0^{z_1} X_1^{x_1} Z_1^{z_1} X_2^{x_2} Z_2^{z_2} Z_3^{z_2}\). And \(E_4 = Z_4^{z_1 \oplus z_2}\).
- Ancilla detection: \(E_4=Z_4^{z_1 \oplus z_2}\). No \(X_4\) component, so no ancilla detection. All 15 errors pass.
- Code detection & logical change: We check \(E_{0123}\).
\(E_{0123}\) must commute with \(S_1=XXXX\) (even \(X/Y\) count). \(x_0 \oplus x_1 \oplus x_2 \oplus x_3 = 0 \oplus x_1 \oplus x_2 \oplus 0 = 0 \implies x_1=x_2\).
\(E_{0123}\) must commute with \(S_2=ZZZZ\) (even \(Z/Y\) count). \(z_0 \oplus z_1 \oplus z_2 \oplus z_3 = z_1 \oplus z_1 \oplus z_2 \oplus z_2 = 0\). This is always true.
So, only errors with \(x_1=x_2\) are not detected by \(S_1\). These are \(I_1 I_2, X_1 X_2, Y_1 Y_2, Z_1 Z_2\). (4 errors).
- \(I_1 I_2\): (\(x_1=0,z_1=0,x_2=0,z_2=0\)) \(E_{0123}=I\). \(E_4=I_4\). Contributes to \(N_0\). \(N_0 \leftarrow N_0+1\).
- \(X_1 X_2\): (\(x_1=1,z_1=0,x_2=1,z_2=0\)) \(E_{0123}=X_1 X_2\). \(E_4=I_4\). Commutes \(S_1, S_2\). Anti-commutes \(Z_A=Z_0 Z_1\) (\(X_1, Z_1\)). Contributes to \(N_L\). \(N_L \leftarrow N_L+1\).
- \(Y_1 Y_2\): (\(x_1=1,z_1=1,x_2=1,z_2=1\)) \(E_{0123}=Z_0 X_1 Z_1 X_2 Z_2 Z_3 = Y_0 Y_1 Y_2 Z_3\). \(E_4=I_4\). Number of \(X/Y\) terms is 3 (\(Y_0, Y_1, Y_2\)). Anti-commutes \(S_1\). Detected by code.
- \(Z_1 Z_2\): (\(x_1=0,z_1=1,x_2=0,z_2=1\)) \(E_{0123}=Z_0 Z_1 Z_2 Z_3 = S_2\). \(E_4=I_4\). \(S_2\) is a stabilizer, so it belongs to \(N_0\). \(N_0 \leftarrow N_0+1\).
All other 11 errors in \(P_{12}\) (where \(x_1 \ne x_2\)) anti-commute with \(S_1\). Detected by code.
For \(CNOT_{12}\), \(N_0=2\), \(N_L=1\).
Cumulative: \(N_0=5+2=7\). \(N_L=4+1=5\).