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

Step-by-Step Derivation

  1. Ideal target state.
    Starting from \(\ket{0000}\), the noiseless circuit
\[ \ket{\psi} = \bigl(\mathrm{CNOT}_{03}\bigr)\,(H_0)\,\bigl(\mathrm{CNOT}_{21}\bigr)\,(H_2)\,\ket{0000} \]

produces a pure 4-qubit stabilizer state \(\ket\psi\), namely the logical GHZ on qubits \(A,B\).

  1. Error model.
    Each CNOT\(_{ij}\) is followed by a two-qubit depolarizing channel on qubits \((i,j)\):
\[ \mathcal{E}_{ij}(\rho) = (1-p)\,\rho + \frac{p}{15}\sum_{P\in\{I,X,Y,Z\}^{\otimes2}\setminus\{I\}} P_{ij}\,\rho\,P_{ij}\,. \]
  1. Noisy output state.
    Label the first CNOT (\(21\)) error by \(P_1\) on qubits \((2,1)\) and the second (\(03\)) by \(P_2\) on \((0,3)\). Since the Hadamard on 2 and the CNOT on 0–3 commute with errors on 1–2, the final state is
\[ \rho = \sum_{P_1,P_2} \Pr(P_1)\,\Pr(P_2)\; \bigl(\mathrm{CNOT}_{03}H_0\,P_1\,\mathrm{CNOT}_{21}H_2\ket{0000}\bigr) \bigl\langle\cdots\bigr|\; P_2\,. \]

Equivalently, up to conjugation by the ideal unitaries, the total error is \(\,E=P_2^{(0,3)}\,P_1^{(1,2)}\), where \(P_1\), \(P_2\) are independent random Paulis with

\[ \Pr\bigl(P_i = I\otimes I\bigr)=1-p, \quad \Pr\bigl(P_i = \text{any non-identity}\bigr)=\frac p{15}\,. \]
  1. Fidelity as stabilizer overlap.
    The ideal \(\ket\psi\) is a stabilizer state whose stabilizer group factorizes over the pairs \((0,3)\) and \((1,2)\):
\[ G \;=\; \bigl\{\,g_{03}\otimes g_{12}\;\big|\; g_{03},g_{12}\in\{I,\,X_0X_3,\,Z_0Z_3,\,Y_0Y_3\}\bigr\}\,. \]

For any Pauli error \(E=P_2\otimes P_1\),

\[ \bigl|\bra\psi\,E\,\ket\psi\bigr|^2 = \begin{cases} 1, & P_2\in\{I,X_0X_3,Z_0Z_3,Y_0Y_3\} \;\text{and}\; P_1\in\{I,X_1X_2,Z_1Z_2,Y_1Y_2\},\\ 0, & \text{otherwise.} \end{cases} \]
  1. Probability of a “harmless” Pauli on one pair.
    On each pair \((i)\in\{(0,3),(1,2)\}\),
\[ \Pr\bigl(P_i\in\{I,\,XX,\,ZZ,\,YY\}\bigr) = (1-p) \;+\; 3\;\frac p{15} = 1 - \frac{4\,p}{5}\,. \]
  1. Total fidelity.
    Since \(P_1\) and \(P_2\) are independent,
\[ F(p) = \sum_{P_1,P_2}\Pr(P_1)\Pr(P_2)\,\bigl|\bra\psi\,P_2P_1\,\ket\psi\bigr|^2 = \Bigl(1 - \tfrac{4p}{5}\Bigr)\!\times\!\Bigl(1 - \tfrac{4p}{5}\Bigr) = \Bigl(1 - \tfrac{4p}{5}\Bigr)^2. \]

Final Answer:

