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)

Summary of Fidelity Calculation for a 4-Qubit State Preparation Circuit

Okay, here’s my thinking on this problem. I need to figure out the fidelity of a specific 4-qubit state after it’s been prepared by a quantum circuit, taking into account some two-qubit depolarizing errors.

First, I need to really understand the [[4,2,2]] code. It encodes 2 logical qubits into 4 physical qubits using stabilizers. The goal is to prepare a logical GHZ state, which means a specific combination of logical qubits.

Then, I have to break down the state preparation circuit: it’s a series of CNOTs and Hadamard gates applied in reverse. The tricky part is that each CNOT gate is followed by a depolarizing error. Hadamard gates are treated as ideal in this model, so no errors.

The main objective is to calculate the fidelity between the ideal, error-free state and the actual state with errors. Since I know the ideal state will be pure (error-free) and the noisy state will be mixed, I can use a standard fidelity formula that involves just taking an inner product.

Now, let’s start with finding the ideal state. I’m starting from the ground state |0000> and applying the circuit, step by step. I quickly derive the ideal final physical state: It turns out that by applying the circuit, the ideal, error-free final state is \(\frac{1}{2}(|0000\rangle + |1001\rangle + |0110\rangle + |1111\rangle)\). I then make sure that this state is indeed an encoded GHZ state. It satisfies the required stabilizer properties to belong to the codespace, namely \(S_1\) and \(S_2\), where \(S_1 = X_0 X_1 X_2 X_3\) and \(S_2 = Z_0 Z_1 Z_2 Z_3\). Next, I consider the logical operators \(X_A, X_B, Z_A, Z_B\). My initial idea was wrong, the state is NOT a simple eigenstate of the single-qubit Z and X logical operators as I defined. I am very curious about how to define the two logical qubits within the 4-qubit space. This makes me think. Based on the problem statement, I think the circuit DOES prepare the correct logical state, but I just have to reconcile it by using the right definitions of these logical qubits and their basis states within the 4-qubit physical space.

To calculate the fidelity, I start from the state \(|\psi_C\rangle\) that occurs after the hadamard gate \(H_0\). The fidelity is basically a sum of terms involving the error probability (\(p\)) and the overlap of Pauli operators with this state. The crucial insight is that due to the structure of the circuit and the code, some of the Pauli error operators will average to zero when taking their overlap. The calculations boil down to computing the overlaps with different Pauli operators and I can use the fact that the state can be factored to simplify the overlaps. After all the hard work I arrive to the final equation for the fidelity, which is of the form \(1 - A p + B p^2\). I compute the coefficients.

Finally, I got the equation for fidelity: \(1 - 1.6p + 0.64p^2\).

The problem asks for the physical state fidelity of the final 4-qubit state, given a state preparation circuit and an error model. The initial state is implicitly assumed to be \(|0000\rangle\).

1. Determine the ideal target physical state:

The circuit is \(U = (CNOT_{03}) (H_0) (CNOT_{21}) (H_2)\). The operations are applied right-to-left. Let the initial state be \(|\psi_0\rangle = |0000\rangle\).

  • Apply \(H_2\) to qubit 2:
\[ |\psi_1\rangle = (I_0 I_1 H_2 I_3) |0000\rangle = |00\rangle \left(\frac{|0\rangle+|1\rangle}{\sqrt{2}}\right) |0\rangle = \frac{1}{\sqrt{2}}(|0000\rangle + |0010\rangle) \]
  • Apply \(CNOT_{21}\) (control 2, target 1):
\[ |\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) \]
  • Apply \(H_0\) to qubit 0:
\[ |\psi_3\rangle = (H_0 I_1 I_2 I_3) |\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) \]
  • Apply \(CNOT_{03}\) (control 0, target 3):
