Checkpoint-2

System #0

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

Input Problems will be provided in Markdown format.

Output (Markdown format)

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

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

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

User #1

Problem setup:

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

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

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

Checkpoints

Checkpoint 1

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

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

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

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

Assistant #2
Reasoning (model)

Quantum Error Correction for the [[4,2,2]] Code: Physical State Fidelity

Alright, let’s break this down. The user wants me to calculate the physical state fidelity of a quantum circuit that prepares a two-qubit GHZ state using a specific quantum error correction code: the [[4,2,2]] code. I need to account for errors introduced by a depolarizing channel after each CNOT gate in the circuit. No problem, let’s dive in.

First, I identified the circuit’s ideal operation, finding that, in the absence of noise, the circuit prepares the target GHZ state: \(|\psi_{ideal}\rangle = \frac{1}{2}(|0000\rangle + |1001\rangle + |0110\rangle + |1111\rangle)\). I then analyzed the ideal state to be sure that it is a valid logical state of the code.

Next, I modeled the noise. After each CNOT gate, a two-qubit depolarizing channel applies a Pauli operator, which means a small change from the perfect state. I determined that the final state would be a mixture of states resulting from different error events. From there, I set up the Fidelity equation as follows: F = sum_kl P(k,l) |\langle Psi|psi(k,l)\rangle|^2.

The critical step is figuring out how the errors affect the fidelity. A key insight is that a non-zero overlap between the ideal state and an error state only happens if the error operator commutes with the stabilizer group of the ideal state. I found that the stabilizers for the ideal state include the code stabilizers \(XXXX\) and \(ZZZZ\) and the logical stabilizers. For the Bell state \(|\Psi\rangle\), the two logical stabilizers should be \(X_1X_2\) and \(Z_1Z_2\). Using this, I could identify the “good” error operators which preserve fidelity by commuting with the stabilizer group. Specifically, only three two-qubit Pauli operators on each CNOT gate act such that they generate states in the same subspace, with the good error operators given by the operators from the group \(<X_0X_3, Z_0Z_3, Y_0Y_3>\) on qubit \(0\) and \(3\), and with a similar set of operators on qubits \(1\) and \(2\). These 3 errors and identity have a non-zero overlap in the Fidelity computation.

The final result is F = (1 - 4p/5)^2. This makes sense; as the error rate p increases, fidelity should decrease quadratically.

Step-by-Step Derivation

1. Ideal State Preparation (No Errors)

First, we determine the 4-qubit state prepared by the circuit in the ideal, error-free case. The circuit is \(U = (CNOT_{03}) (H_0) (CNOT_{21}) (H_2)\), and it acts on the initial state \(|\psi_{in}\rangle = |0000\rangle\). The operations are applied from right to left.

  1. Initial state: \(|\psi_0\rangle = |0000\rangle\).
  2. Apply \(H_2\): The Hadamard gate on qubit 2 creates a superposition.
\[ |\psi_1\rangle = H_2 |\psi_0\rangle = |00\rangle_0 |+\rangle_2 |0\rangle_3 = \frac{1}{\sqrt{2}} |00\rangle(|0\rangle+|1\rangle)_2|0\rangle_3 = \frac{1}{\sqrt{2}}(|0000\rangle + |0010\rangle) \]
  1. Apply \(CNOT_{21}\): This gate flips qubit 1 if qubit 2 is \(|1\rangle\).
\[ |\psi_2\rangle = CNOT_{21} |\psi_1\rangle = \frac{1}{\sqrt{2}}(CNOT_{21}|0000\rangle + CNOT_{21}|0010\rangle) = \frac{1}{\sqrt{2}}(|0000\rangle + |0110\rangle) \]
  1. Apply \(H_0\): The Hadamard gate on qubit 0.
\[ |\psi_3\rangle = H_0 |\psi_2\rangle = \frac{1}{\sqrt{2}}(H_0|0000\rangle + H_0|0110\rangle) = \frac{1}{\sqrt{2}}\left(\frac{|0\rangle+|1\rangle}{\sqrt{2}}|000\rangle + \frac{|0\rangle+|1\rangle}{\sqrt{2}}|110\rangle\right) \]
\[ |\psi_3\rangle = \frac{1}{2}(|0000\rangle + |1000\rangle + |0110\rangle + |1110\rangle) \]
  1. Apply \(CNOT_{03}\): This gate flips qubit 3 if qubit 0 is \(|1\rangle\).
