Checkpoint-2

System #0

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

Input Problems will be provided in Markdown format.

Output (Markdown format)

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

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

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

User #1

Problem setup:

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

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

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

Checkpoint 1

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

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

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

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

Assistant #2
Reasoning (model)

First, I need to find the physical state fidelity of the final state after the circuit, considering errors from the CNOT gates. The circuit is given as: (CNOT_{03}) (H_0) (CNOT_{21}) (H_2). But since quantum operations are applied from right to left, the actual order of operations is:

  1. Apply H_2

  2. Apply CNOT_{21}

  3. Apply H_0

  4. Apply CNOT_{03}

Each CNOT gate is followed by a two-qubit depolarizing error channel with error probability p. That means after each CNOT, with probability p, one of the 15 non-identity two-qubit Paulis is applied, each with probability p/15. But since the error channel is applied after the gate, I need to model the errors separately for each CNOT.

The fidelity is between the ideal state and the actual state with errors. So I need to find the ideal state first, then find the actual state with errors, and then compute the fidelity.

The ideal state is what we get without any errors. Let’s compute that step by step.

Start with all qubits in |0⟩ state, I assume? The problem doesn’t specify the initial state, but typically for state preparation, we start with all qubits in |0⟩. So let’s assume initial state is |0000⟩.

Now, apply the operations in order:

First, apply H_2. H_2 is Hadamard on qubit 2. So after H_2: |0⟩_2 becomes (|0⟩ + |1⟩)/√2, so state is |00⟩ (qubits 0,1) ⊗ (|0⟩ + |1⟩)/√2 ⊗ |0⟩_3? Let’s label qubits: qubit 0,1,2,3.

After H_2: qubit 2 is now in |+⟩ = (|0⟩ + |1⟩)/√2, so state is |0⟩_0 |0⟩_1 (|0⟩ + |1⟩)/√2 |0⟩_3 = (|0000⟩ + |0010⟩)/√2? No: qubit 2 is the third qubit? Qubits are labelled 0,1,2,3, so after H_2, state is |0⟩_0 |0⟩_1 |+⟩_2 |0⟩_3 = \frac{1}{\sqrt{2}} ( |0000\rangle + |0010\rangle ) but |0010⟩ means qubit 0=0,1=0,2=1,3=0, so yes.

But better to write as \frac{1}{\sqrt{2}} ( |00\rangle_{01} |0\rangle_2 |0\rangle_3 + |00\rangle_{01} |1\rangle_2 |0\rangle_3 ) = \frac{1}{\sqrt{2}} ( |0000\rangle + |0010\rangle )

Now, next operation: CNOT_{21}. CNOT with control qubit 2 and target qubit 1.

So apply CNOT_{21} to the state. CNOT_{21} flips qubit 1 if qubit 2 is |1⟩.

So on the state \frac{1}{\sqrt{2}} ( |0000\rangle + |0010\rangle )

After CNOT_{21}:

  • For |0000⟩: control qubit 2 is |0⟩, so no flip, remains |0000⟩

  • For |0010⟩: control qubit 2 is |1⟩, so flip qubit 1, which is |0⟩ to |1⟩, so becomes |0110⟩? Qubit 1 was |0⟩, so after flip, |1⟩, so state is |0⟩_0 |1⟩_1 |1⟩_2 |0⟩_3, so |0110⟩.

So state becomes \frac{1}{\sqrt{2}} ( |0000\rangle + |0110\rangle )

Now, next operation: H_0. Hadamard on qubit 0.

Apply H_0 to each term.

H_0 |0⟩_0 = (|0⟩ + |1⟩)/√2

H_0 |1⟩_0 = (|0⟩ - |1⟩)/√2

But in our state, qubit 0 is always |0⟩ in both terms? |0000⟩ has qubit 0=0, |0110⟩ has qubit 0=0, so both have qubit 0 in |0⟩.

So after H_0:

For |0000⟩: H_0 applied, so becomes (|0⟩0 + |1⟩_0)/√2 ⊗ |000⟩{123}? No, the state is |0000⟩, so after H_0 on qubit 0, it becomes \frac{1}{\sqrt{2}} ( |0000\rangle + |1000\rangle ) but since we have a global factor, let’s see.

The state before H_0 is \frac{1}{\sqrt{2}} ( |0000\rangle + |0110\rangle )

After H_0 on qubit 0:

|0000⟩ → \frac{1}{\sqrt{2}} ( |0000\rangle + |1000\rangle )

|0110⟩ → \frac{1}{\sqrt{2}} ( |0110\rangle + |1110\rangle )? No: H_0 |0⟩_0 = (|0⟩ + |1⟩)/√2, so |0110⟩ becomes \frac{1}{\sqrt{2}} ( |0110\rangle + |1110\rangle )

But since we have a global 1/√2, the state becomes:

\frac{1}{\sqrt{2}} \left[ \frac{1}{\sqrt{2}} ( |0000\rangle + |1000\rangle ) + \frac{1}{\sqrt{2}} ( |0110\rangle + |1110\rangle ) \right] = \frac{1}{2} ( |0000\rangle + |1000\rangle + |0110\rangle + |1110\rangle )

Now, finally, apply CNOT_{03}. CNOT with control qubit 0 and target qubit 3.

So apply CNOT_{03} to this state.

CNOT_{03} flips qubit 3 if qubit 0 is |1⟩.

So let’s apply to each term:

  • |0000⟩: control qubit 0 is |0⟩, so no flip, remains |0000⟩

  • |1000⟩: control qubit 0 is |1⟩, so flip qubit 3 from |0⟩ to |1⟩, so becomes |1001⟩

  • |0110⟩: control qubit 0 is |0⟩, so no flip, remains |0110⟩

  • |1110⟩: control qubit 0 is |1⟩, so flip qubit 3 from |0⟩ to |1⟩, so becomes |1111⟩

So the ideal final state is:

\frac{1}{2} ( |0000\rangle + |1001\rangle + |0110\rangle + |1111\rangle )

Now, is this the logical GHZ state? The logical GHZ state for qubits A and B should be (|00⟩_AB + |11⟩_AB)/√2.

But what are the logical states? From the problem, the logical operators are given, but I need to know the code states.

The [[4,2,2]] code has stabilizers XXXX and ZZZZ. The logical states are defined with respect to these.

For example, the logical |00⟩_AB might be a state that is +1 eigenstate of stabilizers and logical Z operators.

But in this state, we have |0000⟩, |1001⟩, etc. I need to see if this is indeed the logical GHZ state.

Perhaps for fidelity calculation, I don’t need to know the logical part, since fidelity is about the physical state.

The question is to find the physical state fidelity, which is the fidelity between the ideal physical state and the actual physical state with errors.

So for the ideal state, we have it as above.

Now, for the actual state, we have errors after each CNOT gate.

There are two CNOT gates: CNOT_{21} and CNOT_{03}.

Each CNOT is followed by a depolarizing error channel on the two qubits involved.

So, after CNOT_{21}, with probability 1-p, no error, and with probability p, an error occurs, which is one of the 15 Pauli errors on qubits 2 and 1, each with probability p/15.

Similarly, after CNOT_{03}, with probability 1-p, no error, and with probability p, an error occurs on qubits 0 and 3.

The Hadamard gates are assumed to be perfect, I think? The problem only mentions errors for CNOT gates, so H gates are noiseless.

So, the actual state is affected by errors after CNOT gates.

I need to find the output state after the circuit with errors, and then find the fidelity with the ideal state.

Fidelity F = |⟨ψ_ideal | ψ_actual ⟩|^2, but since there might be multiple error possibilities, ψ_actual is a mixed state, so fidelity is for pure state and mixed state? The ideal state is pure, but actual state is mixed due to errors.

The fidelity between a pure state |ψ⟩ and a mixed state ρ is ⟨ψ| ρ |ψ⟩.

So I need to find the density matrix of the actual output state, and then compute ⟨ψ_ideal| ρ |ψ_ideal⟩.

Since the errors are stochastic, I need to average over all possible error patterns.

There are two error locations: after CNOT_{21} and after CNOT_{03}.

For each CNOT, the error channel is: after the gate, with prob 1-p, identity, with prob p, a Pauli error E chosen uniformly from the 15 non-identity two-qubit Paulis on the pair.

The Pauli errors are applied after the gate, so they affect the state.

I need to find the state after each step, considering errors.

Start with initial state ρ_0 = |0000⟩⟨0000|

First, apply H_2. No error, so after H_2, state is |ψ1⟩⟨ψ1| where |ψ1⟩ = \frac{1}{\sqrt{2}} ( |0000\rangle + |0010\rangle ) as before.

Now, apply CNOT_{21}. First, apply the ideal CNOT_{21} to |ψ1⟩, which gives |ψ2⟩ = \frac{1}{\sqrt{2}} ( |0000\rangle + |0110\rangle ) as before.

But after applying CNOT_{21}, we have the error channel. So after CNOT_{21}, we have a state, then we apply the error channel.

Let me denote the state after ideal CNOT_{21} as |ψ2⟩.

Then, after error channel, the state becomes:

With probability 1-p, no error, so state remains |ψ2⟩

With probability p, an error E is applied, where E is a Pauli on qubits 2 and 1. Since |ψ2⟩ is a state, after error, it becomes E |ψ2⟩, but since E is Pauli, it changes the state.

But for the density matrix, after error channel, the state is a mixture: (1-p) |ψ2⟩⟨ψ2| + (p/15) sum_{E in Paulis on {1,2}, E≠I} E |ψ2⟩⟨ψ2| E^\dagger

Since Paulis are unitary, E^\dagger E = I, so it’s (1-p) |ψ2⟩⟨ψ2| + (p/15) sum_{E} E |ψ2⟩⟨ψ2| E^\dagger

But since the sum is over all non-identity Paulis on two qubits, and there are 15 of them.

Now, after this, we apply H_0, which is perfect, so we apply H_0 to this density matrix.

Then, after H_0, we apply CNOT_{03} ideally, and then after that, we apply the error channel for CNOT_{03}.

So, let’s do this step by step.

First, after CNOT_{21} and error channel, the density matrix ρ_2 is:

ρ_2 = (1-p) |ψ2⟩⟨ψ2| + \frac{p}{15} \sum_{E \in \mathcal{P}_{21} \setminus {I}} E |ψ2⟩⟨ψ2| E^\dagger

where \mathcal{P}_{21} is the set of Pauli operators on qubits 2 and 1.

Now, |ψ2⟩ = \frac{1}{\sqrt{2}} ( |0000\rangle + |0110\rangle )

Now, we apply H_0 to ρ_2. Since H_0 is unitary, the new density matrix is H_0 ρ_2 H_0^\dagger

H_0 acts only on qubit 0, so it commutes with operators on other qubits, but since ρ_2 involves qubits 0,1,2,3, we apply H_0 to it.

After H_0, we have ρ_3 = H_0 ρ_2 H_0^\dagger

Now, we apply ideal CNOT_{03} to ρ_3. Let U_{03} be the unitary for CNOT_{03}, so after CNOT_{03}, we have ρ_4 = U_{03} ρ_3 U_{03}^\dagger

Then, after CNOT_{03}, we apply the error channel for CNOT_{03}, which is on qubits 0 and 3. So the final density matrix ρ_final is:

ρ_final = (1-p) ρ_4 + \frac{p}{15} \sum_{F \in \mathcal{P}_{03} \setminus {I}} F ρ_4 F^\dagger

where \mathcal{P}_{03} is Paulis on qubits 0 and 3.

Now, we need to find the fidelity F = ⟨ψ_ideal| ρ_final |ψ_ideal⟩

where |ψ_ideal⟩ = \frac{1}{2} ( |0000\rangle + |1001\rangle + |0110\rangle + |1111\rangle ) as derived earlier.

Since the error channels are Pauli errors, and the initial state and operations are Clifford, perhaps I can compute the effect of errors on the ideal state.

Notice that the ideal state is a stabilizer state, and errors are Pauli errors, so the fidelity might be computed by finding the probability that no error occurs or errors that cancel, but since errors happen during the circuit, it might be messy.

I recall that for depolarizing noise, the fidelity can be related to the probability that the state is not affected by errors.

But here errors are after specific gates, so I need to see how errors propagate through the circuit.

Since the circuit consists of Clifford gates, and errors are Pauli, I can track how Pauli errors affect the state.

But for fidelity, I need ⟨ψ| ρ |ψ⟩, which is the probability that the actual state is the ideal state.

Since ρ_final is a mixture of states obtained by applying Pauli errors at different points, and then the gates, I can think of all possible error sequences and find the final state for each error pattern, and then average the fidelity.

There are two error locations: after CNOT21 and after CNOT03.

For each error location, there are 16 possibilities: no error or one of 15 Pauli errors.

But since the errors are applied after the gate, and then subsequent gates are applied, I need to see what happens when errors occur.

Let me define the ideal circuit without errors as U_circuit = CNOT03 H0 CNOT21 H2

And the ideal output |ψ_ideal⟩ = U_circuit |0000⟩

With errors, after each CNOT, an error may occur.

So, let me denote the actual operation.

Start with |0000⟩

Apply H2: no error, so |ψ1⟩ = H2 |0000⟩ = \frac{1}{\sqrt{2}} ( |0000\rangle + |0010\rangle )

Now apply CNOT21: first apply CNOT21 ideally, so |ψ2⟩ = CNOT21 |ψ1⟩ = \frac{1}{\sqrt{2}} ( |0000\rangle + |0110\rangle )

Then after CNOT21, with prob 1-p, no error, state remains |ψ2⟩

With prob p, an error E on {2,1} is applied, so state becomes E |ψ2⟩

Then after this, apply H0: so if no error, H0 |ψ2⟩ = |ψ3⟩ where |ψ3⟩ = H0 |ψ2⟩ = \frac{1}{2} ( |0000\rangle + |1000\rangle + |0110\rangle + |1110\rangle ) as before? Earlier we had after H0, the state was \frac{1}{2} ( |0000\rangle + |1000\rangle + |0110\rangle + |1110\rangle ) but that was after H0 on |ψ2⟩, which is correct.

But after error, if error E occurred, then we apply H0 to E |ψ2⟩.

Then after H0, we apply CNOT03 ideally: so first apply CNOT03 to the state after H0.

Then after CNOT03, with prob 1-p, no error, or with prob p, error F on {0,3} applied.

So for each error pattern, we have a final state, and then we average over the error probabilities.

Then fidelity is |⟨ψ_ideal| ψ_actual ⟩|^2 for each pure state ψ_actual, but since we have mixture, we need the average of |⟨ψ_ideal| ψ_final ⟩|^2 over error patterns, but for fidelity between pure and mixed, it is the average of |⟨ψ_ideal| ψ⟩|^2 for each |ψ⟩ in the mixture, which is exactly what we have since ρ_final is a mixture of pure states.

So let’s find for each error pattern, what is the final state, and then what is |⟨ψ_ideal| ψ_final ⟩|^2, and then average over error probabilities.

First, define the states after each step without errors.

After H2: |ψ1⟩ = \frac{1}{\sqrt{2}} ( |0000\rangle + |0010\rangle )

After CNOT21: |ψ2⟩ = \frac{1}{\sqrt{2}} ( |0000\rangle + |0110\rangle )

After H0: |ψ3⟩ = H0 |ψ2⟩ = \frac{1}{2} ( |0000\rangle + |1000\rangle + |0110\rangle + |1110\rangle )

After CNOT03: |ψ_ideal⟩ = CNOT03 |ψ3⟩ = \frac{1}{2} ( |0000\rangle + |1001\rangle + |0110\rangle + |1111\rangle )

Now, with errors.

Case 1: no error after CNOT21.

Then after CNOT21, state is |ψ2⟩.

Then apply H0: state becomes |ψ3⟩.

Then apply CNOT03 ideally: state becomes |ψ_ideal⟩.

Then after CNOT03, we have error channel.

So after CNOT03, state is |ψ_ideal⟩.

Then with probability 1-p, no error, so final state |ψ_ideal⟩

With probability p, error F on {0,3} is applied, so final state F |ψ_ideal⟩

So for no error after CNOT21, the final state is:

  • With prob (1-p) from error after CNOT03: |ψ_ideal⟩

  • With prob p from error after CNOT03: F |ψ_ideal⟩ for each F, with prob p/15 each F.

But since we have multiple F, we need to average.

Now, case 2: error E after CNOT21.

With probability p/15 for each E, after CNOT21, state is E |ψ2⟩

Then apply H0: state becomes H0 E |ψ2⟩

Then apply CNOT03 ideally: state becomes CNOT03 H0 E |ψ2⟩

Then after CNOT03, with probability 1-p, no error, so final state CNOT03 H0 E |ψ2⟩

With probability p, error F on {0,3} applied, so final state F CNOT03 H0 E |ψ2⟩

Now, we need to find for each such final state, what is |⟨ψ_ideal| ψ_final ⟩|^2

Since |ψ_ideal⟩ is a state, and ψ_final is some state, we need the overlap.

