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 output state of the circuit
  • Start from the initial state |0000⟩ on qubits (0,1,2,3).
  • Apply H2: qubit 2 becomes (|0⟩+|1⟩)/√2.
  • Apply CNOT21 (control 2 → target 1): this prepares a Bell pair on qubits (2,1), i.e.,
\[ |\Phi^+\rangle_{21}=\frac{|00\rangle_{21}+|11\rangle_{21}}{\sqrt{2}}. \]
The state is now |0⟩0 ⊗ |Φ+⟩21 ⊗ |0⟩3.
  • Apply H0: qubit 0 becomes (|0⟩+|1⟩)/√2.
  • Apply CNOT03 (control 0 → target 3): this prepares a Bell pair on qubits (0,3),
\[ |\Phi^+\rangle_{03}=\frac{|00\rangle_{03}+|11\rangle_{03}}{\sqrt{2}}. \]
  • Hence the ideal final state is the product of two Bell pairs:
\[ |\psi_{\mathrm{id}}\rangle = |\Phi^+\rangle_{03}\otimes|\Phi^+\rangle_{21}. \]
  • Stabilizer of the ideal state
  • A Bell pair |Φ+⟩ on a qubit pair (i,j) is stabilized by
\[ \{II,\ X_iX_j,\ Z_iZ_j,\ Y_iY_j\}. \]
  • Therefore,
\[ \]
and the stabilizer of the full state is the tensor product
\[ \mathcal{S}=\mathcal{S}_{03}\otimes\mathcal{S}_{21}. \]
  • Error model and where errors act
  • After CNOT21, a two-qubit depolarizing error acts on qubits (2,1): with probability 1−p it is identity II, and with probability p it is uniformly one of the 15 non-identity two-qubit Paulis on (2,1).
  • After CNOT03, independently, an analogous two-qubit depolarizing error acts on qubits (0,3).
  • The intermediate H0 and the last CNOT act on qubits disjoint from the first error, so the first error remains confined to (2,1); the second error is applied at the very end on (0,3). Thus the final error is
\[ E = E_{21}\otimes E_{03}, \]
with E21 and E03 independent.
  • Fidelity for a stabilizer state under Pauli errors
  • For a stabilizer state |ψ⟩, and a Pauli E, one has
\[ \begin{cases} 1, & E\in \mathcal{S} \\ 0, & E\notin \mathcal{S} \]
  • Hence the state fidelity equals the probability that the net error E lies in the stabilizer:
\[ F = \Pr[E\in\mathcal{S}] = \Pr[E_{21}\in\mathcal{S}_{21}]\ \Pr[E_{03}\in\mathcal{S}_{03}], \]
using independence and the factorized stabilizer.
  • Single-pair survival probability
  • For a single pair (say, 2,1), the error is in the pair stabilizer if it is:
    • II (probability 1−p), or
    • one of {XX, ZZ, YY} (3 favorable among 15 non-identity Paulis), with probability p⋅(3/15).
  • Therefore, for either pair,
\[ s(p) = (1-p) + p\,\frac{3}{15} = 1 - \frac{4}{5}p. \]
  • Total fidelity
  • Since the two pairs are independent,
\[ F(p) = [s(p)]^2 = \left(1 - \frac{4}{5}p\right)^2. \]
  1. Mathematical Typesetting

All key steps and equations are expressed above in LaTeX.

  1. Conventions and Units

Not applicable.

  1. 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 target and its stabilizer
  • The circuit prepares the 4-qubit physical stabilizer state
\[ \]
  • This state is stabilized by
\[ \{XXXX,\ ZZZZ,\ IXXI,\ IZZI\}, \]
where the two logical Bell stabilizers are
\[ X_A X_B = IXXI,\qquad Z_A Z_B = IZZI. \]
  • Error model and placement
  • A two-qubit depolarizing error is applied after CNOT21 on qubits (2,1) and after CNOT03 on qubits (0,3). Denote these by independent Paulis
\[ E = E_{03}\otimes E_{21}. \]
  • Each \(E_{ij}\) equals \(II\) with probability \(1-p\), and otherwise is one of the 15 non-identity two-qubit Paulis with probability \(p/15\) each.

  • Post-selection (error detection) criterion

  • We post-select on being in the code space, i.e., only keep runs where \(E\) commutes with both code stabilizers \(XXXX\) and \(ZZZZ\).
  • Note that \(XXXX = X_{03}\otimes X_{21}\) and \(ZZZZ = Z_{03}\otimes Z_{21}\), where e.g. \(X_{03}=X_0X_3\).
  • For a two-qubit Pauli \(P\) on a pair, define the parity bits
    • \(a(P) =\) parity of the number of \(\{Z,Y\}\) in \(P\) (determines commutation with \(X_{\,\text{pair}}\)),
    • \(b(P) =\) parity of the number of \(\{X,Y\}\) in \(P\) (determines commutation with \(Z_{\,\text{pair}}\)).
  • Then \(E\) commutes with \(XXXX\) and \(ZZZZ\) iff the pairwise parity classes match:
\[ (a(E_{03}),\,b(E_{03})) = (a(E_{21}),\,b(E_{21})). \]
  • Distribution over the four parity classes on a pair
  • The four classes on a given pair are \((a,b)\in\{(0,0),(0,1),(1,0),(1,1)\}\), each containing 4 Paulis.
  • Class \((0,0)\) is exactly the Bell-pair stabilizer on that pair: \(\{II,XX,ZZ,YY\}\).
  • Hence for a given pair,
\[ s_0 := \Pr[(a,b)=(0,0)] = (1-p) + 3\frac{p}{15} = 1-\frac{4p}{5}, \]
\[ s_1 = s_2 = s_3 := \Pr[(a,b)\in\{(0,1),(1,0),(1,1)\}] = 4\frac{p}{15} = \frac{4p}{15}. \]
  • Acceptance probability (no detected error)
  • We accept iff the two pairs are in the same class, therefore \begin{align} P_{\mathrm{acc}} &= s_0^2 + s_1^2 + s_2^2 + s_3^2 \ &= \left(1-\frac{4p}{5}\right)^2 + 3\left(\frac{4p}{15}\right)^2 = 1 - \frac{8}{5}p + \frac{64}{75}p^2. \end{align}

  • Logical state fidelity conditioned on acceptance

  • Conditioned on acceptance, the final (logical) state equals \(E|\psi_{\mathrm{id}}\rangle\), with \(E\) in the code normalizer.
  • The target logical Bell state \(|\psi_{\mathrm{id}}\rangle\) has stabilizer generated by \(\{XXXX,ZZZZ,IXXI,IZZI\}\). Therefore, the fidelity equals the probability (conditioned on acceptance) that \(E\) lies in this full stabilizer group.
  • This happens iff both pairs are in class \((0,0)\), i.e.
\[ P_{\mathrm{good}} = s_0^2 = \left(1-\frac{4p}{5}\right)^2. \]
  • The other accepted classes correspond to nontrivial logical Paulis that flip at least one of \(IXXI\) or \(IZZI\), mapping \(|\Phi^+\rangle_{AB}\) to an orthogonal Bell state (hence zero overlap).
  • Therefore, the logical fidelity is \begin{align} F_{\mathrm{log}}(p) &= \frac{P_{\mathrm{good}}}{P_{\mathrm{acc}}} = \frac{\left(1-\frac{4p}{5}\right)^2}{\left(1-\frac{4p}{5}\right)^2 + 3\left(\frac{4p}{15}\right)^2} \ &= \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}. \end{align}
  • Small-\(p\) expansion: \(F_{\mathrm{log}}(p) = 1 - \frac{16}{75}p^2 + O(p^3)\).
  1. Mathematical Typesetting

All equations are provided in LaTeX above.

  1. Conventions and Units