\[ |\psi_{ideal}\rangle = CNOT_{03} |\psi_3\rangle = \frac{1}{2}(CNOT_{03}|0000\rangle + CNOT_{03}|1000\rangle + CNOT_{03}|0110\rangle + CNOT_{03}|1110\rangle) \]
\[ |\psi_{ideal}\rangle = \frac{1}{2}(|0000\rangle + |1001\rangle + |0110\rangle + |1111\rangle) \]

2. Logical State Identification

The target logical state is \(|\Psi_L\rangle = \frac{1}{\sqrt{2}}(|00\rangle_{AB} + |11\rangle_{AB})\). We need to find the physical representation of this state. The logical basis states \(|v_A v_B\rangle_L\) are the eigenstates of the logical \(Z\) operators, \(Z_A=Z_0Z_1\) and \(Z_B=Z_0Z_2\), within the codespace defined by the stabilizers \(S_1=XXXX\) and \(S_2=ZZZZ\).

The logical \(|00\rangle_L\) state is stabilized by \(S_1, S_2, Z_A, Z_B\). - \(Z_A=Z_0Z_1\) and \(Z_B=Z_0Z_2\) imply the states must have \(z_0=z_1\) and \(z_0=z_2\). - \(S_2=Z_0Z_1Z_2Z_3\) implies an even number of \(|1\rangle\)s, so \(z_0+z_1+z_2+z_3 = 0 \pmod 2\), which leads to \(z_3=z_0\). - Thus, the computational basis states are \(|0000\rangle\) and \(|1111\rangle\). - \(S_1=XXXX\) stabilization requires the state to be an equal superposition: \(|00\rangle_L = \frac{1}{\sqrt{2}}(|0000\rangle + |1111\rangle)\).

The other logical basis states are found by applying logical \(X\) operators: \(|01\rangle_L = X_B|00\rangle_L = (X_0X_1)\frac{1}{\sqrt{2}}(|0000\rangle + |1111\rangle) = \frac{1}{\sqrt{2}}(|1100\rangle + |0011\rangle)\). \(|10\rangle_L = X_A|00\rangle_L = (X_0X_2)\frac{1}{\sqrt{2}}(|0000\rangle + |1111\rangle) = \frac{1}{\sqrt{2}}(|1010\rangle + |0101\rangle)\). \(|11\rangle_L = X_A X_B|00\rangle_L = (X_0X_2)(X_0X_1)|00\rangle_L = (I_0X_1X_2I_3)|00\rangle_L = \frac{1}{\sqrt{2}}(|0110\rangle + |1001\rangle)\). Note: The problem statement has slightly different logical operators, e.g., \(X_A=XIXI\). Using these operators as given: \(X_A X_B |00\rangle_L = (X_0I_1X_2I_3)(X_0X_1I_2I_3)|00\rangle_L = I_0X_1X_2I_3|00\rangle_L = \frac{1}{\sqrt{2}}(|0110\rangle+|1001\rangle)\). The result is the same.

The target logical GHZ state is:

\[ |\Psi_L\rangle = \frac{1}{\sqrt{2}}(|00\rangle_L + |11\rangle_L) = \frac{1}{\sqrt{2}}\left(\frac{1}{\sqrt{2}}(|0000\rangle+|1111\rangle) + \frac{1}{\sqrt{2}}(|0110\rangle+|1001\rangle)\right) \]
\[ |\Psi_L\rangle = \frac{1}{2}(|0000\rangle + |1111\rangle + |0110\rangle + |1001\rangle) \]

This matches the ideal state \(|\psi_{ideal}\rangle\) calculated in the previous section. Let’s denote this state by \(|\Psi\rangle\).

3. Modeling the Noisy Circuit

The circuit contains two \(CNOT\) gates, each followed by a two-qubit depolarizing channel. Let the ideal circuit be \(U = U_{03}H_0U_{21}H_2\). The noisy evolution produces a final density matrix \(\rho_{final}\). The error channel on qubits \(i,j\) following a gate is \(\mathcal{E}_{ij}(\rho) = (1-p)\rho + \frac{p}{15}\sum_{k=1}^{15} P^{(k)}_{ij} \rho (P^{(k)}_{ij})^\dagger\), where \(P^{(k)}_{ij}\) are the 15 non-identity two-qubit Pauli operators on qubits \(i,j\).