Notice that |ψ_ideal⟩ = CNOT03 H0 |ψ2⟩, because |ψ2⟩ = CNOT21 H2 |0000⟩, and U_circuit = CNOT03 H0 CNOT21 H2, so |ψ_ideal⟩ = CNOT03 H0 CNOT21 H2 |0000⟩ = CNOT03 H0 |ψ2⟩

So |ψ_ideal⟩ = CNOT03 H0 |ψ2⟩

Therefore, for any operator O, ⟨ψ_ideal| O |ψ_ideal⟩ = ⟨ψ2| H0^\dagger CNOT03^\dagger O CNOT03 H0 |ψ2⟩

But for our case, we need ⟨ψ_ideal| ψ_final ⟩ for various ψ_final.

First, for case 1: no error after CNOT21.

Then after CNOT03, if no error, ψ_final = |ψ_ideal⟩, so ⟨ψ_ideal| ψ_final ⟩ =1, so |⟨|^2=1

If error F after CNOT03, ψ_final = F |ψ_ideal⟩, so ⟨ψ_ideal| F |ψ_ideal⟩

So |⟨ψ_ideal| F |ψ_ideal⟩|^2

Since F is Pauli on {0,3}, and |ψ_ideal⟩ is a state, we need to see how F acts on |ψ_ideal⟩.

Similarly for other cases.

Now, |ψ_ideal⟩ = \frac{1}{2} ( |0000\rangle + |1001\rangle + |0110\rangle + |1111\rangle )

This state might have some symmetry or stabilizers.

Notice that the circuit is designed to create the logical GHZ state, but for physical fidelity, we care about the physical state.

Let me write |ψ_ideal⟩ explicitly.

|ψ_ideal⟩ = \frac{1}{2} ( |0\rangle_0 |0\rangle_1 |0\rangle_2 |0\rangle_3 + |1\rangle_0 |0\rangle_1 |0\rangle_2 |1\rangle_3 + |0\rangle_0 |1\rangle_1 |1\rangle_2 |0\rangle_3 + |1\rangle_0 |1\rangle_1 |1\rangle_2 |1\rangle_3 )

Now, let’s find the stabilizers of this state. Since it’s a GHZ-like state, it might be stabilized by some Paulis.

For example, XXXX applied to |ψ_ideal⟩: XXXX |ψ_ideal⟩ = \frac{1}{2} ( |1111\rangle + |0110\rangle + |1001\rangle + |0000\rangle ) = |ψ_ideal⟩, so it is stabilized by XXXX.

Similarly, ZZZZ |ψ_ideal⟩ = \frac{1}{2} ( |0000\rangle + (-1) |1001\rangle + (-1) |0110\rangle + (1) |1111\rangle )? Let’s see: ZZZZ means Z on each qubit, so for each term, phase based on number of |1⟩.

|0000⟩: all |0⟩, so phase +1

|1001⟩: qubit 0=1,1=0,2=0,3=1, so three |1⟩? qubit 0=1,1=0,2=0,3=1, so two |1⟩? |1⟩ on qubit 0 and 3, so two |1⟩, so ZZZZ gives phase (-1)^2 = +1? Z applied to |1⟩ gives -|1⟩, but for basis state, Z_i |x_i⟩ = (-1)^{x_i} |x_i⟩, so for state, ZZZZ |ket> = product of (-1)^{x_i} for each qubit.

For |1001⟩, x0=1, x1=0, x2=0, x3=1, so (-1)^{1+0+0+1} = (-1)^2 =1, so phase +1.

Similarly, |0110⟩: x0=0,x1=1,x2=1,x3=0, so (-1)^{0+1+1+0} = (-1)^2=1

|1111⟩: all 1, (-1)^4=1

So ZZZZ |ψ_ideal⟩ = |ψ_ideal⟩, so it is also stabilized by ZZZZ.

So |ψ_ideal⟩ is indeed a stabilizer state of the [[4,2,2]] code? But the code has multiple logical states, so this is one of them.

Now, back to fidelity.

First, for case 1: no error after CNOT21.

Then after CNOT03, with prob 1-p, no error, final state |ψ_ideal⟩, fidelity |⟨ψ_ideal|ψ_ideal⟩|^2 =1

With prob p, error F on {0,3}, final state F |ψ_ideal⟩, so fidelity |⟨ψ_ideal| F |ψ_ideal⟩|^2

Now, since F is Pauli on qubits 0 and 3, and |ψ_ideal⟩ is stabilized by XXXX and ZZZZ, but F acts only on 0 and 3, so we need to see if F commutes with the stabilizers or not, but for the overlap, ⟨ψ_ideal| F |ψ_ideal⟩ is the expectation value of F in state |ψ_ideal⟩.

Since |ψ_ideal⟩ is a stabilizer state, for any Pauli operator P, ⟨ψ| P |ψ⟩ is either 0 or ±1, depending on whether P is in the stabilizer or not.

Specifically, for a stabilizer state |ψ⟩ with stabilizer group S, ⟨ψ| P |ψ⟩ = 1 if P ∈ S, -1 if P ∈ -S, and 0 otherwise.

But here, F is on qubits 0 and 3, so we need to see if F is in the stabilizer of |ψ_ideal⟩ or not.

The stabilizer of |ψ_ideal⟩ includes XXXX and ZZZZ, but also other operators? Since it’s a stabilizer state, the full stabilizer group has 4 generators for 4 qubits, but here we have two generators mentioned, but for this state, it might have more.

From the state, let’s find what stabilizes it.

For example, consider operator Z I Z I? Let’s see.

First, list the basis states: |0000⟩, |1001⟩, |0110⟩, |1111⟩

Notice that the parity of qubits 0 and 3 is the same: in |0000⟩, both 0, |1001⟩ both 1, |0110⟩ both 0? |0110⟩ has qubit 0=0, qubit 3=0, so both 0, |1111⟩ both 1. So qubit 0 and qubit 3 are always equal. So the operator that measures if they are equal? For example, the operator that is I if both same, -I if different, but for stabilizer, we need operators that fix the state.

Since always same, the operator X0 X3 should have expectation, but X0 X3 |ψ_ideal⟩ = ?

X0 X3 |0000⟩ = |1001⟩

X0 X3 |1001⟩ = |0000⟩

X0 X3 |0110⟩ = |1111⟩? X0 on |0> = |1>, X3 on |0> = |1>, so |1111⟩? |0110⟩ with X0 X3: X0 on qubit 0: |0> to |1>, so |1110⟩? No: |0110⟩ means qubit 0=0,1=1,2=1,3=0. After X0, qubit 0=1, so |1110⟩? Then X3 on qubit 3=0 to 1, so |1111⟩. Similarly X0 X3 |1111⟩ = |0110⟩? X0 on |1> = |0>, X3 on |1> = |0>, so |0110⟩. So X0 X3 |ψ_ideal⟩ = |ψ_ideal⟩, so it is stabilized by X0 X3.

Similarly, since XXXX stabilizes, and X0 X3 stabilizes, then X1 X2 must also stabilize? XXXX = X0 X1 X2 X3, so if X0 X3 stabilizes, then X1 X2 must stabilize because XXXX (X0 X3) = X1 X2, so yes, X1 X2 also stabilizes |ψ_ideal⟩.

Similarly for Z operators. From ZZZZ, and since qubit 0 and 3 are always same, but let’s see Z0 Z3.

Z0 Z3 |0000⟩ = |0000⟩

Z0 Z3 |1001⟩ = (-1) * (-1) |1001⟩ = |1001⟩? Z0 on |1> = -|1>, Z3 on |1> = -|1>, so product phase (-1)(-1)=1, so yes.

Z0 Z3 |0110⟩ = Z0 on |0> =1, Z3 on |0> =1, so |0110⟩

Z0 Z3 |1111⟩ = (-1)(-1)|1111⟩ = |1111⟩

So Z0 Z3 |ψ_ideal⟩ = |ψ_ideal⟩, so stabilized by Z0 Z3.

Similarly, from ZZZZ, and Z0 Z3, then Z1 Z2 must stabilize.

So the stabilizer group of |ψ_ideal⟩ is generated by XXXX, ZZZZ, X0 X3, Z0 Z3, etc., but since XXXX and X0 X3 imply X1 X2, similarly for Z.

But for our purpose, we need to find for Pauli F on {0,3}, what is ⟨ψ_ideal| F |ψ_ideal⟩.

F is a Pauli on qubits 0 and 3, so it can be I, X0, X3, X0 X3, Z0, Z3, Z0 Z3, Y0, Y3, Y0 Y3, etc., but since it’s Pauli, it’s products of X and Z.

But since |ψ_ideal⟩ is stabilized by X0 X3 and Z0 Z3, then for any Pauli P on {0,3}, if P commutes with X0 X3 and Z0 Z3, then it might be in the stabilizer, but not necessarily.

Actually, for a stabilizer state, the expectation value of Pauli P is non-zero only if P commutes with all stabilizers, but since the stabilizers include operators on other qubits, P on {0,3} may not commute with, say, X1 X2, but X1 X2 acts on other qubits, so it commutes with P since acting on different qubits, so yes, P commutes with all stabilizers that act on other qubits.

The stabilizer group of |ψ_ideal⟩ includes operators on all qubits, but since P acts only on 0 and 3, it commutes with any operator that doesn’t act on 0 or 3, but for operators that act on 0 or 3, we need to see.

The key point is that for |ψ_ideal⟩, since it is a stabilizer state, and the subgroup acting on qubits 0 and 3 can be characterized.

From the state, we see that qubit 0 and qubit 3 are always equal in the basis state, so for any Pauli P on {0,3}, it will have non-zero expectation only if it doesn’t change the correlation between 0 and 3.

But let’s calculate ⟨ψ_ideal| F |ψ_ideal⟩ for each type of F.

F is a two-qubit Pauli on qubits 0 and 3. There are 16 Paulis, but we need only non-identity for error, but for expectation, we can compute.

Since |ψ_ideal⟩ is normalized, ⟨ψ_ideal| F |ψ_ideal⟩ is the expectation value.

From the state, let’s compute for each possible F.

First, if F = I, then ⟨I⟩ =1

If F = X0, then X0 |ψ_ideal⟩ = \frac{1}{2} ( X0 |0000⟩ + X0 |1001⟩ + X0 |0110⟩ + X0 |1111⟩ ) = \frac{1}{2} ( |1000⟩ + |0001⟩ + |1110⟩ + |0111⟩ )

Now ⟨ψ_ideal| X0 |ψ_ideal⟩ = \frac{1}{4} \langle 0000| + \langle 1001| + \langle 0110| + \langle 1111| ) ( |1000⟩ + |0001⟩ + |1110⟩ + |0111⟩ )

Now, dot product: ⟨0000|1000⟩=0, ⟨0000|0001⟩=0, etc., all terms are orthogonal, so each inner product is zero unless same state. But here, |0000⟩ vs |1000⟩, different, so all inner products are zero. So ⟨ψ_ideal| X0 |ψ_ideal⟩ =0

Similarly, if F = X3, similarly, X3 |ψ_ideal⟩ = \frac{1}{2} ( |0001⟩ + |1000⟩ + |0111⟩ + |1110⟩ ) , same as above, so ⟨ψ_ideal| X3 |ψ_ideal⟩ =0

If F = X0 X3, then X0 X3 |ψ_ideal⟩ = |ψ_ideal⟩ as we saw earlier, so ⟨ψ_ideal| X0 X3 |ψ_ideal⟩ =1

Similarly, if F = Z0, then Z0 |ψ_ideal⟩ = \frac{1}{2} ( Z0 |0000⟩ + Z0 |1001⟩ + Z0 |0110⟩ + Z0 |1111⟩ ) = \frac{1}{2} ( |0000⟩ + (-1)|1001⟩ + |0110⟩ + (-1)|1111⟩ )

Now ⟨ψ_ideal| Z0 |ψ_ideal⟩ = \frac{1}{4} ( ⟨0000| + ⟨1001| + ⟨0110| + ⟨1111| ) ( |0000⟩ - |1001⟩ + |0110⟩ - |1111⟩ ) = \frac{1}{4} (1 -1 +1 -1) =0

Similarly for Z3, same thing, because from state, qubit 0 and 3 have same value, so Z0 and Z3 have same effect? Z3 |ψ_ideal⟩ = \frac{1}{2} ( |0000⟩ + (-1)|1001⟩ + |0110⟩ + (-1)|1111⟩ ) same as above, so ⟨Z3⟩=0

If F = Z0 Z3, then Z0 Z3 |ψ_ideal⟩ = |ψ_ideal⟩ as above, so ⟨Z0 Z3⟩=1

Now for Y operators. Y = i X Z, so for example F = Y0 = i X0 Z0

But since expectation is linear, and we have ⟨X0⟩=0, ⟨Z0⟩=0, so ⟨Y0⟩ = i ⟨X0 Z0⟩ but X0 Z0 is another Pauli, so we can compute directly.

Y0 |ψ_ideal⟩ = i X0 Z0 |ψ_ideal⟩ = i X0 [ \frac{1}{2} ( |0000⟩ - |1001⟩ + |0110⟩ - |1111⟩ ) ] from earlier? Z0 |ψ_ideal⟩ = \frac{1}{2} ( |0000⟩ - |1001⟩ + |0110⟩ - |1111⟩ )

Then X0 on that: X0 Z0 |ψ_ideal⟩ = \frac{1}{2} ( X0 |0000⟩ - X0 |1001⟩ + X0 |0110⟩ - X0 |1111⟩ ) = \frac{1}{2} ( |1000⟩ - |0001⟩ + |1110⟩ - |0111⟩ )

So Y0 |ψ_ideal⟩ = i \frac{1}{2} ( |1000⟩ - |0001⟩ + |1110⟩ - |0111⟩ )

Now ⟨ψ_ideal| Y0 |ψ_ideal⟩ = i \frac{1}{4} \langle 0000| + \langle 1001| + \langle 0110| + \langle 1111| ) ( |1000⟩ - |0001⟩ + |1110⟩ - |0111⟩ ) =0 since all inner products zero.

Similarly for Y3, same thing.

For F = Y0 Y3, etc., but similarly, since X0 X3 has expectation 1, Z0 Z3 has expectation 1, but Y0 Y3 = i^2 X0 Z0 X3 Z3 = - X0 X3 Z0 Z3, and since X0 X3 and Z0 Z3 both stabilize, so Y0 Y3 |ψ_ideal⟩ = - |ψ_ideal⟩? Let’s see.

Y0 Y3 = (i X0 Z0) (i X3 Z3) = i^2 X0 X3 Z0 Z3 = - X0 X3 Z0 Z3

Now X0 X3 Z0 Z3 |ψ_ideal⟩ = since X0 X3 |ψ_ideal⟩ = |ψ_ideal⟩, and Z0 Z3 |ψ_ideal⟩ = |ψ_ideal⟩, but careful: X0 X3 and Z0 Z3 commute? X0 X3 and Z0 Z3 act on different qubits? No, both act on qubit 0 and 3, so they commute? X0 and Z0 anti-commute, but X0 X3 and Z0 Z3: [X0 X3, Z0 Z3] = X0 X3 Z0 Z3 - Z0 Z3 X0 X3 = X0 Z0 X3 Z3 - Z0 X0 Z3 X3 = (-Z0 X0) (-Z3 X3) - Z0 X0 Z3 X3? Let’s compute the commutator.

Since X0 and Z0 anti-commute, {X0,Z0}=0, so X0 Z0 = - Z0 X0

Similarly for X3 and Z3.

So X0 X3 Z0 Z3 = X0 Z0 X3 Z3 = (-Z0 X0) (-Z3 X3) = Z0 X0 Z3 X3

And Z0 Z3 X0 X3 = Z0 X0 Z3 X3

So they are equal, so [X0 X3, Z0 Z3] =0, so they commute.

Therefore X0 X3 Z0 Z3 |ψ_ideal⟩ = X0 X3 (Z0 Z3 |ψ_ideal⟩) = X0 X3 |ψ_ideal⟩ = |ψ_ideal⟩

So Y0 Y3 |ψ_ideal⟩ = - X0 X3 Z0 Z3 |ψ_ideal⟩ = - |ψ_ideal⟩

Thus ⟨ψ_ideal| Y0 Y3 |ψ_ideal⟩ = -1

Similarly, for other products like X0 Z3, etc.

But for fidelity, we need |⟨ψ_ideal| F |ψ_ideal⟩|^2, so for F that gives expectation ±1, | |^2 =1, for expectation 0, | |^2=0.

So for Pauli F on {0,3}, ⟨ψ_ideal| F |ψ_ideal⟩ is non-zero only if F is a product of X0 X3 and Z0 Z3, i.e., if F is in the group generated by X0 X3 and Z0 Z3.

The group generated by X0 X3 and Z0 Z3 has elements: I, X0 X3, Z0 Z3, X0 X3 Z0 Z3 = - Y0 Y3? X0 X3 Z0 Z3 = (X0 Z0) (X3 Z3) but since X0 Z0 = i Y0, etc., but anyway, the expectation is ±1.