\[ |\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) \]
This is the target ideal physical state. We verify it's a valid codeword (stabilized by $S_1=XXXX$ and $S_2=ZZZZ$) and has the properties of a logical GHZ state (e.g. $X_A X_B |\psi_{ideal}\rangle = |\psi_{ideal}\rangle$).

2. Analyze the error model and fidelity calculation:

Each \(CNOT_{ij}\) gate is followed by a two-qubit depolarizing error channel \(\mathcal{E}_{ij}(\rho) = (1-p)\rho + \frac{p}{15} \sum_{P_{ij} \neq I_i I_j} P_{ij} \rho P_{ij}\). Hadamard gates are assumed perfect. The circuit sequence of operations is: \(H_2 \to CNOT_{21} \to \mathcal{E}_{21} \to H_0 \to CNOT_{03} \to \mathcal{E}_{03}\). Let \(\rho_0 = |0000\rangle\langle0000|\). The state evolution is: \(\rho_1 = H_2 \rho_0 H_2^\dagger\) \(\rho_2^{pre-error} = CNOT_{21} \rho_1 CNOT_{21}^\dagger\) \(\rho_2 = \mathcal{E}_{21}(\rho_2^{pre-error}) = (1-p)\rho_2^{pre-error} + \frac{p}{15} \sum_{P_{21}} P_{21} \rho_2^{pre-error} P_{21}\) \(\rho_3 = H_0 \rho_2 H_0^\dagger\) \(\rho_4^{pre-error} = CNOT_{03} \rho_3 CNOT_{03}^\dagger\) \(\rho_f = \mathcal{E}_{03}(\rho_4^{pre-error}) = (1-p)\rho_4^{pre-error} + \frac{p}{15} \sum_{P_{03}} P_{03} \rho_4^{pre-error} P_{03}\)

The physical state fidelity is \(F = \langle\psi_{ideal}|\rho_f|\psi_{ideal}\rangle\). Substituting the expression for \(\rho_f\):

\[ F = (1-p)\langle\psi_{ideal}|\rho_4^{pre-error}|\psi_{ideal}\rangle + \frac{p}{15} \sum_{P_{03}} \langle\psi_{ideal}|P_{03} \rho_4^{pre-error} P_{03}|\psi_{ideal}\rangle \]

