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:
  • Starting from |0000⟩, the sequence (right-to-left) H₂ → CNOT₂₁ prepares a Bell state on qubits (2,1): |Φ⁺⟩₂₁ = (|00⟩ + |11⟩)/√2.
  • Then H₀ → CNOT₀₃ prepares a Bell state on qubits (0,3): |Φ⁺⟩₀₃.
  • Hence the ideal final 4-qubit state factorizes:
\[ |\psi_{\text{ideal}}\rangle = |\Phi^+\rangle_{03} \otimes |\Phi^+\rangle_{21}. \]
  • Noise model:
  • After each CNOT, a two-qubit depolarizing channel acts on the same pair:
\[ \mathcal{E}_p(\rho) = (1-p)\rho + \frac{p}{15}\sum_{P\in\mathcal{P}_2\setminus\{II\}} P \rho P, \]
where the sum is over the 15 non-identity two-qubit Paulis.
  • The two channels act independently on disjoint pairs (0,3) and (2,1). Since the ideal state is a product state across these pairs, the final state factorizes:
\[ \rho_{\text{out}} = \rho_{03} \otimes \rho_{21}, \qquad \rho_{\text{pair}} = \mathcal{E}_p\!\left(|\Phi^+\rangle\langle\Phi^+|\right). \]
  • Single-pair fidelity under the depolarizing channel:
  • For the Bell state |Φ⁺⟩, the only nonzero Pauli expectations are
\[ \langle \Phi^+|XX|\Phi^+\rangle = 1,\quad \langle \Phi^+|ZZ|\Phi^+\rangle = 1,\quad \langle \Phi^+|YY|\Phi^+\rangle = -1, \]
and all other two-qubit Paulis have zero expectation.
  • Thus, for a Pauli error P applied to |Φ⁺⟩, the overlap squared is
\[ \begin{cases} 1, & P \in \{II,\, XX,\, YY,\, ZZ\},\\ 0, & \text{otherwise}. \]
  • The single-pair fidelity is therefore
\[ = (1-p)\cdot 1 + \frac{p}{15}\cdot(1+1+1) \]
  • Total 4-qubit fidelity:
  • Because the two pairs are independent and the ideal state factorizes,
\[ = \big(F_{\text{pair}}\big)^2 \]
  1. Mathematical Typesetting

Already used above.

  1. Conventions and Units
  • No unit conventions are needed. The depolarizing probability is p per two-qubit gate.
  1. Final Answer:
\[ F_{\text{phys}}(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
  • Ideal (noiseless) state prepared by the circuit:
  • As in Subproblem 1, the sequence prepares a Bell pair on qubits (2,1) and a Bell pair on qubits (0,3):
\[ |\psi_{\mathrm{ideal}}\rangle = |\Phi^+\rangle_{03}\otimes|\Phi^+\rangle_{21},\qquad |\Phi^+\rangle=\frac{|00\rangle+|11\rangle}{\sqrt2}. \]
  • This state lies in the code space (it is +1 for both \(XXXX\) and \(ZZZZ\)) and encodes the logical Bell state \((|00\rangle_{AB}+|11\rangle_{AB})/\sqrt2\).

  • Noise model and factorization:

  • After each CNOT, a two-qubit depolarizing channel acts on the same pair:
\[ \mathcal{E}_p(\rho)=(1-p)\rho+\frac{p}{15}\sum_{P\in\mathcal{P}_2\setminus\{II\}}P\rho P. \]
  • The two noisy gates act on disjoint pairs (03) and (21), and there are no subsequent gates touching those pairs. Hence the final state is
\[ \rho_{\mathrm{out}} = ( \mathcal{E}_p(|\Phi^+\rangle\langle\Phi^+|) )_{03} \otimes ( \mathcal{E}_p(|\Phi^+\rangle\langle\Phi^+|) )_{21}. \]
  • Classifying Pauli errors on a Bell pair:
  • For a two-qubit Pauli \(P\) acting on one Bell pair, define the flip parities with respect to the pair stabilizers \(ZZ\) and \(XX\):
    • \(f_Z(P)=1\) iff \(P\) anticommutes with \(ZZ\) on that pair (i.e., an odd number of \(X\) or \(Y\) occur on the two qubits), else \(0\).
    • \(f_X(P)=1\) iff \(P\) anticommutes with \(XX\) on that pair (i.e., an odd number of \(Y\) or \(Z\) occur), else \(0\).
  • Acting on \(|\Phi^+\rangle\), the pair transitions as:
    • \((f_Z,f_X)=(0,0)\Rightarrow |\Phi^+\rangle\) (possibly a global phase),
    • \((0,1)\Rightarrow |\Phi^-\rangle\),
    • (1,0) ⇒ \(|\Psi^+\rangle\),
    • (1,1) ⇒ \(|\Psi^-\rangle\).
  • Among the 16 two-qubit Paulis, each of the four flip types occurs exactly 4 times (Klein-four structure under bitwise XOR of \((f_Z,f_X)\)). Therefore, under the depolarizing channel on one pair,
\[ r_{00} &:= \Pr[(f_Z,f_X)=(0,0)] = (1-p) + 3\frac{p}{15} = 1-\frac{4p}{5},\\ r_{01} = r_{10} = r_{11} &= \frac{4}{15}p. \]
  • Post-selection (error detection) using the [[4,2,2]] stabilizers:
  • The global stabilizers are \(S_X=XXXX\) and \(S_Z=ZZZZ\). Since the ideal state factorizes and \(S_X=XX_{03}\,XX_{21}\), \(S_Z=ZZ_{03}\,ZZ_{21}\) (up to qubit ordering), their eigenvalues after errors are the products of the pair eigenvalues.
  • Let \((f_Z^{03},f_X^{03})\) and \((f_Z^{21},f_X^{21})\) be the flip bits produced on the two pairs. The post-selection keeps runs with \(S_X=+1\) and \(S_Z=+1\), which is equivalent to:
\[ f_Z^{03}\oplus f_Z^{21}=0,\qquad f_X^{03}\oplus f_X^{21}=0, \]
i.e., the flip vectors must match: $(f_Z^{03},f_X^{03})=(f_Z^{21},f_X^{21})$.
  • Acceptance probability:
  • By independence of the two pairs,
\[ = r_{00}^2 + r_{01}^2 + r_{10}^2 + r_{11}^2 \]
  • Logical state after post-selection and its fidelity:
  • Conditional on acceptance, the two pairs end in the same Bell state, so the physical state remains in the code space and equals one of the four orthonormal encoded Bell states:
\[ |\Phi^-\rangle_{03}\otimes|\Phi^-\rangle_{21},\; |\Psi^+\rangle_{03}\otimes|\Psi^+\rangle_{21},\; \]
  • These correspond to mutually orthogonal logical states. Therefore, the logical fidelity with the target logical GHZ (encoded \(|\Phi^+\rangle_{AB}\)) equals the conditional probability that both pairs have \((f_Z,f_X)=(0,0)\):
\[ \]
  • Small-\(p\) expansion:
\[ F_{\mathrm{log}}(p) = 1 - \frac{16}{75}p^2 + O(p^3), \]

showing that all first-order (single-gate) error contributions are detected and discarded.

  1. Mathematical Typesetting
  • Used throughout.
  1. Conventions and Units
  • Probability \(p\) is the error probability per two-qubit gate; errors act only after CNOTs.
  1. Final Answer:
\[ = \frac{1 - \frac{8}{5}p + \frac{16}{25}p^2}{1 - \frac{8}{5}p + \frac{64}{75}p^2} \]
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 preparation
  • Starting from |00000⟩ on data qubits 0–3 and ancilla 4, the sequence H₁ → CNOT₁₂ → CNOT₁₀ → CNOT₂₃ → CNOT₃₄ → CNOT₀₄ → M₄ prepares
\[ |\psi_{\text{ideal}}\rangle = \frac{|0000\rangle_{0123}+|1111\rangle_{0123}}{\sqrt2}\otimes|0\rangle_4. \]
  • The 4-qubit GHZ is +1 for both \(S_X=XXXX\) and \(S_Z=ZZZZ\) and encodes the logical \(|00\rangle_{AB}\) (it is +1 for both \(Z_A=ZZII\) and \(Z_B=ZIZI\)).

  • Noise model

  • After each CNOT, an independent two-qubit depolarizing channel acts:
\[ \mathcal E_p(\rho)=(1-p)\rho+\frac{p}{15}\sum_{P\in\mathcal P_2\setminus\{II\}}P\rho P. \]
  • There are 5 such locations: after CNOTs 12, 10, 23, 34, 04.

  • What is accepted

  • We post-select on (i) ancilla measurement \(|0\rangle\) and (ii) all detectable code errors (i.e., \(S_X=+1\) and \(S_Z=+1\)).
  • Interpreting in the Pauli frame (track only the final Pauli error):

    • \(S_Z=+1\) requires an even number of \(X/Y\) on data qubits 0–3 (even “\(X\)-parity”).
    • \(S_X=+1\) requires an even number of \(Z/Y\) on data qubits 0–3 (even “\(Z\)-parity”).
    • Ancilla outcome \(0\) is equivalent to having even \(X\)-parity on qubits {0,3} at the end (since the ancilla has been driven by 3→4 then 0→4).
  • Logical error that matters for the target |00⟩

  • Any logical \(Z\) on \(A\) or \(B\) leaves \(|00\rangle_{AB}\) invariant (it is a +1 eigenstate of both \(Z_A\) and \(Z_B\)). So \(Z\)-type logicals do not reduce the logical state fidelity.
  • The only harmful logical errors here are those with an \(X\) component on the logicals: \(X_A\), \(X_B\), or \(X_A X_B\) (and \(Y\) with an \(X\) component). Among accepted events (even \(X\)-parity on data and \(x_0\oplus x_3=0\)), the only nontrivial \(X\)-pattern modulo the stabilizer \(S_X=XXXX\) is the class of \(X_A X_B\), represented on data by the weight-2 patterns \(\{1,2\}\) or \(\{0,3\}\).

  • Single-fault analysis (O(p))

  • Represent the \(X\)-content of a two-qubit Pauli at a gate by bits \((x_c,x_t)\in\{0,1\}^2\) for control and target (1 if \(X\) or \(Y\) is present).
  • Propagate \(X\) forward through later CNOTs (rule: \(X\) on a control copies to its target; \(X\) on a target stays).
  • For each CNOT location, the final data \(X\)-set and ancilla \(X\)-bit are:
    • After 12: \((x_1,x_2)\mapsto\) data sets {}, {0,1}, {2,3}, {0,1,2,3} with ancilla bit \(x_1\oplus x_2\).
    • After 10: \((x_1,x_0)\mapsto\) {}, {1}, {0}, {0,1} with ancilla bit \(x_0\).
    • After 23: \((x_2,x_3)\mapsto\) {}, {2}, {3}, {2,3} with ancilla bit \(x_3\).
    • After 34: \((x_3,x_4)\mapsto\) {} or {3}, with ancilla bit \(x_4\) (no further 3→4 after the error).
    • After 04: \((x_0,x_4)\mapsto\) {} or {0}, with ancilla bit \(x_4\).
  • Checking acceptance (ancilla 0 and even \(X\)-parity) shows every single fault that is accepted yields either no \(X\) on data or the stabilizer \(S_X=XXXX\). No \(X_A\), \(X_B\), or \(X_A X_B\) arises at O(p).
  • Therefore the logical infidelity is zero to first order: all single-gate faults are either detected (rejected) or benign (logical \(Z\) or stabilizer).

  • Two-fault analysis (O(p²))

  • The net data \(X\)-pattern is the XOR of the two single-fault patterns; the ancilla \(X\)-bit is the XOR of the two ancilla bits.
  • Accepted wrong logicals require: 1) ancilla bit XOR = 0, 2) even \(X\)-parity on data, 3) data \(X\)-pattern equal to \(\{1,2\}\) or \(\{0,3\}\) (the \(X_A X_B\) class).
  • Enumerating gate pairs g<h and the needed single-fault \(X\)-patterns (with their multiplicities; each nonidentity two-qubit Pauli category has weight 4 or 3 among the 15):
    • Pair (10,23):
    • {1} from 10 with {2} from 23 → {1,2} (ancilla 0⊕0=0), 16 combinations.
    • {0} from 10 with {3} from 23 → {0,3} (ancilla 1⊕1=0), 16 combinations.
    • Pair (10,34):
    • {0} from 10 with {3} (ancilla-odd) from 34 → {0,3} (1⊕1=0), 16 combinations.
    • Pair (23,04):
    • {3} from 23 with {0} (ancilla-odd) from 04 → {0,3} (1⊕1=0), 16 combinations.
    • Pair (34,04):
    • {3} (ancilla-even) from 34 with {0} (ancilla-even) from 04 → {0,3} (0⊕0=0), 16 combinations.
    • {3} (ancilla-odd) from 34 with {0} (ancilla-odd) from 04 → {0,3} (1⊕1=0), 16 combinations.
    • All pairs involving gate 12 cannot yield \(\{1,2\}\) or \(\{0,3\}\) because its \(X\)-patterns are {}, {0,1}, {2,3}, {0,1,2,3}.
  • Up to this point there are 96 such two-fault combinations. Each combination above corresponds to \((p/15)^2\) probability.

  • Enforcing \(S_X=+1\) (even data \(Z\)-parity):

    • Whether a two-fault combination passes \(S_X\) depends on the presence of \(Z\) (or \(Y\)) letters on the involved qubits. For each listed combination, the resulting data \(Z\)-parity is the XOR of 3 or 4 independent fair bits (coming from choosing \(Y\) vs \(X\) on \(X\)-type qubits and \(Z\) vs \(I\) on \(X\)-free qubits), so it is even with probability 1/2.
    • Hence each set of 16 combinations contributes 8 accepted combinations.
    • Total accepted wrong combinations: 48.
  • Coefficient of the O(p²) infidelity:

\[ C=\frac{\text{# accepted wrong combinations}}{15^2}=\frac{48}{225}=\frac{16}{75}. \]
  • Therefore, to second order in p,
\[ F_{\text{log}}(p)=1-\frac{16}{75}\,p^2+O(p^3). \]
  • Note: First-order acceptance loss cancels in the conditional fidelity ratio, so only O(p²) terms appear in \(1-F_{\text{log}}\).
  1. Mathematical Typesetting
  • All key equations are typeset above.
  1. Conventions and Units
  • Error rate \(p\) is the depolarizing probability per two-qubit gate.
  • Only the two-qubit gates are noisy; \(H\) and \(M\) are ideal.
  1. Final Answer:
\[ F_{\text{log}}(p)=1-\frac{16}{75}\,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, 75)*p**2 + sp.O(p**3)  # a SymPy expression of inputs
    # ---------------------------------------------------------------

    return F_logical