Checkpoint-3

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, or mathematical identities.
  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 state prepared by the circuit:
  • Start from |0000⟩.
  • Apply H2 then CNOT21: this prepares a Bell state on qubits (2,1),
\[ |\Phi^+\rangle_{21} = \frac{|00\rangle_{21} + |11\rangle_{21}}{\sqrt{2}}. \]
  • Apply H0 then CNOT03: this prepares a Bell state on qubits (0,3),
\[ |\Phi^+\rangle_{03} = \frac{|00\rangle_{03} + |11\rangle_{03}}{\sqrt{2}}. \]
  • Hence the final ideal 4-qubit state is a product of Bell pairs:
\[ |\psi_{\text{ideal}}\rangle = |\Phi^+\rangle_{03} \otimes |\Phi^+\rangle_{21}. \]
  • Stabilizer of the ideal state:
  • For a Bell state |Φ+⟩ on a pair (a,b), the stabilizer is generated by {X_a X_b, Z_a Z_b}, and the full stabilizer group on that pair is
\[ \{I I,\; X X,\; Y Y,\; Z Z\}\quad\text{(up to global phase)}. \]
  • Therefore the full 4-qubit stabilizer factorizes as
\[ \mathcal{S} = \langle X_0 X_3, Z_0 Z_3 \rangle \otimes \langle X_1 X_2, Z_1 Z_2 \rangle. \]
  • Noise model and its action:
  • After each CNOT gate, a two-qubit depolarizing error acts on the same two qubits: with probability 1−p no error (I I), and with probability p a uniformly random non-identity two-qubit Pauli from the 15 possibilities is applied.
  • The error after CNOT21 acts on qubits (2,1) and commutes with the later gates (H0, CNOT03), which act only on (0,3). Thus it does not propagate. The error after CNOT03 acts on (0,3) at the very end.
  • Hence the final error is a tensor product
\[ E_{\text{tot}} = E_{03} \otimes E_{21}, \]
where E03 and E21 are independent two-qubit Pauli errors on (0,3) and (2,1), respectively.
  • Fidelity with a stabilizer state under a Pauli channel:
  • For a pure stabilizer state |ψ⟩ and a Pauli error E, we have ⟨ψ|E|ψ⟩ ∈ {0, ±1}. It equals ±1 iff E is in the stabilizer (up to phase), and 0 otherwise. Therefore, for a Pauli mixture,
\[ = \sum_E \Pr(E)\, |\langle \psi_{\text{ideal}} | E | \psi_{\text{ideal}} \rangle|^2 \]
  • Because the stabilizer factorizes and the errors on the two pairs are independent,
\[ F = \Pr(E_{03} \in \mathcal{S}_{03}) \cdot \Pr(E_{21} \in \mathcal{S}_{21}). \]
  • Single-pair success probability:
  • On a Bell pair, among the 15 non-identity two-qubit Paulis, exactly 3 are in the stabilizer: {X X, Y Y, Z Z}.
  • Thus, for one pair,
\[ = (1-p) + p \cdot \frac{3}{15} \]
  • Total fidelity:
  • Since the two pairs are independent,