\[ F(p) \;=\;\bigl(1 - \tfrac{4}{5}p\bigr)^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

Step-by-Step Derivation

We label the two noisy CNOT gates as acting on qubit‐pairs – first \( \mathrm{CNOT}_{21}\) with error \(P_1\) on qubits \((2,1)\), – then \( \mathrm{CNOT}_{03}\) with error \(P_2\) on qubits \((0,3)\).
No errors occur on the Hadamards. Thus the total error is

\[ E \;=\; P_2^{(0,3)}\;P_1^{(2,1)}, \]

where \(P_i\) are drawn i.i.d. from the two-qubit depolarizing channel

\[ \Pr\bigl(P_i = I\otimes I\bigr)=1-p, \quad \Pr\bigl(P_i =\text{any one of the other }15\text{ Paulis}\bigr) =\frac p{15}\,. \]
  1. Post‐selection (“no‐detect”) condition.
    We measure the two stabilizers
\[ S_X = X_0X_1X_2X_3,\qquad S_Z = Z_0Z_1Z_2Z_3 \]

at the end and keep only those runs where both syndromes are “+1.”
Equivalently, we require

\[ [E,S_X]=0 \quad\text{and}\quad [E,S_Z]=0. \]

One checks that these two commutation conditions are equivalent to requiring that the Pauli on \((0,3)\) and the Pauli on \((1,2)\) have the same “\(Z/Y\)–parity” and the same “\(X/Y\)–parity.”

  1. Single‐pair parity classification.
    For a single two‐qubit Pauli \(P\) on a pair we define
\[ a = \#\{\,\text{qubits where }P\in\{Z,Y\}\}\bmod2,\quad b = \#\{\,\text{qubits where }P\in\{X,Y\}\}\bmod2. \]

One finds that among the 16 Pauli operators on two qubits exactly 4 have parity \((a,b)=(0,0)\), and the other three parity‐classes \((0,1),(1,0),(1,1)\) each also have 4 operators. Since the depolarizing channel is uniform over the 15 non‐identity Paulis, the probability that a random error on one pair lies in class \((a,b)\) is

\[ \pi(0,0)= (1-p)\;+\;3\frac p{15} \;=\;1-\frac{4p}{5}, \qquad \pi(0,1)=\pi(1,0)=\pi(1,1)=4\frac p{15}\,. \]
  1. Denominator: probability of no‐detection.
    The two errors are independent, and commutation with both stabilizers forces the two pairs to lie in the same parity‐class. Hence
\[ \Pr[\text{no detect}] = \sum_{(a,b)\in\{0,1\}^2}\;\pi(a,b)^2 = \Bigl(1-\tfrac{4p}{5}\Bigr)^2 \;+\;3\Bigl(4\tfrac p{15}\Bigr)^2 =1-\tfrac{8}{5}p+\tfrac{64}{75}p^2. \]
  1. Numerator: probability of correct logical GHZ.
    Conditioned on no‐detect, the remaining errors lie in the code’s normalizer \(N(S)\). Those that act trivially on the logical GHZ are exactly – the four stabilizers \(\{I,XXXX,ZZZZ,YYYY\}\), and
    – the four elements \(Z_AZ_B\cdot S\) (the coset which implements a global logical \(Z_AZ_B\), which on \(\tfrac{|00\rangle+|11\rangle}{\sqrt2}\) also has eigenvalue \(+1\)).

Of these eight “good” errors exactly four lie in the identity‐stabilizer coset: \((P_2,P_1)\in\{(I,I),(XX,XX),(ZZ,ZZ),(YY,YY)\}\), and four lie in the \(Z_AZ_B\)–coset: \(\bigl\{(I,ZZ),(ZZ,I),(XX,YY),(YY,XX)\bigr\}\).

Their probabilities are – \(\Pr[P_2=P_1=I]=(1-p)^2\),
– each weight-2 pair \((XX,XX),(ZZ,ZZ),(YY,YY)\) has \(\,(p/15)^2\),
– the two “mixed” coset events \((I,ZZ)\) or \((ZZ,I)\) each have \((1-p)(p/15)\),
– and the other two \((XX,YY),(YY,XX)\) each have \((p/15)^2\).
Summing gives

\[ \Pr[\text{logical‐good}] = (1-p)^2 \;+\;2\,(1-p)\frac p{15} \;+\;5\Bigl(\frac p{15}\Bigr)^2 =1-\frac{28}{15}\,p+\frac{8}{9}\,p^2. \]
  1. Logical‐state fidelity.
    Conditioning on no‐detection, the overlap of the logical state with the ideal GHZ is the fraction of “good” over all no‐detect events:
\[ F_L(p) =\frac{\Pr[\text{logical‐good}]}{\Pr[\text{no detect}]} =\frac{1-\tfrac{28}{15}p+\tfrac{8}{9}p^2} {1-\tfrac{8}{5}p+\tfrac{64}{75}p^2}\,. \]

Final Answer:

\[ \boxed{ F_L(p) \;=\; \frac{1-\tfrac{28}{15}p+\tfrac{8}{9}p^2} {1-\tfrac{8}{5}p+\tfrac{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

Step‐by‐Step Derivation

We label the five noisy CNOT gates (right‐to‐left in the circuit) and their Pauli errors as follows:

• After CNOT\(_{12}\): error \(P_1\) on qubits \((1,2)\)
 • After CNOT\(_{10}\): error \(P_2\) on \((1,0)\)
 • After CNOT\(_{23}\): error \(P_3\) on \((2,3)\)
 • After CNOT\(_{34}\): error \(P_4\) on \((3,4)\)
 • After CNOT\(_{04}\): error \(P_5\) on \((0,4)\)

Each \(P_i\) is drawn independently from the two–qubit depolarizing channel

\[ \Pr[P_i=I\otimes I]=1-p,\quad \Pr[P_i\ne I\otimes I]=\frac p{15}\;\text{(each non‐identity Pauli equally likely).} \]

We then perform a \(Z\)–basis measurement of qubit 4 (the ancilla) and post‐select on outcome \(\ket0\). Finally we (conceptually) measure the two code‐stabilizers

\[ S_X=X_0X_1X_2X_3,\qquad S_Z=Z_0Z_1Z_2Z_3 \]

on the data qubits \(0,1,2,3\) and post‐select on the “+1” outcome for both. The surviving runs are exactly those in which

(i) the net error on the ancilla commutes with \(Z_4\) (so it does not flip the ancilla measurement), and
(ii) the net data‐qubit error commutes with both \(S_X\) and \(S_Z\) (so it is undetected by the code).

We denote by \(E_{\rm tot}\) the overall Pauli on all five qubits obtained by propagating each \(P_i\) forward through the subsequent ideal CNOTs. Then the post‐selected logical fidelity is

\[ F_L(p) =\; \frac{ \displaystyle \sum_{P_1,\dots,P_5} \Pr[P_1]\cdots\Pr[P_5]\; \bigl\langle\overline{00}\bigr| \Tr_{\!4}\!\bigl[E_{\rm tot}\,\ket{00000}\!\bra{00000}\,E_{\rm tot}\bigr] \bigl|\overline{00}\bigr\rangle \;\; \delta_{\rm no\!-\!detect} } { \displaystyle \sum_{P_1,\dots,P_5} \Pr[P_1]\cdots\Pr[P_5]\; \delta_{\rm no\!-\!detect} }\!, \]

where \(\delta_{\rm no\!-\!detect}=1\) if and only if

\[ [E_{\rm tot},\,Z_4]=0 \quad\text{and}\quad [E_{\rm tot},\,S_X]=0 \quad\text{and}\quad [E_{\rm tot},\,S_Z]=0, \]

and zero otherwise.


Because this gadget is fault‐tolerant at distance 2, one checks by explicit propagation (or by the usual “malignant‐pair” counting) that

• Every single fault (\(1\) of the \(P_i\) non‐identity) is caught by either the ancilla measurement or the final stabilizer check.
• The first possible undetected logical error appears only when two faults occur “just so” (a certain small subset of the \(\binom52\) pairs of gates, each with a few values of \((P_i,P_j)\), can slip past both checks and land on a nontrivial logical operator).

Hence

1. Acceptance probability (denominator) has no \(O(p)\)–term; to second order one finds

\[ \Pr[\hbox{accept}] = (1-p)^5 \;+\; \underbrace{N_{\rm slip}}_{=O(1)}\;\Bigl(\!\tfrac p{15}\Bigr)^{2} \;+\;O(p^3) \;\approx\;1-5p+\bigl(10+N_{\rm slip}/225\bigr)p^2+O(p^3)\,, \]

but the linear term vanishes after post‐selection so the leading correction is \(O(p^2)\).

2. No‐logical‐error probability (numerator) likewise has no \(O(p)\) entry and picks up a still smaller \(O(p^2)\) from exactly those “malignant” fault pairs that both escape detection and implement a nontrivial logical flip. Denote by \(N_{\rm mal}\) the total count of such malignant two‐fault combinations (including their various Pauli‐values).

Hence to second order

\[ F_L(p) =\; \frac{(1-p)^5 + N_{\rm good}\,(p/15)^2 + O(p^3)} {(1-p)^5 + N_{\rm slip}\,(p/15)^2 + O(p^3)} \;=\;1 \;-\;\frac{N_{\rm mal}}{225}\,p^2 \;+\;O(p^3)\,, \]

showing that all \(O(p)\) errors are detected and the first infidelity appears only at \(O(p^2)\).


Final Answer (leading behavior).

Up to \(\displaystyle O(p^3)\) one finds simply

\[ \boxed{% F_L(p)\;=\;1 \;-\;\frac{N_{\rm mal}}{225}\,p^2\;+\;O(p^3), } \]

where \(N_{\rm mal}\) is the (small) number of two‐fault pairs in the ancilla‐gadget that both slip detection and implement a nontrivial logical operator. In particular, this circuit is first‐order fault‐tolerant (no term linear in \(p\)), and the logical infidelity scales as \(O(p^2)\).

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')
N_mal = sp.symbols('N_mal')

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 ------------------
    # Leading fault-tolerant behavior: no O(p) term, first correction ~ p^2
    F_logical = 1 - (N_mal/225)*p**2
    # ---------------------------------------------------------------

    return F_logical