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

Answering the user’s request.

Step-by-Step Derivation

1. Determine the Ideal Final State

The quantum circuit prepares a 4-qubit state from the initial state \(|0000\rangle\). The unitary operations are applied from right to left as given in the expression \(U = (CNOT_{03}) (H_0) (CNOT_{21}) (H_2)\). Let’s track the state vector \(|\psi\rangle\) through the circuit.

  1. Initial state: \(|\psi_0\rangle = |0000\rangle\)

  2. Apply \(H_2\) (Hadamard on qubit 2): \(|\psi_1\rangle = H_2 |\psi_0\rangle = |00\rangle \otimes \frac{1}{\sqrt{2}}(|0\rangle + |1\rangle) \otimes |0\rangle = \frac{1}{\sqrt{2}}(|0000\rangle + |0010\rangle)\)

  3. Apply \(CNOT_{21}\) (Control on qubit 2, Target on qubit 1): \(|\psi_2\rangle = CNOT_{21} |\psi_1\rangle = \frac{1}{\sqrt{2}}(CNOT_{21}|0000\rangle + CNOT_{21}|0010\rangle)\) The control qubit (2) is \(|0\rangle\) for the first term, so the target (1) is unchanged. The control is \(|1\rangle\) for the second term, so the target is flipped. \(|\psi_2\rangle = \frac{1}{\sqrt{2}}(|0000\rangle + |0110\rangle)\)

  4. Apply \(H_0\) (Hadamard on qubit 0): \(|\psi_3\rangle = H_0 |\psi_2\rangle = \frac{1}{\sqrt{2}}(H_0|0000\rangle + H_0|0110\rangle)\) \(|\psi_3\rangle = \frac{1}{\sqrt{2}} \left( \frac{1}{\sqrt{2}}(|0\rangle+|1\rangle)|000\rangle + \frac{1}{\sqrt{2}}(|0\rangle+|1\rangle)|110\rangle \right)\) \(|\psi_3\rangle = \frac{1}{2}(|0000\rangle + |1000\rangle + |0110\rangle + |1110\rangle)\)

  5. Apply \(CNOT_{03}\) (Control on qubit 0, Target on qubit 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)\) The control qubit (0) is \(|0\rangle\) for the first and third terms, leaving the target (3) unchanged. The control is \(|1\rangle\) for the second and fourth terms, flipping the target.

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

2. Analyze the Structure of the Ideal Final State

The ideal final state \(|\Psi_{ideal}\rangle\) has a special structure. Let’s group the terms by the states of qubit pairs (0,3) and (1,2).

\(|0000\rangle = |00\rangle_{03} \otimes |00\rangle_{12}\) \(|1001\rangle = |11\rangle_{03} \otimes |00\rangle_{12}\) \(|0110\rangle = |00\rangle_{03} \otimes |11\rangle_{12}\) \(|1111\rangle = |11\rangle_{03} \otimes |11\rangle_{12}\)

Substituting these into the expression for \(|\Psi_{ideal}\rangle\):

\[ |\Psi_{ideal}\rangle = \frac{1}{2} \left( |00\rangle_{03}|00\rangle_{12} + |11\rangle_{03}|00\rangle_{12} + |00\rangle_{03}|11\rangle_{12} + |11\rangle_{03}|11\rangle_{12} \right) \]

Factoring the expression:

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

This shows that the ideal final state is a product of two Bell states, \(|\Phi^+\rangle_{03} \otimes |\Phi^+\rangle_{12}\). Let \(\rho_{ideal} = |\Psi_{ideal}\rangle\langle\Psi_{ideal}|\).

3. Model the Noisy Circuit Evolution

The circuit consists of two noisy CNOT gates, \(CNOT_{21}\) and \(CNOT_{03}\). Let \(\mathcal{U}_G\) denote the unitary channel for a gate \(G\), and \(\mathcal{E}_{ij}\) denote the two-qubit depolarizing error channel on qubits \(i,j\). The circuit applies the following sequence of operations to the initial state \(\rho_0 = |0000\rangle\langle0000|\):

\[ \rho_{final} = \mathcal{E}_{03} \circ \mathcal{U}_{CNOT_{03}} \circ \mathcal{U}_{H_0} \circ \mathcal{E}_{21} \circ \mathcal{U}_{CNOT_{21}} \circ \mathcal{U}_{H_2} (\rho_0) \]