Specifically, from above:

  • If F = I, ⟨F⟩=1

  • F = X0 X3, ⟨F⟩=1

  • F = Z0 Z3, ⟨F⟩=1

  • F = X0 X3 Z0 Z3, which is same as (X0 Z0) (X3 Z3) but since X0 Z0 = i Y0, so i Y0 i Y3 = i^2 Y0 Y3 = - Y0 Y3, and we have ⟨ - Y0 Y3 ⟩ = -1, so for F = X0 X3 Z0 Z3, ⟨F⟩= -1? From above, Y0 Y3 |ψ_ideal⟩ = - |ψ_ideal⟩, so ⟨Y0 Y3⟩ = -1, so for F = Y0 Y3, ⟨F⟩= -1

But Y0 Y3 = i X0 Z0 i X3 Z3 = i^2 X0 X3 Z0 Z3 = - X0 X3 Z0 Z3, so X0 X3 Z0 Z3 = - Y0 Y3, so ⟨ X0 X3 Z0 Z3 ⟩ = - ⟨ Y0 Y3 ⟩ = - (-1) =1

Similarly, other combinations.

The group generated by X0 X3 and Z0 Z3 has four elements: I, X0 X3, Z0 Z3, and (X0 X3)(Z0 Z3) = X0 X3 Z0 Z3.

And from above, all have expectation 1? From calculation: X0 X3 Z0 Z3 |ψ_ideal⟩ = |ψ_ideal⟩, so yes, ⟨X0 X3 Z0 Z3⟩=1.

And for Y0 Y3, which is not in the group, but Y0 Y3 = - X0 X3 Z0 Z3, so ⟨Y0 Y3⟩= -1.

But for Pauli F, if F is proportional to one of these, but since Pauli operators are defined with phase ±1,±i, but in the error channel, the Paulis are applied with phase 1, I think? The depolarizing channel applies Pauli operators without phase, so for example, it applies X0, not i Y0, etc.

In the error model, it says “produces one of the 15 non-identity two-qubit Paulis”, and Paulis are usually taken as the matrices with eigenvalues ±1, so for two qubits, the Pauli group has elements like X I, X Z, etc., with phase ±1,±i, but typically in error models, we consider the operators with phase 1, so the non-identity Paulis are those like X0, X3, X0 X3, Z0, Z3, Z0 Z3, X0 Z3, Z0 X3, Y0, Y3, Y0 Y3, Y0 X3, etc., all with coefficient 1.

So for F on {0,3}, we need to list all 16 Paulis, but for expectation, we can see which ones have non-zero expectation.

From the state |ψ_ideal⟩, since qubit 0 and 3 are always equal, the reduced density matrix for qubits 0 and 3 is proportional to |00⟩⟨00| + |11⟩⟨11|, so it is classical correlated.

For any Pauli P on {0,3}, ⟨P⟩ is non-zero only if P does not change the parity or something.

Specifically, from earlier calculation:

  • If P has X0 or X3 alone, ⟨P⟩=0

  • If P has Z0 or Z3 alone, ⟨P⟩=0

  • If P has Y0 or Y3 alone, ⟨P⟩=0

  • If P is X0 X3, ⟨P⟩=1

  • If P is Z0 Z3, ⟨P⟩=1

  • If P is X0 Z3, let’s compute: X0 Z3 |ψ_ideal⟩ = X0 Z3 \frac{1}{2} ( |0000⟩ + |1001⟩ + |0110⟩ + |1111⟩ ) = \frac{1}{2} ( X0 Z3 |0000⟩ + X0 Z3 |1001⟩ + X0 Z3 |0110⟩ + X0 Z3 |1111⟩ )

Z3 |0000⟩ = |0000⟩, then X0 |0000⟩ = |1000⟩

Z3 |1001⟩ = (-1) |1001⟩ because qubit 3=1, so - |1001⟩, then X0 |1001⟩ = |0001⟩? X0 on |1> = |0>, so |0001⟩

Similarly, Z3 |0110⟩ = |0110⟩ since qubit 3=0, then X0 |0110⟩ = |1110⟩

Z3 |1111⟩ = (-1) |1111⟩, then X0 |1111⟩ = |0111⟩

So X0 Z3 |ψ_ideal⟩ = \frac{1}{2} ( |1000⟩ + |0001⟩ + |1110⟩ + |0111⟩ )

Now ⟨ψ_ideal| this state =0, so ⟨X0 Z3⟩=0

Similarly for Z0 X3, same thing.

Now for P = Y0 X3 etc., but similarly, will be zero.

Now for P = Y0 Y3, we have ⟨Y0 Y3⟩= -1 as above.

Y0 Y3 = i X0 Z0 i X3 Z3 = - X0 X3 Z0 Z3, but since X0 X3 Z0 Z3 has expectation 1, so Y0 Y3 has expectation -1.

Similarly, for P = X0 X3 Z0 Z3, which is the same as above, expectation 1.

But note that X0 X3 Z0 Z3 is not a basic Pauli; it is a product.

In the Pauli list, for two qubits, the Pauli operators are tensor products of I,X,Y,Z on each qubit, so for example, X0 I3, I0 X3, X0 X3, Z0 I3, I0 Z3, Z0 Z3, X0 Z3, Z0 X3, Y0 I3, I0 Y3, Y0 Y3, X0 Y3, Y0 X3, Z0 Y3, Y0 Z3.

And each can have phase ±1, but in application, we apply the operator with phase 1.

So for expectation, we need to compute for each.

But from symmetry, since the state has qubit 0 and 3 correlated, only Paulis that preserve the correlation will have non-zero expectation.

Specifically, Paulis that commute with X0 X3 and Z0 Z3 will have non-zero expectation.

The Paulis on {0,3} that commute with X0 X3 are those that have the same Pauli type on both qubits or something.

From group theory, the centralizer of {X0 X3, Z0 Z3} in the Pauli group on {0,3} is the group generated by X0 X3 and Z0 Z3, which has four elements: I, X0 X3, Z0 Z3, X0 X3 Z0 Z3.

And for these, expectation is 1 for I, X0 X3, Z0 Z3, and for X0 X3 Z0 Z3, which is equivalent to Y0 Y3 up to phase, but since we apply with phase 1, X0 X3 Z0 Z3 has expectation 1, as calculated.

But Y0 Y3 has expectation -1, so when we apply the error operator, if we apply Y0 Y3, it has phase -1, but the operator itself is applied, so for fidelity, |⟨ψ| Y0 Y3 |ψ⟩|^2 = | -1 |^2 =1.

Similarly, for any Pauli in the group generated by X0 X3 and Z0 Z3, but with phase, but since we apply the Pauli operator with coefficient 1, for example, if we apply the operator Y0 Y3, which is not in the group, but it has expectation -1, so |⟨|^2=1.

From calculation, for any Pauli P on {0,3}, ⟨ψ_ideal| P |ψ_ideal⟩ is either 0 or ±1, and it is ±1 only if P is in the set where P is a product of X0 X3 and Z0 Z3, but since X0 X3 and Z0 Z3 generate a group, and any P that is proportional to I, X0 X3, Z0 Z3, or X0 X3 Z0 Z3 will have expectation ±1.

But let’s list all possible P on {0,3} with coefficient 1.

The Pauli operators are:

  1. I I

  2. X I

  3. I X

  4. X X

  5. Z I

  6. I Z

  7. Z Z

  8. X Z

  9. Z X

  10. Y I

  11. I Y

  12. Y Y

  13. X Y

  14. Y X

  15. Z Y

  16. Y Z

Now, from earlier:

  • I I: expectation 1

  • X I: expectation 0

  • I X: expectation 0

  • X X: expectation 1

  • Z I: expectation 0

  • I Z: expectation 0

  • Z Z: expectation 1

  • X Z: expectation 0 (as computed)

  • Z X: expectation 0

  • Y I: expectation 0

  • I Y: expectation 0

  • Y Y: expectation -1

  • X Y: let’s compute quickly? X Y |ψ_ideal⟩ = X0 Y3 |ψ_ideal⟩, likely 0

  • Similarly others, all have expectation 0 except the ones above.

So for P on {0,3}, ⟨ψ_ideal| P |ψ_ideal⟩ ≠ 0 only for P = I, X X, Z Z, and Y Y.

And for these, |⟨ψ_ideal| P |ψ_ideal⟩|^2 =1 since expectation magnitude 1.

So for error F on {0,3}, if F is one of I, X0 X3, Z0 Z3, Y0 Y3, then |⟨ψ_ideal| F |ψ_ideal⟩|^2 =1, otherwise 0.

But I is identity, so for non-identity, the Paulis that have non-zero expectation are X0 X3, Z0 Z3, and Y0 Y3.

There are three such Paulis.

In the depolarizing channel, there are 15 non-identity Paulis, so for most, fidelity is 0.

Now back to case 1: no error after CNOT21.

Then after CNOT03, with prob 1-p, no error, fidelity 1

With prob p, error F, and for each F, with prob p/15, fidelity |⟨ψ_ideal| F |ψ_ideal⟩|^2

So the average fidelity for case 1 is: (1-p) * 1 + p * [ fraction of F that give fidelity 1 ]

There are 15 possible F, and for 3 of them, fidelity 1, for other 12, fidelity 0.

So average from error after CNOT03: (1-p) 1 + p * (3/15) 1 + p * (12/15) *0 = (1-p) + p * 3/15 = 1-p + p/5 = 1 - (4/5)p

But this is for after CNOT03 error, but this is when there was no error after CNOT21.

So for case 1, which has probability (1-p) for no error after CNOT21, the fidelity is 1 - (4/5)p

Now, case 2: error E after CNOT21.

This happens with probability p for error after CNOT21, and for each E, prob p/15.

After error E, state is E |ψ2⟩

Then apply H0: state becomes H0 E |ψ2⟩

Then apply CNOT03 ideally: state becomes CNOT03 H0 E |ψ2⟩

Then after CNOT03, with prob 1-p, no error, so final state CNOT03 H0 E |ψ2⟩

With prob p, error F, so final state F CNOT03 H0 E |ψ2⟩

Now, we need |⟨ψ_ideal| final state ⟩|^2

But |ψ_ideal⟩ = CNOT03 H0 |ψ2⟩

So for final state without F error, i.e., CNOT03 H0 E |ψ2⟩

Then ⟨ψ_ideal| CNOT03 H0 E |ψ2⟩ = ⟨ψ2| H0^\dagger CNOT03^\dagger CNOT03 H0 E |ψ2⟩ = ⟨ψ2| H0^\dagger H0 E |ψ2⟩ = ⟨ψ2| E |ψ2⟩

Since H0 and CNOT03 are unitary.

Similarly, if with F error, final state F CNOT03 H0 E |ψ2⟩

Then ⟨ψ_ideal| F CNOT03 H0 E |ψ2⟩ = ⟨ψ2| H0^\dagger CNOT03^\dagger F CNOT03 H0 E |ψ2⟩

Now, CNOT03^\dagger F CNOT03 is some operator on qubits 0 and 3, since F acts on 0 and 3, and CNOT03 acts on 0 and 3, so CNOT03^\dagger F CNOT03 is also a Pauli on 0 and 3, because CNOT conjugates Pauli to Pauli.

Similarly, H0 acts on qubit 0, so H0^\dagger (CNOT03^\dagger F CNOT03) H0 may change it, but let’s see.

First, for simplicity, let’s define |φ⟩ = |ψ2⟩ = \frac{1}{\sqrt{2}} ( |0000\rangle + |0110\rangle )

And we need ⟨φ| E |φ⟩ for the case without F error.

And for with F error, we need ⟨φ| H0^\dagger CNOT03^\dagger F CNOT03 H0 E |φ⟩

But since E is a Pauli on {2,1}, and |φ⟩ is a state on all qubits, we need to compute these overlaps.

Notice that |φ⟩ = \frac{1}{\sqrt{2}} ( |0000\rangle + |0110\rangle ) = \frac{1}{\sqrt{2}} |0\rangle_0 |0\rangle_1 |0\rangle_2 |0\rangle_3 + \frac{1}{\sqrt{2}} |0\rangle_0 |1\rangle_1 |1\rangle_2 |0\rangle_3

So |φ⟩ is a state where qubit 0 is always |0⟩, qubit 3 is always |0⟩, and qubits 1 and 2 are either both |0⟩ or both |1⟩.

So |φ⟩ is stabilized by some operators? For example, Z0, Z3, and X1 X2, etc.

Now, E is a Pauli on qubits 2 and 1.

So for ⟨φ| E |φ⟩, since E acts on qubits 1 and 2, and |φ⟩ involves only states where qubits 1 and 2 are correlated.

Let’s compute ⟨φ| E |φ⟩ for general E on {1,2}.

|φ⟩ = \frac{1}{\sqrt{2}} ( |a\rangle + |b\rangle ) where |a⟩ = |0000⟩, |b⟩ = |0110⟩

So ⟨φ| E |φ⟩ = \frac{1}{2} ( \langle a| E |a\rangle + \langle a| E |b\rangle + \langle b| E |a\rangle + \langle b| E |b\rangle )

Now, |a⟩ and |b⟩ are orthogonal, and E is Pauli, so unless E changes the state, but let’s see.

For example, if E = I, then ⟨φ| I |φ⟩ =1

If E = X1, then X1 |a⟩ = X1 |0000⟩ = |0100⟩, not |a⟩ or |b⟩, so ⟨a| X1 |a⟩=0, similarly ⟨a| X1 |b⟩ = ⟨0000| X1 |0110⟩ = ⟨0000| |0110⟩? X1 |0110⟩ = |0010⟩? X1 on qubit 1: |1> to |0>, so |0010⟩, so ⟨0000|0010⟩=0, similarly all terms zero, so ⟨φ| X1 |φ⟩=0

Similarly, if E = X2, X2 |a⟩ = |0010⟩, not in {|a⟩,|b⟩}, so overlap 0

If E = X1 X2, then X1 X2 |a⟩ = X1 X2 |0000⟩ = |0110⟩ = |b⟩

X1 X2 |b⟩ = X1 X2 |0110⟩ = |0000⟩ = |a⟩

So ⟨a| X1 X2 |a⟩ = ⟨a|b⟩=0

⟨a| X1 X2 |b⟩ = ⟨a|a⟩=1

⟨b| X1 X2 |a⟩ = ⟨b|b⟩=1

⟨b| X1 X2 |b⟩ = ⟨b|a⟩=0

So ⟨φ| X1 X2 |φ⟩ = \frac{1}{2} (0 +1 +1 +0) =1

Similarly, if E = Z1, then Z1 |a⟩ = |0000⟩, Z1 |b⟩ = - |0110⟩ = - |b⟩

So ⟨a| Z1 |a⟩=1, ⟨a| Z1 |b⟩= ⟨a| -|b⟩=0, ⟨b| Z1 |a⟩=0, ⟨b| Z1 |b⟩= -1

So ⟨φ| Z1 |φ⟩ = \frac{1}{2} (1 +0 +0 -1) =0

Similarly for Z2, Z2 |a⟩ = |0000⟩, Z2 |b⟩ = - |0110⟩ = - |b⟩? Z2 on |b⟩ = |0110⟩, since qubit2=1, Z2 |1> = -|1>, so - |0110⟩, so similarly ⟨φ| Z2 |φ⟩=0

If E = Z1 Z2, then Z1 Z2 |a⟩ = |0000⟩, Z1 Z2 |b⟩ = (-1)(-1) |0110⟩ = |0110⟩? Z1 Z2 |0110⟩ = Z1 |0>1>1>0> but qubit1=1, qubit2=1, so Z1 gives -1, Z2 gives -1, so product phase (-1)(-1)=1, so |0110⟩

So Z1 Z2 |a⟩ = |a⟩, Z1 Z2 |b⟩ = |b⟩, so ⟨φ| Z1 Z2 |φ⟩ =1

Now for Y operators, e.g., E = Y1 = i X1 Z1

But from above, since ⟨X1⟩=0, ⟨Z1⟩=0, but let’s compute directly.

Y1 |a⟩ = i X1 Z1 |0000⟩ = i X1 |0000⟩ = i |0100⟩

Y1 |b⟩ = i X1 Z1 |0110⟩ = i X1 ( - |0110⟩ ) since Z1 |1> = -|1>, so - i X1 |0110⟩ = - i |0010⟩? X1 |0110⟩ = |0010⟩, so -i |0010⟩

Now ⟨a| Y1 |a⟩ = ⟨0000| i |0100⟩ =0

⟨a| Y1 |b⟩ = ⟨0000| -i |0010⟩ =0

Similarly all zero, so ⟨φ| Y1 |φ⟩=0

Similarly for Y2, etc.

Now for products like X1 Z2, etc.

But from the pattern, ⟨φ| E |φ⟩ is non-zero only if E preserves the correlation between qubit 1 and 2, i.e., if E is in the group generated by X1 X2 and Z1 Z2.

Similarly to before, for E on {1,2}, ⟨φ| E |φ⟩ ≠0 only if E is I, X1 X2, Z1 Z2, or Y1 Y2? Let’s check Y1 Y2.

