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

Step-by-Step Derivation

1) Ideal target state and its stabilizers

  • The circuit acts (right-to-left) as H2 → CNOT21 → H0 → CNOT03 on |0000⟩, yielding the pure 4‑qubit state
\[ |\Psi\rangle=\frac{1}{2}\big(|0000\rangle+|1001\rangle+|0110\rangle+|1111\rangle\big). \]

This state is the [[4,2,2]]-encoded logical Bell (two‑qubit GHZ) state |Φ+⟩AB, i.e., (|00⟩AB+|11⟩AB)/√2, stabilized (in the logical basis) by X_A X_B and Z_A Z_B, exactly as a Bell state is stabilized by XX and ZZ. Using the given physical representatives X_A=XIXI, X_B=XXII, Z_A=ZZII, Z_B=ZIZI, we obtain physical logical stabilizers

\[ X_A X_B=(XIXI)(XXII)=IXXI,\qquad Z_A Z_B=(ZZII)(ZIZI)=IZZI. \]

Together with the code stabilizers XXXX and ZZZZ, these generate the 4‑qubit stabilizer group S of |Ψ⟩. In particular, S contains three weight‑2 Paulis on qubits (1,2): IXXI, IZZI, IYYI (up to phases), three weight‑2 Paulis on qubits (0,3): XIII X, ZIIZ, YIIY, and nine weight‑4 Paulis formed by their products (e.g., XXXX, ZZZZ, ZX XZ, XZZX, etc.). The Bell-state stabilizer fact is standard, and Clifford/logical replacement uses the given logical operators. (en.wikipedia.org)

2) Noise model located in the circuit

  • After each CNOT gate we apply an independent two‑qubit depolarizing channel on that gate’s qubits:
\[ \mathcal{E}_p(\rho)=(1-p)\rho+\frac{p}{15}\sum_{P\in\mathcal{P}_2\setminus\{II\}} P\rho P, \]

i.e., with probability 1−p no error occurs; with probability p a uniformly random non‑identity 2‑qubit Pauli from the 15 possibilities is applied. One channel acts on qubits (2,1) after CNOT21; the other acts on qubits (0,3) after CNOT03. (A uniform Pauli mixture over all non‑identity n‑qubit Paulis is the “uniform Pauli error” form of the depolarizing channel.) (qiskit.github.io, qiskit-org-web-resources.s3.us.cloud-object-storage.appdomain.cloud)

  • Because later gates act on disjoint qubits (H0 and CNOT03 do not touch qubits 1 or 2), the Pauli error drawn after CNOT21 remains a Pauli on qubits (1,2) until the end, and similarly for the error after CNOT03 on qubits (0,3). Clifford gates map Paulis to Paulis under conjugation; here, disjoint support also makes the propagation trivial. (en.wikipedia.org)

3) Fidelity reduction to counting stabilizer elements

  • Let P03 be the (possibly identity) Pauli on qubits (0,3) drawn by the last channel, and P12 the (possibly identity) Pauli on (1,2) drawn by the first. The final state is a classical mixture of (P03⊗P12)|Ψ⟩. For a pure stabilizer state |Ψ⟩, the state fidelity with |Ψ⟩,
\[ \]

equals the total probability that the net Pauli P03⊗P12 lies in the stabilizer group S of |Ψ⟩ (since |Ψ⟩ is the unique +1 eigenstate of S; for P∉S the overlap vanishes). Thus, the fidelity is a counting problem over stabilizer elements reachable by the two channels. (zxcalc.github.io)

4) Counting cases that preserve the state

  • Event types: 1) No error on either channel: probability (1−p)^2; the net Pauli is I and lies in S. 2) Exactly one two‑qubit error (on one pair only): probability 2(1−p)p. On a given pair, 3 of the 15 non‑identity two‑qubit Paulis are in S (for (1,2): IXXI, IZZI, IYYI; for (0,3): XIII X, ZIIZ, YIIY). Hence the conditional success probability is 3/15=1/5. 3) Two errors (one on each pair): probability p^2. There are 15×15=225 ordered pairs of non‑identity Paulis. Exactly 9 give a stabilizer element: all combinations where the (0,3) Pauli is one of {XX,YY,ZZ} and the (1,2) Pauli is one of {XX,YY,ZZ}, yielding the 9 weight‑4 stabilizers (e.g., XXXX= (XX)03⊗(XX)12, ZZZZ= (ZZ)03⊗(ZZ)12, etc.). Thus the conditional success probability is 9/225=1/25.

  • Summing contributions:

