Checkpoint-1

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

The problem asks for the physical state fidelity of the final 4-qubit state prepared by a given circuit, as a function of the two-qubit gate error rate \(p\). The circuit prepares a logical two-qubit GHZ state in the [[4,2,2]] quantum error detection code.

First, let’s identify the ideal target state and the state produced by the ideal circuit.

1. Define the ideal target state: Logical GHZ state The logical two-qubit GHZ state is \(|\psi_{GHZ_L}\rangle = \frac{1}{\sqrt{2}}(|00\rangle_{AB}+|11\rangle_{AB})\). We need to find the physical representation of \(|00\rangle_{AB}\) and \(|11\rangle_{AB}\) in the [[4,2,2]] code, given the stabilizers \(S_1 = X_0X_1X_2X_3\), \(S_2 = Z_0Z_1Z_2Z_3\), and logical operators \(Z_A = Z_0Z_1I_2I_3\), \(Z_B = Z_0I_1Z_2I_3\). Logical states must be +1 eigenstates of the stabilizers \(S_1\) and \(S_2\). \(|00\rangle_{AB}\) is defined as a +1 eigenstate of \(Z_A\) and \(Z_B\). \(|11\rangle_{AB}\) is defined as a -1 eigenstate of \(Z_A\) and \(Z_B\).

Let’s find \(|00\rangle_{AB}\): Consider the state \(\frac{1}{\sqrt{2}}(|0000\rangle + |1111\rangle)\). \(S_1 \frac{1}{\sqrt{2}}(|0000\rangle + |1111\rangle) = \frac{1}{\sqrt{2}}(|1111\rangle + |0000\rangle)\), so it’s a +1 eigenstate of \(S_1\). \(S_2 \frac{1}{\sqrt{2}}(|0000\rangle + |1111\rangle) = \frac{1}{\sqrt{2}}(|0000\rangle + (-1)^4|1111\rangle)\), so it’s a +1 eigenstate of \(S_2\). \(Z_A \frac{1}{\sqrt{2}}(|0000\rangle + |1111\rangle) = \frac{1}{\sqrt{2}}(Z_0Z_1|0000\rangle + Z_0Z_1|1111\rangle) = \frac{1}{\sqrt{2}}(|0000\rangle + (-1)^2|1111\rangle) = \frac{1}{\sqrt{2}}(|0000\rangle + |1111\rangle)\). So it’s a +1 eigenstate of \(Z_A\). \(Z_B \frac{1}{\sqrt{2}}(|0000\rangle + |1111\rangle) = \frac{1}{\sqrt{2}}(Z_0Z_2|0000\rangle + Z_0Z_2|1111\rangle) = \frac{1}{\sqrt{2}}(|0000\rangle + (-1)^2|1111\rangle) = \frac{1}{\sqrt{2}}(|0000\rangle + |1111\rangle)\). So it’s a +1 eigenstate of \(Z_B\). Thus, \(|00\rangle_{AB} = \frac{1}{\sqrt{2}}(|0000\rangle + |1111\rangle)\).

Let’s find \(|11\rangle_{AB}\): Consider the state \(\frac{1}{\sqrt{2}}(|1010\rangle + |0101\rangle)\). \(S_1 \frac{1}{\sqrt{2}}(|1010\rangle + |0101\rangle) = \frac{1}{\sqrt{2}}(|0101\rangle + |1010\rangle)\), so it’s a +1 eigenstate of \(S_1\). \(S_2 \frac{1}{\sqrt{2}}(|1010\rangle + |0101\rangle) = \frac{1}{\sqrt{2}}(Z_0Z_1Z_2Z_3|1010\rangle + Z_0Z_1Z_2Z_3|0101\rangle) = \frac{1}{\sqrt{2}}(|1010\rangle + |0101\rangle)\), so it’s a +1 eigenstate of \(S_2\). \(Z_A \frac{1}{\sqrt{2}}(|1010\rangle + |0101\rangle) = \frac{1}{\sqrt{2}}(Z_0Z_1|1010\rangle + Z_0Z_1|0101\rangle) = \frac{1}{\sqrt{2}}((-1)(+1)|1010\rangle + (+1)(-1)|0101\rangle) = -\frac{1}{\sqrt{2}}(|1010\rangle + |0101\rangle)\). So it’s a -1 eigenstate of \(Z_A\). \(Z_B \frac{1}{\sqrt{2}}(|1010\rangle + |0101\rangle) = \frac{1}{\sqrt{2}}(Z_0Z_2|1010\rangle + Z_0Z_2|0101\rangle) = \frac{1}{\sqrt{2}}((-1)(+1)|1010\rangle + (+1)(+1)|0101\rangle) = -\frac{1}{\sqrt{2}}(|1010\rangle + |0101\rangle)\). So it’s a -1 eigenstate of \(Z_B\). Thus, \(|11\rangle_{AB} = \frac{1}{\sqrt{2}}(|1010\rangle + |0101\rangle)\).

