We are given: “What is the logical state fidelity of the final 2-qubit logical state at the end of the circuit as a function of two-qubit gate error rate p, assuming the state is post-selected on all detectable errors in the code and on the ancilla qubit measuring |0⟩?”
Interpretation: We have a circuit that prepares the logical |00> state. The circuit is:
M_4 (CNOT_{04}) (CNOT_{34}) (CNOT_{23}) (CNOT_{10}) (CNOT_{12}) (H_1)
But careful: The equation is written in matrix multiplication order, while quantum operations occur in reverse order. So the actual circuit order (from initial state to final state) is:
Step 1: H_1
Step 2: CNOT_{12}
Step 3: CNOT_{10}
Step 4: CNOT_{23}
Step 5: CNOT_{34}
Step 6: CNOT_{04}
Step 7: M_4 (measurement on qubit 4)
But wait: There is also “M_4” at the beginning? Actually: “M_4 (CNOT_{04}) (CNOT_{34}) (CNOT_{23}) (CNOT_{10}) (CNOT_{12}) (H_1)”. That means the circuit is: first apply H_1, then CNOT_{12}, then CNOT_{10}, then CNOT_{23}, then CNOT_{34}, then CNOT_{04}, then measure qubit 4. So that is the order.
We assume that initially, all qubits (0,1,2,3,4) are in state |0⟩? Typically, state preparation: We want to prepare logical |00> state. The circuit likely starts with all qubits in |0⟩. But then we apply H_1. So initial state: |00000⟩? Qubits: 0,1,2,3,4. So initial state: |0⟩_0|0⟩_1|0⟩_2|0⟩_3|0⟩_4.
Then circuit:
-
H_1: on qubit 1. So state becomes: |0⟩_0 (|0⟩+|1⟩)/√2 _1 |0⟩_2|0⟩_3|0⟩_4 = (|00000⟩ + |01000⟩)/√2? But careful: qubit indices: 0,1,2,3,4. So state: (|0⟩_0|+⟩_1|0⟩_2|0⟩_3|0⟩_4).
-
CNOT_{12}: Control qubit 1, target qubit 2.
So state becomes: (|0⟩_0 (|0⟩_1|0⟩_2 + |1⟩_1|1⟩_2)/√2 |0⟩_3|0⟩_4) = (|00000⟩ + |01100⟩)/√2? Actually: qubit1 and qubit2: if qubit1 is |0⟩ then qubit2 remains |0⟩; if qubit1 is |1⟩ then qubit2 flips. So state: |0,0,0,0,0⟩ and |0,1,1,0,0⟩. So state: (|00000⟩ + |01100⟩)/√2.
-
CNOT_{10}: Control qubit 1, target qubit 0.
So apply CNOT on qubits 1 and 0. For the first term: |0⟩_1 so no flip on qubit0: remains |0⟩_0. For second term: |1⟩_1 so flip qubit0: from |0⟩ to |1⟩. So state becomes: (|00000⟩ + |11100⟩)/√2? But careful: qubit order: 0,1,2,3,4. So first term: qubit0=0, qubit1=0, qubit2=0, qubit3=0, qubit4=0.
Second term: qubit0=1, qubit1=1, qubit2=1, qubit3=0, qubit4=0.
So state: (|00000⟩ + |11100⟩)/√2.
-
CNOT_{23}: Control qubit 2, target qubit 3.
For first term: qubit2=0 so no flip: remains |0⟩_3.
For second term: qubit2=1 so flip qubit3: from |0⟩ to |1⟩.
So state: (|00000⟩ + |11110⟩)/√2.
-
CNOT_{34}: Control qubit 3, target qubit 4.
For first term: qubit3=0 so no flip: remains |0⟩_4.
For second term: qubit3=1 so flip qubit4: from |0⟩ to |1⟩.
So state: (|00000⟩ + |11111⟩)/√2.
-
CNOT_{04}: Control qubit 0, target qubit 4.
For first term: qubit0=0 so no flip: remains |0⟩4.
For second term: qubit0=1 so flip qubit4: from |1⟩ to |0⟩.
So state: (|00000⟩ + |11110⟩)/√2? Wait: second term: qubit0=1, so flip qubit4: originally |1⟩ becomes |0⟩. So second term becomes: |1,1,1,1,0⟩? But careful: qubit4: originally was 1, so becomes 0. So state: (|00000⟩ + |11110⟩)/√2.
But then we measure qubit 4. The measurement M_4: if we get 0, then both terms are 0? Actually, first term: qubit4=0, second term: qubit4=0. So measurement always gives 0. So the state becomes: (|00000⟩ + |11110⟩)/√2. But then we discard the ancilla qubit? Actually, the ancilla is qubit 4. But then the state on qubits 0,1,2,3 is: (|0000⟩ + |1110⟩)/√2. But that is not the logical |00> state? Actually, the logical |00> state in the [[4,2,2]] code? The code: stabilizers: XXXX and ZZZZ. The logical operators: X_A = XIXI, X_B=XXII, Z_A=ZZII, Z_B=ZIZI.
What is the logical |00> state? It should be stabilized by Z_A and Z_B. So Z_A|00> = |00>, Z_B|00> = |00>. Also it is in the code space: it is an eigenstate of XXXX with eigenvalue +1? Actually, the code space is the space of states that are +1 eigenvectors of both stabilizers. So the code space is 4-dimensional? Actually, [[4,2,2]] code: encodes 2 qubits, so code space dimension 4. The logical basis states: |00>_L, |01>_L, |10>_L, |11>_L. They are defined up to stabilizers. One representation:
|00>_L = (|0000⟩+|1111⟩)/√2? But careful: That state is stabilized by XXXX? Actually, XXXX(|0000⟩+|1111⟩) = (|1111⟩+|0000⟩)=+1. And ZZZZ(|0000⟩+|1111⟩) = (|0000⟩+|1111⟩)=+1. So that is a valid code state. But then what are the logical operators? For example, if we take X_A = XIXI, then X_A(|0000⟩+|1111⟩) = (|0101⟩+|1010⟩) which is not necessarily |10>_L. Actually, there are different conventions. The problem gives: logical operators: X_A = XIXI, X_B=XXII, Z_A=ZZII, Z_B=ZIZI. Let’s check on the state (|0000⟩+|1111⟩)/√2. Compute Z_A: ZZII. On |0000⟩: Z on qubit0 and qubit1: both 0 so eigenvalue +1. On |1111⟩: qubits0,1 are 1 so Z on them gives (-1)*(-1)=+1. So Z_A gives +1. Z_B: ZIZI. On |0000⟩: qubit0: Z gives +1, qubit2: Z gives +1, so +1. On |1111⟩: qubit0: -1, qubit2: -1, product +1. So both Z_A and Z_B give +1. So (|0000⟩+|1111⟩)/√2 is indeed |00>_L. But our state after the circuit is (|0000⟩ + |1110⟩)/√2? That is not the same because the last qubit: in the second term, qubit3 is 0 instead of 1. So that state is not in the code space? But wait, maybe we made a mistake: The circuit: CNOT{23} and CNOT_{34} and CNOT_{04}. Perhaps the ordering? Let’s re-check carefully:
Circuit: H_1, then CNOT_{12}, then CNOT_{10}, then CNOT_{23}, then CNOT_{34}, then CNOT_{04}, then measure qubit4.
Initial state: |0⟩0|0⟩_1|0⟩_2|0⟩_3|0⟩_4.
After H_1: = |0⟩_0 (|0⟩+|1⟩)/√2 _1 |0⟩_2|0⟩_3|0⟩_4.
After CNOT{12}: control qubit1, target qubit2.
So: if qubit1=0, then qubit2 remains 0; if qubit1=1, then qubit2 flips to 1.
So state: = (|0⟩0|0⟩_1|0⟩_2 + |0⟩_0|1⟩_1|1⟩_2)/√2 |0⟩_3|0⟩_4.
After CNOT{10}: control qubit1, target qubit0.
For first term: qubit1=0 so qubit0 unchanged: remains 0.
For second term: qubit1=1 so flip qubit0: from 0 to 1.
So state: = (|0⟩0|0⟩_1|0⟩_2 + |1⟩_0|1⟩_1|1⟩_2)/√2 |0⟩_3|0⟩_4.
After CNOT{23}: control qubit2, target qubit3.
First term: qubit2=0 so qubit3 unchanged: remains 0.
Second term: qubit2=1 so flip qubit3: from 0 to 1.
So state: = (|0⟩0|0⟩_1|0⟩_2|0⟩_3 + |1⟩_0|1⟩_1|1⟩_2|1⟩_3)/√2 |0⟩_4.
After CNOT{34}: control qubit3, target qubit4.
First term: qubit3=0 so qubit4 unchanged: remains 0.
Second term: qubit3=1 so flip qubit4: from 0 to 1.
So state: = (|0⟩0|0⟩_1|0⟩_2|0⟩_3|0⟩_4 + |1⟩_0|1⟩_1|1⟩_2|1⟩_3|1⟩_4)/√2.
After CNOT{04}: control qubit0, target qubit4.
First term: qubit0=0 so qubit4 unchanged: remains 0.
Second term: qubit0=1 so flip qubit4: from 1 to 0.
So state: = (|0⟩_0|0⟩_1|0⟩_2|0⟩_3|0⟩_4 + |1⟩_0|1⟩_1|1⟩_2|1⟩_3|0⟩_4)/√2 = (|00000⟩ + |11110⟩)/√2? But careful: second term: qubit4 becomes 0. So state: = (|0,0,0,0,0⟩ + |1,1,1,1,0⟩)/√2.
Then measure qubit4. That measurement gives 0 with probability 1. So the state collapses to the same: (|0000⟩ on qubits 0-3 and |0⟩ on qubit4) and (|1111⟩ on qubits 0-3 and |0⟩ on qubit4) but wait: second term: qubits: 0,1,2,3 are all 1? Actually, second term: qubit0=1, qubit1=1, qubit2=1, qubit3=1, qubit4=0. So indeed it is |1111⟩ on the code qubits. So the state becomes: (|0000⟩ + |1111⟩)/√2 on qubits 0,1,2,3. And that is exactly the logical |00> state. So the circuit correctly prepares |00>_L.
So without errors, the fidelity is 1.
Now, we introduce errors: Each CNOT gate is followed by a two-qubit depolarizing error channel. That channel: With probability p, an error occurs. And if an error occurs, it is uniformly one of the 15 non-identity two-qubit Paulis on the two qubits involved. So each CNOT gate: after applying CNOT, we apply with probability p/15 each of the 15 Pauli errors (I⊗X, I⊗Y, I⊗Z, X⊗I, X⊗X, … etc, but not I⊗I). And with probability 1-p, no error.
We have 5 CNOT gates: CNOT_{12}, CNOT_{10}, CNOT_{23}, CNOT_{34}, CNOT_{04}. Also there is H_1 gate. But the problem says: “each CNOT_{ij} gate has a two qubit depolarizing error channel following it”. So H gate is not mentioned to have an error? Possibly we assume H is perfect? The problem statement: “each CNOT_{ij} gate in the circuit has a two qubit depolarizing error channel following it”. So only CNOT gates have errors. So H_1 is error-free. Also the measurement M_4 is presumably perfect? But then we post-select on the ancilla qubit measuring |0⟩. And also we post-select on all detectable errors in the code. That means if an error occurs that is detectable by the code (i.e., not a stabilizer or logical operator? Actually, the code is an error detection code. It can detect any error that is not in the stabilizer? Actually, the [[4,2,2]] code has distance 2, so it can detect any single-qubit error? But careful: The code’s stabilizers are XXXX and ZZZZ. An error E is detectable if it anti-commutes with at least one stabilizer. So if an error commutes with both stabilizers, then it is either a stabilizer itself or a logical operator. So detectable errors are those that are not in the normalizer of the stabilizer group? Actually, for error detection, we measure the stabilizers. If the outcome is -1, then an error is detected. So errors that commute with both stabilizers will not flip the stabilizer measurements. So they are undetectable. So post-selection: we only keep states where the stabilizer measurements are +1. That means if an error occurs that is a logical error (or stabilizer) then it is not detected. But wait: The problem says: “assuming the state is post-selected on all detectable errors in the code and on the ancilla qubit measuring |0⟩”. So we post-select on the ancilla measurement being 0, and also on the code stabilizers being +1? Actually, “detectable errors” means that if an error is detected (by the code’s error detection procedure), we discard that state. So we only keep states that are in the code space? But careful: The circuit itself is used to prepare the state. Possibly we also measure the stabilizers? But the problem statement: “post-selected on all detectable errors in the code” likely means that we check the stabilizers of the code and if they are not +1, we discard. So the final state that we keep is one that is in the code space and also the ancilla measurement is 0.
We want the logical state fidelity. That is the fidelity of the actual state (after post-selection) with the ideal logical |00> state. Since we post-select on the code being in the code space, the state is either exactly |00>_L or some logical error might have occurred? But wait: Errors that are logical operators commute with the stabilizers. So they are not detected. So if a logical error occurs, the state might be |01>_L, |10>_L, or |11>_L. But then the fidelity would be 0 for those? But careful: The fidelity is the overlap with the intended state |00>_L. So if a logical error occurs, the state is orthogonal to |00>_L. So then the fidelity would be 0. But then we are post-selecting on detectable errors. That means if an error is detected (non-identity syndrome), we discard. So only states that have no error or undetectable errors (logical errors) remain. So the fidelity will be the probability that no logical error occurred given that no error was detected. But wait: There is also the ancilla measurement: we post-select on ancilla measuring 0. That might also detect some errors.
So we need to compute: The probability that the final state is exactly |00>_L (i.e., no logical error) given that the ancilla measurement is 0 and the code stabilizers are +1. But careful: The circuit has errors on CNOT gates. Each CNOT gate is followed by a Pauli error from the set of 15 with probability p/15. And these errors can propagate through subsequent gates. Since the gates are Clifford, Pauli errors remain Pauli. So we can analyze the effect of errors as Pauli errors on the initial state? But careful: The errors occur after each CNOT. So they are inserted at different points in the circuit. We can use the method of “error propagation” through the circuit. That is, if an error E occurs after a gate U, it is equivalent to a error U^\dagger E U before the gate? But careful: The errors are applied after the gate. So if we have a gate U and then an error E, then the overall operation is E U. That is equivalent to (U U^\dagger) E U = U (U^\dagger E U). So it is like having a different error before the gate. So we can push all errors to the beginning of the circuit. But then the initial state is |0⟩ for all qubits. But then the errors become Pauli operators acting on the initial state. However, note that the initial state is not necessarily stabilized by all Paulis? But we can compute the effect: The ideal circuit (without errors) produces |00>_L. With errors, the final state will be some Pauli operator applied to the ideal state? But careful: The circuit is not necessarily Clifford? Actually, it is Clifford: H and CNOT are Clifford. So the entire circuit is Clifford. So if we have Pauli errors inserted at various points, the overall effect is that the final state is some Pauli operator (on the code qubits and ancilla) applied to the ideal state. But then we measure the ancilla. And we also measure the stabilizers? Actually, we post-select on the ancilla measurement being 0 and on the code being in the code space (i.e., stabilizers are +1). So we want to know: Given that these conditions are satisfied, what is the probability that the logical state is |00>_L? That is equivalent to: The overall error (after pushing to the beginning) must be such that when conjugated through the circuit, it becomes a Pauli that acts trivially on the logical state? Actually, more systematically:
We have a circuit C that ideally prepares |ψ⟩ = |00>_L ⊗ |0⟩_ancilla? Actually, careful: The circuit uses ancilla. The ideal final state is: on qubits 0,1,2,3, we get |00>_L, and on qubit 4, we get |0⟩. So ideal state: |Ψ_ideal⟩ = |00>_L ⊗ |0⟩_4.
Now, with errors, the actual operation is: There are errors after each CNOT. Let the errors be E_i (i=1,…,5) on the pairs involved. Then the overall operation is:
U = (M_4) (CNOT_{04}) E_5 (CNOT_{34}) E_4 (CNOT_{23}) E_3 (CNOT_{10}) E_2 (CNOT_{12}) E_1 (H_1)
But careful: The measurement M_4 is at the end. But we post-select on measurement outcome 0. So we are effectively projecting onto the subspace where qubit 4 is |0⟩. So the effective operation is: P_0 U, where P_0 = I⊗|0⟩⟨0| on qubit 4.
Now, since the errors are Pauli, and the circuit is Clifford, we can propagate these errors through the circuit. That is, we can write:
U = (M_4) (CNOT_{04}) E_5 (CNOT_{34}) E_4 (CNOT_{23}) E_3 (CNOT_{10}) E_2 (CNOT_{12}) E_1 (H_1)
= (M_4) (CNOT_{04}) (CNOT_{34}) (CNOT_{23}) (CNOT_{10}) (CNOT_{12}) (H_1) * (something)
Actually, we want to push errors to the beginning. But careful: The errors occur after gates. So if we have a gate V and then an error E, then V E = (V E V^\dagger) V. So it becomes an error before V. So we can push each error to the left through subsequent gates. So let’s denote the gates in order from right to left as:
G1 = H_1
G2 = CNOT_{12}
G3 = CNOT_{10}
G4 = CNOT_{23}
G5 = CNOT_{34}
G6 = CNOT_{04}
And then measurement M_4.
So the circuit is: M_4 * G6 * E_5 * G5 * E_4 * G4 * E_3 * G3 * E_2 * G2 * E_1 * G1.
Now, push E_5 through G6: G6 E_5 = (G6 E_5 G6^\dagger) G6. So then overall becomes: M_4 * (G6 E_5 G6^\dagger) * G6 * G5 * E_4 * … But careful: The measurement M_4 is at the end. But we can also push errors through measurement? Actually, measurement is projective. But we will consider the effect on the state. Alternatively, we can push all errors to the beginning. That is, write:
U = M_4 * G6 * G5 * G4 * G3 * G2 * G1 * (G1^\dagger G2^\dagger … G6^\dagger E_5 G6 G5 …?) Actually, let’s do step by step:
We have: U = M_4 * G6 * E_5 * G5 * E_4 * G4 * E_3 * G3 * E_2 * G2 * E_1 * G1.
Push E_5 through G6: = M_4 * (G6 E_5 G6^\dagger) * G6 * G5 * E_4 * G4 * E_3 * G3 * E_2 * G2 * E_1 * G1.
Now, let F_5 = G6 E_5 G6^\dagger. Then U = M_4 * F_5 * G6 * G5 * E_4 * G4 * E_3 * G3 * E_2 * G2 * E_1 * G1.
Now, push E_4 through G6G5? Actually, careful: We have G6 * G5 * E_4. But note that G6 and G5 commute? They act on different qubits? G5 is CNOT_{34} and G6 is CNOT_{04}. They act on qubits: G5: control 3, target 4; G6: control 0, target 4. They do not commute in general. So we need to push E_4 through G6G5. Actually, we can push E_4 through G5 first: G5 E_4 = (G5 E_4 G5^\dagger) G5. So then:
G6 * G5 * E_4 = G6 * (G5 E_4 G5^\dagger) G5 = (G6 (G5 E_4 G5^\dagger) G6^\dagger) G6 G5.
So then let F_4 = G6 G5 E_4 (G5^\dagger G6^\dagger)? Actually, careful:
We have: U = M_4 * F_5 * G6 * G5 * E_4 * G4 * E_3 * G3 * E_2 * G2 * E_1 * G1.
Write G6 * G5 * E_4 = [G6 (G5 E_4 G5^\dagger) G6^\dagger] * G6 G5.
So then U = M_4 * F_5 * [G6 (G5 E_4 G5^\dagger) G6^\dagger] * G6 G5 * G4 * E_3 * G3 * E_2 * G2 * E_1 * G1.
So define F_4 = G6 G5 E_4 (G5^\dagger G6^\dagger)? Actually, careful: The term is: G6 (G5 E_4 G5^\dagger) G6^\dagger. So if we define F_4 = (G6 G5) E_4 (G6 G5)^\dagger, then that is exactly that? Check: (G6 G5) E_4 (G6 G5)^\dagger = G6 G5 E_4 G5^\dagger G6^\dagger. So yes, F_4 = (G6 G5) E_4 (G6 G5)^\dagger.
Then U = M_4 * F_5 * F_4 * G6 G5 * G4 * E_3 * G3 * E_2 * G2 * E_1 * G1.
Next, push E_3 through G6 G5 G4. So: G6 G5 G4 * E_3 = (G6 G5 G4 E_3 (G6 G5 G4)^\dagger) * G6 G5 G4.
So define F_3 = (G6 G5 G4) E_3 (G6 G5 G4)^\dagger.
Then U = M_4 * F_5 * F_4 * F_3 * G6 G5 G4 * G3 * E_2 * G2 * E_1 * G1.
Next, push E_2 through G6 G5 G4 G3. So: F_2 = (G6 G5 G4 G3) E_2 (G6 G5 G4 G3)^\dagger.
Then U = M_4 * F_5 * F_4 * F_3 * F_2 * G6 G5 G4 G3 * G2 * E_1 * G1.
Next, push E_1 through G6 G5 G4 G3 G2. So: F_1 = (G6 G5 G4 G3 G2) E_1 (G6 G5 G4 G3 G2)^\dagger.
Then U = M_4 * F_5 * F_4 * F_3 * F_2 * F_1 * G6 G5 G4 G3 G2 * G1.
But note that G6 G5 G4 G3 G2 G1 is the ideal circuit without errors. And that ideal circuit, when applied to the initial state |0⟩^5, gives the ideal state: |Ψ_ideal⟩ = |00>_L ⊗ |0⟩_4.
So then the overall operation with errors is: U = M_4 * (F_5 F_4 F_3 F_2 F_1) * (ideal circuit).
So if we start with the initial state |0⟩^5, then the state before measurement is: F_5 F_4 F_3 F_2 F_1 |Ψ_ideal⟩. But careful: The order of F’s: They are multiplied from left? Actually, U |0⟩^5 = M_4 * (F_5 F_4 F_3 F_2 F_1) * (ideal circuit) |0⟩^5 = M_4 * (F_5 F_4 F_3 F_2 F_1) |Ψ_ideal⟩.
But then we also have the measurement M_4. But M_4 is a projection onto |0⟩ on qubit 4. So the final state (after post-selection on ancilla measurement 0) is proportional to: P_0 (F_5 F_4 F_3 F_2 F_1) |Ψ_ideal⟩.
And note that F_i are Pauli operators (since E_i are Pauli on two qubits, and conjugation by Clifford gates gives Pauli operators). So overall, the effect is that the final state is: P_0 * (some Pauli operator F) * |Ψ_ideal⟩, where F = F_5 F_4 F_3 F_2 F_1. And F acts on all 5 qubits. But note that the ideal state |Ψ_ideal⟩ has qubit 4 in |0⟩. So if F does not act on qubit 4 in a way that flips it? Actually, F is a Pauli. It might flip qubit 4. But then P_0 will project that component to zero. So for the state to survive post-selection on ancilla measurement 0, we need that F does not flip the state of qubit 4 from |0⟩ to |1⟩. More precisely, if F has a factor X or Y on qubit 4, then applying it to |0⟩ gives a state that is orthogonal to |0⟩? Actually, careful: If F contains X_4, then F|Ψ_ideal⟩ will have qubit 4 in |1⟩. Then P_0 will give 0. So for survival, we require that the part of F on qubit 4 is I or Z? But wait: Z on qubit 4: Z|0⟩ = |0⟩. So that is fine. Also if F has Y_4, then Y = i X Z, so Y|0⟩ = i|1⟩, so that flips to |1⟩. So indeed, for the state to have qubit 4 in |0⟩, we need that the Pauli on qubit 4 is either I or Z. So condition: F must have no X or Y on qubit 4.
Additionally, we post-select on detectable errors in the code. That means we measure the stabilizers of the code (XXXX and ZZZZ) and only keep if they are +1. So if F acting on the code qubits (0,1,2,3) is not in the stabilizer group? Actually, the code space is the +1 eigenspace of both stabilizers. If F on the code qubits is a Pauli that commutes with both stabilizers, then it will map the code space to itself. But if it is a logical operator, then it might change the logical state. If it is a stabilizer, then it acts trivially on the code space. So detectable errors are those that anti-commute with at least one stabilizer. So if F on the code qubits anti-commutes with either XXXX or ZZZZ, then when we measure the stabilizers, we get -1, and we discard. So we only keep if F on the code qubits commutes with both stabilizers. That means F on the code qubits must be in the normalizer of the stabilizer group. The normalizer of the stabilizer group for the [[4,2,2]] code is generated by the stabilizers and the logical operators. So F on code qubits can be: I, XXXX, ZZZZ, XXXX ZZZZ? Actually, careful: The stabilizer group is {I, XXXX, ZZZZ, XXXX ZZZZ}? But wait: XXXX and ZZZZ are the stabilizers. Their product is also a stabilizer. So the stabilizer group is of order 4. And then the logical operators: X_A, X_B, Z_A, Z_B, and their products. So the normalizer is of order 44=16. So F on code qubits must be one of these 16 Paulis. But if it is a logical operator (other than identity on the logical state? Actually, if it is a logical operator, it will change the logical state. For example, if F = X_A on code qubits, then F|00>_L = |10>_L, so fidelity 0. So for the state to have high fidelity, we want F on code qubits to be either I or a stabilizer (which acts as identity on the code space because the code space is invariant under stabilizers? Actually, careful: The stabilizers act as identity on the code space because the code space is defined as the +1 eigenspace. So if F is a stabilizer, then F|ψ⟩ = |ψ⟩ for any code state. So that is good.)
So condition for the state to be the correct logical state is that F on the code qubits is in the stabilizer group (which is {I, XXXX, ZZZZ, XXXX ZZZZ}). But wait: Could it be that F on code qubits is a logical operator that happens to act trivially on |00>_L? For example, if F = Z_A, then Z_A|00>_L = |00>_L because |00>_L is eigenstate of Z_A with eigenvalue +1. Similarly, Z_B|00>_L = |00>_L. But what about X_A? X_A|00>_L = |10>_L, so that changes. What about X_B? X_B|00>_L = |01>_L. What about products? For instance, X_A X_B? That would give |11>_L. So only logical operators that are diagonal in the Z basis for both logical qubits will preserve |00>_L. But wait: The logical operators given are: Z_A = ZZII, Z_B = ZIZI. So if F on code qubits is Z_A, then it commutes with stabilizers? Check: Z_A = ZZII. Does it commute with XXXX? XXXX and ZZII: They act on different qubits? Actually, qubit0 and qubit1: X and Z anti-commute. So ZZII and XXXX: On qubit0, X and Z anti-commute, so overall they anti-commute? But wait: The stabilizer is XXXX. For ZZII, consider qubit0: Z and X anti-commute. So indeed, ZZII anti-commutes with XXXX. So Z_A is not in the normalizer? That is interesting: The logical operators are supposed to commute with the stabilizers. Check: X_A = XIXI. Does it commute with XXXX? X on qubit0: X and X commute; on qubit1: I and X commute; on qubit2: X and X commute; on qubit3: I and X commute. So X_A commutes with XXXX. With ZZZZ: X and Z anti-commute on qubit0? Actually, X_A = X on qubit0, I on qubit1, X on qubit2, I on qubit3. ZZZZ: Z on all. On qubit0: X and Z anti-commute. So X_A anti-commutes with ZZZZ. But wait, the condition for a logical operator is that it commutes with all stabilizers. So actually, X_A should commute with both stabilizers. There is a mistake: The stabilizers are XXXX and ZZZZ. For X_A = XIXI, compute with XXXX:
X_A * XXXX = (X on qubit0)(X on qubit0) = I? Actually, careful: The stabilizer XXXX means the operator X⊗X⊗X⊗X. And X_A = X⊗I⊗X⊗I. Their product: on qubit0: XX = I; qubit1: IX = X; qubit2: XX = I; qubit3: IX = X. So product = I X I X? That is not necessarily ±1? Actually, we check commutativity: Two Pauli operators commute if they have an even number of places where they are different and both are non-identity? Actually, the rule: Two Pauli operators commute if the number of positions where they are both different from I and are different Paulis (one X and one Z) is even. For X_A and XXXX: On qubit0: both X, so commute. qubit1: X and I -> commute. qubit2: X and X -> commute. qubit3: I and X -> commute. So they commute. For X_A and ZZZZ: On qubit0: X and Z anti-commute. qubit1: I and Z commute. qubit2: X and Z anti-commute. qubit3: I and Z commute. So that gives two anti-commutations, which is even? Actually, anti-commute count: each anti-commute gives a factor of -1. Two anti-commutes multiply to +1. So indeed, X_A commutes with ZZZZ. So that’s fine.
Now check Z_A = ZZII. With XXXX: On qubit0: Z and X anti-commute; qubit1: Z and X anti-commute; so that gives (-1)(-1)=+1? Actually, careful: The commutator: [Z_A, XXXX] =? Actually, compute: Z_A * XXXX = (Z on qubit0)(X on qubit0) = -i Y, but we only care about sign. Actually, simpler: Two Pauli operators commute if the number of positions where they are both non-identity and are different Paulis (X and Z) is even. For Z_A and XXXX: qubit0: Z and X -> different, so count 1; qubit1: Z and X -> count 1; total 2, which is even, so they commute. For Z_A and ZZZZ: qubit0: Z and Z -> same, so commute; qubit1: Z and Z -> commute; so Z_A commutes with ZZZZ. So indeed, Z_A is in the normalizer. So the normalizer on the code qubits consists of Paulis that commute with both XXXX and ZZZZ. That set is generated by: XXXX, ZZZZ, X_A, X_B, Z_A, Z_B? But careful: The stabilizer group is generated by XXXX and ZZZZ. So the normalizer is all Paulis that commute with these. That group has order 16. And it includes logical operators. So for the state to be in the code space (after post-selection on detectable errors), we require that the error on the code qubits (from F) is such that it commutes with both stabilizers. That means F on code qubits must be in the normalizer. But then if it is a logical operator that is not identity on |00>_L, then the fidelity will be 0. Which logical operators preserve |00>_L? |00>_L is the +1 eigenstate of Z_A and Z_B. So any logical operator that is a product of Z_A and Z_B will act as ±1? Actually, Z_A|00>_L = |00>_L, Z_B|00>__L = |00>_L. But wait: Could there be a sign? Pauli operators can have phases ±1, ±i. But since we are dealing with Pauli errors, they are Hermitian? Actually, Pauli matrices are usually taken as X, Y, Z with eigenvalues ±1. But careful: Y = iXZ, so sometimes there is an i. But when we push errors through Clifford circuits, we might get phases. But we should keep track of phases? However, the fidelity is the overlap squared. If the error gives a phase factor, then the state is still the same up to global phase. But global phase does not affect fidelity. So we only care if the error changes the logical state to a different logical basis state. So the errors that yield fidelity 1 are those that are in the stabilizer group (which act as identity on the code space) and those that are logical operators that are diagonal in the Z basis? But wait: Consider Z_A. Z_A|00>_L = |00>_L because |00>_L is an eigenvector of Z_A with eigenvalue +1. But is that always true? It depends on the definition of |00>_L. We defined |00>_L as (|0000⟩+|1111⟩)/√2. Check: Z_A = ZZII. On |0000⟩, ZZII gives +1. On |1111⟩, on qubits 0 and 1: both 1, so Z gives -1 each, product = +1. So indeed, Z_A|00>_L = |00>_L. Similarly, Z_B = ZIZI. On |0000⟩: qubit0: Z gives +1, qubit2: Z gives +1, so +1. On |1111⟩: qubit0: -1, qubit2: -1, product +1. So Z_B|00>_L = |00>_L.
What about products like Z_A Z_B? That would also give +1. So actually, any logical operator that is a product of Z_A and Z_B will preserve |00>_L. But wait: Are Z_A and Z_B in the normalizer? Yes, they are. So then errors that are logical Z errors do not reduce fidelity. But what about logical X errors? They flip the state to |10>_L or |01>_L or |11>_L, so fidelity 0.
Also, what about errors that are products of stabilizers and logical Z? That is still stabilizer? Actually, if you multiply a stabilizer by a logical operator, you get another logical operator? For example, XXXX * Z_A. That might be something like? XXXX * ZZII = (XZ)(XZ)(XX)(II)? Actually, careful: On each qubit: qubit0: XZ = -iY, qubit1: XZ = -iY, qubit2: XX = I, qubit3: XI = X. So that is not a Pauli? Actually, it is a Pauli up to phase: (-i)^2 = -1, so it becomes - (Y Y I X). That is not obviously a logical operator? But it should be because the normalizer is a group. Actually, the normalizer group consists of Paulis that commute with stabilizers. The logical operators are defined modulo stabilizers. So if an error is equal to a stabilizer times a logical operator, then its action on the code space is the same as the logical operator. So we only care about the logical part modulo stabilizers. So the errors that give fidelity 1 are those whose logical part is I or Z_A, Z_B, or Z_A Z_B. But wait: Check: What is the logical action of Z_A? That is a logical Z on qubit A. And since |00>_L is the +1 eigenstate of Z_A, it remains |00>_L. So yes.
So, summarizing: After pushing all errors to the beginning, the overall effect is a Pauli operator F on all 5 qubits. This F is a product of the propagated errors from each CNOT gate. Each CNOT gate error E_i (which is one of the 15 non-identity Paulis on the two qubits it acts on) gives rise to a propagated error F_i. And then F = F_5 F_4 F_3 F_2 F_1 (order? They commute because they are Pauli? Actually, careful: They are Pauli operators, so they commute up to phase. But since we are only interested in the action on the state, the order doesn’t matter because they are all applied simultaneously. So F is essentially the product of these independent errors. And each F_i is obtained by conjugating E_i through the subsequent gates. And since the subsequent gates are Clifford, F_i will be a Pauli operator on some set of qubits. And importantly, these F_i are independent because the errors occur on different gates independently. And the probability for each error E_i is: with probability 1-p, no error (identity); with probability p, an error occurs, and then it is uniformly one of the 15 non-identity Paulis on the two qubits involved. So for each CNOT gate, the error contribution F_i will be: with probability 1-p, F_i = I (on all qubits). With probability p/15, F_i is some specific Pauli (which depends on which error occurred and on the gate index). So then F is the product over i=1 to 5 of F_i. And we want the conditions for post-selection:
(1) Ancilla measurement: qubit 4 must be in |0⟩. That means that the Pauli F, when restricted to qubit 4, must not contain X or Y. So we require that the Pauli on qubit 4 is I or Z.
(2) Code detectable errors: The error on the code qubits (0,1,2,3) must commute with both stabilizers XXXX and ZZZZ. That means that the Pauli on code qubits must be in the normalizer of the stabilizer group. Equivalently, it must be such that when we measure the stabilizers, we get +1. So if the error on code qubits anti-commutes with either stabilizer, then it is detected and we discard.
(3) Additionally, we want the logical fidelity. That is the probability that the logical state is |00>_L. That happens if the error on the code qubits, when reduced modulo the stabilizer group, is either I or a logical Z operator (i.e., it acts as identity on |00>_L). But careful: Even if the error is a logical Z operator, the state might get a phase? But as argued, phases are global and do not affect fidelity. So fidelity = 1 if the logical part is I or Z_A or Z_B or Z_A Z_B. But wait: Could there be a sign? For example, if the error is -I (global minus) that is still fidelity 1. So indeed, any error that is in the set of Paulis that act as a phase on |00>_L is good. So we need to determine: For which Paulis on the code qubits (that are in the normalizer) do we have that the state remains |00>_L? That is: The logical operators are defined modulo stabilizers. The normalizer group on 4 qubits has 16 elements. They are generated by: S1 = XXXX, S2 = ZZZZ, L_XA = X_A = XIXI, L_XB = X_B = XXII, L_ZA = Z_A = ZZII, L_ZB = Z_B = ZIZI. Actually, check: Are these independent?
We have:
S1 = XXXX
S2 = ZZZZ
L_XA = XIXI
L_XB = XXII
L_ZA = ZZII
L_ZB = ZIZI
But note: (L_XA)(L_XB) = XIXI * XXII = XXXI? That is not necessarily a stabilizer. Actually, the group order is 16. So any element can be written as S1^a S2^b * L_XA^c L_XB^d * L_ZA^e L_ZB^f, with a,b,c,d,e,f in {0,1} but with some relations? Actually, the group has order 16, so it is 4^2? Actually, the normalizer of a 2-qubit code is isomorphic to the Pauli group on 2 qubits, which has 16 elements. So indeed, the logical part is determined by the exponents c,d,e,f. The action on |00>_L: |00>_L is the +1 eigenstate of L_ZA and L_ZB. So if we apply an operator that has L_XA or L_XB, it will flip the state to something else. So fidelity is 1 if and only if c=0 and d=0. And e and f can be 0 or 1 arbitrarily. So the condition for fidelity 1 is: The logical part (mod stabilizers) should have no X component. That is, it should be in the subgroup generated by L_ZA and L_ZB (and stabilizers). So we want: The error on code qubits should be such that its logical X part is trivial.
So then our goal: Compute the probability that, given that the post-selection conditions (ancilla=0 and code stabilizers are +1) are satisfied, the logical state is |00>_L (i.e., the error on code qubits has no X logical component). And then the fidelity is that probability? Actually, the fidelity is the overlap squared between the actual state and the ideal state. If the error is such that it gives a phase, then the state is exactly |00>_L. If it gives a logical X error, then the state is orthogonal to |00>_L. So the fidelity is 1 if the error is in the “good” set, and 0 if it is in the “bad” set (within the post-selected set). But wait: Could there be errors that are not in the normalizer? Those are detected and discarded. So they are not in the post-selected set. So we only consider errors that satisfy the post-selection conditions. So then the logical fidelity (the probability that the state is correct given that it passed post-selection) is:
Fidelity = (Probability that error is in good set) / (Probability that error is in post-selected set)
because post-selection means we condition on the event that the error is such that ancilla condition and code condition hold.
But careful: There might also be errors that cause the ancilla measurement to be 1? But we post-select on ancilla=0. So that is condition.
So we need to compute: For each CNOT gate, the error E_i (which is a Pauli on the two qubits that gate acts on) and then its propagated version F_i. And then F = product of F_i. And we want to know the probability distribution of F over the Pauli group on 5 qubits. And then we want to sum over all F that satisfy:
- On qubit 4: F must have I or Z (so no X or Y).
- On qubits 0-3: F must be in the normalizer of the stabilizer group (i.e., commute with XXXX and ZZZZ).
And then among those, we want those that have logical part with no X (i.e., c=0, d=0).
And then the fidelity is: (Sum of probabilities for good F) / (Sum of probabilities for all F that satisfy post-selection).
And we assume that p is small? But the problem likely expects an expression in terms of p. Possibly the answer is something like: Fidelity = 1 - …? But note: The circuit has 5 CNOT gates. Each gate error probability p. So to first order in p, the infidelity might be something like? But we need to compute exactly.
Maybe we can compute the effect of each gate error separately? But errors from different gates are independent. And F is the product of F_i. So the overall error probability distribution is the convolution of the distributions from each gate. And since these are independent, we can compute the probability that F has a certain pattern on the qubits. But careful: The F_i are not independent on different qubits? They are Pauli operators. But since they commute, the overall effect is that the exponent on each qubit and each Pauli type is the sum mod 2 of the contributions from each gate. So we can break it down by qubit and by Pauli type (X, Y, Z) but note that Y = i X Z, so if we care about phases, we need to be careful. But maybe we only care about the pattern mod phases? Because conditions: On qubit 4, we require that there is no X or Y. That means that the Pauli on qubit 4 should be either I or Z. So we care about whether there is an X on qubit 4. Similarly, on code qubits, we require that the error is in the normalizer. That condition can be expressed in terms of the Pauli operators on each qubit? The normalizer condition: A Pauli on 4 qubits commutes with XXXX if and only if the number of qubits where it has an X or Y? Actually, careful: XXXX commutes with a Pauli P if and only if the number of qubits where P has a Z or Y (which anti-commute with X) is even? Actually, simpler: Two Pauli operators commute if the number of positions where they are different and both are non-identity is even. For XXXX, it is all X’s. So for a Pauli on 4 qubits, let’s denote its Pauli type on each qubit as: either I, X, Y, Z. It will commute with XXXX if on each qubit, if the Pauli is X or I, then it commutes with X; if it is Z or Y, then it anti-commutes with X. So the total commutation is the product of signs. So we need an even number of qubits where the Pauli is Z or Y. Similarly, with ZZZZ: It commutes if the number of qubits where the Pauli is X or Y is even. So the conditions for being in the normalizer are:
For qubits 0,1,2,3, let a_i be 0 if Pauli is I or Z, and 1 if Pauli is X or Y? Actually, careful: For commutation with XXXX: The sign is (-1)^(number of qubits with Z or Y). So we need that number mod 2 = 0.
For commutation with ZZZZ: The sign is (-1)^(number of qubits with X or Y). So we need that number mod 2 = 0.
So together, that means: The number of qubits with Y? Actually, if a qubit has Y, it contributes to both counts. So overall, the conditions are:
(Number of qubits with Z) + (Number of qubits with Y) is even.
(Number of qubits with X) + (Number of qubits with Y) is even.
This is equivalent to: The parity of the number of X’s is equal to the parity of the number of Z’s? Because if we subtract these two conditions mod 2, we get: (#Z + #Y) - (#X + #Y) = #Z - #X is even, so #X and #Z have the same parity. And then individually, they must be even? Actually, if #X is even and #Z is even, then both conditions hold. If #X is odd and #Z is odd, then (#X+#Y) is odd if #Y is even, but then (#Z+#Y) is odd as well? Wait, check: Suppose on one qubit, X; on another, Z; others I. Then #X=1, #Z=1, #Y=0. Then condition1: #Z+#Y=1 (odd) so fails. So actually, they must both be even. Because if #X is odd and #Z is odd, then #X+#Y: if #Y is even, then odd+even=odd; if #Y is odd, then odd+odd=even? For example, take one qubit with X and one with Y. Then #X=1, #Z=0, #Y=1. Condition1: #Z+#Y=1 (odd) so fails. Take one qubit with Z and one with Y: then #X=0, #Z=1, #Y=1, condition2: #X+#Y=1 odd. So indeed, for a Pauli on 4 qubits to commute with both XXXX and ZZZZ, we need that the total number of qubits that have an X or Y (i.e., non-I and non-Z) is even, and the total number of qubits that have a Z or Y (non-I and non-X) is even. That is equivalent to: The pattern of Paulis on the 4 qubits must be such that the number of X’s (including those in Y) is even, and the number of Z’s (including those in Y) is even. So that is the condition.
Now, we also need to determine the logical part. The logical operators are:
X_A = XIXI, so that has X on qubit0 and qubit2.
X_B = XXII, so that has X on qubit0 and qubit1.
Z_A = ZZII, so that has Z on qubit0 and qubit1.
Z_B = ZIZI, so that has Z on qubit0 and qubit2.
So, if an error on the code qubits is in the normalizer, it can be written as (stabilizer) * (X_A)^c (X_B)^d (Z_A)^e (Z_B)^f. The logical action on |00>_L will be: It will flip to |cd>_L if c or d are 1? Actually, careful: X_A|00>_L = |10>_L, X_B|00>_L = |01>_L, so if both are 1, then |11>_L. And the Z factors give phase +1 because |00>_L is +1 eigenstate of Z_A and Z_B. So the fidelity is 1 if and only if c=0 and d=0. So we need to determine from the Pauli pattern on qubits 0,1,2,3 whether the logical X part is trivial. How can we determine that? The logical operators are defined modulo stabilizers. So we want to know if the error is equivalent to a stabilizer times a product of Z_A and Z_B. That means that the error should have an even number of X’s on the set of qubits? Actually, note: X_A has X on qubits 0 and 2. X_B has X on qubits 0 and 1. So if an error has X on qubit0, that could be part of either X_A or X_B. But if it has X on qubit0 and also on qubit2, then that is exactly X_A (mod stabilizer? Actually, X_A itself commutes with stabilizers? Yes.) So maybe we can compute the parity of X on certain qubits? Alternatively, we can compute the syndromes for the logical operators? Actually, the logical state is |00>_L. If an error applies a logical X_A, then the state becomes |10>_L. So the fidelity would be 0. So we want to avoid any error that has the effect of a logical X on either logical qubit. So we need to compute the probability that the overall error F on the code qubits has a component that is a logical X operator.
Maybe it is easier to compute the propagated errors from each CNOT gate explicitly. We have 5 CNOT gates. Let’s label them in the order they appear in the circuit (from right to left as given, but careful: Our pushing was from the end to the beginning. Actually, we defined:
G1 = H_1
G2 = CNOT_{12}
G3 = CNOT_{10}
G4 = CNOT_{23}
G5 = CNOT_{34}
G6 = CNOT_{04}
And errors: after G2: E_1 (on qubits 1 and2)
after G3: E_2 (on qubits 1 and0)
after G4: E_3 (on qubits 2 and3)
after G5: E_4 (on qubits 3 and4)
after G6: E_5 (on qubits 0 and4)
And then we pushed them to become F_i such that overall F = F_5 F_4 F_3 F_2 F_1.
And F_i = (G6 G5 G4 G3 G2) E_i (G6 G5 G4 G3 G2)^\dagger for i=1? Actually, careful: We had:
F_1 = (G6 G5 G4 G3 G2) E_1 (G6 G5 G4 G3 G2)^\dagger
F_2 = (G6 G5 G4 G3) E_2 (G6 G5 G4 G3)^\dagger
F_3 = (G6 G5 G4) E_3 (G6 G5 G4)^\dagger
F_4 = (G6 G5) E_4 (G6 G5)^\dagger
F_5 = (G6) E_5 (G6)^\dagger
So we need to compute these conjugations. Let’s compute step by step.
First, list the gates in order from the beginning of the circuit to the end:
G1: H_1
G2: CNOT_{12}
G3: CNOT_{10}
G4: CNOT_{23}
G5: CNOT_{34}
G6: CNOT_{04}
And then measurement on qubit 4.
It might be easier to compute the effect of an error occurring at a certain gate on the final Pauli pattern. We can do that by simulating how an error propagates through the subsequent gates. Since the gates are Clifford, we can determine how a Pauli on specific qubits transforms through each gate. Let’s do that for each error location.
We want to know: If an error E occurs after a certain gate, what is the resulting Pauli operator on the final state (before measurement) that would be applied to the ideal state? That is exactly the F corresponding to that error. And since errors from different gates commute, the overall effect is the product of these individual effects.
So, consider an error occurring after gate G2 (CNOT_{12}). That error E_1 acts on qubits 1 and 2. Then it will go through gates: G3, G4, G5, G6. Let’s compute how a Pauli on qubits 1 and 2 transforms through these gates.
G3: CNOT_{10} (control 1, target 0).
G4: CNOT_{23} (control 2, target 3)
G5: CNOT_{34} (control 3, target 4)
G6: CNOT_{04} (control 0, target 4)
We want to know the final Pauli on all qubits 0,1,2,3,4 after these gates act by conjugation. Let’s denote the Pauli as something like: P = (on qubit1, qubit2) and identity on others initially. But careful: The error occurs after G2, so at that point, the state is not necessarily |0⟩ but that doesn’t matter for conjugation because we are only interested in how the Pauli operator transforms under the unitary gates. So we can compute: U = G6 G5 G4 G3. And then F = U E U^\dagger. But careful: Our F_1 was defined as (G6 G5 G4 G3 G2) E_1 (G6 G5 G4 G3 G2)^\dagger actually. Wait, check: F_1 was from error after G2. But then we pushed through G2 as well? Actually, we had: F_1 = (G6 G5 G4 G3 G2) E_1 (G6 G5 G4 G3 G2)^\dagger. But note that G2 is CNOT_{12}. But wait, did we include G2 in the pushing? Yes, because after G2, the error occurs. So then we push through G3, G4, G5, G6. So indeed, F_1 = (G6 G5 G4 G3) (G2 E_1 G2^\dagger) (G6 G5 G4 G3)^\dagger? Actually, careful: The error occurs after G2. So the circuit is: … G2, then E_1, then G3, G4, G5, G6. To push E_1 to the beginning, we would do: G3 E_1 = (G3 E_1 G3^\dagger) G3. So then it becomes: … G2, (G3 E_1 G3^\dagger) G3, … So actually, the pushing should be: F_1 = (G6 G5 G4 G3) E_1 (G6 G5 G4 G3)^\dagger? But then what about G2? Because the error occurs after G2, so it is not affected by G2 itself. Wait, let’s re-derive pushing carefully:
We have: U = M_4 * G6 * E_5 * G5 * E_4 * G4 * E_3 * G3 * E_2 * G2 * E_1 * G1.
We want to push all errors to the right after G1? Actually, we want to push them to the end? We want to write U = (M_4 * G6 * G5 * G4 * G3 * G2 * G1) * (something). Actually, we want to see the effect on the state. The ideal state is |ψ_ideal⟩ = (G6 G5 G4 G3 G2 G1) |0⟩^5. With errors, the state becomes: |ψ⟩ = G6 E_5 G5 E_4 G4 E_3 G3 E_2 G2 E_1 G1 |0⟩^5.
Now, insert identities: = G6 G5 G4 G3 G2 G1 * (G1^\dagger G2^\dagger G3^\dagger G4^\dagger G5^\dagger G6^\dagger) E_5 G5 E_4 G4 E_3 G3 E_2 G2 E_1 G1 |0⟩^5.
That is messy. The method of pushing errors through gates is: For each error, determine how it looks when commuted through subsequent gates. So, consider error E_1 occurring after G2. It will be acted on by G3, G4, G5, G6. So if I define V = G6 G5 G4 G3, then the contribution from E_1 is that it becomes V E_1 V^\dagger applied after the ideal circuit? Actually, careful:
|ψ⟩ = G6 E_5 G5 E_4 G4 E_3 G3 E_2 G2 E_1 G1 |0⟩.
Write this as: G6 E_5 G5 E_4 G4 E_3 G3 E_2 (G2 G1) * (G1^\dagger G2^\dagger) E_1 (G2 G1) |0⟩? Not sure.
Maybe it’s easier to determine the effect of an error at each location by simulation through the circuit. That is: We know the ideal circuit takes |0⟩^5 to |Ψ_ideal⟩. If an error occurs at a certain point, then the state becomes different. But since the circuit is Clifford, the state will be a Pauli operator applied to |Ψ_ideal⟩. And that Pauli operator can be determined by propagating the error through the remaining gates. So for each error location, we can compute what Pauli operator (on the final state) results from an error E on specific qubits at that location. And then these Pauli operators from different gates will multiply together. And they act on the ideal state. So then the conditions for post-selection are on the total Pauli operator on the final state. And since these Pauli operators commute, the total is just the product of the individual ones. And they are independent across gates. So we can compute for each gate, the distribution of the resulting Pauli operator on the final state (on qubits 0,1,2,3,4) that comes from an error at that gate. And then the overall error is the product of these independent contributions. And then we want the probability that the overall error has certain properties.
Let’s do that. Let’s label the gates by their order in the circuit (from first to last):
- H_1 (no error)
- CNOT_{12} -> error E_1 on qubits (1,2)
- CNOT_{10} -> error E_2 on qubits (1,0)
- CNOT_{23} -> error E_3 on qubits (2,3)
- CNOT_{34} -> error E_4 on qubits (3,4)
- CNOT_{04} -> error E_5 on qubits (0,4)
And then measurement on qubit 4.
Now, let’s determine for each error location, if an error Pauli occurs on the specified qubits, what is the resulting Pauli operator on the final state (before measurement) that would be applied to the ideal state? That is, if the error occurs right after that gate, then how does it propagate through the subsequent gates? We can compute this by taking a Pauli operator that acts on the qubits at that time, and then see how it transforms under the remaining gates. Since the gates are Clifford, the result will be a Pauli operator on the final qubits.
Let’s denote the final Pauli operator as acting on qubits 0,1,2,3,4. We want to know its form.
I will go through each error location:
Error location 1: After CNOT_{12} (gate2).
At this point, the state has been affected by H_1 and CNOT_{12}. But we want to know: If an error Pauli E acts on qubits 1 and 2 at this point, what is the equivalent Pauli that would act on the initial state? Actually, easier: The ideal final state is obtained by applying gates 3,4,5,6 to the state after gate2 (which is ideal). If an error occurs at this point, then the state becomes E times the state after gate2. Then applying gates 3,4,5,6 gives: gates * E * (state) = (gates E gates^\dagger) * (gates state) = (gates E gates^\dagger) * ideal final state. So the resulting Pauli is gates E gates^\dagger, where gates = G3 G4 G5 G6. So for error location 1, the effective final Pauli is: F_1 = (G3 G4 G5 G6) E_1 (G3 G4 G5 G6)^\dagger.
Now, G3 = CNOT_{10}
G4 = CNOT_{23}
G5 = CNOT_{34}
G6 = CNOT_{04}
So we need to compute the conjugation through these gates in order. Let’s do that step by step for a general Pauli on qubits 1 and 2. But careful: The error E_1 acts only on qubits 1 and 2 initially. But after conjugation, it may spread to other qubits.
Let’s denote the Pauli as: On qubit1: P1, on qubit2: P2, and identity on qubits 0,3,4.
We will go through each gate:
G3: CNOT_{10} (control 1, target 0)
Under CNOT_{10}, the Pauli operators transform as follows (conjugation rules):
On control qubit 1: X -> X⊗X? Actually, standard: CNOT_{control, target} conjugations:
X_c -> X_c X_t
X_t -> X_t
Z_c -> Z_c
Z_t -> Z_c Z_t
And for Paulis that are products, they multiply accordingly.
So, let’s determine how each Pauli on qubit1 and qubit2 transforms under G3.
But careful: G3 acts on qubits 1 and 0. So it will affect any Pauli that involves qubit1 or qubit0. Our Pauli currently involves only qubits 1 and 2. So qubit2 is unaffected by G3. So we only need to see how Pauli on qubit1 changes relative to qubit0.
So, if the Pauli on qubit1 is I, then nothing happens.
If it is X_1, then under CNOT_{10}, X_1 becomes X_1 X_0.
If it is Y_1, then Y_1 = i X_1 Z_1, but careful: Actually, better: The conjugation rules for CNOT are usually given for X and Z separately. So I’ll keep track of X and Z parts separately. Actually, since Pauli operators are products of X and Z, I can decompose them into factors on each qubit. So let the error E_1 be: (on qubit1: something, on qubit2: something). Write it as: (a1, b1) for qubit1 and (a2, b2) for qubit2, where a indicates whether there is an X factor (0 or 1) and b indicates whether there is a Z factor (0 or 1). And then possibly a phase. But maybe I can compute the effect on each basis Pauli: I, X, Y, Z. I’ll do that manually for each possibility? But there are 15 errors. But maybe we can compute the overall distribution of the final Pauli from each error location in terms of its action on qubits 0,1,2,3,4. And then later, when taking product over gates, we only care about the pattern mod2 on each qubit for X and Z separately? Because conditions involve whether there is an X or Z on qubit4, and on code qubits, we care about the parity of X’s and Z’s. And also the logical part might be determined by specific qubits? But careful: The logical operators involve specific qubits: X_A involves qubits 0 and 2; X_B involves qubits 0 and 1; Z_A involves qubits 0 and 1; Z_B involves qubits 0 and 2. So the pattern on qubits 0,1,2 is important. Qubit3 seems to only appear in stabilizers? Actually, stabilizer XXXX involves all four. So maybe I need to compute the final Pauli for each error type explicitly.
Maybe there is a smarter way: The circuit is designed to prepare |00>_L. Errors that cause undetectable logical errors will come from specific patterns. Perhaps we can determine the probability of a logical error given that post-selection conditions are met. And since p is small, the leading order term might be from single errors. But wait, the problem likely expects an expression in terms of p. It might be that the fidelity is 1 - something * p^2? Because single errors might be detected by the ancilla or code checks? Let’s check single errors first.
Consider a single error occurring at one of the CNOT gates. What is the resulting final Pauli? If only one error occurs, then the overall F is just that error’s propagated version. We want to know if that error causes the state to be discarded ( detectable) or if it is undetectable but causes a logical error, or if it is harmless ( fidelity remains 1). And then the probability of that error is p/15 times something? But careful: The errors are independent across gates. But then we also have terms with two errors that might cancel each other? But for small p, the leading order infidelity will come from events where a single error occurs that is undetectable and causes a logical error. But wait, could a single error be undetectable? Let’s check each gate:
Gate2: CNOT_{12}. Errors occur on qubits 1 and2.
Let’s compute for gate2 errors. We want F_1 = (G3 G4 G5 G6) E (G3 G4 G5 G6)^\dagger.
Let’s compute this for each of the 15 Pauli errors on qubits 1 and2. But maybe we can compute the effect on the final state more directly by tracking how an error propagates through the circuit. I’ll do that.
Circuit after gate2: state is ready. Error occurs on qubits 1 and2.
Then gates:
G3: CNOT_{10} ( control 1, target 0)
G4: CNOT_{23} ( control 2, target 3)
G5: CNOT_{34} ( control 3, target 4)
G6: CNOT_{04} ( control 0, target 4)
Let’s take each Pauli on {1,2} and see what it becomes after these gates. I’ll denote Pauli as P_{1}P_{2} (acting on qubits 1 and2 only initially). I’ll go through each gate step by step.
Let me list the Paulis on two qubits: They are:
I⊗I ( identity) -> trivial.
I⊗X, I⊗Y, I⊗Z,
X⊗I, Y⊗I, Z⊗I,
X⊗X, X⊗Y, X⊗Z,
Y⊗X, Y⊗Y, Y⊗Z,
Z⊗X, Z⊗Y, Z⊗Z.
I will compute the effect of each gate on these Paulis. But careful: The gates act on specific qubits. I will keep track of the Pauli on qubits 0,1,2,3,4. Initially, only qubits 1 and2 have something, others are I.
Gate3: CNOT_{10}. This gate affects qubits 1 and 0.
under CNOT_{10}, the rules:
X_1 -> X_1 X_0
Z_1 -> Z_1
X_0 -> X_0
Z_0 -> Z_1 Z_0
Also, anything on other qubits unchanged.
So, for each Pauli on qubit1, we need to see how it changes relative to qubit0.
Let’s do this systematically. I’ll denote the Pauli as a string for qubits 0,1,2,3,4. Initially, qubit0: I, qubit1: something, qubit2: something, qubit3: I, qubit4: I.
After gate3, the Pauli will change according to the following rules based on the Pauli on qubit1:
If Pauli on qubit1 is I: no change.
If Pauli on qubit1 is X: then X_1 becomes X_1 X_0. So that means an X appears on qubit0 as well.
If Pauli on qubit1 is Y: Y = i X Z. Under CNOT, X_1 -> X_1 X_0, Z_1 -> Z_1. So Y_1 -> i (X_1 X_0) Z_1 = i X_1 Z_1 X_0 = Y_1 X_0? But careful with phase: Actually, CNOT acting on Y_1: CNOT Y_1 CNOT^\dagger = CNOT (i X_1 Z_1) CNOT^\dagger = i (CNOT X_1 CNOT^\dagger)(CNOT Z_1 CNOT^\dagger) = i (X_1 X_0)(Z_1) = i X_1 Z_1 X_0 = Y_1 X_0. So indeed, Y_1 -> Y_1 X_0.
If Pauli on qubit1 is Z: Z_1 remains Z_1.
Also, if there is anything on qubit0 initially? Initially, qubit0 is I, so no issue.
So, after gate3, the Pauli will have contributions on qubit0 coming from the action on qubit1.
Now, also gate3 affects Pauli on qubit0 if it involved Z? Actually, rule for qubit0: Z_0 -> Z_1 Z_0. But since initially qubit0 is I, Z_0 doesn’t appear. So that rule won’t activate unless there is already a Z on qubit0? But wait, could there be? Initially, qubit0 is I. So no.
So, after gate3, the Pauli becomes:
Qubit0: will become whatever comes from the Pauli on qubit1 that is X or Y. Specifically, if qubit1 had X, then qubit0 gets an X. If qubit1 had Y, then qubit0 gets an X as well? Actually, careful: For Y_1, we got Y_1 X_0. So that means on qubit0, there is an X. For Z_1, no change on qubit0.
Also, what about if qubit1 had something like? That covers it.
So, let’s go through each Pauli for error at gate2:
I will create a table for error at gate2. Let the error be on qubits 1 and2. I’ll denote it as (P1, P2). I will compute the resulting Pauli after each gate. I’ll use notation: Pauli string for qubits 0,1,2,3,4. Initially: (I, P1, P2, I, I).
Gate3: CNOT_{10}:
affects qubits 0 and 1.
For each possibility for P1:
If P1 = I: then no change.
If P1 = X: then becomes: qubit0: X appears; qubit1: remains X? Actually, careful: X_1 -> X_1 X_0. So that means actually, both qubit0 and qubit1 get an X? But wait, initially there was X on qubit1. After conjugation, we get X_1 X_0. So that means the Pauli becomes: on qubit0: X, on qubit1: X, and on qubit2: P2, others I.
If P1 = Y: then Y_1 -> Y_1 X_0. So becomes: qubit0: X, qubit1: Y, qubit2: P2.
If P1 = Z: then Z_1 remains Z_1. So no change on qubit0.
So, after gate3, the Pauli is:
For P1=I: (I, I, P2, I, I) actually careful: if P1=I, then it remains (I, I, P2, I, I) but wait, initially it was (I, I, P2, I, I) because P1=I means no error on qubit1? Actually, error is on both qubits? But careful: The error is a two-qubit Pauli. It could be that it acts as I on one qubit and something on the other. So yes, that is included.
So, I’ll make a table for each of the 15 errors. But maybe I can be systematic by considering the type on qubit1 and qubit2 separately. Let’s denote the error as (A on qubit1, B on qubit2) where A,B ∈ {I,X,Y,Z} but not both I.
I will compute the effect gate by gate.
Let me denote the state after each gate as a Pauli string on qubits 0,1,2,3,4. I’ll use notation like: X0 means Pauli X on qubit0, etc.
Gate3: CNOT_{10}
Input: (I, A, B, I, I)
Output depends on A:
If A = I: then output remains (I, I, B, I, I) actually careful: if A=I, then qubit1 becomes I still, so it is (I, I, B, I, I).
If A = X: then becomes: (X0, X1, B, I, I) because X_1 -> X_1 X_0.
If A = Y: becomes: (X0, Y1, B, I, I) because Y_1 -> Y_1 X_0.
If A = Z: becomes: (I, Z1, B, I, I).
So after gate3, we have these.
Next, gate4: CNOT_{23} acts on qubits 2 and 3.
Now, the current Pauli string is something like: (Q0, Q1, Q2, I, I) where Q0 depends on A, Q1 is determined by A, Q2 is B initially but wait, careful: Q2 is actually B itself because gate3 did not affect qubit2. So Q2 = B.
Gate4: CNOT_{23} rules:
On control qubit2 and target qubit3.
For qubit2:
X_2 -> X_2 X_3
Z_2 -> Z_2
For qubit3:
X_3 -> X_3
Z_3 -> Z_2 Z_3
So, let’s apply this based on Q2 (which is B) and also consider if Q1 or Q0 have any effect? No, gate4 only acts on qubits 2 and 3. So we update only qubits 2 and 3.
So, current: (Q0, Q1, B, I, I).
Now, depending on B:
If B = I: then no change.
If B = X: then X_2 -> X_2 X_3. So becomes: qubit2: X becomes X? Actually, careful: If B = X, then initially on qubit2 we have X. Under CNOT_{23}, X_2 becomes X_2 X_3. So that means we get an X on qubit3 as well. So outcome: qubit2 remains X? Actually, wait: The Pauli becomes: on qubit2: X, and on qubit3: X appears. But careful: Could there be already something on qubit3? Initially qubit3 is I. So becomes: (Q0, Q1, X2, X3, I).
If B = Y: Y_2 = i X_2 Z_2. Under CNOT, X_2 -> X_2 X_3, Z_2 -> Z_2. So Y_2 -> i (X_2 X_3) Z_2 = i X_2 Z_2 X_3 = Y_2 X_3. So outcome: (Q0, Q1, Y2, X3, I).
If B = Z: Z_2 remains Z_2. So no change on qubit3. So outcome: (Q0, Q1, Z2, I, I).
So after gate4, the Pauli string becomes:
It depends on A and B.
I will keep track separately for each A and B. Let’s make a table for gate2 errors. I’ll consider A and B separately. But maybe I should also keep track of phases? Phases might matter for whether something becomes Y vs something else? But for our conditions, we only care about whether there is an X or Z on each qubit actually. Because conditions like: On qubit4, we require no X or Y. That means if there is an X anywhere on qubit4, it’s bad. But careful: Y involves both X and Z. So if there is Y on qubit4, that means there is an X component? Actually, Y = i X Z. So if there is Y on qubit4, then that means there is an X acting on qubit4 (because Z alone would be okay). So actually, the condition for qubit4 is that the Pauli on qubit4 should not include an X. So we care about whether the Pauli on qubit4 has an X factor. So I will keep track of the Pauli type on each qubit in terms of whether it has an X and/or Z. I can use a notation: For each qubit, I’ll keep a pair (x,z) where x=0 means no X, x=1 means presence of X; z=0 means no Z, z=1 means presence of Z. Then I can determine if it’s I, X, Y, or Z. But careful with phases: sometimes the order might matter for overall phase, but that won’t affect the conditions because conditions are on each qubit separately? Actually, conditions are on the product of signs from different qubits for commutation with stabilizers. But wait, the conditions for being in the normalizer involve the overall sign when commuting with XXXX and ZZZZ. That overall sign is determined by the product over qubits of (-1)^( indicator that Pauli anti-commutes with X) etc. For a given qubit, if the Pauli is X or Y, it anti-commutes with Z? Actually, let’s determine: For stabilizer XXXX, it commutes with a Pauli if the number of qubits where the Pauli is Z or Y is even. So if I use the (x,z) notation, then a Pauli has an X component if x=1, and a Z component if z=1. Then, with stabilizer XXXX (which is all X’s), the commutation sign is given by product over qubits of: if z=1 alone? Actually, X and Z anti-commute. So if a Pauli has a Z factor (z=1), then it will anti-commute with X. Also if it has both X and Z? That is Y, and Y anti-commutes with X as well because Y = iXZ and X Y = -Y X. So actually, any Pauli that has z=1 will anti-commute with X regardless of x? Check: If Pauli is Z, then X Z = -Z X. If Pauli is Y, then X Y = -Y X. If Pauli is X alone, then X commutes with X. So indeed, for stabilizer XXXX, the condition is that the total number of qubits with z=1 is even.
For stabilizer ZZZZ, similarly, any Pauli that has x=1 will anti-commute with Z. So condition is that the total number of qubits with x=1 is even.
So conditions for being in the normalizer on code qubits (0,1,2,3) are: Sum_{i=0}^3 z_i mod 2 = 0, and Sum_{i=0}^3 x_i mod 2 = 0.
And condition for ancilla (qubit4) is that it should not have x=1. So on qubit4, we require x_4=0.
Also, for fidelity, we need that the logical X part is trivial. The logical X operators are: X_A acts on qubits 0 and 2 with x=1. X_B acts on qubits 0 and 1 with x=1. So likely the condition for no logical X error is that the pattern of x’s on code qubits is such that it is even on these specific pairs? Actually, careful: An error that is itself a stabilizer will have x’s on all four qubits? For example, XXXX has x=1 on all qubits, so that gives even parity? Actually, wait, stabilizer XXXX: x_i=1 for i=0,1,2,3, so total x count is 4 which is even, and z count is 0 even. So that is good. But if an error is, say, X on qubit0 only, then that is not in the normalizer because x count=1 (odd) so it would be detected. So actually, any single-qubit X error would be detected because it would anti-commute with ZZZZ? Check: X on qubit0 alone: with ZZZZ, qubit0: X and Z anti-commute, so that gives a -1, so detected. So indeed, single errors are detected. So the undetectable errors come from至少 two errors that cancel each other’s syndrome? But wait, they could also be errors that act on two qubits in a way that the overall x and z parities are even. For example, X on qubit0 and X on qubit1 would give x count=2 (even) and z count=0, so that commutes with both stabilizers. Is that a logical error? That product is X0 X1. Is that a logical operator? Our logical X_B is XXII, which is X0 X1. So yes, that is a logical X error on qubit B. So that would cause infidelity. So we want to avoid that pattern.
So, maybe I can compute for each error location, what is the resulting pattern on the final state in terms of (x,z) for each qubit 0,1,2,3,4. And then later, when taking product of errors from different gates, the overall pattern will be the product ( addition mod2 of the patterns). And since these errors are independent, I can compute the probability distribution of the overall pattern caused by errors at each gate. And then the conditions for post-selection are that on qubit4, x_4=0, and on code qubits, the total x parity is 0 and total z parity is 0. And then among those, the good ones are those that do not contain a logical X error. But careful: The logical X error condition is not simply that the pattern is not equal to that of a logical X operator because it could be that times a stabilizer. For example, if the pattern is X on all four qubits, that is XXXX, which is a stabilizer, so that is good. So I need to know the actual pattern on qubits 0,1,2,3. The logical operators are determined modulo stabilizers. So essentially, the logical part is determined by the pattern on qubits 0,1,2? Because stabilizers act on all four. Actually, the normalizer group on 4 qubits has 16 elements. They can be characterized by their action on qubits 0,1,2,3. I want to know when an error has no logical X component. That means that the error is in the subgroup generated by stabilizers and Z_A, Z_B. So that subgroup consists of errors that act with Pauli that is either I or Z on qubits 0,1,2,3 such that the pattern of Z’s is arbitrary? But wait, consider Z_A = ZZII. That has z=1 on qubits 0 and 1. That is fine. What about a stabilizer like XXXX? That has x=1 on all qubits, so that is not in that subgroup because it has X’s. So actually, the good errors are those that can be written as something that has no X on any qubit? Is that true? Check: Could there be an error that has some X’s but still acts as identity on |00>_L? For example, consider the error X on qubit0 and X on qubit2. That is X_A actually. So that would flip to |10>_L. What about X on qubit0 alone? That is not in the normalizer because its x parity is 1, so it would be detected anyway. What about X on qubit0 and X on qubit1 and X on qubit2? That product is X0X1X2. Is that in the normalizer? Check x parity: 3 is odd, so it would anti-commute with ZZZZ? Actually, wait, ZZZZ requires that the number of qubits with x=1 is even. So 3 is odd, so that error would be detected. So indeed, any error in the normalizer must have an even number of X’s. So the possible patterns of X’s on code qubits for undetectable errors are: 0,2,4. If it is 0, then it’s good ( could be I or Z errors). If it is 2, then it could be a logical X error if those two X’s are on qubits that correspond to a logical operator. The logical X operators are: X_A requires X on qubits 0 and 2. X_B requires X on qubits 0 and 1. Also, what about X on qubits 1 and 2? That would be X_A X_B? Because X_A X_B would be XIXI * XXII = XXXI? Actually, careful: X_A = XIXI means qubit0: X, qubit2: X. X_B = XXII means qubit0: X, qubit1: X. Their product gives qubit0: X^2=I, qubit1: X, qubit2: X, so that is actually X on qubits 1 and 2. So that is also a logical X error ( specifically, it would flip both logical qubits? Actually, X_A X_B|00> = |11>). So any pattern with exactly two X’s on code qubits will be a logical X error if those two X’s are on any two of {0,1,2}? What about X on qubits 0 and 3? Is that possible? For an error to be in the normalizer, the x parity must be even. So could we have X on qubit0 and X on qubit3? That gives x count=2. Does that commute with XXXX? For XXXX, we need z count even. If there are no Z’s, then it’s okay. So X0X3 is in the normalizer. Is that a logical operator? Let’s check: X0X3. Commute with stabilizers? It commutes with XXXX because both have X’s? Actually, check with ZZZZ: X0 and Z0 anti-commute, X3 and Z3 anti-commute, so product gives commute. So X0X3 is in the normalizer. What is its logical action? likely it is equivalent to something times a stabilizer? For instance, X0X3 * (XXXX) would give? X0X3 * X0X1X2X3 = X1X2. And X1X2 is actually X_A X_B? Because X_A X_B gives X on qubits 1 and 2? Wait, X_A = XIXI gives qubit0 and qubit2 actually. I’m getting confused. Let’s determine the logical operators clearly. We are given:
X_A = XIXI means: qubit0: X, qubit1: I, qubit2: X, qubit3: I.
X_B = XXII means: qubit0: X, qubit1: X, qubit2: I, qubit3: I.
Z_A = ZZII means: qubit0: Z, qubit1: Z, qubit2: I, qubit3: I.
Z_B = ZIZI means: qubit0: Z, qubit1: I, qubit2: Z, qubit3: I.
The stabilizers are S1 = XXXX, S2 = ZZZZ.
Now, any element of the normalizer can be written as S1^a S2^b * X_A^c X_B^d * Z_A^e Z_B^f.
Let’s see what that gives for some examples:
If we take c=0,d=0, then it’s just stabilizers. So that’s good.
If we take c=1,d=0, then that is X_A = XIXI. So that has X on qubits 0 and 2.
If we take c=0,d=1, then that is X_B = XXII, so X on qubits 0 and 1.
If we take c=1,d=1, then that is X_A X_B = (XIXI)(XXII) = (X0X0, X1I, X2X2, I) actually careful: On qubit0: XX=I, qubit1: IX=X, qubit2: XI=X, qubit3: II=I. So that gives X on qubits 1 and 2. So indeed, the logical X errors are those that have X on qubits such that the pattern is either on {0,2}, {0,1}, or {1,2}. What about an error with X on qubits 0 and 3? Can that be written as above? Suppose we want to see if X0X3 is in the normalizer. Write it as S1^a S2^b * X_A^c X_B^d * Z_A^e Z_B^f. This is a Pauli operator. Its Pauli type on each qubit would be:
Qubit0: from S1: X^a, from S2: Z^b, from X_A: X^c, from X_B: X^d, from Z_A: Z^e, from Z_B: Z^f -> overall: X^{a+c+d}, Z^{b+e+f}
Qubit1: from S1: X^a, from S2: Z^b, from X_A: I, from X_B: X^d, from Z_A: Z^e, from Z_B: I -> X^{a+d}, Z^{b+e}
Qubit2: from S1: X^a, from S2: Z^b, from X_A: X^c, from X_B: I, from Z_A: I, from Z_B: Z^f -> X^{a+c}, Z^{b+f}
Qubit3: from S1: X^a, from S2: Z^b, from others: I -> X^a, Z^b.
We want this to equal X0X3 means:
Qubit0: should be X only -> so need X^{1}, Z^{0} -> conditions: a+c+d = 1 mod2, b+e+f = 0 mod2.
Qubit1: should be I -> so a+d=0, b+e=0.
Qubit2: should be I -> so a+c=0, b+f=0.
Qubit3: should be X -> so a=1, b=0.
Then from a=1, then a+d=0 gives d=1 mod2? Actually, 1+d=0 mod2 means d=1.
a+c=0 gives 1+c=0 so c=1.
Then a+c+d = 1+1+1=1 mod2? Actually, 1+1+1=3 mod2 = 1, okay.
b=0 then b+e=0 gives e=0.
b+f=0 gives f=0.
Then b+e+f=0. So indeed, X0X3 = S1^1 * X_A^1 X_B^1? That would give: S1 * X_A X_B = XXXX * (X on qubits 1 and2) = actually careful: S1 has X on all four. X_A X_B has X on qubits 1 and2 only. Their product gives X on qubits 0 and3 actually. So yes, X0X3 is equivalent to a logical operator? But wait, that would then be X_A X_B times S1. But X_A X_B would normally give X on qubits 1 and2. times S1 gives X on qubits 0,3 times something? Actually, S1 = XXXX. So (X_A X_B)(S1) = (X on qubits 1,2) times (X on all) = X on qubits 0,3 because on qubits 1,2 they cancel? Yes. So X0X3 is actually a logical operator? But what is its logical action? Since it is X_A X_B times a stabilizer, its logical action is that of X_A X_B, which flips both logical qubits. So that would give |11>_L, so infidelity. So indeed, any undetectable error that has an X on any of the code qubits will actually be a logical X error if that X pattern cannot be turned into all I by multiplication by stabilizers? Actually, wait, what if the error has 4 X’s? That is S1 itself, which is good. So the good errors are those that are in the set where the pattern of X’s on code qubits is either all even and actually could be that there are 0 X’s or 4 X’s. What about errors with 2 X’s? Those are logical X errors as we saw. What about errors with no X’s? Those are good because they are either I or Z errors. So indeed, for the code qubits, the condition for fidelity 1 is that the overall Pauli has an even number of X’s? But careful: If it has 4 X’s, that is actually the stabilizer XXXX, which acts as identity on the code space. So that is good. So actually, the good set is: either the number of X’s is 0 mod something? Is it that the pattern of X’s must be such that it is either all qubits have X or none have X? But wait, consider an error that is X on qubits 0,1,2,3 would be XXXX which is good. What about an error that is X on qubits 0,1 and Z on qubits 2,3? That would have x count=2 (qubits 0,1) and z count=2 (qubits 2,3). That commutes with both stabilizers? Check: With XXXX, need z count even: here z count=2, so okay. With ZZZZ, need x count even: here x count=2, so okay. So that error is undetectable. What is its logical action? Can it be written as something times stabilizers? Let’s try to see if it can be reduced to only Z’s. We want to see if it is in the subgroup generated by stabilizers and Z_A, Z_B. That subgroup would have no X’s on any qubit because stabilizers have X on all qubits actually wait: Stabilizers: XXXX has X on all qubits. So if I multiply an error that has X’s on some qubits by XXXX, I can flip those X’s to become I on those qubits? For example, take error = X0X1 Z2Z3. Multiply by XXXX gives (X0X1 Z2Z3)(X0X1X2X3) = (I)(Z2X2)(Z3X3) = (Y2)(Y3) times a phase? Actually, careful: X0X1 Z2Z3 * X0X1X2X3 = (X0^2)(X1^2)(Z2X2)(Z3X3) = (I)(I)(-iY2)(-iY3) = (-1) Y2 Y3? So that gives Y2Y3, which still has X components because Y involves X. So that is not in the subgroup of only Z’s. So likely that error does actually involve a logical X component. Let’s determine its logical action directly. We want to see how it acts on |00>_L = (|0000⟩+|1111⟩)/√2. Consider the error E = X0X1 Z2Z3. Apply this to |0000⟩: X0X1 Z2Z3|0000⟩ = |1100⟩ because Z2 and Z3 act as +1 on |0⟩ actually wait, Z|0⟩=|0⟩. So that gives |1100⟩. On |1111⟩: X0X1 Z2Z3|1111⟩ = X0X1|1111⟩ with phase? Actually, careful: Z2|1⟩ = -|1⟩, Z3|1⟩ = -|1⟩, so overall phase (+1) actually because (-1)*(-1)=+1. So X0X1|1111⟩ = |0011⟩. So the state becomes (|1100⟩+|0011⟩)/√2. Is that |00>_L? No, because |00>_L is (|0000⟩+|1111⟩)/√2. So that error changes the state. So indeed, for fidelity 1, we need that the error on code qubits is such that it can be written as a product of stabilizers and Z errors only (i.e., no X anywhere). But wait, what about errors that are stabilizers themselves? Stabilizers have X on all qubits, but that is actually okay because they act as identity. But careful: XXXX acting on |00>_L gives itself because |00>_L is an eigenvector of XXXX with eigenvalue +1. So that is good. So actually, the good errors are those that are in the set where the pattern of X’s is either all zeros or all ones? Is that sufficient? Consider an error that is X on qubits 0,1,2,3 would be good. What about an error that is X on qubits 0,1 only? That is not good because that is a logical X error. What about an error that is X on qubits 0,1,2? That would have x count=3, which is odd, so it would be detected anyway. So indeed, for undetectable errors, the x count must be even. So the possible even numbers are 0,2,4. If it is 0, good. If it is 4, good because that is stabilizer (XXXX) actually wait, could there be an undetectable error with x count=2 that is good? What if it is X on qubits 0,3 and also something else? But then that would be2 alone. We already saw X0X3 is equivalent to X_AX_B times stabilizer, so that gives logical X error. What about an error with x count=2 and also some Z’s such that overall it becomes something like? Let’s take error = X0 Z1 Z2 X3. Then x count=2 (qubits 0 and3), z count=2 (qubits 1 and2). Does that commute with stabilizers? For XXXX, need z count even:2 okay. For ZZZZ, need x count even:2 okay. So it is undetectable. Can it be reduced to only Z’s? Multiply by XXXX gives: (X0Z1Z2X3)(X0X1X2X3) = (I)(Z1X1)(Z2X2)(I) = (Y1)(Y2) which still has X components. So likely it is a logical error. I think it’s easier: The good errors are those that stabilize |00>_L. |00>_L is stabilized by Z_A and Z_B. So the stabilizer of |00>_L within the code space is generated by the code stabilizers and Z_A, Z_B. So that group has order 8. So the good errors are exactly those that are in that group. And that group consists of Paulis on code qubits that can be written as S1^a S2^b Z_A^c Z_B^d. Let’s check what that looks like:
S1 = XXXX means on each qubit: X.
S2 = ZZZZ means on each qubit: Z.
Z_A = ZZII means on qubits 0,1: Z; qubits 2,3: I.
Z_B = ZIZI means on qubits 0,2: Z; qubits 1,3: I.
So any element of this group will have the property that on each qubit, the Pauli is either only Z or only X? Actually, take an element: S1 * Z_A = XXXX * ZZII = (XZ)(XZ)(X)(X) on qubits 0,1,2,3. That gives on qubit0: XZ which is Y times phase, so that has both X and Z. So that is good actually because it still stabilizes |00>_L because both S1 and Z_A stabilize |00>_L. So the good group is actually that. So maybe it’s easier to compute the fidelity by first computing the probability that the overall error is in the good group ( stabilizer of |00>_L) conditioned on being undetectable and ancilla condition. That might be done by computing for each gate error, what is its contribution to the final error relative to the good group. But wait, the errors from different gates will multiply. They are independent. So the overall error will be a product of these independent contributions. So then the probability that the overall error is in the good group is the product of the probabilities that each gate’s error contributes an element of the good group? Not exactly because they multiply together. But since the good group is a subgroup, if each gate’s error independently has a certain distribution on the Pauli group, then the overall distribution is the convolution. So I would need to compute for each gate, the distribution of the resulting error (modulo the fact that errors that are detected are post-selected against) actually wait, post-selection happens after all errors. So I need the joint distribution of the final error from all gates. And that distribution is the product of the distributions from each gate (since they are independent). So then I want to compute: P(final error is in good set and satisfies post-selection conditions) and P(final error satisfies post-selection conditions). Then fidelity = first divided by second.
So I need to compute for each gate, the probability distribution over the final Pauli that results from an error at that gate. But wait, these distributions are not independent across gates because they act on the same qubits? But since they commute, the final error is the product of the individual errors. And if I know the distribution for each gate’s error independently ( conditional on that gate having an error), then the overall distribution is the convolution of these distributions ( since they are independent). So I can compute the characteristic function or something.
Maybe I can compute for each gate, the outcome in terms of its effect on the following things:
- The Pauli on qubit4 ( whether it introduces an X on qubit4 or not). Let’s call that indicator: gate contributes a factor that causes an X on qubit4 or not.
- The Pauli on code qubits will affect the syndromes for XXXX and ZZZZ. But maybe I can compute for each gate error, what is the resulting change in the logical state? Actually, wait, since the good group is known, maybe I can compute for each gate error, what is its effect modulo the good group. That is, whether it flips the logical state or not. And also whether it causes detection (ancilla or code) conditions to fail.
I will try to compute for each gate separately by actually going through the propagation for each error type. This is laborious but maybe necessary.
Let’s start with gate2 errors ( after CNOT_{12}). So error occurs on qubits 1 and2. I will go through each of the 15 Pauli errors and determine the resulting final Pauli after gates 3,4,5,6. I’ll use the step-by-step method I started. I will keep track of the Pauli string on qubits 0,1,2,3,4 after each gate. I’ll use notation like: for each qubit, I’ll write the Pauli letter (I,X,Y,Z). I will also keep track of phases if they become relevant for determining whether something becomes I eventually? But likely phases won’t matter for the conditions because conditions are on whether there is an X or Z on each qubit. However, careful: When taking product of errors from different gates, phases might matter for overall commutation with stabilizers? But since we only care about the pattern of Pauli types ( whether each qubit has an X or Z), I think I can ignore phases because the conditions only depend on the Pauli type mod phase. because whether something commutes with XXXX depends on the number of qubits with Z or Y, and that is determined by whether that Pauli has a Z factor. So I will only care about the following: For each qubit, whether it has an X component ( yes/no) and whether it has a Z component ( yes/no). I will denote that as (x,z). So I will compute for each error type, the resulting pattern on qubits 0,1,2,3,4 as a 5-tuple of pairs (x,z). I will also determine if this error would cause the ancilla measurement to be 1? That requires that on qubit4, x=1. So if the resulting pattern has x=1 on qubit4, then that error would lead to ancilla measurement outcome 1 sometimes? Actually, wait, if an error causes qubit4 to have an X, then when we measure qubit4, we project onto |0⟩ or |1⟩. But if the error makes qubit4 involved in X, then the state becomes a superposition of |0⟩ and |1⟩ for qubit4? Actually, careful: The error is a Pauli operator. If it has an X on qubit4, then applied to the ideal state which has qubit4 in |0⟩, it will yield a state that has qubit4 in |1⟩ because X|0⟩=|1⟩. So that would cause the measurement to yield 1. So yes, conditions for post-selection include that the Pauli on qubit4 must not have x=1. So I will also note that.
Also, I want to know if the error is detectable by the code. That requires that on code qubits (0,1,2,3), the conditions are that the total number of qubits with z=1 is even, and total number with x=1 is even. If not, then it is detectable.
And then among those that are undetectable, I want to know if they are in the good group ( fidelity=1) or bad group ( fidelity=0). The good group is the stabilizer of |00>_L. How can I determine that? Maybe I can determine the logical action by looking at the pattern on qubits 0,1,2? Because the logical operators are defined on qubits 0,1,2 primarily? Actually, wait, the code has 4 qubits. The logical operators involve qubits 0,1,2 mostly? Z_A involves qubits 0 and1; Z_B involves qubits 0 and2; X_A involves qubits 0 and2; X_B involves qubits 0 and1. So likely the logical state is determined by the Pauli on qubits 0,1,2 alone? But careful: What about qubit3? Stabilizers involve qubit3 as well. So an error that acts only on qubit3 would be detectable because it would anti-commute with something? For example, X3 alone would give x count=1 on code qubits, so detectable. So indeed, any single error on a code qubit is detectable. So undetectable errors must act on at least two qubits. I might determine the logical action by actually seeing if the error can be written as something times a stabilizer that acts only on qubits 0,1,2 with Z’s? Not sure.
Maybe I can compute the effect on the state directly for each error type? Since the ideal state is |00>_L which is (|0000⟩+|1111⟩)/√2. If an error E acts on that state, what is the resulting state? If E commutes with both stabilizers, then it will leave the state in the code space. And then it will act as some logical operator. So I can compute that logical operator by looking at its action on |0000⟩ and |1111⟩. For |0000⟩, since it’s Pauli, it will give a basis state times a phase. For |1111⟩ similarly. Then the resulting state will be that basis state if they are the same. So for an error to be in the good group, it must map |0000⟩ to itself up to phase and |1111⟩ to itself up to phase. So that is a condition: E|0000⟩ should be proportional to |0000⟩, and E|1111⟩ should be proportional to |1111⟩. So for each error type (on code qubits), I can check that. So I will compute that for the final error patterns that I get. So I will also need to know the actual Pauli string on code qubits (0,1,2,3) after propagation. So I will compute that carefully.
Let’s do gate2 errors first.
Gate2: errors on qubits 1 and2.
I will go through each Pauli type for (P1, P2). I’ll use the following notation: I’ll denote the error as something like: on qubit1: something, on qubit2: something. I’ll go through each possibility.
I will also need to keep track of phases sometimes to know the sign when acting on |0000⟩ and |1111⟩. But maybe I can determine the action on |0000⟩ and |1111⟩ from the Pauli string itself without phase issues because phase will be the same for both if it’s in the good group? Actually, careful: If an error is in the good group, it should stabilize |00>_L, so it should give the same phase on both |0000⟩ and |1111⟩. So I want to know if that happens.
Maybe I’ll compute the final Pauli string explicitly for each error type. I’ll do step-by-step propagation through gates 3,4,5,6.
Let the error be E with support on qubits 1 and2 only initially.
So initial: (Q0, Q1, Q2, Q3, Q4) = (I, A, B, I, I), where A,B ∈ {I,X,Y,Z} and not both I.
Gate3: CNOT_{10} affects qubits 1 and0.
rules recall:
X_1 -> X_1 X_0
Y_1 -> Y_1 X_0
Z_1 -> Z_1
X_0 -> X_0
Z_0 -> Z_1 Z_0 (but initially Q0=I so likely won’t matter)
So after gate3, become:
depends on A:
If A = I: then remains (I, I, B, I, I).
If A = X: then becomes (X, X, B, I, I) because X_1 -> X_1 X_0 gives X on both.
If A = Y: becomes (X, Y, B, I, I) because Y_1 -> Y_1 X_0 gives phase? Actually, careful: Y_1 becomes Y_1 X_0. So that means on qubit0, we get an X. On qubit1, we get Y. So yes, (X, Y, B, I, I).
If A = Z: becomes (I, Z, B, I, I).
So after gate3, state is determined by A and B.
Gate4: CNOT_{23} affects qubits 2 and3.
Current state: (Q0, Q1, Q2, Q3, Q4) where Q2 = B initially but wait, careful: Q2 is still B because gate3 did not affect qubit2. So Q2 = B.
rules for CNOT_{23}:
X_2 -> X_2 X_3
Y_2 -> Y_2 X_3
Z_2 -> Z_2
X_3 -> X_3
Z_3 -> Z_2 Z_3
So after gate4, depends on B:
If B = I: then no change.
If B = X: then becomes: Q2 remains X? Actually, careful: X_2 -> X_2 X_3. So that means an X appears on qubit3 as well. So outcome: Q2 becomes X still? Actually, wait: initially Q2 = X. After conjugation, we get X_2 X_3. So that means the Pauli becomes: on qubit2: X, on qubit3: X. So outcome: (Q0, Q1, X, X, I) but careful: could there be already something on qubit3? Initially Q3=I, so okay.
If B = Y: then Y_2 -> Y_2 X_3. So outcome: (Q0, Q1, Y, X, I) because Q2 becomes Y, and Q3 becomes X.
If B = Z: then Z_2 remains Z_2. So outcome: (Q0, Q1, Z, I, I).
So after gate4, state becomes based on A and B. I will make a table for each combination of A and B. But note that A and B can be any of {I,X,Y,Z} but not both I. So there are 15 cases. I will go through them systematically. I’ll create a table with rows for A and columns for B. I’ll denote the state after gate4 as (Q0, Q1, Q2, Q3, Q4). I will also keep track of any phases that might occur during these conjugations? But careful: When we conjugate, sometimes phases can appear. For example, when doing CNOT, if we have something like that involves both control and target, phases can appear. I should keep track of phases because they might affect the action on |0000⟩ and |1111⟩ later. So I need to be careful with phases. Let’s determine the phase rules for CNOT conjugation properly. actually, when I write something like CNOT_{ij} P CNOT_{ij}^\dagger, the result is determined by the following rules (I’ll use that for each Pauli on involved qubits):
CNOT_{ control, target}:
I -> I (no phase)
X_c -> X_c X_t (no phase)
Z_c -> Z_c (no phase)
X_t -> X_t (no phase)
Z_t -> Z_c Z_t (no phase)
What about products? If I have something like Y_c = i X_c Z_c, then CNOT Y_c CNOT^\dagger = i (X_c X_t) Z_c = i X_c Z_c X_t = Y_c X_t. So that seems phase-free if I consider Y_c itself becomes Y_c X_t. But wait, could there be a phase? Actually, check: CNOT_{12} Y_1 CNOT_{12} =? Let’s do it carefully: Y_1 = i σ_x1 σ_z1. CNOT_{12} σ_x1 CNOT_{12} = σ_x1 σ_x2. CNOT_{12} σ_z1 CNOT_{12} = σ_z1. So product = i σ_x1 σ_z1 σ_x2 = σ_x2 (i σ_x1 σ_z1) = σ_x2 Y_1. So that gives a factor of σ_x2 outside actually. So careful: Y_1 -> actually, let’s derive properly for each Pauli on control and target separately:
I will use the following known relations:
CNOT_{ct}:
X_c -> X_c X_t
Z_c -> Z_c
X_t -> X_t
Z_t -> Z_c Z_t
These are phase-free because they are just Pauli strings.
Now, what about Y_c? Y_c = i X_c Z_c. Then CNOT Y_c CNOT = i (X_c X_t) Z_c = i X_c Z_c X_t = (i X_c Z_c) X_t = Y_c X_t. So that is also phase-free because Y_c X_t is still a Pauli string (Y_c times X_t) and there is no additional phase factor because both are Pauli matrices? But wait, check signs: Y_c X_t might actually anti-commute? They act on different qubits so they commute actually. So it’s fine.
What about Y_t? Y_t = i X_t Z_t. Then CNOT Y_t CNOT = i X_t (Z_c Z_t) = i X_t Z_t Z_c = Y_t Z_c. So that is also fine.
What about products that involve both control and target like X_c Z_t? Then CNOT (X_c Z_t) CNOT = (X_c X_t) (Z_c Z_t) = X_c Z_c X_t Z_t = (i Y_c) (i Y_t) actually careful: X_c Z_c = i Y_c, and X_t Z_t = i Y_t, so that product becomes - Y_c Y_t. So that introduces a phase of -1. So indeed, when both control and target are involved in a way that they interact, phases can appear. So I need to be careful with phases when the Pauli involves both qubits that are acted upon by the CNOT. In our propagation, we will often have that situation because errors initially act on two qubits that may both be involved in a CNOT gate. So I should compute the conjugation through each gate carefully and keep track of the resulting Pauli string and any phase factor that might multiply it. However, will phases affect whether something is detectable? Detectability is determined by commutation with stabilizers. commutation cares about whether the operator anti-commutes or not. A phase factor does not affect that. So for conditions like whether something is in the normalizer, phases are irrelevant. Also, for the ancilla condition, phases are irrelevant. However, for determining whether the error is in the good group ( stabilizes |00>_L), phases could matter because if the error gives a phase of -1 on both |0000⟩ and |1111⟩, that is still okay because that’s just a global phase. But if it gives different phases on |0000⟩ and |1111⟩, then that would not stabilize |00>_L because then the state would become something like ( -|0000⟩+|1111⟩)/√2 which is not |00>_L if that phase is not global? Actually, wait, if both get the same phase, it’s global. If they get different phases, then it’s not that state anymore. So I need to know the phase separately for acting on |0000⟩ and |1111⟩. But maybe I can compute that later directly from the final Pauli string itself. Because if the final Pauli string is something like P on code qubits, then P|0000⟩ will be something times |0000⟩ if P is diagonal in the computational basis. If P has off-diagonal terms, then it will map |0000⟩ to a different state. So actually, for P to stabilize |00>_L, it must be that P|0000⟩ is proportional to |0000⟩ and P|1111⟩ is proportional to |1111⟩. That means that P should not flip any bit in the computational basis for these states. So that means that P should act as only Z errors on these states. So actually, for P to be in the good group, it must be that on each qubit, P either acts as I or Z when applied to |0⟩ and |1⟩. But wait, consider a stabilizer like XXXX. XXXX|0000⟩ = |1111⟩, so that would not leave |0000⟩ invariant. But wait, |00>_L is (|0000⟩+|1111⟩)/√2. XXXX applied to that gives (|1111⟩+|0000⟩)/√2, so that is actually the same state. So that works because |0000⟩ and |1111⟩ are swapped. So for stabilizers, they actually exchange |0000⟩ and |1111⟩. So for an error to be in the good group, it should either leave both |0000⟩ and |1111⟩ invariant up to phase, or it should swap them up to phase. So that means that the error should either act as identity on both, or act as X on all qubits? Because XXXX will swap them. What about an error that is Z on some qubits? Z|0⟩=|0⟩, Z|1⟩=-|1⟩. So if an error is Z on some qubits, then applied to |0000⟩ it gives |0000⟩ with a phase product, and applied to |1111⟩ it gives (-1)^( number of Z’s) |1111⟩. So for that to be the same phase on both, we need that number of Z’s is even. So that is fine. So actually, the good group conditions are that the error should either have the property that it maps |0000⟩ to itself times a phase and |1111⟩ to itself times the same phase, or it maps |0000⟩ to |1111⟩ times a phase and |1111⟩ to |0000⟩ times the same phase. wait, check XXXX: XXXX|0000⟩=|1111⟩, and XXXX|1111⟩=|0000⟩. So that works if the phase is 1 both times. So for an error to be good, its action on the set {|0000⟩,|1111⟩} should be either both fixed or both swapped. So that means that the error should either have an even number of X’s on these states? Actually, if it has an odd number of X’s, then it will swap them? For example, X on one qubit alone would give: X_i|0000⟩ would give a state that is not |0000⟩ or |1111⟩ generally because it flips one bit. So that is not good. So indeed, for an error to be undetectable, it must have an even number of X’s overall on code qubits. And for it to be good, it must that even number is either 0 or 4. Because if it is 2, then it will map |0000⟩ to a state that has two ones, which is not |0000⟩ or |1111⟩. So that is the criteria: Good means that the error on code qubits has either no X anywhere or X on all four qubits. Is that true? Check an error like X0X1 Z2Z3 that I considered earlier. That has X on qubits 0 and1 only, so that is 2 X’s, so it would map |0000⟩ to |1100⟩, so that is not good. What about an error that is X0X1X2X3 itself? That is good because it swaps both. What about an error that is Z0Z1? That has 0 X’s, so good. What about an error that is X0X1X2 Z3? That has X count=3, but that is odd, so detectable anyway. So yes, for undetectable errors, the X count is even. And for good errors, that even number must be 0 or 4. So actually, the condition for fidelity 1 is that on code qubits, either there are no X’s at all, or there are X’s on all four qubits. So I will use that criteria: Good if (x_i for i=0,1,2,3 are either all 0 or all 1). And that is easy to check from the final Pauli pattern.
So I will compute for each error type the resulting pattern on code qubits (0,1,2,3) and on qubit4. And also determine if it causes detection ( code conditions fail) or causes ancilla measurement to be 1 ( qubit4 has x=1).
Let’s do that for gate2 errors.
I will go through each combination of A and B for error at gate2. I’ll make a table. I’ll also need to keep track of any phase factors that might change the Pauli type? But careful: When I conjugate through gates, the resulting operator might pick up a phase factor. That phase factor will not affect the Pauli type ( whether it is X, Y, Z) because phase factors are global. So I only care about the Pauli string itself ( the letters). So I will compute the resulting Pauli string without worrying about phases because phases won’t change whether something is X, Y, or Z. I will however note if there is a phase that might make it become something like -I times something else? But that won’t matter for the pattern of X and Z on each qubit. So I will compute the resulting string of Pauli matrices on qubits 0,1,2,3,4 after gates 3,4,5,6. I’ll do this gate by gate for each case.
Let’s take case by case.
Gate2 errors: E acts on qubits 1 and2 with Pauli (A,B). So initial: (0,1,2,3,4) = (I, A, B, I, I).
I will go through gates 3,4,5,6 in order.
Gate3: CNOT_{10}. This acts on qubits 1 and0.
rules (I’ll use that carelessly regarding phases for now because I only want the resulting Pauli type on each qubit. But careful: When both control and target are involved, sometimes the resulting Pauli might be something like that could be affected by phase? Actually, the resulting Pauli type itself ( whether it is X, Y, Z) is determined by the conjugation rules that I gave for single Paulis. Those rules should be enough to determine the outcome type on each qubit if I apply them to each Pauli factor separately. But wait, if there is interaction between factors on the same gate, then the order matters. I should apply the conjugation rules to the entire Pauli string acting on qubits that are involved in the gate. So I will do that carefully for each gate. I’ll use the following method: For each gate, I will take the current Pauli string on the two qubits that the gate acts on, and determine what it becomes after conjugation. I will also keep track of any overall phase that might appear. But since that phase won’t affect the Pauli type on each qubit, I will only care about the resulting Pauli letters on each qubit. However, caution: sometimes the phase could change something like if it becomes -I times something, that is still the same Pauli type. So I think I can determine the resulting Pauli type on each qubit by these rules applied to each Pauli factor independently, provided that the Pauli factors on different qubits commute. Is that true? For example, consider a Pauli that is X_c Z_t. Under CNOT, what happens? separately, X_c -> X_c X_t, and Z_t -> Z_c Z_t. So the product would become X_c X_t Z_c Z_t. But wait, that is not simply the product of the images because they might not commute? Actually, they do commute because they act on different qubits? X_c X_t and Z_c Z_t commute because they act on different sets? Actually, careful: X_c X_t and Z_c Z_t actually commute because they involve both qubits. I can compute directly: CNOT (X_c Z_t) CNOT. Let’s compute that properly:
CNOT = |0><0|⊗I + |1><1|⊗X.
So, CNOT (X_c Z_t) CNOT. I want to know the resulting operator. Maybe it’s easier to use the fact that CNOT conjugation takes Pauli to Pauli and there are known rules for each Pauli product. I found that for X_c Z_t, it becomes something like? Let’s derive:
CNOT_{ct} X_c Z_t CNOT_{ct} = ?
I can use the fact that CNOT_{ct} = exp(iπ/4 (I-Z_c)(I-X_t)) something. Actually, let me derive using the following method: for any Pauli P on two qubits, determine its action on basis states and see what it is equivalent to. That might be too heavy.
Maybe I can use the following known relations (I’ll assume that the conjugation rules for products are that they become the product of the images of each factor, but careful with order because sometimes they might anti-0 commute and give a sign. So I will compute the image of each Pauli factor separately and then take the product. But then I must take care of any additional sign that comes from reordering. So I will do that. I’ll denote the current Pauli as P = P_c ⊗ P_t for the two qubits involved in the gate. Then CNOT P CNOT = (CNOT P_c CNOT) (CNOT P_t CNOT) times maybe a sign if these two operators anti-commute? Actually, since CNOT is unitary, CNOT (P_c P_t) CNOT = (CNOT P_c CNOT)(CNOT P_t CNOT) because P_c and P_t commute outside anyway. So that should be fine. So I will use that method: For each gate, I will take the Pauli on the control and target separately, find their images under conjugation, and then multiply them together. But careful: Those images might not commute with each other? They act on both qubits though. But since they are Pauli strings, their product is well-defined. I will do that. So for a gate acting on qubits i (control) and j (target), the rules are:
For control:
X_i -> X_i X_j
Z_i -> Z_i
For target:
X_j -> X_j
Z_j -> Z_i Z_j
And these rules are phase-free because they directly give the resulting Pauli string without any additional phase factors. I will use these rules. But wait, check with Y_i: Y_i = i X_i Z_i. Under control rules, X_i -> X_i X_j, Z_i -> Z_i, so that would give i (X_i X_j) Z_i = i X_i Z_i X_j = Y_i X_j. So that works. And for Y_j: Y_j = i X_j Z_j -> i X_j (Z_i Z_j) = i X_j Z_j Z_i = Y_j Z_i. So that works too. So these rules seem phase-free if applied to each Pauli factor separately. But careful: What about when both factors are present? For example, take P = X_i Z_j. Then separately, image of X_i is X_i X_j, image of Z_j is Z_i Z_j. Their product is X_i X_j Z_i Z_j. But wait, is that equal to CNOT (X_i Z_j) CNOT? Let’s check with specific states. Take i=1,j=0. So CNOT_{10}. Consider operator X_1 Z_0. Act on state |00⟩: X_1 Z_0|00⟩ = |10⟩ because Z_0|0⟩=|0⟩ actually careful: Z_0|0⟩=|0⟩, so X_1|00⟩=|10⟩. So X_1 Z_0|00⟩=|10⟩.
Now, what is (X_1 X_0)(Z_1 Z_0)|00⟩? But careful: (X_1 X_0)(Z_1 Z_0) acting on |00⟩. first, Z_1 Z_0|00⟩ = Z_1|00⟩ since Z_0|0⟩=|0⟩, so = |00⟩ because Z_1|0⟩=|0⟩. Then X_1 X_0|00⟩ = |11⟩. So that gives |11⟩. So that is different. So there is a sign issue. So I cannot simply take the product of the images because they might not commute. I need to compute the image of the product directly. So I will compute the image of each two-qubit Pauli under CNOT conjugation for the two qubits involved. I’ll make a table for CNOT conjugation on two qubits for all Pauli strings on those two qubits. Let the two qubits be control (c) and target (t). The Pauli strings on these two qubits are determined by Pauli on c and Pauli on t. I will list them and their images under CNOT_{ct}. I’ll use that then for each gate when it acts on the two qubits that are involved.
So for a gate CNOT_{ct}, the conjugation rules for Pauli strings on {c,t} are known. I can use this table:
I will use that for each gate, when it acts, I will look at the Pauli on the two qubits that are involved and replace them with the image according to this table. I will also keep track of any phase that might appear relative to that Pauli string. But since I only care about the Pauli type ( whether it is X, Y, Z) on each qubit, that phase won’t affect that. However, caution: sometimes the phase could be such that it changes the Pauli type? No, phase is just a scalar multiple. So I will only care about the resulting Pauli letters on each qubit. So I will use the following table for CNOT_{ct} conjugation outcomes. I’ll denote the Pauli on control and target as something like: (P_c, P_t) -> (P_c’, P_t’) with maybe a phase factor. I’ll determine that table.
Let the Pauli matrices be I, X, Y, Z. I’ll use that for two qubits, the outcome of CNOT_{ct} P CNOT_{ct}^\dagger. I can derive this known table. Actually, I recall that under CNOT, the following happens:
IX -> IX
IY -> ZY? Wait, let’s derive systematically.
I will use the rules that for single Paulis:
CNOT_{ct}:
X_c -> X_c X_t
Z_c -> Z_c
X_t -> X_t
Z_t -> Z_c Z_t
Now, for products, I will compute them carefully.
Let me denote the Pauli on control and target as ( something on c, something on t). I’ll go through each combination:
-
(I, I) -> (I, I) obviously.
-
(I, X) -> remains (I, X) because X_t -> X_t.
-
(I, Y) -> Y_t = i X_t Z_t. Under CNOT, X_t -> X_t, Z_t -> Z_c Z_t. So Y_t -> i X_t (Z_c Z_t) = i X_t Z_t Z_c = Y_t Z_c. So (I, Y) -> (Z_c, Y_t) actually careful: that gives an operator that is Z on control and Y on target. But wait, is there a phase? Let’s check with states to be sure. Take CNOT_{ct} (I⊗Y) CNOT_{ct}. Consider its action on |00⟩. (I⊗Y)|00⟩ = i|01⟩? Actually, Y|0⟩ = i|1⟩, so (I⊗Y)|00⟩ = i|01⟩.
Now, what is (Z_c ⊗ Y_t)|00⟩? That is Z|0⟩⊗Y|0⟩ = |0⟩⊗(i|1⟩) = i|01⟩. So that works. So (I,Y) -> (Z, Y) with no phase? But wait, careful: (Z_c ⊗ Y_t) actually means that control gets Z and target gets Y. So that is the outcome. So (I,Y) -> (Z, Y).
-
(I, Z) -> Z_t -> Z_c Z_t, so (I,Z) -> (Z_c, Z_t). Check: (I,Z)|00⟩=|00⟩. (Z,Z)|00⟩=|00⟩. So okay.
-
(X, I) -> X_c -> X_c X_t, so (X,I) -> (X_c, X_t).
- (X, X) -> need to compute CNOT (X_c X_t) CNOT. separately, X_c -> X_c X_t, X_t -> X_t, so product would be X_c X_t X_t = X_c I = X_c. But wait, that seems to suggest (X,X) -> (X, I). Let’s check with states: (X,X)|00⟩ = |11⟩. CNOT|00⟩=|00⟩, so that’s fine. Actually, compute directly: CNOT (X_c X_t) CNOT. Take state |00⟩. First, CNOT^\dagger|00⟩=|00⟩. Then X_c X_t|00⟩=|11⟩. Then CNOT|11⟩ = |10⟩? because CNOT|11⟩ = |10⟩ actually since control=1, target flip -> becomes 0. So that gives |10⟩. And (X_c alone)|00⟩ would give |10⟩? because X_c|00⟩=|10⟩. So yes, (X,X) -> (X, I). So (X,X) -> (X, I).
- (X, Y) -> X_c Y_t. under CNOT, X_c -> X_c X_t, Y_t -> Y_t Z_c (from earlier). So product becomes X_c X_t Y_t Z_c. Now, note that X_t Y_t = i Z_t (since X Y = iZ). So becomes