\[ F(p) &= (1-p)^2\;+\;2(1-p)p\cdot\frac{3}{15}\;+\;p^2\cdot\frac{9}{225}\\ &= (1-p)^2+\frac{2}{5}p(1-p)+\frac{1}{25}p^2\\ &= 1-\frac{8}{5}p+\frac{16}{25}p^2\\ &= \big(1-\tfrac{4}{5}p\big)^2. \]

Notes on ingredients cited: the stabilizers of Bell/|Φ+⟩ are generated by XX and ZZ; two‑qubit depolarizing as a uniform mixture over the 15 non‑identity Paulis is the standard “uniform Pauli error” form of an n‑qubit depolarizing channel; and Clifford gates map Pauli errors to Pauli errors under conjugation, which justifies treating each Pauli error at the end of the circuit. (en.wikipedia.org, qiskit.github.io, qiskit-org-web-resources.s3.us.cloud-object-storage.appdomain.cloud)

Final Answer: F(p) = 1 − (8/5)p + (16/25)p^2 = (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

Step-by-Step Derivation

1) What “post-selecting on all detectable errors” means and how to compute logical fidelity

  • The [[4,2,2]] code has stabilizer generators S = ⟨XXXX, ZZZZ⟩. Measuring these two generators and keeping only +1 outcomes projects onto the code space. A Pauli error P is “detectable” (and thus rejected) if it anticommutes with at least one generator; equivalently, it is accepted iff it commutes with both generators, i.e., P∈N(S) (the normalizer/centralizer of S). Errors in N(S)\S act as nontrivial logical Paulis; errors in S act trivially. (en.wikipedia.org, leftasexercise.com)

  • The target logical state is the logical Bell state |Φ+⟩AB = (|00⟩AB+|11⟩AB)/√2. In the logical basis it is stabilized by XAXB and ZAZB, just as a 2‑qubit Bell state is stabilized by XX and ZZ. Hence, among accepted (normalizer) errors, those that are equivalent (mod S) to I, XAXB, ZAZB, or YAYB leave the logical |Φ+⟩ unchanged; any other logical Pauli maps it to an orthogonal Bell state. Therefore the logical fidelity, conditioned on acceptance, is Flogical(p) = P{P ∈ Sstate}/P{P ∈ N(S)}, where Sstate is the full stabilizer group of the prepared 4‑qubit codeword (generated by XXXX, ZZZZ together with physical representatives of XAXB and ZAZB). (zxcalc.github.io)

2) Noise model and independence across pairs

  • The circuit has two CNOTs; we place an independent two‑qubit depolarizing channel after each CNOT. For a 2‑qubit system (d=4), the depolarizing channel is the uniform mixture over the 15 non‑identity 2‑qubit Paulis, so each non‑identity Pauli occurs with probability p/15 and “no error” occurs with probability 1−p. One channel acts on qubits (2,1) after CNOT21; the other acts on (0,3) after CNOT03. Subsequent gates act on disjoint qubits, so each drawn Pauli remains on its pair until the end. (en.wikipedia.org)

  • Denote the (possibly identity) Pauli on pair (1,2) by P12 and on (0,3) by P03. The net (final) Pauli is P = P03 ⊗ P12.

3) Classifying a 2‑qubit Pauli by its commutation with XXXX and ZZZZ

  • For any Pauli P, P commutes with ZZZZ iff the total number of X or Y factors in P is even, and P commutes with XXXX iff the total number of Z or Y factors is even. For a 2‑qubit Pauli Q acting on a specific pair, define its “syndrome parity” s(Q) = (sX(Q), sZ(Q)) with sX(Q) = parity of {Z,Y} in Q, sZ(Q) = parity of {X,Y} in Q. For the two disjoint pairs, acceptance requires the total parity over all 4 qubits to be even, i.e., s(P12) ⊕ s(P03) = (0,0). (en.wikipedia.org)

  • Enumerating the 15 non‑identity 2‑qubit Paulis on one pair and grouping by s(Q): • s=(0,0): {XX, YY, ZZ} → 3 elements, • s=(1,0): {ZI, IZ, XY, YX} → 4 elements, • s=(0,1): {XI, IX, YZ, ZY} → 4 elements, • s=(1,1): {YI, IY, XZ, ZX} → 4 elements. (Here I, X, Y, Z act on the two qubits of that pair.)