Y1 Y2 |a⟩ = Y1 Y2 |0000⟩ = i X1 Z1 i X2 Z2 |0000⟩ = i^2 X1 X2 Z1 Z2 |0000⟩ = - X1 X2 |0000⟩ since Z1 Z2 |0000⟩=|0000⟩, so - |0110⟩ = - |b⟩

Y1 Y2 |b⟩ = Y1 Y2 |0110⟩ = i X1 Z1 i X2 Z2 |0110⟩ = - X1 X2 Z1 Z2 |0110⟩ = - X1 X2 |0110⟩ since Z1 Z2 |0110⟩=|0110⟩, so - |0000⟩ = - |a⟩

So ⟨a| Y1 Y2 |a⟩ = ⟨a| -|b⟩=0

⟨a| Y1 Y2 |b⟩ = ⟨a| -|a⟩= -1

⟨b| Y1 Y2 |a⟩ = ⟨b| -|b⟩= -1

⟨b| Y1 Y2 |b⟩ = ⟨b| -|a⟩=0

So ⟨φ| Y1 Y2 |φ⟩ = \frac{1}{2} (0 -1 -1 +0) = -1

So |⟨φ| Y1 Y2 |φ⟩|^2 =1

Similarly, for other Paulis, only when E is proportional to I, X1 X2, Z1 Z2, or X1 X2 Z1 Z2, but X1 X2 Z1 Z2 |φ⟩ = since X1 X2 Z1 Z2 |a⟩ = X1 X2 |a⟩ = |b⟩, and X1 X2 Z1 Z2 |b⟩ = X1 X2 |b⟩ = |a⟩, so ⟨φ| X1 X2 Z1 Z2 |φ⟩ = \frac{1}{2} (⟨a|b⟩ + ⟨a|a⟩ + ⟨b|b⟩ + ⟨b|a⟩) wait no.

⟨φ| X1 X2 Z1 Z2 |φ⟩ = \frac{1}{2} ( \langle a| X1 X2 Z1 Z2 |a\rangle + \langle a| X1 X2 Z1 Z2 |b\rangle + \langle b| X1 X2 Z1 Z2 |a\rangle + \langle b| X1 X2 Z1 Z2 |b\rangle ) = \frac{1}{2} ( \langle a|b\rangle + \langle a|a\rangle + \langle b|b\rangle + \langle b|a\rangle ) = \frac{1}{2} (0+1+1+0) =1

So indeed, for E on {1,2}, ⟨φ| E |φ⟩ is non-zero only for E in the set where E is I, X1 X2, Z1 Z2, or X1 X2 Z1 Z2.

But X1 X2 Z1 Z2 is the same as Y1 Y2 up to phase? Y1 Y2 = i X1 Z1 i X2 Z2 = - X1 X2 Z1 Z2, so X1 X2 Z1 Z2 = - Y1 Y2, so when we apply the operator, if we apply X1 X2 Z1 Z2, it has expectation 1, if we apply Y1 Y2, it has expectation -1.

But in terms of the operator applied, for the error channel, we apply the Pauli operators with coefficient 1, so for example, we apply X1, I2, etc., or X1 X2, etc.

So from above, the Paulis E on {1,2} that have non-zero expectation are those that are products of X1 X2 and Z1 Z2, i.e., the group generated by X1 X2 and Z1 Z2.

The group has four elements: I, X1 X2, Z1 Z2, and X1 X2 Z1 Z2.

But X1 X2 Z1 Z2 is not a basic Pauli; it is a product. In the list of Pauli operators on two qubits, the operators are things like X1 I2, X1 X2, etc., so for example, X1 X2 is one operator, Z1 Z2 is another, and X1 X2 Z1 Z2 is another operator, which is the same as - Y1 Y2 but with coefficient 1, so when we apply the operator X1 X2 Z1 Z2, it is applied as is.

In the depolarizing channel, the Paulis are all possible tensor products, so including X1 X2, Z1 Z2, and also X1 Z2, etc., and also products like X1 X2 Z1 Z2, which is a valid Pauli operator.

Similarly for others.

So for E on {1,2}, there are 16 Paulis, but only 4 of them have |⟨φ| E |φ⟩|^2 =1, and the other 12 have |⟨φ| E |φ⟩|^2 =0.

From above, when E is I, X1 X2, Z1 Z2, or X1 X2 Z1 Z2, then ⟨φ| E |φ⟩ =1,1,1,1 respectively? From calculation:

  • I: ⟨φ| I |φ⟩ =1

  • X1 X2: ⟨φ| X1 X2 |φ⟩ =1

  • Z1 Z2: ⟨φ| Z1 Z2 |φ⟩ =1

  • X1 X2 Z1 Z2: ⟨φ| X1 X2 Z1 Z2 |φ⟩ =1

And for Y1 Y2, which is another Pauli, ⟨φ| Y1 Y2 |φ⟩ = -1, so |⟨|^2=1

But Y1 Y2 is not the same as X1 X2 Z1 Z2; they are different operators.

In the list, Y1 Y2 is a Pauli operator, and it has |⟨φ| Y1 Y2 |φ⟩|^2 =1.

Similarly, are there others?

Let’s list all Paulis on {1,2} that have non-zero expectation.

From the state |φ⟩, since qubits 1 and 2 are always equal in the sense that in |a⟩ they are both 0, in |b⟩ they are both 1, so the reduced density matrix is |00⟩⟨00| + |11⟩⟨11| for qubits 1 and2.

So for Pauli P on {1,2}, ⟨P⟩ is non-zero only if P does not change the basis or something.

Specifically, P must commute with X1 X2 and Z1 Z2.

The Paulis that commute with X1 X2 are those that have the same Pauli on both qubits or something.

From earlier calculation, only Paulis that are products of X1 X2 and Z1 Z2 have non-zero expectation, but that includes I, X1 X2, Z1 Z2, and X1 X2 Z1 Z2.

But X1 X2 Z1 Z2 = (X1 Z1) (X2 Z2) = (i Y1) (i Y2) = - Y1 Y2, so if we apply Y1 Y2, it is proportional to X1 X2 Z1 Z2, but with phase -1, so when we apply Y1 Y2, we get expectation -1.

Similarly, if we apply X1 X2 Z1 Z2, we get expectation 1.

But in terms of the operator applied, for the error channel, when we say “apply Pauli E”, we mean apply the operator with coefficient 1, so for example, apply the matrix Y1 Y2, which has expectation -1.

So for fidelity, |⟨φ| E |φ⟩|^2 =1 for E such that E |φ⟩ = ± |φ⟩, which happens when E is in the stabilizer of |φ⟩ or something.

From above, for E on {1,2}, E |φ⟩ = ± |φ⟩ only if E is I, X1 X2, Z1 Z2, or Y1 Y2? Let’s see.

From earlier, X1 X2 |φ⟩ = |φ⟩? X1 X2 |a⟩ = |b⟩, X1 X2 |b⟩ = |a⟩, so X1 X2 |φ⟩ = \frac{1}{\sqrt{2}} ( |b⟩ + |a⟩ ) = |φ⟩, so yes.

Z1 Z2 |φ⟩ = |φ⟩ as above.

Y1 Y2 |φ⟩ = - |φ⟩ as above.

Now for X1 X2 Z1 Z2, which is the same as - Y1 Y2, so X1 X2 Z1 Z2 |φ⟩ = - Y1 Y2 |φ⟩ = - (- |φ⟩) = |φ⟩, so also.

But X1 X2 Z1 Z2 is not a basic Pauli; it is a product, but it is a Pauli operator.

In the list of Pauli operators on two qubits, the operators are uniquely defined by their action on each qubit, so for example, the operator that is X on qubit 1 and X on qubit 2 is X1 X2, etc.

So for E on {1,2}, the Pauli operators that have E |φ⟩ = ± |φ⟩ are: - I - X1 X2 - Z1 Z2 - X1 X2 Z1 Z2 - Y1 Y2

But X1 X2 Z1 Z2 and Y1 Y2 are different operators? Yes, because X1 X2 Z1 Z2 has matrix that is tensor product of X and X times Z and Z, but since it acts on two qubits, it is a single operator.

But note that X1 X2 Z1 Z2 = (X1 Z1) (X2 Z2) = (i Y1) (i Y2) = - Y1 Y2, so indeed, X1 X2 Z1 Z2 is proportional to Y1 Y2.

So in terms of the set of Pauli operators, there are four operators that have expectation magnitude 1: namely, the identity, and the three operators X1 X2, Z1 Z2, and Y1 Y2.

Because X1 X2 Z1 Z2 is not independent; it is equal to - Y1 Y2, so when we apply the operator, if we apply Y1 Y2, we get expectation -1, if we apply X1 X2 Z1 Z2, we get expectation 1, but X1 X2 Z1 Z2 is the same as applying the operator that is X on both and Z on both, which is a valid Pauli, but in the standard list, when we say “non-identity Paulis”, we list all products, so for example, the operator with X on qubit 1 and Z on qubit 2 is X1 Z2, etc.

So for the error channel, the Pauli operators on two qubits are all possible combinations of I,X,Y,Z on each qubit with coefficient 1, so there are 16 operators, including for example X1 I2, I1 X2, X1 X2, X1 Z2, Z1 X2, Z1 Z2, Y1 I2, I1 Y2, Y1 Y2, X1 Y2, Y1 X2, Z1 Y2, Y1 Z2, etc.

Now for each, we can compute the expectation with |φ⟩.

From earlier calculation and symmetry, the only operators that have non-zero expectation are those where the operator on qubit 1 and qubit 2 are the same type and same sign? But from above, for example, X1 X2 has expectation 1, Z1 Z2 has expectation 1, Y1 Y2 has expectation -1.

What about X1 Z2? X1 Z2 |a⟩ = X1 Z2 |0000⟩ = X1 |0000⟩ = |0100⟩, not proportional to |a⟩ or |b⟩, so expectation 0.

Similarly for others.

So indeed, for E on {1,2}, ⟨φ| E |φ⟩ ≠ 0 only if E is I, X1 X2, Z1 Z2, or Y1 Y2.

And for these, |⟨φ| E |φ⟩|^2 =1.

So there are 4 operators out of 16 that give fidelity 1, but since I is identity, for non-identity, there are 3 operators that give fidelity 1.

In the error channel, when error occurs, we have non-identity Paulis, so for E non-identity, there are 15 possible, and for 3 of them, |⟨φ| E |φ⟩|^2 =1, for other 12, it is 0.

But in case 2, when we have error E after CNOT21, then for the final state without F error, we have final state CNOT03 H0 E |ψ2⟩, and ⟨ψ_ideal| this state = ⟨φ| E |φ⟩ as above, so |⟨|^2 = |⟨φ| E |φ⟩|^2

So if E is one of the 3 non-identity Paulis that give |⟨φ| E |φ⟩|^2=1, then this term has fidelity 1, otherwise 0.

Then for with F error, we have final state F CNOT03 H0 E |ψ2⟩, and ⟨ψ_ideal| this state = ⟨φ| H0^\dagger CNOT03^\dagger F CNOT03 H0 E |φ⟩

Now, CNOT03^\dagger F CNOT03 is a Pauli on {0,3} because CNOT conjugates Pauli to Pauli.

Similarly, H0^\dagger something H0 may change it.

But note that H0 acts on qubit 0, and CNOT03 acts on qubits 0 and 3, so let’s define O = H0^\dagger CNOT03^\dagger F CNOT03 H0

Since F is on {0,3}, CNOT03^\dagger F CNOT03 is on {0,3}, and then H0^\dagger ( that ) H0 is on qubit 0, so it is still an operator on qubits 0 and 3, but may be different Pauli.

Then we need ⟨φ| O E |φ⟩

But E is on {1,2}, and O is on {0,3}, and |φ⟩ is on all qubits, and since they act on different sets of qubits, O and E commute, so ⟨φ| O E |φ⟩ = ⟨φ| O |φ⟩ ⟨φ| E |φ⟩? No, because |φ⟩ is not necessarily product, but since O acts on 0 and3, E acts on 1 and2, and |φ⟩ might be product between {0,3} and {1,2}, let’s see.

From |φ⟩ = \frac{1}{\sqrt{2}} ( |0000⟩ + |0110⟩ ) = \frac{1}{\sqrt{2}} ( |0\rangle_0 |0\rangle_3 |0\rangle_1 |0\rangle_2 + |0\rangle_0 |0\rangle_3 |1\rangle_1 |1\rangle_2 ) = |0\rangle_0 |0\rangle_3 \otimes \frac{1}{\sqrt{2}} ( |00\rangle_{12} + |11\rangle_{12} )

So indeed, |φ⟩ is product between qubits {0,3} and {1,2}, specifically, qubits 0 and 3 are in state |00\rangle_{03}, and qubits 1 and 2 are in state \frac{1}{\sqrt{2}} ( |00\rangle + |11\rangle ) which is Bell state.

So for operator O on {0,3}, and E on {1,2}, we have ⟨φ| O E |φ⟩ = ⟨00|{03} O |00\rangle{03} \cdot \langle Bell| E | Bell\rangle_{12}

Because |φ⟩ = |00\rangle_{03} \otimes |\Phi^+\rangle_{12} where |\Phi^+\rangle = \frac{1}{\sqrt{2}} ( |00\rangle + |11\rangle )

So ⟨φ| O E |φ⟩ = [ ⟨00|{03} O |00\rangle{03} ] [ ⟨\Phi^+| E |\Phi^+\rangle_{12} ]

Now, ⟨00|{03} O |00\rangle{03} is the expectation of O in state |00⟩_{03}

Similarly, ⟨\Phi^+| E |\Phi^+\rangle_{12} is the expectation of E in Bell state.

Now, for the Bell state |\Phi^+\rangle = \frac{1}{\sqrt{2}} ( |00\rangle + |11\rangle ), what is ⟨\Phi^+| E |\Phi^+\rangle for E on {1,2}?

Similarly to before, for E on {1,2}, ⟨\Phi^+| E |\Phi^+\rangle is non-zero only if E is I, X1 X2, Z1 Z2, or Y1 Y2, and for these, it is 1,1,1,-1 respectively? Let’s compute.

For E=I, ⟨E⟩=1

For E=X1 X2, X1 X2 |\Phi^+\rangle = X1 X2 \frac{1}{\sqrt{2}} ( |00\rangle + |11\rangle ) = \frac{1}{\sqrt{2}} ( |11\rangle + |00\rangle ) = |\Phi^+\rangle, so ⟨E⟩=1

For E=Z1 Z2, Z1 Z2 |\Phi^+\rangle = \frac{1}{\sqrt{2}} ( Z1 Z2 |00\rangle + Z1 Z2 |11\rangle ) = \frac{1}{\sqrt{2}} ( |00\rangle + (-1)(-1)|11\rangle ) = |\Phi^+\rangle, so ⟨E⟩=1

For E=Y1 Y2, Y1 Y2 |\Phi^+\rangle = i X1 Z1 i X2 Z2 |\Phi^+\rangle = - X1 X2 Z1 Z2 |\Phi^+\rangle = - X1 X2 |\Phi^+\rangle since Z1 Z2 |\Phi^+\rangle=|\Phi^+\rangle, so - |\Phi^+\rangle, so ⟨E⟩= -1

For other E, ⟨E⟩=0.

So indeed, ⟨\Phi^+| E |\Phi^+\rangle =1 for E=I, X1 X2, Z1 Z2, and -1 for Y1 Y2, and 0 otherwise.

So |⟨\Phi^+| E |\Phi^+\rangle|^2 =1 for these4 operators, and 0 for others.

But since E is for error on {1,2}, and in case 2, E is applied after CNOT21, so for the overlap, we have ⟨φ| E |φ⟩ = ⟨00|{03} |00\rangle{03} ⟨\Phi^+| E |\Phi^+\rangle = 1 * ⟨\Phi^+| E |\Phi^+\rangle

So from above, if E is I, X1 X2, Z1 Z2, or Y1 Y2, then ⟨φ| E |φ⟩ =1,1,1,-1 respectively, so |⟨φ| E |φ⟩|^2=1 for these4 cases.

Otherwise, |⟨φ| E |φ⟩|^2=0.

But for non-identity E, there are 3 operators that give |⟨φ| E |φ⟩|^2=1: X1 X2, Z1 Z2, Y1 Y2.

Now back to case 2.

For case 2, with error E after CNOT21, which happens with probability p for error, and for each E, prob p/15.

Then after that, we apply H0 and CNOT03 ideally, so state becomes CNOT03 H0 E |ψ2⟩

Then with probability 1-p, no error after CNOT03, so final state is CNOT03 H0 E |ψ2⟩

Then fidelity |⟨ψ_ideal| this state⟩|^2 = |⟨φ| E |φ⟩|^2

So if E is one of the 3 good non-identity Paulis, fidelity 1, else fidelity 0.

With probability p, error F after CNOT03, so final state F CNOT03 H0 E |ψ2⟩

Then fidelity |⟨ψ_ideal| this state⟩|^2 = |⟨φ| H0^\dagger CNOT03^\dagger F CNOT03 H0 E |φ⟩|^2

