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

Goal and noise model - We prepare the 4-qubit physical state using the circuit CNOT03 · H0 · CNOT21 · H2 where H gates are ideal and each CNOTij is followed by an independent 2-qubit depolarizing channel that, with probability p, applies one of the 15 non-identity 2-qubit Paulis uniformly (probability p/15 each), and with probability 1−p applies the identity. This is the standard “uniform Pauli” form of an n=2 depolarizing channel (4^2−1=15), used widely in simulators; see, e.g., Qiskit’s depolarizing_error construction and discussion of uniform Pauli channels. (qiskit-org-web-resources.s3.us.cloud-object-storage.appdomain.cloud, en.wikipedia.org)

  • The ideal target state is the encoded logical Bell (GHZ of two logical qubits) state |Φ+⟩AB = (|00⟩AB + |11⟩AB)/√2 inside the [[4,2,2]] code whose stabilizers are XXXX and ZZZZ. (errorcorrectionzoo.org)

Identify the stabilizer of the prepared state - The logical-Bell state is stabilized by the logical operators XAXB and ZAZB. With the given logicals, ZAZB = (ZZII)(ZIZI) = IZZI, XAXB = (XIXI)(XXII) = IXXI. - Together with the code stabilizers XXXX and ZZZZ, a convenient generating set for the stabilizer of the final ideal 4-qubit state is g1 = XXXX, g2 = ZZZZ, g3 = IXXI, g4 = IZZI. Hence the (pure) ideal state |ψ⟩ is the unique +1 eigenstate of the Abelian group Sψ = ⟨g1, g2, g3, g4⟩ with |Sψ| = 16.

Useful fact about stabilizer states - For any stabilizer state |ψ⟩ and any Pauli P, ⟨ψ|P|ψ⟩ = 0 unless P ∈ ±Sψ; if P ∈ ±Sψ, then P|ψ⟩ = ±|ψ⟩, so the density matrix is unchanged by conjugation with P. Consequently, when a classical mixture of Pauli errors is applied, the state fidelity with |ψ⟩ equals the total probability weight of those Pauli errors that lie in ±Sψ. (arxiv.org)

Where the two error channels act and why they commute with later gates - The error after CNOT21 acts only on qubits {2,1}; no later gate touches these qubits, since H0 acts on 0 and CNOT03 acts on {0,3}. The error after CNOT03 acts only on {0,3} and is last in the circuit. Therefore the total error at the end is a tensor product E = P21 ⊗ Q03, with P21 ∈ {two-qubit Paulis on (2,1)} and Q03 ∈ {two-qubit Paulis on (0,3)}, chosen independently with the probabilities specified above.

Classify which Pauli errors stabilize the ideal state - We need all elements of Sψ that factor as operators supported on (1,2) and/or (0,3). Using the generators: • Elements supported only on (1,2): {I, X1X2, Y1Y2, Z1Z2} = {I, g3, g3g4, g4}. • Elements supported only on (0,3): {I, X0X3, Y0Y3, Z0Z3} = {I, g1g3, g1g2g3g4, g2g4}. • The remaining 9 elements of Sψ act nontrivially on both pairs (0,3) and (1,2).

Compute the fidelity as a probability sum Let p be the error rate per two-qubit gate.

  • Case A: No error on either gate (identity on both pairs). Probability: (1−p)^2. This yields E = I ∈ Sψ, so contributes (1−p)^2.

  • Case B: Exactly one gate has a non-identity error. Suppose (2,1) has the error and (0,3) is identity. Then E ∈ Sψ iff P21 ∈ {X1X2, Y1Y2, Z1Z2}, i.e., 3 of the 15 non-identity two-qubit Paulis. Probability contribution: (1−p) × p × (3/15). The same holds if only (0,3) errs, giving an identical contribution. Total for Case B: 2 × (1−p) × p × (3/15).

  • Case C: Both gates have non-identity errors. Then E ∈ Sψ iff P21 ⊗ Q03 equals one of the 9 stabilizers that act nontrivially on both pairs. There are 9 favorable pairs out of 15×15 total. Probability contribution: 9 × (p/15)^2.

Sum all three cases:

