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

  • Noise model and goal

Each CNOT in the circuit is followed by an independent two-qubit depolarizing channel on the same two qubits that, with probability p, applies one of the 15 non-identity two-qubit Pauli operators equiprobably (probability p/15 each), and with probability 1 − p applies identity. We are asked for the physical state fidelity F(p) = ⟨ψideal|ρout|ψideal⟩ of the final 4-qubit state produced by the noisy circuit with respect to the ideal state produced by the same circuit without noise.

  • Ideal state prepared by the circuit

Circuit (right-to-left order): H2 → CNOT21 → H0 → CNOT03, acting on |0000⟩.

Use H|0⟩ = (|0⟩ + |1⟩)/√2 and that CNOT flips the target iff the control is |1⟩. (en.wikipedia.org)

1) After H2: |ψ1⟩ = |0⟩0 |0⟩1 (|0⟩2 + |1⟩2)/√2 |0⟩3 = (|0000⟩ + |0110⟩)/√2.

2) After CNOT21 (control 2, target 1): already included above; |ψ1⟩ = (|0000⟩ + |0110⟩)/√2.

3) After H0: |ψ2⟩ = (1/2)(|0000⟩ + |1000⟩ + |0110⟩ + |1110⟩).

4) After CNOT03 (control 0, target 3): |ψideal⟩ = (1/2)(|0000⟩ + |1001⟩ + |0110⟩ + |1111⟩).

Recognize this as a tensor product of two Bell states (on qubit pairs 0–3 and 1–2): |ψideal⟩ = |Φ+⟩03 ⊗ |Φ+⟩12 with |Φ+⟩ = (|00⟩ + |11⟩)/√2. (en.wikipedia.org)

  • Where the noise acts

The depolarizing channels act: - after CNOT21 on qubits (2,1) (i.e., the pair 1–2), and - after CNOT03 on qubits (0,3) (the pair 0–3).

No subsequent gates touch those qubits across pairs, so the two error channels act independently on the two disjoint Bell pairs and do not propagate to the other pair.

  • Fidelity for a single Bell pair under a two-qubit depolarizing channel

Let ρ = |Φ+⟩⟨Φ+| and apply the two-qubit depolarizing channel once: Λ(ρ) = (1 − p)ρ + (p/15)∑P≠I PρP, where the sum ranges over the 15 non-identity two-qubit Paulis on that pair (as stated in the problem). The state fidelity with respect to |Φ+⟩ is

Fpair(p) = ⟨Φ+|Λ(ρ)|Φ+⟩ = (1 − p) + (p/15)∑P≠I |⟨Φ+|P|Φ+⟩|^2.

For |Φ+⟩, the only two-qubit Paulis with nonzero expectation are X ⊗ X, Y ⊗ Y, Z ⊗ Z, with eigenvalues +1, −1, +1, respectively; all other two-qubit Paulis have expectation 0. Therefore ∑P≠I |⟨Φ+|P|Φ+⟩|^2 = 1^2 + (−1)^2 + 1^2 = 3.

Hence Fpair(p) = (1 − p) + (p/15)·3 = 1 − (4/5)p.

  • Total 4-qubit fidelity

The final ideal state is |Φ+⟩03 ⊗ |Φ+⟩12 and the two depolarizing channels act independently on 03 and 12. The overall fidelity is therefore the product of the independent pair fidelities: F(p) = Fpair(p)^2 = [1 − (4/5)p]^2.

As a quick consistency check: at p = 1, each pair has fidelity 3/15 = 1/5 with |Φ+⟩, so the 4-qubit fidelity is (1/5)^2 = 1/25 = 0.04, which matches F(1) = [1 − 4/5]^2 = (1/5)^2.

2) Mathematical Typesetting

  • Key equations provided above in LaTeX form.

3) Conventions and Units

  • Qubits labeled 0,1,2,3; CNOTij has control i and target j; H as standard Hadamard; Bell state definition |Φ+⟩ = (|00⟩ + |11⟩)/√2. (en.wikipedia.org)