The final state can be written as a mixture over all possible error events:

\[ \rho_{final} = \sum_{k=0}^{15} \sum_{l=0}^{15} \text{Prob}(k,l) |\psi_{k,l}\rangle\langle\psi_{k,l}| \]

where \(|\psi_{k,l}\rangle = P^{(l)}_{03} U_{03} H_0 P^{(k)}_{21} U_{21} H_2 |0000\rangle\). The indices \(k=0, l=0\) correspond to no error (\(P=I\)). Since the operators \(U_{03}H_0\) (acting on qubits 0,3) commute with Pauli errors \(P^{(k)}_{21}\) (acting on qubits 2,1), we can write:

\[ |\psi_{k,l}\rangle = P^{(l)}_{03} P^{(k)}_{21} (U_{03} H_0 U_{21} H_2) |0000\rangle = P^{(l)}_{03} P^{(k)}_{21} |\Psi\rangle \]

The probability of a specific error sequence \((k,l)\) is \(p_k p_l\), where \(p_0=1-p\) and \(p_{k>0}=p/15\).

The physical fidelity is \(F = \langle\Psi|\rho_{final}|\Psi\rangle\):

\[ F = \sum_{k=0}^{15} \sum_{l=0}^{15} p_k p_l |\langle\Psi| P^{(l)}_{03} P^{(k)}_{21} |\Psi\rangle|^2 \]

4. Evaluating Overlaps using Stabilizer Formalism

The overlap term \(|\langle\Psi|P|\Psi\rangle|^2\) is non-zero only if the Pauli operator \(P\) commutes with the stabilizer group of the state \(|\Psi\rangle\). If \(P\) commutes, \(P|\Psi\rangle = \pm|\Psi\rangle\) and the overlap squared is 1. If \(P\) anti-commutes with any stabilizer of \(|\Psi\rangle\), the overlap is 0.

The state \(|\Psi\rangle = \frac{1}{\sqrt{2}}(|00\rangle_L + |11\rangle_L)\) is a logical Bell state. Its stabilizer group \(S_{|\Psi\rangle}\) is generated by the code stabilizers (\(S_1, S_2\)) and the logical operators corresponding to the Bell state stabilizers (\(X_A X_B, Z_A Z_B\)). - Code stabilizers: \(S_1 = XXXX\), \(S_2 = ZZZZ\). - Logical Bell state stabilizers: - \(X_A X_B = (X_0I_1X_2I_3)(X_0X_1I_2I_3) = I_0X_1X_2I_3\). Let’s call this \(S_3\). - \(Z_A Z_B = (Z_0Z_1I_2I_3)(Z_0I_1Z_2I_3) = I_0Z_1Z_2I_3\). Let’s call this \(S_4\). So, \(S_{|\Psi\rangle} = \langle XXXX, ZZZZ, IX_1X_2I, IZ_1Z_2I \rangle\).

An error operator \(P = P^{(l)}_{03} P^{(k)}_{21}\) gives a non-zero overlap iff it commutes with all four generators. Since \(P^{(l)}_{03}\) and \(P^{(k)}_{21}\) act on disjoint sets of qubits, this condition decouples:

  1. \(P^{(k)}_{21}\) must commute with \(S_3=IX_1X_2I\) and \(S_4=IZ_1Z_2I\). It automatically commutes with the \(X_0X_3\) and \(Z_0Z_3\) parts of \(S_1\) and \(S_2\).
  2. \(P^{(l)}_{03}\) must commute with the \(X_0X_3\) part of \(S_1\) and the \(Z_0Z_3\) part of \(S_2\). It automatically commutes with \(S_3\) and \(S_4\).

Let’s count the number of “good” errors (those that commute and thus preserve the state up to a phase).

  • Errors on qubits (2,1): A non-identity Pauli \(P_{12}\) on qubits 1,2 is a “good” error if it commutes with both \(X_1X_2\) and \(Z_1Z_2\). The only two-qubit Paulis with this property are \(X_1X_2\), \(Z_1Z_2\), and \(Y_1Y_2 = (iX_1Z_1)(iX_2Z_2) = -X_1X_2 Z_1Z_2\). There are 3 such operators.

  • Errors on qubits (0,3): Similarly, a non-identity Pauli \(P_{03}\) on qubits 0,3 is a “good” error if it commutes with both \(X_0X_3\) and \(Z_0Z_3\). There are 3 such operators: \(X_0X_3\), \(Z_0Z_3\), and \(Y_0Y_3\).