\[ \begin{aligned} F(p) &= (1-p)^2 \;+\; 2(1-p)\,p\left(\frac{3}{15}\right) \;+\; 9\left(\frac{p}{15}\right)^2 \\ &= (1-p)^2 \;+\; \frac{2p(1-p)}{5} \;+\; \frac{p^2}{25}. \end{aligned} \]

Simplify:

\[ F(p) = 1 - \frac{8}{5}\,p + \frac{16}{25}\,p^2. \]

Checks - Small p: F(p) ≈ 1 − (8/5)p, meaning a linear coefficient reduced from 2 (two gates) because a 3/15 fraction of single-gate Pauli errors stabilize the target state. - p = 1: F(1) = 1/25 = 9/225, matching the fraction of 2-gate error pairs that land in Sψ (9 of 225).

2) Mathematical Typesetting

All equations are presented above in LaTeX.

3) Conventions and Units

We use the standard Pauli group conventions and the stabilizer formalism; the two-qubit depolarizing channel is the uniform Pauli channel over 15 non-identity two-qubit Paulis. (qiskit-org-web-resources.s3.us.cloud-object-storage.appdomain.cloud)

4) Final Answer: F(p) = 1 − (8/5)p + (16/25)p^2

References: - [[4,2,2]] code stabilizers XXXX and ZZZZ; codeword structure. Error Correction Zoo, “[[4,2,2]] Four-qubit code.” (errorcorrectionzoo.org) - Bell state stabilizers are +XX and +ZZ (illustrated in Qiskit StabilizerState docs). (docs.quantum.ibm.com) - Two-qubit depolarizing = uniform Pauli over 4^n−1 non-identity Paulis. Qiskit Aer standard_errors; Wikipedia depolarizing channel background. (qiskit-org-web-resources.s3.us.cloud-object-storage.appdomain.cloud, en.wikipedia.org) - Expectation of Pauli on a stabilizer state is zero unless the Pauli is (±) in the stabilizer group. (arxiv.org)

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

Setup and noise model - We run the 4‑qubit circuit (right-to-left) (CNOT03)(H0)(CNOT21)(H2), with ideal single-qubit H’s. Each CNOT is followed by an independent 2‑qubit depolarizing channel: with probability 1−p nothing happens and with probability p one of the 4^2−1=15 non-identity two‑qubit Pauli operators is applied uniformly (p/15 each). This is the standard n‑qubit depolarizing channel. [Cirq documentation spells this out; identical definition is used widely.] (quantumai.google)

  • The code is the [[4,2,2]] code with stabilizer generators S=⟨XXXX, ZZZZ⟩. Its codespace is the simultaneous +1 eigenspace of these two operators. (errorcorrectionzoo.org)

  • The target logical state is the logical Bell state |Φ+〉AB=(|00〉AB+|11〉AB)/√2, which (at the logical level) is stabilized by XAXB and ZAZB; equivalently the physical state prepared by the circuit is a 4‑qubit stabilizer state whose stabilizer contains {XXXX, ZZZZ} together with logical-Bell stabilizers mapped into the code. For the 2‑qubit Bell state itself, the (phase-free) stabilizer set is {II, XX, ZZ} (with −YY also in the full Pauli stabilizer group), so XX and ZZ generate it. (quantumcomputing.stackexchange.com)

Where the errors land - No gate after CNOT21 touches qubits 2 or 1, and CNOT03 is last and only touches qubits 0 and 3. Hence the total Pauli error at the end factors as E = P21 ⊗ Q03, with P21 acting on qubits {2,1} and Q03 on {0,3}, independently drawn per the depolarizing model above.

Post-selection rule (detect-then-keep) - “Post-select on all detectable errors” means we discard any run whose final stabilizer measurements report a nontrivial syndrome. For Pauli errors, an error is undetected exactly when it commutes with every stabilizer generator; i.e., E lies in the centralizer/normalizer N(S) of S in the 4‑qubit Pauli group. If E∉N(S), at least one generator anticommutes with E and yields a −1 outcome, so we reject the run. (en.wikipedia.org)

Commutation constraints in parity form - Represent a Pauli string by binary “X- and Z-parity” indicators: for each qubit j, let xj=1 if the local Pauli is X or Y and zj=1 if it is Z or Y (else 0). A Pauli E commutes with XXXX iff the total parity of {Z,Y} across all four qubits is even, i.e., ∑j zj≡0 (mod 2). It commutes with ZZZZ iff ∑j xj≡0 (mod 2). This is the standard symplectic-commutation rule in the stabilizer formalism. (en.wikipedia.org)

