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, 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 (error-free) output state
    • Start in the computational ground state
\[ |0000\rangle_{0123}\;. \]

• Apply the circuit (right-to-left order)

a) \(H_2\)

\[ \frac{|0\rangle_2+|1\rangle_2}{\sqrt2}\otimes|000\rangle_{013} \]

b) \(CNOT_{21}\) (control 2, target 1)

\[ \xrightarrow{CNOT_{21}} \]

c) \(H_0\)

\[ \xrightarrow{H_0} \]

d) \(CNOT_{03}\) (control 0, target 3)

\[ \]

e) Rearranging qubits pairwise,

\[ =\frac{|00\rangle_{21}+|11\rangle_{21}}{\sqrt2}\; \otimes\; \frac{|00\rangle_{03}+|11\rangle_{03}}{\sqrt2} \]
   where $|\Phi^+\rangle=(|00\rangle+|11\rangle)/\sqrt2$.
   Hence the ideal state is a tensor product of two Bell pairs:
   • qubits 2–1,  
   • qubits 0–3.
  1. Stabilizers of each Bell pair
    For a Bell state \(|\Phi^+\rangle\) on qubits \(i,j\),
\[ YY_{ij}\,|\Phi^+\rangle=|\Phi^+\rangle,\quad \]
Thus the set $\{XX,YY,ZZ\}$ (and $II$) stabilizes each pair.
  1. Two-qubit depolarizing channel after every CNOT
    After each CNOT the noise map on its two qubits is
\[ \mathcal E(\rho)=(1-p)\rho+\frac{p}{15}\sum_{P\ne I\!I}P\rho P. \]
  After $CNOT_{21}$ the noise acts only on qubits 21.  
  After $CNOT_{03}$ the noise acts only on qubits 03.  
No subsequent gates mix these qubit pairs, so the final error operators are simply Pauli products on the corresponding pair(s).
  1. Fidelity for a single Pauli error
    Let \(P\) be any of the 15 non-identity two-qubit Paulis on a given pair.

    Fidelity contribution

\[ =\begin{cases} 1 & P\in\{XX,YY,ZZ\},\\[2pt] 0 & \text{otherwise}. \]
Therefore, averaged over the depolarizing distribution
\[ \]
  1. Fidelity for two independent Pauli errors
    With Pauli operators \(P_{21}\) on qubits (2,1) and \(Q_{03}\) on (0,3),
\[ =|\langle\Phi^+|P_{21}|\Phi^+\rangle|\; \]
The magnitude is 1 only if **both** $P_{21}$ and $Q_{03}$
are in $\{XX,YY,ZZ\}$; otherwise it is 0.  
Hence
\[ \]
  1. Combine the mutually exclusive error cases
    • no errors: probability \((1-p)^2\), fidelity \(1\)
    • exactly one error: probability \(2p(1-p)\), fidelity \(1/5\)
    • two errors: probability \(p^2\), fidelity \(1/25\)

    Altogether

\[ F(p)=(1-p)^2+\frac{2p(1-p)}{5}+\frac{p^2}{25} =1-\frac{8}{5}p+\frac{16}{25}p^2 =\Bigl(1-\frac{4}{5}p\Bigr)^2. \]

Final Answer:
The physical four-qubit state fidelity after the preparation circuit, as a function of the two-qubit gate error rate \(p\), is

$$

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. Error model
    • After each of the two CNOTs a two–qubit depolarising channel acts on the same two qubits as the gate
\[ (1-p)\rho+\frac{p}{15}\!\! \]
  Denote by  
  •  $P_{21}$ the Pauli error on qubits $(2,1)$ (coming from $CNOT_{21}$),  
  •  $Q_{03}$ the Pauli error on qubits $(0,3)$ (coming from $CNOT_{03}$).
  1. Which two–qubit Paulis are undetectable?
    An error \(E\) is undetectable iff it commutes with both stabilisers
\[ S_X = XXXX,\qquad S_Z = ZZZZ. \]
For a twoqubit operator supported on some qubit pair
only the three elements
\[ \{\,XX,\;YY,\;ZZ\}\, \]
commute with **both** $S_X$ and $S_Z$ (identity of course also does).  
Therefore, for either pair of qubits  good operators (no syndrome): $I I,\,XX,\,YY,\,ZZ$    bad operators (trigger syndrome): the remaining 12 Paulis.
  1. Syndrome pattern produced by a single two-qubit Pauli

    For every error we record the pair of parity bits