But as above, this is | [ ⟨00|{03} O |00\rangle{03} ] [ ⟨\Phi^+| E |\Phi^+\rangle ] |^2 where O = H0^\dagger CNOT03^\dagger F CNOT03 H0

Now O is an operator on {0,3}, and we need ⟨00|{03} O |00\rangle{03}

Now |00\rangle_{03} is a state, and O is a Pauli operator on {0,3} after conjugation.

First, CNOT03^\dagger F CNOT03 for F on {0,3}.

CNOT03 with control 0 target 3.

The conjugation of Pauli by CNOT03.

For example, if F = X0, then CNOT03^\dagger X0 CNOT03 = X0 X3? Let’s recall.

Generally, CNOT conjugation: - CNOT^\dagger X_c CNOT = X_c X_t - CNOT^\dagger X_t CNOT = X_t - CNOT^\dagger Z_c CNOT = Z_c - CNOT^\dagger Z_t CNOT = Z_c Z_t

Where c is control, t is target.

So for CNOT03, c=0, t=3.

So CNOT03^\dagger F CNOT03 for F on {0,3}.

For example, if F = X0, then CNOT03^\dagger X0 CNOT03 = X0 X3

If F = X3, then CNOT03^\dagger X3 CNOT03 = X3

If F = Z0, then CNOT03^\dagger Z0 CNOT03 = Z0

If F = Z3, then CNOT03^\dagger Z3 CNOT03 = Z0 Z3

And for other Paulis, similarly.

Then after that, we apply H0^\dagger … H0

H0 conjugation on qubit 0: H0^\dagger X0 H0 = Z0 H0^\dagger Z0 H0 = X0

So for O = H0^\dagger CNOT03^\dagger F CNOT03 H0

So let’s compute for each type of F.

But since we need ⟨00|{03} O |00\rangle{03}, and O is a Pauli operator on {0,3}, so ⟨00| O |00⟩ is non-zero only if O is I or something, but |00⟩ is eigenstate of Z0 and Z3, so ⟨00| O |00⟩ ≠0 only if O has no X or Y on either qubit, i.e., if O is product of Z operators or I.

Specifically, for |00⟩, ⟨00| O |00⟩ =1 if O=I, or if O=Z0, or O=Z3, or O=Z0 Z3, but since |00⟩ is |0⟩ for both, Z0 |00⟩ = |00⟩, Z3 |00⟩ = |00⟩, so ⟨00| Z0 |00⟩=1, similarly for Z3, Z0 Z3.

But if O has X or Y, then O |00⟩ has |1⟩, so ⟨00| O |00⟩=0.

So ⟨00| O |00⟩ =1 only if O is I, Z0, Z3, or Z0 Z3.

Otherwise, 0.

Now for our case, we need O = H0^\dagger CNOT03^\dagger F CNOT03 H0

So we need to see for which F, this O is one of I, Z0, Z3, or Z0 Z3.

Since H0 acts only on qubit 0, and CNOT03 on 0 and3, we can compute for each F what is O.

But note that we have average over F, and also over E.

For case 2, when we have error F after CNOT03, the fidelity is | [ ⟨00| O |00⟩ ] [ ⟨Φ+| E |Φ+⟩ ] |^2

Since both are scalars, so | ab |^2 = |a|^2 |b|^2

And from above, ⟨00| O |00⟩ is either 0 or 1, and similarly ⟨Φ+| E |Φ+⟩ is either 0 or ±1, so |b|^2 is 0 or 1.

So for fidelity to be 1, we need both ⟨00| O |00⟩ =1 and ⟨Φ+| E |Φ+⟩ = ±1, so |b|^2=1.

Otherwise, fidelity 0.

So for case 2 with F error, the fidelity is 1 only if E is one of the good Paulis (X1 X2, Z1 Z2, Y1 Y2) and O is one of I, Z0, Z3, Z0 Z3.

Otherwise, fidelity 0.

Now, for given F, what is O, and for which F is O one of those.

But since we average over F, and F is random, we need to find the probability that for random F, O is in that set.

But O depends on F.

Now let’s compute O for each F.

First, let’s find CNOT03^\dagger F CNOT03 for F on {0,3}.

As above, for F = X0, CNOT03^\dagger X0 CNOT03 = X0 X3

For F = X3, CNOT03^\dagger X3 CNOT03 = X3

For F = Z0, CNOT03^\dagger Z0 CNOT03 = Z0

For F = Z3, CNOT03^\dagger Z3 CNOT03 = Z0 Z3

For F = X0 X3, CNOT03^\dagger X0 X3 CNOT03 = (X0 X3) (X3) = X0 X3 X3 = X0 I3? Let’s compute carefully.

CNOT03^\dagger X0 X3 CNOT03 = CNOT03^\dagger X0 CNOT03 CNOT03^\dagger X3 CNOT03 because CNOT03 is unitary, so it distributes.

CNOT03^\dagger X0 CNOT03 = X0 X3

CNOT03^\dagger X3 CNOT03 = X3

So product is X0 X3 * X3 = X0 X3 X3 = X0 I3 = X0

Similarly, for F = X0 Z3, etc., but we may not need all.

Now for O = H0^\dagger CNOT03^\dagger F CNOT03 H0

So for example, if F = X0, then CNOT03^\dagger F CNOT03 = X0 X3

Then H0^\dagger (X0 X3) H0 = H0^\dagger X0 H0 H0^\dagger X3 H0 = Z0 X3 because H0^\dagger X0 H0 = Z0, and H0^\dagger X3 H0 = X3 since H0 acts only on qubit 0.

So O = Z0 X3

Similarly, if F = X3, then CNOT03^\dagger X3 CNOT03 = X3

Then O = H0^\dagger X3 H0 = X3

If F = Z0, then CNOT03^\dagger Z0 CNOT03 = Z0

Then O = H0^\dagger Z0 H0 = X0

If F = Z3, then CNOT03^\dagger Z3 CNOT03 = Z0 Z3

Then O = H0^\dagger (Z0 Z3) H0 = H0^\dagger Z0 H0 H0^\dagger Z3 H0 = X0 Z3

Now for F = X0 X3, then CNOT03^\dagger X0 X3 CNOT03 = X0 as above

Then O = H0^\dagger X0 H0 = Z0

If F = Z0 Z3, then CNOT03^\dagger Z0 Z3 CNOT03 = CNOT03^\dagger Z0 CNOT03 CNOT03^\dagger Z3 CNOT03 = Z0 * (Z0 Z3) = Z0 Z0 Z3 = I0 Z3 = Z3

Then O = H0^\dagger Z3 H0 = Z3

If F = X0 Z3, then CNOT03^\dagger X0 Z3 CNOT03 = [CNOT03^\dagger X0 CNOT03] [CNOT03^\dagger Z3 CNOT03] = (X0 X3) (Z0 Z3) = X0 Z0 X3 Z3

Then O = H0^\dagger (X0 Z0 X3 Z3) H0 = H0^\dagger X0 Z0 H0 X3 Z3 = H0^\dagger X0 H0 H0^\dagger Z0 H0 X3 Z3 = Z0 X0 X3 Z3 = - X0 Z0 X3 Z3? Let’s compute:

H0^\dagger X0 Z0 H0 = since H0 X0 H0^\dagger = Z0, but careful: H0^\dagger X0 H0 = Z0, and H0^\dagger Z0 H0 = X0, so H0^\dagger X0 Z0 H0 = H0^\dagger X0 H0 H0^\dagger Z0 H0 = Z0 X0

So then O = (Z0 X0) X3 Z3 = Z0 X0 X3 Z3

Now X0 X3 Z3 is not simple, but for ⟨00| O |00⟩, O has X0 and X3, so it will have off-diagonal, so ⟨00| O |00⟩=0.

Similarly for other F, we need to see when O has only Z operators.

From the examples, when O has any X or Y, then ⟨00| O |00⟩=0.

So we need O to be I, Z0, Z3, or Z0 Z3.

From above, when F = X0, O= Z0 X3, which has X3, so not good.

F=X3, O=X3, has X3, not good.

F=Z0, O=X0, has X0, not good.

F=Z3, O=X0 Z3, has X0, not good.

F=X0 X3, O=Z0, which is good, since Z0 is one of the desired.

F=Z0 Z3, O=Z3, which is good.

Now what about F= Y0 Y3? But let’s list all F that give O with only Z.

Perhaps from the conjugation, since H0 and CNOT03 are Clifford, the map F to O is a permutation of Paulis, so for each O, there is some F.

But we need for which F, O is in {I, Z0, Z3, Z0 Z3}

From above, when F=X0 X3, O=Z0

When F=Z0 Z3, O=Z3

Now what about when O=I? For example, if F=I, then CNOT03^\dagger I CNOT03=I, then O= H0^\dagger I H0=I, so O=I, good.

But F=I is identity, but in error channel, F is non-identity for error, but when no error, we already handled, so for error F, F is non-identity, so we need non-identity F such that O is in {I, Z0, Z3, Z0 Z3}

But O=I corresponds to F such that H0^\dagger CNOT03^\dagger F CNOT03 H0 = I, so CNOT03^\dagger F CNOT03 = H0 I H0^\dagger = I, so F=I, but F=I is identity, not non-identity.

So for non-identity F, O cannot be I.

Similarly, O=Z0, from above, when F=X0 X3, O=Z0

O=Z3, when F=Z0 Z3, O=Z3

O=Z0 Z3, when is O=Z0 Z3?

For example, if F= X3 Z0? Let’s find.

Suppose we want O=Z0 Z3

Then H0^\dagger CNOT03^\dagger F CNOT03 H0 = Z0 Z3

So CNOT03^\dagger F CNOT03 = H0 Z0 Z3 H0^\dagger = H0 Z0 H0^\dagger H0 Z3 H0^\dagger = X0 Z3

So CNOT03^\dagger F CNOT03 = X0 Z3

Thus F = CNOT03 X0 Z3 CNOT03^\dagger

Now CNOT03 X0 Z3 CNOT03^\dagger = CNOT03 X0 CNOT03^\dagger CNOT03 Z3 CNOT03^\dagger

CNOT03 X0 CNOT03^\dagger = since CNOT03^\dagger X0 CNOT03 = X0 X3, so CNOT03 X0 CNOT03^\dagger = X0 X3? Let’s see.

From earlier, CNOT03^\dagger X0 CNOT03 = X0 X3, so by multiplying on left by CNOT03 and on right by CNOT03^\dagger, CNOT03 CNOT03^\dagger X0 CNOT03 CNOT03^\dagger = CNOT03 (X0 X3) CNOT03^\dagger, so X0 = CNOT03 X0 X3 CNOT03^\dagger

Similarly, CNOT03^\dagger Z3 CNOT03 = Z0 Z3, so Z3 = CNOT03 Z0 Z3 CNOT03^\dagger

So for CNOT03 X0 Z3 CNOT03^\dagger = [CNOT03 X0 CNOT03^\dagger] [CNOT03 Z3 CNOT03^\dagger] = [ X0 X3 ] [ Z0 Z3 ] from above? From X0 = CNOT03 X0 X3 CNOT03^\dagger, so CNOT03 X0 CNOT03^\dagger = X0 X3? Let’s solve.

From CNOT03^\dagger X0 CNOT03 = X0 X3

So by taking dagger, (CNOT03^\dagger X0 CNOT03)^\dagger = (X0 X3)^\dagger, so CNOT03^\dagger X0 CNOT03 = X0 X3 since Pauli self-adjoint.

So from this, we have CNOT03^\dagger X0 CNOT03 = X0 X3

Then multiply on left by CNOT03, CNOT03 CNOT03^\dagger X0 CNOT03 = CNOT03 X0 X3

So X0 CNOT03 = CNOT03 X0 X3

Thus CNOT03 X0 = X0 X3 CNOT03

So CNOT03 X0 CNOT03^\dagger = X0 X3 CNOT03 CNOT03^\dagger = X0 X3

Similarly, from CNOT03^\dagger Z3 CNOT03 = Z0 Z3

Then CNOT03 Z3 CNOT03^\dagger = Z0 Z3 CNOT03 CNOT03^\dagger = Z0 Z3

So back to CNOT03 X0 Z3 CNOT03^\dagger = [CNOT03 X0 CNOT03^\dagger] [CNOT03 Z3 CNOT03^\dagger] = (X0 X3) (Z0 Z3) = X0 Z0 X3 Z3

So F = X0 Z0 X3 Z3

But X0 Z0 X3 Z3 is a Pauli operator, and it is non-identity.

Then O = H0^\dagger CNOT03^\dagger F CNOT03 H0 = from above, we wanted O=Z0 Z3, and we have it.

So for F = X0 Z0 X3 Z3, O=Z0 Z3

Similarly, for other desired O.

But for our purpose, we need when O is in {I, Z0, Z3, Z0 Z3} for non-identity F.

From above, for F=X0 X3, O=Z0

For F=Z0 Z3, O=Z3

For F=X0 Z0 X3 Z3, O=Z0 Z3

Are there other F? For example, if F= something that gives O=Z0, but from above, when F=X0 X3, O=Z0

Similarly, if F=Y0 Y3, let’s compute.

F=Y0 Y3 = i X0 Z0 i X3 Z3 = - X0 X3 Z0 Z3

Then CNOT03^\dagger F CNOT03 = CNOT03^\dagger (- X0 X3 Z0 Z3) CNOT03 = - [CNOT03^\dagger X0 X3 CNOT03] [CNOT03^\dagger Z0 Z3 CNOT03] because Z0 Z3 commutes with CNOT03? Not necessarily, but since CNOT03^\dagger (AB) CNOT03 = (CNOT03^\dagger A CNOT03) (CNOT03^\dagger B CNOT03) if A and B commute with CNOT03? But better to compute separately.

CNOT03^\dagger X0 X3 CNOT03 = from earlier, for X0 X3, we had CNOT03^\dagger X0 X3 CNOT03 = X0 as above

CNOT03^\dagger Z0 Z3 CNOT03 = CNOT03^\dagger Z0 CNOT03 CNOT03^\dagger Z3 CNOT03 = Z0 * (Z0 Z3) = Z0 Z0 Z3 = Z3

So CNOT03^\dagger F CNOT03 = - X0 Z3

Then O = H0^\dagger (- X0 Z3) H0 = - H0^\dagger X0 H0 H0^\dagger Z3 H0 = - Z0 X3

So O = - Z0 X3, which has X3, so not good.

So for non-identity F, the only F that give O in {Z0, Z3, Z0 Z3} are F=X0 X3, F=Z0 Z3, and F=X0 Z0 X3 Z3.

But F=X0 Z0 X3 Z3 is the same as - Y0 Y3 up to phase, but as operator, it is applied.

So there are 3 non-identity F that make O good.

Now, back to case 2 with F error.

The fidelity is 1 only if E is good (one of X1 X2, Z1 Z2, Y1 Y2) and F is good (one of X0 X3, Z0 Z3, X0 Z0 X3 Z3)

Otherwise, fidelity 0.

Now, for case 2, we have probability for error E after CNOT21, and error F after CNOT03.

But in case 2, when we have error E after CNOT21, then with probability 1-p, no error after CNOT03, so fidelity depends only on E, and is 1 if E good, else 0.

With probability p, error F after CNOT03, so fidelity is 1 only if both E and F good, else 0.

Now, the probability that E is good: there are 15 non-identity Paulis on {1,2}, and 3 of them are good, so prob E good is 3/15 = 1/5

Similarly for F, prob F good is 3/15 = 1/5

Now, for case 2, which happens with probability p for error after CNOT21, and for each E, but since we average, the contribution from case 2 to fidelity is:

When no error after CNOT03: prob (1-p) times fidelity which is 1 if E good, else 0, so average over E: (1-p) * (1/5) 1 + (1-p) * (4/5) 0 = (1-p)/5

When error after CNOT03: prob p times, and fidelity is 1 only if both E and F good, so average over E and F: p * (1/5) * (1/5) *1 = p/25

So for case 2, the average fidelity is (1-p)/5 + p/25

Now, recall case 1: no error after CNOT21, which has probability (1-p), and average fidelity 1 - (4/5)p as earlier.

Now, the overall fidelity is the average over both error locations.

So total fidelity F = probability case 1 * fidelity case 1 + probability case 2 * fidelity case 2

Probability case 1: no error after CNOT21, prob = 1-p

Fidelity case 1: 1 - (4/5)p

Probability case 2: error after CNOT21, prob = p

Fidelity case 2: (1-p)/5 + p/25

So F = (1-p) [1 - (4/5)p] + p [ (1-p)/5 + p/25 ]

Now simplify this expression.

First, (1-p) [1 - (4/5)p] = (1-p) (1 - 0.8p) = 1 - 0.8p - p + 0.8p^2 = 1 - 1.8p + 0.8p^2

Better to use fractions: (1-p) (1 - 4p/5) = 1 - 4p/5 - p + 4p^2/5 = 1 - (4/5)p - (5/5)p + (4/5)p^2 = 1 - (9/5)p + (4/5)p^2

Now second part: p [ (1-p)/5 + p/25 ] = p [ (1-p)/5 + p/25 ] = p [ (5(1-p) + p)/25 ] = p [ (5 -5p + p)/25 ] = p (5 -4p)/25 = (5p -4p^2)/25