Classify two-qubit Paulis on a given pair - For any fixed pair, say (2,1), group the 16 Paulis (including II) by the two parities (a,b)≡(∑xj mod 2, ∑zj mod 2) on that pair: • Class 00: {II, XX, YY, ZZ} (size 4; among these, the 3 non-identity are XX, YY, ZZ) • Class 10: {XI, IX, YZ, ZY} (size 4) • Class 01: {ZI, IZ, XY, YX} (size 4) • Class 11: {XZ, ZX, IY, YI} (size 4)

Acceptance (probability that the run is kept) - No error: accepted with probability (1−p)^2 (E=I∈N(S)). - Exactly one gate errs (say on (2,1)): E lies in N(S) iff that pair error has even x-parity and even z-parity, i.e., it is in class 00 and non-identity ⇒ exactly 3 acceptable Paulis out of 15. The same holds if only (0,3) errs. Contribution: 2(1−p)p(3/15). - Both gates err: E=P21⊗Q03 commutes with XXXX and ZZZZ iff the pairwise parities match between the two pairs (a,b)21=(a,b)03 (both constraints). Counting acceptable pairs among 15×15=225 possibilities: class 00: 3×3=9 class 10: 4×4=16 class 01: 4×4=16 class 11: 4×4=16 Total 57. Contribution: p^2·(57/225)=p^2·(19/75).

Therefore the post-selection acceptance probability is

\[ P_{\rm acc}(p) =(1-p)^2+2(1-p)p\frac{3}{15}+p^2\frac{57}{225} =1-\frac{8}{5}p+\frac{64}{75}p^2. \]

“Good” (logically correct) undetected errors - Among accepted runs (E∈N(S)), the logical two-qubit state equals the intended |Φ+〉AB iff E acts on the codespace as an element of the logical-Bell stabilizer subgroup generated by XAXB and ZAZB (global phases ignored), i.e., E is in the state’s stabilizer. For our circuit this occurs exactly when: • No error, or • A single-pair error is one of {XX,YY,ZZ} on that pair, or • Both pairs have errors from {XX,YY,ZZ} on each pair (9 combinations). This is precisely the same counting that gave the physical 4‑qubit state fidelity in Subproblem 1:

\[ P_{\rm good}(p)=(1-p)^2+2(1-p)p\frac{3}{15}+9\left(\frac{p}{15}\right)^2 =1-\frac{8}{5}p+\frac{16}{25}p^2, \]

since {XX,YY,ZZ} stabilize the Bell state up to phase. (quantumcomputing.stackexchange.com)

Logical fidelity conditioned on passing detection - The desired quantity is the conditional fidelity of the logical 2‑qubit state given acceptance (syndrome +1), i.e.,

\[ F_{\rm logical}(p)=\frac{P_{\rm good}(p)}{P_{\rm acc}(p)} =\frac{1-\frac{8}{5}p+\frac{16}{25}p^2}{1-\frac{8}{5}p+\frac{64}{75}p^2} =\frac{75-120p+48p^2}{75-120p+64p^2}. \]

Sanity checks - Small‑p expansion: using (1+αp+βp^2)/(1+γp+δp^2)=1+(α−γ)p+[β−δ−γ(α−γ)]p^2+… and noting the linear terms cancel, we get

\[ F_{\rm logical}(p)=1-\frac{16}{75}p^2+O(p^3), \]

showing first‑order errors are removed by post‑selection, as expected for a distance‑2 detection code. (en.wikipedia.org) - At p=1: Flogical(1)=(1/25)/(19/75)=3/19≈0.1579.

2) Mathematical Typesetting

All key steps above are written in LaTeX.

3) Conventions and Units

4) Final Answer: Flogical(p) = (75 − 120 p + 48 p^2) / (75 − 120 p + 64 p^2) = [1 − (8/5)p + (16/25)p^2] / [1 − (8/5)p + (64/75)p^2].

Equivalently, for small p: Flogical(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 = (75 - 120*p + 48*p**2) / (75 - 120*p + 64*p**2)
    # ---------------------------------------------------------------

    return F_logical