The ideal target physical state is:

\[ |\psi_{target}\rangle = \frac{1}{\sqrt{2}}(|00\rangle_{AB} + |11\rangle_{AB}) = \frac{1}{\sqrt{2}} \left[ \frac{1}{\sqrt{2}}(|0000\rangle + |1111\rangle) + \frac{1}{\sqrt{2}}(|1010\rangle + |0101\rangle) \right] \]
\[ |\psi_{target}\rangle = \frac{1}{2}(|0000\rangle + |1111\rangle + |1010\rangle + |0101\rangle) \]

2. Determine the state produced by the ideal circuit The circuit is \(U = (CNOT_{03}) (H_0) (CNOT_{21}) (H_2)\), starting from \(|0000\rangle\). The operations occur from right to left.

  1. Initial state: \(|\psi_0\rangle = |0000\rangle\).
  2. Apply \(H_2\): \(H_2|0000\rangle = |00+0\rangle = \frac{1}{\sqrt{2}}(|0000\rangle + |0010\rangle)\).
  3. Apply \(CNOT_{21}\) (control 2, target 1): \(CNOT_{21}\frac{1}{\sqrt{2}}(|0000\rangle + |0010\rangle) = \frac{1}{\sqrt{2}}(CNOT_{21}|0000\rangle + CNOT_{21}|0010\rangle) = \frac{1}{\sqrt{2}}(|0000\rangle + |0110\rangle)\). Let this be \(|\psi_{B,ideal}\rangle\).
  4. Apply \(H_0\): \(H_0\frac{1}{\sqrt{2}}(|0000\rangle + |0110\rangle) = \frac{1}{\sqrt{2}}(H_0|0000\rangle + H_0|0110\rangle)\) \(= \frac{1}{\sqrt{2}}\left(\frac{1}{\sqrt{2}}(|0000\rangle + |1000\rangle) + \frac{1}{\sqrt{2}}(|0110\rangle + |1110\rangle)\right) = \frac{1}{2}(|0000\rangle + |1000\rangle + |0110\rangle + |1110\rangle)\).
  5. Apply \(CNOT_{03}\) (control 0, target 3): \(CNOT_{03}\frac{1}{2}(|0000\rangle + |1000\rangle + |0110\rangle + |1110\rangle)\) \(= \frac{1}{2}(CNOT_{03}|0000\rangle + CNOT_{03}|1000\rangle + CNOT_{03}|0110\rangle + CNOT_{03}|1110\rangle)\) \(= \frac{1}{2}(|0000\rangle + |1001\rangle + |0110\rangle + |1111\rangle)\). Let this be \(|\psi_{circ}\rangle\).

3. Calculate the ideal fidelity \(F_{ideal}\) The ideal fidelity is the overlap between the ideal target state and the state produced by the ideal circuit:

\[ F_{ideal} = |\langle\psi_{target}|\psi_{circ}\rangle|^2 \]
\[ \langle\psi_{target}|\psi_{circ}\rangle = \frac{1}{2}\left(\langle0000| + \langle1111| + \langle1010| + \langle0101|\right) \frac{1}{2}\left(|0000\rangle + |1001\rangle + |0110\rangle + |1111\rangle\right) \]
\[ = \frac{1}{4}(\langle0000|0000\rangle + \langle1111|1111\rangle + \langle1010|1001\rangle + \langle0101|0110\rangle) \]