4) Final Answer: F(p) = [1 − (4/5)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
Tool Call (code to execute)
from itertools import product
letters = ['I','X','Y','Z']
# mapping: (vX, vZ) bits for a single site relative to X and Z anticommute parity
bit = {'I':(0,0),'X':(0,1),'Y':(1,1),'Z':(1,0)}
# two-qubit on a pair (ordered letters)
all_pairs = [(a,b) for a in letters for b in letters]
# exclude identity pair
nonid_pairs = [p for p in all_pairs if not (p[0]=='I' and p[1]=='I')]
# compute parity class for each pair
par = lambda p: ((bit[p[0]][0]^bit[p[1]][0]), (bit[p[0]][1]^bit[p[1]][1]))
from collections import Counter
cnt = Counter(par(p) for p in nonid_pairs)
print('counts per parity on a pair:', cnt)
# Accept if par(P)==par(Q)
nonid_pairs_list = nonid_pairs
N_acc = 0
N_good = 0
acc_examples = []
for P in nonid_pairs_list:
    for Q in nonid_pairs_list:
        # acceptance if par(P)==par(Q)
        if par(P)==par(Q):
            N_acc += 1
            # good if both parities are (0,0)
            if par(P)==(0,0):
                N_good += 1
                acc_examples.append((P,Q))

print('N_acc', N_acc, 'N_good', N_good)
# sanity: examples
print('first few good examples:', acc_examples[:6])
Tool #5
counts per parity on a pair: Counter({(0, 1): 4, (1, 1): 4, (1, 0): 4, (0, 0): 3})
N_acc 57 N_good 9
first few good examples: [(('X', 'X'), ('X', 'X')), (('X', 'X'), ('Y', 'Y')), (('X', 'X'), ('Z', 'Z')), (('Y', 'Y'), ('X', 'X')), (('Y', 'Y'), ('Y', 'Y')), (('Y', 'Y'), ('Z', 'Z'))]
Assistant #6
Tool Call (code to execute)
import sympy as sp
p=sp.symbols('p')
Pacc=(1-p)**2 + (6/15)*p*(1-p) + (57/(15**2))*p**2
Pgood=(1-p)**2 + (6/15)*p*(1-p) + (9/(15**2))*p**2
F=sp.simplify(Pgood/Pacc)
sp.simplify(F)
print('F=',sp.together(F))
print('expanded numerator=',sp.expand(sp.together(F).as_numer_denom()[0]))
print('expanded denominator=',sp.expand(sp.together(F).as_numer_denom()[1]))
Tool #7
F= (0.64*p**2 - 1.6*p + 1.0)/(0.853333333333333*p**2 - 1.6*p + 1.0)
expanded numerator= 0.64*p**2 - 1.6*p + 1.0
expanded denominator= 0.853333333333333*p**2 - 1.6*p + 1.0
Assistant #8

1) Step-by-Step Derivation

  • Setup, code and circuit

  • [[4,2,2]] code: stabilizers S = ⟨XXXX, ZZZZ⟩. The codespace is the simultaneous +1 eigenspace of these two commuting generators. (ar5iv.labs.arxiv.org, en.wikipedia.org)

  • Logical GHZ target on logical qubits A,B: (|00⟩AB + |11⟩AB)/√2.
  • Circuit (right-to-left action): H2 → CNOT21 → H0 → CNOT03 on input |0000⟩.

  • Ideal output state of the circuit

Apply H and CNOT pairwise: 1) H2; CNOT21 prepares a Bell pair on qubits (2,1): |Φ+⟩12. 2) H0; CNOT03 prepares another Bell pair on qubits (0,3): |Φ+⟩03.

Therefore the ideal 4-qubit output is

\[ \]

The Bell state |Φ+⟩ is stabilized by XX and ZZ (equivalently by {II, XX, ZZ, −YY} with generators XX, ZZ). Hence

