1) Step-by-Step Derivation
-
Setup, code and circuit
-
[[4,2,2]] code: stabilizers S = ⟨XXXX, ZZZZ⟩. The codespace is the simultaneous +1 eigenspace of these two commuting generators. (ar5iv.labs.arxiv.org, en.wikipedia.org)
- Logical GHZ target on logical qubits A,B: (|00⟩AB + |11⟩AB)/√2.
-
Circuit (right-to-left action): H2 → CNOT21 → H0 → CNOT03 on input |0000⟩.
-
Ideal output state of the circuit
Apply H and CNOT pairwise:
1) H2; CNOT21 prepares a Bell pair on qubits (2,1): |Φ+⟩12.
2) H0; CNOT03 prepares another Bell pair on qubits (0,3): |Φ+⟩03.
Therefore the ideal 4-qubit output is
\[
\]
The Bell state |Φ+⟩ is stabilized by XX and ZZ (equivalently by {II, XX, ZZ, −YY} with generators XX, ZZ). Hence
\[
(X_0X_3X_1X_2)|\psi_{\text{ideal}}\rangle=(X^{\otimes 4})|\psi_{\text{ideal}}\rangle=|\psi_{\text{ideal}}\rangle,
\]
\[
(Z_0Z_3Z_1Z_2)|\psi_{\text{ideal}}\rangle=(Z^{\otimes 4})|\psi_{\text{ideal}}\rangle=|\psi_{\text{ideal}}\rangle,
\]
so the state lies in the [[4,2,2]] codespace. (en.wikipedia.org, medium.com, errorcorrectionzoo.org)
Each CNOT gate is followed by an independent two-qubit depolarizing channel on the same two qubits that, with probability p, applies one of the 15 non-identity two-qubit Pauli operators uniformly (probability p/15 each), and with probability 1−p applies identity. This is the standard “Pauli version” of a two-qubit depolarizing channel. (en.wikipedia.org, quantumchannelzoo.org)
Since the only two-qubit gates are CNOT21 and CNOT03 and the errors occur after these gates, the final error has the form
\[
E = P_{03}\otimes Q_{12},
\]
where each of P03, Q12 ∈ {II, IX, IY, IZ, XI, …, ZZ} and independently equals II with probability 1−p and any non-identity two-qubit Pauli with probability p/15.
- Post-selection (“detect and discard”)
We post-select on the “no-error-detected” syndrome, i.e., both stabilizer measurements XXXX and ZZZZ return +1. For a Pauli error E, this occurs iff E commutes with both stabilizer generators; otherwise it anticommutes with at least one and is rejected. (learning.quantum.ibm.com, en.wikipedia.org)
- Commutation bookkeeping by parity classes
For a two-qubit Pauli on a pair (say, qubits a,b), define the parity vector
\[
\pi(P_{ab})=\big(\pi_Z(P_{ab}),\,\pi_X(P_{ab})\big)\in\{0,1\}^2,
\]
where πZ(Pab) is 1 iff Pab anticommutes with Z⊗Z on that pair, and πX(Pab) is 1 iff Pab anticommutes with X⊗X on that pair.
Using the binary (symplectic) representation of Paulis, the parity components are just the XOR of the single-qubit “Z-part” and “X-part” bits across the two sites. Concretely, for single-qubit L∈{I,X,Y,Z}, write bits b(L)=(vZ,vX) with
I:(0,0), X:(0,1), Y:(1,1), Z:(1,0). Then for a pair Pab = La⊗Lb,
\[
\pi(P_{ab}) = b(L_a)\oplus b(L_b).
\]
The full 4-qubit error E = P03⊗Q12 commutes with X⊗4 (resp. Z⊗4) iff the X-parities (resp. Z-parities) of the two pairs match. Thus,
\[
E\ \text{is accepted} \iff \pi(P_{03})=\pi(Q_{12}).
\]
This parity/symplectic-commutation correspondence is standard in stabilizer theory. (en.wikipedia.org)
- Enumerating parity classes on one pair
The 15 non-identity two-qubit Paulis on a given pair split into four parity classes:
\[
\text{class} & \# \\
\hline
\pi=(0,0)\ \text{(commutes with both XX, ZZ)} & 3\ \ (\{XX,YY,ZZ\})\\
\pi=(0,1) & 4\\
\pi=(1,0) & 4\\
\pi=(1,1) & 4
\]
(Easy to check by the XOR rule, or by listing.) The class (0,0) is exactly the nontrivial stabilizer of |Φ+⟩ on that pair, so acting with any of {XX,YY,ZZ} maps |Φ+⟩ to ±|Φ+⟩. (medium.com)
- Which accepted errors are “good” (i.e., preserve the target state)?
Since the ideal state is |Φ+⟩03⊗|Φ+⟩12 and the 16 Bell-product states form an orthonormal basis, an accepted error E has nonzero overlap with the target if and only if it preserves each pair’s |Φ+⟩ up to a global phase; otherwise it maps at least one pair to a different Bell state orthogonal to |Φ+⟩, yielding zero overlap. Therefore:
- On a single pair, “good” non-identity Paulis are exactly {XX,YY,ZZ}, i.e., class (0,0).
- For the full error E = P03⊗Q12,
- Acceptance requires π(P03)=π(Q12).
- Goodness (nonzero overlap) requires P03∈{XX,YY,ZZ} and Q12∈{XX,YY,ZZ}.
Hence among accepted double errors, only the 3×3=9 choices are good; the other accepted classes (matching non-(0,0) parities) are logical errors that change the encoded state within the codespace. (medium.com)
- Counting accepted vs. good events by error weight
Let “weight” mean how many gates suffered a non-identity two-qubit Pauli.
- Weight 0: probability (1−p)^2. Accepted and good.
- Weight 1: exactly one of the two gates has a non-identity 2-qubit Pauli.
- Acceptance requires that single-pair error be in class (0,0), i.e., one of {XX,YY,ZZ}. Count per gate = 3 of the 15 possibilities; with two gates total, accepted singles = 2×3.
- All such singles are good because {XX,YY,ZZ} stabilizes |Φ+⟩ on that pair.
Probability contribution: 2·(p/15)·(1−p)·3 = (6/15)p(1−p). Accepted = good.
- Weight 2: both gates have non-identity 2-qubit Paulis.
- Acceptance requires parity match across pairs. Using the class counts above,
total accepted ordered pairs =
3·3 + 4·4 + 4·4 + 4·4 = 9 + 16 + 16 + 16 = 57.
- Good among these are exactly 3·3 = 9 (both in class (0,0)).
Probability contribution: (p/15)^2 times the respective counts.
Therefore
\[
P_{\text{acc}}(p) &= (1-p)^2 + \frac{6}{15}p(1-p) + \frac{57}{15^2}p^2,\\
P_{\text{good}}(p) &= (1-p)^2 + \frac{6}{15}p(1-p) + \frac{9}{15^2}p^2.
\]
- Logical-state fidelity under post-selection
Conditioning on acceptance, the (normalized) post-selected state is a classical mixture over accepted Pauli-error images. The only terms with nonzero overlap with |ψideal⟩ are the “good” ones above; all other accepted terms are orthogonal (they are other Bell-product basis states). Hence the logical-state fidelity equals the good fraction of accepted shots:
\[
F_{\text{logical}}(p)=\frac{P_{\text{good}}(p)}{P_{\text{acc}}(p)}.
\]
Plugging in and simplifying,
\[
F_{\text{logical}}(p)
&= \frac{(1-p)^2 + \frac{6}{15}p(1-p) + \frac{9}{225}p^2}
{(1-p)^2 + \frac{6}{15}p(1-p) + \frac{57}{225}p^2}\\[2mm]
&= \frac{75 - 120p + 48p^2}{75 - 120p + 64p^2}.
\]
Series at small p: \(F_{\text{logical}}(p)=1 - \frac{16}{75}p^2 + O(p^3)\), i.e., all single-gate errors are detected and discarded; logical infidelity appears only at order p^2.
2) Mathematical Typesetting
- All key relations shown above in LaTeX.
3) Conventions and Units
- Qubits labeled 0,1,2,3; stabilizers XXXX and ZZZZ; Bell-state facts (stabilizers XX, ZZ) and stabilizer-code detection rule (anticommute ⇒ detected) used as standard. (medium.com, learning.quantum.ibm.com)
4) Final Answer:
\[
F_{\text{logical}}(p)=\frac{75 - 120\,p + 48\,p^2}{75 - 120\,p + 64\,p^2}.
\]
This satisfies Flogical(0)=1 and, to lowest order, 1−Flogical(p)=\tfrac{16}{75}p^2+O(p^3).