So total F = [1 - (9/5)p + (4/5)p^2] + [ (5p -4p^2)/25 ]

Now get common denominator, which is 25.

First term: 1 - (9/5)p + (4/5)p^2 = 25/25 - (45/25)p + (20/25)p^2

Second term: (5p -4p^2)/25

So F = [25 -45p +20p^2 +5p -4p^2]/25 = [25 -40p +16p^2]/25

So F = 1 - (40/25)p + (16/25)p^2 = 1 - (8/5)p + (16/25)p^2

Now, this is the physical state fidelity.

But is this correct? Let me verify.

When p=0, no errors, F=1, good.

When p=1, always errors, but let’s see.

But for small p, we have F ≈ 1 - (8/5)p

Now, the problem asks for physical state fidelity as a function of p.

So perhaps this is the answer.

But let me confirm if I missed something.

In the circuit, there are two CNOT gates, each with error probability p, so yes.

And I think I covered all cases.

So the fidelity is F = 1 - \frac{8}{5} p + \frac{16}{25} p^2

But since p is small, we often keep up to linear terms, but here we have exact.

Now, for the final answer, I think we need to box it.

But let me write it neatly.

So the physical state fidelity is

\[ F = 1 - \frac{8}{5} p + \frac{16}{25} p^2 \]

We can write as

\[ F = \frac{25 - 40p + 16p^2}{25} \]

But either way.

Now, for the output, I need to present it.

So finally.

Step-by-Step Derivation

The goal is to find the physical state fidelity of the final 4-qubit state after applying the circuit \( \text{CNOT}_{03} H_0 \text{CNOT}_{21} H_2 \) (operations applied from right to left) with initial state \( |0000\rangle \), where each CNOT gate is followed by a two-qubit depolarizing error channel with error probability \( p \). The error channel applies one of the 15 non-identity two-qubit Pauli operators with probability \( p/15 \) each. The Hadamard gates are perfect.

Ideal State Preparation

  1. Apply \( H_2 \) to \( |0000\rangle \):
\[ H_2 |0000\rangle = \frac{1}{\sqrt{2}} (|0000\rangle + |0010\rangle) \]
  1. Apply \( \text{CNOT}_{21} \) (control qubit 2, target qubit 1):
\[ \text{CNOT}_{21} \left( \frac{1}{\sqrt{2}} (|0000\rangle + |0010\rangle) \right) = \frac{1}{\sqrt{2}} (|0000\rangle + |0110\rangle) \]
  1. Apply \( H_0 \):
\[ H_0 \left( \frac{1}{\sqrt{2}} (|0000\rangle + |0110\rangle) \right) = \frac{1}{2} (|0000\rangle + |1000\rangle + |0110\rangle + |1110\rangle) \]
  1. Apply \( \text{CNOT}_{03} \) (control qubit 0, target qubit 3):
\[ \text{CNOT}_{03} \left( \frac{1}{2} (|0000\rangle + |1000\rangle + |0110\rangle + |1110\rangle) \right) = \frac{1}{2} (|0000\rangle + |1001\rangle + |0110\rangle + |1111\rangle) \]

Thus, the ideal final state is:

\[ |\psi_{\text{ideal}}\rangle = \frac{1}{2} (|0000\rangle + |1001\rangle + |0110\rangle + |1111\rangle) \]

Error Model

Each CNOT gate is followed by a depolarizing error channel: - After \( \text{CNOT}_{21} \), with probability \( 1-p \), no error; with probability \( p \), a Pauli error \( E \) on qubits {1,2} is applied (each of the 15 non-identity Paulis with probability \( p/15 \)). - After \( \text{CNOT}_{03} \), with probability \( 1-p \), no error; with probability \( p \), a Pauli error \( F \) on qubits {0,3} is applied (each with probability \( p/15 \)).

The fidelity between the ideal pure state \( |\psi_{\text{ideal}}\rangle \) and the actual mixed state \( \rho \) is \( F = \langle \psi_{\text{ideal}} | \rho | \psi_{\text{ideal}} \rangle \).

Case Analysis

  • Case 1: No error after \( \text{CNOT}_{21} \)
  • Probability: \( 1-p \)
  • After \( \text{CNOT}_{03} \), the state is \( |\psi_{\text{ideal}}\rangle \).
  • After error channel for \( \text{CNOT}_{03} \):
    • With probability \( 1-p \), no error, fidelity = 1.
    • With probability \( p \), error \( F \) on {0,3}:
    • For \( F \) such that \( \langle \psi_{\text{ideal}} | F | \psi_{\text{ideal}} \rangle \neq 0 \), fidelity = 1; otherwise, 0.
    • From analysis, only 3 of the 15 non-identity Paulis on {0,3} yield fidelity 1: \( X_0 X_3 \), \( Z_0 Z_3 \), \( Y_0 Y_3 \).
  • Average fidelity for Case 1:
\[ F_1 = (1-p) \cdot 1 + p \cdot \frac{3}{15} \cdot 1 = 1 - p + \frac{p}{5} = 1 - \frac{4}{5}p \]
  • Case 2: Error \( E \) after \( \text{CNOT}_{21} \)
  • Probability: \( p \)
  • After applying \( E \), state is \( E |\psi_2\rangle \), where \( |\psi_2\rangle = \frac{1}{\sqrt{2}} (|0000\rangle + |0110\rangle) \).
  • Then apply \( H_0 \) and \( \text{CNOT}_{03} \) ideally, so state becomes \( \text{CNOT}_{03} H_0 E |\psi_2\rangle \).
  • After error channel for \( \text{CNOT}_{03} \):
    • With probability \( 1-p \), no error, fidelity = \( |\langle \psi_{\text{ideal}} | \text{CNOT}_{03} H_0 E |\psi_2\rangle |^2 = |\langle \psi_2 | E | \psi_2\rangle |^2 \).
    • From analysis, only 3 of the 15 non-identity Paulis on {1,2} yield fidelity 1: \( X_1 X_2 \), \( Z_1 Z_2 \), \( Y_1 Y_3 \).
    • With probability \( p \), error \( F \) on {0,3}, fidelity = \( |\langle \psi_2 | H_0^\dagger \text{CNOT}_{03}^\dagger F \text{CNOT}_{03} H_0 E | \psi_2\rangle |^2 \).
    • This fidelity is 1 only if both \( E \) and \( F \) are “good” (i.e., from the sets above).
  • Average fidelity for Case 2:
\[ F_2 = (1-p) \cdot \frac{3}{15} + p \cdot \frac{3}{15} \cdot \frac{3}{15} = \frac{1-p}{5} + \frac{p}{25} \]

Total Fidelity

The overall fidelity is the weighted sum:

\[ F = (1-p) F_1 + p F_2 = (1-p) \left(1 - \frac{4}{5}p\right) + p \left( \frac{1-p}{5} + \frac{p}{25} \right) \]

Simplifying:

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

Using a common denominator of 25:

\[ F = \frac{25}{25} - \frac{45}{25}p + \frac{20}{25}p^2 + \frac{5p - 4p^2}{25} = \frac{25 - 45p + 20p^2 + 5p - 4p^2}{25} = \frac{25 - 40p + 16p^2}{25} \]

Thus,

\[ F = 1 - \frac{8}{5}p + \frac{16}{25}p^2 \]

Final Answer:

\[ F = 1 - \frac{8}{5}p + \frac{16}{25}p^2 \]
User #3

Checkpoint 2

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

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

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

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

Assistant #4
Reasoning (model)

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

Interpretation: We have the circuit from subproblem 1. But now we post-select on all detectable errors. That means we measure the stabilizers (XXXX and ZZZZ) and only keep outcomes that are +1? But careful: “post-selected on all detectable errors” means that we detect errors that are not in the stabilizer? Actually, the [[4,2,2]] code is an error detection code. It can detect any single-qubit error? Actually, it’s distance 2, so it can detect any single-qubit error. But here errors come from two-qubit depolarizing channels after CNOT gates. So errors might be on two qubits. But post-selection: we measure the stabilizers. If the outcome is not trivial (i.e., not +1 for both stabilizers), then we discard the state. So we only keep states that are in the code space. So we want the fidelity of the logical state conditioned on being in the code space.

So we need to compute: F_logical = probability that the state is the correct logical state given that it is in the code space.

Let’s denote: The ideal logical state is |GHZ>_AB = (|00> + |11>)/√2.

The circuit prepares that ideally. With errors, we get a mixed state. But we post-select on the state being in the code space. That means that we measure the stabilizers S1=XXXX and S2=ZZZZ. If we get +1 on both, then we keep the state. Otherwise discard.

So we want: F = <ψ_ideal| ρ_post |ψ_ideal> where ρ_post is the normalized state after post-selection.

So we need to compute the probability that the state is in the code space and the probability that it is the correct state within the code space.

Let’s denote the full state after the circuit (with errors) as ρ. Then the post-selected state is: ρ_post = Π ρ Π / Tr(Π ρ) where Π is the projector onto the code space. The code space of [[4,2,2]] is 4-dimensional? Actually, it encodes 2 qubits, so dimension 4. The stabilizers are XXXX and ZZZZ. The code space is the simultaneous +1 eigenspace of these operators.

We want the fidelity: F = <ψ_ideal| ρ_post |ψ_ideal> = Tr( |ψ_ideal><ψ_ideal| Π ρ Π ) / Tr(Π ρ).

But since |ψ_ideal> is in the code space, we have Π |ψ_ideal> = |ψ_ideal>. So F = <ψ_ideal| ρ |ψ_ideal> / Tr(Π ρ) because |ψ_ideal><ψ_ideal| commutes with Π? Actually careful: Tr( |ψ_ideal><ψ_ideal| Π ρ Π ) = <ψ_ideal| Π ρ Π |ψ_ideal> = <ψ_ideal| ρ |ψ_ideal> because Π|ψ_ideal>=|ψ_ideal>. And Tr(Π ρ) is the probability to be in code space.

So F = (Probability that state is ideal and in code space) / (Probability in code space). But note: if there is an error that is detectable, then it will take the state out of the code space. But some errors might be undetectable? Actually, in a distance-2 code, any error of weight 1 is detectable. But errors from two-qubit depolarizing channels can be weight 2 errors. Some weight 2 errors might be in the normalizer of the stabilizer? Actually, the code has distance 2, so there are weight-1 errors that are not detectable? Actually, distance 2 means that no error of weight 1 is correctable, but they are detectable. Actually, for detection, if an error anti-commutes with at least one stabilizer, then it is detectable. For weight-1 errors on qubits, they will anti-commute with either XXXX or ZZZZ? Check: A single X error on one qubit: It will anti-commute with ZZZZ? Actually, ZZZZ commutes with X? No, X and Z anti-commute. So a single X error will anti-commute with ZZZZ. Similarly, a single Z error will anti-commute with XXXX. So all single-qubit errors are detectable. But what about two-qubit errors? They might be undetectable if they are in the stabilizer or logical operators? But careful: The depolarizing errors occur on specific pairs: after CNOT21, errors on qubits {1,2}; after CNOT03, errors on qubits {0,3}. So these errors are on two qubits. They might be detectable or not. We need to check which errors on these pairs commute with both stabilizers.

Let’s list the stabilizers: S1 = XXXX, S2 = ZZZZ. Consider an error E on qubits {1,2}. E is a Pauli operator on qubits 1 and 2 (and identity on 0 and 3). For E to be undetectable, it must commute with both S1 and S2. S1 = X0 X1 X2 X3. For E on {1,2} only, it commutes with S1 if and only if E commutes with X1 X2? Actually, careful: E acts on qubits 1 and 2. S1 acts on all qubits. Since E does not act on qubits 0 and 3, the commutativity with S1 is determined by the part on qubits 1 and 2: S1 has X1 X2. So E commutes with S1 if and only if E commutes with X1 X2. Similarly, S2 = Z0 Z1 Z2 Z3, so E commutes with S2 if and only if E commutes with Z1 Z2. So for E on {1,2} to be in the normalizer of the stabilizer (i.e., not detected), we need E such that [E, X1X2]=0 and [E, Z1Z2]=0. What are the Paulis on two qubits that commute with both X1X2 and Z1Z2? The group generated by X1X2 and Z1Z2 itself. That group has elements: I, X1X2, Z1Z2, and X1X2 Z1Z2 (which is proportional to Y1Y2). So these 4 operators commute with both. But wait: Check: X1 alone: Does it commute with X1X2? X1 and X1X2: X1 * X1X2 = X2, and X1X2 * X1 = X2, so they commute? Actually, careful: X1 and X1X2: They act on different qubits? Actually, X1 and X1X2: They commute because X1 commutes with X1 and with X2? Actually, X1 and X2 commute. So X1 commutes with X1X2. But does X1 commute with Z1Z2? X1 and Z1Z2: X1 anti-commutes with Z1, so X1 Z1Z2 = - Z1 X1 Z2 = - Z1 Z2 X1? Actually, let’s do properly: [X1, Z1Z2] = X1 Z1Z2 - Z1Z2 X1 = (X1 Z1)Z2 - Z1Z2 X1 = (-Z1 X1)Z2 - Z1Z2 X1 = -Z1 X1 Z2 - Z1Z2 X1 = -Z1 (X1 Z2 + Z2 X1) = -Z1 (0) because X1 and Z2 commute? Actually, careful: X1 and Z2: they act on different qubits, so they commute. So X1 Z2 = Z2 X1. So then X1 Z1Z2 = X1 Z1 Z2 = -Z1 X1 Z2 = -Z1 Z2 X1. And Z1Z2 X1 = Z1 Z2 X1. So indeed, X1 anti-commutes with Z1Z2. So X1 does not commute with S2. So indeed, only the operators that are products of X1X2 and Z1Z2 will commute with both. So on qubits {1,2}, the undetectable errors are: I, X1X2, Z1Z2, and X1X2 Z1Z2 (which is equivalent to Y1Y2 up to phase). But note: I is no error. So among non-identity errors on {1,2}, there are 3 that are undetectable: X1X2, Z1Z2, and X1X2 Z1Z2. But wait: Check: What about Y1 alone? Y1 = i X1 Z1. That will not commute with Z1Z2? Likely not. So yes.

Now similarly, for errors on {0,3} from the second CNOT. For an error F on qubits {0,3}, it will be undetectable if it commutes with S1 and S2. S1 has X0X3, and S2 has Z0Z3. So F must commute with X0X3 and Z0Z3. So the undetectable F are: I, X0X3, Z0Z3, and X0X3 Z0Z3 (which is Y0Y3 up to phase). So among non-identity, there are 3 undetectable errors on {0,3}: X0X3, Z0Z3, and X0X3 Z0Z3.

