Checkpoint-2

System #0

You are a physics research assistant specializing in solving complex, research-level problems using precise, step-by-step reasoning.

Input Problems will be provided in Markdown format.

Output (Markdown format)

  1. Step-by-Step Derivation - Show every non-trivial step in the solution. Justify steps using relevant physical laws, theorems, or mathematical identities.
  2. Mathematical Typesetting - Use LaTeX for all mathematics: $...$ for inline expressions, $$...$$ for display equations.
  3. Conventions and Units - Follow the unit system and conventions specified in the problem.
  4. Final Answer - At the end of the solution, start a new line with “Final Answer:”, and present the final result.

    For final answers involving values, follow the precision requirements specified in the problem. If no precision is specified: - If an exact value is possible, provide it (e.g., \$\sqrt(2)\$, \$\pi/4\$). - If exact form is not feasible, retain at least 12 significant digits in the result.

  5. Formatting Compliance - If the user requests a specific output format (e.g., code, table), provide the final answer accordingly.

User #1

Problem setup:

In quantum error correction, you encode quantum states into logical states made of many qubits in order to improve their resilience to errors. In quantum error detection, you do the same but can only detect the presence of errors and not correct them. In this problem, we will consider a single [[4,2,2]] quantum error detection code, which encodes two logical qubits into four physical qubits, and investigate how robust logical quantum operations in this code are to quantum errors.

Our convention is that the four physical qubits in the [[4,2,2]] code are labelled 0,1,2,3. The two logical qubits are labelled A and B. The stabilizers are \(XXXX\) and \(ZZZZ\), where \(X\) and \(Z\) are Pauli matrices. The logical \(X\) and \(Z\) operators on the two qubits are \(X_A = XIXI\), \(X_B=XXII\), \(Z_A = ZZII\), \(Z_B = ZIZI\), up to multiplication by stabilizers.

We will consider different state preparation circuits consisting of controlled not \(CNOT_{ij}\) gates, where \(CNOT_{ij}\) has control qubit \(i\) and target qubit \(j\). As a simple model of quantum errors in hardware, we will suppose that each \(CNOT_{ij}\) gate in the circuit has a two qubit depolarizing error channel following it that produces one of the 15 non-identity two-qubit Paulis with equal probability \(p/15\). The probability \(p\) indicates the probability of an error in a single two-qubit gate. We will assess the logical infidelity of certain state preparation protocols as a function of the physical infidelity \(p\).

Checkpoints

Checkpoint 1

Suppose that we wish to prepare a logical two-qubit GHZ state \((|00\rangle_{AB}+|11\rangle_{AB})/\sqrt{2}\) in the [[4,2,2]] code. To do so, we use the following state preparation circuit:

\[ (CNOT_{03}) (H_0) (CNOT_{21}) (H_2). \]

Note that this equation is written in matrix multiplication order, while the quantum operations in the circuit occur in the reverse order (from right-to-left in the above equation). \(H\) is a single-qubit Hadamard gate.

What is the physical state fidelity of the final physical 4-qubit state at the end of the circuit as a function of the two-qubit gate error rate \(p\)?

Assistant #2
Reasoning (model)

We are given: “Suppose that we wish to prepare a logical two-qubit GHZ state \((|00\rangle_{AB}+|11\rangle_{AB})/\sqrt{2}\) in the [[4,2,2]] code. To do so, we use the following state preparation circuit:

\[ (CNOT_{03}) (H_0) (CNOT_{21}) (H_2). \]

Note: This equation is written in matrix multiplication order, while the quantum operations in the circuit occur in the reverse order (from right-to-left in the above equation). \(H\) is a single-qubit Hadamard gate.

What is the physical state fidelity of the final physical 4-qubit state at the end of the circuit as a function of the two-qubit gate error rate \(p\)?”

Interpretation: We have a circuit that prepares a logical state. But then we are adding errors: Each CNOT gate is followed by a two-qubit depolarizing error channel that produces one of the 15 non-identity two-qubit Paulis with equal probability p/15. So there are two CNOT gates: CNOT_{21} and CNOT_{03}. Also there are Hadamard gates: H_0 and H_2. But note: The problem says: “each CNOT_{ij} gate in the circuit has a two qubit depolarizing error channel following it”. So only CNOT gates get errors? Possibly the Hadamard gates are error-free? The problem statement: “As a simple model of quantum errors in hardware, we will suppose that each CNOT_{ij} gate in the circuit has a two qubit depolarizing error channel following it that produces one of the 15 non-identity two-qubit Paulis with equal probability p/15.” So only CNOT gates have errors. So H gates are perfect.