5. Calculating the Fidelity

The total fidelity is the sum of probabilities of all event sequences where only “good” errors or no errors occur. At a single CNOT gate, the error channel is \(\mathcal{E}\). The state after the ideal gate is \(|\psi\rangle\). The state after the channel is \(\rho' = \mathcal{E}(|\psi\rangle\langle\psi|)\). The fidelity contribution from this gate is \(F_1 = \langle\psi|\rho'|\psi\rangle\).

\[ F_1 = (1-p) + \frac{p}{15} \sum_{k=1}^{15} |\langle\psi|P^{(k)}|\psi\rangle|^2 \]

For our state \(|\Psi\rangle\) and errors \(P_{12}\) (or \(P_{03}\)), the sum evaluates to 3, as there are 3 “good” errors. The probability of a “good” error is \(3 \times (p/15) = p/5\). The probability of a “bad” error (one of the other 12 Paulis) is \(12 \times (p/15) = 4p/5\).

The final state \(|\psi_{final}\rangle\) is not orthogonal to \(|\Psi\rangle\) if and only if any errors that occurred were “good” errors. Let’s consider one CNOT gate. The state remains in the desired subspace (i.e., is not mapped to an orthogonal state) with probability:

\[ P_{\text{good}} = P(\text{no error}) + P(\text{good error}) = (1-p) + \frac{3p}{15} = 1 - p + \frac{p}{5} = 1 - \frac{4p}{5} \]

Since the errors at the two CNOT gates are independent, the total fidelity is the product of the probabilities that each gate operation preserves the state in the correct subspace:

\[ F = P_{\text{good at CNOT}_{21}} \times P_{\text{good at CNOT}_{03}} = \left(1 - \frac{4p}{5}\right) \left(1 - \frac{4p}{5}\right) \]
\[ F(p) = \left(1 - \frac{4p}{5}\right)^2 = 1 - \frac{8p}{5} + \frac{16p^2}{25} \]

This is the physical fidelity of the final 4-qubit state as a function of the two-qubit gate error rate \(p\).

Final Answer: The physical state fidelity is given by the function:

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

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

Now let’s solve the next Checkpoint.

Checkpoint 2

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

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

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

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

Assistant #4
Reasoning (model)

Calculating Logical State Fidelity After Post-Selection

Okay, so I’m tasked with figuring out the logical fidelity of the final state after we post-select, given some noise in the CNOT gates. I’ve already confirmed my understanding of the first part, which was about physical state fidelity. Now it’s the logical fidelity that needs calculating.

Here’s the setup: We start with a bunch of qubits in the \(|0000\rangle\) state. Then, we apply this quantum circuit: CNOT_{03} then H_0, followed by CNOT_{21}, and then H_2. The ideal outcome? We want to end up with a logical GHZ state: \(|\Psi_L\rangle = \frac{1}{\sqrt{2}}(|00\rangle + |11\rangle)\). This state is physically encoded as \(|\Psi\rangle = \frac{1}{2}(|0000\rangle + |1001\rangle + |0110\rangle + |1111\rangle)\).

The catch is, each CNOT gate is followed by some noise—a two-qubit depolarizing channel with an error probability p. This means there’s a chance a Pauli error will be introduced. The error is one of 15 non-identity Paulis, each with a probability of p/15.

The last part of the problem is post-selection. This means we filter our final state for errors, which is done by projecting our output into the codespace. This codespace is defined as the space where the stabilizers \(S_1 = XXXX\) and \(S_2 = ZZZZ\) have eigenvalue +1 (also known as the “+1 eigenspace”). In simpler terms, an error is “detectable” if it pushes the state out of that codespace.

My first thought is to break this down. I need to:

  1. Understand how these errors mess with our desired state, \(|\Psi\rangle\).
  2. Grasp what post-selection really means in this context.
  3. Then, finally, I can calculate this logical fidelity.

Mathematically, my “final” state before post-selection can be represented by a density matrix: \(\rho_{final}\). To calculate post-selection, I create this projector onto the codespace, \(\Pi_C\), and use it to get my post-selected state.