The cross terms \(\langle1010|1001\rangle=0\) and \(\langle0101|0110\rangle=0\).

\[ \langle\psi_{target}|\psi_{circ}\rangle = \frac{1}{4}(1 + 1 + 0 + 0) = \frac{2}{4} = \frac{1}{2} \]

So the ideal fidelity is \(F_{ideal} = \left(\frac{1}{2}\right)^2 = \frac{1}{4}\).

4. Account for depolarizing errors Each CNOT gate is followed by a two-qubit depolarizing channel. The circuit has two CNOT gates: \(CNOT_{21}\) and \(CNOT_{03}\). Let \(U_1 = H_2\), \(U_2 = CNOT_{21}\), \(U_3 = H_0\), \(U_4 = CNOT_{03}\). The initial state is \(\rho_0 = |0000\rangle\langle0000|\). The state after \(H_2\) is \(\rho_1 = U_1\rho_0 U_1^\dagger\). The state after \(CNOT_{21}\) and its error channel \(\mathcal{E}_{21}\) is: \(\rho_A = \mathcal{E}_{21}(U_2\rho_1 U_2^\dagger) = (1-p)U_2\rho_1 U_2^\dagger + \frac{p}{15}\sum_{P_1 \in \mathcal{P}_{21}'} P_1 U_2\rho_1 U_2^\dagger P_1^\dagger\). Here, \(U_2\rho_1 U_2^\dagger = |\psi_{B,ideal}\rangle\langle\psi_{B,ideal}|\). The state after \(H_0\) is \(\rho_B = U_3\rho_A U_3^\dagger\). The state after \(CNOT_{03}\) and its error channel \(\mathcal{E}_{03}\) is: \(\rho_{final} = \mathcal{E}_{03}(U_4\rho_B U_4^\dagger) = (1-p)U_4\rho_B U_4^\dagger + \frac{p}{15}\sum_{P_2 \in \mathcal{P}_{03}'} P_2 U_4\rho_B U_4^\dagger P_2^\dagger\). Here, \(P_1\) are the 15 non-identity Pauli operators acting on qubits 1 and 2, and \(P_2\) are the 15 non-identity Pauli operators acting on qubits 0 and 3.

We want to calculate the fidelity \(F = \langle\psi_{target}|\rho_{final}|\psi_{target}\rangle\). We will keep terms up to \(O(p)\).

