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, mathematical identities or numerical codes.
  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
  1. Step-by-Step Derivation
  • Ideal output state and its stabilizer:
  • The circuit (right-to-left) is:
    • Apply H on qubit 2, then CNOT2→1: prepares a Bell state on qubits (2,1), stabilized by {X2X1, Z2Z1}.
    • Apply H on qubit 0, then CNOT0→3: prepares a Bell state on qubits (0,3), stabilized by {X0X3, Z0Z3}.
  • The final ideal 4-qubit state is thus a tensor product of two Bell pairs (on 21 and 03). A convenient set of 4 independent stabilizers for this pure state is
\[ \{\,X_2X_1,\; Z_2Z_1,\; X_0X_3,\; Z_0Z_3\,\}. \]
This is equivalent (by products) to the code stabilizers XXXX, ZZZZ together with IXXI and IZZI, and it encodes the logical Bell state (|00⟩AB+|11⟩AB)/√2.
  • Noise model localization and propagation:
  • A two-qubit depolarizing channel is applied after each CNOT gate.
  • After CNOT2→1, the noise acts only on qubits (2,1). The remaining gates (H0 and CNOT0→3) act on qubits (0,3) only, so this error does not propagate or change.
  • After CNOT0→3, the noise acts only on qubits (0,3) and there are no further gates.
  • Therefore, the final error operator has the form
\[ F = P_{(2,1)} \otimes Q_{(0,3)}, \]
where P acts on qubits (2,1) and Q acts on qubits (0,3).
  • Fidelity for a stabilizer state under Pauli errors:
  • For a pure stabilizer state |ψ⟩, and a Pauli error F, the overlap is
\[ 1,& F \in \mathcal{S}(\psi),\\ 0,& F \notin \mathcal{S}(\psi), \]
where 𝒮(ψ) is the stabilizer group of |ψ⟩.
  • Hence, the physical state fidelity equals the total probability that the net error F lies in the stabilizer group of the ideal state.

  • Membership condition on each pair:

  • The subgroup on qubits (2,1) leaving the Bell state invariant is generated by X2X1 and Z2Z1, hence it is
\[ \{\,I\!I,\; X_2X_1,\; Z_2Z_1,\; Y_2Y_1\,\}. \]
  • Similarly, on qubits (0,3) the invariant subgroup is
\[ \{\,I\!I,\; X_0X_3,\; Z_0Z_3,\; Y_0Y_3\,\}. \]
  • Because the final state is a tensor product of the two Bell pairs, the full stabilizer group is the direct product of these two subgroups. Therefore,
\[ F \in \mathcal{S} \iff \big(P_{(2,1)} \in \{I\!I, X\!X, Y\!Y, Z\!Z\}\big)\ \text{and}\ \big(Q_{(0,3)} \in \{I\!I, X\!X, Y\!Y, Z\!Z\}\big). \]
  • Counting “good” errors from the depolarizing channel:
  • Each two-qubit depolarizing channel yields:
    • Identity with probability 1−p,
    • Each of the 15 non-identity two-qubit Paulis with probability p/15.
  • Among these 16 possibilities, the ones that keep the Bell state invariant on a given pair are exactly {II, XX, YY, ZZ}, i.e., 1 (identity) + 3 non-identity.
  • Hence, for one channel,
\[ \Pr[\text{good on a given pair}] = (1-p) + 3\cdot\frac{p}{15} = 1 - \frac{4p}{5}. \]
  • Independence across the two CNOTs:
  • The two error channels act on disjoint pairs and are independent, so the total fidelity is the product of the “good” probabilities:
\[ F_{\text{phys}}(p) = \left(1 - \frac{4p}{5}\right)^2. \]
  1. Mathematical Typesetting
  • All expressions above are typeset in LaTeX.
  1. Conventions and Units
  • Qubit labels and gate conventions follow the problem statement. The Hadamards are assumed ideal; only the two CNOTs are followed by depolarizing noise.
  1. Final Answer: F_phys(p) = (1 - 4p/5)^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
  1. Step-by-Step Derivation
  • Circuit and ideal output:
  • Gates (right-to-left): H2, CNOT2→1 prepare a Bell pair on qubits (2,1); H0, CNOT0→3 prepare a Bell pair on qubits (0,3).
  • Ideal 4-qubit state: |Φ+⟩21 ⊗ |Φ+⟩03, stabilized by {X2X1, Z2Z1} and {X0X3, Z0Z3}.
  • This state lies in the [[4,2,2]] code space (stabilizers XXXX, ZZZZ) and encodes the logical Bell state (|00⟩AB + |11⟩AB)/√2.

  • Noise model and error structure:

  • After each CNOT, a 2-qubit depolarizing channel acts on the corresponding pair: on (2,1) and on (0,3), independently.
  • Each channel outputs:
    • II with probability 1 − p,
    • each of the 15 non-identity 2-qubit Paulis with probability p/15.
  • Let P act on (2,1) and Q on (0,3). The net physical error is E = P ⊗ Q.

  • Post-selection (detectable errors discarded):

  • We “accept” (keep) runs that yield +1 for both code stabilizers XXXX and ZZZZ.
  • Since XXXX = (X2X1)(X0X3) and ZZZZ = (Z2Z1)(Z0Z3), commutation with E factorizes by pairs.
  • For a two-qubit Pauli R, define sX(R) = +1 if R commutes with X⊗X, and −1 if it anticommutes; sZ(R) = +1 if R commutes with Z⊗Z, and −1 if it anticommutes.
  • Acceptance condition is equivalently sX(P) = sX(Q) and sZ(P) = sZ(Q).

  • Classifying two-qubit Paulis by (sX, sZ):

  • Using single-qubit commutation (I: ++, X: +−, Z: −+, Y: −−), the 16 two-qubit Paulis partition into four classes:
    • ++ : {II, XX, YY, ZZ} (4 total; 3 non-identity),
    • +− : {IX, XI, ZY, YZ} (4),
    • −+ : {IZ, ZI, XY, YX} (4),
    • −− : {IY, YI, XZ, ZX} (4).
  • Acceptance requires P and Q be in the same class (including the identity, which is in ++).

  • Acceptance probability Ppass:

  • Cases contributing to acceptance: 1) No error: (1 − p)^2. 2) Exactly one non-identity error: must be in ++ (3 of 15) to pass; either pair can have it: 2 × (1 − p) × (3p/15) = 2(1 − p)(p/5). 3) Two non-identity errors: both must be in the same class:
    • ++: 3 × 3 = 9 pairs,
    • +−: 4 × 4 = 16,
    • −+: 4 × 4 = 16,
    • −−: 4 × 4 = 16, total 57, giving 57(p/15)^2.
  • Therefore
\[ \]
  • Logical action of accepted errors and “good” events:
  • The target logical state |Φ+⟩AB is stabilized by X_A X_B and Z_A Z_B (and hence also by Y_A Y_B).
  • Errors that are logically harmless (i.e., keep |Φ+⟩AB unchanged) are those whose logical action is in the set
\[ \mathcal{G} = \{I,\; X_A X_B,\; Z_A Z_B,\; Y_A Y_B\} \times \mathcal{S}, \]
where 𝒮 is the code stabilizer.
  • For class ++ on a single pair:
    • On (2,1): XX = X2X1 = X_A X_B, ZZ = Z2Z1 = Z_A Z_B, YY = Y2Y1 = Y_A Y_B (up to phases); similarly on (0,3).
    • Hence any accepted event with P, Q ∈ ++ (including identity on either side) yields E ∈ 𝒮 × 𝒢 and is logically harmless.
  • For the other classes:
    • +− on both pairs yields a single logical X (either X_A or X_B) up to 𝒮 (e.g., P=XI on (2,1), Q=XI on (0,3) gives E = X0X1 = X_B).
    • −+ on both pairs yields a single logical Z (either Z_A or Z_B) up to 𝒮.
    • −− on both pairs yields a single logical Y (either Y_A or Y_B) up to 𝒮.
    • Any single-logical Pauli flips at least one of {X_A X_B, Z_A Z_B}, thus maps |Φ+⟩AB to an orthogonal Bell state.
  • Therefore, among accepted events, the only “good” ones (that keep the logical state) are exactly those with P,Q ∈ ++ (including identity).
  • Probability of “good” accepted events:
\[ \]
  • Logical state fidelity conditioned on acceptance:
\[ \]
  • Small-p behavior (useful check): since first-order errors are detected, the leading infidelity is quadratic:
\[ F_{\text{logical}}(p) = 1 - \frac{16}{75}p^2 + O(p^3). \]
  1. Mathematical Typesetting

All equations have been typeset in LaTeX.

  1. Conventions and Units
  • Qubit labels and logical operator identifications follow the problem statement.
  • Only the two CNOT gates are noisy; Hadamards are ideal; post-selection is assumed perfect.
  1. Final Answer: F_logical(p) = [(1 - 4p/5)^2] / [1 - (8/5)p + (64/75)p^2], with small-p expansion F_logical(p) = 1 - (16/75)p^2 + O(p^3).
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 - sp.Rational(4, 5)*p)**2 / (1 - sp.Rational(8, 5)*p + sp.Rational(64, 75)*p**2)
    # ---------------------------------------------------------------

    return F_logical