Step-by-Step Derivation
1. Ideal State and Error Model
From Subproblem 1, the ideal physical state prepared by the circuit is \(|\Psi_{ideal}\rangle = \frac{1}{2}(|0000\rangle + |1001\rangle + |0110\rangle + |1111\rangle)\). This state is in the codespace of the [[4,2,2]] code (the +1 eigenspace of stabilizers \(S_1=XXXX\) and \(S_2=ZZZZ\)) and corresponds to the logical GHZ state \(|\Psi_L\rangle = \frac{1}{\sqrt{2}}(|00\rangle_{AB} + |11\rangle_{AB})\). Let \(\rho_{ideal} = |\Psi_{ideal}\rangle\langle\Psi_{ideal}|\).
The circuit has two noisy CNOT gates. The final state of the 4 physical qubits, \(\rho_{final}\), after passing through the two independent depolarizing channels is given by:
\[
\rho_{final} = (\mathcal{E}_{03} \circ \mathcal{E}_{21}) (\rho_{ideal})
\]
where \(\mathcal{E}_{ij}\) is the two-qubit depolarizing channel on qubits \(i\) and \(j\).
2. Post-selection and Logical Fidelity
We post-select on the absence of detectable errors. This corresponds to projecting the final state into the codespace. The projector onto the codespace is \(\Pi_C = \frac{1}{4}(I + S_1 + S_2 + S_1S_2)\). The post-selected state is:
\[
\rho_{ps} = \frac{\Pi_C \rho_{final} \Pi_C}{\text{Tr}(\Pi_C \rho_{final})}
\]
The denominator, \(P_{succ} = \text{Tr}(\Pi_C \rho_{final})\), is the probability of success (i.e., of measuring both stabilizers and getting +1).
The logical state fidelity is defined with respect to the ideal logical state \(|\Psi_L\rangle\). The corresponding physical state is \(|\Psi_{ideal}\rangle\). The fidelity of the post-selected state \(\rho_{ps}\) with the ideal pure state \(|\Psi_{ideal}\rangle\) is:
\[
F_L = \langle\Psi_{ideal}| \rho_{ps} |\Psi_{ideal}\rangle
\]
Substituting the expression for \(\rho_{ps}\):
\[
F_L = \frac{\langle\Psi_{ideal}| \Pi_C \rho_{final} \Pi_C |\Psi_{ideal}\rangle}{P_{succ}}
\]
Since \(|\Psi_{ideal}\rangle\) is in the codespace, it is an eigenvector of \(\Pi_C\) with eigenvalue 1, i.e., \(\Pi_C |\Psi_{ideal}\rangle = |\Psi_{ideal}\rangle\) and \(\langle\Psi_{ideal}| \Pi_C = \langle\Psi_{ideal}|\). Therefore, the numerator simplifies:
\[
\langle\Psi_{ideal}| \Pi_C \rho_{final} \Pi_C |\Psi_{ideal}\rangle = \langle\Psi_{ideal}| \rho_{final} |\Psi_{ideal}\rangle = F_{phys}
\]
where \(F_{phys}\) is the physical state fidelity calculated in Subproblem 1.
Thus, the logical fidelity is the ratio of the physical fidelity to the success probability:
\[
F_L(p) = \frac{F_{phys}(p)}{P_{succ}(p)}
\]
3. Calculation of the Success Probability (\(P_{succ}\))
From Subproblem 1, we know the ideal state factorizes as \(|\Psi_{ideal}\rangle = |\Phi^+\rangle_{03} \otimes |\Phi^+\rangle_{12}\), where \(|\Phi^+\rangle = \frac{1}{\sqrt{2}}(|00\rangle+|11\rangle)\). The final state is \(\rho_{final} = \rho_{03} \otimes \rho_{12}\), where \(\rho_{03} = \mathcal{E}_{03}(|\Phi^+\rangle_{03}\langle\Phi^+|_{03})\) and \(\rho_{12} = \mathcal{E}_{21}(|\Phi^+\rangle_{12}\langle\Phi^+|_{12})\).
The success probability is \(P_{succ} = \text{Tr}(\Pi_C \rho_{final})\). Let’s write the projector in terms of operators on the subsystems (0,3) and (1,2):
\[
\Pi_C = \frac{1}{4}(I \otimes I + (X_0X_3 \otimes X_1X_2) + (Z_0Z_3 \otimes Z_1Z_2) + (Y_0Y_3 \otimes Y_1Y_2))
\]
The trace becomes:
\begin{align} P_{succ} &= \frac{1}{4} \text{Tr} \left[ (I \otimes I + X_0X_3 \otimes X_1X_2 + \dots) (\rho_{03} \otimes \rho_{12}) \right] \ &= \frac{1}{4} \left[ \text{Tr}(I\rho_{03})\text{Tr}(I\rho_{12}) + \text{Tr}(X_0X_3\rho_{03})\text{Tr}(X_1X_2\rho_{12}) + \dots \right] \ &= \frac{1}{4} \left[ 1 + \langle X_0X_3 \rangle_{\rho_{03}} \langle X_1X_2 \rangle_{\rho_{12}} + \langle Z_0Z_3 \rangle_{\rho_{03}} \langle Z_1Z_2 \rangle_{\rho_{12}} + \langle Y_0Y_3 \rangle_{\rho_{03}} \langle Y_1Y_2 \rangle_{\rho_{12}} \right] \end{align}
We need to calculate the expectation value of a two-qubit Pauli operator \(Q\) for a Bell state that has passed through a depolarizing channel. Let \(\rho' = \mathcal{E}(|\Phi^+\rangle\langle\Phi^+|)\).
\[
\langle Q \rangle_{\rho'} = \text{Tr}(Q \rho') = (1-p)\text{Tr}(Q\rho_{ideal}) + \frac{p}{15}\sum_{P \neq I} \text{Tr}(Q P \rho_{ideal} P)
\]
Using the identity \(\text{Tr}(QP\rho P) = \text{sgn}(P,Q)\text{Tr}(Q\rho)\), where \(\text{sgn}(P,Q) = \pm 1\) depending on whether \(P,Q\) commute or anticommute:
\[
\langle Q \rangle_{\rho'} = \left( (1-p) + \frac{p}{15}\sum_{P \neq I} \text{sgn}(P,Q) \right) \langle Q \rangle_{ideal}
\]
For any two-qubit Pauli \(Q \neq I\), the sum over the 15 non-identity Paulis is \(\sum_{P \neq I} \text{sgn}(P,Q) = -1\). So:
\[
\langle Q \rangle_{\rho'} = \left( 1-p - \frac{p}{15} \right) \langle Q \rangle_{ideal} = \left( 1 - \frac{16}{15}p \right) \langle Q \rangle_{ideal}
\]
The ideal expectation values for \(|\Phi^+\rangle\) are \(\langle XX \rangle = 1\), \(\langle ZZ \rangle = 1\), and \(\langle YY \rangle = -1\).
So for each subsystem, we have:
\(\langle XX \rangle_{\rho'} = 1 - \frac{16}{15}p\)
\(\langle ZZ \rangle_{\rho'} = 1 - \frac{16}{15}p\)
\(\langle YY \rangle_{\rho'} = -(1 - \frac{16}{15}p)\)
Substituting these into the expression for \(P_{succ}\):
\[
P_{succ}(p) = \frac{1}{4} \left[ 1 + \left(1-\frac{16}{15}p\right)^2 + \left(1-\frac{16}{15}p\right)^2 + \left(-\left(1-\frac{16}{15}p\right)\right)\left(-\left(1-\frac{16}{15}p\right)\right) \right]
\]
\[
P_{succ}(p) = \frac{1}{4} \left[ 1 + 3\left(1 - \frac{16}{15}p\right)^2 \right]
\]
Expanding this expression:
\[
P_{succ}(p) = \frac{1}{4} \left[ 1 + 3\left(1 - \frac{32}{15}p + \frac{256}{225}p^2\right) \right] = \frac{1}{4} \left[ 4 - \frac{32}{5}p + \frac{256}{75}p^2 \right]
\]
\[
P_{succ}(p) = 1 - \frac{8}{5}p + \frac{64}{75}p^2
\]
4. Final Calculation of Logical Fidelity
We now combine our results. From Subproblem 1, the physical fidelity is:
\[
F_{phys}(p) = \left(1 - \frac{4}{5}p\right)^2 = 1 - \frac{8}{5}p + \frac{16}{25}p^2 = 1 - \frac{8}{5}p + \frac{48}{75}p^2
\]
The logical fidelity is the ratio:
\[
F_L(p) = \frac{F_{phys}(p)}{P_{succ}(p)} = \frac{1 - \frac{8}{5}p + \frac{16}{25}p^2}{1 - \frac{8}{5}p + \frac{64}{75}p^2}
\]
The linear terms in \(p\) in the numerator and denominator are identical. This implies that the logical infidelity, \(1 - F_L(p)\), is of order \(p^2\), which is expected for a distance-2 code.
\[
1 - F_L(p) = \frac{P_{succ}(p) - F_{phys}(p)}{P_{succ}(p)} = \frac{(1 - \frac{8}{5}p + \frac{64}{75}p^2) - (1 - \frac{8}{5}p + \frac{48}{75}p^2)}{1 - \frac{8}{5}p + \frac{64}{75}p^2} = \frac{\frac{16}{75}p^2}{1 - \frac{8}{5}p + \frac{64}{75}p^2}
\]
Final Answer:
The logical state fidelity of the final 2-qubit logical state as a function of the two-qubit gate error rate \(p\) is:
\[
F_L(p) = \frac{1 - \frac{8}{5}p + \frac{16}{25}p^2}{1 - \frac{8}{5}p + \frac{64}{75}p^2}
\]