\[ 0 & \text{commutes with }S_X,\\ 1 & \text{anticommutes with }S_X, \end{cases}\qquad b=\begin{cases} 0 & \text{commutes with }S_Z,\\ 1 & \text{anticommutes with }S_Z . \]
A direct enumeration gives for **each** depolarising channel

| $(a,b)$ | operators | probability |
|---------|-----------|-------------|
| (0,0)   | $II,XX,YY,ZZ$                     | $p_{00}=1-p+\dfrac{3p}{15}=1-\dfrac{4p}{5}$ |
| (1,0)   | $Z,\;Z,\;XY,\;YX$                 | $p_{10}= \dfrac{4p}{15}$ |
| (0,1)   | $X,\;X,\;YZ,\;ZY$                 | $p_{01}= \dfrac{4p}{15}$ |
| (1,1)   | $Y,\;Y,\;XZ,\;ZX$                 | $p_{11}= \dfrac{4p}{15}$ |
  1. Probability that no error is detected (post-selection kept)

    Let \((a_1,b_1)\) be the parity bits of \(P_{21}\) and \((a_2,b_2)\) those of \(Q_{03}\).
    After both channels the combined error is detected iff

\[ a=a_1\oplus a_2,\; b=b_1\oplus b_2 \]
contains at least one ‘1’.  
Consequently the run is **kept** when simultaneously
\[ a_1=a_2,\qquad b_1=b_2. \]
Because the two channels are independent,
\[ P_{\text{keep}} =\sum_{(a,b)\in\{0,1\}^2} p_{ab}^2 =p_{00}^2+3\,p_{10}^2 =(1-\tfrac{4p}{5})^{\!2}+3\Bigl(\tfrac{4p}{15}\Bigr)^{\!2} =1-\frac{8p}{5}+\frac{64p^{2}}{75}. \]
  1. Logical state fidelity conditioned on keeping the run

    The ideal encoded GHZ state obtained by the circuit is

\[ |\Psi_{\mathrm{enc}}\rangle =|\Phi^{+}\rangle_{21}\otimes|\Phi^{+}\rangle_{03}, \qquad |\Phi^{+}\rangle=\frac{|00\rangle+|11\rangle}{\sqrt2}. \]
For a single Bell pair
\[ \begin{cases} \;\;1 & P\in\{II,XX,YY,ZZ\},\\[4pt] \;\;0 & \text{otherwise}. \]
Hence after the two independent errors
\[ \langle\Psi_{\mathrm{enc}}|Q_{03}P_{21}|\Psi_{\mathrm{enc}}\rangle =\langle\Phi^{+}|P_{21}|\Phi^{+}\rangle\, \langle\Phi^{+}|Q_{03}|\Phi^{+}\rangle = \begin{cases} 1 & P_{21},Q_{03}\in\{II,XX,YY,ZZ\},\\ 0 & \text{otherwise}. \end{cases} \]
Therefore the (squared) overlap with the target logical state equals 1
**iff** both individual errors are of the $(a,b)=(0,0)$ type.
The probability for that event is $p_{00}^2=(1-\tfrac{4p}{5})^{2}$.

The logical fidelity **conditioned on acceptance** is then
\[ F_{\mathrm{logical}}(p)= \frac{p_{00}^2}{P_{\text{keep}}} =\frac{(1-\frac{4}{5}p)^{2}} {(1-\frac{4}{5}p)^{2}+3\left(\frac{4}{15}p\right)^{2}} =\frac{(1-\frac{4}{5}p)^{2}} {1-\frac{8}{5}p+\frac{64}{75}p^{2}}. \]
Expanding for small $p$,
\[ F_{\mathrm{logical}}(p)=1-\frac{64}{75}p^{2}+O(p^{3}), \]
i.e. all first-order error contributions are removed by the
post-selection.

Final Answer:
The logical two-qubit state fidelity after post-selection on all detectable errors is

\[ \boxed{\,F_{\mathrm{logical}}(p)= \frac{\bigl(1-\tfrac{4}{5}p\bigr)^{2}} {1-\tfrac{8}{5}p+\tfrac{64}{75}p^{2}}\,}. \]
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(4, 5) * p)**2) / (1 - sp.Rational(8, 5) * p + sp.Rational(64, 75) * p**2)
    # ---------------------------------------------------------------

    return F_logical