I’ve got the equation sorted out: logical fidelity is \(\langle \Psi_L | \rho'_{logical} | \Psi_L \rangle\), where \(\rho'_{logical}\) is the 2-qubit logical state corresponding to \(\rho'_{post}\). The physical analog of the post-selected state looks like \(\rho'_{post} = \frac{\rho_{post}}{P_{success}}\). The logical fidelity can then be written as \(\frac{\text{Tr}(\Pi_C \rho_{final} \Pi_C |\Psi\rangle\langle\Psi|)}{\text{Tr}(\Pi_C \rho_{final})}\).

Now, the trick is determining what errors actually matter.

I see that the post-selection and physical fidelity calculation result in two probabilities, which will divide. An error is undetectable if it keeps the state in the codespace, and these will not change the state after post selection. Any state \(P|\Psi\rangle\) is outside the codespace if \(P\) anti-commutes with \(S_1\) or \(S_2\), as \(\Pi_C\) will annihilate. I need to calculate \(P_{success}\), the probability of ending up inside the codespace.

Now, from the setup, the only gates that introduce errors are CNOTs on pairs (0,3) and (2,1). For an error to be undetectable by \(S_1\) and \(S_2\), it must commute. I know that the Paulis \(I,X,Y,Z\) generate the 2-qubit errors on each gate. Undetectable means that the Pauli commutes with the code stabilizers, \(S_1, S_2\). So I need to find the undetectable errors at each gate.

Since the error model is on pairs, an undetectable error must commute. So, I need to count the operators that will commute with the code stabilizers. \(S_1\), \(S_2\) are each a tensor product, so the overall state remains.

This gives me the probabilities. Both probabilities equal \((1-4p/5)^2\), so the fidelity is 1.

I know that an error can be either detectable or undetectable. If it’s detectable, then that part of the state vanishes after post-selection.

Step-by-Step Derivation

1. Definition of Logical State Fidelity after Post-selection

The circuit produces a final state described by the density matrix \(\rho_{final}\). Post-selection on detectable errors corresponds to projecting this state into the codespace, which is the simultaneous +1 eigenspace of the code stabilizers \(S_1=XXXX\) and \(S_2=ZZZZ\). The projector is \(\Pi_C = \frac{1}{4}(I+S_1)(I+S_2)\).