Let \(U_{circuit} = CNOT_{03} H_0 CNOT_{21} H_2\). Then \(|\psi_{ideal}\rangle = U_{circuit}|0000\rangle\). Let \(|\psi_C\rangle = H_0 CNOT_{21} H_2 |0000\rangle = |\psi_3\rangle\) from above. Then \(\rho_4^{pre-error} = CNOT_{03} \rho_3 CNOT_{03}^\dagger\). And \(|\psi_{ideal}\rangle = CNOT_{03} |\psi_C\rangle\). So \(\langle\psi_{ideal}|\rho_4^{pre-error}|\psi_{ideal}\rangle = \langle CNOT_{03}\psi_C| CNOT_{03} \rho_3 CNOT_{03}^\dagger |CNOT_{03}\psi_C\rangle = \langle\psi_C|\rho_3|\psi_C\rangle\). Also, \(\langle\psi_{ideal}|P_{03} \rho_4^{pre-error} P_{03}|\psi_{ideal}\rangle = \langle\psi_C| (CNOT_{03}^\dagger P_{03} CNOT_{03}) \rho_3 (CNOT_{03}^\dagger P_{03} CNOT_{03}) |\psi_C\rangle\). Let \(P'_{03} = CNOT_{03}^\dagger P_{03} CNOT_{03}\). This is just a different Pauli on qubits (0,3).

Now substitute \(\rho_3\): \(\rho_3 = H_0 \rho_2 H_0^\dagger = H_0 \left( (1-p)\rho_2^{pre-error} + \frac{p}{15} \sum_{P_{21}} P_{21} \rho_2^{pre-error} P_{21} \right) H_0^\dagger\). Since \(H_0\) acts on qubit 0 and \(P_{21}\) acts on qubits 1 and 2, they commute: \(H_0 P_{21} H_0^\dagger = P_{21}\). So \(\rho_3 = (1-p)H_0 \rho_2^{pre-error} H_0^\dagger + \frac{p}{15} \sum_{P_{21}} P_{21} H_0 \rho_2^{pre-error} H_0^\dagger P_{21}\). Let \(|\psi_C\rangle = H_0 \rho_2^{pre-error} H_0^\dagger = |\psi_3\rangle\langle\psi_3|\). \(\rho_3 = (1-p)|\psi_C\rangle\langle\psi_C| + \frac{p}{15} \sum_{P_{21}} P_{21} |\psi_C\rangle\langle\psi_C| P_{21}\).

Plugging this into the fidelity expression:

\[ F = (1-p) \left[ (1-p)\langle\psi_C|\psi_C\rangle\langle\psi_C|\psi_C\rangle + \frac{p}{15} \sum_{P_{21}} \langle\psi_C|P_{21}|\psi_C\rangle\langle\psi_C|P_{21}|\psi_C\rangle \right] \]
\[ + \frac{p}{15} \sum_{P'_{03}} \left[ (1-p)\langle\psi_C|P'_{03}|\psi_C\rangle\langle\psi_C|P'_{03}|\psi_C\rangle + \frac{p}{15} \sum_{P_{21}} \langle\psi_C|P'_{03}P_{21}|\psi_C\rangle\langle\psi_C|P'_{03}P_{21}|\psi_C\rangle \right] \]

This simplifies to:

\[ F = (1-p)^2 + (1-p)\frac{p}{15} \sum_{P_{21}} |\langle\psi_C|P_{21}|\psi_C\rangle|^2 + \frac{p}{15}(1-p) \sum_{P'_{03}} |\langle\psi_C|P'_{03}|\psi_C\rangle|^2 + \frac{p^2}{15^2} \sum_{P'_{03}, P_{21}} |\langle\psi_C|P'_{03}P_{21}|\psi_C\rangle|^2 \]

Let’s call the sums \(A_1, A_2, A_3\):

\[ F = (1-p)^2 + (1-p)\frac{p}{15} A_1 + \frac{p}{15}(1-p) A_2 + \frac{p^2}{15^2} A_3 \]

3. Calculate the expectation values for \(|\psi_C\rangle\):

The state is \(|\psi_C\rangle = \frac{1}{2}(|0000\rangle + |1000\rangle + |0110\rangle + |1110\rangle)\). This state can be factorized:

\[ |\psi_C\rangle = \frac{1}{\sqrt{2}}(|00\rangle_{03} + |10\rangle_{03}) \otimes \frac{1}{\sqrt{2}}(|00\rangle_{12} + |11\rangle_{12}) \]

Let \(|\phi_{03}\rangle = \frac{1}{\sqrt{2}}(|00\rangle_{03} + |10\rangle_{03})\) (on qubits 0 and 3) and \(|\phi_{12}\rangle = \frac{1}{\sqrt{2}}(|00\rangle_{12} + |11\rangle_{12})\) (on qubits 1 and 2). So \(|\psi_C\rangle = |\phi_{03}\rangle \otimes |\phi_{12}\rangle\).

  • Calculate \(A_1 = \sum_{P_{21}} |\langle\psi_C|P_{21}|\psi_C\rangle|^2\): \(P_{21}\) acts on qubits (1,2). So \(\langle\psi_C|P_{21}|\psi_C\rangle = \langle\phi_{03}|I|\phi_{03}\rangle \langle\phi_{12}|P_{21}|\phi_{12}\rangle = 1 \cdot \langle\phi_{12}|P_{21}|\phi_{12}\rangle\). We need to calculate \(\langle\phi_{12}|P_{21}|\phi_{12}\rangle\) for all 15 non-identity Paulis \(P_{21}\). For \(|\phi_{12}\rangle = \frac{1}{\sqrt{2}}(|00\rangle + |11\rangle)\):

    • \(P_{21} = X_1 X_2\): \(\langle\phi_{12}|X_1 X_2|\phi_{12}\rangle = 1\).
    • \(P_{21} = Y_1 Y_2\): \(\langle\phi_{12}|Y_1 Y_2|\phi_{12}\rangle = -1\).
    • \(P_{21} = Z_1 Z_2\): \(\langle\phi_{12}|Z_1 Z_2|\phi_{12}\rangle = 1\). For all other 12 two-qubit Paulis (\(I_1 X_2, I_1 Y_2, I_1 Z_2, X_1 I_2, X_1 Y_2, X_1 Z_2, Y_1 I_2, Y_1 X_2, Y_1 Z_2, Z_1 I_2, Z_1 X_2, Z_1 Y_2\)), the expectation value \(\langle\phi_{12}|P_{21}|\phi_{12}\rangle = 0\). Thus, \(A_1 = 1^2 + (-1)^2 + 1^2 + 12 \cdot 0^2 = 3\).
  • Calculate \(A_2 = \sum_{P'_{03}} |\langle\psi_C|P'_{03}|\psi_C\rangle|^2\): \(P'_{03} = CNOT_{03}^\dagger P_{03} CNOT_{03}\) acts on qubits (0,3). \(P'_{03}\) is one of the 15 non-identity Pauli operators on qubits 0 and 3. So \(\langle\psi_C|P'_{03}|\psi_C\rangle = \langle\phi_{03}|P'_{03}|\phi_{03}\rangle \langle\phi_{12}|I|\phi_{12}\rangle = \langle\phi_{03}|P'_{03}|\phi_{03}\rangle\). We need to calculate \(\langle\phi_{03}|P'_{03}|\phi_{03}\rangle\) for all 15 non-identity Paulis \(P'_{03}\). For \(|\phi_{03}\rangle = \frac{1}{\sqrt{2}}(|00\rangle + |10\rangle)\):

    • \(P'_{03} = I_0 Z_3\): \(\langle\phi_{03}|I_0 Z_3|\phi_{03}\rangle = 1\). (Since \(q_3\) is always 0)
    • \(P'_{03} = X_0 I_3\): \(\langle\phi_{03}|X_0 I_3|\phi_{03}\rangle = 1\).
    • \(P'_{03} = X_0 Z_3\): \(\langle\phi_{03}|X_0 Z_3|\phi_{03}\rangle = 1\). (Since \(q_3\) is always 0) For all other 12 two-qubit Paulis, the expectation value \(\langle\phi_{03}|P'_{03}|\phi_{03}\rangle = 0\). Thus, \(A_2 = 1^2 + 1^2 + 1^2 + 12 \cdot 0^2 = 3\).
  • Calculate \(A_3 = \sum_{P'_{03}, P_{21}} |\langle\psi_C|P'_{03}P_{21}|\psi_C\rangle|^2\): Since \(P'_{03}\) acts on (0,3) and \(P_{21}\) acts on (1,2), they commute. \(\langle\psi_C|P'_{03}P_{21}|\psi_C\rangle = \langle\phi_{03}|P'_{03}|\phi_{03}\rangle \langle\phi_{12}|P_{21}|\phi_{12}\rangle\).

\[ A_3 = \sum_{P'_{03}} \sum_{P_{21}} |\langle\phi_{03}|P'_{03}|\phi_{03}\rangle|^2 |\langle\phi_{12}|P_{21}|\phi_{12}\rangle|^2 \]
This sum is non-zero only when both factors are non-zero.
The first factor is non-zero for 3 Paulis (value 1).
The second factor is non-zero for 3 Paulis (value 1).
So $A_3 = (3 \cdot 1^2) \cdot (3 \cdot 1^2) = 9$.

4. Combine results for the final fidelity:

Substitute \(A_1=3, A_2=3, A_3=9\) into the fidelity formula:

\[ F = (1-p)^2 + (1-p)\frac{p}{15}(3) + \frac{p}{15}(1-p)(3) + \frac{p^2}{15^2}(9) \]
\[ F = (1-p)^2 + \frac{6p(1-p)}{15} + \frac{9p^2}{225} \]
\[ F = (1-p)^2 + \frac{2p(1-p)}{5} + \frac{p^2}{25} \]

Expand the terms:

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

Collect terms by powers of \(p\):

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

As a decimal:

\[ F = 1 - 1.6p + 0.64p^2 \]

The final answer is \(\boxed{1 - 1.6p + 0.64p^2}\)

User #3

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

Now let’s solve the next Checkpoint.

Checkpoint 2

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

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

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

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

Assistant #4
Reasoning (model)

Analyzing Logical State Fidelity with Post-Selection

Okay, so I got tripped up initially, but my physical fidelity calculation in Subproblem 1 was, in fact, spot-on. I was just thrown off by the way the “Correct Answer” was presented. Now, on to Subproblem 2!

My objective is to determine the logical state fidelity, assuming we post-select on detectable errors. This means discarding any states where an error was detected, effectively measuring the stabilizers and projecting onto the codespace.

First, I recall that the logical target state is a GHZ state, which is encoded in the [[4,2,2]] code. In Subproblem 1, I had already calculated the ideal physical state. This is key because now, post-selection implies I only want the part of the noisy, final state that remains within the valid code space after the measurement.

My core strategy is as follows: The logical fidelity is the probability of having both no detected error AND having the correct logical state. To get this, I will divide the probability of having the correct logical state and no detected errors by the probability of having no detected errors, which is the trace of the noisy, projected state. The numerator is the product of the ideal state and the final, noisy state, and the denominator is the sum of the noisy state after projection. This is equivalent to summing over all the possible error scenarios, and filtering for just those that did not violate the stabilizers.

I know from Subproblem 1 how the state evolves under these noisy gates, and I know how to represent my final noisy state, \(\rho_f\), in terms of Pauli operators that describe error possibilities.

Now, my task is to calculate the probability of no detectable error. An error is detectable if it breaks the stabilizer conditions. To solve this, I need to know which combinations of Pauli errors commute with the stabilizer operators. The set of all commuting errors is known to be \(N(S)\), the normalizer group.

I work out that the effective error acting on the ideal state will, ultimately, come down to a combination of two Pauli operators \(P_1\) and \(P_2\), that represent noise from the circuit, for example noise after a CNOT or after a Hadamard. In order for \(P_{success}\), for the probability of no detectable errors, to be non-zero, the total error \(P_1P_2\) must commute with the stabilizers. The combinations of Pauli errors \(P_1\) and \(P_2\) that commute and, therefore, do not lead to a detected error, are the errors in the normalizer group \(N(S)\). To find the probability, \(P_{success}\), I sum over just those terms that commute with the stabilizers, which form 64 valid combinations.

Now I need to calculate, the fidelity with post selection, \(F_L\). The numerator is equal to the fidelity, \(F\) that I found in Subproblem 1, the probability of obtaining the correct state without detecting an error. The denominator, \(P_{success}\), is the probability of measuring no detected errors. The numerator is found to be: \(F = 1 - \frac{8}{5}p + \frac{16}{25}p^2\) The denominator is: \(P_{success} = 1 - \frac{8}{5}p + \frac{64}{75}p^2\). So, dividing the numerator and denominator, \(F_L = \frac{1 - \frac{8}{5}p + \frac{16}{25}p^2}{1 - \frac{8}{5}p + \frac{64}{75}p^2}\).

This is the final expression for the logical fidelity. I verified that this function gives expected results for \(p=0\) and small \(p\).

This seems correct. And with that, I believe I have successfully tackled this section!

To determine the logical state fidelity with post-selection, we need to calculate:

\[ F_L = \frac{\langle\psi_{ideal}|\rho_f|\psi_{ideal}\rangle}{\text{Tr}(P_S \rho_f P_S)} \]

where \(|\psi_{ideal}\rangle\) is the ideal target physical state, \(\rho_f\) is the final noisy physical state, and \(P_S\) is the projector onto the codespace.

1. Numerator: Physical State Fidelity (\(F\))

The numerator \(\langle\psi_{ideal}|\rho_f|\psi_{ideal}\rangle\) is precisely the physical state fidelity calculated in Subproblem 1. From Subproblem 1, the physical fidelity is:

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

2. Denominator: Probability of No Detectable Error (\(P_{success}\))

The denominator \(\text{Tr}(P_S \rho_f P_S)\) is the probability that the final state \(\rho_f\) lies within the codespace (i.e., no error is detected). An error \(E\) is undetectable (i.e., it maps a codeword to another codeword, or \(E|\psi_{ideal}\rangle\) remains in the codespace) if and only if \(E\) commutes with all stabilizers of the code. The set of all Pauli operators that commute with the stabilizer group \(S\) is called the normalizer \(N(S)\).

As established in the thought process for Subproblem 1, the state evolution can be considered as the ideal state \(|\psi_{ideal}\rangle\) acted upon by an effective Pauli error \(E_{eff} = P_2 P_1\), where \(P_1\) is a Pauli error on qubits (1,2) and \(P_2\) is a Pauli error on qubits (0,3). The final noisy state \(\rho_f\) is a mixture of states \(E_{eff}|\psi_{ideal}\rangle\langle\psi_{ideal}|E_{eff}^\dagger\), with coefficients \(c(P_1,P_2)\):

\[ \rho_f = \sum_{P_1 \in \mathcal{P}_{12}} \sum_{P_2 \in \mathcal{P}_{03}} c(P_1,P_2) (P_2 P_1) |\psi_{ideal}\rangle\langle\psi_{ideal}| (P_2 P_1)^\dagger \]

where \(c(I,I) = (1-p)^2\), \(c(P_1,I) = \frac{p}{15}(1-p)\) for \(P_1 \ne I\), \(c(I,P_2) = \frac{p}{15}(1-p)\) for \(P_2 \ne I\), and \(c(P_1,P_2) = \frac{p^2}{15^2}\) for \(P_1 \ne I, P_2 \ne I\).

The probability of no detectable error is the sum of coefficients \(c(P_1,P_2)\) for all effective errors \(E_{eff} = P_2 P_1\) that belong to the normalizer \(N(S)\). The [[4,2,2]] code has \(n=4\) physical qubits and \(k=2\) logical qubits. The size of the normalizer group \(N(S)\) for a CSS code is \(2^{n+k}\). For this code, it is \(2^{4+2} = 2^6 = 64\). Since any 4-qubit Pauli operator \(E_{eff}\) can be uniquely expressed as \(P_2 P_1\) (where \(P_1\) acts on \(q_1,q_2\) and \(P_2\) acts on \(q_0,q_3\)), we simply need to count how many of the \(4^4=256\) total Pauli operators are in \(N(S)\) and sum their corresponding probabilities.

Let’s categorize the \(N_C=64\) operators in \(N(S)\): * Case 1: \(P_1=I, P_2=I\) (Identity error) This is \(E_{eff} = I\). \(I \in N(S)\). There is 1 such term. Contribution to \(P_{success}\): \(1 \cdot c(I,I) = (1-p)^2\).

  • Case 2: \(P_1 \ne I, P_2=I\) (Error only on qubits 1,2) Here \(E_{eff} = P_1\). We need \(P_1 \in N(S)\). \(P_1\) acts on qubits (1,2). The stabilizers are \(S_1 = X_0X_1X_2X_3\) and \(S_2 = Z_0Z_1Z_2Z_3\). For \(P_1\) to commute with \(S_1\), the number of qubits where \(P_1\) has \(Y\) or \(Z\) and \(S_1\) has \(X\) must be even. For \(P_1\) (on \(q_1,q_2\)) \(P_{11}P_{12}\), this means \(\delta(P_{11},X_1) + \delta(P_{12},X_2)\) must be even. For \(P_1\) to commute with \(S_2\), \(\delta(P_{11},Z_1) + \delta(P_{12},Z_2)\) must be even. As derived in the scratchpad, there are 4 such Pauli operators on \((q_1,q_2)\): \(\{I_1I_2, X_1X_2, Y_1Y_2, Z_1Z_2\}\). Since \(P_1 \ne I\), there are \(4-1=3\) such terms. Contribution to \(P_{success}\): \(3 \cdot c(P_1,I) = 3 \cdot \frac{p(1-p)}{15}\).

  • Case 3: \(P_1 = I, P_2 \ne I\) (Error only on qubits 0,3) Here \(E_{eff} = P_2\). We need \(P_2 \in N(S)\). This calculation is analogous to Case 2. There are 4 such Pauli operators on \((q_0,q_3)\): \(\{I_0I_3, X_0X_3, Y_0Y_3, Z_0Z_3\}\). Since \(P_2 \ne I\), there are \(4-1=3\) such terms. Contribution to \(P_{success}\): \(3 \cdot c(I,P_2) = 3 \cdot \frac{p(1-p)}{15}\).

  • Case 4: \(P_1 \ne I, P_2 \ne I\) (Errors on both sets of qubits) The total number of operators in \(N(S)\) is 64. The number of operators in Case 1 is 1. The number of operators in Case 2 (excluding \(I\)) is 3. The number of operators in Case 3 (excluding \(I\)) is 3. So, the number of operators where both \(P_1 \ne I\) and \(P_2 \ne I\) that result in \(E_{eff} \in N(S)\) is \(64 - 1 - 3 - 3 = 57\). Contribution to \(P_{success}\): \(57 \cdot c(P_1,P_2) = 57 \cdot \frac{p^2}{15^2}\).

Summing these contributions for \(P_{success}\):

\[ P_{success} = (1-p)^2 + 3 \cdot \frac{p(1-p)}{15} + 3 \cdot \frac{p(1-p)}{15} + 57 \cdot \frac{p^2}{15^2} \]
\[ P_{success} = (1-p)^2 + \frac{6p(1-p)}{15} + \frac{57p^2}{225} \]
\[ P_{success} = (1-2p+p^2) + \left(\frac{2p}{5} - \frac{2p^2}{5}\right) + \frac{57p^2}{225} \]
\[ P_{success} = 1 - \left(2 - \frac{2}{5}\right)p + \left(1 - \frac{2}{5} + \frac{57}{225}\right)p^2 \]
\[ P_{success} = 1 - \frac{8}{5}p + \left(\frac{225 - 90 + 57}{225}\right)p^2 \]
\[ P_{success} = 1 - \frac{8}{5}p + \frac{192}{225}p^2 \]

Simplifying the fraction \(\frac{192}{225}\): divide by 3: \(\frac{64}{75}\).

\[ P_{success} = 1 - \frac{8}{5}p + \frac{64}{75}p^2 \]

3. Logical State Fidelity (\(F_L\))

Now, divide the numerator \(F\) by the denominator \(P_{success}\):

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

The final answer is \(\boxed{\frac{1 - \frac{8}{5}p + \frac{16}{25}p^2}{1 - \frac{8}{5}p + \frac{64}{75}p^2}}\)

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 = (1 - (8/5)*p + (16/25)*p**2) / (1 - (8/5)*p + (64/75)*p**2)
    # ---------------------------------------------------------------

    return F_logical