So circuit: The operations in order (from right to left as per note: “the quantum operations in the circuit occur in the reverse order (from right-to-left in the above equation)”. So the circuit order is: Step 1: H_2 Step 2: CNOT_{21} Step 3: H_0 Step 4: CNOT_{03}

But careful: The equation is: (CNOT_{03}) (H_0) (CNOT_{21}) (H_2). That is matrix multiplication order. So the actual circuit order: first apply H_2, then CNOT_{21}, then H_0, then CNOT_{03}. So that is the order.

We want: “What is the physical state fidelity of the final physical 4-qubit state at the end of the circuit as a function of the two-qubit gate error rate p?” That means: The ideal final state (without errors) is some state. But due to errors on CNOT gates, the actual state becomes a mixture. The fidelity is the overlap between the ideal state and the actual state. But careful: “physical state fidelity” likely means the fidelity of the output state relative to the ideal state. But the output state is a density matrix due to errors. And we want the average fidelity? Possibly: The circuit is applied to initial state? Usually initial state is |0000>? But not explicitly stated. But likely: The initial state is |0000>? Because we are preparing a state. So initial state: |0> on all qubits? Typically yes. So initial state: |0\rangle^{\otimes 4}.

Then ideal circuit: H_2 on qubit 2: becomes: |0\rangle on qubits 0,1,3 and on qubit 2: H|0> = |+> = (|0>+|1>)/√2. So state: |0>0 |0>_1 (|0>+|1>)_2/√2 |0>_3. Then CNOT{21}: control qubit 2, target qubit 1. So then state: If qubit2 is 0, then qubit1 remains 0; if qubit2 is 1, then qubit1 flips. So state becomes: |0>0 (|00>+|11>)_21/√2 |0>_3? But careful: Actually: State: |0>_0 βŠ— (|0>_1|0>_2 + |0>_1|1>_2? Actually: Initially: |0>_1 and |+>_2 = (|0>+|1>)/√2. So state = |0>_0 βŠ— |0>_1 βŠ— (|0>_2+|1>_2)/√2 βŠ— |0>_3. After CNOT{21} (control=2, target=1): When qubit2=0, then qubit1 remains 0; when qubit2=1, then qubit1 becomes 1. So state becomes: |0>0 βŠ— (|0>_1|0>_2 + |1>_1|1>_2)/√2 βŠ— |0>_3. So state: (|0000> + |0110>)? Actually careful: qubits: 0,1,2,3. So: |0>_0, then qubit1 and qubit2: |00> and |11>, and qubit3: |0>. So state = (|0>_0|00>_12|0>_3 + |0>_0|11>_12|0>_3)/√2 = (|0000> + |0110>)/√2? But wait: labeling: qubit0, qubit1, qubit2, qubit3. So |0000> means qubit0=0, qubit1=0, qubit2=0, qubit3=0. And |0110> means qubit0=0, qubit1=1, qubit2=1, qubit3=0. So that is state. Then H_0: Hadamard on qubit0. So H|0> = |+> = (|0>+|1>)/√2. So state becomes: H_0 applied: State = (1/√2) * [ (|0>_0+|1>_0)/√2 |00>_12|0>_3 + (|0>_0+|1>_0)/√2 |11>_12|0>_3 ]? Actually careful: H_0 acts on qubit0. So: Before: |ψ> = (|0>_0|00>_12|0>_3 + |0>_0|11>_12|0>_3)/√2. After H_0: becomes: (H|0>_0|00>_12|0>_3 + H|0>_0|11>_12|0>_3)/√2 = (|+>_0|00>_12|0>_3 + |+>_0|11>_12|0>_3)/√2 = (1/√2)[ (|0>+|1>)_0/√2 (|00>_12|0>_3 + |11>_12|0>_3) ] = (1/2)[ |0>_0(|00>_12+|11>_12)|0>_3 + |1>_0(|00>_12+|11>_12)|0>_3 ]. So state = (|0>_0 + |1>_0)/2 * (|00>_12+|11>_12)|0>_3? Actually careful: It is: = 1/2 [ |0>_0|00>_12|0>_3 + |0>_0|11>_12|0>_3 + |1>_0|00>_12|0>_3 + |1>_0|11>_12|0>_3 ]. So state = (|0000> + |0110> + |1000> + |1110>)/2. Then CNOT{03}: control qubit 0, target qubit 3. So apply CNOT_{03}: For terms: |0000>: control=0 so target qubit3 flips? Actually control: if qubit0=1 then flip qubit3. So: |0000> -> |0000> because qubit0=0. |0110> -> |0110> because qubit0=0. |1000> -> qubit0=1 so flip qubit3: becomes |1001>. |1110> -> becomes |1111>. So final ideal state: |ψ_ideal> = (|0000> + |0110> + |1001> + |1111>)/2. But wait: Is that the logical GHZ state? The logical GHZ state for two qubits A and B is (|00>_AB + |11>_AB)/√2. But here we have 4 physical qubits. And the code is [[4,2,2]]. And the logical operators are given: X_A = XIXI, X_B=XXII, Z_A=ZZII, Z_B=ZIZI. So what are the logical basis states? They are encoded such that they are stabilized by XXXX and ZZZZ. So the code space is the subspace of 4 qubits that are +1 eigenvectors of XXXX and ZZZZ. Our state: |ψ_ideal> = (|0000>+|0110>+|1001>+|1111>)/2. Check: Apply XXXX: XXXX|0000> = |1111>? Actually XXXX on |0000> gives |1111> because flip all bits. So that is not an eigenvector unless coefficients match. But here: XXXX|ψ> = (|1111>+|1001>+|0110>+|0000>)/2 = same as |ψ>? Actually order: |ψ> = (|0000> + |0110> + |1001> + |1111>)/2. XXXX|ψ> = (XXXX|0000> + XXXX|0110> + XXXX|1001> + XXXX|1111>)/2 = (|1111> + |1001> + |0110> + |0000>)/2 = same. So it is symmetric. And ZZZZ: ZZZZ|ψ> = (1 +? Actually ZZZZ on each basis: |0000>: all zeros, so eigenvalue +1. |0110>: qubits: 0,1,1,0. Z on each: gives phases: qubit0: +1, qubit1: -1, qubit2: -1, qubit3: +1, product = +1. |1001>: qubits: 1,0,0,1: phases: -1, +1, +1, -1 = +1. |1111>: all ones: product of -1’s: (-1)^4 = +1. So indeed it is in the code space. And then what are the logical states? The logical operators: X_A = XIXI. Apply X_A to |ψ>: X_A|0000> = |0100>? That is not in the basis. But maybe we don’t need to check. But the problem says: “logical two-qubit GHZ state (|00>_AB+|11>_AB)/√2”. So that state is indeed an entangled state between the two logical qubits. So it’s fine.

So ideal state: |ψ_ideal> = (|0000>+|0110>+|1001>+|1111>)/2.

Now, we have errors on CNOT gates. There are two CNOT gates: CNOT_{21} and CNOT_{03}. Each CNOT gate is followed by a depolarizing error channel on the two qubits involved. That error channel: With probability 1-p, no error. With probability p, an error occurs. And if an error occurs, it is uniformly distributed among the 15 non-identity two-qubit Pauli operators on those two qubits. So each CNOT gate’s error channel: After applying CNOT, then apply with probability p/15 each of the 15 Paulis on the two qubits (the ones that are involved in the CNOT). But careful: The error channel is applied after the CNOT gate. So the overall circuit with errors: Start with |0000>. Apply H_2 (perfect). Then apply CNOT_{21} (perfect) followed by error channel on qubits 2 and 1. That error channel: It applies a Pauli error E from the set {I, X, Y, Z} βŠ— {I, X, Y, Z} minus identity? Actually: “produces one of the 15 non-identity two-qubit Paulis with equal probability p/15.” So actually it is: With probability 1-p, no error (IβŠ—I). With probability p, an error from the set of 15 Paulis (all Pauli strings on two qubits except IβŠ—I) each with probability p/15. Then apply H_0 (perfect). Then apply CNOT_{03} (perfect) followed by error channel on qubits 0 and 3.

So the final state is a mixture. We want the physical state fidelity. That is: F = ⟨ψ_ideal| ρ_final |ψ_ideal⟩, where ρ_final is the density matrix after the circuit with errors. Since errors are independent on the two CNOT gates, we can compute the effect of each error channel on the ideal state preparation. But careful: The errors occur in the middle of the circuit. So the final state is not simply the ideal state with some Pauli errors applied? But we can compute the entire process as a quantum channel. Alternatively, we can compute the fidelity as: The probability that no error occurs that takes the state out of the ideal state? But careful: Some errors might be correctable? But here we are not correcting errors; we are just computing the fidelity of the output state relative to the ideal state. And the errors are Pauli errors. And the circuit is Clifford? Actually, the circuit consists of Hadamard and CNOT. So it is a Clifford circuit. And the initial state is |0>^4. So the entire process is a Clifford circuit. And the errors are Pauli errors. So the final state is a mixture of states that are Pauli errors applied to the ideal state? But careful: The errors occur at different times. But because the circuit is Clifford, the effect of a Pauli error at some point can be propagated through the subsequent gates. That is a common technique: Instead of applying errors on the state, we can push them to the end as Pauli errors on the initial state? But here the errors are applied after gates. But we can use the fact that if we have a Clifford circuit U, and an error E occurs after some gate, then U E = (U E U^\dagger) U. So the overall effect is that the error becomes a Pauli error at the beginning? But careful: The errors are applied in between gates. So let’s denote the circuit as: U = U4 * U3 * U2 * U1, where: U1 = H_2 U2 = CNOT_{21} U3 = H_0 U4 = CNOT_{03} But then errors: After U2, we have error channel on qubits {2,1}. After U4, we have error channel on qubits {0,3}. So the actual operation is: ρ = E_{03} ∘ U4 ∘ E_{21} ∘ U2 ∘ U1 (|0><0|) but careful: There is also U3 = H_0 in between. Actually order: Step 1: U1 = H_2 Step 2: U2 = CNOT_{21} Step 3: Error channel on qubits {2,1} (call it E_{21}) Step 4: U3 = H_0 Step 5: U4 = CNOT_{03} Step 6: Error channel on qubits {0,3} (call it E_{03}) So overall: ρ = (E_{03} ∘ U4 ∘ U3 ∘ E_{21} ∘ U2 ∘ U1)(|0><0|) but careful: The error channel E_{21} is applied after U2, so it is: U2 then E_{21} then U3 then U4 then E_{03}. So overall unitary part: U = U4 U3 U2 U1. And then errors: They are not necessarily at the end because they are conjugated by subsequent gates. But we can push them to the end. Specifically, if we have an error E acting on some qubits after a unitary V, then the overall effect is: V E = (V E V^\dagger) V. So if we have a sequence: … V, then error E, then W, then we can write: W (V E) = W V E = (W V E V^\dagger W^\dagger) W V. So indeed, we can push errors to the end. So let’s do that. We have: U_total = U4 U3 U2 U1. But errors: After U2, we have error E (on qubits 1,2). Then U3 and U4 follow. So that error becomes: U4 U3 E U3^\dagger U4^\dagger? Actually careful: The circuit is: U4 * U3 * (error E on qubits {1,2}) * U2 * U1. So that is equivalent to: (U4 U3 E U3^\dagger U4^\dagger) * (U4 U3 U2 U1) = E’ * U_total, where E’ = U4 U3 E U3^\dagger U4^\dagger. And then after U4, we have error F on qubits {0,3}. That is already at the end? Actually: The circuit: U4, then error F on {0,3}. So that is: F * U4. But then combined with the previous part: Actually careful: The full circuit with errors: ρ = (F ∘ U4) ∘ (U3) ∘ (E ∘ U2) ∘ (U1) (|0><0|). But note: U3 is a unitary that does not have an error after it? Actually, the error after U2 is applied before U3. So it is: U4 * (error F on {0,3})? Actually, wait: The order is: Start: |ψ0> = |0000>. Apply U1 = H_2. Apply U2 = CNOT_{21}. Then apply error channel on qubits {2,1} (call it E_{21}). Then apply U3 = H_0. Then apply U4 = CNOT_{03}. Then apply error channel on qubits {0,3} (call it E_{03}). So if we denote the perfect unitary as U = U4 U3 U2 U1, then the actual operation is: ρ = E_{03} ( U4 ( U3 ( E_{21} ( U2 ( U1 (|0><0|) U1^\dagger ) U2^\dagger ) U3^\dagger ) U4^\dagger ) ) But we can push the error E_{21} through U3 and U4. As said: U4 U3 E_{21} = (U4 U3 E_{21} U3^\dagger U4^\dagger) U4 U3. So then the overall becomes: ρ = E_{03} ( (U4 U3 E_{21} U3^\dagger U4^\dagger) U4 U3 U2 U1 (|0><0|) … ) but careful with order: Actually, let’s do it step by step: We have: ρ = E_{03} ∘ (U4) ∘ (U3) ∘ (E_{21}) ∘ (U2) ∘ (U1) (ρ0). Define V = U3 U2 U1. Then ρ = E_{03} ∘ (U4) ∘ (E_{21}) ∘ (V) (ρ0)? Not exactly because U3 is after E_{21}? Actually: The order is: U1, then U2, then E_{21}, then U3, then U4, then E_{03}. So if we combine U3 U2 U1 = V, then careful: That would be if E_{21} was after U3? Actually, no: It is: U1, U2, E_{21}, U3, U4, E_{03}. So if I define V = U3 U2 U1, then the order is: U1, U2, then E_{21}, then U3, then U4, then E_{03} = (U4 U3) (E_{21}) (U2 U1) but then that is not simply V because V = U3 U2 U1, so U4 U3 = U4 * U3, and U2 U1 is part of V but then U3 is separate. Actually, it’s easier: Push E_{21} through U3 and U4. Write the entire unitary part as U = U4 U3 U2 U1. Then note that: U4 U3 E_{21} U2 U1 = U4 U3 E_{21} (U3^\dagger U4^\dagger) (U4 U3 U2 U1) = (U4 U3 E_{21} U3^\dagger U4^\dagger) U. So indeed, the effect of the error E_{21} (which acts on qubits 1,2) becomes, after pushing through U3 and U4, an error E’ = U4 U3 E_{21} U3^\dagger U4^\dagger that acts on the state at the end (after U). But careful: There is also the error E_{03} at the very end. So overall, the actual state is: ρ = (E_{03} ∘ (E’))( U ρ0 U^\dagger ) where E’ is the channel that applies the error E (from the set of Paulis on qubits {1,2}) transformed by U4 U3. But wait: But then note: E_{21} is a probabilistic application of Paulis on qubits 1 and 2. And then E’ will be some Pauli on some qubits? Since U4 and U3 are Clifford gates, they map Paulis to Paulis. So E’ will be a Pauli operator on some set of qubits. Let’s compute that transformation. We have: U3 = H_0. U4 = CNOT_{03}. And E is a Pauli on qubits {1,2}? Actually, careful: E_{21} acts on qubits 2 and 1. But note: qubits are labeled: 0,1,2,3. So E_{21} acts on qubit2 and qubit1. Under U3 = H_0, that does nothing to qubits 1,2 because H_0 only acts on qubit0. So U3 E_{21} U3^\dagger = E_{21} because E_{21} commutes with H_0? Actually, check: H_0 acts on qubit0. E_{21} acts on qubits 1 and 2. They act on different qubits, so they commute. So then U4 U3 E_{21} U3^\dagger U4^\dagger = U4 E_{21} U4^\dagger. And U4 = CNOT_{03}. That acts on qubits 0 and 3. So it will commute with operators on qubits 1 and 2? Actually, careful: CNOT_{03} acts on qubit0 and qubit3. Operators on qubits 1 and 2 commute with CNOT_{03} if they are Paulis? Actually, Pauli operators on qubits 1 and 2 commute with CNOT_{03} because they act on different qubits. So indeed, U4 E_{21} U4^\dagger = E_{21} because E_{21} acts on qubits 1 and 2, and CNOT_{03} acts on qubits 0 and 3, so they commute. Wait, check: For example, if E_{21} = X_2, then CNOT_{03} X_2 = X_2 CNOT_{03} because CNOT_{03} only involves qubits 0 and 3. So yes, they commute. So actually, E’ = E_{21} itself. That is interesting: The error on the first CNOT (on qubits 1,2), when pushed through the subsequent gates (H_0 and CNOT_{03}), remains as the same Pauli error on qubits 1 and 2. So then the overall effect is: The actual state is as if we applied the perfect unitary U, and then we apply two independent error channels: one on qubits {1,2} from the first CNOT error, and one on qubits {0,3} from the second CNOT error. But wait: Is that correct? Let’s check manually: The circuit: H_2, then CNOT_{21}, then error on {1,2}, then H_0, then CNOT_{03}, then error on {0,3}. If we push the error on {1,2} through H_0 and CNOT_{03}, since these gates act on qubits 0 and 3, they commute with any operator on qubits 1 and 2. So indeed, we can move that error to after the CNOT_{03} gate. So then the circuit becomes: H_2, CNOT_{21}, H_0, CNOT_{03}, then error on {1,2} (from first CNOT error) and then error on {0,3} (from second CNOT error). And note that the order of these two errors doesn’t matter because they act on disjoint sets of qubits. So indeed, the overall process is: Ideal unitary U (which prepares the ideal state |ψ_ideal>) and then two independent error channels: one on qubits {1,2} and one on qubits {0,3}. And these error channels are: For qubits {1,2}: With probability 1-p, identity; with probability p, a random non-identity Pauli on qubits 1 and 2 (each of the 15 equally likely). For qubits {0,3}: Similarly.

So then the final state ρ is: ρ = (E_{03} βŠ— E_{21}) ( |ψ_ideal><ψ_ideal| ) where E_{03} and E_{21} are the depolarizing channels on those pairs. But careful: The error channels are applied independently. So the overall channel is: ρ = (1-p)^2 |ψ_ideal><ψ_ideal| + (1-p)p/15 * (sum over non-identity Paulis on {0,3}) applied to |ψ_ideal><ψ_ideal| + p(1-p)/15 * (sum over non-identity Paulis on {1,2}) + (p/15)^2 * (sum over pairs of non-identity Paulis on both sets) applied.

But wait: There is also possibility that both errors occur? But that is included: probability p^2 that both errors occur, but then each error is one of 15, so total probability for a specific pair is p^2/225.

So then the fidelity F = <ψ_ideal| ρ |ψ_ideal>. That equals: F = (1-p)^2 * 1 + (1-p)*p/15 * (sum over E on {0,3} non-identity: <ψ_ideal| E |ψ_ideal>? But careful: The channel: For a given Pauli error E (on a specific set), the state becomes: with probability (p/15), we get E |ψ_ideal><ψ_ideal| E^\dagger. So then the overlap with |ψ_ideal> is |<ψ_ideal| E |ψ_ideal>|^2. But note: |ψ_ideal> is a state. And E is a Pauli operator. So <ψ_ideal| E |ψ_ideal> is either 0 or 1? Actually, Pauli operators are Hermitian and unitary. And |ψ_ideal> is a specific state. It might be an eigenvector of some Paulis? Let’s check: |ψ_ideal> = (|0000>+|0110>+|1001>+|1111>)/2. We want to compute for a Pauli operator acting on qubits {0,3} (say) what is <ψ_ideal| P |ψ_ideal>? And similarly for Paulis on {1,2}.

So we need to compute: For each non-identity Pauli on qubits {0,3}, what is the expectation value? And for each non-identity Pauli on qubits {1,2}, what is the expectation value? And then also for products from both sets? But careful: The errors are independent. But note: The errors on {0,3} and on {1,2} act on disjoint qubits. So if we have an error E on {0,3} and F on {1,2}, then the overall error is EβŠ—F. And then the fidelity contribution is |<ψ_ideal| (EβŠ—F) |ψ_ideal>|^2. And then we sum over all such errors weighted by their probabilities.

So let’s compute these overlaps.

Let |ψ> = (|0000> + |0110> + |1001> + |1111>)/2. We want to compute for a Pauli operator P (which is a tensor product of Paulis on the four qubits, but restricted to act nontrivially only on a subset? Actually, careful: The errors are on specific sets: For the error from the first CNOT, it acts on qubits 1 and 2. So those Paulis are of the form: I βŠ— (something on qubit1) βŠ— (something on qubit2) βŠ— I. But wait: Actually, the error channel on the first CNOT is on qubits 2 and 1. But order: qubits: 0,1,2,3. So on qubits 1 and 2, the Pauli operators are: I_0 βŠ— A_1 βŠ— B_2 βŠ— I_3, where A,B ∈ {I, X, Y, Z} but not both I? Actually, the error set is all Paulis on qubits {1,2} except the identity. So there are 15 such operators. Similarly, the error from the second CNOT is on qubits {0,3}. So those are: C_0 βŠ— I_1 βŠ— I_2 βŠ— D_3, with C,D ∈ {I,X,Y,Z} and not both I.

And then also there is possibility of both errors simultaneously: That gives operators: (C_0 βŠ— I_1 βŠ— I_2 βŠ— D_3) * (I_0 βŠ— A_1 βŠ— B_2 βŠ— I_3) = C_0 βŠ— A_1 βŠ— B_2 βŠ— D_3. But note: These are not all Paulis on all 4 qubits? They are a subset of the 4-qubit Paulis that act nontrivially only on these pairs. But careful: There is also possibility that the errors from the two channels are applied? But they are independent. So indeed, the overall error channel is: With probability (1-p)^2: no error. With probability p(1-p): error only on {0,3} (15 possibilities, each probability p(1-p)/15) With probability (1-p)p: error only on {1,2} (15 possibilities, each probability p(1-p)/15) With probability p^2: error on both sets (225 possibilities, each probability p^2/225)

But wait: There is also possibility that the error from one channel is identity? But that is already included: The error channel on each CNOT gives identity with probability 1-p. So indeed.

So then fidelity F = <ψ| ρ |ψ> = (1-p)^2 * 1 + (1-p)p/15 * [ sum_{E in Paulis on {0,3} non-identity } |<ψ| E |ψ>|^2 ] + p(1-p)/15 * [ sum_{F in Paulis on {1,2} non-identity } |<ψ| F |ψ>|^2 ] + p^2/225 * [ sum_{E on {0,3} non-identity, F on {1,2} non-identity } |<ψ| E F |ψ>|^2 ]

And note: |<ψ| P |ψ>|^2 is either 0 or 1? Actually, careful: For a Pauli operator P, if |ψ> is an eigenvector of P, then <ψ|P|ψ> = Β±1, so squared is 1. If not, then it could be 0? But wait: For a Pauli operator, it要么 commutes with the state’s projector? Actually, if |ψ> is a stabilizer state, then it is an eigenvector of some Paulis. But here |ψ> is not necessarily a stabilizer state of the full Pauli group? But it is a state in the code space. Actually, |ψ> is a specific state. Let’s compute these overlaps explicitly.

We have |ψ> = (|0000> + |0110> + |1001> + |1111>)/2. Let’s denote basis states by |a b c d> where a=qubit0, b=qubit1, c=qubit2, d=qubit3. So |ψ> = (|0000> + |0110> + |1001> + |1111>)/2.

Now, consider an operator on {0,3}: That is of the form P = P_0 βŠ— I_1 βŠ— I_2 βŠ— P_3, where P_0 and P_3 are Paulis (X, Y, Z) but not both I? Actually, non-identity means that (P_0, P_3) is not (I,I). So there are 15 such operators. We want to compute <ψ| P |ψ>. P acts on qubits 0 and 3. So it will map each basis state to another basis state up to a phase. Let’s list the basis states in |ψ>: 1: |0000> 2: |0110> 3: |1001> 4: |1111> Under P, what happens? For a given P = (Οƒ, Ο„) on qubits 0 and 3, where Οƒ, Ο„ ∈ {X, Y, Z} (and not both identity, but we include all combinations? But careful: The set is: Οƒ and Ο„ can be I? But then it would be identity? Actually, the error set on {0,3} is non-identity Paulis. So Οƒ and Ο„ are such that they are not both I. But we can compute for each possibility separately.

Let’s compute for each type: We want <ψ| P |ψ> = (1/4)[ <0000| P |0000> + <0110| P |0110> + <1001| P |1001> + <1111| P |1111> ] plus cross terms? Actually careful: <ψ| P |ψ> = sum_{i,j} (1/4) where i,j are the four basis states. But since P is a Pauli operator, it will map each computational basis state to another computational basis state (possibly with a phase). So the matrix elements are diagonal only if P maps the state to itself. So we need to check: For each basis state in the support of |ψ>, what is P|state>? For state |0000>: P|0000> = (Οƒ|0>_0) βŠ— |0>_1 βŠ— |0>_2 βŠ— (Ο„|0>_3). Οƒ|0>: If Οƒ = I, then |0>. If Οƒ = X, then |1>. If Οƒ = Y, then i? Actually Y|0> = i|1>? But careful: Pauli Y is usually defined as iΟƒ_y, so Y = [[0, -i],[i, 0]]? Actually, there are conventions. But Pauli matrices are Hermitian. Typically, Pauli Y is defined as: Y = (0 -i; i 0). So then Y|0> = i|1>. But then the phase matters. But when we compute <ψ| P |ψ>, we are taking expectation value. That will be a complex number. But then we square it to get fidelity contribution? Actually, careful: The fidelity is <ψ| ρ |ψ>. And ρ is a mixture of states that are P|ψ> with some probabilities. But then <ψ| (P|ψ><ψ|P^\dagger) |ψ> = |<ψ|P|ψ>|^2. So we need the magnitude squared. So we want |<ψ|P|ψ>|^2. So we can compute the phase factors. But maybe we can determine which Paulis leave |ψ> invariant (up to a phase) and which do not. Because if P|ψ> is orthogonal to |ψ>, then <ψ|P|ψ> = 0. And if P|ψ> is proportional to |ψ>, then |<ψ|P|ψ>|^2 = 1. So we want to know: For a given Pauli P on {0,3} (non-identity), does it stabilize |ψ>? That is, is |ψ> an eigenvector of P? Similarly for Paulis on {1,2}.

Let’s check for Paulis on {0,3}: P = Οƒ_0 βŠ— I_1 βŠ— I_2 βŠ— Ο„_3. We want to see if P|ψ> = Ξ»|ψ> for some Ξ». |ψ> = (|0000> + |0110> + |1001> + |1111>)/2. Apply P: P|0000> = (Οƒ|0>)_0 βŠ— |0>_1 βŠ— |0>_2 βŠ— (Ο„|0>)_3. P|0110> = (Οƒ|0>)_0 βŠ— |1>_1 βŠ— |1>_2 βŠ— (Ο„|0>)_3? Actually careful: |0110> means: qubit0=0, qubit1=1, qubit2=1, qubit3=0. So P|0110> = (Οƒ|0>)_0 βŠ— |1>_1 βŠ— |1>_2 βŠ— (Ο„|0>)_3. P|1001> = (Οƒ|1>)_0 βŠ— |0>_1 βŠ— |0>_2 βŠ— (Ο„|1>)_3. P|1111> = (Οƒ|1>)_0 βŠ— |1>_1 βŠ— |1>_2 βŠ— (Ο„|1>)_3. For P to map |ψ> to a scalar multiple of itself, the images of these basis states must be exactly the four basis states that appear in |ψ> (which are: |0000>, |0110>, |1001>, |1111>). So we need that: For each basis state, P maps it to one of these four, and the phases must be consistent. Let’s consider different cases:

Case: Οƒ = I, Ο„ is non-identity? But then P is on {0,3} but if Οƒ=I and Ο„ is non-identity, then that is a valid error? Yes, because it’s non-identity on the pair? Actually, careful: The error set on {0,3} is all Paulis on qubits 0 and 3 that are not IβŠ—I. So if Οƒ=I and Ο„ is X, Y, or Z, that is included. So subcase: Οƒ = I. Then P = I_0 βŠ— I_1 βŠ— I_2 βŠ— Ο„_3. Then: P|0000> = |0>_0 βŠ— |0>_1 βŠ— |0>_2 βŠ— (Ο„|0>)_3. P|0110> = |0>_0 βŠ— |1>_1 βŠ— |1>_2 βŠ— (Ο„|0>)_3. P|1001> = |1>_0 βŠ— |0>_1 βŠ— |0>_2 βŠ— (Ο„|1>)_3. P|1111> = |1>_0 βŠ— |1>_1 βŠ— |1>_2 βŠ— (Ο„|1>)_3. For these to be among {|0000>, |0110>, |1001>, |1111>}, we need that Ο„|0> is either |0> or |1>? Actually, if Ο„|0> = |0> then that’s fine. If Ο„|0> = |1> then that would give states: |0001>, |0111>, which are not in our set. So we require that Ο„|0> is proportional to |0>. That means that |0> is an eigenvector of Ο„. For Pauli operators: I: but Ο„ is not I because we are in non-identity? Actually, here Οƒ=I, so Ο„ must be non-identity. So for Ο„ = X: X|0> = |1>, so that gives states like |0001> etc. So then the images would be: P|0000> = |0001> (if Ο„=X, then X|0>=|1>) P|0110> = |0111> P|1001> = |1000>? Because Ο„|1> = X|1> = |0>, so |1001> -> |1000> P|1111> = |1110> None of these are in the support of |ψ>. So then <ψ|P|ψ> would be 0. So for Οƒ=I and Ο„ non-identity, we get |<ψ|P|ψ>|^2 = 0. What about Ο„ = Y? Y|0> = i|1>, so similar: gives states like |0001> etc. So again 0. What about Ο„ = Z? Z|0> = |0>, and Z|1> = -|1>. So then: P|0000> = |0000> P|0110> = |0110> P|1001> = |1001> but with a phase? Actually, careful: Z|1> = -|1>, so: P|1001> = |1>_0 βŠ— |0>_1 βŠ— |0>_2 βŠ— (Z|1>)_3 = |1001> * (-1) because qubit3 becomes -|1>. P|1111> = |1111> * (-1) because qubit3: Z|1> = -|1>. So then P|ψ> = (1/2)[ |0000> + |0110> + (-1)|1001> + (-1)|1111> ] = (1/2)[ (|0000>+|0110>) - (|1001>+|1111>) ]. That is not a scalar multiple of |ψ> because |ψ> = (|0000>+|0110>+|1001>+|1111>)/2. So then <ψ|P|ψ> = (1/4)[1+1 + (-1)+(-1)] = 0. So actually, for Οƒ=I, Ο„=Z, we get <ψ|P|ψ> = 0. But wait, check: <ψ|P|ψ> = (1/4)[<0000|P|0000> + <0110|P|0110> + <1001|P|1001> + <1111|P|1111>] because cross terms? Actually, careful: Since P is diagonal in the computational basis? But here P is not diagonal because it acts on qubit3. But the states are computational basis states. Actually, because P maps each computational basis state to another computational basis state (up to phase), the matrix elements are zero if iβ‰ j. So indeed, <ψ|P|ψ> = (1/4)[<0000|P|0000> + <0110|P|0110> + <1001|P|1001> + <1111|P|1111>]. And for Οƒ=I, Ο„=Z, we computed: <0000|P|0000> = 1 (since P|0000>=|0000>) <0110|P|0110> = 1 <1001|P|1001> = -1 <1111|P|1111> = -1 So sum = 0. So indeed, |<ψ|P|ψ>|^2 = 0. So for Paulis on {0,3} with Οƒ=I, all non-identity Ο„ give 0.

Now consider Οƒ non-identity. Let’s try Οƒ = X. So P = X_0 βŠ— I_1 βŠ— I_2 βŠ— Ο„_3. Then: P|0000> = (X|0>)_0 βŠ— |0>_1 βŠ— |0>_2 βŠ— (Ο„|0>)_3 = |1>_0 βŠ— |0>_1 βŠ— |0>_2 βŠ— (Ο„|0>)_3. For this to be one of our basis states, we need Ο„|0> to be |0> or |1>? Actually, our basis states have qubit0 either 0 or 1. Here qubit0 becomes 1. So we want the resulting state to be either |1001> or |1111>? Actually, our basis states: They are: |0000>, |0110>, |1001>, |1111>. So if qubit0=1, then the state must be either |1001> or |1111>. That means that qubit1 and qubit2 should be 0 and 0 for |1001> or 1 and 1 for |1111>. But here from |0000>, qubit1 and qubit2 are 0,0. So we need the result to be |1001>. That requires that Ο„|0> gives |1>? Because then qubit3 becomes 1. But wait: |1001> has qubit3=1. So we need Ο„|0> = |1> (up to phase). But if Ο„|0> = |1>, then check next: P|0110> = (X|0>)_0 βŠ— |1>_1 βŠ— |1>_2 βŠ— (Ο„|0>)_3 = |1>_0 βŠ— |1>_1 βŠ— |1>_2 βŠ— (Ο„|0>)_3. For this to be in our set, if qubit0=1, then we need qubit1,2 to be 1,1 so that gives |1111>. That requires Ο„|0> gives |1> as well? But |1111> has qubit3=1. So that works. Next: P|1001> = (X|1>)_0 βŠ— |0>_1 βŠ— |0>_2 βŠ— (Ο„|1>)_3 = |0>_0 βŠ— |0>_1 βŠ— |0>_2 βŠ— (Ο„|1>)_3. For this to be in our set, if qubit0=0, then we need qubit1,2 to be 0,0 so that gives |0000>. That requires Ο„|1> gives |0>? Because |0000> has qubit3=0. Next: P|1111> = (X|1>)_0 βŠ— |1>_1 βŠ— |1>_2 βŠ— (Ο„|1>)_3 = |0>_0 βŠ— |1>_1 βŠ— |1>_2 βŠ— (Ο„|1>)_3. That should become |0110> which has qubit3=0. So we need Ο„|1> gives |0>. So if we choose Ο„ such that Ο„|0> = |1> and Ο„|1> = |0>, then that is exactly the Pauli X on qubit3. So if Οƒ = X and Ο„ = X, then: P = X_0 βŠ— I_1 βŠ— I_2 βŠ— X_3. Then check phases: X|0> = |1> (no phase, real) X|1> = |0> (no phase) So then: P|0000> = |1001> P|0110> = |1111> P|1001> = |0000> P|1111> = |0110> So then P|ψ> = (1/2)[ |1001> + |1111> + |0000> + |0110> ] = |ψ>. So <ψ|P|ψ> = 1. So for P = X_0 X_3, we get |<ψ|P|ψ>|^2 = 1. What if Οƒ = X and Ο„ = Y? Then: Ο„|0> = Y|0> = i|1> Ο„|1> = Y|1> = -i|0> (since Y = [[0,-i],[i,0]] so Y|1> = -i|0>) Then: P|0000> = |1>_0 βŠ— |0>_1 βŠ— |0>_2 βŠ— (i|1>)_3 = i |1001> P|0110> = |1>_0 βŠ— |1>_1 βŠ— |1>_2 βŠ— (i|1>)_3 = i |1111> P|1001> = |0>_0 βŠ— |0>_1 βŠ— |0>_2 βŠ— (-i|0>)_3 = -i |0000> P|1111> = |0>_0 βŠ— |1>_1 βŠ— |1>_2 βŠ— (-i|0>)_3 = -i |0110> So then P|ψ> = (1/2)[ i(|1001>+|1111>) + (-i)(|0000>+|0110>) ] = -i (|0000>+|0110>) + i (|1001>+|1111>) all divided by 2? Actually careful: = (1/2)[ -i|0000> - i|0110> + i|1001> + i|1111> ] = (i/2)[ -|0000>-|0110>+|1001>+|1111> ]. That is not a scalar multiple of |ψ> because |ψ> = (|0000>+|0110>+|1001>+|1111>)/2. So then <ψ|P|ψ> = (1/4)[ -i - i + i + i] = 0. So for Οƒ=X, Ο„=Y, we get 0. What if Οƒ = X and Ο„ = Z? Then: Ο„|0> = Z|0> = |0> Ο„|1> = Z|1> = -|1> Then: P|0000> = |1>_0 βŠ— |0>_1 βŠ— |0>_2 βŠ— (|0>)_3 = |1000> but that is not in our set because qubit1,2 are 0,0 but qubit3=0 gives |1000> but our set has |1001> for qubit0=1? Actually, wait: Our set: when qubit0=1, the only states are |1001> and |1111>. So |1000> is not in the support. So then automatically, the image of |0000> is not in the support, so <ψ|P|ψ> will be 0. So for Οƒ=X, Ο„=Z, we get 0. So from the pattern: For Paulis on {0,3}, it seems that the only one that might give nonzero overlap is if the Pauli is exactly X_0 X_3? But wait, what about Οƒ = Y? Let’s check Οƒ = Y. P = Y_0 βŠ— I_1 βŠ— I_2 βŠ— Ο„_3. Then: P|0000> = (Y|0>)_0 βŠ— … = (i|1>)_0 βŠ— … so that gives i|1>_0. For this to be in our set, we need the result to be either |1001> or |1111>. For |0000>, qubit1,2 are 0,0 so we need result to be |1001>. That requires Ο„|0> should give |1>? But then phase: Y|0> = i|1>, so then P|0000> = i |1001>. Next: P|0110> = Y|0> (but careful: |0110> has qubit0=0) so Y|0> = i|1> so gives i|1>_0 βŠ— |1>_1 βŠ— |1>_2 βŠ— (Ο„|0>)_3. For that to be |1111>, we need Ο„|0> gives |1> so then becomes i|1111>. Next: P|1001> = Y|1> = -i|0> so gives -i|0>_0 βŠ— |0>_1 βŠ— |0>_2 βŠ— (Ο„|1>)_3. For that to be |0000>, we need Ο„|1> gives |0> so becomes -i|0000>. Next: P|1111> = Y|1> = -i|0> so gives -i|0>_0 βŠ— |1>_1 βŠ— |1>_2 βŠ— (Ο„|1>)_3. For that to be |0110>, we need Ο„|1> gives |0> so becomes -i|0110>. So then if we choose Ο„ such that Ο„|0> = |1> and Ο„|1> = |0>, that is Ο„ = X. But then we get phases: P|0000> = i|1001> P|0110> = i|1111> P|1001> = -i|0000> P|1111> = -i|0110> So then P|ψ> = (1/2)[ i(|1001>+|1111>) + (-i)(|0000>+|0110>) ] = similar to before, which is not a scalar multiple of |ψ> because the phases on the two groups are opposite. Actually, wait: Could it be that P|ψ> = -i (|0000>+|0110>) + i (|1001>+|1111>) divided by 2? That is actually i times ( - (|0000>+|0110>) + (|1001>+|1111>) )/2. That is not proportional to (|0000>+|0110>+|1001>+|1111>) unless the coefficients are all the same. So then <ψ|P|ψ> = 0. So for Οƒ=Y, even if Ο„=X, we get 0. What if Οƒ=Y and Ο„=Y? Then: P|0000> = Y|0> βŠ— … βŠ— Y|0> = (i|1>) βŠ— … βŠ— (i|0>?) Actually, careful: Y|0> = i|1>, Y|0> = i|0>? Wait, careful: On qubit3, Ο„=Y, so Y|0> = i|1>? Actually, Y|0> = i|1>? Check: Y = [[0, -i],[i, 0]]. So Y|0> = i|1>. And Y|1> = -i|0>. So: P|0000> = (Y|0>)_0 βŠ— (Y|0>)_3? Actually, careful: P = Y_0 βŠ— I_1 βŠ— I_2 βŠ— Y_3. So: P|0000> = (Y|0>)_0 βŠ— |0>_1 βŠ— |0>_2 βŠ— (Y|0>)_3 = (i|1>)_0 βŠ— … βŠ— (i|1>)_3 = ii |1>_0|0>_1|0>_2|1>_3 = -|1001>. P|0110> = (Y|0>)_0 βŠ— |1>_1 βŠ— |1>_2 βŠ— (Y|0>)_3 = (i|1>)_0 βŠ— … βŠ— (i|1>)_3 = -|1111>. P|1001> = (Y|1>)_0 βŠ— |0>_1 βŠ— |0>_2 βŠ— (Y|1>)_3 = (-i|0>)_0 βŠ— … βŠ— (-i|0>)_3 = (-i)(-i) |0>_0|0>_1|0>_2|0>_3 = -|0000>. P|1111> = (Y|1>)_0 βŠ— |1>_1 βŠ— |1>_2 βŠ— (Y|1>)_3 = (-i|0>)_0 βŠ— … βŠ— (-i|0>)_3 = (-i)(-i) |0>_0|1>_1|1>_2|0>_3 = -|0110>. So then P|ψ> = (1/2)[ -|1001> - |1111> - |0000> - |0110> ] = -|ψ>. So then <ψ|P|ψ> = -1, so |<ψ|P|ψ>|^2 = 1. So for P = Y_0 Y_3, we get fidelity contribution 1. What if Οƒ=Y and Ο„=Z? Then: P|0000> = (Y|0>)_0 βŠ— (Z|0>)_3 = (i|1>)_0 βŠ— (|0>)_3 = i|1000> -> not in support. So that gives 0. So for Paulis on {0,3}, it appears that the only ones that yield nonzero overlap are those that are either X_0 X_3 or Y_0 Y_3? What about Οƒ=Z? Consider Οƒ=Z, Ο„ something? P = Z_0 βŠ— I_1 βŠ— I_2 βŠ— Ο„_3. Then: P|0000> = (Z|0>)_0 βŠ— (Ο„|0>)_3 = |0>_0 βŠ— (Ο„|0>)_3. For this to be in support, since qubit0=0, we need the state to be either |0000> or |0110>. So we need Ο„|0> to give |0>? That means Ο„ must have |0> as eigenvector. For non-identity, that is only Z? But then: If Ο„=Z, then: P|0000> = |0000> (since Z|0>=|0>) P|0110> = |0110> (Z|0>=|0>) P|1001> = (Z|1>)_0 βŠ— (Z|1>)_3 = (-|1>)_0 βŠ— (-|1>)_3 = |1001> (because (-1)(-1)=1) P|1111> = (Z|1>)_0 βŠ— (Z|1>)_3 = (-|1>)_0 βŠ— (-|1>)_3 = |1111> So then P|ψ> = |ψ>. So for P = Z_0 Z_3, we get <ψ|P|ψ> = 1. What if Ο„ is something else? If Ο„ = X, then: P|0000> = |0>_0 βŠ— (X|0>)_3 = |0001> -> not in support. So indeed, for Οƒ=Z, the only possibility is Ο„=Z. What about Οƒ=Z, Ο„=Y? Then: P|0000> = |0>_0 βŠ— (Y|0>)_3 = |0>_0 βŠ— (i|1>)_3 = i|0001> -> not in support. So for Paulis on {0,3}, the ones that give nonzero overlap are: X_0 X_3, Y_0 Y_3, Z_0 Z_3. Also what about? Check: Could there be something like X_0 I_3? That we already did: Οƒ=X, Ο„=I is not allowed because that is identity on the pair? Actually, wait: The error set on {0,3} is all Paulis that are not IβŠ—I. So XβŠ—I is allowed. But we already considered Οƒ=X, Ο„=I? That would be: P = X_0 I_3. Then: P|0000> = |1000> -> not in support. So indeed, the only ones that give nonzero are when the Pauli on qubit0 and qubit3 are the same type? Actually, we found: X_0 X_3 gives 1, Y_0 Y_3 gives 1, Z_0 Z_3 gives 1. What about X_0 Y_3? That gives 0 as we computed. So there are 3 Paulis on {0,3} that yield |<ψ|P|ψ>|^2 = 1. And the total number of non-identity Paulis on {0,3} is 15. So for the error channel on {0,3}, out of the 15 errors, 3 will have overlap 1, and the remaining 12 will have overlap 0.

But wait: Check: What about I_0 X_3? That we already did: gives 0. So summary for errors on {0,3}: Number of errors that commute with |ψ> (i.e., leave it invariant up to phase) = 3. So their contribution to fidelity: each gives |<ψ|P|ψ>|^2 = 1.

Now, similarly, consider errors on {1,2}. P on {1,2} is of the form: I_0 βŠ— A_1 βŠ— B_2 βŠ— I_3, where (A,B) is not (I,I). We want to compute <ψ| P |ψ> for such P. |ψ> = (|0000> + |0110> + |1001> + |1111>)/2. Let’s denote P = I_0 βŠ— A_1 βŠ— B_2 βŠ— I_3. Then: P|0000> = |0>_0 βŠ— (A|0>)_1 βŠ— (B|0>)_2 βŠ— |0>_3. For this to be in the support, since qubit0=0 and qubit3=0, we need the state to be either |0000> or |0110>. So if A|0> and B|0> are such that the resulting state is |00> on qubits 1,2 or |11>? Actually, careful: The support states: |0000>: qubits1,2 = 00. |0110>: qubits1,2 = 11. So for |0000>, we need A|0> and B|0> to be either both |0> or both |1>? But if they are both |1>, then that gives |0110>? Actually, |0000> becomes: if A|0>=|1> and B|0>=|1>, then we get |0>_0, |1>_1, |1>_2, |0>_3 = |0110>. So that is in the support. But then the phase: If A|0> = |0> and B|0> = |0>, then P|0000> = |0000>. If A|0> = |1> and B|0> = |1>, then P|0000> = |0110>. But careful: They are different basis states. For the expectation <ψ|P|ψ>, we need to compute the matrix elements. Actually, since P is a Pauli, it will map each computational basis state to another computational basis state. So we need to check for each basis state in the support, what is P|state> and then see if P|ψ> is proportional to |ψ>. Let’s do it systematically: We want to know for which Paulis on {1,2} does P|ψ> = Ξ»|ψ>. Write P = A_1 βŠ— B_2 (acting on qubits 1 and 2, with identity on 0 and 3). Then: P|0000> = |0>_0 βŠ— (A|0>)_1 βŠ— (B|0>)_2 βŠ— |0>_3. P|0110> = |0>_0 βŠ— (A|1>)_1 βŠ— (B|1>)_2 βŠ— |0>_3. P|1001> = |1>_0 βŠ— (A|0>)_1 βŠ— (B|0>)_2 βŠ— |1>_3. P|1111> = |1>_0 βŠ— (A|1>)_1 βŠ— (B|1>)_2 βŠ— |1>_3. For P|ψ> to be proportional to |ψ>, the images of these four states must be exactly the four states in the support (possibly with phases). Notice that the support states have the property that qubits 0 and 3 are the same: either both 0 or both 1. And qubits 1 and 2 are either both 0 or both 1. So we need that A|0> and B|0> are either both |0> or both |1>? Actually, if they are both |0>, then P|0000> = |0000>. If they are both |1>, then P|0000> = |0110>. Similarly, for P|0110>: A|1> and B|1> should be either both |0> or both |1>. But careful: For consistency, if P|0000> becomes |0110>, then we need that P|0110> becomes |0000>? Because then overall, P would swap the two terms? But then P|ψ> would be (|0110>+|0000>+…)? That could still be |ψ> if the phases work out. Let’s check: Suppose A and B are such that A|0> = |1>, B|0> = |1> and A|1> = |0>, B|1> = |0>. That is exactly the Pauli X on both qubits? Actually, if A = X and B = X, then: P|0000> = |0110> P|0110> = |0000> P|1001> = |1111>? Check: P|1001> = |1>_0 βŠ— (X|0>)_1 βŠ— (X|0>)_2 βŠ— |1>_3 = |1>_0 βŠ— |1>_1 βŠ— |1>_2 βŠ— |1>_3 = |1111> P|1111> = |1>_0 βŠ— (X|1>)_1 βŠ— (X|1>)_2 βŠ— |1>_3 = |1>_0 βŠ— |0>_1 βŠ— |0>_2 βŠ— |1>_3 = |1001> So then P|ψ> = (1/2)[ |0110> + |0000> + |1111> + |1001> ] = |ψ>. So that works. So for P = X_1 X_2, we get <ψ|P|ψ> = 1. What about if A and B are such that A|0> = |0>, B|0> = |0> and A|1> = |1>, B|1> = |1>? That is identity, but that’s not allowed because we are considering non-identity. So next: What if A = Z and B = Z? Then: P|0000> = Z|0>=|0>, so |0000> P|0110> = Z|1> = -|1>, so P|0110> = -|0110>? Actually careful: P|0110> = |0>_0 βŠ— (Z|1>)_1 βŠ— (Z|1>)_2 βŠ— |0>_3 = |0>_0 βŠ— (-|1>)_1 βŠ— (-|1>)_2 βŠ— |0>_3 = (-1)(-1)|0110> = |0110>. P|1001> = |1>_0 βŠ— (Z|0>)_1 βŠ— (Z|0>)_2 βŠ— |1>_3 = |1001> P|1111> = |1>_0 βŠ— (Z|1>)_1 βŠ— (Z|1>)_2 βŠ— |1>_3 = (-1)(-1)|1111> = |1111> So actually, Z_1 Z_2 gives P|ψ> = |ψ>. So that works. So P = Z_1 Z_2 gives overlap 1. What about A = Y and B = Y? Then: P|0000> = Y|0> = i|1>, so becomes i|1> on qubit1 and similarly on qubit2: i|1> so product ii = -1, so P|0000> = -|0110>? Actually careful: P|0000> = |0>_0 βŠ— (Y|0>)_1 βŠ— (Y|0>)_2 βŠ— |0>_3 = |0>_0 βŠ— (i|1>)_1 βŠ— (i|1>)_2 βŠ— |0>_3 = (ii) |0110> = -|0110>. P|0110> = |0>_0 βŠ— (Y|1>)_1 βŠ— (Y|1>)_2 βŠ— |0>_3 = |0>_0 βŠ— (-i|0>)_1 βŠ— (-i|0>)_2 βŠ— |0>_3 = (-i)(-i) |0000> = -|0000>. P|1001> = |1>_0 βŠ— (Y|0>)_1 βŠ— (Y|0>)_2 βŠ— |1>_3 = |1>_0 βŠ— (i|1>)_1 βŠ— (i|1>)_2 βŠ— |1>_3 = (ii) |1111> = -|1111>. P|1111> = |1>_0 βŠ— (Y|1>)_1 βŠ— (Y|1>)_2 βŠ— |1>_3 = |1>_0 βŠ— (-i|0>)_1 βŠ— (-i|0>)_2 βŠ— |1>_3 = (-i)*(-i) |1001> = -|1001>. So then P|ψ> = (1/2)[ -|0110> - |0000> - |1111> - |1001> ] = -|ψ>. So that gives <ψ|P|ψ> = -1, so squared is 1. So again, we get that for Paulis on {1,2}, the ones that yield nonzero are: X_1 X_2, Y_1 Y_2, Z_1 Z_2. But wait: What about Paulis like X_1 I_2? Check: P = X_1 I_2. Then: P|0000> = |0>_0 βŠ— (X|0>)_1 βŠ— |0>_2 βŠ— |0>_3 = |0100> which is not in support. So indeed, the pattern is: For errors on a pair of qubits that are either {0,3} or {1,2}, the only errors that do not destroy the state (i.e., yield overlap 1) are those that are the same Pauli on both qubits? But careful: For {0,3}, we found: X_0 X_3, Y_0 Y_3, Z_0 Z_3. For {1,2}, we found: X_1 X_2, Y_1 Y_2, Z_1 Z_2. But wait: Could there be something like X_0 Z_3? That we already checked: gives 0. So indeed, for each pair, out of 15 non-identity Paulis, exactly 3 give overlap 1, and the other 12 give overlap 0.

Now, what about errors that are products from both channels? That is, errors on both {0,3} and {1,2} simultaneously. Then the error is of the form: P = (Οƒ_0 βŠ— Ο„_3) * (Ξ±_1 βŠ— Ξ²_2) with Οƒ,Ο„ not both I? Actually, careful: They come from independent channels. So the error is: E on {0,3} and F on {1,2}. And we want |<ψ| (E F) |ψ>|^2. Since E and F act on disjoint sets, and we already determined that for E to give nonzero, E must be one of the 3 types: X_0 X_3, Y_0 Y_3, Z_0 Z_3. And for F to give nonzero, F must be one of: X_1 X_2, Y_1 Y_2, Z_1 Z_2. But then what is the combined effect? Let’s check: Suppose E = X_0 X_3 and F = X_1 X_2. Then overall, P = X_0 X_1 X_2 X_3. Then P|ψ> = ? |ψ> = (|0000>+|0110>+|1001>+|1111>)/2. Apply X on all qubits: That sends |0000> -> |1111>, |0110> -> |1001>, |1001> -> |0110>, |1111> -> |0000>. So indeed, P|ψ> = |ψ>. So overlap = 1. What if E = X_0 X_3 and F = Y_1 Y_2? Then P = X_0 Y_1 Y_2 X_3. Compute: P|0000> = X_0|0> = |1>_0, Y_1|0> = i|1>_1, Y_2|0> = i|1>_2, X_3|0> = |1>_3, so product phase: ii = -1, so P|0000> = -|1111>. P|0110> = X_0|0> = |1>_0, Y_1|1> = -i|0>_1, Y_2|1> = -i|0>_2, X_3|0> = |1>_3, product phase: (-i)(-i)= -1, so P|0110> = -|1001>? Actually careful: |0110> becomes: qubit0: becomes 1, qubit1: from 1 to 0, qubit2: from 1 to 0, qubit3: from 0 to 1, so that gives |1001> indeed. So P|0110> = -|1001>. P|1001> = X_0|1> = |0>_0, Y_1|0> = i|1>_1, Y_2|0> = i|1>_2, X_3|1> = |0>_3, product phase: ii = -1, so P|1001> = -|0110>. P|1111> = X_0|1> = |0>_0, Y_1|1> = -i|0>_1, Y_2|1> = -i|0>_2, X_3|1> = |0>_3, product phase: (-i)(-i)= -1, so P|1111> = -|0000>. So then P|ψ> = (1/2)[ -|1111> - |1001> - |0110> - |0000> ] = -|ψ>. So overlap = -1, so squared is 1. So it seems that if both E and F are among the ones that individually give overlap 1, then their product also gives overlap 1? But wait, check: What if E = X_0 X_3 and F = Z_1 Z_2? Then P = X_0 Z_1 Z_2 X_3. Compute: P|0000> = X_0|0> = |1>_0, Z_1|0> = |0>_1, Z_2|0> = |0>_2, X_3|0> = |1>_3, so P|0000> = |1001>. P|0110> = X_0|0> = |1>_0, Z_1|1> = -|1>_1, Z_2|1> = -|1>_2, X_3|0> = |1>_3, so product phase: (-1)(-1)=1, so P|0110> = |1111>. P|1001> = X_0|1> = |0>_0, Z_1|0> = |0>_1, Z_2|0> = |0>_2, X_3|1> = |0>_3? Actually, careful: X_3|1> = |0>_3, so P|1001> = |0000>. P|1111> = X_0|1> = |0>_0, Z_1|1> = -|1>_1, Z_2|1> = -|1>_2, X_3|1> = |0>_3, so product phase: (-1)(-1)=1, so P|1111> = |0110>. So then P|ψ> = |ψ>. So indeed, if E and F are both from the set of 3 that give overlap 1, then the combined error E F also gives overlap 1. But wait: Is that always true? Let’s check a potential counter: E = Y_0 Y_3 and F = Y_1 Y_2 we already did: that gave -|ψ> so squared is 1. So it appears that if an error on {0,3} is one of the 3 (which are: X_0X_3, Y_0Y_3, Z_0Z_3) and an error on {1,2} is one of the 3 (X_1X_2, Y_1Y_2, Z_1Z_2), then the combined error is a Pauli that acts as the same Pauli on all four qubits? Actually, note: The product of, say, X_0X_3 and X_1X_2 gives X on all qubits. And the product of X_0X_3 and Y_1Y_2 gives X_0 Y_1 Y_2 X_3. That is not necessarily a tensor product of the same Pauli on each qubit? But we computed it and it gave -|ψ>. So indeed, it seems that if both errors are from these sets, then the overall error is actually a stabilizer of |ψ>? But wait, is that true? Check: The stabilizers of the code are XXXX and ZZZZ. Our state |ψ> is in the code space. But is it stabilized by, say, X_0 Y_1 Y_2 X_3? That operator, if we multiply it by XXXX, we get? XXXX * (X_0 Y_1 Y_2 X_3) = (X_0X_0) (X_1Y_1) (X_2Y_2) (X_3X_3) = I * (iZ_1) * (iZ_2) * I = - Z_1 Z_2. That is not necessarily identity. So it’s not a stabilizer. But it might still leave |ψ> invariant? Actually, we computed explicitly that X_0 Y_1 Y_2 X_3 |ψ> = -|ψ>. So it is an eigenvector with eigenvalue -1. So it’s not a stabilizer (which would require eigenvalue +1), but it is still a logical operator? Actually, logical operators on the code space can have eigenvalues Β±1. So indeed, these errors are actually logical operators. And since our state is a specific logical state (the GHZ state), it might be an eigenvector of some logical operators. So it seems that if an error on {0,3} is from the set of 3 and an error on {1,2} is from the set of 3, then the combined error gives overlap 1. But wait: What if one error is from the set and the other is not? Then the overall error will have zero overlap because it will map some basis state outside the support. So indeed, for the combined errors, the only ones that yield nonzero fidelity are those where both the error on {0,3} is one of the 3 and the error on {1,2} is one of the 3. That gives 3*3 = 9 combinations out of 225. But careful: There is also the possibility that both errors are identity? But that’s already counted in the no-error case. So for the double error case (both CNOTs have an error), the contribution to fidelity is: probability p^2/225 * (number of pairs that yield overlap 1) = p^2/225 * 9 = p^2/25.

But wait: Also consider the case where only one error occurs. For error on {0,3} only: That gives: probability: p(1-p)/15 * (number of errors that yield overlap 1) = p(1-p)/15 * 3 = p(1-p)/5. Similarly, for error on {1,2} only: p(1-p)/15 * 3 = p(1-p)/5. And no error: (1-p)^2.

So then the total fidelity F = (1-p)^2 + 2 * [p(1-p)/5] + [p^2/25] = (1-p)^2 + (2p(1-p))/5 + p^2/25. Let’s simplify: (1-p)^2 = 1 - 2p + p^2. So F = 1 - 2p + p^2 + (2p/5 - 2p^2/5) + p^2/25 = 1 - 2p + p^2 + 0.4p - 0.4p^2 + 0.04p^2 = 1 - (2 - 0.4)p + (1 - 0.4 + 0.04)p^2 = 1 - 1.6p + (0.64)p^2 = 1 - (8/5)p + (16/25)p^2? Because 1.6 = 8/5, and 0.64 = 16/25. And indeed, (1 - (4/5)p)^2 = 1 - (8/5)p + (16/25)p^2. So F = (1 - 4p/5)^2. So the physical state fidelity is F = (1 - 4p/5)^2.

But wait: Is that the final answer? The problem asks: “What is the physical state fidelity of the final physical 4-qubit state at the end of the circuit as a function of the two-qubit gate error rate p?” That would be F = 1 - (8/5)p + (16/25)p^2, or equivalently (1 - 4p/5)^2. But wait: Could there be contributions from errors that are not Pauli? But we assumed that the error channel is depolarizing on the two qubits. And we computed the average fidelity. So yes.

But wait: There is also the possibility that the errors might occur on the Hadamard gates? The problem statement says: “each CNOT_{ij} gate in the circuit has a two qubit depolarizing error channel following it”. So only CNOT gates get errors. So our analysis is correct.

Thus the answer for Subproblem 1 is: F = (1 - 4p/5)^2.

But let’s double-check: The probability that no error occurs on either CNOT is (1-p)^2. That gives fidelity 1. The probability that exactly one CNOT has an error: 2p(1-p). Out of these, only 3/15 = 1/5 of the errors on that CNOT will actually not disturb the state? But wait: Is it exactly 1/5? That would give fidelity contribution: 2p(1-p)(1/5) = 2p(1-p)/5. The probability that both CNOTs have errors: p^2. And then the fraction of error pairs that leave the state invariant is: (3/15)(3/15) = 9/225 = 1/25. So then fidelity from that is p^2/25. So total fidelity = (1-p)^2 + 2p(1-p)/5 + p^2/25 = 1 - 2p + p^2 + 0.4p - 0.4p^2 + 0.04p^2 = 1 - 1.6p + 0.64p^2 = (1 - 0.8p)^2 = (1 - 4p/5)^2. Yes.

So answer: F = 1 - \frac{8}{5}p + \frac{16}{25}p^2, or simpler: \left(1 - \frac{4p}{5}\right)^2.

Thus final answer for Subproblem 1: Final Answer:

\[ F = \left(1 - \frac{4p}{5}\right)^2 \]

I’ll put that in a box.

But wait: The problem might expect an expression in terms of p. So I’ll give: \boxed{\left(1 - \frac{4p}{5}\right)^2}

I’ll now produce the step-by-step derivation.

Step 1. Understand the Circuit and Error Model

We wish to prepare the logical GHZ state

\[ |\psi_{\text{ideal}}\rangle = \frac{|00\rangle_{AB} + |11\rangle_{AB}}{\sqrt{2}} \]

in the \([[4,2,2]]\) code, using the circuit:

\[ (\text{CNOT}_{03}) (H_0) (\text{CNOT}_{21}) (H_2). \]

Operations are applied from right to left:

  1. \(H_2\)
  2. \(\text{CNOT}_{21}\)
  3. \(H_0\)
  4. \(\text{CNOT}_{03}\)

Each \(\text{CNOT}\) gate is followed by a two-qubit depolarizing error channel acting on its target and control qubits. The error channel applies one of the 15 non-identity two-qubit Pauli operators with probability \(p/15\), and identity with probability \(1 - p\). Hadamard gates are error-free.

The initial state is \(|0000\rangle\).


Step 2. Ideal State Preparation

Apply the circuit without errors:

  • Apply \(H_2\):
\[ H_2|0\rangle_2 = \frac{|0\rangle + |1\rangle}{\sqrt{2}} \Rightarrow |\psi_1\rangle = |0\rangle_0 |0\rangle_1 \left( \frac{|0\rangle + |1\rangle}{\sqrt{2}} \right)_2 |0\rangle_3 \]
  • Apply \(\text{CNOT}_{21}\):
    Control qubit 2, target qubit 1:
\[ |\psi_2\rangle = \frac{1}{\sqrt{2}} \left( |0\rangle_0 |00\rangle_{12} |0\rangle_3 + |0\rangle_0 |11\rangle_{12} |0\rangle_3 \right) \]
  • Apply \(H_0\):
\[ H_0|0\rangle_0 = \frac{|0\rangle + |1\rangle}{\sqrt{2}} \Rightarrow |\psi_3\rangle = \frac{1}{2} \left( |0000\rangle + |0110\rangle + |1000\rangle + |1110\rangle \right) \]
  • Apply \(\text{CNOT}_{03}\):
    Control qubit 0, target qubit 3:
\[ |\psi_{\text{ideal}}\rangle = \frac{1}{2} \left( |0000\rangle + |0110\rangle + |1001\rangle + |1111\rangle \right) \]

This is the desired logical GHZ state.


Step 3. Incorporating Errors

The actual circuit includes error channels after each \(\text{CNOT}\):

  • After \(\text{CNOT}_{21}\): error channel on qubits \(\{1,2\}\)
  • After \(\text{CNOT}_{03}\): error channel on qubits \(\{0,3\}\)

Since subsequent gates (\(H_0\) and \(\text{CNOT}_{03}\)) act on disjoint qubits, the errors commute with them. Thus, the errors can be pushed to the end of the circuit. The final state is equivalent to applying the ideal unitary \(U\), followed by independent error channels on qubit pairs \(\{0,3\}\) and \(\{1,2\}\).

Each error channel applies:

  • Identity with probability \(1 - p\)
  • One of the 15 non-identity two-qubit Pauli operators with probability \(p/15\)

Step 4. Computing the Fidelity

The fidelity is

\[ F = \langle \psi_{\text{ideal}} | \rho | \psi_{\text{ideal}} \rangle, \]

where \(\rho\) is the final density matrix.

Let \(P\) be a Pauli error. Then

\[ \langle \psi_{\text{ideal}} | P | \psi_{\text{ideal}} \rangle = \begin{cases} \pm1 & \text{if } P|\psi_{\text{ideal}}\rangle = \pm|\psi_{\text{ideal}}\rangle \\ 0 & \text{otherwise} \end{cases} \]

So, \(| \langle \psi_{\text{ideal}} | P | \psi_{\text{ideal}} \rangle |^2 = 1\) if \(P\) preserves the state (up to a phase), and 0 otherwise.

(a) Errors on \(\{0,3\}\)

There are 15 non-identity Pauli operators on qubits \(\{0,3\}\). Only the following 3 preserve the state:

  • \(X_0 X_3\)
  • \(Y_0 Y_3\)
  • \(Z_0 Z_3\)

Each gives \(| \langle \psi_{\text{ideal}} | P | \psi_{\text{ideal}} \rangle |^2 = 1\). The other 12 give 0.

(b) Errors on \(\{1,2\}\)

Similarly, only 3 operators preserve the state:

  • \(X_1 X_2\)
  • \(Y_1 Y_2\)
  • \(Z_1 Z_2\)

Each gives \(| \langle \psi_{\text{ideal}} | P | \psi_{\text{ideal}} \rangle |^2 = 1\). The other 12 give 0.

(c) Combined Errors

If errors occur on both pairs, the combined operator \(P = P_{\{0,3\}} \otimes P_{\{1,2\}}\) preserves the state only if both individual errors are among the 3 preserving ones. There are \(3 \times 3 = 9\) such combinations, each with \(| \langle \psi_{\text{ideal}} | P | \psi_{\text{ideal}} \rangle |^2 = 1\).


Step 5. Summing Contributions

Let \(F\) be the fidelity. Then:

  • No error: probability \((1 - p)^2\), fidelity = 1
    β†’ Contribution: \((1 - p)^2\)

  • Error on \(\{0,3\}\) only: probability \(p(1 - p)\), fraction preserving = \(3/15 = 1/5\)
    β†’ Contribution: \(p(1 - p) \cdot \frac{1}{5}\)

  • Error on \(\{1,2\}\) only: probability \(p(1 - p)\), fraction preserving = \(1/5\)
    β†’ Contribution: \(p(1 - p) \cdot \frac{1}{5}\)

  • Errors on both pairs: probability \(p^2\), fraction preserving = \(\frac{3}{15} \cdot \frac{3}{15} = \frac{1}{25}\)
    β†’ Contribution: \(p^2 \cdot \frac{1}{25}\)

Total fidelity:

\[ \begin{aligned} F &= (1 - p)^2 + 2 \cdot \frac{p(1 - p)}{5} + \frac{p^2}{25} \\ &= 1 - 2p + p^2 + \frac{2p}{5} - \frac{2p^2}{5} + \frac{p^2}{25} \\ &= 1 - \left(2 - \frac{2}{5}\right)p + \left(1 - \frac{2}{5} + \frac{1}{25}\right)p^2 \\ &= 1 - \frac{8}{5}p + \frac{16}{25}p^2 \\ &= \left(1 - \frac{4p}{5} \right)^2 \end{aligned} \]

Final Answer

\[ \boxed{\left(1 - \frac{4p}{5}\right)^2} \]
User #3

The correct answer is: $ F_{\rm{physical}}=(1-\frac{12}{15}p)^2 $

Now let’s solve the next Checkpoint.

Checkpoint 2

Suppose that we wish to prepare a logical two-qubit GHZ state \((|00\rangle_{AB}+|11\rangle_{AB})/\sqrt{2}\) in the [[4,2,2]] code. To do so, we use the following state preparation circuit:

\[ (CNOT_{03}) (H_0) (CNOT_{21}) (H_2). \]

Note that this equation is written in matrix multiplication order, while the quantum operations in the circuit occur in the reverse order (from right-to-left in the above equation). \(H\) is a single-qubit Hadamard gate.

What is the logical state fidelity of the final 2-qubit logical state at the end of the circuit as a function of the two-qubit gate error rate \(p\), assuming the state is post-selected on all detectable errors in the code?

Assistant #4
Reasoning (model)

We are given: “Suppose that we wish to prepare a logical two-qubit GHZ state \((|00\rangle_{AB}+|11\rangle_{AB})/\sqrt{2}\) in the [[4,2,2]] code. To do so, we use the following state preparation circuit:

\[ (CNOT_{03}) (H_0) (CNOT_{21}) (H_2). \]

What is the logical state fidelity of the final 2-qubit logical state at the end of the circuit as a function of the two-qubit gate error rate \(p\), assuming the state is post-selected on all detectable errors in the code?”

Interpretation: Now we want logical state fidelity. And we assume post-selection on all detectable errors. That means that if an error occurs that is detectable by the code, we discard the state. Only if no detectable error occurs, we keep the state. And then we compute the fidelity of the logical state conditioned on passing post-selection.

The [[4,2,2]] code has distance 2. It can detect any single-qubit error? Actually, [[4,2,2]] code: It encodes 2 logical qubits into 4 physical qubits with distance 2. That means it can detect any single-qubit error? Actually, distance 2 means it can detect any error on 1 qubit? But careful: The stabilizers are XXXX and ZZZZ. So any single-qubit Pauli error will anti-commute with at least one stabilizer? Check: A single-qubit X error on qubit 0: That will anti-commute with ZZZZ? Actually, ZZZZ commutes with X on one qubit? Because X and Z anticommute. So yes, it will be detected. So any single-qubit error is detectable. But wait: The errors we have are two-qubit errors from depolarizing channels on pairs. But these errors might be detectable or not. We want to post-select on all detectable errors. That means if the error is detectable, we discard the state. So only if the error is undetectable (i.e., it is a logical operator or stabilizer) then we keep the state. And then we compute the fidelity of the logical state.

From previous analysis: The final state after ideal circuit and then errors is: ρ = (1-p)^2 |ψ><ψ| + … etc. But now we post-select: We only keep states that are not detected as errors. Which errors are detectable? The code’s stabilizers are S1 = XXXX and S2 = ZZZZ. An error is detectable if it anti-commutes with at least one stabilizer. An error is undetectable if it commutes with both stabilizers. That means the error is in the normalizer of the stabilizer group. That includes the stabilizers themselves and the logical operators. But careful: The state |ψ> is a specific logical state. Even if an error is a logical operator, it might change the logical state. For example, a logical X on one logical qubit would change |00> to |10> etc. So we want the fidelity of the logical state. So we want that the error, if it is undetectable, should actually be such that it leaves the logical state invariant (up to a phase) or at least does not change the logical information? But wait: “logical state fidelity” means: We want the state to be the desired logical GHZ state. So if an error is a logical operator that changes the logical state, then even though it is undetectable (because it commutes with stabilizers), it will reduce the fidelity. So post-selection: We discard states that are detected as errors. So we only keep states that are in the code space? Actually, not exactly: If an error is undetectable, it means that when we measure the stabilizers, we get +1. But that error could be a logical operator. So if we post-select on getting +1 on both stabilizers, then the state is in the code space. But it might be a different logical state. So then the fidelity conditioned on passing post-selection is: The probability that the state is exactly |ψ> (the desired logical state) given that it is in the code space. But wait: The problem says: “assuming the state is post-selected on all detectable errors in the code”. That means we only keep runs where no error is detected. That is equivalent to saying that the error applied is such that it commutes with both stabilizers. So the set of errors that are not detected are those that are in the normalizer of the stabilizer group. That set includes: - The stabilizers themselves: XXXX and ZZZZ (and their products? Actually, the stabilizer group is generated by XXXX and ZZZZ. So stabilizers are: I, XXXX, ZZZZ, XXXX ZZZZ? But careful: XXXX and ZZZZ commute? Actually, XXXX and ZZZZ commute? They act on different Pauli bases? Actually, XXXX and ZZZZ: X and Z anticommute on each qubit, so product of signs: For each qubit, X and Z anticommute, so overall, XXXX and ZZZZ: They commute if the number of qubits is even? Actually, check: XXXX * ZZZZ = (XβŠ—XβŠ—XβŠ—X)(ZβŠ—ZβŠ—ZβŠ—Z) = (XZ)βŠ—(XZ)βŠ—(XZ)βŠ—(XZ) = (-iY)βŠ—(-iY)βŠ—(-iY)βŠ—(-iY) = (-i)^4 (YβŠ—YβŠ—YβŠ—Y) = YYYY. So they do not necessarily commute? Wait, we need to check: For two operators to commute, we need that for each qubit, the operators commute or anticommute? Actually, two Pauli operators commute if the number of qubits where they anticommute is even. Here, on each qubit, X and Z anticommute. So on all 4 qubits, they anticommute. So the number of anticommuting qubits is 4, which is even, so they commute. So indeed, XXXX and ZZZZ commute. So the stabilizer group is {I, XXXX, ZZZZ, XXXX ZZZZ}. But note: XXXX ZZZZ = ? That equals? On each qubit, X Z = -iY, so product gives (-i)^4 YYYY = YYYY. So the stabilizers are: I, XXXX, ZZZZ, YYYY. So these are the stabilizers. So if an error is a stabilizer, then it leaves the code space invariant and also leaves the logical state invariant? Actually, careful: The stabilizers act as identity on the code space. So if an error is a stabilizer, then it is actually equivalent to no error on the code space. So errors that are stabilizers are harmless. But wait: But our error channels are applied to the physical qubits. But if the error is a stabilizer, then when we measure the stabilizers, we get +1. So such errors are not detected. So they are kept. And they do not change the logical state. So that’s good.

Then there are logical operators. The logical operators given: X_A = XIXI, X_B = XXII, Z_A = ZZII, Z_B = ZIZI. And their products. These operators commute with the stabilizers? Check: X_A commutes with XXXX? X_A is on qubits: qubit0: X, qubit1: I, qubit2: X, qubit3: I. XXXX: on all qubits X. They commute because on qubits where both are X, they commute; on qubits where one is I and the other is X, they commute. So yes. So logical operators are undetectable. But they change the logical state. So if an error is a logical operator, then the state becomes a different logical state. So that would reduce the fidelity.

Also, there might be errors that are products of stabilizers and logical operators. Those are also undetectable.

So in post-selection, we only keep runs where the error is undetectable. That means the error must commute with both stabilizers. So we want to compute the conditional fidelity: Given that the error is undetectable (i.e., it is in the normalizer of the stabilizer group), what is the probability that the logical state is still the desired GHZ state? And then the overall fidelity after post-selection will be that probability.

But careful: The errors come from two independent channels: on {1,2} and on {0,3}. And we determined that the overall effect is that the error is a Pauli operator E that is a product of an error on {1,2} and an error on {0,3}. And we computed the overlap fidelity for each such error. But now we are not looking at overlap with the physical state, but rather: We post-select on the error being undetectable. That means that E must commute with both stabilizers S1=XXXX and S2=ZZZZ. And then, if it is undetectable, then the state is in the code space. But it might be a logical error. The logical fidelity is then 1 if E is a stabilizer (or identity) and 0 if E is a nontrivial logical operator? But wait: Could it be that some logical operators actually leave the GHZ state invariant? The GHZ state is (|00>+|11>)/√2. That state is not necessarily an eigenvector of all logical operators. For example, logical X on qubit A would flip it to |10>+|01> which is orthogonal to the GHZ state. So indeed, if an error is a logical operator that is not identity on the logical space, then the fidelity becomes 0. But wait: What about logical operators that are products? For instance, X_A X_B? That would flip both qubits: |00> -> |11>, |11> -> |00>, so that actually leaves the GHZ state invariant? Because (|00>+|11>) is invariant under swapping both? Actually, check: X_A X_B |00> = |11>, and X_A X_B |11> = |00>, so indeed, X_A X_B (|00>+|11>) = |11>+|00> = same. So there might be some logical operators that preserve the GHZ state. So we need to determine which undetectable errors (those that commute with stabilizers) actually preserve the logical GHZ state.

Let’s denote the logical GHZ state as |Ψ⟩_L = (|00⟩_L + |11⟩_L)/√2. But careful: Our state is encoded. But we can work in the logical space. The undetectable errors are elements of the normalizer of the stabilizer group. They can be written as stabilizers times logical operators. So essentially, the effect on the logical state is given by a logical Pauli operator. So we want to know: For a logical Pauli operator L (which is a product of Paulis on the two logical qubits), when does L|Ψ⟩_L = Β±|Ψ⟩_L? That is, when is the GHZ state an eigenvector of L? The GHZ state for two qubits is: |Ψ⟩ = (|00⟩+|11⟩)/√2. Consider logical operators: I_L: obviously identity. X_A: XβŠ—I. Then X_A|Ψ⟩ = (|10⟩+|01⟩)/√2, which is orthogonal to |Ψ⟩. So fidelity 0. X_B: IβŠ—X? Actually, careful: The logical operators are defined: X_A = XIXI, X_B = XXII. But on the logical space, what are they? They act on the two logical qubits. We need to determine the action on the logical basis. The code [[4,2,2]] has logical operators: X_A = XIXI, X_B = XXII, Z_A = ZZII, Z_B = ZIZI. So on the logical basis, these act as Pauli matrices on the two logical qubits. So then the logical GHZ state is |00⟩_L + |11⟩_L (up to normalization). Then: X_A acts as Οƒ_x on first logical qubit: X_A|00⟩ = |10⟩, X_A|11⟩ = |01⟩, so X_A|Ψ⟩ = (|10⟩+|01⟩)/√2, which is orthogonal to |Ψ⟩. So fidelity 0. X_B acts as Οƒ_x on both? Actually, X_B = XXII means it applies X on qubit0 and qubit1? But careful: That is not necessarily a tensor product of logical operators? Actually, since the code encodes 2 qubits, the logical operators should be independent. Typically, we can choose a basis such that: Logical qubit A: X_A = XIXI, Z_A = ZZII. Logical qubit B: X_B = IXIX? That might be different. But the problem gives: X_B = XXII. And Z_B = ZIZI. So then on the logical basis, what is the action? We can determine by commutation relations: X_A and Z_A anticommute, and X_B and Z_B anticommute, and they commute with the others. So indeed, these are valid logical operators. So then on logical qubit A, X_A acts as Οƒ_x, and on logical qubit B, X_B acts as? But careful: X_B is XXII. That means it acts on qubits 0 and 1 with X. That is not a single-qubit Pauli on logical qubit B? But it must be. Actually, in a 2-qubit code, the logical operators are not unique. They are defined up to stabilizers. So we can take: X_A = XIXI, Z_A = ZZII, X_B = XXII, Z_B = ZIZI. Then check: X_B and Z_B: They anticommute? X_B Z_B = (XXII)(ZIZI) = (XZ on qubit0, XI on qubit1, IX on qubit2, II on qubit3?) Actually, compute: On qubit0: X and Z -> anticommute so gives -1 factor? Let’s do properly: X_B = X_0 X_1 I_2 I_3. Z_B = Z_0 I_1 Z_2 I_3. Their product: X_B Z_B = (X_0 Z_0) βŠ— (X_1 I_1) βŠ— (I_2 Z_2) βŠ— (I_3 I_3) = ( -i Y_0) βŠ— (X_1) βŠ— (Z_2) βŠ— I_3. That is not simply a phase. They should anticommute. Actually, check commutator: [X_B, Z_B] = X_B Z_B - Z_B X_B. Since X and Z anticommute on each qubit where both are non-identity, here qubit0: X and Z anticommute, so that gives a sign flip. So indeed, X_B and Z_B anticommute. So it’s fine. So then on the logical space, X_B acts as a Pauli on the second logical qubit. So we can denote: Logical qubit A: operators: X_A, Z_A. Logical qubit B: operators: X_B, Z_B. Then the GHZ state is |00⟩_L + |11⟩_L. Now, consider logical operator L = X_A X_B. Then L|00⟩ = |11⟩, L|11⟩ = |00⟩, so L|Ψ⟩ = |Ψ⟩. So that preserves the state. What about L = Z_A? Z_A|00⟩ = |00⟩, Z_A|11⟩ = -|11⟩, so Z_A|Ψ⟩ = (|00⟩ - |11⟩)/√2, which is orthogonal to |Ψ⟩. So fidelity 0. What about L = Z_B? Similarly, Z_B|00⟩ = |00⟩, Z_B|11⟩ = -|11⟩? Actually, careful: Z_B acts on second logical qubit: Z_B|00⟩ = |00⟩, Z_B|11⟩ = -|11⟩, so again orthogonal. What about L = Z_A Z_B? Then Z_A Z_B|00⟩ = |00⟩, Z_A Z_B|11⟩ = (-1)(-1)|11⟩ = |11⟩, so that preserves the state. What about L = X_A Z_B? That would give: X_A Z_B|00⟩ = |10⟩? Actually, X_A Z_B: on |00⟩, Z_B gives no change? Actually, Z_B on second qubit: |0⟩ -> |0⟩, so X_A flips first qubit: becomes |10⟩. On |11⟩, Z_B gives -|11⟩? Actually, careful: Z_B|1⟩ = -|1⟩, so |11⟩ -> -|11⟩, then X_A flips first qubit: becomes -|01⟩. So overall, X_A Z_B|Ψ⟩ = (|10⟩ - |01⟩)/√2, which is orthogonal to |Ψ⟩. Soζ€»η»“: The logical operators that preserve the GHZ state are: I, X_A X_B, and Z_A Z_B? Check Z_A Z_B: we did: gives |00⟩ and |11⟩ unchanged? Actually, Z_A Z_B|00⟩ = |00⟩, Z_A Z_B|11⟩ = (-1)(-1)|11⟩ = |11⟩, so yes. Also, what about Y_A Y_B? That would be i? Actually, Y_A Y_B = (i Z_A X_A)(i Z_B X_B) = - Z_A X_A Z_B X_B = - (Z_A Z_B)(X_A X_B) because they commute? Actually, careful: X_A and Z_B commute? Yes, they act on different qubits. So Y_A Y_B = - (Z_A Z_B)(X_A X_B). So if both X_A X_B and Z_A Z_B preserve the state, then their product will preserve the state? But then there is a minus sign? Let’s check: Y_A Y_B|00⟩ = Y_A Y_B|00⟩ = (iΟƒ_y βŠ— iΟƒ_y)|00⟩ = (-Οƒ_yβŠ—Οƒ_y)|00⟩ =? Actually, compute directly: Οƒ_y|0⟩ = i|1⟩, so Οƒ_yβŠ—Οƒ_y|00⟩ = i|1⟩ βŠ— i|1⟩ = -|11⟩. And Οƒ_yβŠ—Οƒ_y|11⟩ = (-i|0⟩)βŠ—(-i|0⟩) = -|00⟩. So Y_A Y_B|Ψ⟩ = - (|11⟩+|00⟩) = -|Ψ⟩. So indeed, Y_A Y_B also preserves the state (up to a phase). So actually, the set of logical operators that preserve the GHZ state are those that are either I, or flip both qubits in the same way? More systematically: The GHZ state |00⟩+|11⟩ is stabilized by the group generated by XβŠ—X and ZβŠ—Z. So any logical operator that is in that group will preserve the state. So the stabilizer of the GHZ state in the logical space is {I, X_A X_B, Z_A Z_B, Y_A Y_B} (note that (X_A X_B)(Z_A Z_B) = -i Y_A Y_B? Actually, careful: X_A X_B * Z_A Z_B = (X_A Z_A) βŠ— (X_B Z_B) = (-i Y_A) βŠ— (-i Y_B) = - Y_A Y_B. So indeed, the group is of order 4. So if an undetectable error acts as a logical operator that is in this group, then the logical state is correct (fidelity 1). If it acts as any other logical operator, then the logical state is orthogonal to the desired state, so fidelity 0.

But wait: There is also the possibility that the error is a stabilizer. Stabilizers act as identity on the code space. So they are fine.

So, in post-selection, we only keep runs where the error E is undetectable. That means E must commute with both XXXX and ZZZZ. And then the logical fidelity is 1 if the logical part of E (mod stabilizers) is in the group that stabilizes the GHZ state, and 0 otherwise.

Now, we need to compute: Given that an error occurs from our two channels, what is the probability that it is undetectable? And among those, what fraction have the property that the logical effect is trivial (i.e., in the stabilizer of the GHZ state)?

But careful: The errors come from two independent channels: one on {1,2} and one on {0,3}. And we determined that the overall error is a Pauli operator E = E_{03} * E_{21}, where E_{03} acts on qubits {0,3} and E_{21} acts on qubits {1,2}. And these are chosen independently from the set of 15 non-identity Paulis each with probability p/15, and identity with probability 1-p.

So let’s denote: A = error on {0,3} (can be I or one of 15 Paulis) B = error on {1,2} (similarly)

And the overall error is E = A * B.

We want to know: When is E undetectable? That is, E commutes with S1 = XXXX and S2 = ZZZZ. Since A and B act on disjoint sets, E commutes with S if and only if A commutes with S and B commutes with S? Actually, careful: S acts on all qubits. But since A and B act on different qubits, we have: [E, S] = A B S - S A B = A S B - S A B? Not exactly because S commutes with B? Actually, S = XXXX. Write S = S_0 S_1 S_2 S_3. A acts on qubits 0 and 3. B acts on qubits 1 and 2. So S = (S_0 S_3) (S_1 S_2). And A commutes with S_1 S_2 because they act on different qubits. So [E, S] = A B S - S A B = A S B - S A B = (A S_0 S_3 - S_0 S_3 A) B S_1 S_2? Actually, let’s do it properly: E = A βŠ— B (since they act on disjoint sets). S = (S_0 βŠ— S_3) βŠ— (S_1 βŠ— S_2) but careful: Actually, S = XXXX means: X on qubit0, X on qubit1, X on qubit2, X on qubit3. So we can write S = (X_0 X_3) βŠ— (X_1 X_2) because these commute? Actually, X_0 X_3 and X_1 X_2 commute because they act on different qubits. So S = (X_0 X_3) (X_1 X_2). Similarly, ZZZZ = (Z_0 Z_3)(Z_1 Z_2). Then E commutes with S if and only if A commutes with X_0 X_3 and B commutes with X_1 X_2? Not exactly: E and S are both products of operators on disjoint sets. Actually, since A and B act on different sets, we have: E S = (A (X_0 X_3)) (B (X_1 X_2)) and S E = ((X_0 X_3) A) ((X_1 X_2) B). So E commutes with S if and only if A commutes with X_0 X_3 and B commutes with X_1 X_2. But wait: Is that sufficient? Check: If A commutes with X_0 X_3, then A (X_0 X_3) = (X_0 X_3) A. And if B commutes with X_1 X_2, then similarly. So yes, E commutes with S if and only if A commutes with X_0 X_3 and B commutes with X_1 X_2. Similarly, E commutes with ZZZZ if and only if A commutes with Z_0 Z_3 and B commutes with Z_1 Z_2.

So, for E to be undetectable, we need: A must commute with both X_0 X_3 and Z_0 Z_3. B must commute with both X_1 X_2 and Z_1 Z_2.

Now, what are the Pauli operators on two qubits that commute with both XβŠ—X and ZβŠ—Z? Let’s analyze for two qubits. Consider a Pauli operator on two qubits, say on qubits i and j. We want P such that [P, X_i X_j] = 0 and [P, Z_i Z_j] = 0. Write P = Οƒ_a βŠ— Οƒ_b, where Οƒ_a, Οƒ_b ∈ {I, X, Y, Z} but not both I? Actually, we consider all Paulis including identity. We want: P (XβŠ—X) = (XβŠ—X) P. Since P is a Pauli, this commutation condition is that the number of qubits where P and XβŠ—X anticommute is even. Actually, easier: The operators that commute with XβŠ—X are those that are either both I or both X? Actually, let’s list: For two qubits, the Pauli group has 16 elements. Which ones commute with XβŠ—X? XβŠ—X itself commutes. IβŠ—I commutes. What about XβŠ—I? Check: (XβŠ—I)(XβŠ—X) = X^2 βŠ— X = IβŠ—X. (XβŠ—X)(XβŠ—I) = X^2 βŠ— X = IβŠ—X. So actually, XβŠ—I commutes with XβŠ—X? Wait, careful: They act on different qubits? Actually, XβŠ—I and XβŠ—X: On the first qubit, both are X, so they commute. On the second qubit, I and X commute. So yes, XβŠ—I commutes with XβŠ—X. But does XβŠ—I commute with ZβŠ—Z? Check: (XβŠ—I)(ZβŠ—Z) = (XZ)βŠ—(Z) = -i YβŠ—Z. (ZβŠ—Z)(XβŠ—I) = (ZX)βŠ—(Z) = i YβŠ—Z. So they anticommute. So for undetectability, we need commutation with both XβŠ—X and ZβŠ—Z. So let’s determine: On two qubits, the condition that a Pauli P commutes with both XβŠ—X and ZβŠ—Z. Write P = Β± (Οƒ1 βŠ— Οƒ2) where Οƒ1,Οƒ2 ∈ {I,X,Y,Z}. The phase doesn’t affect commutation. So we need: [Οƒ1βŠ—Οƒ2, XβŠ—X] = 0 and [Οƒ1βŠ—Οƒ2, ZβŠ—Z] = 0. The commutator [Οƒ1βŠ—Οƒ2, XβŠ—X] = 0 if and only if Οƒ1 and X commute and Οƒ2 and X commute, OR Οƒ1 and X anticommute and Οƒ2 and X anticommute? Actually, because (Οƒ1βŠ—Οƒ2)(XβŠ—X) = (Οƒ1 X)βŠ—(Οƒ2 X) and (XβŠ—X)(Οƒ1βŠ—Οƒ2) = (X Οƒ1)βŠ—(X Οƒ2). So these are equal if and only if Οƒ1 X = Β± X Οƒ1 and Οƒ2 X = Β± X Οƒ2, and the signs must be the same? Actually, if Οƒ1 anticommutes with X, then Οƒ1 X = - X Οƒ1. So then (Οƒ1βŠ—Οƒ2)(XβŠ—X) = (-1) (X Οƒ1)βŠ—(Οƒ2 X). And (XβŠ—X)(Οƒ1βŠ—Οƒ2) = (X Οƒ1)βŠ—(X Οƒ2). For these to be equal, we need that Οƒ2 also anticommutes with X so that then (Οƒ1βŠ—Οƒ2)(XβŠ—X) = (-1)*(-1) (X Οƒ1)βŠ—(X Οƒ2) = (X Οƒ1)βŠ—(X Οƒ2). So indeed, [P, XβŠ—X]=0 if either both Οƒ1 and Οƒ2 commute with X, or both anticommute with X. Similarly, [P, ZβŠ—Z]=0 if either both Οƒ1 and Οƒ2 commute with Z, or both anticommute with Z. So let’s list Paulis on two qubits (ignoring phase) that satisfy these conditions: We need: For X: either (Οƒ1 commutes with X and Οƒ2 commutes with X) OR (Οƒ1 anticommutes with X and Οƒ2 anticommutes with X). For Z: either (Οƒ1 commutes with Z and Οƒ2 commutes with Z) OR (Οƒ1 anticommutes with Z and Οƒ2 anticommutes with Z).

Now, what Paulis commute with X? I and X commute with X. Y and Z anticommute with X. What Paulis commute with Z? I and Z commute with Z. X and Y anticommute with Z. So, condition for X: Case 1: Both Οƒ1 and Οƒ2 commute with X. That means Οƒ1, Οƒ2 ∈ {I, X}. Case 2: Both Οƒ1 and Οƒ2 anticommute with X. That means Οƒ1, Οƒ2 ∈ {Y, Z}.

Condition for Z: Case A: Both Οƒ1 and Οƒ2 commute with Z. That means Οƒ1, Οƒ2 ∈ {I, Z}. Case B: Both Οƒ1 and Οƒ2 anticommute with Z. That means Οƒ1, Οƒ2 ∈ {X, Y}.

So for P to commute with both XβŠ—X and ZβŠ—Z, we need that the pair (Οƒ1, Οƒ2) satisfies either (Case 1 and Case A) or (Case 1 and Case B) or (Case 2 and Case A) or (Case 2 and Case B). Let’s check: Case 1 & Case A: Οƒ1,Οƒ2 ∈ {I,X} ∩ {I,Z} = {I} only. So that gives: IβŠ—I. But IβŠ—I is identity. But wait, what about XβŠ—X? That is in Case 1? Actually, XβŠ—X: Οƒ1=X, Οƒ2=X. That is in Case 1? But then for Z: X anticommutes with Z, so XβŠ—X would fall into Case 1 & Case B? Because Case 1 requires commute with X, so X is okay. Case B requires anticommute with Z, and X anticommutes with Z. So XβŠ—X is in (Case 1 & Case B). So let’s do systematically:

We want pairs (Οƒ1, Οƒ2) such that: (Οƒ1, Οƒ2) must be either both in {I,X} or both in {Y,Z} from X condition. And from Z condition, they must be either both in {I,Z} or both in {X,Y}.

So combine: If both in {I,X} from X condition, then from Z condition, they could be both in {I,Z} or both in {X,Y}. - Both in {I,X} and both in {I,Z} gives: only I,I. So that gives IβŠ—I. - Both in {I,X} and both in {X,Y} gives: intersection of {I,X} and {X,Y} is {X} only. So that gives XβŠ—X. So from the (I,X) branch, we get: IβŠ—I and XβŠ—X.

Now if both in {Y,Z} from X condition, then from Z condition, they could be both in {I,Z} or both in {X,Y}. - Both in {Y,Z} and both in {I,Z} gives: intersection is {Z} so that gives ZβŠ—Z. - Both in {Y,Z} and both in {X,Y} gives: intersection is {Y} so that gives YβŠ—Y. So from the (Y,Z) branch, we get: ZβŠ—Z and YβŠ—Y.

So the Pauli operators on two qubits that commute with both XβŠ—X and ZβŠ—Z are exactly: IβŠ—I, XβŠ—X, YβŠ—Y, ZβŠ—Z. But wait: What about IβŠ—X? That does not work because from X condition: I and X: I commutes with X, X commutes with X, so that satisfies X condition. But from Z condition: I commutes with Z, but X anticommutes with Z, so that fails. So indeed, on two qubits, the operators that commute with both XβŠ—X and ZβŠ—Z are only those that are the same Pauli on both qubits (including identity). So that means: For the error on {0,3} to be undetectable, A must be such that A commutes with X_0 X_3 and Z_0 Z_3. That means A must be one of: I, X_0 X_3, Y_0 Y_3, Z_0 Z_3. But wait: Is that sufficient? Check: If A = X_0 X_3, then it commutes with X_0 X_3 obviously, and with Z_0 Z_3? We already checked: X_0 X_3 and Z_0 Z_3: On each qubit, X and Z anticommute, so overall they commute because even number? Actually, check: (X_0 X_3)(Z_0 Z_3) = (X_0 Z_0)(X_3 Z_3) = (-iY_0)(-iY_3) = -Y_0 Y_3. And (Z_0 Z_3)(X_0 X_3) = (Z_0 X_0)(Z_3 X_3) = (iY_0)(iY_3) = -Y_0 Y_3. So they commute. So yes. Similarly, for the error on {1,2}, B must be one of: I, X_1 X_2, Y_1 Y_2, Z_1 Z_2.

But wait: There is also the possibility that A and B individually are not undetectable, but their product might be undetectable? Because undetectability condition is on the overall E = A B. But since A and B act on disjoint sets, we have: E commutes with S if and only if A commutes with (X_0 X_3) and B commutes with (X_1 X_2) as argued. Because S = (X_0 X_3)(X_1 X_2) and A commutes with (X_1 X_2) automatically since they act on different qubits. So indeed, E commutes with S if and only if A commutes with X_0 X_3 and B commutes with X_1 X_2. Similarly for Z. So actually, for E to be undetectable, we need A to commute with X_0 X_3 and Z_0 Z_3, and B to commute with X_1 X_2 and Z_1 Z_2. So that means A must be in the set U_{03} = {I, X_0 X_3, Y_0 Y_3, Z_0 Z_3} and B must be in the set U_{12} = {I, X_1 X_2, Y_1 Y_2, Z_1 Z_2}. But wait: Is that necessary? Could it be that A does not commute with X_0 X_3 but B does something such that overall it commutes? Let’s check: Suppose A = X_0 I_3. Then A does not commute with X_0 X_3? Actually, check: X_0 I_3 and X_0 X_3: They commute? X_0 I_3 and X_0 X_3: On qubit0, both are X, so commute; on qubit3, I and X commute. So actually, X_0 I_3 commutes with X_0 X_3? But wait, we need commutation with both X_0 X_3 and Z_0 Z_3. Check with Z_0 Z_3: X_0 I_3 and Z_0 Z_3: On qubit0, X and Z anticommute; on qubit3, I and Z commute. So overall, they anticommute. So A = X_0 I_3 does not commute with Z_0 Z_3. So indeed, for A to commute with both, it must be that on qubit0 and qubit3, the pattern is such that either both commute with X and Z? Actually, our derivation above shows that on two qubits, the only operators that commute with both XβŠ—X and ZβŠ—Z are those that are the same Pauli on both qubits. So that is correct. So indeed, for undetectability, we require that A ∈ U_{03} and B ∈ U_{12}.

So, the probability that the error is undetectable is: P(undetectable) = P(A ∈ U_{03}) * P(B ∈ U_{12}) because they are independent. Now, what is P(A ∈ U_{03})? A is from the error channel on {0,3}. That channel: With probability 1-p, A = I. With probability p, A is uniformly distributed among the 15 non-identity Paulis on {0,3}. Among these 15, how many are in U_{03}? U_{03} contains besides I: X_0 X_3, Y_0 Y_3, Z_0 Z_3. So there are 3 non-identity Paulis that are undetectable. So P(A ∈ U_{03}) = (1-p) + p*(3/15) = 1-p + p/5 = 1 - (4/5)p. Similarly, P(B ∈ U_{12}) = 1 - (4/5)p. So the probability that the overall error is undetectable is: P(undetectable) = (1 - 4p/5)^2.

But wait: That is exactly the fidelity we computed earlier for the physical state fidelity? That was (1 - 4p/5)^2. And indeed, that makes sense: The physical fidelity was the probability that the error does not change the state. And that required that the error is actually in the set that preserves the state. And we found that set was: For {0,3} errors, the preserving ones were exactly X_0 X_3, Y_0 Y_3, Z_0 Z_3? But wait, earlier we found that for {0,3} errors, the ones that give overlap 1 were exactly these three. And for {1,2} errors, the ones that give overlap 1 were X_1 X_2, Y_1 Y_2, Z_1 Z_2. And then combined, if both are from these sets, then the product gives overlap 1. So indeed, the physical fidelity is exactly the probability that the error is undetectable? But careful: Is that true? Physical fidelity F_physical = (1 - 4p/5)^2. And P(undetectable) = (1 - 4p/5)^2 as well. So that means that if an error is undetectable, then it actually preserves the physical state? But wait, that is not necessarily true: An error could be undetectable but still change the logical state. For example, consider A = X_0 X_3 and B = I. That is undetectable? Check: A = X_0 X_3 is in U_{03} so yes. But does that preserve the physical state? We computed earlier: For an error on {0,3} only, the ones that preserve the state are exactly those three? Actually, we computed that for an error on {0,3} only, the overlap is 1 only if the error is one of X_0 X_3, Y_0 Y_3, Z_0 Z_3. So yes, that works. So indeed, it seems that if an error is undetectable, then it actually leaves the physical state invariant? But wait, consider an error that is a logical operator. For example, what is a logical operator? The logical operators are given. For instance, X_A = XIXI. Is that undetectable? Check: XIXI acts on qubits 0 and 2? Actually, X_A = XIXI means: qubit0: X, qubit1: I, qubit2: X, qubit3: I. That is not of the form that commutes with XXXX? Let’s check: XIXI and XXXX: On qubit0: X and X commute; qubit1: I and X commute; qubit2: X and X commute; qubit3: I and X commute. So it commutes with XXXX. With ZZZZ: On qubit0: X and Z anticommute; qubit1: I and Z commute; qubit2: X and Z anticommute; qubit3: I and Z commute. So overall, anticommute? Actually, number of anticommuting qubits: qubit0 and qubit2 anticommute, so that’s 2, which is even, so they commute? Wait, careful: For two Pauli operators to commute, the number of qubits where they anticommute must be even. Here, on qubit0: X and Z anticommute, so count 1; on qubit2: X and Z anticommute, so count 2; so even, so they commute. So XIXI commutes with ZZZZ as well? Check explicitly: (XIXI)(ZZZZ) = (XZ on qubit0, IZ on qubit1, XZ on qubit2, IZ on qubit3) = (-iY)(Z)(-iY)(Z) = (-i)(-i) (Y Z)(Y Z)? Actually, better: On qubit0: XZ = -iY; on qubit1: IZ = Z; on qubit2: XZ = -iY; on qubit3: IZ = Z. So product = (-iY)(Z)(-iY)(Z) = (-i)(-i) (Y Z Y Z) = (-1) (Y Y)(Z Z) because Y and Z anticommute? Let’s do step: Y Z = -Z Y, so Y Z Y Z = Y (-Z Y) Z = -Y Z Y Z? I’m getting confused. Let’s do it qubit by qubit: The operators act on different qubits so they commute across qubits. So we want to check if (XIXI) and (ZZZZ) commute. They will commute if the number of qubits where they anticommute is even. On qubit0: X and Z anticommute -> so that gives a sign of -1 if we swap? Actually, the rule: Two Pauli operators P and Q commute if and only if for each qubit, either they commute or anticommute, and the total number of anticommuting qubits is even. Here, on qubit0: anticommute -> contributes a factor of -1 when swapping? Actually, the condition is: P Q = (-1)^(number of qubits where they anticommute) Q P. So if number is even, they commute. On qubit0: anticommute -> count=1; qubit1: commute -> count=1; qubit2: anticommute -> count=2; qubit3: commute -> count=2. So even, so they commute. So XIXI is undetectable. But does XIXI preserve the physical state? We computed earlier that for an error on {0,3} only, the preserving ones were those that are like X_0 X_3, etc. But XIXI is not of that form because it acts on qubits 0 and 2, not 0 and 3. But wait, our error channels are only on {0,3} and {1,2}. So an error like XIXI cannot occur from our channels because our channels only apply errors on the pairs that were involved in the CNOT gates. So indeed, the errors we get are always products of an operator on {0,3} and an operator on {1,2}. So they are of the form: (something on qubits 0 and 3) βŠ— (something on qubits 1 and 2). So that means that any error from our channels will have the property that it acts trivially on qubits? Actually, it will act on qubits 0 and 3 together and on qubits 1 and 2 together. So such an error will commute with X_0 X_3 and X_1 X_2 automatically? Not automatically, but as we derived, for it to commute with XXXX, we need that the part on {0,3} commutes with X_0 X_3 and the part on {1,2} commutes with X_1 X_2. And that forces them to be in U_{03} and U_{12} respectively. So indeed, from our error model, the only undetectable errors are those where A ∈ {I, X_0 X_3, Y_0 Y_3, Z_0 Z_3} and B ∈ {I, X_1 X_2, Y_1 Y_2, Z_1 Z_2}. And we already computed that if A is in that set and B is in that set, then the overall error actually preserves the physical state? Let’s check: If A = X_0 X_3 and B = I, then we already computed that gives fidelity 1. If A = X_0 X_3 and B = X_1 X_2, then that gives fidelity 1. If A = X_0 X_3 and B = Y_1 Y_2, then we computed that gives fidelity? We computed for combined: X_0 X_3 and Y_1 Y_2 gave: overall operator = X_0 X_3 Y_1 Y_2. Does that preserve the physical state? We computed earlier for an error on {1,2} only, the preserving ones were X_1 X_2, Y_1 Y_2, Z_1 Z_2. So if B = Y_1 Y_2, then that alone would preserve the state? But wait, we computed for an error on {1,2} only: We determined that the ones that give overlap 1 are exactly X_1 X_2, Y_1 Y_2, Z_1 Z_2. So yes, if B = Y_1 Y_2, then that error alone would preserve the state. And since A and B act on disjoint sets, if each preserves the state, then their product preserves the state. So indeed, if A ∈ U_{03} and B ∈ U_{12}, then the overall error E preserves the physical state. So that means that for our error model, the condition for undetectability is exactly the same as the condition for the error to not change the physical state. And we computed that probability as (1 - 4p/5)^2. So then if we post-select on undetectable errors, we are keeping exactly those runs where the physical state is perfect. So then the logical state fidelity after post-selection would be 1? That seems too trivial. But wait, the problem asks: “What is the logical state fidelity … assuming the state is post-selected on all detectable errors?” That would then be 1? But that is not interesting. Perhaps I misinterpreted: “post-selected on all detectable errors” might mean that we discard any run where an error is detected. But that does not guarantee that the state is correct because there could be undetectable errors that are logical errors. But as argued, from our error model, any undetectable error actually preserves the state. But is that always true? Let’s check: Could there be an undetectable error that is a logical operator? For example, consider an error that is X_A = XIXI. But can that occur from our error channels? Our error channels only apply errors on the pairs {0,3} and {1,2}. So an error like XIXI would require that on qubits 0 and 3, we have X on qubit0 and I on qubit3, and on qubits 1 and 2, we have I on qubit1 and X on qubit2. But is that product in the form A * B? That would be: A = X_0 I_3 and B = I_1 X_2. But are these in U_{03} and U_{12}? Check A = X_0 I_3: Does it commute with X_0 X_3? X_0 I_3 and X_0 X_3: On qubit0, both X commute; on qubit3, I and X commute. So it commutes with X_0 X_3. But does it commute with Z_0 Z_3? X_0 I_3 and Z_0 Z_3: On qubit0, X and Z anticommute; on qubit3, I and Z commute. So overall, they anticommute. So A = X_0 I_3 is not in U_{03} because it does not commute with Z_0 Z_3. So indeed, from our error model, the errors are restricted to products of operators on the specific pairs that are acted upon by the CNOT gates. And because of that, the only undetectable errors are those that are actually stabilizers of the physical state? That seems to be the case from our analysis: For an error on {0,3} to be undetectable, it must be in {I, X_0X_3, Y_0Y_3, Z_0Z_3}. And these actually we found give physical fidelity 1. Similarly for {1,2}. So then if we post-select on no detection, we are only keeping runs where the error is such that A ∈ U_{03} and B ∈ U_{12}. And then the state is exactly the ideal state. So then the logical fidelity after post-selection would be 1.

But wait, the problem likely expects an answer that is not 1. Perhaps I misinterpreted: “post-selected on all detectable errors” might mean that we detect errors using the code’s error detection capability. The code can detect any error that is not in the normalizer. So if an error is detected, we discard the state. So the only states we keep are those for which the error is undetectable. But as argued, from our error model, the undetectable errors are exactly those that do not change the state. So then the fidelity would be 1. But that seems too perfect.

Maybe there is another interpretation: The circuit itself might introduce errors that are not correctable by the code? Or perhaps the post-selection is on errors that are detected by the code’s stabilizer measurements. But then if no error is detected, the state is in the code space. However, it could be that the state is in the code space but is a different logical state. For example, consider an error that is a logical operator. But as argued, such an error would require that the error on {0,3} is not in U_{03} because logical operators typically act on single qubits across these pairs. But wait, could there be an error that is undetectable but still changes the logical state? For that, the error would have to be something like: A = X_0 I_3 and B = I_1 X_2. But is that undetectable? Check: A = X_0 I_3. Does it commute with X_0 X_3? Yes, as checked. Does it commute with Z_0 Z_3? No, because on qubit0, X and Z anticommute. So it is detectable. So indeed, any error that is not of the form same Pauli on both qubits in a pair will be detected because it will anticommute with either XβŠ—X or ZβŠ—Z on that pair. So therefore, with this error model (errors only on the pairs that are involved in CNOT gates), the only undetectable errors are those that actually leave the state invariant. So then the logical fidelity after post-selection is 1.

But wait, the problem might be asking for the logical state fidelity without post-selection? But that would be the physical fidelity? But that was subproblem 1. Subproblem 2 says: “What is the logical state fidelity … assuming the state is post-selected on all detectable errors?” That suggests that after post-selection, the state is guaranteed to be in the code space. But then its fidelity could be less than 1 if there are undetectable logical errors. But as argued, due to the structure of the errors coming from CNOT gates, any undetectable error actually is harmless.

I will re-read the problem statement: “Suppose that we wish to prepare a logical two-qubit GHZ state \((|00\rangle_{AB}+|11\rangle_{AB})/\sqrt{2}\) in the [[4,2,2]] code. To do so, we use the following state preparation circuit:

\[ (CNOT_{03}) (H_0) (CNOT_{21}) (H_2). \]

What is the logical state fidelity of the final 2-qubit logical state at the end of the circuit as a function of the two-qubit gate error rate \(p\), assuming the state is post-selected on all detectable errors in the code?”

Maybe “post-selected on all detectable errors” means that we measure the stabilizers and if we detect an error, we discard the state. So we only keep states that yield no error syndrome. That means the error must be in the set of operators that commute with the stabilizers. That set is larger than what I considered? Actually, the set of operators that commute with the stabilizers is the normalizer of the stabilizer group. That includes operators that act on single qubits? But wait, consider an operator that acts on only one qubit, say X on qubit0. Does that commute with XXXX? X on qubit0 commutes with XXXX because on qubit0, X and X commute; on other qubits, identity and X commute. So X on qubit0 commutes with XXXX. But does it commute with ZZZZ? X on qubit0 and ZZZZ: On qubit0, X and Z anticommute; on others, identity and Z commute. So overall, they anticommute. So X on qubit0 is detectable because it anticommutes with ZZZZ. So indeed, any single-qubit error will anticommute with at least one stabilizer? Check: X on qubit0: anticommutes with ZZZZ. Z on qubit0: anticommutes with XXXX. Y on qubit0: anticommutes with both? Actually, Y anticommutes with X and Z? So yes, single-qubit errors are detectable. What about two-qubit errors that are not on the pairs that are acted upon by CNOT? For example, an error on qubits 0 and 1. Consider X on qubit0 and X on qubit1. That is XβŠ—XβŠ—IβŠ—I. Does it commute with XXXX? On qubits 0 and 1, X and X commute; on qubits 2 and 3, I and X commute. So it commutes with XXXX. With ZZZZ: On qubit0, X and Z anticommute; on qubit1, X and Z anticommute; on qubits 2 and 3, I and Z commute. So overall, anticommute? Actually, two anticommutes give commute because (-1)*(-1)=1. So XβŠ—XβŠ—IβŠ—I commutes with ZZZZ as well? Check carefully: XXXX = X_0 X_1 X_2 X_3. ZZZZ = Z_0 Z_1 Z_2 Z_3. Consider E = X_0 X_1 I_2 I_3. Compute commutator with XXXX: E XXXX = X_0 X_1 I_2 I_3 * X_0 X_1 X_2 X_3 = (X_0 X_0)(X_1 X_1)(I X_2)(I X_3) = I I X_2 X_3 = X_2 X_3. XXXX E = X_0 X_1 X_2 X_3 * X_0 X_1 I_2 I_3 = (X_0 X_0)(X_1 X_1)(X_2 I)(X_3 I) = I I X_2 X_3 = X_2 X_3. So they commute. With ZZZZ: E ZZZZ = X_0 X_1 I_2 I_3 * Z_0 Z_1 Z_2 Z_3 = (X_0 Z_0)(X_1 Z_1)(I Z_2)(I Z_3) = (-iY_0)(-iY_1) Z_2 Z_3 = (-1) Y_0 Y_1 Z_2 Z_3. ZZZZ E = Z_0 Z_1 Z_2 Z_3 * X_0 X_1 I_2 I_3 = (Z_0 X_0)(Z_1 X_1)(Z_2 I)(Z_3 I) = (iY_0)(iY_1) Z_2 Z_3 = (-1) Y_0 Y_1 Z_2 Z_3. So they commute actually. So E = X_0 X_1 I_2 I_3 commutes with both stabilizers. So that error is undetectable. And is it possible from our error model? Our error model only applies errors on the pairs {0,3} and {1,2} because they come from CNOT gates. So an error like X_0 X_1 cannot occur because it involves qubits 0 and 1 together, but our errors are only on {0,3} and {1,2}. So indeed, the errors we get are always products of an operator on {0,3} and an operator on {1,2}. So that restricts the form of errors to be of the type: (Pauli on qubits 0 and 3) βŠ— (Pauli on qubits 1 and 2). And as we determined, for such an error to commute with XXXX, we need that the part on {0,3} commutes with X_0 X_3 and the part on {1,2} commutes with X_1 X_2. And that forces them to be in {I, X_0X_3, Y_0Y_3, Z_0Z_3} and similarly for {1,2}. So indeed, with this error model, any undetectable error actually leaves the state invariant. So then the logical fidelity after post-selection is 1.

But wait, the problem might be asking for the probability of success of post-selection? That is (1-4p/5)^2. But that is the physical fidelity without post-selection.

I will re-read the problem: “Subproblem 1: … What is the physical state fidelity … Subproblem 2: … What is the logical state fidelity … assuming the state is post-selected on all detectable errors in the code?”

So Subproblem 1 is about the physical state fidelity without any post-selection. Subproblem 2 is about the logical state fidelity after post-selection. That would be the fidelity of the logical state conditioned on that no error was detected. And since any undetectable error actually gives the correct state, the logical fidelity should be 1.

However, that seems too trivial. Perhaps there is a catch: The circuit itself might introduce errors that are not correctable even after post-selection? Or maybe the post-selection is done by measuring the stabilizers. But if an error is undetectable, it means it is in the normalizer. But wait, could it be that some undetectable errors actually change the logical state? For that, we would need an error that is of the form something like: On {0,3}, could we have an error that is undetectable but not identity on the logical space? For example, consider A = X_0 X_3 is undetectable. What is its logical action? X_0 X_3. Is that a logical operator? Let’s check: The logical operators are given as X_A = XIXI and X_B = XXII. Can X_0 X_3 be written as a product of these? X_0 X_3 = (X_0 I_1 I_2 I_3) * (I_0 I_1 I_2 X_3). But are these logical operators? XIXI is X_A. But I_0 I_1 I_2 X_3 is not one of the given logical operators. However, it might be equivalent to a logical operator times a stabilizer? For instance, I_0 I_1 I_2 X_3. commute with stabilizers? Check with ZZZZ: I_0 I_1 I_2 X_3 and ZZZZ: On qubit3, X and Z anticommute, so that would anticommute? So actually, I_0 I_1 I_2 X_3 is not undetectable because it doesn’t commute with ZZZZ. So indeed, any error that is undetectable must be such that on each pair, it is the same Pauli on both qubits. So that means it is of the form: (Οƒ_0 Οƒ_3) and (Ο„_1 Ο„_2). Now, what is the logical effect of such an error? Let’s compute the action on the logical operators. The logical operators are: X_A = XIXI. Z_A = ZZII. X_B = XXII. Z_B = ZIZI. Consider an error E = (Οƒ_0 Οƒ_3) βŠ— (Ο„_1 Ο„_2). We want to see if this error acts as a logical operator on the code space. Actually, any operator that commutes with the stabilizers will act on the code space as a logical operator. So let’s determine the logical action of E. Take basis states for the code. The code [[4,2,2]] has stabilizers S1=XXXX, S2=ZZZZ. The logical states can be taken as: |00⟩L = |0000⟩ + |1111⟩? Not sure. Actually, our desired state is |ψ⟩ = (|0000⟩+|0110⟩+|1001⟩+|1111⟩)/2. That state is actually not a basis state of the logical qubits? It is an entangled state between the two logical qubits. Maybe we can determine the logical effect by seeing how E changes the logical operators. If E is undetectable, then it commutes with stabilizers, so it will map the code space to itself. Its action on the logical operators can be determined by conjugation. For example, if E = X_0 X_3, then what is its action on X_A? X_A = XIXI. Compute E X_A E^\dagger = (X_0 X_3)(X_0 I_2? Actually, careful: X_A = X_0 I_1 X_2 I_3. Then E X_A E = (X_0 X_3)(X_0 I_1 X_2 I_3)(X_0 X_3) because Paulis are involutory. = X_0 X_3 X_0 I_1 X_2 I_3 X_0 X_3 = (X_0 X_0 X_0) actually, let’s do qubit by qubit: On qubit0: X_0 * X_0 * X_0 = X_0 because X_0^2=I actually careful: E = X_0 X_3, so on qubit0, we have X_0. Then X_A has X_0 on qubit0. So product: X_0 * X_0 * X_0 = X_0? Actually, better: E X_A E = (X_0 X_3) (X_0 I_1 X_2 I_3) (X_0 X_3) = on qubit0: X_0 X_0 X_0 = X_0 (since X_0^2=I, so actually X_0 X_0 = I, so it becomes I * X_0 = X_0) wait, let’s do properly: For any Pauli, P Q P = Β± Q depending on commutation. So we can use that. E = X_0 X_3. X_A = X_0 I_1 X_2 I_3. Do they commute? Check between E and X_A: E and X_A: On qubit0, both X -> commute; qubit1: I and I -> commute; qubit2: I and X -> commute; qubit3: X and I -> commute. So actually, E and X_A commute. So then E X_A E = X_A. So that means that E acts trivially on X_A. What about Z_A = ZZII. E and Z_A: On qubit0: X and Z anticommute; qubit1: I and Z commute; qubit2: I and I commute; qubit3: X and I commute. So overall, they anticommute? Actually, careful: E and Z_A: The anticommutation comes only from qubit0. So they anticommute. So then E Z_A E = - Z_A. So that means that E acts as a logical operator that flips the sign of Z_A. That would be like a logical Pauli on qubit A? Actually, if something commutes with X_A and anticommutes with Z_A, then it is proportional to Z_A itself? Actually, wait: If an operator L satisfies L X_A L = X_A and L Z_A L = - Z_A, then L could be Z_A itself because Z_A X_A Z_A = - X_A actually? Let’s check: Z_A X_A Z_A = - X_A because Z and X anticommute. So that’s not it. What operator would give that? If L = something that commutes with X and anticommutes with Z, then L must be like Y? Because Y X Y = -X? No. Actually, let’s determine: We want an operator L such that L X_A L = X_A and L Z_A L = -Z_A. Consider L = I? That gives both positive. Consider L = X_A? Then X_A X_A X_A = X_A, and X_A Z_A X_A = -Z_A. So actually, X_A works? But wait, X_A anticommutes with Z_A? Yes, because X and Z anticommute. So X_A gives: X_A X_A X_A = X_A, and X_A Z_A X_A = -Z_A. So that means that E acts as X_A on the logical space? But then that would change the logical state. But wait, we earlier argued that if E = X_0 X_3 alone, then it should preserve the physical state. There is a contradiction. Let’s check directly with state: E = X_0 X_3. Apply that to |ψ⟩ = (|0000⟩+|0110⟩+|1001⟩+|1111⟩)/2. X_0 X_3|0000⟩ = |1001⟩ because flip qubit0 and qubit3: 0000 -> 1001. X_0 X_3|0110⟩ = |1111⟩? Actually, 0110 -> flip qubit0 and qubit3: becomes 1111. X_0 X_3|1001⟩ = |0000⟩. X_0 X_3|1111⟩ = |0110⟩. So indeed, X_0 X_3|ψ⟩ = |ψ⟩. So physically, it leaves the state invariant. So why does the conjugation suggest that it acts as X_A? Because X_A would send |00⟩_L to |10⟩_L, which would change the state. So there is an inconsistency. Let’s determine the logical action carefully. The code [[4,2,2]] has logical operators. We need to know how they act on the code space. Our state |ψ⟩ is not necessarily a logical basis state. It is an entangled state between the two logical qubits. So maybe the logical action of an operator is determined by its effect on the logical operators. But careful: The logical operators are defined up to stabilizers. So X_A is given as XIXI. But note that XIXI and X_0 X_3 might be related by a stabilizer? because X_0 X_3 * (I? actually, X_0 X_3 * something might equal XIXI? Consider: X_0 X_3 * X_1 X_2? That would give X_0 X_1 X_2 X_3 = XXXX, which is a stabilizer. So indeed, X_0 X_3 is actually equal to XIXI times XXXX up to phase? Because XIXI * XXXX = X_0 X_1 X_2 X_3 * X_0 I_1 X_2 I_3? That gives? Let’s do: XIXI = X_0 I_1 X_2 I_3. XXXX = X_0 X_1 X_2 X_3. Their product is: (X_0 X_0) (I_1 X_1) (X_2 X_2) (I_3 X_3) = I_0 * X_1 * I_2 * X_3 = X_1 X_3. That is not X_0 X_3. Maybe: X_0 X_3 * X_1 X_2 = X_0 X_1 X_2 X_3 = XXXX. So X_0 X_3 = XXXX * (X_1 X_2)^{-1} = XXXX * X_1 X_2 because Pauli are involutory. So X_0 X_3 = XXXX * X_1 X_2. But XXXX is a stabilizer, so on the code space, X_0 X_3 acts as X_1 X2. And what is X_1 X2 logically? That would be? likely related to X_B maybe? Because X_B = XXII acts on qubits 0 and 1. So X_1 X2 is not that either. I think I need to determine the logical action of errors that are in U{03} and U_{12} on the state |ψ⟩. But we already computed that physically, if A is in U_{03} and B is in U_{12}, then the state is unchanged. So that means that for any E that is a product of an element from U_{03} and an element from U_{12}, we have E|ψ⟩ = |ψ⟩. So that means that these errors actually stabilize |ψ⟩. So they are in the stabilizer of |ψ⟩ within the code space. So then their logical action on |ψ⟩ is trivial. So then the logical fidelity after post-selection is 1.

Given that Subproblem 1 gave an answer that is not 1, Subproblem 2 likely gives a different answer. wait, Subproblem 1: physical state fidelity = (1-4p/5)^2. Subproblem 2: logical state fidelity after post-selection. If post-selection keeps only those states that are in the code space, then the probability of that is P(undetectable) = (1-4p/5)^2. And within that, the state is perfect. So then the logical fidelity would be 1. But that is too simple.

Maybe post-selection means that we detect errors and then discard those runs. So the resulting state is then that conditional state. Its fidelity would be [ probability that state is correct ] / [ probability that state is kept ]. That is (1-4p/5)^2 / (1-4p/5)^2 = 1. So that suggests that if we post-select, we get fidelity 1.

I recall that in error detection, often the fidelity after post-selection is 1 because any error that is detected is thrown out. So that makes sense: post-selection ensures that the state is error-free. So then the logical state fidelity would be 1.

But wait, could there be undetectable errors that are not correctable? But with distance 2, any error that is undetectable must be that it acts as a logical operator. But as argued, due to the structure of the errors coming from the CNOT gates, any undetectable error actually acts trivially on the state. Is that always true? What if an error occurs on both CNOT gates such that A is not identity but in U_{03} and B is not identity but in U_{12}? Then physically, we computed that still gives fidelity 1. So indeed, it seems that for this specific circuit, any error that is undetectable actually does not change the state. So then the logical fidelity after post-selection is 1.

I will check one more example: Suppose an error happens on the first CNOT: A = Y_0 Y_3 (undetectable) and on the second CNOT: B = Z_1 Z_2 (undetectable). Then the overall error is Y_0 Y_3 Z_1 Z_2. Apply this to |ψ⟩. |ψ⟩ = (|0000⟩+|0110⟩+|1001⟩+|1111⟩)/2. Y_0 Y_3 Z_1 Z_2|0000⟩: Y_0|0⟩ = i|1⟩, Y_3|0⟩ = i|1⟩, so Y_0 Y_3 gives ii |1⟩|1⟩ on qubits 0 and 3 -> -|11⟩ on those qubits. wait, careful: Y_0 Y_3|0000⟩ = acting on qubit0 and qubit3: |0⟩-> i|1⟩, |0⟩-> i|1⟩, so product phase = ii = -1, so becomes -|1⟩_0|0⟩_1|0⟩_2|1⟩_3 = -|1001⟩? But then Z_1 Z_2 acts on qubits 1 and 2: |0⟩ -> |0⟩, |0⟩ -> |0⟩, so overall gives -|1001⟩. Next, Y_0 Y_3 Z_1 Z_2|0110⟩: |0110⟩: qubit0=0,1=1,2=1,3=0. Y_0|0⟩ = i|1⟩, Y_3|0⟩ = i|1⟩, so that gives phase ii = -1, so becomes -|1⟩_0|1⟩_1|1⟩_2|1⟩_3 = -|1111⟩. Then Z_1 Z_2: Z|1⟩ = -|1⟩, so on qubits 1 and 2, that gives (-1)(-1)=1, so overall -|1111⟩. Next, |1001⟩: Y_0|1⟩ = -i|0⟩, Y_3|1⟩ = -i|0⟩, so product phase = (-i)(-i)= -1, so becomes -|0⟩_0|0⟩_1|0⟩_2|0⟩_3 = -|0000⟩. Z_1 Z_2 acts trivially on |0⟩ so overall -|0000⟩. Next, |1111⟩: Y_0|1⟩ = -i|0⟩, Y_3|1⟩ = -i|0⟩, so phase = (-i)(-i)= -1, so becomes -|0⟩_0|1⟩_1|1⟩_2|0⟩_3 = -|0110⟩. Z_1 Z_2 on |1⟩ gives (-1)*(-1)=1, so overall -|0110⟩. So total: Y_0 Y_3 Z_1 Z_2|ψ⟩ = (-1/2)(|1001⟩+|1111⟩+|0000⟩+|0110⟩) = -|ψ⟩. So indeed, it preserves the state up to a phase. So fidelity 1.

Thus, it appears that if an error is undetectable, then it actually leaves the state invariant. So then after post-selection, the state is always the ideal state. So the logical fidelity is 1.

But wait, then what is the point of Subproblem 2? It might be that the logical state fidelity is actually the probability that the state is kept times 1? That would be (1-4p/5)^2. But that is the physical fidelity, not the logical fidelity after post-selection. The phrase “logical state fidelity” might mean the fidelity of the logical state relative to the ideal logical state, conditioned on that no error was detected. That conditional fidelity would be 1 because any undetectable error gives the correct state.

I will check the official answer from the user: “The correct answer is: \(F_{\rm{physical}}=(1-\frac{12}{15}p)^2\)”. That is actually (1 - 4p/5)^2 because 12/15 = 4/5. So that is the physical fidelity. So that is Subproblem 1. Then Subproblem 2 might be something else.

Maybe Subproblem 2 is: “What is the logical state fidelity?” could be that without post-selection, the logical state fidelity is also (1-4p/5)^2? But that would be the same as physical because the state is encoded.

I think I’ll go with: Subproblem 1: physical fidelity = (1 - 4p/5)^2. Subproblem 2: logical fidelity after post-selection = 1.

But wait, the user said: “Now let’s solve the next Checkpoint.” So maybe Subproblem 2 is separate.

Given that the user gave an answer for Subproblem 1 as that, I will assume that Subproblem 2’s answer is 1.

I’ll answer: Final Answer for Subproblem 2:

\[ F_{\text{logical}} = 1 \]

after post-selection.

I’ll put that in a box.

I’ll now produce the step-by-step derivation for Subproblem 2.

Step 1. Understand Post-Selection in Error Detection

The \([[4,2,2]]\) code uses stabilizers \(S_1 = XXXX\) and \(S_2 = ZZZZ\) to detect errors. Any error that anti-commutes with at least one stabilizer is detectable. Post-selection involves measuring these stabilizers and discarding any state where an error is detected. Thus, only states with no error syndrome are kept, meaning the error must commute with both stabilizers.

The state preparation circuit is:

\[ \text{CNOT}_{03} \cdot H_0 \cdot \text{CNOT}_{21} \cdot H_2 \]

with operations applied from right to left. Each \(\text{CNOT}\) gate is followed by a two-qubit depolarizing error channel acting on its control and target qubits. The error channel applies one of the 15 non-identity two-qubit Pauli operators with probability \(p/15\), and identity with probability \(1 - p\). Hadamard gates are error-free.

The ideal final state is the logical GHZ state:

\[ |\psi_{\text{ideal}}\rangle = \frac{|00\rangle_{AB} + |11\rangle_{AB}}{\sqrt{2}} \]

which corresponds to the physical state:

\[ |\psi\rangle = \frac{1}{2} \left( |0000\rangle + |0110\rangle + |1001\rangle + |1111\rangle \right) \]

Step 2. Error Model and pushing errors to the end

The errors occur after each \(\text{CNOT}\) gate:

  • After \(\text{CNOT}_{21}\): error on qubits \(\{1,2\}\)
  • After \(\text{CNOT}_{03}\): error on qubits \(\{0,3\}\)

Since subsequent gates act on disjoint sets of qubits, these errors commute with them and can be pushed to the end of the circuit. Thus, the overall effect is equivalent to applying the ideal unitary followed by independent error channels on qubit pairs \(\{0,3\}\) and \(\{1,2\}\).

Let \(A\) be the error on \(\{0,3\}\) and \(B\) the error on \(\{1,2\}\). Then the total error is \(E = A \otimes B\).


Step 3. Conditions for Undetectable Errors

An error \(E\) is undetectable if it commutes with both stabilizers:

\[ [E, XXXX] = 0 \quad \text{and} \quad [E, ZZZZ] = 0 \]

Since \(E = A \otimes B\) and the stabilizers factor as:

\[ XXXX = (X_0 X_3) \otimes (X_1 X_2), \quad ZZZZ = (Z_0 Z_3) \otimes (Z_1 Z_2) \]

\(E\) commutes with the stabilizers iff \(A\) commutes with \(X_0 X_3\) and \(Z_0 Z_3\), and \(B\) commutes with \(X_1 X_2\) and \(Z_1 Z_2\).

On two qubits, the only Pauli operators that commute with both \(X \otimes X\) and \(Z \otimes Z\) are:

\[ I \otimes I, \quad X \otimes X, \quad Y \otimes Y, \quad Z \otimes Z \]

Thus, the undetectable errors are exactly those where:

  • \(A \in U_{03} = \{I, X_0 X_3, Y_0 Y_3, Z_0 Z_3\}\)
  • \(B \in U_{12} = \{I, X_1 X_2, Y_1 Y_2, Z_1 Z_2\}\)

Step 4. Effect of Undetectable Errors on the State

If \(A \in U_{03}\) and \(B \in U_{12}\), then direct computation shows that:

\[ E |\psi\rangle = \pm |\psi\rangle \]

That is, any undetectable error leaves the physical state unchanged up to a global phase. Therefore, the logical state remains the ideal GHZ state.


Step 5. Logical Fidelity After Post-Selection

Post-selection discards all runs where an error is detected, keeping only those where \(A \in U_{03}\) and \(B \in U_{12}\). In these cases, the state is exactly \(|\psi_{\text{ideal}}\rangle\), so the logical fidelity is 1.


Final Answer:

\[ \boxed{1} \]
User #5

Populate your final answer into the code template provided below. This step is purely for formatting/display purposes. No additional reasoning or derivation should be performed. Do not import any modules or packages beyond what is provided in the template.

import sympy as sp

p = sp.symbols('p')

def answer(p):
    r"""
    Return the expression of logical state fidelity of the final 2-qubit logical state
    at the end of the circuit as a function of the two-qubit gate error rate $p$ in Sympy format.

    Inputs
    ----------
    p: sympy.Symbol, the two-qubit gate error rate, $p$

    Outputs
    ----------
    F_logical: sympy.Expr, the logical state fidelity as a function of $p$
    """

    # ------------------ FILL IN YOUR RESULTS BELOW ------------------
    F_logical = ...  # a SymPy expression of inputs
    # ---------------------------------------------------------------

    return F_logical
Assistant #6
Reasoning (model)

We are given that the logical state fidelity after post-selection is 1, as derived in the step-by-step reasoning. However, note that the function is expected to return an expression in terms of p. But since the fidelity is always 1 regardless of p (after post-selection), we return 1.

But wait: the problem asks for the logical state fidelity as a function of p. However, our derivation shows that after post-selection, the state is always ideal, so fidelity is 1.

However, let’s double-check the problem statement: “What is the logical state fidelity of the final 2-qubit logical state at the end of the circuit as a function of the two-qubit gate error rate p, assuming the state is post-selected on all detectable errors in the code?”

Our conclusion: After post-selection, the state is always the ideal state, so the fidelity is 1.

Therefore, we return 1.

But note: the function must return a SymPy expression. So we return sp.Integer(1).

However, let’s make sure there is no mistake. The physical fidelity (without post-selection) was (1-4p/5)^2. But after post-selection, we are conditioning on the event that no error was detected. And we found that if no error is detected, then the state is perfect. So the conditional fidelity is 1.

Thus, the answer is 1.

Code implementation:

Final Answer:

import sympy as sp

p = sp.symbols('p')

def answer(p):
    r"""
    Return the expression of logical state fidelity of the final 2-qubit logical state
    at the end of the circuit as a function of the two-qubit gate error rate $p$ in Sympy format.

    Inputs
    ----------
    p: sympy.Symbol, the two-qubit gate error rate, $p$

    Outputs
    ----------
    F_logical: sympy.Expr, the logical state fidelity as a function of $p$
    """

    # ------------------ FILL IN YOUR RESULTS BELOW ------------------
    F_logical = sp.Integer(1)
    # ---------------------------------------------------------------

    return F_logical