Let’s analyze the evolution. The state after the first noisy gate, \(CNOT_{21}\), is \(\rho_A = \mathcal{E}_{21} \circ \mathcal{U}_{CNOT_{21}} \circ \mathcal{U}_{H_2} (\rho_0)\). The subsequent operations are \(U_{H_0}\) and \(U_{CNOT_{03}}\). The error channel \(\mathcal{E}_{21}\) acts on qubits 1 and 2, while \(U_{H_0}\) acts on qubit 0 and \(U_{CNOT_{03}}\) acts on qubits 0 and 3. Since these unitaries act on disjoint sets of qubits from the error channel, they commute:

\[ \mathcal{U}_{H_0} \circ \mathcal{E}_{21} = \mathcal{E}_{21} \circ \mathcal{U}_{H_0} \]
\[ \mathcal{U}_{CNOT_{03}} \circ \mathcal{E}_{21} = \mathcal{E}_{21} \circ \mathcal{U}_{CNOT_{03}} \]

Using this, we can reorder the operations in the full circuit:

\[ \rho_{final} = \mathcal{E}_{03} \circ \mathcal{E}_{21} \circ \mathcal{U}_{CNOT_{03}} \circ \mathcal{U}_{H_0} \circ \mathcal{U}_{CNOT_{21}} \circ \mathcal{U}_{H_2} (\rho_0) \]

The combined unitary part is precisely the ideal circuit, \(U_{ideal} = U_{CNOT_{03}} U_{H_0} U_{CNOT_{21}} U_{H_2}\). Thus, the evolution can be written as:

\[ \rho_{final} = \mathcal{E}_{03} \circ \mathcal{E}_{21} (\rho_{ideal}) \]

Since \(\rho_{ideal} = |\Phi^+\rangle_{03}\langle\Phi^+|_{03} \otimes |\Phi^+\rangle_{12}\langle\Phi^+|_{12}\), and the error channels act on separate subsystems:

\[ \mathcal{E}_{21}(\rho_{ideal}) = |\Phi^+\rangle_{03}\langle\Phi^+|_{03} \otimes \mathcal{E}_{21}(|\Phi^+\rangle_{12}\langle\Phi^+|_{12}) \]
\[ \rho_{final} = \mathcal{E}_{03}(|\Phi^+\rangle_{03}\langle\Phi^+|_{03}) \otimes \mathcal{E}_{21}(|\Phi^+\rangle_{12}\langle\Phi^+|_{12}) \]

4. Calculate the Fidelity

The physical state fidelity is \(F = \langle\Psi_{ideal}|\rho_{final}|\Psi_{ideal}\rangle = \text{Tr}(\rho_{ideal} \rho_{final})\). Let \(\rho_{03}^{ideal} = |\Phi^+\rangle_{03}\langle\Phi^+|_{03}\) and \(\rho_{12}^{ideal} = |\Phi^+\rangle_{12}\langle\Phi^+|_{12}\). Let \(\rho_{03}^{final} = \mathcal{E}_{03}(\rho_{03}^{ideal})\) and \(\rho_{12}^{final} = \mathcal{E}_{21}(\rho_{12}^{ideal})\). Then \(\rho_{ideal} = \rho_{03}^{ideal} \otimes \rho_{12}^{ideal}\) and \(\rho_{final} = \rho_{03}^{final} \otimes \rho_{12}^{final}\).

\[ F = \text{Tr}((\rho_{03}^{ideal} \otimes \rho_{12}^{ideal}) (\rho_{03}^{final} \otimes \rho_{12}^{final})) \]
\[ F = \text{Tr}(\rho_{03}^{ideal} \rho_{03}^{final}) \times \text{Tr}(\rho_{12}^{ideal} \rho_{12}^{final}) \]

This means the total fidelity is the product of the fidelities for each Bell pair subsystem. Let \(F_{03} = \text{Tr}(\rho_{03}^{ideal} \rho_{03}^{final})\) and \(F_{12} = \text{Tr}(\rho_{12}^{ideal} \rho_{12}^{final})\).

5. Fidelity of a Bell State under Depolarizing Noise

Let’s calculate the fidelity for one subsystem, say (0,3). \(F_{03} = \langle\Phi^+|_{03} \rho_{03}^{final} |\Phi^+\rangle_{03} = \langle\Phi^+|_{03} \mathcal{E}_{03}(|\Phi^+\rangle_{03}\langle\Phi^+|_{03}) |\Phi^+\rangle_{03}\). The error channel is \(\mathcal{E}(\rho) = (1-p) \rho + \frac{p}{15} \sum_{P \neq I} P \rho P^\dagger\), where \(P\) are the 15 non-identity two-qubit Pauli operators.

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