\[ \rho_{final} = (1-p)^2 |\psi_{circ}\rangle\langle\psi_{circ}| + (1-p)\frac{p}{15} \sum_{P_1 \in \mathcal{P}_{21}'} U_4 U_3 P_1 |\psi_{B,ideal}\rangle\langle\psi_{B,ideal}|P_1^\dagger U_3^\dagger U_4^\dagger \]
\[ + (1-p)\frac{p}{15} \sum_{P_2 \in \mathcal{P}_{03}'} P_2 |\psi_{circ}\rangle\langle\psi_{circ}| P_2^\dagger + O(p^2) \]

The fidelity is then:

\[ F = (1-p)^2 |\langle\psi_{target}|\psi_{circ}\rangle|^2 \]
\[ + (1-p)\frac{p}{15} \sum_{P_1 \in \mathcal{P}_{21}'} |\langle\psi_{target}|U_4 U_3 P_1 |\psi_{B,ideal}\rangle|^2 \]
\[ + (1-p)\frac{p}{15} \sum_{P_2 \in \mathcal{P}_{03}'} |\langle\psi_{target}|P_2 |\psi_{circ}\rangle|^2 + O(p^2) \]

Let’s evaluate the terms: The first term is \((1-2p+p^2) \frac{1}{4} = \frac{1}{4} - \frac{p}{2} + O(p^2)\).

For the second term (sum over \(P_1\) acting on qubits 1,2): We need to calculate \(M_1(P_1) = |\langle\psi_{target}|U_4 U_3 P_1 |\psi_{B,ideal}\rangle|^2\) for each \(P_1 \in \mathcal{P}_{12}'\). \(|\psi_{B,ideal}\rangle = \frac{1}{\sqrt{2}}(|0000\rangle + |0110\rangle)\). \(U_4 U_3 = CNOT_{03}H_0\). \(|\psi_{circ}\rangle = U_4 U_3 |\psi_{B,ideal}\rangle = \frac{1}{2}(|0000\rangle + |1001\rangle + |0110\rangle + |1111\rangle)\). There are 15 non-identity Pauli operators on qubits 1 and 2. We test which ones result in a non-zero overlap with \(|\psi_{target}\rangle\):

  1. \(P_1 = X_1X_2\): \(P_1|\psi_{B,ideal}\rangle = \frac{1}{\sqrt{2}}(|0110\rangle + |0000\rangle) = |\psi_{B,ideal}\rangle\). So \(U_4 U_3 P_1 |\psi_{B,ideal}\rangle = |\psi_{circ}\rangle\). \(M_1(X_1X_2) = |\langle\psi_{target}|\psi_{circ}\rangle|^2 = \frac{1}{4}\).
  2. \(P_1 = Y_1Y_2\): \(P_1|\psi_{B,ideal}\rangle = -|\psi_{B,ideal}\rangle\). So \(U_4 U_3 P_1 |\psi_{B,ideal}\rangle = -|\psi_{circ}\rangle\). \(M_1(Y_1Y_2) = |-\langle\psi_{target}|\psi_{circ}\rangle|^2 = \frac{1}{4}\).
  3. \(P_1 = Z_1Z_2\): \(P_1|\psi_{B,ideal}\rangle = |\psi_{B,ideal}\rangle\). So \(U_4 U_3 P_1 |\psi_{B,ideal}\rangle = |\psi_{circ}\rangle\). \(M_1(Z_1Z_2) = \frac{1}{4}\).
  4. \(P_1 = Z_1I_2\): \(P_1|\psi_{B,ideal}\rangle = \frac{1}{\sqrt{2}}(|0000\rangle - |0110\rangle)\). Let’s call this \(|\phi_1\rangle\). \(U_4 U_3 |\phi_1\rangle = \frac{1}{2}(|0000\rangle - |1001\rangle - |0110\rangle + |1111\rangle)\). Let this be \(|\psi'_{circ}\rangle\). \(\langle\psi_{target}|\psi'_{circ}\rangle = \frac{1}{4}(1 - 0 - 0 + 1) = \frac{1}{2}\). So \(M_1(Z_1I_2) = \frac{1}{4}\).
  5. \(P_1 = I_1Z_2\): This also gives \(|\phi_1\rangle\). So \(M_1(I_1Z_2) = \frac{1}{4}\).
  6. \(P_1 = Y_1X_2\): \(P_1|\psi_{B,ideal}\rangle = i Z_1|\psi_{B,ideal}\rangle = i \frac{1}{\sqrt{2}}(|0000\rangle - |0110\rangle) = i|\phi_1\rangle\). So \(U_4 U_3 P_1 |\psi_{B,ideal}\rangle = i|\psi'_{circ}\rangle\). \(M_1(Y_1X_2) = |i \cdot \frac{1}{2}|^2 = \frac{1}{4}\).
  7. \(P_1 = Z_1Y_2\): \(P_1|\psi_{B,ideal}\rangle = i X_2|\psi_{B,ideal}\rangle = i \frac{1}{\sqrt{2}}(|0000\rangle + |0110\rangle) = i|\psi_{B,ideal}\rangle\). So \(U_4 U_3 P_1 |\psi_{B,ideal}\rangle = i|\psi_{circ}\rangle\). \(M_1(Z_1Y_2) = |i \cdot \frac{1}{2}|^2 = \frac{1}{4}\). All other 8 Pauli operators on \(Q_1,Q_2\) produce states orthogonal to \(|\psi_{target}\rangle\), so \(M_1(P_1)=0\). The sum for the second term is \(7 \times \frac{1}{4}\). So this term contributes \(\frac{p(1-p)}{15} \times \frac{7}{4} = \frac{7p(1-p)}{60}\).

For the third term (sum over \(P_2\) acting on qubits 0,3): We need to calculate \(M_2(P_2) = |\langle\psi_{target}|P_2 |\psi_{circ}\rangle|^2\) for each \(P_2 \in \mathcal{P}_{03}'\). \(|\psi_{circ}\rangle = \frac{1}{2}(|0000\rangle + |1001\rangle + |0110\rangle + |1111\rangle)\). There are 15 non-identity Pauli operators on qubits 0 and 3. We test which ones result in a non-zero overlap:

  1. \(P_2 = X_0X_3\): \(P_2|\psi_{circ}\rangle = \frac{1}{2}(|1001\rangle + |0000\rangle + |1111\rangle + |0110\rangle) = |\psi_{circ}\rangle\). \(M_2(X_0X_3) = \frac{1}{4}\).
  2. \(P_2 = Z_0Z_3\): \(P_2|\psi_{circ}\rangle = \frac{1}{2}(|0000\rangle + (-1)^2|1001\rangle + |0110\rangle + (-1)^2|1111\rangle) = |\psi_{circ}\rangle\). \(M_2(Z_0Z_3) = \frac{1}{4}\).
  3. \(P_2 = Y_0Y_3\): \(P_2|\psi_{circ}\rangle = (iZ_0X_0)(iZ_3X_3)|\psi_{circ}\rangle = -Z_0X_0Z_3X_3|\psi_{circ}\rangle = -Z_0Z_3 X_0X_3|\psi_{circ}\rangle = -|\psi_{circ}\rangle\). \(M_2(Y_0Y_3) = |-\langle\psi_{target}|\psi_{circ}\rangle|^2 = \frac{1}{4}\). All other 12 Pauli operators on \(Q_0,Q_3\) produce states orthogonal to \(|\psi_{target}\rangle\), so \(M_2(P_2)=0\). The sum for the third term is \(3 \times \frac{1}{4}\). So this term contributes \(\frac{p(1-p)}{15} \times \frac{3}{4} = \frac{3p(1-p)}{60}\).

5. Total Fidelity Collecting all terms up to \(O(p)\):

\[ F = \left(\frac{1}{4} - \frac{p}{2}\right) + \frac{7p}{60} + \frac{3p}{60} + O(p^2) \]
\[ F = \frac{1}{4} - \frac{p}{2} + \frac{10p}{60} + O(p^2) \]
\[ F = \frac{1}{4} - \frac{p}{2} + \frac{p}{6} + O(p^2) \]
\[ F = \frac{1}{4} - p\left(\frac{1}{2} - \frac{1}{6}\right) + O(p^2) \]
\[ F = \frac{1}{4} - p\left(\frac{3}{6} - \frac{1}{6}\right) + O(p^2) \]
\[ F = \frac{1}{4} - p\left(\frac{2}{6}\right) + O(p^2) \]
\[ F = \frac{1}{4} - \frac{p}{3} + O(p^2) \]

The final answer is \(\boxed{0.25 - \frac{1}{3}p}\).

User #3

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 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$.

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

    Outputs
    ----------
    F_physical: sympy.Expr, the physical state fidelity of the final physical 4-qubit state
    """

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

    return F_physical
Assistant #4
Reasoning (model)

My Analytical Approach to the Python Code

Okay, so I’m being asked to fill in the F_physical variable in this Python code snippet. The goal is clear: to represent the derived expression, \(0.25 - \frac{1}{3}p\), within the code. Since I’m dealing with an algebraic expression and likely want to use symbolic manipulation, sympy is the obvious tool. I’ll need to define p as a symbolic variable and then construct the expression directly using sympy’s syntax. This will allow for the symbolic representation and potentially further operations if needed within the broader context of the code. Let’s keep it simple and directly translate the expression into sympy format.

import sympy as sp

p = sp.symbols('p')

def answer(p):
    r"""
    Return the expression of 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$.

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

    Outputs
    ----------
    F_physical: sympy.Expr, the physical state fidelity of the final physical 4-qubit state
    """

    # ------------------ FILL IN YOUR RESULTS BELOW ------------------
    F_physical = sp.Rational(1, 4) - sp.Rational(1, 3) * p
    # ---------------------------------------------------------------

    return F_physical