4) Probability the run is accepted (passes both stabilizers)

Break into mutually exclusive cases:

  • No error on either channel: probability (1−p)^2, accepted.

  • Exactly one non‑identity error (on one pair only): probability 2(1−p)p. Acceptance requires that that single 2‑qubit Pauli commute with both generators, i.e., s=(0,0). There are 3 such Paulis out of 15, so conditional acceptance probability = 3/15 = 1/5.

  • Non‑identity errors on both pairs: probability p^2. Acceptance requires s(P12)=s(P03). With counts above, the number of accepted ordered pairs is 3^2+4^2+4^2+4^2 = 57 out of 15×15 = 225. Hence conditional acceptance probability = 57/225 = 19/75.

Therefore the total acceptance probability is

\[ P_{\mathrm{acc}}(p) =(1-p)^2+2(1-p)p\cdot\frac{1}{5}+p^2\cdot\frac{19}{75} =1-\frac{8}{5}p+\frac{64}{75}p^2. \]

5) Probability the prepared 4‑qubit state equals the ideal (i.e., is in the state stabilizer)

  • The run produces the exact target 4‑qubit state iff the net Pauli P lies in the stabilizer Sstate of that pure state. Counting (as in Subproblem 1): identity contributes (1−p)^2; a single non‑identity on one pair yields a stabilizer element only for the 3 Paulis {XX,YY,ZZ} → probability 2(1−p)p·(3/15); with non‑identity on both pairs, being in Sstate occurs for the 3×3=9 ordered choices in {XX,YY,ZZ}×{XX,YY,ZZ} → probability p^2·(9/225). Thus
\[ P\{P\in S_{\text{state}}\} =(1-p)^2+2(1-p)p\cdot\frac{3}{15}+p^2\cdot\frac{9}{225} =1-\frac{8}{5}p+\frac{16}{25}p^2 =\Bigl(1-\frac{4}{5}p\Bigr)^2. \]

Because |Φ+⟩AB is stabilized by XX and ZZ in the logical basis, P∈Sstate is equivalent to “no logical error” on |Φ+⟩AB. (zxcalc.github.io)

6) Logical fidelity conditioned on acceptance

  • By definition,
\[ F_{\mathrm{logical}}(p) =\Pr\{P\in S_{\text{state}}\mid P\in N(S)\} =\frac{\Pr\{P\in S_{\text{state}}\}}{\Pr\{P\in N(S)\}} =\frac{\,1-\frac{8}{5}p+\frac{16}{25}p^2\,}{\,1-\frac{8}{5}p+\frac{64}{75}p^2\,}. \]

Two useful checks: • Small‑p expansion: \(F_{\mathrm{logical}}(p)=1-\frac{16}{75}p^2+O(p^3)\), i.e., post‑selection removes all O(p) infidelity, as expected for a distance‑2 detector. • Worst case p=1: \(F_{\mathrm{logical}}(1)=\frac{1/25}{19/75}=\frac{3}{19}\).

Final Answer: The logical state fidelity of the post‑selected logical Bell state is

\[ F_{\mathrm{logical}}(p) =\frac{1-\frac{8}{5}p+\frac{16}{25}p^2}{1-\frac{8}{5}p+\frac{64}{75}p^2} =1-\frac{16}{75}p^2+O(p^3), \]

with acceptance probability \(P_{\mathrm{acc}}(p)=1-\frac{8}{5}p+\frac{64}{75}p^2\). (en.wikipedia.org, zxcalc.github.io)

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(8, 5)*p + sp.Rational(16, 25)*p**2) / (1 - sp.Rational(8, 5)*p + sp.Rational(64, 75)*p**2)
    # ---------------------------------------------------------------

    return F_logical