Step 1: Define Logical State Fidelity with Post-selection
The logical state fidelity, \(F_L\), is the fidelity of the actual final state with the ideal logical state, conditioned on the state being in the correct codespace. The process of “post-selecting on all detectable errors” means we project the final state onto the codespace and re-normalize.
Let \(\rho_{actual}\) be the final density matrix of the 4-qubit system at the end of the noisy circuit. The codespace is the subspace stabilized by \(S_1 = XXXX\) and \(S_2 = ZZZZ\). The projector onto this codespace is \(P_{code} = \frac{1}{4}(I+S_1)(I+S_2)\).
The post-selected state is:
\[
\rho_{ps} = \frac{P_{code} \rho_{actual} P_{code}}{\text{Tr}(P_{code} \rho_{actual})}
\]
The denominator, \(P_{success} = \text{Tr}(P_{code} \rho_{actual})\), is the probability that the state is found in the codespace upon measurement of the stabilizers (the success probability of error detection).
The ideal final state, derived in Subproblem 1, is \(|\Psi_{ideal}\rangle = \frac{1}{2} (|0000\rangle + |1001\rangle + |0110\rangle + |1111\rangle)\). We must first verify this state is in the codespace.
\[
S_1 |\Psi_{ideal}\rangle = XXXX \frac{1}{2} (|0000\rangle + |1001\rangle + |0110\rangle + |1111\rangle) = \frac{1}{2} (|1111\rangle + |0110\rangle + |1001\rangle + |0000\rangle) = |\Psi_{ideal}\rangle
\]
\[
S_2 |\Psi_{ideal}\rangle = ZZZZ \frac{1}{2} (|0000\rangle + |1001\rangle + |0110\rangle + |1111\rangle) = \frac{1}{2} (|0000\rangle + |1001\rangle + |0110\rangle + |1111\rangle) = |\Psi_{ideal}\rangle
\]
Since \(|\Psi_{ideal}\rangle\) is in the codespace, \(P_{code}|\Psi_{ideal}\rangle = |\Psi_{ideal}\rangle\).
The logical fidelity is the fidelity of the post-selected state with the ideal state:
\[
F_L = \langle\Psi_{ideal}| \rho_{ps} |\Psi_{ideal}\rangle = \frac{\langle\Psi_{ideal}| P_{code} \rho_{actual} P_{code} |\Psi_{ideal}\rangle}{P_{success}}
\]
Using \(P_{code}|\Psi_{ideal}\rangle = |\Psi_{ideal}\rangle\), this simplifies to:
\[
F_L = \frac{\langle\Psi_{ideal}| \rho_{actual} |\Psi_{ideal}\rangle}{P_{success}} = \frac{F_{phys}}{P_{success}}
\]
From Subproblem 1, we know the physical fidelity is \(F_{phys}(p) = (1 - \frac{4}{5}p)^2\). We now need to calculate the success probability \(P_{success}\).
Step 2: Model the Error Process and Find Effective Error Operators
The circuit has two noisy CNOT gates. Let’s trace the effect of errors.
The ideal state is \(|\Psi_{ideal}\rangle = U |\vec{0}\rangle\), where \(U = U_{C03}U_{H0}U_{C21}U_{H2}\).
The noisy circuit applies depolarizing channels \(\mathcal{E}_{21}\) and \(\mathcal{E}_{03}\) after \(U_{C21}\) and \(U_{C03}\) respectively.
Let \(U_{early} = U_{C21}U_{H2}\) and \(U_{late} = U_{C03}U_{H0}\). The actual state is:
\[
\rho_{actual} = \mathcal{E}_{03}(U_{late} \mathcal{E}_{21}(U_{early} |0\rangle\langle0|^{\otimes 4} U_{early}^\dagger) U_{late}^\dagger)
\]
The output state is a mixture of states resulting from Pauli errors occurring at each CNOT gate. An error \(P_{12}\) on qubits (1,2) can occur after \(U_{early}\), and an error \(Q_{03}\) on qubits (0,3) can occur after \(U_{late}\). The state after the first error is \(U_{late} P_{12} U_{early} |\vec{0}\rangle\). The second error \(Q_{03}\) is applied after this. The total effective error operator acting on the ideal state \(|\Psi_{ideal}\rangle\) is \(E_{P,Q} = Q_{03} (U_{late} P_{12} U_{late}^\dagger)\).
Let’s simplify the conjugated operator \(U_{late} P_{12} U_{late}^\dagger = (U_{C03}U_{H0}) P_{12} (U_{H0}^\dagger U_{C03}^\dagger)\).
Since \(U_{H0}\) acts on qubit 0 and \(P_{12}\) acts on qubits (1,2), they commute: \(U_{H0} P_{12} U_{H0}^\dagger = P_{12}\).
Similarly, \(U_{C03}\) acts on qubits (0,3) and \(P_{12}\) acts on qubits (1,2), so they commute: \(U_{C03} P_{12} U_{C03}^\dagger = P_{12}\).
Thus, the effective error operator is simply \(E_{P,Q} = Q_{03} P_{12}\). This is a Pauli operator that is a tensor product of a Pauli on (0,3) and a Pauli on (1,2).
Step 3: Characterize Detectable and Undetectable Errors
An error \(E\) is detectable if it anticommutes with at least one stabilizer. It is undetectable if it commutes with all stabilizers.
\[
[E, S_1] = [E, XXXX] = 0
\]
\[
[E, S_2] = [E, ZZZZ] = 0
\]
Let \(E = P_0P_1P_2P_3\) be a 4-qubit Pauli string.
- \([E, XXXX]=0\) if \(E\) has an even number of Paulis from \(\{Y, Z\}\) (i.e., Paulis that anticommute with \(X\)). Let \(w_Z(E)\) be this number. So, \(w_Z(E)\) must be even.
- \([E, ZZZZ]=0\) if \(E\) has an even number of Paulis from \(\{X, Y\}\) (i.e., Paulis that anticommute with \(Z\)). Let \(w_X(E)\) be this number. So, \(w_X(E)\) must be even.
For our effective error \(E = Q_{03}P_{12}\), the weights are additive: \(w_Z(E) = w_Z(Q_{03}) + w_Z(P_{12})\) and \(w_X(E) = w_X(Q_{03}) + w_X(P_{12})\).
So, an error \((Q_{03}, P_{12})\) is undetectable if and only if:
- \(w_Z(Q_{03}) + w_Z(P_{12})\) is even \(\iff w_Z(Q_{03}) \equiv w_Z(P_{12}) \pmod 2\).
- \(w_X(Q_{03}) + w_X(P_{12})\) is even \(\iff w_X(Q_{03}) \equiv w_X(P_{12}) \pmod 2\).
The condition is that \(Q_{03}\) and \(P_{12}\) must have the same weight parity pair \((w_X \pmod 2, w_Z \pmod 2)\).
Let’s classify the 16 two-qubit Pauli operators based on their weight parity:
- Parity (0,0) (\(w_X\) even, \(w_Z\) even): \(\{II, XX, ZZ, YY\}\). There are 4 such operators.
- Parity (0,1) (\(w_X\) even, \(w_Z\) odd): \(\{IZ, ZI, XY, YX\}\). There are 4 such operators.
- Parity (1,0) (\(w_X\) odd, \(w_Z\) even): \(\{IX, XI, ZY, YZ\}\). There are 4 such operators.
- Parity (1,1) (\(w_X\) odd, \(w_Z\) odd): \(\{IY, YI, XZ, ZX\}\). There are 4 such operators.
Step 4: Calculate the Success Probability \(P_{success}\)
The success probability is the total probability of all undetectable error events. An error event is defined by the pair of Paulis \((P_{12}, Q_{03})\).
\[
P_{success} = \sum_{P_{12}, Q_{03}} \text{Prob}(P_{12}, Q_{03}) \cdot \mathbb{I}[(P_{12}, Q_{03}) \text{ is undetectable}]
\]
where \(\mathbb{I}\) is the indicator function. The probability of a specific pair of non-identity errors is \((p/15)^2\), a single error is \(p(1-p)/15\), and no error is \((1-p)^2\).
We sum over four cases:
- No error: \(P_{12}=II, Q_{03}=II\). Parity of both is (0,0), so they match. Undetectable.
Probability: \((1-p)^2\).
- Error at first CNOT only: \(P_{12} \neq II, Q_{03}=II\). Parity of \(Q_{03}=II\) is (0,0). For the error to be undetectable, \(P_{12}\) must also have parity (0,0). There are 3 such non-identity operators: \(\{XX, ZZ, YY\}\) on qubits (1,2).
Probability: \(3 \times \frac{p(1-p)}{15} = \frac{p(1-p)}{5}\).
- Error at second CNOT only: \(P_{12} = II, Q_{03} \neq II\). Similar to case 2, there are 3 undetectable non-identity errors for \(Q_{03}\).
Probability: \(3 \times \frac{p(1-p)}{15} = \frac{p(1-p)}{5}\).
- Errors at both CNOTs: \(P_{12} \neq II, Q_{03} \neq II\). The error is undetectable if \(P_{12}\) and \(Q_{03}\) have the same weight parity.
- Parity (0,0): 3 choices for \(P_{12}\), 3 for \(Q_{03}\). Total \(3 \times 3 = 9\) pairs.
- Parity (0,1): 4 choices for \(P_{12}\), 4 for \(Q_{03}\). Total \(4 \times 4 = 16\) pairs.
- Parity (1,0): 4 choices for \(P_{12}\), 4 for \(Q_{03}\). Total \(4 \times 4 = 16\) pairs.
- Parity (1,1): 4 choices for \(P_{12}\), 4 for \(Q_{03}\). Total \(4 \times 4 = 16\) pairs.
Total number of undetectable pairs is \(9+16+16+16 = 57\).
Probability: \(57 \times \left(\frac{p}{15}\right)^2 = \frac{57 p^2}{225} = \frac{19 p^2}{75}\).
Summing all contributions to find the total success probability:
\[
P_{success}(p) = (1-p)^2 + \frac{p(1-p)}{5} + \frac{p(1-p)}{5} + \frac{19}{75}p^2
\]
\[
P_{success}(p) = (1 - 2p + p^2) + \frac{2}{5}(p - p^2) + \frac{19}{75}p^2
\]
\[
P_{success}(p) = 1 + (-2 + \frac{2}{5})p + (1 - \frac{2}{5} + \frac{19}{75})p^2
\]
\[
P_{success}(p) = 1 - \frac{8}{5}p + \left(\frac{75 - 30 + 19}{75}\right)p^2
\]
\[
P_{success}(p) = 1 - \frac{8}{5}p + \frac{64}{75}p^2
\]
Step 5: Calculate the Final Logical Fidelity
Now we combine the results using the formula \(F_L = F_{phys} / P_{success}\).
\[
F_{phys}(p) = \left(1 - \frac{4}{5}p\right)^2 = 1 - \frac{8}{5}p + \frac{16}{25}p^2
\]
\[
P_{success}(p) = 1 - \frac{8}{5}p + \frac{64}{75}p^2
\]
The logical state fidelity 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}
\]
We can also write this with a common denominator:
\[
F_L(p) = \frac{1 - \frac{8}{5}p + \frac{48}{75}p^2}{1 - \frac{8}{5}p + \frac{64}{75}p^2}
\]
For small \(p\), the infidelity \(1 - F_L(p)\) is:
\[
1 - F_L(p) = 1 - \frac{1 - \frac{8}{5}p + \frac{48}{75}p^2}{1 - \frac{8}{5}p + \frac{64}{75}p^2} = \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} \approx \frac{16}{75}p^2
\]
This shows the logical error is suppressed to second order in \(p\), which is characteristic of an error detection code.
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}
\]