Now, in our error model, errors occur after each CNOT. So we have two error locations: after CNOT21 and after CNOT03. Let E be error on {1,2} and F be error on {0,3}. The total error operator is F * E (order: first E then F? Actually, circuit: After CNOT21, error E. Then apply H0 and CNOT03. Then error F. So the overall effect on the state is: final state = F * (CNOT03 H0) * E * (CNOT21 H2) |0000> but with errors. But we already computed the ideal state is |ψ_ideal>. And under errors, the state becomes something like: if errors are Paulis, then the state becomes a Pauli error applied to |ψ_ideal>? But careful: The circuit is Clifford, and the initial state is |0>^4. The entire circuit is a Clifford operation. So the effect of errors in the middle can be translated to Pauli errors on the final state. But careful: The errors occur after gates. But since the gates are Clifford, we can propagate the errors through the subsequent gates. That is a common technique: instead of applying errors after gates, we can push them to the end as Pauli errors on the final state. But note: The errors are applied after specific gates. But we can commute them through the subsequent Clifford gates. So let’s do that.

The circuit: H2, then CNOT21, then error E on {1,2}, then H0, then CNOT03, then error F on {0,3}. We want to know the final state. Instead, we can propagate the errors to the end. That is: We have U = CNOT03 * H0 * CNOT21 * H2. Then with errors, the actual operation is: F * (CNOT03) * (H0) * E * (CNOT21) * (H2). But since E and F are Paulis, we can commute them through the Clifford gates. Let’s define: U_ideal = CNOT03 * H0 * CNOT21 * H2. We want to compute: U_actual = F * CNOT03 * H0 * E * CNOT21 * H2. But note: E is after CNOT21. So it is: U_actual = F * CNOT03 * H0 * E * CNOT21 * H2. We can push E through H0 and CNOT03. But careful: E acts on qubits {1,2}. H0 acts on qubit 0 only, so commutes with E. So E commutes with H0. Then we have CNOT03 which acts on qubits {0,3}. Does E commute with CNOT03? E acts on {1,2} and CNOT03 acts on {0,3}, so they commute. So actually, E commutes with H0 and CNOT03. So then U_actual = F * CNOT03 * H0 * CNOT21 * H2 * E = U_ideal * E? But wait: Check order: U_ideal = CNOT03 * H0 * CNOT21 * H2. So indeed, U_actual = F * U_ideal * E. But careful: The order of multiplication: The circuit is applied from right to left. So the actual operation is: F * (CNOT03) * (H0) * (E) * (CNOT21) * (H2). And since E commutes with H0 and CNOT03, we can move E to the right: = F * (CNOT03) * (H0) * (CNOT21) * (H2) * E = F * U_ideal * E. So indeed, the final state (without post-selection) is: |ψ_actual> = F * U_ideal * E |0000> = F * E * U_ideal |0000>? But careful: E and F might not commute? But they act on disjoint sets, so they do commute. So actually, |ψ_actual> = F * E * U_ideal |0000> = F * E |ψ_ideal>. But wait: Is that correct? Check: U_ideal |0000> = |ψ_ideal>. And then we apply E and then F. But note: E is applied after CNOT21, but we pushed it through H0 and CNOT03. But since those gates are Clifford and E commutes with them, it becomes E at the end. But careful: When we push an operator through a Clifford gate, it might change into a different Pauli. But here, we checked that E acts on {1,2} and H0 acts on qubit 0, so they commute. And CNOT03 acts on {0,3}, so it commutes with E because E acts on {1,2}. So indeed, E remains unchanged. Similarly, F is applied after CNOT03. But F acts on {0,3}. There is no gate after F, so F stays as is. So indeed, the overall effect is that the final state is F * E |ψ_ideal>, where E is the error on {1,2} and F is the error on {0,3}. But wait: What about the fact that errors occur with probability? Actually, careful: The errors are not deterministic. They occur with probabilities. So the final state is a mixture over different E and F. And the probability for a particular E (non-identity) is p/15, and for no error on that location is (1-p). Similarly for F. So the density matrix ρ = sum_{E on {1,2}, F on {0,3}} Prob(E) Prob(F) * (F E) |ψ_ideal><ψ_ideal| (F E)^†. But note: F and E commute, so it’s E F |ψ_ideal><ψ_ideal| F E. And Prob(E) = if E=I, probability 1-p; if E ≠ I, probability p/15. Similarly for F.

So then the state is: ρ = (1-p)^2 |ψ_ideal><ψ_ideal| + (1-p) * (p/15) sum_{F ≠ I} F |ψ_ideal><ψ_ideal| F + (p/15)(1-p) sum_{E ≠ I} E |ψ_ideal><ψ_ideal| E + (p/15)^2 sum_{E ≠ I, F ≠ I} E F |ψ_ideal><ψ_ideal| F E.

But careful: The errors E and F are applied independently. So that is correct.

Now, we want to post-select on the state being in the code space. That means we only keep states that are eigenvectors of S1 and S2 with eigenvalue +1. That is, we want the state to be in the code space. The code space is the space where S1=+1 and S2=+1. Now, what are the conditions for E F |ψ_ideal> to be in the code space? Since |ψ_ideal> is in the code space, applying a Pauli operator will take it to another state. That state will be in the code space if and only if that Pauli operator is in the normalizer of the stabilizer. Because if G is in the normalizer, then G maps the code space to itself. But careful: The code space is the +1 eigenspace of S1 and S2. If G commutes with S1 and S2, then G |ψ> is also +1 eigenvector if |ψ> is. So indeed, E F will keep the state in the code space if and only if E F is in the normalizer of the stabilizer. But note: E acts on {1,2} and F acts on {0,3}. So E F is in the normalizer if and only if E is in the normalizer on {1,2} and F is in the normalizer on {0,3}? Actually, careful: The normalizer of the stabilizer for the entire code is the set of Paulis that commute with S1 and S2. Since E and F act on disjoint sets, E F commutes with S1 if and only if E commutes with the part on {1,2} and F commutes with the part on {0,3}? Actually, S1 = X0 X1 X2 X3. E acts on {1,2} and F acts on {0,3}. So [E F, S1] = 0 if and only if [E, X1X2]=0 and [F, X0X3]=0. Similarly for S2. So indeed, E F is in the normalizer if and only if E is in the set of Paulis on {1,2} that commute with X1X2 and Z1Z2, and F is in the set of Paulis on {0,3} that commute with X0X3 and Z0Z3. And as we determined, those sets are: For {1,2}: {I, X1X2, Z1Z2, X1X2 Z1Z2} (4 elements). For {0,3}: {I, X0X3, Z0Z3, X0X3 Z0Z3} (4 elements).

So, the state will be in the code space if and only if E is one of these 4 and F is one of these 4. But note: E and F are chosen from the set of all Paulis on their respective pairs. But our error model: E is on {1,2} and F on {0,3}. And the probabilities: For E: P(E=I) = 1-p, and for E being one of the other 15, each with p/15. But among those 15, how many are in the normalizer? There are 3: X1X2, Z1Z2, and X1X2 Z1Z2. Similarly for F: 3 normalizer elements among non-identity. So, the probability that the state is in the code space is: P(code) = [Probability that E is in normalizer] * [Probability that F is in normalizer] because they are independent. Probability that E is in normalizer = P(E=I) + P(E is one of the 3) = (1-p) + 3*(p/15) = 1-p + p/5 = 1 - (4/5)p. Similarly for F: 1 - (4/5)p. So P(code) = [1 - (4/5)p]^2.

Now, within the code space, what is the state? If E and F are both in the normalizer, then E F |ψ_ideal> is in the code space. But note: The normalizer of the stabilizer includes the stabilizers themselves and the logical operators. But here, |ψ_ideal> is a specific logical state. The normalizer elements that are not in the stabilizer will act as logical operators on the logical qubits. So we need to determine the logical effect of these normalizer elements on the logical state. We have the logical operators given: X_A = XIXI, X_B = XXII, Z_A = ZZII, Z_B = ZIZI. But our errors are on specific qubits: E on {1,2} and F on {0,3}. Let’s list the normalizer elements on {1,2}: N_E: I, X1X2, Z1Z2, X1X2 Z1Z2. And on {0,3}: N_F: I, X0X3, Z0Z3, X0X3 Z0Z3.

Now, how do these act on the logical state? We need to see what logical operation they correspond to. But careful: The state |ψ_ideal> is the logical GHZ state: (|00>_AB + |11>_AB)/√2. We need to know the action of these Paulis on the logical state. But note: These Paulis are in the normalizer, so they map the code space to itself. They can be represented as logical operators (possibly with a phase) on the logical qubits. So we need to compute: For each combination of E and F that are in the normalizer, what is E F |ψ_ideal>? And is it the same as |ψ_ideal> up to a phase? Or does it change the logical state?

Let’s determine the logical effect of these operators. We have the code [[4,2,2]]. The logical operators are given. But we need to express our errors in terms of the logical operators and stabilizers. First, consider errors on {1,2}. Take E = X1X2. What is its effect on the logical state? We know the logical operators: X_A = X0 I X2 I? Actually, X_A = XIXI means: on qubit 0: X, qubit 1: I, qubit 2: X, qubit 3: I? That pattern: XIXI: positions: 0: X, 1: I, 2: X, 3: I. But wait: The problem says: “X_A = XIXI”. That likely means: qubit0: X, qubit1: I, qubit2: X, qubit3: I. But then X_B = XXII: qubit0: X, qubit1: X, qubit2: I, qubit3: I. And Z_A = ZZII: qubit0: Z, qubit1: Z, qubit2: I, qubit3: I. Z_B = ZIZI: qubit0: Z, qubit1: I, qubit2: Z, qubit3: I. But our errors: E on {1,2} means qubits 1 and 2. So X1X2: that is on qubit1 and qubit2. Compare with logical operators: X_A involves qubit0 and qubit2. X_B involves qubit0 and qubit1. So X1X2 is not exactly a logical operator? But it is in the normalizer. It must be equivalent to some product of logical operators and stabilizers. Let’s find: We have stabilizers: S1 = X0X1X2X3, S2 = Z0Z1Z2Z3. We want to see what X1X2 is. Multiply X1X2 by S1? S1 = X0X1X2X3. So S1 * (X1X2) = X0 X1^2 X2^2 X3 = X0 X3. That is not a logical operator? Alternatively, maybe we can determine the action on the logical state by computing the expectation or something. But maybe we can compute directly on |ψ_ideal>. |ψ_ideal> = 1/2 (|0000> + |1001> + |0110> + |1111>). Apply X1X2 to |ψ_ideal>. X1X2 |0000> = |0110>? Because flip qubit1 and qubit2: |0000> -> |0110>. X1X2 |1001> = |1111>? Because |1001> -> flip qubit1 and qubit2: qubit1=0->1, qubit2=0->1, so becomes |1111>. X1X2 |0110> = |0000>. X1X2 |1111> = |1001>. So X1X2 |ψ_ideal> = 1/2 (|0110> + |1111> + |0000> + |1001>) = |ψ_ideal>. So X1X2 acts as identity on |ψ_ideal>? But wait, check phases: All are positive. So indeed, X1X2 |ψ_ideal> = |ψ_ideal>. So that error does not change the logical state. Next, E = Z1Z2. Z1Z2 |0000> = |0000> (since qubit1=0, qubit2=0, so phase +1) Z1Z2 |1001> = |1001>? Check: |1001>: qubit1=0, qubit2=0? Actually, |1001>: qubit0=1, qubit1=0, qubit2=0, qubit3=1. So Z1 and Z2 give +1. So remains. Z1Z2 |0110> = (-1)(-1)|0110> = |0110>? Actually, careful: |0110>: qubit1=1, qubit2=1, so Z1 gives -1, Z2 gives -1, product +1. So remains. Z1Z2 |1111> = (-1)(-1)|1111> = |1111>. So Z1Z2 |ψ_ideal> = |ψ_ideal>. So that also acts as identity. Next, E = X1X2 Z1Z2. But note: X1X2 Z1Z2 = (X1Z1)(X2Z2) = (i Y1)(i Y2) = - Y1 Y2. But let’s compute directly: X1X2 Z1Z2 |0000> = X1X2 (|0000>) = |0110> as before? But careful: Z1Z2 first: Z1Z2 |0000> = |0000>, then X1X2 gives |0110>. X1X2 Z1Z2 |1001> = X1X2 |1001> = |1111>. X1X2 Z1Z2 |0110> = X1X2 (Z1Z2 |0110>) = X1X2 (|0110>) because Z1Z2 gives +1? Actually, check: |0110>: qubit1=1, qubit2=1, so Z1 gives -1, Z2 gives -1, product +1. So then X1X2 gives |0000>. X1X2 Z1Z2 |1111> = X1X2 (Z1Z2 |1111>) = X1X2 (|1111>) because qubit1=1, qubit2=1 so product +1? Actually, careful: |1111>: qubit1=1, qubit2=1, so Z1 gives -1, Z2 gives -1, product +1. Then X1X2 gives |1001>. So indeed, X1X2 Z1Z2 |ψ_ideal> = 1/2 (|0110>+|1111>+|0000>+|1001>) = |ψ_ideal>. So all errors on {1,2} that are in the normalizer actually act as identity on |ψ_ideal>? That is interesting. But wait: Could it be that these errors are actually stabilizers? Check: X1X2 is not a stabilizer because the stabilizers are XXXX and ZZZZ. X1X2 is not a multiple of those. But it might be that on the code space, X1X2 acts as identity? Let’s check: The code space is 4-dimensional. The stabilizers generate a group of order 4. The normalizer modulo the stabilizer gives the logical group of order 16 for 2 qubits. So there should be logical operators that are not identity. But maybe on the particular state |ψ_ideal>, these operators act as identity? That is possible if |ψ_ideal> is a eigenstate of those logical operators with eigenvalue 1. But |ψ_ideal> is the GHZ state for two qubits: (|00>+|11>)/√2. That state is not invariant under all logical operators. For example, logical X on one qubit would change it to (|10>+|01>)/√2. So there are logical operators that change it. So why do these errors on {1,2} seem to act as identity? Let’s check: Consider the logical operator X_A. X_A = XIXI. That means apply X on qubit0 and qubit2. So if we apply X_A to |ψ_ideal>, what happens? X_A |0000> = |1010>? But wait, |ψ_ideal> is: |0000>, |1001>, |0110>, |1111>. X_A applied: X_A |0000> = X0 X2 |0000> = |1010> but that is not in the set? So maybe |1010> is not in the code space? Actually, the code space is not spanned by these four states? They are a basis? Actually, the code space is 4-dimensional. The state |ψ_ideal> is one state in the code space. The logical operators should map the code space to itself. So X_A should map |ψ_ideal> to some other state in the code space. Let’s find the code space explicitly. The stabilizers are XXXX and ZZZZ. The code space is the common +1 eigenspace. A basis for the code space can be taken as the simultaneous eigenvectors of logical operators. Often, the logical states are defined by: |00>_L = (|0000>+|1111>)/√2? But our |ψ_ideal> is different: it is (|0000>+|1001>+|0110>+|1111>)/2. That is actually (|00>_L + |11>_L)/√2? Because if |00>_L = (|0000>+|1111>)/√2 and |11>_L = (|1001>+|0110>)/√2, then indeed (|00>_L+|11>_L)/√2 = 1/√2 * (1/√2(|0000>+|1111>) + 1/√2(|1001>+|0110>)) = 1/2 (|0000>+|1111>+|1001>+|0110>). So yes, |ψ_ideal> = (|00>_L + |11>_L)/√2. So that is the GHZ state. Now, what are the logical operators? We have: X_A = XIXI. Let’s compute X_A on |00>_L. |00>_L = (|0000>+|1111>)/√2. X_A |00>_L = (X0 X2) (|0000>+|1111>)/√2 = (|1010>+|0101>)/√2. That is likely |11>_L? Because |11>_L = (|1001>+|0110>)/√2. So not exactly. So maybe our identification of logical states is different. We need to determine the logical operators properly from the given: X_A = XIXI, X_B = XXII, Z_A = ZZII, Z_B = ZIZI. We want to find a basis for the code space that are eigenstates of Z_A and Z_B. Z_A = ZZII. So it acts on qubits 0 and 1. So its eigenvalues: +1 if qubits 0 and 1 are same? Actually, Z on |0> gives +1, on |1> gives -1. So Z_A = Z0 Z1. So +1 if Z0 Z1 = +1, i.e., both 0 or both 1? Actually, careful: Z0 Z1 |00> = |00>, so eigenvalue +1. Z0 Z1 |11> = |11>, so eigenvalue +1. Z0 Z1 |01> = -|01>, so eigenvalue -1. Z0 Z1 |10> = -|10>, so eigenvalue -1. So Z_A has eigenvalue +1 for states where qubits 0 and 1 are equal, and -1 for states where they are different. Z_B = ZIZI = Z0 Z2? Because qubit0 and qubit2. So similarly, Z_B has eigenvalue +1 if qubit0 and qubit2 are same, and -1 if different. Now, the code space is the intersection of +1 eigenspace of XXXX and ZZZZ. Let’s find a basis. The stabilizers: S1=XXXX, S2=ZZZZ. We want states that are +1 for both. Consider the state |0000>. S1|0000>=|1111>, so not eigenvector. So we need superpositions. A common basis for the [[4,2,2]] code is: |00>_L = (|0000>+|1111>)/√2, |01>_L = (|1100>+|0011>)/√2, |10>_L = (|1010>+|0101>)/√2, |11>_L = (|1001>+|0110>)/√2. Check S1: XXXX applied to these gives them back? For |00>_L, XXXX(|0000>+|1111>)=|1111>+|0000>, so yes. S2: ZZZZ gives: for |0000>, phase +1; for |1111>, phase (-1)^4=+1, so okay. Now, what are the logical Z operators? Z_A = ZZII. On |00>_L, Z_A = Z0Z1. For |0000>, Z0Z1 gives +1; for |1111>, Z0Z1 gives (+1)(+1)? Actually, careful: |1111>: Z0 gives -1, Z1 gives -1, product +1. So Z_A|00>_L = |00>_L. So |00>_L is eigenvalue +1 for Z_A. Z_B = ZIZI = Z0Z2. On |00>_L, |0000>: Z0Z2=+1; |1111>: Z0Z2=(-1)(-1)=+1. So |00>_L is eigenvalue +1 for Z_B as well. So |00>_L corresponds to logical |00>. Now, |11>_L = (|1001>+|0110>)/√2. Check Z_A: On |1001>, Z0Z1: Z0 on qubit0=1 gives -1, Z1 on qubit1=0 gives +1, so product -1. On |0110>, Z0 on 0=0 gives +1, Z1 on 1=1 gives -1, product -1. So Z_A|11>_L = -|11>_L. So logical value for Z_A is -1. Z_B: On |1001>, Z0Z2: qubit0=1 -> -1, qubit2=0 -> +1, product -1. On |0110>, qubit0=0 -> +1, qubit2=1 -> -1, product -1. So Z_B|11>_L = -|11>_L. So |11>_L is logical |11>. So then our |ψ_ideal> = (|0000>+|1001>+|0110>+|1111>)/2. That is actually (|00>_L + |11>_L)/√2? Because |00>_L = (|0000>+|1111>)/√2, and |11>_L = (|1001>+|0110>)/√2. So yes, |ψ_ideal> = (|00>_L + |11>_L)/√2. So that is the GHZ state for logical qubits.

Now, let’s determine the effect of the normalizer errors on this state. We are interested in errors on {1,2} that are in the normalizer: E can be: I, X1X2, Z1Z2, X1X2 Z1Z2. We already computed on the physical state |ψ_ideal> that all these seem to give back |ψ_ideal> itself. But wait, check carefully: For E = X1X2, we computed: X1X2 |0000> = |0110> X1X2 |1001> = |1111> X1X2 |0110> = |0000> X1X2 |1111> = |1001> So indeed, X1X2 permutes the terms: it sends |0000> to |0110> and |1111> to |1001>. So the state becomes: 1/2 (|0110>+|1111>+|0000>+|1001>) which is the same set. So yes, X1X2 |ψ_ideal> = |ψ_ideal>. For E = Z1Z2, we computed that it gives phase +1 on each term? Check: |0000>: Z1Z2 gives +1. |1001>: qubit1=0, qubit2=0 -> +1. |0110>: qubit1=1, qubit2=1 -> (-1)(-1)=+1. |1111>: qubit1=1, qubit2=1 -> +1. So Z1Z2 |ψ_ideal> = |ψ_ideal>. For E = X1X2 Z1Z2, we computed that it also gives the same permutation as X1X2? Actually, careful: X1X2 Z1Z2 = (X1Z1)(X2Z2) = (iY1)(iY2) = -Y1Y2. But when applied to |0000>, we get: first Z1Z2 gives +1, then X1X2 gives |0110>. So it gives |0110>. Similarly, on |1001>, gives |1111>; on |0110>, gives |0000>; on |1111>, gives |1001>. So it is the same as X1X2? But wait, there might be phases? Check: On |0110>, Z1Z2: qubit1=1, qubit2=1 gives (-1)(-1)=+1, then X1X2 gives |0000>. So no phase. So indeed, X1X2 Z1Z2 |ψ_ideal> = |ψ_ideal>. So all errors on {1,2} that are in the normalizer act as identity on |ψ_ideal>.

Now consider errors on {0,3} that are in the normalizer: F can be: I, X0X3, Z0Z3, X0X3 Z0Z3. Let’s compute these on |ψ_ideal>. F = X0X3: X0X3 |0000> = |1001> X0X3 |1001> = |0000> X0X3 |0110> = |1111>? Check: |0110>: qubit0=0->1, qubit3=0->1, so becomes |1111>. X0X3 |1111> = |0110> So X0X3 |ψ_ideal> = 1/2 (|1001>+|0000>+|1111>+|0110>) = |ψ_ideal>. So identity. F = Z0Z3: Z0Z3 |0000> = |0000> (+1) Z0Z3 |1001> = (-1)(-1)|1001> = |1001>? Check: |1001>: qubit0=1 -> -1, qubit3=1 -> -1, product +1. Z0Z3 |0110> = |0110> (qubit0=0: +1, qubit3=0: +1) Z0Z3 |1111> = (-1)(-1)|1111> = |1111> So Z0Z3 |ψ_ideal> = |ψ_ideal>. F = X0X3 Z0Z3: This is similar to before, likely gives identity as well. Check: X0X3 Z0Z3 |0000> = X0X3 |0000> = |1001> |1001> -> Z0Z3 gives (+1)? Actually, careful: On |0000>, Z0Z3 gives +1, then X0X3 gives |1001>. On |1001>, Z0Z3: qubit0=1 -> -1, qubit3=1 -> -1, product +1, then X0X3 gives |0000>. On |0110>, Z0Z3: +1, then X0X3 gives |1111>. On |1111>, Z0Z3: (-1)*(-1)=+1, then X0X3 gives |0110>. So indeed, X0X3 Z0Z3 |ψ_ideal> = |ψ_ideal>. So it appears that all these normalizer errors act as identity on |ψ_ideal>! That is interesting. But wait, are there any normalizer errors that could act as logical operators? They would be products of these with stabilizers? But stabilizers themselves act as identity on the code space. So indeed, any operator in the normalizer that is not a logical operator? Actually, the normalizer modulo the stabilizer gives the logical group. So there should be operators that are not in the stabilizer but act non-trivially on the code space. For example, X_A = XIXI. Is X_A in the normalizer? Check: X_A = X0 I X2 I. Does it commute with S1? S1 = X0X1X2X3. X_A commutes with S1 if and only if? X0 and X2 commute with X0X1X2X3? Actually, X0 commutes with X0, but anti-commutes with? Let’s check: X_A and S1: They act on qubits: X_A on 0 and 2; S1 on all. They will commute if the number of anti-commutations is even. X0 with X0: commute; X2 with X2: commute; so overall commute. With S2: Z0Z1Z2Z3. X0 anti-commutes with Z0, so that gives one anti-commutation; X2 anti-commutes with Z2, so that gives another; so overall commute? Actually, product of two anti-commutations gives commute. So yes, X_A is in the normalizer. So why didn’t we get X_A from our errors? Because our errors are restricted to pairs: {1,2} and {0,3}. X_A involves qubits 0 and 2, which is not on a single pair from our error locations. So indeed, the errors that occur are only on these specific pairs. And it seems that the errors on these pairs that are in the normalizer actually act trivially on |ψ_ideal>. Let’s check: Could there be an error on {0,3} that acts as X_A? X_A = X0 X2. But that involves qubit2, which is not in {0,3}. So no. What about errors on {1,2} that act as X_B? X_B = X0 X1. That involves qubit0, so no. So indeed, the errors that occur from these specific depolarizing channels, when they are undetectable (i.e., in the normalizer), they actually do not change the logical state. So that means that if the state is in the code space, then it is actually the correct logical state |ψ_ideal>.

But wait: Is that always true? Let’s check one more: What about an error that is a product of an error on {1,2} and an error on {0,3} that together might act as a logical operator? For example, consider E = X1X2 and F = something that gives X0? But we already computed that individually they act as identity. And since they commute, the combined effect is identity. So it seems that for any E and F that are in the normalizer (from our sets), we have E F |ψ_ideal> = |ψ_ideal>. I want to double-check: Take E = X1X2 and F = X0X3. Then combined: X0X3 X1X2. Does that equal any logical operator? That operator acts on all qubits. Could it be X_A? X_A = X0 X2. Not that. Could it be X_B? X_B = X0 X1. Not that. Maybe it is a stabilizer? S1 = X0X1X2X3. Our product is X0X1X2X3? Actually, X0X3 X1X2 = X0X1X2X3 = S1. And S1 acts as identity on the code space. So yes. What about E = X1X2 and F = Z0Z3? That product is Z0Z3 X1X2. Is that a stabilizer? S2 = Z0Z1Z2Z3. Not exactly. But we computed individually they act as identity. So it’s fine. So indeed, if both E and F are in the normalizer, then the state is exactly |ψ_ideal>.

Therefore, the post-selected state is only those cases where E and F are in their respective normalizer sets. And in all those cases, the state is |ψ_ideal>. So then the fidelity after post-selection is 1. But wait: Is that true? What about the cases where there is no error? That is included: E=I and F=I are in the normalizer. So yes. So then, if we post-select on the code space, we only keep outcomes where E is in N_E and F is in N_F. And in all those cases, the state is |ψ_ideal>. So the logical state fidelity is 1.

But wait: The question: “What is the logical state fidelity of the final 2-qubit logical state at the end of the circuit as a function of p, assuming the state is post-selected on all detectable errors?” That suggests that after post-selection, the state is perfect. But is that true? That would mean that the fidelity is 1 regardless of p? That seems too good. But wait: There might be a catch: Post-selection on all detectable errors means that we discard any state that is not in the code space. But what about errors that are not detectable? Those are the ones that are in the normalizer. And as we argued, those errors actually do not change the logical state. So indeed, if we post-select, we only keep the states that are in the code space, and those states are exactly the ideal state. So the logical fidelity is 1.

But wait: Could there be any phase factors? We checked that each normalizer error from these sets acts as identity on |ψ_ideal>. So yes.

Therefore, the logical state fidelity after post-selection is 1.

But wait: The problem might be more nuanced: “post-selected on all detectable errors” might mean that we measure the stabilizers and if we get -1 on either, we discard. That means we keep only when the state is in the code space. And as argued, if the state is in the code space, then it must be that E and F are such that they are in the normalizer. And then the state is E F |ψ_ideal>. And we have shown that for any E in the set of 4 on {1,2} and F in the set of 4 on {0,3}, we get |ψ_ideal>. So indeed, the logical state is always |ψ_ideal>. So the fidelity is 1.

Thus the answer should be: F_logical = 1.

But wait: Is that independent of p? That is interesting. It means that if we can post-select on the code space, then no matter what the error rate p is, the logical state is perfect. But that is only if the errors are exactly these two-qubit depolarizing channels on these specific pairs. And indeed, these errors are such that any error that takes the state out of the code space is detectable, and any error that does not take it out is actually harmless for this particular state. That is a property of this specific circuit and this specific code. So the answer is 1.

I will double-check with an example: Suppose after CNOT21, there is an error X1 (which is detectable because it anti-commutes with Z1Z2? Actually, X1 on qubit1: Does it commute with S1? S1 has X1, so commutes? But with S2: S2 has Z1, so anti-commutes. So detectable). So that state would be discarded. What if there is an error Z1? Then with S1: anti-commutes? S1 has X1, so anti-commutes. So detectable. What if there is an error Y1? That would be detectable as well. So indeed, any single-qubit error on these pairs is detectable. And any two-qubit error that is not in the normalizer will be detectable. So the only errors that are not detected are those in the normalizer. And we checked that those act trivially on the logical state. So yes.

Therefore, the logical fidelity after post-selection is 1.

So the answer is: F_logical = 1.

But wait: The problem asks “as a function of p”. That would be constant 1.

So final answer: \boxed{1}.

I’ll provide step-by-step reasoning.

Step-by-Step Derivation

🔹 Circuit and Error Model

We aim to prepare the logical GHZ state

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

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

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

where operations are applied from right to left. The initial state is \(|0000\rangle\).

Each CNOT gate is followed by a two-qubit depolarizing error channel: - After \(\text{CNOT}_{21}\), an error \(E\) occurs on qubits \(\{1,2\}\) with probability \(p\), where \(E\) is one of the 15 non-identity Pauli operators (each with probability \(p/15\)). - After \(\text{CNOT}_{03}\), an error \(F\) occurs on qubits \(\{0,3\}\) with probability \(p\), where \(F\) is one of the 15 non-identity Pauli operators (each with probability \(p/15\)).

Hadamard gates are assumed perfect.

🔹 Ideal State Preparation

Applying the circuit without errors:

  1. \(H_2 |0000\rangle = \frac{1}{\sqrt{2}}(|0000\rangle + |0010\rangle)\)
  2. \(\text{CNOT}_{21} \cdot \frac{1}{\sqrt{2}}(|0000\rangle + |0010\rangle) = \frac{1}{\sqrt{2}}(|0000\rangle + |0110\rangle)\)
  3. \(H_0 \cdot \frac{1}{\sqrt{2}}(|0000\rangle + |0110\rangle) = \frac{1}{2}(|0000\rangle + |1000\rangle + |0110\rangle + |1110\rangle)\)
  4. \(\text{CNOT}_{03} \cdot \frac{1}{2}(|0000\rangle + |1000\rangle + |0110\rangle + |1110\rangle) = \frac{1}{2}(|0000\rangle + |1001\rangle + |0110\rangle + |1111\rangle)\)

Thus, the ideal physical state is:

\[ |\psi_{\text{ideal}}\rangle = \frac{1}{2}(|0000\rangle + |1001\rangle + |0110\rangle + |1111\rangle) \]

🔹 Error Propagation

Since the circuit consists of Clifford gates, errors can be propagated to the end. The errors \(E\) (on \(\{1,2\}\)) and \(F\) (on \(\{0,3\}\)) commute with subsequent gates (as they act on disjoint qubit sets), so the final state becomes:

\[ |\psi_{\text{actual}}\rangle = F \cdot E \cdot |\psi_{\text{ideal}}\rangle \]

The full density matrix is a mixture over all possible errors:

\[ \rho = \sum_{E,F} P(E) P(F) \cdot (FE) |\psi_{\text{ideal}}\rangle \langle \psi_{\text{ideal}}| (FE)^\dagger \]

where: - \(P(E = I) = 1 - p\), \(P(E \neq I) = \frac{p}{15}\) - \(P(F = I) = 1 - p\), \(P(F \neq I) = \frac{p}{15}\)

🔹 Post-Selection on the Code Space

The \([[4,2,2]]\) code has stabilizers:

\[ S_1 = X_0 X_1 X_2 X_3, \quad S_2 = Z_0 Z_1 Z_2 Z_3 \]

The code space is the simultaneous \(+1\) eigenspace of \(S_1\) and \(S_2\). We post-select by measuring \(S_1\) and \(S_2\), keeping only outcomes where both yield \(+1\).

A Pauli error \(G\) will keep the state in the code space iff it commutes with both \(S_1\) and \(S_2\). Since \(E\) and \(F\) act on disjoint sets, \(FE\) is in the normalizer iff: - \(E\) commutes with \(X_1 X_2\) and \(Z_1 Z_2\) - \(F\) commutes with \(X_0 X_3\) and \(Z_0 Z_3\)

The Paulis on \(\{1,2\}\) that satisfy this are:

\[ \mathcal{N}_E = \{I, X_1 X_2, Z_1 Z_2, X_1 X_2 Z_1 Z_2\} \]

The Paulis on \(\{0,3\}\) that satisfy this are:

\[ \mathcal{N}_F = \{I, X_0 X_3, Z_0 Z_3, X_0 X_3 Z_0 Z_3\} \]

The probability that \(E \in \mathcal{N}_E\) is:

\[ P(E \in \mathcal{N}_E) = (1 - p) + 3 \cdot \frac{p}{15} = 1 - \frac{4}{5}p \]

Similarly, \(P(F \in \mathcal{N}_F) = 1 - \frac{4}{5}p\). Since \(E\) and \(F\) are independent:

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

🔹 Effect of Normalizer Errors on Logical State

We now examine the action of errors in \(\mathcal{N}_E\) and \(\mathcal{N}_F\) on \(|\psi_{\text{ideal}}\rangle\).

  • For any \(E \in \mathcal{N}_E\), direct computation shows:
\[ E |\psi_{\text{ideal}}\rangle = |\psi_{\text{ideal}}\rangle \]
  • Similarly, for any \(F \in \mathcal{N}_F\):
\[ F |\psi_{\text{ideal}}\rangle = |\psi_{\text{ideal}}\rangle \]

Since \(E\) and \(F\) act on disjoint qubits, they commute, so:

\[ FE |\psi_{\text{ideal}}\rangle = |\psi_{\text{ideal}}\rangle \]

for all \(E \in \mathcal{N}_E\), \(F \in \mathcal{N}_F\).

Thus, if the state is in the code space (i.e., \(E \in \mathcal{N}_E\) and \(F \in \mathcal{N}_F\)), the logical state is exactly \(|\psi_{\text{ideal}}\rangle\).

🔹 Logical Fidelity After Post-Selection

After post-selection, the state is:

\[ \rho_{\text{post}} = \frac{\Pi \rho \Pi}{\operatorname{Tr}(\Pi \rho)} \]

where \(\Pi\) is the projector onto the code space. Since \(|\psi_{\text{ideal}}\rangle\) is in the code space, we have:

\[ \langle \psi_{\text{ideal}} | \rho_{\text{post}} | \psi_{\text{ideal}} \rangle = \frac{\langle \psi_{\text{ideal}} | \rho | \psi_{\text{ideal}} \rangle}{\operatorname{Tr}(\Pi \rho)} \]

But from above, whenever the state is in the code space, it is exactly \(|\psi_{\text{ideal}}\rangle\), so:

\[ \langle \psi_{\text{ideal}} | \rho | \psi_{\text{ideal}} \rangle = P(\text{code}) \cdot 1 \]

and

\[ \operatorname{Tr}(\Pi \rho) = P(\text{code}) \]

Hence, the logical fidelity is:

\[ F_{\text{logical}} = \frac{P(\text{code})}{P(\text{code})} = 1 \]

Final Answer:

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

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

import sympy as sp

p = sp.symbols('p')

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

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

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

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

    return F_logical
Assistant #6
Reasoning (model)

We are given that the logical state fidelity after post-selection is 1, regardless of p. So, we return the constant 1.

However, note that the function should return a SymPy expression. We can return sp.Integer(1).

But let’s confirm: The problem says “assuming the state is post-selected on all detectable errors”. We have shown that any error that is not detected (i.e., that leaves the state in the code space) does not change the logical state. Therefore, after post-selection, the logical state is always ideal. So fidelity is 1.

Thus, F_logical = 1.

Final Answer:
The logical state fidelity after post-selection on all detectable errors is 1, independent of the error rate \( p \). This is because any undetectable errors (those in the normalizer of the stabilizers) leave the logical state unchanged, while detectable errors are discarded during post-selection.

import sympy as sp

p = sp.symbols('p')

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

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

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

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

    return F_logical