We need to find the expectation values of Pauli operators for a Bell state \(|\Phi^+\rangle = \frac{1}{\sqrt{2}}(|00\rangle+|11\rangle)\). The state \(|\Phi^+\rangle\) is a \(+1\) eigenstate of the stabilizer operators \(X\otimes X\) and \(Z\otimes Z\). It is also a \(-1\) eigenstate of \(Y\otimes Y = (iXZ)(iXZ) = - (X\otimes X)(Z\otimes Z)\). All other 12 non-identity Pauli operators have an expectation value of 0 for this state. The non-zero expectation values are: \(\langle\Phi^+| X\otimes X |\Phi^+\rangle = 1\) \(\langle\Phi^+| Z\otimes Z |\Phi^+\rangle = 1\) \(\langle\Phi^+| Y\otimes Y |\Phi^+\rangle = -1\)

The sum of squares of these expectation values is:

\[ \sum_{P_{03} \neq I} |\langle\Phi^+| P_{03} |\Phi^+\rangle|^2 = 1^2 + 1^2 + (-1)^2 = 3 \]

Substituting this into the expression for \(F_{03}\):

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

By symmetry, the fidelity for the (1,2) subsystem is the same:

\[ F_{12} = 1 - \frac{4}{5}p \]

6. Combine Results for the Final Fidelity

The total physical state fidelity is the product of the fidelities of the two subsystems:

\[ F = F_{03} \times 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 physical 4-qubit state as a function of the two-qubit gate error rate \(p\) is:

\[ F(p) = 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)

Logical State Fidelity for the [[4,2,2]] Code

My goal is to calculate the logical fidelity, conditioned on no detectable errors. I’m dealing with a [[4,2,2]] quantum code, meaning four physical qubits encode two logical qubits. First, I needed to understand the code: how the qubits, stabilizers (\(XXXX\) and \(ZZZZ\)), logical operators (\(X_A, X_B, Z_A, Z_B\)) and basis states relate. The target logical state I want to prepare is a Bell state: \(|\Psi_L\rangle = \frac{1}{\sqrt{2}}(|00\rangle_{AB} + |11\rangle_{AB})\).

To begin, I had to ensure the circuit actually creates the desired logical state. By working through the circuit operations, I determined the expected ideal physical state is \(|\Psi_{ideal}\rangle = \frac{1}{2}(|0000\rangle + |1001\rangle + |0110\rangle + |1111\rangle)\). I then confirmed this state lies within the code space (the +1 eigenspace of the stabilizers) by checking that the state is indeed stabilized by \(S_1\) and \(S_2\). Further, I had to verify that the \(|\Psi_{ideal}\rangle\) state does encode the correct logical Bell state, \(|\Psi_L\rangle\). I constructed the logical basis states using the properties of the stabilizers and logical operators, and carefully checked the action of the logical operators on each logical basis state to make sure I constructed the basis correctly. Ultimately, I confirmed that the ideal circuit indeed creates the correct encoded Bell state.

Next, I introduced an error model: independent depolarizing channels on two qubit pairs, (0,3) and (2,1) after the circuit. My focus is on post-selecting on the absence of detectable errors. I set up the relevant notation and then expressed the final state as the product of the effects of each channel on the ideal Bell pairs. I focused on error channels that act independently on the subsystems to determine the probability of success, \(P_{succ}\), and the physical fidelity. The projector \(\Pi_C\) allows me to focus on the encoded code subspace for computing \(P_{succ}\) and logical fidelity, \(F_L = F_{phys} / P_{succ}\).

I then meticulously considered the error channels, noting that the errors can be detectable or undetectable. Detectable errors get post-selected out by measuring the stabilizers, and my goal is the fidelity conditioned on those detectable errors having not occurred. Undetectable errors can map logical states within the codespace (leaving the logical state unchanged), or they can be true logical errors that change the logical state. So I calculated the fidelity in several ways, and after some struggles, arrived at the result. I considered all possible combinations of undetectable errors that could have occurred, which led me to the correct expression. In the end, I confirmed that the logical infidelity indeed scales quadratically with the physical error rate, as expected for a distance-2 code, because the linear decrease in physical fidelity caused by the detectable errors exactly cancels with the decreases in the probability of success, due to those same errors.

Step-by-Step Derivation

1. Ideal State and Error Model

From Subproblem 1, the ideal physical state prepared by the circuit is \(|\Psi_{ideal}\rangle = \frac{1}{2}(|0000\rangle + |1001\rangle + |0110\rangle + |1111\rangle)\). This state is in the codespace of the [[4,2,2]] code (the +1 eigenspace of stabilizers \(S_1=XXXX\) and \(S_2=ZZZZ\)) and corresponds to the logical GHZ state \(|\Psi_L\rangle = \frac{1}{\sqrt{2}}(|00\rangle_{AB} + |11\rangle_{AB})\). Let \(\rho_{ideal} = |\Psi_{ideal}\rangle\langle\Psi_{ideal}|\).

The circuit has two noisy CNOT gates. The final state of the 4 physical qubits, \(\rho_{final}\), after passing through the two independent depolarizing channels is given by:

\[ \rho_{final} = (\mathcal{E}_{03} \circ \mathcal{E}_{21}) (\rho_{ideal}) \]

where \(\mathcal{E}_{ij}\) is the two-qubit depolarizing channel on qubits \(i\) and \(j\).

2. Post-selection and Logical Fidelity

We post-select on the absence of detectable errors. This corresponds to projecting the final state into the codespace. The projector onto the codespace is \(\Pi_C = \frac{1}{4}(I + S_1 + S_2 + S_1S_2)\). The post-selected state is:

\[ \rho_{ps} = \frac{\Pi_C \rho_{final} \Pi_C}{\text{Tr}(\Pi_C \rho_{final})} \]

The denominator, \(P_{succ} = \text{Tr}(\Pi_C \rho_{final})\), is the probability of success (i.e., of measuring both stabilizers and getting +1).

The logical state fidelity is defined with respect to the ideal logical state \(|\Psi_L\rangle\). The corresponding physical state is \(|\Psi_{ideal}\rangle\). The fidelity of the post-selected state \(\rho_{ps}\) with the ideal pure state \(|\Psi_{ideal}\rangle\) is:

\[ F_L = \langle\Psi_{ideal}| \rho_{ps} |\Psi_{ideal}\rangle \]

Substituting the expression for \(\rho_{ps}\):

\[ F_L = \frac{\langle\Psi_{ideal}| \Pi_C \rho_{final} \Pi_C |\Psi_{ideal}\rangle}{P_{succ}} \]

Since \(|\Psi_{ideal}\rangle\) is in the codespace, it is an eigenvector of \(\Pi_C\) with eigenvalue 1, i.e., \(\Pi_C |\Psi_{ideal}\rangle = |\Psi_{ideal}\rangle\) and \(\langle\Psi_{ideal}| \Pi_C = \langle\Psi_{ideal}|\). Therefore, the numerator simplifies:

\[ \langle\Psi_{ideal}| \Pi_C \rho_{final} \Pi_C |\Psi_{ideal}\rangle = \langle\Psi_{ideal}| \rho_{final} |\Psi_{ideal}\rangle = F_{phys} \]

where \(F_{phys}\) is the physical state fidelity calculated in Subproblem 1. Thus, the logical fidelity is the ratio of the physical fidelity to the success probability:

\[ F_L(p) = \frac{F_{phys}(p)}{P_{succ}(p)} \]

3. Calculation of the Success Probability (\(P_{succ}\))

From Subproblem 1, we know the ideal state factorizes as \(|\Psi_{ideal}\rangle = |\Phi^+\rangle_{03} \otimes |\Phi^+\rangle_{12}\), where \(|\Phi^+\rangle = \frac{1}{\sqrt{2}}(|00\rangle+|11\rangle)\). The final state is \(\rho_{final} = \rho_{03} \otimes \rho_{12}\), where \(\rho_{03} = \mathcal{E}_{03}(|\Phi^+\rangle_{03}\langle\Phi^+|_{03})\) and \(\rho_{12} = \mathcal{E}_{21}(|\Phi^+\rangle_{12}\langle\Phi^+|_{12})\).

The success probability is \(P_{succ} = \text{Tr}(\Pi_C \rho_{final})\). Let’s write the projector in terms of operators on the subsystems (0,3) and (1,2):

\[ \Pi_C = \frac{1}{4}(I \otimes I + (X_0X_3 \otimes X_1X_2) + (Z_0Z_3 \otimes Z_1Z_2) + (Y_0Y_3 \otimes Y_1Y_2)) \]

The trace becomes: \begin{align} P_{succ} &= \frac{1}{4} \text{Tr} \left[ (I \otimes I + X_0X_3 \otimes X_1X_2 + \dots) (\rho_{03} \otimes \rho_{12}) \right] \ &= \frac{1}{4} \left[ \text{Tr}(I\rho_{03})\text{Tr}(I\rho_{12}) + \text{Tr}(X_0X_3\rho_{03})\text{Tr}(X_1X_2\rho_{12}) + \dots \right] \ &= \frac{1}{4} \left[ 1 + \langle X_0X_3 \rangle_{\rho_{03}} \langle X_1X_2 \rangle_{\rho_{12}} + \langle Z_0Z_3 \rangle_{\rho_{03}} \langle Z_1Z_2 \rangle_{\rho_{12}} + \langle Y_0Y_3 \rangle_{\rho_{03}} \langle Y_1Y_2 \rangle_{\rho_{12}} \right] \end{align} We need to calculate the expectation value of a two-qubit Pauli operator \(Q\) for a Bell state that has passed through a depolarizing channel. Let \(\rho' = \mathcal{E}(|\Phi^+\rangle\langle\Phi^+|)\).

\[ \langle Q \rangle_{\rho'} = \text{Tr}(Q \rho') = (1-p)\text{Tr}(Q\rho_{ideal}) + \frac{p}{15}\sum_{P \neq I} \text{Tr}(Q P \rho_{ideal} P) \]

Using the identity \(\text{Tr}(QP\rho P) = \text{sgn}(P,Q)\text{Tr}(Q\rho)\), where \(\text{sgn}(P,Q) = \pm 1\) depending on whether \(P,Q\) commute or anticommute:

\[ \langle Q \rangle_{\rho'} = \left( (1-p) + \frac{p}{15}\sum_{P \neq I} \text{sgn}(P,Q) \right) \langle Q \rangle_{ideal} \]

For any two-qubit Pauli \(Q \neq I\), the sum over the 15 non-identity Paulis is \(\sum_{P \neq I} \text{sgn}(P,Q) = -1\). So:

\[ \langle Q \rangle_{\rho'} = \left( 1-p - \frac{p}{15} \right) \langle Q \rangle_{ideal} = \left( 1 - \frac{16}{15}p \right) \langle Q \rangle_{ideal} \]

The ideal expectation values for \(|\Phi^+\rangle\) are \(\langle XX \rangle = 1\), \(\langle ZZ \rangle = 1\), and \(\langle YY \rangle = -1\). So for each subsystem, we have: \(\langle XX \rangle_{\rho'} = 1 - \frac{16}{15}p\) \(\langle ZZ \rangle_{\rho'} = 1 - \frac{16}{15}p\) \(\langle YY \rangle_{\rho'} = -(1 - \frac{16}{15}p)\)

Substituting these into the expression for \(P_{succ}\):

\[ P_{succ}(p) = \frac{1}{4} \left[ 1 + \left(1-\frac{16}{15}p\right)^2 + \left(1-\frac{16}{15}p\right)^2 + \left(-\left(1-\frac{16}{15}p\right)\right)\left(-\left(1-\frac{16}{15}p\right)\right) \right] \]
\[ P_{succ}(p) = \frac{1}{4} \left[ 1 + 3\left(1 - \frac{16}{15}p\right)^2 \right] \]

Expanding this expression:

\[ P_{succ}(p) = \frac{1}{4} \left[ 1 + 3\left(1 - \frac{32}{15}p + \frac{256}{225}p^2\right) \right] = \frac{1}{4} \left[ 4 - \frac{32}{5}p + \frac{256}{75}p^2 \right] \]
\[ P_{succ}(p) = 1 - \frac{8}{5}p + \frac{64}{75}p^2 \]

4. Final Calculation of Logical Fidelity

We now combine our results. From Subproblem 1, the physical fidelity is:

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

The logical fidelity is the ratio:

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

The linear terms in \(p\) in the numerator and denominator are identical. This implies that the logical infidelity, \(1 - F_L(p)\), is of order \(p^2\), which is expected for a distance-2 code.

\[ 1 - F_L(p) = \frac{P_{succ}(p) - F_{phys}(p)}{P_{succ}(p)} = \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} \]

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

    return F_logical