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

Here is a step-by-step derivation to find the physical state fidelity.

Step 1: Determine the Ideal Final State

The ideal final state, denoted \(|\Psi_{ideal}\rangle\), is obtained by applying the specified sequence of gates to the initial state \(|0000\rangle\). The circuit is \(U = (CNOT_{03}) (H_0) (CNOT_{21}) (H_2)\). The gates are applied from right to left.

  1. Initial State: The system starts in the all-zeros state:
\[ |\psi_0\rangle = |0000\rangle \]
  1. Apply \(H_2\): A Hadamard gate is applied to qubit 2.
\[ |\psi_1\rangle = H_2 |\psi_0\rangle = |0\rangle_0 |0\rangle_1 \left( \frac{|0\rangle_2 + |1\rangle_2}{\sqrt{2}} \right) |0\rangle_3 = \frac{1}{\sqrt{2}} (|0000\rangle + |0010\rangle) \]
  1. Apply \(CNOT_{21}\): A CNOT gate with control qubit 2 and target qubit 1 is applied.
\[ |\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\): A Hadamard gate is applied to 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}\): A CNOT gate with control qubit 0 and target qubit 3 is applied.
\[ |\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 pure state produced by the error-free circuit. Let \(\rho_{ideal} = |\Psi_{ideal}\rangle\langle\Psi_{ideal}|\).

Step 2: Model the Noisy Circuit

The circuit consists of four operations, two of which (\(CNOT_{21}\) and \(CNOT_{03}\)) are noisy. The single-qubit Hadamard gates are assumed to be perfect. Let \(U_{H2}, U_{C21}, U_{H0}, U_{C03}\) be the unitary operators for the gates. The error model states that each CNOT is followed by a two-qubit depolarizing channel \(\mathcal{E}\). The channel for a CNOT acting on qubits \(i, j\) is given by:

\[ \mathcal{E}_{ij}(\rho) = (1-p) \rho + \frac{p}{15} \sum_{P \in \{I,X,Y,Z\}^{\otimes 2} \setminus \{II\}} P_{ij} \rho P_{ij}^\dagger \]

The state at the output of the noisy circuit, \(\rho_{actual}\), is:

\[ \rho_{actual} = \mathcal{E}_{03}(U_{C03} U_{H0} \mathcal{E}_{21}(U_{C21} U_{H2} |0000\rangle\langle0000| U_{H2}^\dagger U_{C21}^\dagger) U_{H0}^\dagger U_{C03}^\dagger) \]

Recognizing the intermediate ideal states: \(|0000\rangle\langle0000| = |\psi_0\rangle\langle\psi_0|\), \(U_{H2}|\psi_0\rangle = |\psi_1\rangle\), and \(U_{C21}|\psi_1\rangle = |\psi_2\rangle\). So, \(U_{C21} U_{H2} |0000\rangle\langle0000| U_{H2}^\dagger U_{C21}^\dagger = |\psi_2\rangle\langle\psi_2|\). Let \(\rho_2 = |\psi_2\rangle\langle\psi_2|\). The expression becomes:

\[ \rho_{actual} = \mathcal{E}_{03}(U_{C03} U_{H0} \mathcal{E}_{21}(\rho_2) U_{H0}^\dagger U_{C03}^\dagger) \]

Step 3: Calculate the Physical Fidelity

The physical state fidelity is given by \(F = \langle\Psi_{ideal}|\rho_{actual}|\Psi_{ideal}\rangle = \text{Tr}(\rho_{ideal} \rho_{actual})\).

We can simplify the fidelity calculation by using the adjoint property of quantum channels and the covariance of the depolarizing channel. For a unitary \(U\) acting on the same qubits as the depolarizing channel \(\mathcal{E}\), we have \(\mathcal{E}(U\rho U^\dagger) = U\mathcal{E}(\rho)U^\dagger\). Also, the trace is cyclic, and \(\mathcal{E}\) is self-adjoint. Let \(\mathcal{U}_{final}(\cdot) = U_{C03} U_{H0} (\cdot) U_{H0}^\dagger U_{C03}^\dagger\). Then \(\rho_{ideal} = \mathcal{U}_{final}(\rho_2)\) and \(\rho_{actual} = \mathcal{E}_{03}(\mathcal{U}_{final}(\mathcal{E}_{21}(\rho_2)))\). Since the unitaries \(U_{C03}\) and \(U_{H0}\) act on qubits (0,3), they commute with the channel \(\mathcal{E}_{21}\) which acts on (2,1). The channel \(\mathcal{E}_{03}\) is covariant with respect to unitaries on qubits (0,3).

\[ F = \text{Tr}(\mathcal{U}_{final}(\rho_2) \mathcal{E}_{03}(\mathcal{U}_{final}(\mathcal{E}_{21}(\rho_2)))) = \text{Tr}(\mathcal{U}_{final}(\rho_2) \mathcal{U}_{final}(\mathcal{E}_{03}(\mathcal{E}_{21}(\rho_2)))) \]
\[ F = \text{Tr}(\rho_2 \mathcal{E}_{03}(\mathcal{E}_{21}(\rho_2))) \]

Since the channels \(\mathcal{E}_{03}\) and \(\mathcal{E}_{21}\) act on disjoint sets of qubits, they commute: \(\mathcal{E}_{03} \circ \mathcal{E}_{21} = \mathcal{E}_{21} \circ \mathcal{E}_{03}\).

\[ F = \text{Tr}(\rho_2 \mathcal{E}_{21}(\mathcal{E}_{03}(\rho_2))) = \langle\psi_2| \mathcal{E}_{21}(\mathcal{E}_{03}(|\psi_2\rangle\langle\psi_2|)) |\psi_2\rangle \]

This calculation reveals that the total fidelity is the fidelity of the intermediate state \(|\psi_2\rangle\) after passing through the two error channels.

The state \(|\psi_2\rangle = \frac{1}{\sqrt{2}}(|0000\rangle + |0110\rangle)\) can be written as a product state between the qubit pairs (0,3) and (1,2):

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

Let \(|\phi_{03}\rangle = |00\rangle_{03}\) and \(|\phi_{12}\rangle = \frac{1}{\sqrt{2}}(|00\rangle_{12} + |11\rangle_{12})\). So \(|\psi_2\rangle=|\phi_{03}\rangle \otimes |\phi_{12}\rangle\).

The fidelity can be written as:

\[ F = \text{Tr}((|\phi_{03}\rangle\langle\phi_{03}| \otimes |\phi_{12}\rangle\langle\phi_{12}|) \cdot (\mathcal{E}_{03}(|\phi_{03}\rangle\langle\phi_{03}|) \otimes \mathcal{E}_{21}(|\phi_{12}\rangle\langle\phi_{12}|))) \]
\[ F = \text{Tr}(|\phi_{03}\rangle\langle\phi_{03}|\mathcal{E}_{03}(|\phi_{03}\rangle\langle\phi_{03}|)) \cdot \text{Tr}(|\phi_{12}\rangle\langle\phi_{12}|\mathcal{E}_{21}(|\phi_{12}\rangle\langle\phi_{12}|)) \]

This shows the total fidelity is the product of the fidelities for each subsystem. Let’s calculate them individually.

Fidelity for subsystem (0,3): Let \(F_{03} = \langle\phi_{03}|\mathcal{E}_{03}(|\phi_{03}\rangle\langle\phi_{03}|)|\phi_{03}\rangle\).

\[ F_{03} = (1-p) + \frac{p}{15} \sum_{P_{03} \neq II} |\langle\phi_{03}|P_{03}|\phi_{03}\rangle|^2 \]

We need the expectation values of the 15 two-qubit Pauli operators for the state \(|\phi_{03}\rangle=|00\rangle_{03}\). The only non-zero expectation values are for Paulis that are diagonal in the computational basis and do not flip the \(|00\rangle\) state. - \(\langle 00|Z_0I_3|00\rangle = \langle 0|Z|0\rangle\langle 0|I|0\rangle = 1\) - \(\langle 00|I_0Z_3|00\rangle = \langle 0|I|0\rangle\langle 0|Z|0\rangle = 1\) - \(\langle 00|Z_0Z_3|00\rangle = \langle 0|Z|0\rangle\langle 0|Z|0\rangle = 1\) All other 12 expectation values are zero. The sum of squares is \(1^2 + 1^2 + 1^2 = 3\).

\[ F_{03} = 1-p + \frac{p}{15}(3) = 1 - p + \frac{p}{5} = 1 - \frac{4}{5}p \]

Fidelity for subsystem (1,2): Let \(F_{12} = \langle\phi_{12}|\mathcal{E}_{21}(|\phi_{12}\rangle\langle\phi_{12}|)|\phi_{12}\rangle\).

\[ F_{12} = (1-p) + \frac{p}{15} \sum_{Q_{12} \neq II} |\langle\phi_{12}|Q_{12}|\phi_{12}\rangle|^2 \]

We need expectation values for the state \(|\phi_{12}\rangle = \frac{1}{\sqrt{2}}(|00\rangle_{12} + |11\rangle_{12})\). This is a Bell state, which is stabilized by \(X_1X_2\) and \(Z_1Z_2\). - \(\langle\phi_{12}|X_1X_2|\phi_{12}\rangle = 1\) - \(\langle\phi_{12}|Z_1Z_2|\phi_{12}\rangle = 1\) - \(\langle\phi_{12}|Y_1Y_2|\phi_{12}\rangle = \langle\phi_{12}|(-iZ_1X_1)(-iZ_2X_2)|\phi_{12}\rangle = -\langle\phi_{12}|Z_1Z_2X_1X_2|\phi_{12}\rangle = -1\) All other 12 expectation values are zero. The sum of squares is \(1^2 + 1^2 + (-1)^2 = 3\).

\[ F_{12} = 1-p + \frac{p}{15}(3) = 1 - p + \frac{p}{5} = 1 - \frac{4}{5}p \]

Total Fidelity: The total physical state fidelity is the product of the individual fidelities:

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

Final Answer: The physical state fidelity of the final 4-qubit state as a function of the two-qubit gate error rate \(p\) is \(F(p) = (1 - \frac{4}{5}p)^2 = 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)

Subproblem 2: A Deep Dive into Logical Fidelity

Here’s how I’d approach this problem, leveraging my understanding of quantum error correction. First, my focus would be on logical fidelity, a measure I’m well acquainted with, not the physical fidelity we dealt with in the previous subproblem. The initial setup is familiar: a [[4,2,2]] code that encodes two logical qubits into four physical ones. I’d quickly confirm the validity of the provided stabilizers (\(S_1 = XXXX\), \(S_2 = ZZZZ\)) and logical operators (\(X_A = XIXI, X_B = XXII, Z_A = ZZII, Z_B = ZIZI\)), checking for any inconsistencies, though they appear plausible at first glance. Given the distance of the code, d=2, I’m reminded it can detect single-qubit errors but not correct them. This is an error-detecting, not error-correcting, code.

The crux of this subproblem is the post-selection on detectable errors. “Post-selection” means that at the end of the circuit, you’re measuring the stabilizers. If any stabilizer measurement yields -1 (indicating an error), that run is discarded. This process is equivalent to projecting the final state onto the codespace. The codespace, I remember, is defined as the space where all stabilizers equal +1. A crucial fact in the calculations.

To truly grasp what post-selection means in this context, I’d first define “detectable” and “undetectable” errors. An error is detectable if it anticommutes with at least one stabilizer and moves the state outside the code space. An error is undetectable if it commutes with all stabilizers and thus leaves the state inside the codespace. The post-selected state is essentially the actual state projected onto the codespace.

The logical fidelity is the fidelity of the post-selected state. Given our familiarity with the ideal logical state, \(|\Psi_{logical}\rangle = (|00\rangle + |11\rangle)/\sqrt{2}\), I need to find its physical encoding. The ideal physical state for the logical state must lie in the code space, and therefore needs to be defined in terms of the stabilizers.

I would move to determine the ideal logical basis states to understand how post-selection influences the problem and how the logical state maps to the physical one. From here, finding how a logical basis, such as logical zero, maps to the physical space using my knowledge of stabilizers and projectors. Finding the logical basis from the state \(|00\rangle_{L} = \frac{1}{\sqrt{2}}(|0000\rangle + |1111\rangle)\) and using the provided logical operators \(X_A\) and \(X_B\) on the physical states. The logical \(|11\rangle\) operator presents a tricky scenario. Upon inspection, I notice the commutator of the given logical operators do not behave as they should, i.e., \(\{X_A, Z_A\}=0\). This means there might be an issue with how the problem is defined. The fact that the logical operators commute makes me go back and re-read the problem statement for further insight. I would recheck my definition of the logical basis and verify that it’s consistent with the code and stabilizers, and determine if my operators are valid. I would have to make sure they are valid within the constraints of the definition, as given in the problem statement, which says “up to multiplication by stabilizers”. Once I verify the definitions are within the parameters of the problem, I will find a logical basis to compare to the ideal state.

I’d need to calculate the success probability, meaning the probability of the state remaining in the codespace after the error-prone circuit. This is where I’d start breaking down the problem into individual error scenarios. Here, I’m going to leverage my understanding of the state evolution through the noisy channel. Starting from the initial state, \(|\rho_{0}\rangle\), I’d have to use the given circuit with the depolarizing errors on each of the CNOT operations, tracing the evolution of each of the physical qubits through the noisy operations. For the first CNOT operation, I would calculate the state after Hadamard, followed by the noisy operation and again after the second CNOT. Finally, I would have to use post-selection, thus, I would apply the projector operator to determine if the state lies in the code space.

I’d then focus on the errors themselves. The circuit has two places where errors can happen, after each CNOT. To calculate the final probabilities, I would consider the cases: no errors, error after the first CNOT, error after the second CNOT, and errors after both CNOT operations. The effective error operator is simply a tensor product of Pauli operators and should be classified as detectable

Step 1: Define Logical State Fidelity with Post-selection

The logical state fidelity, \(F_L\), is the fidelity of the actual final state with the ideal logical state, conditioned on the state being in the correct codespace. The process of “post-selecting on all detectable errors” means we project the final state onto the codespace and re-normalize.

Let \(\rho_{actual}\) be the final density matrix of the 4-qubit system at the end of the noisy circuit. The codespace is the subspace stabilized by \(S_1 = XXXX\) and \(S_2 = ZZZZ\). The projector onto this codespace is \(P_{code} = \frac{1}{4}(I+S_1)(I+S_2)\).

The post-selected state is:

\[ \rho_{ps} = \frac{P_{code} \rho_{actual} P_{code}}{\text{Tr}(P_{code} \rho_{actual})} \]

The denominator, \(P_{success} = \text{Tr}(P_{code} \rho_{actual})\), is the probability that the state is found in the codespace upon measurement of the stabilizers (the success probability of error detection).

The ideal final state, derived in Subproblem 1, is \(|\Psi_{ideal}\rangle = \frac{1}{2} (|0000\rangle + |1001\rangle + |0110\rangle + |1111\rangle)\). We must first verify this state is in the codespace.

\[ S_1 |\Psi_{ideal}\rangle = XXXX \frac{1}{2} (|0000\rangle + |1001\rangle + |0110\rangle + |1111\rangle) = \frac{1}{2} (|1111\rangle + |0110\rangle + |1001\rangle + |0000\rangle) = |\Psi_{ideal}\rangle \]
\[ S_2 |\Psi_{ideal}\rangle = ZZZZ \frac{1}{2} (|0000\rangle + |1001\rangle + |0110\rangle + |1111\rangle) = \frac{1}{2} (|0000\rangle + |1001\rangle + |0110\rangle + |1111\rangle) = |\Psi_{ideal}\rangle \]

Since \(|\Psi_{ideal}\rangle\) is in the codespace, \(P_{code}|\Psi_{ideal}\rangle = |\Psi_{ideal}\rangle\).

The logical fidelity is the fidelity of the post-selected state with the ideal state:

\[ F_L = \langle\Psi_{ideal}| \rho_{ps} |\Psi_{ideal}\rangle = \frac{\langle\Psi_{ideal}| P_{code} \rho_{actual} P_{code} |\Psi_{ideal}\rangle}{P_{success}} \]

Using \(P_{code}|\Psi_{ideal}\rangle = |\Psi_{ideal}\rangle\), this simplifies to:

\[ F_L = \frac{\langle\Psi_{ideal}| \rho_{actual} |\Psi_{ideal}\rangle}{P_{success}} = \frac{F_{phys}}{P_{success}} \]

From Subproblem 1, we know the physical fidelity is \(F_{phys}(p) = (1 - \frac{4}{5}p)^2\). We now need to calculate the success probability \(P_{success}\).

Step 2: Model the Error Process and Find Effective Error Operators

The circuit has two noisy CNOT gates. Let’s trace the effect of errors. The ideal state is \(|\Psi_{ideal}\rangle = U |\vec{0}\rangle\), where \(U = U_{C03}U_{H0}U_{C21}U_{H2}\). The noisy circuit applies depolarizing channels \(\mathcal{E}_{21}\) and \(\mathcal{E}_{03}\) after \(U_{C21}\) and \(U_{C03}\) respectively. Let \(U_{early} = U_{C21}U_{H2}\) and \(U_{late} = U_{C03}U_{H0}\). The actual state is:

\[ \rho_{actual} = \mathcal{E}_{03}(U_{late} \mathcal{E}_{21}(U_{early} |0\rangle\langle0|^{\otimes 4} U_{early}^\dagger) U_{late}^\dagger) \]

The output state is a mixture of states resulting from Pauli errors occurring at each CNOT gate. An error \(P_{12}\) on qubits (1,2) can occur after \(U_{early}\), and an error \(Q_{03}\) on qubits (0,3) can occur after \(U_{late}\). The state after the first error is \(U_{late} P_{12} U_{early} |\vec{0}\rangle\). The second error \(Q_{03}\) is applied after this. The total effective error operator acting on the ideal state \(|\Psi_{ideal}\rangle\) is \(E_{P,Q} = Q_{03} (U_{late} P_{12} U_{late}^\dagger)\).

Let’s simplify the conjugated operator \(U_{late} P_{12} U_{late}^\dagger = (U_{C03}U_{H0}) P_{12} (U_{H0}^\dagger U_{C03}^\dagger)\). Since \(U_{H0}\) acts on qubit 0 and \(P_{12}\) acts on qubits (1,2), they commute: \(U_{H0} P_{12} U_{H0}^\dagger = P_{12}\). Similarly, \(U_{C03}\) acts on qubits (0,3) and \(P_{12}\) acts on qubits (1,2), so they commute: \(U_{C03} P_{12} U_{C03}^\dagger = P_{12}\). Thus, the effective error operator is simply \(E_{P,Q} = Q_{03} P_{12}\). This is a Pauli operator that is a tensor product of a Pauli on (0,3) and a Pauli on (1,2).

Step 3: Characterize Detectable and Undetectable Errors

An error \(E\) is detectable if it anticommutes with at least one stabilizer. It is undetectable if it commutes with all stabilizers.

\[ [E, S_1] = [E, XXXX] = 0 \]
\[ [E, S_2] = [E, ZZZZ] = 0 \]

Let \(E = P_0P_1P_2P_3\) be a 4-qubit Pauli string. - \([E, XXXX]=0\) if \(E\) has an even number of Paulis from \(\{Y, Z\}\) (i.e., Paulis that anticommute with \(X\)). Let \(w_Z(E)\) be this number. So, \(w_Z(E)\) must be even. - \([E, ZZZZ]=0\) if \(E\) has an even number of Paulis from \(\{X, Y\}\) (i.e., Paulis that anticommute with \(Z\)). Let \(w_X(E)\) be this number. So, \(w_X(E)\) must be even.

For our effective error \(E = Q_{03}P_{12}\), the weights are additive: \(w_Z(E) = w_Z(Q_{03}) + w_Z(P_{12})\) and \(w_X(E) = w_X(Q_{03}) + w_X(P_{12})\). So, an error \((Q_{03}, P_{12})\) is undetectable if and only if:

  1. \(w_Z(Q_{03}) + w_Z(P_{12})\) is even \(\iff w_Z(Q_{03}) \equiv w_Z(P_{12}) \pmod 2\).
  2. \(w_X(Q_{03}) + w_X(P_{12})\) is even \(\iff w_X(Q_{03}) \equiv w_X(P_{12}) \pmod 2\). The condition is that \(Q_{03}\) and \(P_{12}\) must have the same weight parity pair \((w_X \pmod 2, w_Z \pmod 2)\).

Let’s classify the 16 two-qubit Pauli operators based on their weight parity: - Parity (0,0) (\(w_X\) even, \(w_Z\) even): \(\{II, XX, ZZ, YY\}\). There are 4 such operators. - Parity (0,1) (\(w_X\) even, \(w_Z\) odd): \(\{IZ, ZI, XY, YX\}\). There are 4 such operators. - Parity (1,0) (\(w_X\) odd, \(w_Z\) even): \(\{IX, XI, ZY, YZ\}\). There are 4 such operators. - Parity (1,1) (\(w_X\) odd, \(w_Z\) odd): \(\{IY, YI, XZ, ZX\}\). There are 4 such operators.

Step 4: Calculate the Success Probability \(P_{success}\)

The success probability is the total probability of all undetectable error events. An error event is defined by the pair of Paulis \((P_{12}, Q_{03})\).

\[ P_{success} = \sum_{P_{12}, Q_{03}} \text{Prob}(P_{12}, Q_{03}) \cdot \mathbb{I}[(P_{12}, Q_{03}) \text{ is undetectable}] \]

where \(\mathbb{I}\) is the indicator function. The probability of a specific pair of non-identity errors is \((p/15)^2\), a single error is \(p(1-p)/15\), and no error is \((1-p)^2\).

We sum over four cases:

  1. No error: \(P_{12}=II, Q_{03}=II\). Parity of both is (0,0), so they match. Undetectable. Probability: \((1-p)^2\).
  2. Error at first CNOT only: \(P_{12} \neq II, Q_{03}=II\). Parity of \(Q_{03}=II\) is (0,0). For the error to be undetectable, \(P_{12}\) must also have parity (0,0). There are 3 such non-identity operators: \(\{XX, ZZ, YY\}\) on qubits (1,2). Probability: \(3 \times \frac{p(1-p)}{15} = \frac{p(1-p)}{5}\).
  3. Error at second CNOT only: \(P_{12} = II, Q_{03} \neq II\). Similar to case 2, there are 3 undetectable non-identity errors for \(Q_{03}\). Probability: \(3 \times \frac{p(1-p)}{15} = \frac{p(1-p)}{5}\).
  4. Errors at both CNOTs: \(P_{12} \neq II, Q_{03} \neq II\). The error is undetectable if \(P_{12}\) and \(Q_{03}\) have the same weight parity.
    • Parity (0,0): 3 choices for \(P_{12}\), 3 for \(Q_{03}\). Total \(3 \times 3 = 9\) pairs.
    • Parity (0,1): 4 choices for \(P_{12}\), 4 for \(Q_{03}\). Total \(4 \times 4 = 16\) pairs.
    • Parity (1,0): 4 choices for \(P_{12}\), 4 for \(Q_{03}\). Total \(4 \times 4 = 16\) pairs.
    • Parity (1,1): 4 choices for \(P_{12}\), 4 for \(Q_{03}\). Total \(4 \times 4 = 16\) pairs. Total number of undetectable pairs is \(9+16+16+16 = 57\). Probability: \(57 \times \left(\frac{p}{15}\right)^2 = \frac{57 p^2}{225} = \frac{19 p^2}{75}\).

Summing all contributions to find the total success probability:

\[ P_{success}(p) = (1-p)^2 + \frac{p(1-p)}{5} + \frac{p(1-p)}{5} + \frac{19}{75}p^2 \]
\[ P_{success}(p) = (1 - 2p + p^2) + \frac{2}{5}(p - p^2) + \frac{19}{75}p^2 \]
\[ P_{success}(p) = 1 + (-2 + \frac{2}{5})p + (1 - \frac{2}{5} + \frac{19}{75})p^2 \]
\[ P_{success}(p) = 1 - \frac{8}{5}p + \left(\frac{75 - 30 + 19}{75}\right)p^2 \]
\[ P_{success}(p) = 1 - \frac{8}{5}p + \frac{64}{75}p^2 \]

Step 5: Calculate the Final Logical Fidelity

Now we combine the results using the formula \(F_L = F_{phys} / P_{success}\).

\[ F_{phys}(p) = \left(1 - \frac{4}{5}p\right)^2 = 1 - \frac{8}{5}p + \frac{16}{25}p^2 \]
\[ P_{success}(p) = 1 - \frac{8}{5}p + \frac{64}{75}p^2 \]

The logical state fidelity is:

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

We can also write this with a common denominator:

\[ F_L(p) = \frac{1 - \frac{8}{5}p + \frac{48}{75}p^2}{1 - \frac{8}{5}p + \frac{64}{75}p^2} \]

For small \(p\), the infidelity \(1 - F_L(p)\) is:

\[ 1 - F_L(p) = 1 - \frac{1 - \frac{8}{5}p + \frac{48}{75}p^2}{1 - \frac{8}{5}p + \frac{64}{75}p^2} = \frac{(1 - \frac{8}{5}p + \frac{64}{75}p^2) - (1 - \frac{8}{5}p + \frac{48}{75}p^2)}{1 - \frac{8}{5}p + \frac{64}{75}p^2} = \frac{\frac{16}{75}p^2}{1 - \frac{8}{5}p + \frac{64}{75}p^2} \approx \frac{16}{75}p^2 \]

This shows the logical error is suppressed to second order in \(p\), which is characteristic of an error detection code.

Final Answer: The logical state fidelity of the final 2-qubit logical state as a function of the two-qubit gate error rate \(p\) is:

\[ F_L(p) = \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_physical = (1 - sp.Rational(4, 5) * p)**2
    P_success = 1 - sp.Rational(8, 5) * p + sp.Rational(64, 75) * p**2
    F_logical = F_physical / P_success
    # ---------------------------------------------------------------

    return F_logical