\[ \]
  1. Mathematical Typesetting - All mathematics above is typeset in LaTeX.

  2. Conventions and Units - No units are involved; fidelity is dimensionless.

  3. Final Answer: F(p) = (1 - 4p/5)^2 = 1 - (8/5)p + (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
  • Ideal encoded state (noiseless):
  • As in Subproblem 1, the circuit prepares
\[ \]
  • The code stabilizers are \(S_X=XXXX\) and \(S_Z=ZZZZ\). The logical Bell-state stabilizers are
\[ X_A X_B = X_1 X_2,\qquad Z_A Z_B = Z_1 Z_2, \]
so the logical Bell label is read off from the Bell-state label on qubits 1–2 when the state lies in the code space.
  • Noise model and its reduction to Bell labels:
  • After each CNOT there is a two-qubit depolarizing error on the gate’s qubits. Thus the final error is
\[ E_{\text{tot}}=E_{03}\otimes E_{21}, \]
with $E_{03}$ and $E_{21}$ independent two-qubit Paulis, each equal to $II$ with probability $1-p$ and otherwise uniformly one of the 15 non-identity Paulis with probability $p/15$.
  • For a single Bell pair, applying a two-qubit Pauli maps \(|\Phi^+\rangle\) to exactly one of the four Bell states. The 16 two-qubit Paulis partition into four cosets (modulo the Bell stabilizer \(\{II,XX,YY,ZZ\}\)), each coset mapping \(|\Phi^+\rangle\) to a fixed Bell state. Hence for one pair:
\[ \]
  • Post-selection (detectable errors discarded):
  • Measuring \(S_X\) and \(S_Z\) and keeping only \(+1\) outcomes accepts an error \(E_{\text{tot}}\) iff it commutes with both stabilizers. Equivalently, in terms of the two Bell pairs, the measurement outcomes are the products of the \(X\!\otimes\!X\) and \(Z\!\otimes\!Z\) eigenvalues on pairs (0,3) and (2,1). Thus acceptance occurs iff both pairs end in the same Bell label:
\[ \text{accept} \iff L_{03}=L_{21}\in\{\Phi^+,\Phi^-,\Psi^+,\Psi^-\}. \]
  • Therefore the acceptance probability is
\[ P_{\text{acc}}=\sum_{L}\Pr(L_{03}=L)\Pr(L_{21}=L)=q^2+3r^2. \]
  • Logical state upon acceptance and logical fidelity:
  • Conditional on acceptance, the code state lies in the code space and has logical Bell label equal to the common pair label. Hence the logical Bell-state fidelity with the target \(|\Phi^+\rangle_{AB}\) is the conditional probability that the common label is \(\Phi^+\):
\[ F_L(p)=\Pr\big(L=\Phi^+\,\big|\,\text{accept}\big)=\frac{q^2}{q^2+3r^2}. \]
  • Substituting \(q=1-\frac{4p}{5}\) and \(r=\frac{4p}{15}\) gives
\[ \]
  • Small-\(p\) expansion (showing the error-detecting benefit):
\[ F_L(p)=1-\frac{16}{75}p^2+O(p^3), \]
i.e., the logical infidelity is quadratic in $p$ after post-selection.
  1. Mathematical Typesetting - All relevant expressions are provided in LaTeX.

  2. Conventions and Units - Fidelity is dimensionless; no units.

  3. Final Answer: \(F_L(p)=\dfrac{\left(1-\frac{4p}{5}\right)^2}{\left(1-\frac{4p}{5}\right)^2+3\left(\frac{4p}{15}\right)^2} =\dfrac{1-\frac{8}{5}p+\frac{16}{25}p^2}{1-\frac{8}{5}p+\frac{64}{75}p^2} =1-\dfrac{16}{75}p^2+O(p^3).\)

User #5

Checkpoint 3

Suppose that we prepare a logical two-qubit \(|00\rangle_{AB}\) state in the [[4,2,2]] code. To do so, we introduce an ancilla qubit, qubit 4, and use the following state preparation circuit:

\[ M_4 (CNOT_{04}) (CNOT_{34}) (CNOT_{23}) (CNOT_{10}) (CNOT_{12}) (H_1) \]

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 and \(M\) is a single-qubit measurement. The ancilla is used to detect errors in the state preparation circuit and makes the circuit fault-tolerant. If the ancilla measurement is \(|0\rangle\) (\(|1\rangle\)), the state preparation succeeds (fails).

What is the logical state fidelity of the final 2-qubit logical state at the end of the circuit as a function of two-qubit gate error rate \(p\), assuming the state is post-selected on all detectable errors in the code and on the ancilla qubit measuring \(|0\rangle\)?

Assistant #6
  1. Step-by-Step Derivation
  • Ideal (noiseless) state and goal
  • The circuit
\[ M_4\,(CNOT_{04})\,(CNOT_{34})\,(CNOT_{23})\,(CNOT_{10})\,(CNOT_{12})\,(H_1) \]
prepares the 4-qubit cat state
\[ |\mathrm{cat}_4\rangle=\frac{|0000\rangle+|1111\rangle}{\sqrt2} \]
on data qubits 0–3 and then “verifies” it by measuring an ancilla (qubit 4) in the Z basis after coupling to data via CNOTs from 3 and 0. The accepted outcome is $M_4=0$. In the code, this is the logical state $|00\rangle_{AB}$ (it is stabilized by $XXXX$ and $ZZZZ$, and also by the logical $Z_A=ZZII$ and $Z_B=ZIZI$).
  • Noise model
  • After each of the 5 CNOTs (12,10,23,34,04) a 2-qubit depolarizing error acts on the same two qubits, applying one of the 15 non-identity Paulis with probability \(p/15\). The Hadamard and measurement are perfect.

  • Pauli propagation and notation

  • Represent a Pauli on each qubit \(i\) by its “X-bit” \(x_i\in\{0,1\}\) and “Z-bit” \(z_i\in\{0,1\}\), where \(I\to(0,0)\), \(X\to(1,0)\), \(Z\to(0,1)\), \(Y\to(1,1)\). Composition is bitwise XOR.
  • Conjugation by \(CNOT_{c\to t}\) acts as:
    • \(x_c\mapsto x_c\), \(z_c\mapsto z_c\)
    • \(x_t\mapsto x_t\), \(z_t\mapsto z_t\)
    • plus “copies”:
    • control \(X\) (or \(Y\)) replicates \(X\) to target: if \(x_c=1\) then \(x_t\gets x_t\oplus 1\),
    • target \(Z\) (or \(Y\)) replicates \(Z\) back to control: if \(z_t=1\) then \(z_c\gets z_c\oplus 1\).
  • From this, the net contribution (pushed to the end) of a two-qubit Pauli placed after each gate is (writing only the nonzero toggles):

    • After \(CNOT_{12}\) with Pauli \((P_1,P_2)\):
    • \(x_1\oplus= x(P_1)\), \(x_0\oplus= x(P_1)\); \(x_2\oplus= x(P_2)\), \(x_3\oplus= x(P_2)\)
    • \(x_4\oplus= x(P_1)\oplus x(P_2)\)
    • \(z_1\oplus= z(P_1)\), \(z_2\oplus= z(P_2)\).
    • After \(CNOT_{10}\) with \((P_1,P_0)\):
    • \(x_1\oplus= x(P_1)\), \(x_0\oplus= x(P_0)\)
    • \(x_4\oplus= x(P_0)\)
    • \(z_1\oplus= z(P_1)\), \(z_0\oplus= z(P_0)\).
    • After \(CNOT_{23}\) with \((P_2,P_3)\):
    • \(x_2\oplus= x(P_2)\), \(x_3\oplus= x(P_3)\)
    • \(x_4\oplus= x(P_3)\)
    • \(z_2\oplus= z(P_2)\), \(z_3\oplus= z(P_3)\).
    • After \(CNOT_{34}\) with \((P_3,P_4)\):
    • \(x_3\oplus= x(P_3)\), \(x_4\oplus= x(P_4)\)
    • \(z_3\oplus= z(P_3)\), \(z_4\oplus= z(P_4)\)
    • and additionally \(z_0\oplus= z(P_4)\) (because \(Z/Y\) on the ancilla back-propagates a \(Z\) to control 0 through the subsequent \(CNOT_{04}\)).
    • After \(CNOT_{04}\) with \((P_0,P_4)\):
    • \(x_0\oplus= x(P_0)\), \(x_4\oplus= x(P_4)\)
    • \(z_0\oplus= z(P_0)\), \(z_4\oplus= z(P_4)\).
  • Post-selection (acceptance) conditions

  • Ancilla acceptance (\(M_4=0\)): the ideal ancilla is \(|0\rangle\), and measuring \(Z_4\) at the end yields 0 unless the final Pauli anticommutes with \(Z_4\). Thus we must have no \(X\) or \(Y\) on qubit 4:
\[ x_4=0. \]
  • Code-syndrome acceptance (commute with \(S_X=XXXX\) and \(S_Z=ZZZZ\)):
\[ x_0\oplus x_1\oplus x_2\oplus x_3=0,\qquad z_0\oplus z_1\oplus z_2\oplus z_3=0. \]
  • Logical error criterion for target \(|00\rangle_{AB}\)
  • The logical \(Z\) operators (\(Z_A=ZZII\), \(Z_B=ZIZI\)) stabilize \(|00\rangle_{AB}\), so any accepted error that is in the “\(Z\) logical subgroup” (i.e., some product of \(Z_A\), \(Z_B\), and stabilizers) does not reduce the logical fidelity.
  • A logical \(X\) on \(A\) or \(B\) flips \(|00\rangle_{AB}\) to an orthogonal state and is harmful. In terms of the data \(x\)-pattern, the logical \(X\) content is captured by
\[ X_A\text{-bit}=x_0\oplus x_2,\qquad X_B\text{-bit}=x_0\oplus x_1. \]
These two bits are invariant modulo the stabilizer $XXXX$ (which flips all four $x_i$). Hence,
- Harmful iff not all $x_i$ are equal, i.e., iff $(x_0\oplus x_1)=1$ or $(x_0\oplus x_2)=1$.
- Benign iff $x_0=x_1=x_2=x_3$ (then the error is a stabilizer or a logical-Z-type).
  • Leading-order (quadratic) analysis
  • The circuit is fault-tolerant to single faults: any single depolarizing error that is accepted (passes both the ancilla and code checks) induces no logical \(X\) (benign). Therefore the logical infidelity is \(O(p^2)\).
  • At order \(p^2\), only configurations with exactly two faulty CNOTs contribute. For a fixed unordered pair of faulty gates, the joint error is uniformly distributed over \(15\times 15=225\) Pauli pairs.
  • For each unordered pair of faulty locations, we count how many of the 225 Pauli-pair choices yield: (i) ancilla acceptance (\(x_4=0\)), (ii) code acceptance (both parity constraints), (iii) harmful logical \(X\) (the \(x\)-pattern not all equal). Each such accepted–harmful pair contributes probability \((p/15)^2=p^2/225\).
  • The pairwise counts (sketch of derivations):
    • We write \(a,b,c,\dots\) for the \(x\)-bits produced on the qubits touched by the two faults and use the linear constraints imposed by acceptance (\(x_4=0\) and data \(x\)-parity even) to reduce the \(x\)-pattern; the harmfulness then becomes a simple condition (e.g., \(a\neq b\)). The \(z\)-parity constraint across data is satisfied by exactly half of the remaining cases because the \(z\)-bits are independent fair bits within the allowed (I/Z or X/Y) choices.
    • Results (number of accepted–harmful Pauli pairs out of 225):
    • Fault pairs that never produce harmful \(x\) when accepted:
      • (12,10): 0
      • (12,23): 0
    • Fault pairs giving 16 accepted–harmful cases:
      • (12,34), (12,04), (10,23), (10,04), (23,34), (34,04): each 16
    • Fault pairs giving 24 accepted–harmful cases:
      • (10,34), (23,04): each 24
    • Sum over all unordered pairs (there are C(5,2)=10 pairs):
\[ N_{\text{mal}}=0+0+6\times 16+2\times 24=96+48=144. \]
  • Therefore, to second order in \(p\), the total probability of accepted–harmful events is
\[ P_{\text{bad,acc}}= \frac{144}{225}\,p^2 + O(p^3)=\frac{16}{25}\,p^2+O(p^3). \]
  • As argued, single-fault terms reduce acceptance at \(O(p)\) but do not reduce the conditional logical fidelity; hence the logical fidelity conditioned on acceptance is
\[ F_L(p)=1-P_{\text{bad,acc}}+O(p^3)=1-\frac{16}{25}\,p^2+O(p^3). \]
  1. Mathematical Typesetting - All equations are typeset in LaTeX above.

  2. Conventions and Units - Dimensionless probabilities; no units.

  3. Final Answer: \(F_L(p)=1-\dfrac{16}{25}\,p^2+O(p^3).\)

User #7

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 the logical state fidelity of the final 2-qubit logical state
    at the end of the circuit as a function of two-qubit gate error rate $p$.

    Inputs
    ----------
    p: sympy.Symbol, two-qubit gate error rate, $p$

    Outputs
    ----------
    F_logical: sympy.Expr, logical state fidelity of the final 2-qubit logical state
    """

    # ------------------ FILL IN YOUR RESULTS BELOW ------------------
    F_logical = ...  # a SymPy expression of inputs
    # ---------------------------------------------------------------

    return F_logical
Assistant #8
import sympy as sp

p = sp.symbols('p')

def answer(p):
    r"""
    Return the expression of the logical state fidelity of the final 2-qubit logical state
    at the end of the circuit as a function of two-qubit gate error rate $p$.

    Inputs
    ----------
    p: sympy.Symbol, two-qubit gate error rate, $p$

    Outputs
    ----------
    F_logical: sympy.Expr, logical state fidelity of the final 2-qubit logical state
    """

    # ------------------ FILL IN YOUR RESULTS BELOW ------------------
    F_logical = 1 - sp.Rational(16, 25) * p**2
    # ---------------------------------------------------------------

    return F_logical