To calculate the logical state fidelity, we need to determine the probability of successfully preparing the logical \(|00\rangle_{AB}\) state and the probability of a successful ancilla measurement. The fidelity is the ratio of these two probabilities. We will work to first order in the physical infidelity \(p\).
Let the initial state of the 5 qubits (4 physical, 1 ancilla) be \(|\Psi_{in}\rangle = |00000\rangle\).
The circuit consists of a Hadamard gate \(H_1\) followed by 5 CNOT gates \(C_{12}, C_{10}, C_{23}, C_{34}, C_{04}\). Let’s denote them as \(G_1=H_1\), \(G_2=C_{12}\), \(G_3=C_{10}\), \(G_4=C_{23}\), \(G_5=C_{34}\), \(G_6=C_{04}\). The order of application is \(G_6 G_5 G_4 G_3 G_2 G_1\).
The ideal final state, before ancilla measurement, is \(|\Psi_{ideal}\rangle = G_6 G_5 G_4 G_3 G_2 G_1 |\Psi_{in}\rangle\).
Let’s track the ideal state:
- Initial: \(|00000\rangle\)
- \(H_1\): \(H_1|00000\rangle = \frac{1}{\sqrt{2}}(|00000\rangle + |01000\rangle)\). (Qubit order 01234)
- \(C_{12}\): \(\frac{1}{\sqrt{2}}(|00000\rangle + |01100\rangle)\).
- \(C_{10}\): \(\frac{1}{\sqrt{2}}(|00000\rangle + |11100\rangle)\).
- \(C_{23}\): \(\frac{1}{\sqrt{2}}(|00000\rangle + |11110\rangle)\). This is \(|\text{GHZ}_4\rangle_Q |0\rangle_A\).
The logical state is indeed \(|00\rangle_{AB}\). It’s the \(+1\) eigenstate of \(XXXX\), \(ZZZZ\), \(ZZII\), and \(ZIZI\). Let’s call the set of 16 Pauli operators on the 4 physical qubits that stabilize this state \(G_{00}\).
- \(C_{34}\): \(\frac{1}{\sqrt{2}}(|00000\rangle + |11111\rangle)\).
- \(C_{04}\): \(\frac{1}{\sqrt{2}}(|00000\rangle + |11110\rangle)\).
So, the ideal final state is \(|\Psi_{ideal}\rangle = \frac{1}{\sqrt{2}}(|0000\rangle + |1111\rangle)_Q |0\rangle_A\).
In the ideal case, the ancilla qubit 4 is measured to be \(|0\rangle\) with probability 1, and the logical state is the target \(|00\rangle_{AB}\) state.
Each CNOT gate (\(G_2, G_3, G_4, G_5, G_6\)) is followed by a two-qubit depolarizing error channel \(\mathcal{E}_{ij}\) with probability \(p\). \(\mathcal{E}_{ij}(\rho) = (1-p)\rho + \frac{p}{15} \sum_{P \in \text{Pauli}_2, P \ne I} P \rho P\).
We are interested in the fidelity up to \(O(p)\). This means we consider the case of no errors, and the case of a single error occurring after one of the CNOT gates.
Let \(U_{ideal} = G_6 G_5 G_4 G_3 G_2 G_1\). The ideal final state is \(|\Psi_{ideal}\rangle = U_{ideal}|\Psi_{in}\rangle\).
If a Pauli error \(P_{err}\) occurs after gate \(G_k\), the state is \(G_6 \dots G_{k+1} P_{err} G_k \dots G_1 |\Psi_{in}\rangle\).
This is equivalent to applying an effective Pauli error \(P_{eff}^{(k)}\) to the ideal state: \(P_{eff}^{(k)} |\Psi_{ideal}\rangle\), where \(P_{eff}^{(k)} = G_6 \dots G_{k+1} P_{err} G_{k+1}^\dagger \dots G_6^\dagger\).
We define three categories for each of the \(5 \times 15 = 75\) possible single errors:
- Ancilla Fails (\(S=0\)): If \(P_{eff}^{(k)} |\Psi_{ideal}\rangle\) results in the ancilla qubit 4 being in a state orthogonal to \(|0\rangle_A\). This means \(P_{eff}^{(k)}\) contains an \(X_4\) or \(Y_4\) operator. These errors are detected by the ancilla measurement, and the state preparation fails.
- Logical Fails (\(S=1, F=0\)): If the ancilla qubit is measured to be \(|0\rangle_A\) (i.e., \(P_{eff}^{(k)}\) contains \(I_4\) or \(Z_4\)), but the 4-qubit physical state is no longer the target logical state \(|\text{GHZ}_4\rangle\). This means the 4-qubit part of \(P_{eff}^{(k)}\) is not in \(G_{00}\). These errors are not detected by the ancilla and lead to logical infidelity.
- Logical Success (\(S=1, F=1\)): If the ancilla qubit is measured to be \(|0\rangle_A\) (i.e., \(P_{eff}^{(k)}\) contains \(I_4\) or \(Z_4\)), AND the 4-qubit physical state is still \(|\text{GHZ}_4\rangle\) (i.e., the 4-qubit part of \(P_{eff}^{(k)}\) is in \(G_{00}\)).
We need to list \(P_{eff}^{(k)}\) for each of the 15 errors for each of the 5 CNOT gates (\(G_2\) to \(G_6\)).
Recall the Pauli transformation rules for \(C_{ct}\):
\(C_{ct}(X_c I_t)C_{ct} = X_c X_t\)
\(C_{ct}(I_c X_t)C_{ct} = I_c X_t\)
\(C_{ct}(Z_c I_t)C_{ct} = Z_c I_t\)
\(C_{ct}(I_c Z_t)C_{ct} = Z_c Z_t\)
The operators in \(G_{00}\) (stabilizers of \(|\text{GHZ}_4\rangle\)) are the 16 elements of the group generated by \(\{XXXX, ZZZZ, ZZII, ZIZI\}\).
Let \(N_{ok}, N_{fail,logical}, N_{fail,ancilla}\) be the counts for each category for the 15 non-identity Pauli errors occurring after a specific CNOT.
1. Error after \(G_6 = C_{04}\) (on qubits 0,4): \(P_{eff}^{(6)} = P_{err}\).
* \(Q_A \in \{X_4, Y_4\}\): 8 errors (e.g., \(I_0 X_4, X_0 X_4, Y_0 X_4, Z_0 X_4, I_0 Y_4, \dots\)). \(N_{fail,ancilla}=8\).
* \(Q_A \in \{I_4, Z_4\}\): 7 errors.
* \(I_0 Z_4\): \(I_Q Z_A\). \(I_Q \in G_{00}\). Logical Success. \(N_{ok}=1\).
* \(X_0 I_4, Y_0 I_4, Z_0 I_4, X_0 Z_4, Y_0 Z_4, Z_0 Z_4\): (6 errors). Their logical parts (\(X_0, Y_0, Z_0, X_0, Y_0, Z_0\)) are not in \(G_{00}\). Logical Fails. \(N_{fail,logical}=6\).
Summary for \(G_6\): \((N_{ok}, N_{fail,logical}, N_{fail,ancilla}) = (1, 6, 8)\).
2. Error after \(G_5 = C_{34}\) (on qubits 3,4): \(P_{eff}^{(5)} = C_{04} P_{err} C_{04}\).
* If \(P_{err}\) has \(X_4\) or \(Y_4\) (8 errors, e.g., \(I_3 X_4, \dots\)): \(C_{04}\) maps these to \(I_Q X_4\) or \(I_Q Y_4\). Ancilla Fails. \(N_{fail,ancilla}=8\).
* If \(P_{err}\) has \(I_4\) (3 errors: \(X_3 I_4, Y_3 I_4, Z_3 I_4\)): \(C_{04}\) maps these to \(P_3 I_4\). Their logical parts (\(X_3, Y_3, Z_3\)) are not in \(G_{00}\). Logical Fails. \(N_{fail,logical}=3\).
* If \(P_{err}\) has \(Z_4\) (4 errors, e.g., \(I_3 Z_4, \dots\)): \(C_{04}\) maps \(P_3 Z_4\) to \(P_3 Z_0 Z_4\). Their logical parts (\(I_3 Z_0, X_3 Z_0, Y_3 Z_0, Z_3 Z_0\)) are not in \(G_{00}\). Logical Fails. \(N_{fail,logical}=4\).
Summary for \(G_5\): \((N_{ok}, N_{fail,logical}, N_{fail,ancilla}) = (0, 7, 8)\).
3. Error after \(G_4 = C_{23}\) (on qubits 2,3): \(P_{eff}^{(4)} = C_{04} C_{34} P_{err} C_{34} C_{04}\).
Let \(P_{err}\) be \(P_2 P_3\).
* If \(P_3\) is \(X\) or \(Y\) (8 errors, e.g., \(I_2 X_3, \dots\)): \(C_{34}\) maps \(P_2 P_3\) to \(P_2 P_3 X_4\). These lead to Ancilla Fails. \(N_{fail,ancilla}=8\).
* If \(P_3\) is \(I\) (3 errors: \(X_2 I_3, Y_2 I_3, Z_2 I_3\)): \(C_{34}\) maps \(P_2 I_3\) to \(P_2 I_3 I_4\). \(C_{04}\) keeps it \(P_2 I_3 I_4\). Their logical parts (\(X_2, Y_2, Z_2\)) are not in \(G_{00}\). Logical Fails. \(N_{fail,logical}=3\).
* If \(P_3\) is \(Z\) (4 errors: \(I_2 Z_3, X_2 Z_3, Y_2 Z_3, Z_2 Z_3\)): \(C_{34}\) maps \(P_2 Z_3\) to \(P_2 Z_3 I_4\). \(C_{04}\) keeps it \(P_2 Z_3 I_4\).
* \(Z_2 Z_3\): Logical part \(I_0 I_1 Z_2 Z_3 \in G_{00}\). Logical Success. \(N_{ok}=1\).
* \(I_2 Z_3, X_2 Z_3, Y_2 Z_3\): Logical parts (\(I_2 Z_3, X_2 Z_3, Y_2 Z_3\)) are not in \(G_{00}\). Logical Fails. \(N_{fail,logical}=3\).
Summary for \(G_4\): \((1, 6, 8)\).
4. Error after \(G_3 = C_{10}\) (on qubits 1,0): \(P_{eff}^{(3)} = C_{04} C_{34} C_{23} P_{err} C_{23} C_{34} C_{04}\).
Let \(P_{err}\) be \(P_1 P_0\). These do not act on qubits 2,3,4. So \(C_{23}\) and \(C_{34}\) don’t change them. \(P_{eff}^{(3)} = C_{04} P_{10} I_4 C_{04}\).
* If \(P_0\) is \(X\) or \(Y\) (8 errors): \(C_{04}\) maps \(P_1 P_0 I_4\) to \(P_1 P_0 X_4\). Ancilla Fails. \(N_{fail,ancilla}=8\).
* If \(P_0\) is \(I\) (3 errors: \(X_1 I_0, Y_1 I_0, Z_1 I_0\)): \(C_{04}\) maps \(P_1 I_0 I_4\) to \(P_1 I_0 I_4\). Logical parts (\(X_1, Y_1, Z_1\)) are not in \(G_{00}\). Logical Fails. \(N_{fail,logical}=3\).
* If \(P_0\) is \(Z\) (4 errors: \(I_1 Z_0, X_1 Z_0, Y_1 Z_0, Z_1 Z_0\)): \(C_{04}\) maps \(P_1 Z_0 I_4\) to \(P_1 Z_0 Z_4\). Logical parts (\(I_1 Z_0, X_1 Z_0, Y_1 Z_0, Z_1 Z_0\)) are not in \(G_{00}\). Logical Fails. \(N_{fail,logical}=4\).
Summary for \(G_3\): \((0, 7, 8)\).
5. Error after \(G_2 = C_{12}\) (on qubits 1,2): \(P_{eff}^{(2)} = C_{04} C_{34} C_{23} C_{10} P_{err} C_{10} C_{23} C_{34} C_{04}\).
This is the most complex one. Let’s trace it carefully.
* Errors with \(X_1\) or \(Y_1\) (8 errors: \(X_1 I_2, X_1 X_2, \dots, Y_1 Z_2\)).
\(C_{10}(X_1 P_2)C_{10}\) yields \(X_1 X_0 P_2\). \(C_{10}(Y_1 P_2)C_{10}\) yields \(Y_1 X_0 P_2\).
The \(X_0\) component then means \(C_{04}\) will map these to terms with \(X_4\). All 8 of these lead to Ancilla Fails. \(N_{fail,ancilla}=8\).
* Errors with \(Z_1\) (4 errors: \(Z_1 I_2, Z_1 X_2, Z_1 Y_2, Z_1 Z_2\)).
\(C_{10}(Z_1 P_2)C_{10}\) yields \(Z_1 I_0 P_2\). These have \(I_0\) so \(C_{04}\) won’t flip \(q_4\) from \(q_0\)’s action.
* \(Z_1 I_2 \to Z_1 I_0 I_2 I_3 I_4\). Logical part (\(I_0 Z_1 I_2 I_3\)) not in \(G_{00}\). Logical Fail.
* \(Z_1 X_2 \to Z_1 I_0 X_2 X_3 X_4\). Ancilla Fails.
* \(Z_1 Y_2 \to Z_1 I_0 Y_2 X_3 X_4\). Ancilla Fails.
* \(Z_1 Z_2 \to Z_1 I_0 Z_2 I_3 I_4\). Logical part (\(I_0 Z_1 Z_2 I_3\)) is \(I_0 Z_1 Z_2 I_3 |\text{GHZ}_4\rangle = |\text{GHZ}_4\rangle\). So it’s in \(G_{00}\). Logical Success. \(N_{ok}=1\).
Sub-summary for \(Z_1\): \((1, 1, 2)\).
* Errors with \(I_1\) (3 errors: \(I_1 X_2, I_1 Y_2, I_1 Z_2\)).
\(C_{10}(I_1 P_2)C_{10}\) yields \(I_1 P_2\).
* \(I_1 X_2 \to I_1 X_2 X_3 X_4\). Ancilla Fails.
* \(I_1 Y_2 \to I_1 Y_2 X_3 X_4\). Ancilla Fails.
* \(I_1 Z_2 \to I_1 Z_2 I_3 I_4\). Logical part (\(I_0 I_1 Z_2 I_3\)) not in \(G_{00}\). Logical Fail.
Sub-summary for \(I_1\): \((0, 1, 2)\).
Summary for \(G_2\): \((N_{ok}, N_{fail,logical}, N_{fail,ancilla}) = (1, 1+1, 8+2+2) = (1, 2, 12)\).
Total counts for 75 errors:
Total \(N_{ok} = 1+0+1+0+1 = 3\).
Total \(N_{fail,logical} = 6+7+6+7+2 = 28\).
Total \(N_{fail,ancilla} = 8+8+8+8+12 = 44\).
Total errors = \(3+28+44 = 75\).
The probability of successful ancilla measurement (\(P_{succ}\)) to \(O(p)\):
\(P_{succ} = (1-p)^5 \cdot 1 + \frac{p}{15} (1-p)^4 (N_{ok} + N_{fail,logical}) + O(p^2)\)
\(P_{succ} \approx (1-5p) + \frac{p}{15} (3+28) = 1 - 5p + \frac{31p}{15} = 1 - (\frac{75-31}{15})p = 1 - \frac{44}{15}p\).
The probability of successful ancilla measurement AND correct logical state (\(\mathcal{F}\)) to \(O(p)\):
\(\mathcal{F} = (1-p)^5 \cdot 1 + \frac{p}{15} (1-p)^4 N_{ok} + O(p^2)\)
\(\mathcal{F} \approx (1-5p) + \frac{p}{15} \cdot 3 = 1 - 5p + \frac{p}{5} = 1 - (\frac{25-1}{5})p = 1 - \frac{24}{5}p\).
The logical state fidelity \(F_{logical}\) is the ratio of \(\mathcal{F}\) to \(P_{succ}\):
\[
F_{logical} = \frac{\mathcal{F}}{P_{succ}} = \frac{1 - \frac{24}{5}p}{1 - \frac{44}{15}p}
\]
Using the approximation \(\frac{1}{1-x} \approx 1+x\) for small \(x\):
\[
F_{logical} \approx \left(1 - \frac{24}{5}p\right) \left(1 + \frac{44}{15}p\right)
\]
\[
F_{logical} \approx 1 + \left(\frac{44}{15} - \frac{24}{5}\right)p + O(p^2)
\]
\[
F_{logical} \approx 1 + \left(\frac{44 - 3 \times 24}{15}\right)p + O(p^2)
\]
\[
F_{logical} \approx 1 + \left(\frac{44 - 72}{15}\right)p + O(p^2)
\]
\[
F_{logical} \approx 1 - \frac{28}{15}p + O(p^2)
\]
The final answer is \(\boxed{1 - \frac{28}{15}p}\).