\[ (X_0X_3X_1X_2)|\psi_{\text{ideal}}\rangle=(X^{\otimes 4})|\psi_{\text{ideal}}\rangle=|\psi_{\text{ideal}}\rangle, \]
\[ (Z_0Z_3Z_1Z_2)|\psi_{\text{ideal}}\rangle=(Z^{\otimes 4})|\psi_{\text{ideal}}\rangle=|\psi_{\text{ideal}}\rangle, \]

so the state lies in the [[4,2,2]] codespace. (en.wikipedia.org, medium.com, errorcorrectionzoo.org)

  • Noise model

Each CNOT gate is followed by an independent two-qubit depolarizing channel on the same two qubits that, with probability p, applies one of the 15 non-identity two-qubit Pauli operators uniformly (probability p/15 each), and with probability 1−p applies identity. This is the standard “Pauli version” of a two-qubit depolarizing channel. (en.wikipedia.org, quantumchannelzoo.org)

Since the only two-qubit gates are CNOT21 and CNOT03 and the errors occur after these gates, the final error has the form

\[ E = P_{03}\otimes Q_{12}, \]

where each of P03, Q12 ∈ {II, IX, IY, IZ, XI, …, ZZ} and independently equals II with probability 1−p and any non-identity two-qubit Pauli with probability p/15.

  • Post-selection (“detect and discard”)

We post-select on the “no-error-detected” syndrome, i.e., both stabilizer measurements XXXX and ZZZZ return +1. For a Pauli error E, this occurs iff E commutes with both stabilizer generators; otherwise it anticommutes with at least one and is rejected. (learning.quantum.ibm.com, en.wikipedia.org)

  • Commutation bookkeeping by parity classes

For a two-qubit Pauli on a pair (say, qubits a,b), define the parity vector

\[ \pi(P_{ab})=\big(\pi_Z(P_{ab}),\,\pi_X(P_{ab})\big)\in\{0,1\}^2, \]

where πZ(Pab) is 1 iff Pab anticommutes with Z⊗Z on that pair, and πX(Pab) is 1 iff Pab anticommutes with X⊗X on that pair.

Using the binary (symplectic) representation of Paulis, the parity components are just the XOR of the single-qubit “Z-part” and “X-part” bits across the two sites. Concretely, for single-qubit L∈{I,X,Y,Z}, write bits b(L)=(vZ,vX) with I:(0,0), X:(0,1), Y:(1,1), Z:(1,0). Then for a pair Pab = La⊗Lb,

\[ \pi(P_{ab}) = b(L_a)\oplus b(L_b). \]

The full 4-qubit error E = P03⊗Q12 commutes with X⊗4 (resp. Z⊗4) iff the X-parities (resp. Z-parities) of the two pairs match. Thus,

\[ E\ \text{is accepted} \iff \pi(P_{03})=\pi(Q_{12}). \]

This parity/symplectic-commutation correspondence is standard in stabilizer theory. (en.wikipedia.org)

  • Enumerating parity classes on one pair

The 15 non-identity two-qubit Paulis on a given pair split into four parity classes:

\[ \text{class} & \# \\ \hline \pi=(0,0)\ \text{(commutes with both XX, ZZ)} & 3\ \ (\{XX,YY,ZZ\})\\ \pi=(0,1) & 4\\ \pi=(1,0) & 4\\ \pi=(1,1) & 4 \]

(Easy to check by the XOR rule, or by listing.) The class (0,0) is exactly the nontrivial stabilizer of |Φ+⟩ on that pair, so acting with any of {XX,YY,ZZ} maps |Φ+⟩ to ±|Φ+⟩. (medium.com)

  • Which accepted errors are “good” (i.e., preserve the target state)?

Since the ideal state is |Φ+⟩03⊗|Φ+⟩12 and the 16 Bell-product states form an orthonormal basis, an accepted error E has nonzero overlap with the target if and only if it preserves each pair’s |Φ+⟩ up to a global phase; otherwise it maps at least one pair to a different Bell state orthogonal to |Φ+⟩, yielding zero overlap. Therefore: - On a single pair, “good” non-identity Paulis are exactly {XX,YY,ZZ}, i.e., class (0,0). - For the full error E = P03⊗Q12, - Acceptance requires π(P03)=π(Q12). - Goodness (nonzero overlap) requires P03∈{XX,YY,ZZ} and Q12∈{XX,YY,ZZ}. Hence among accepted double errors, only the 3×3=9 choices are good; the other accepted classes (matching non-(0,0) parities) are logical errors that change the encoded state within the codespace. (medium.com)

  • Counting accepted vs. good events by error weight

Let “weight” mean how many gates suffered a non-identity two-qubit Pauli. - Weight 0: probability (1−p)^2. Accepted and good. - Weight 1: exactly one of the two gates has a non-identity 2-qubit Pauli. - Acceptance requires that single-pair error be in class (0,0), i.e., one of {XX,YY,ZZ}. Count per gate = 3 of the 15 possibilities; with two gates total, accepted singles = 2×3. - All such singles are good because {XX,YY,ZZ} stabilizes |Φ+⟩ on that pair. Probability contribution: 2·(p/15)·(1−p)·3 = (6/15)p(1−p). Accepted = good. - Weight 2: both gates have non-identity 2-qubit Paulis. - Acceptance requires parity match across pairs. Using the class counts above, total accepted ordered pairs = 3·3 + 4·4 + 4·4 + 4·4 = 9 + 16 + 16 + 16 = 57. - Good among these are exactly 3·3 = 9 (both in class (0,0)). Probability contribution: (p/15)^2 times the respective counts.

Therefore

\[ P_{\text{acc}}(p) &= (1-p)^2 + \frac{6}{15}p(1-p) + \frac{57}{15^2}p^2,\\ P_{\text{good}}(p) &= (1-p)^2 + \frac{6}{15}p(1-p) + \frac{9}{15^2}p^2. \]
  • Logical-state fidelity under post-selection

Conditioning on acceptance, the (normalized) post-selected state is a classical mixture over accepted Pauli-error images. The only terms with nonzero overlap with |ψideal⟩ are the “good” ones above; all other accepted terms are orthogonal (they are other Bell-product basis states). Hence the logical-state fidelity equals the good fraction of accepted shots:

\[ F_{\text{logical}}(p)=\frac{P_{\text{good}}(p)}{P_{\text{acc}}(p)}. \]

Plugging in and simplifying,

\[ F_{\text{logical}}(p) &= \frac{(1-p)^2 + \frac{6}{15}p(1-p) + \frac{9}{225}p^2} {(1-p)^2 + \frac{6}{15}p(1-p) + \frac{57}{225}p^2}\\[2mm] &= \frac{75 - 120p + 48p^2}{75 - 120p + 64p^2}. \]

Series at small p: \(F_{\text{logical}}(p)=1 - \frac{16}{75}p^2 + O(p^3)\), i.e., all single-gate errors are detected and discarded; logical infidelity appears only at order p^2.

2) Mathematical Typesetting

  • All key relations shown above in LaTeX.

3) Conventions and Units

  • Qubits labeled 0,1,2,3; stabilizers XXXX and ZZZZ; Bell-state facts (stabilizers XX, ZZ) and stabilizer-code detection rule (anticommute ⇒ detected) used as standard. (medium.com, learning.quantum.ibm.com)

4) Final Answer:

\[ F_{\text{logical}}(p)=\frac{75 - 120\,p + 48\,p^2}{75 - 120\,p + 64\,p^2}. \]

This satisfies Flogical(0)=1 and, to lowest order, 1−Flogical(p)=\tfrac{16}{75}p^2+O(p^3).

User #9

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 #10
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 = (75 - 120*p + 48*p**2)/(75 - 120*p + 64*p**2)
    # ---------------------------------------------------------------

    return F_logical