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. You must use web search engine to gather all the necessary information before solving the problem. You must use web search engine to gather all the necessary information before solving the problem. You must use web search engine to gather all the necessary information before solving the problem.

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
  • Circuit and noise model
  • Circuit (right-to-left): H2 → CNOT21 → H0 → CNOT03. Only the two CNOTs are noisy. Each CNOT is followed by a 2-qubit depolarizing channel acting on its two qubits that applies one of the 15 non-identity 2-qubit Paulis with probability p/15 (and identity with probability 1 − p).
  • State fidelity with a pure target |ψ⟩ is F = ⟨ψ|ρ|ψ⟩, where ρ is the actual (mixed) output state. This follows from the standard fidelity definition specialized to a pure state. (docs.quantum.ibm.com)

  • Ideal (noiseless) output state

  • The pair (2,1) after H2–CNOT21 is a Bell state |Φ+⟩ = (|00⟩+|11⟩)/√2. Likewise, the pair (0,3) after H0–CNOT03 is another |Φ+⟩. Hence the final 4-qubit ideal state factorizes as
\[ |\psi_{\text{ideal}}\rangle = |\Phi^+\rangle_{03}\otimes|\Phi^+\rangle_{12}. \]
The fact that H on the control followed by CX prepares |Φ+⟩ and that |Φ+⟩ is stabilized by XX and ZZ is standard (and shown explicitly in the cited example). ([docs.quantum.ibm.com](https://docs.quantum.ibm.com/api/qiskit/qiskit.quantum_info.StabilizerState?utm_source=openai), [qubit.guide](https://qubit.guide/7.2-pauli-stabilisers.html?utm_source=openai))
  • Stabilizer facts we will use
  • For any stabilizer state |ψ⟩ and any Pauli P, ⟨ψ|P|ψ⟩ = 0 unless P ∈ ±Stab(|ψ⟩), in which case ⟨ψ|P|ψ⟩ = ±1. (arxiv.org)
  • For |Φ+⟩, a generating set of stabilizers is {XX, ZZ}; their product gives −YY, so the non-identity Paulis with |⟨Φ+|P|Φ+⟩| = 1 are exactly {XX, ZZ, YY}. (qubit.guide)

  • One noisy CNOT (single pair) contribution

  • Consider one Bell pair (say qubits 1–2). The 2-qubit depolarizing channel selects:
    • Identity with probability 1 − p (fidelity contribution = 1).
    • A non-identity two-qubit Pauli with probability p/15. Among the 15 possibilities, exactly 3 (XX, ZZ, YY) satisfy |⟨Φ+|P|Φ+⟩|^2 = 1; the other 12 give 0.
  • Therefore the fidelity for a single Bell pair after one noisy CNOT is
\[ F_{\text{pair}}(p) = (1-p)\cdot 1 + \frac{p}{15}\cdot 3\cdot 1 = 1 - \frac{4p}{5}. \]
  • Two independent noisy CNOTs on disjoint pairs
  • The overall ideal state factorizes as |ψideal⟩ = |Φ+⟩03 ⊗ |Φ+⟩12, and the noise acts independently on the two disjoint pairs. Fidelity for product states factorizes:
\[ F\big(\rho_1\!\otimes\!\rho_2,\sigma_1\!\otimes\!\sigma_2\big) = F(\rho_1,\sigma_1)\,F(\rho_2,\sigma_2). \]
Hence the total fidelity equals the product of the two single-pair fidelities, i.e.,
\[ F_{\text{total}}(p) = \big[F_{\text{pair}}(p)\big]^2 = \left(1-\frac{4p}{5}\right)^2. \]
([eu-de.quantum.cloud.ibm.com](https://eu-de.quantum.cloud.ibm.com/learning/courses/general-formulation-of-quantum-information/purifications-and-fidelity/fidelity?utm_source=openai))
  • Direct counting cross-check (same result)
  • Expanding the product gives
\[ \]
which is identical to (1 − 4p/5)^2.
  • Interpretation: the three “good” Pauli errors per pair (XX, ZZ, YY) preserve the corresponding Bell state up to a phase (hence unit overlap magnitude); all other single- or weight-2 Paulis are orthogonal in expectation and do not contribute to fidelity. (arxiv.org, qubit.guide)
  1. Mathematical Typesetting

All equations provided above use LaTeX.

  1. Conventions and Units
  • Qubits ordered as (0,1,2,3); pairs affected by noisy CNOTs are (2,1) and (0,3).
  • Fidelity is dimensionless.
  1. Final Answer:
\[ F_{\text{physical}}(p) = \left(1 - \frac{4p}{5}\right)^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
  1. Step-by-Step Derivation
  • Circuit, target, and noise model
  • Circuit (right-to-left): H2 → CNOT21 → H0 → CNOT03. Only the two CNOTs are noisy, each followed by a two-qubit depolarizing channel that applies one of the 15 non-identity two-qubit Paulis with probability p/15 (identity with probability 1 − p). The fidelity with a pure target |ψ⟩ is F = ⟨ψ|ρ|ψ⟩. The “Bell-state from H+CNOT” fact will be used below. (en.wikipedia.org)
  • The [[4,2,2]] code has stabilizers {XXXX, ZZZZ}. We will post-select on the +1 outcomes of both, i.e., accept no detectable errors. (errorcorrectionzoo.org)

  • Ideal (noiseless) output state and its relation to the code

  • H2–CNOT21 prepares a Bell pair |Φ+⟩ on qubits (2,1), and H0–CNOT03 prepares |Φ+⟩ on qubits (0,3). Hence the ideal four-qubit state is
\[ |\Psi_{\rm ideal}\rangle=|\Phi^+\rangle_{03}\otimes|\Phi^+\rangle_{12}. \]
Each Bell pair |Φ+⟩ is stabilized by XX and ZZ; therefore the product state is stabilized by XXXX and ZZZZ and lies in the [[4,2,2]] codespace. ([en.wikipedia.org](https://en.wikipedia.org/wiki/Bell_state?utm_source=openai), [learning.quantum.ibm.com](https://learning.quantum.ibm.com/course/foundations-of-quantum-error-correction/the-stabilizer-formalism?utm_source=openai))
  • How Pauli errors act on a Bell pair
  • The Bell state |Φ+⟩ on a given pair is stabilized by the group ⟨X⊗X, Z⊗Z⟩ = {I⊗I, X⊗X, Z⊗Z, −Y⊗Y}. Conjugating |Φ+⟩ by any of these leaves it invariant (up to a phase); the other three cosets of this group map |Φ+⟩ to the other three Bell states. Thus, after a single two-qubit depolarizing channel:

    • P(Φ+) = (1 − p) + 3·(p/15) = 1 − 4p/5,
    • P(Φ−) = P(Ψ+) = P(Ψ−) = 4p/15. This uses that two-qubit Paulis partition into four size-4 cosets of the Bell stabilizer, with exactly three non-identity elements in the stabilizer coset. (learning.quantum.ibm.com)
  • What “no detectable error” means for this preparation

  • The code stabilizers factor as XXXX = (XX)03 ⊗ (XX)12 and ZZZZ = (ZZ)03 ⊗ (ZZ)12. Measuring XXXX (ZZZZ) on the product of two Bell pairs returns the product of the XX (ZZ) eigenvalues of the two pairs. Consequently, the post-selection “+1 for XXXX and ZZZZ” accepts exactly those outcomes where the two pairs land in the same Bell state (Φ+ with Φ+, or Φ− with Φ−, or Ψ+ with Ψ+, or Ψ− with Ψ−). This follows from standard Pauli-commutation/syndrome logic for stabilizer codes. (errorcorrectionzoo.org, learning.quantum.ibm.com)

  • Logical state given acceptance and the resulting logical fidelity

  • Upon acceptance, the logical two-qubit state (A,B) is the Bell state corresponding to the common Bell type of the physical pairs (since the logical observables X_A X_B ≡ IXXI and Z_A Z_B ≡ IZZI act on the 12 pair). Therefore, the logical fidelity with the target logical Bell |Φ+⟩_{AB} equals the conditional probability that both physical pairs are Φ+.
  • Let a ≡ 1 − 4p/5 and b ≡ 4p/15. For the two independent pairs:
    • P(accept) = a^2 + 3 b^2,
    • P(both Φ+) = a^2.
  • Hence the post-selected logical fidelity is
\[ =\frac{(1-\tfrac{4p}{5})^2}{(1-\tfrac{4p}{5})^2+3(\tfrac{4p}{15})^2} \]
Small‑p expansion: $F_{\rm logical}(p)=1-\tfrac{16}{75}p^2+O(p^3)$, i.e., logical errors are second order once all detectable errors are discarded. (Uses independence of the two noisy CNOTs and the Bell‑stabilizer eigenvalue table.) ([en.wikipedia.org](https://en.wikipedia.org/wiki/Bell_state?utm_source=openai), [learning.quantum.ibm.com](https://learning.quantum.ibm.com/course/foundations-of-quantum-error-correction/the-stabilizer-formalism?utm_source=openai))
  1. Mathematical Typesetting

All mathematics is typeset in LaTeX above.

  1. Conventions and Units
  • Qubit order (0,1,2,3). Pairs (0,3) and (1,2).
  • Fidelity is dimensionless.
  1. Final Answer:
\[ \]
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(4, 5)*p)**2 + 3*(sp.Rational(4, 15)*p)**2)
    # ---------------------------------------------------------------

    return F_logical