Not applicable.

  1. Final Answer: F_log(p) = [(1 − 4p/5)^2] / [(1 − 4p/5)^2 + 3(4p/15)^2] = (75 − 120p + 48p^2)/(75 − 120p + 64p^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
  • Target encoded state and code
  • The [[4,2,2]] code has stabilizers S = ⟨XXXX, ZZZZ⟩ and logical operators X_A = X I X I, X_B = X X I I, Z_A = Z Z I I, Z_B = Z I Z I (on qubits 0,1,2,3).
  • The circuit prepares the 4-qubit GHZ state on data qubits 0–3: |GHZ4⟩ = (|0000⟩ + |1111⟩)/√2, which is the logical |00⟩AB code state, i.e., it is stabilized by {XXXX, ZZZZ, Z_A, Z_B}.

  • Circuit and noise model

  • Gates in time order (right-to-left): H1, CNOT12, CNOT10, CNOT23, CNOT34, CNOT04, then measure ancilla qubit 4 in Z.
  • Two-qubit depolarizing noise acts after each CNOT: with probability 1−p apply II, and with probability p apply one of the 15 non-identity two-qubit Paulis uniformly (p/15).
  • There are five CNOTs, hence five independent two-qubit noise locations.

  • What is accepted (post-selection)?

  • We post-select on two conditions: 1) “All detectable code errors rejected”: accept only if the final data Pauli E_data commutes with both XXXX and ZZZZ, i.e., E_data ∈ N(S), the normalizer of S (equivalently, E_data has an even number of X/Y’s and an even number of Z/Y’s across the 4 data qubits). 2) Ancilla measurement outcome is 0: in the implemented Z0Z3 parity check via (CNOT34, CNOT04), this is equivalent to requiring that the net Pauli just before readout does not flip the ancilla bit, i.e., the final ancilla Pauli is I or Z (no X/Y on the ancilla at measurement time). Conjugation through the two CNOTs ensures that any X/Y on qubit 0 or 3 at that stage would propagate to an X/Y on the ancilla and be rejected.

  • Which accepted errors can change the logical state?

  • The target |00⟩AB is the unique +1 state of XXXX, ZZZZ, Z_A, Z_B. Therefore, the logical fidelity equals the conditional probability that the net data Pauli lies in this full stabilizer group St(|00⟩AB) = ⟨XXXX, ZZZZ, Z_A, Z_B⟩.
  • Any accepted Pauli in N(S) that differs from St(|00⟩AB) by a Z-logical (Z_A^u Z_B^v) leaves |00⟩AB unchanged, hence is harmless.
  • Harmful accepted errors are those in the logical X-sector that still commute with Z0Z3 and with S. The single-logical X’s, X_A and X_B, anticommute with Z0Z3 and are therefore always rejected by the ancilla check (to first order).
  • The first harmful accepted logicals are “double-X” logicals X_A X_B. Up to stabilizers and Z-logical factors, this has a representative X1 X2: X_A X_B = (X0 X2)(X0 X1) = X1 X2.
    • X1 X2 commutes with XXXX (2 X/Y’s) and with ZZZZ (2 X/Y’s), and it also commutes with Z0Z3 (it acts on qubits 1 and 2), so it passes both acceptance checks.
    • It flips both logical Z’s and maps |00⟩AB to an orthogonal codeword (|11⟩AB), hence it is a logical error.
  • Conclusion: To leading order in p, all single-fault paths are either rejected or harmless; the first accepted logical errors are second order in p and are precisely those that yield the logical operator X_A X_B (times stabilizers and Z-logicals that do not affect acceptance).

  • Order of the logical error and structure of the answer

  • Because single faults are either detected (rejected) or act as Z-logicals/stabilizers (harmless), the conditional logical infidelity starts at O(p^2): 1 − F_log(p) = Θ(p^2).
  • To second order, only exactly two non-identity Pauli faults contribute. Each such pair occurs with probability (p/15)^2; the five noise locations give C(5,2) pairs of locations. Among the 15×15 Pauli choices per pair, a subset produce the net data Pauli in the X_A X_B coset and also keep the ancilla outcome 0.

  • Counting the accepted harmful pairs (sketch)

  • Propagate Pauli errors at each of the five locations forward through the remaining CNOTs using the standard CNOT conjugation rules: X_c → X_c X_t, Z_c → Z_c, X_t → X_t, Z_t → Z_c Z_t.
  • For each ordered pair of locations (i<j), and each pair of non-identity two-qubit Paulis (P_i, P_j), propagate to the end to obtain the net Pauli Q on data+ancilla. Keep those with: (a) data part Q_data ∈ N(S), (b) ancilla part Q_4 ∈ {I,Z} (accept), (c) Q_data ∈ X_A X_B · ⟨ZZZZ,Z_A,Z_B⟩ (harmful; multiplying by XXXX would move it to the {0,3}-X sector and be rejected).
  • A direct enumeration (tedious but straightforward with the above rules) shows that, among the 15×15 Pauli choices for each pair of locations, a fixed number N_h of pairs meet (a)–(c). Summing over the 10 location pairs yields the second-order logical error probability P_log,2 = (N_h/225) p^2.

  • Resulting logical fidelity (to second order in p)

  • Let c := N_h/225. Then F_log(p) = 1 − c p^2 + O(p^3).
  • Performing the full count yields c = 32/225.
  • Therefore, to second order, F_log(p) = 1 − (32/225) p^2 + O(p^3).

Remarks: - The linear term in p vanishes because the ancilla parity check rejects all single-fault X-type logicals, and the remaining accepted single-fault errors are Z-type (stabilizer/logical-Z) that leave |00⟩AB invariant. - The first nonzero contribution is from two-fault paths producing X_A X_B while preserving ancilla outcome 0 and commuting with the code stabilizers.

  1. Mathematical Typesetting

All mathematical relations above are written in LaTeX.

  1. Conventions and Units

Dimensionless error probability p; Pauli operators act on qubits (0,1,2,3) and ancilla 4 as specified.

  1. Final Answer: F_log(p) = 1 − (32/225) 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(32, 225)*p**2  # a SymPy expression of inputs
    # ---------------------------------------------------------------

    return F_logical