The unnormalized state after post-selection is \(\rho_{post} = \Pi_C \rho_{final} \Pi_C\). The probability of a successful post-selection (i.e., not detecting an error) is \(P_{success} = \text{Tr}(\rho_{post}) = \text{Tr}(\Pi_C \rho_{final})\). The normalized post-selected state is \(\rho'_{post} = \rho_{post} / P_{success}\).

The ideal state is the logical GHZ state \(|\Psi_L\rangle = \frac{1}{\sqrt{2}}(|00\rangle_{AB}+|11\rangle_{AB})\), whose physical representation is \(|\Psi\rangle = \frac{1}{2}(|0000\rangle + |1001\rangle + |0110\rangle + |1111\rangle)\). The logical state fidelity is the fidelity of the post-selected state with respect to the ideal state:

\[ F_{logical} = \langle\Psi| \rho'_{post} |\Psi\rangle = \frac{\langle\Psi| \Pi_C \rho_{final} \Pi_C |\Psi\rangle}{\text{Tr}(\Pi_C \rho_{final})} \]

Since the ideal state \(|\Psi\rangle\) is in the codespace, we have \(\Pi_C |\Psi\rangle = |\Psi\rangle\). The numerator simplifies to:

\[ \langle\Psi| \rho_{final} |\Psi\rangle = F_{physical} \]

This is the physical state fidelity, which we calculated in Subproblem 1 to be \(F_{physical}(p) = (1 - 4p/5)^2\). Thus, the logical fidelity is given by:

\[ F_{logical} = \frac{F_{physical}}{P_{success}} \]

2. Calculating the Success Probability (\(P_{success}\))

The final state is a mixture over all possible error events:

\[ \rho_{final} = \sum_{k,l=0}^{15} p_k p_l | \psi_{k,l} \rangle \langle \psi_{k,l} | \]

where \(|\psi_{k,l}\rangle = P^{(l)}_{03} P^{(k)}_{21} |\Psi\rangle\), \(p_0=1-p\) for no error, and \(p_{i>0}=p/15\) for a specific Pauli error.

The success probability is:

\[ P_{success} = \text{Tr}(\Pi_C \rho_{final}) = \sum_{k,l} p_k p_l \text{Tr}(\Pi_C |\psi_{k,l}\rangle\langle\psi_{k,l}|) = \sum_{k,l} p_k p_l \langle\psi_{k,l}| \Pi_C |\psi_{k,l}\rangle \]

An error operator \(P\) is detectable if it anti-commutes with at least one code stabilizer \(S_i \in \{S_1, S_2\}\). If \(P\) is detectable, the resulting state \(P|\Psi\rangle\) is moved out of the codespace, and \(\Pi_C P |\Psi\rangle = 0\). An error operator \(P\) is undetectable if it commutes with all code stabilizers. In this case, \(P\) maps the codespace to itself, and \(\Pi_C P |\Psi\rangle = P |\Psi\rangle\). Therefore, the term \(\langle\psi_{k,l}| \Pi_C |\psi_{k,l}\rangle\) is non-zero only if the combined error operator \(P_{k,l} = P^{(l)}_{03} P^{(k)}_{21}\) is undetectable. If \(P_{k,l}\) is undetectable, \(\langle\psi_{k,l}| \Pi_C |\psi_{k,l}\rangle = \langle\Psi|P_{k,l}^\dagger \Pi_C P_{k,l}|\Psi\rangle = \langle\Psi|P_{k,l}^\dagger P_{k,l} \Pi_C|\Psi\rangle = \langle\Psi|\Pi_C|\Psi\rangle=1\).

\(P_{success}\) is the total probability of all undetectable error events. Since errors on the two CNOTs are independent and act on disjoint qubits, the total error \(P_{k,l}\) is undetectable if and only if both \(P^{(k)}_{21}\) and \(P^{(l)}_{03}\) are individually undetectable.

Let’s count the undetectable errors for each gate: * For \(CNOT_{21}\): An error \(P_{12}\) on qubits (1,2) is undetectable if it commutes with the restrictions of the stabilizers to these qubits, which are \(X_1X_2\) and \(Z_1Z_2\). The two-qubit Paulis commuting with both are \(\{I, X_1X_2, Z_1Z_2, Y_1Y_2\}\). There are 3 non-identity undetectable errors. * For \(CNOT_{03}\): An error \(P_{03}\) on qubits (0,3) is undetectable if it commutes with \(X_0X_3\) and \(Z_0Z_3\). These are \(\{I, X_0X_3, Z_0Z_3, Y_0Y_3\}\). There are also 3 non-identity undetectable errors.

The probability of an undetectable event at a single gate is:

\[ P_{\text{undetectable}} = P(\text{no error}) + P(\text{any of the 3 undetectable errors}) = (1-p) + 3 \times \frac{p}{15} = 1 - p + \frac{p}{5} = 1 - \frac{4p}{5} \]

The total success probability is the product of the probabilities for each gate:

\[ P_{success} = (P_{\text{undetectable at } CNOT_{21}}) \times (P_{\text{undetectable at } CNOT_{03}}) = \left(1 - \frac{4p}{5}\right)^2 \]

3. Final Calculation of Logical Fidelity

We have the physical fidelity from Subproblem 1:

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

And we have just calculated the success probability:

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

The reason \(F_{physical}\) and \(P_{success}\) are identical is that, for this specific problem, the set of undetectable errors happens to be the same as the set of errors that stabilize the ideal state \(|\Psi\rangle\). An error preserves the physical state (up to a phase) if it commutes with the state’s stabilizers, \(S_{|\Psi\rangle} = \langle XXXX, ZZZZ, IX_1X_2I, IZ_1Z_2I \rangle\). The conditions for an error on qubits (1,2) or (0,3) to commute with these generators are identical to the conditions for being undetectable.

Now, we compute the logical fidelity:

\[ F_{logical} = \frac{F_{physical}}{P_{success}} = \frac{(1 - 4p/5)^2}{(1 - 4p/5)^2} = 1 \]

This result indicates that for this specific state preparation circuit and code, any error that is not detected by the code does not corrupt the logical information of the prepared GHZ state. The undetectable errors are all equivalent to logical operators that stabilize the logical GHZ state.

Final Answer: The logical state fidelity is:

\[ F_{logical}(p) = 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
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