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

1. Step–by–Step Derivation

1.1 Ideal state produced by the circuit
Start in the computational vacuum \(\lvert 0000\rangle_{0123}\) and apply the gates from right to left

  • \(H_{2}\) :
\[ \frac{1}{\sqrt2}\bigl(\lvert 0000\rangle+\lvert 0100\rangle\bigr) \]
  • \({\rm CNOT}_{21}\) (control 2, target 1):
\[ \frac{1}{\sqrt2}\bigl(\lvert 0000\rangle+\lvert 0110\rangle\bigr) \]
  • \(H_{0}\) :
\[ \frac{1}{2}\bigl(\lvert 0000\rangle+\lvert 1000\rangle+\lvert 0110\rangle+\lvert 1110\rangle\bigr) \]
  • \({\rm CNOT}_{03}\) (control 0, target 3):
\[ \lvert 0000\rangle\;+\;\lvert 1001\rangle\;+\;\lvert 0110\rangle\;+\;\lvert 1111\rangle \]

This is the physical encoding of the logical Bell (GHZ-type) state
\(\bigl(\lvert 00\rangle_{AB}+\lvert 11\rangle_{AB}\bigr)/\sqrt2\) in the [[4,2,2]] code.


1.2 Stabilizer of the prepared state

The code stabilizers are
\(g_1 = XXXX\), \(g_2 = ZZZZ\).

For the logical Bell state we have the additional (logical) stabilizers

\(h_1 = X_A X_B = IXXI\), \(h_2 = Z_A Z_B = IZZI\).

The complete stabilizer group of \(\lvert\psi_{\mathrm{ideal}}\rangle\) is

\[ \mathcal S \;=\;\langle g_1,\;g_2,\;h_1,\;h_2\rangle, \]

which has \(|\mathcal S| = 2^{4}=16\) elements.
Enumerating them (ignoring overall phases) one finds

• weight-0: \(IIII\)

• weight-2 (6 elements)
\(IXXI,\;IYYI,\;IZZI,\;XI\!IX,\;YI\!IY,\;ZI\!IZ\)

• weight-4 (9 elements)
\(XXXX,\;YYYY,\;ZZZZ,\;ZYYZ,\;YZZY,\;XYYX,\;XZZX,\;ZXXZ,\;YX\!XY\).

All operators in \(\mathcal S\) leave \(\lvert\psi_{\mathrm{ideal}}\rangle\) unchanged, i.e.
\(\sigma\lvert\psi_{\mathrm{ideal}}\rangle = \pm\lvert\psi_{\mathrm{ideal}}\rangle\) for every \(\sigma\in\mathcal S\).


1.3 Error model

• After each two–qubit CNOT a two–qubit depolarising channel acts on the same pair:

\[ {\cal E}(\rho) \;=\;(1-p)\rho+\frac{p}{15}\sum_{\sigma\neq II}\sigma\,\rho\,\sigma, \]

where the sum runs over the 15 non-identity two-qubit Paulis.

• There are two CNOTs, hence two independent error channels:

Channel 1 on qubits \((2,1)\), Channel 2 on qubits \((0,3)\).


1.4 Fidelity for a fixed Pauli error

For a pure target state, the physical (state) fidelity after a Pauli \(E\) is

\(F(E)=|\langle\psi_{\mathrm{ideal}}|E|\psi_{\mathrm{ideal}}\rangle|^{2}\).

Because \(\lvert\psi_{\mathrm{ideal}}\rangle\) is a stabilizer state,

\(F(E)=\begin{cases} 1,& E\in\mathcal S,\\[4pt] 0,& E\notin\mathcal S. \end{cases}\)


1.5 Single–channel error contribution

For either channel, 3 of the 15 two-qubit Paulis are in \(\mathcal S\) (the \(XX\), \(YY\), \(ZZ\) acting on the corresponding qubit pair).
Hence

\[ =\Pr\bigl(E\in\mathcal S\mid E\neq II\bigr) =\frac{3}{15} \]

1.6 Two–channel (double) error contribution

With errors on both channels we have \(E = E_2E_1\) acting on all four qubits. \(E\) is in \(\mathcal S\) iff it equals one of the 9 weight-4 stabilizers listed above. Because the two channels are independent and each supplies 15 possibilities,

\[ =\frac{9}{15\times15} =\frac{9}{225} \]

1.7 Averaged fidelity

Break the possibilities into:

  1. no error, prob.\ \((1-p)^2\), fidelity \(1\)
  2. exactly one error, prob.\ \(2p(1-p)\), fidelity \(f_{\text{single}}\)
  3. two errors, prob.\ \(p^{2}\), fidelity \(f_{\text{double}}\)

Hence

\[ \begin{aligned} F(p) &=(1-p)^2 +2p(1-p)\left(\frac15\right) +p^2\left(\frac1{25}\right) \\[4pt] &=1-2p+p^{2} +\frac{2p}{5}-\frac{2p^{2}}{5} +\frac{p^{2}}{25} \\[4pt] &=1-\frac{8}{5}p+\frac{16}{25}p^{2}. \end{aligned} \]

2. Final Answer

Final Answer:
The average physical-state fidelity after the four–qubit GHZ preparation circuit is

\[ \boxed{\,F(p)=1-\dfrac{8}{5}\,p+\dfrac{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

(Throughout we neglect global phases and write Paulis as strings in the order
qubits \(0,1,2,3\).)


  1. Error model and notation

• There are two CNOTs, hence two independent error channels
\({\cal E}_{21}\) (on the pair \(2,1\)) and \({\cal E}_{03}\) (on the pair \(0,3\)).

• After a CNOT the two–qubit depolarising channel acts

\[ {\cal E}(\rho)=(1-p)\rho+\frac{p}{15}\sum_{\sigma\neq II}\sigma\,\rho\,\sigma . \]

We denote the Pauli drawn from channel \((2,1)\) by \(E_{21}\) and that from
\((0,3)\) by \(E_{03}\); the overall error is
\(E=E_{03}E_{21}\).


  1. Detectable vs. undetectable errors

The code stabilisers are

\[ g_{1}=XXXX,\qquad g_{2}=ZZZZ . \]

An error is undetectable (passes syndrome \(+1,+1\)) iff it commutes with both \(g_{1}\) and \(g_{2}\).
For the two–qubit Pauli set on either pair this happens only for

\[ \boxed{\;XX,\;YY,\;ZZ\;} \]

(in addition to \(II\)). All other 12 Paulis on a pair are detected.

Hence for a single channel

prob.\,(undetectable \(\neq II\))\(=\frac{3}{15}=\frac15\).


  1. Probabilities for one or two faulty gates

Let

\[ q\equiv\frac15,\qquad\bar q\equiv1-q=\frac45 . \]

(a) No error

\(\Pr(E_{21}=II)=\Pr(E_{03}=II)=1-p\)

\[ P_{0}=(1-p)^{2}. \]

This is always correct and passes.


(b) Exactly one error

\(\Pr(\text{“one error”})=2p(1-p)\).

• detected (rejected): \(2p(1-p)\,\bar q\)

• undetectable (passes): \(2p(1-p)\,q\).

Since \(XX,YY,ZZ\) are logical operators (e.g. \(IXXI=X_{A}X_{B}\)) every undetectable single error produces a wrong logical state.

Thus

\[ P_{\text{pass,\,1err}}=2p(1-p)q,\qquad P_{\text{corr,\,1err}}=0. \]

(c) Two errors

\(\Pr(\text{“two errors”})=p^{2}\).

Write \(E_{21}\), \(E_{03}\) as ordered pairs of single–qubit Paulis
\(P_{21}\equiv(P_{2},P_{1})\), \(P_{03}\equiv(P_{0},P_{3})\).
Define for any Pauli on one qubit

\[ s_Z(P)= \begin{cases} 0,&P\in\{I,X\},\\[2pt] 1,&P\in\{Y,Z\}, \end{cases}\qquad s_X(P)= \begin{cases} 0,&P\in\{I,Z\},\\[2pt] 1,&P\in\{X,Y\}. \end{cases} \]

An overall error \(E\) commutes with \(g_1\) (\(g_2\)) iff
\(\bigoplus_{i=0}^{3}s_Z(P_i)=0\) (\(\bigoplus_{i=0}^{3}s_X(P_i)=0\)). Because the two pairs act on disjoint qubits

\[ E\;\text{passes}\;\Longleftrightarrow \bigl(s_Z(E_{21}),s_X(E_{21})\bigr)= \bigl(s_Z(E_{03}),s_X(E_{03})\bigr). \]

Counting the 16 possibilities (\(II\) + 15 errors) on a pair gives

\[ \begin{aligned} &(0,0):\;4\;\text{elements }(II,\;XX,\;YY,\;ZZ),\\ &(0,1):\;4,\qquad (1,0):\;3,\qquad (1,1):\;5, \end{aligned} \]

hence \(\bigl(4,4,3,5\bigr)\) possibilities respectively.

Therefore

\[ \begin{aligned} P_{\text{pass,\,2err}} &=p^{2}\!\left[\frac{4^{2}+4^{2}+3^{2}+5^{2}}{15^{2}}\right] =p^{2}\frac{194}{225},\\[4pt] P_{\text{corr,\,2err}} &=p^{2}\!\left[\frac{1}{15^{2}}\;\times\;(\text{XX+YY+ZZ both pairs})\right] =3\Bigl(\frac{p}{15}\Bigr)^{2} =\frac{p^{2}}{75}. \end{aligned} \]

(The only two‐error patterns that leave the logical state intact are
\(II\,II,\;XX\,XX,\;YY\,YY,\;ZZ\,ZZ\) giving \(I,XXXX,YYYY,ZZZZ\).)


  1. Passing and correct probabilities
\[ \begin{aligned} P_{\text{pass}} &=P_{0}+P_{\text{pass,\,1err}}+P_{\text{pass,\,2err}}\\ &=(1-p)^{2}+2p(1-p)q+p^{2}\frac{194}{225}\\ &=1-\frac{8}{5}p+\frac{194}{225}p^{2},\\[6pt] P_{\text{corr}} &=P_{0}+P_{\text{corr,\,2err}}\\ &=(1-p)^{2}+\frac{p^{2}}{75} =1-2p+\frac{76}{75}p^{2}. \end{aligned} \]

  1. Logical state fidelity conditioned on passing

All states that pass are orthogonal to each other (they are related by logical Paulis), hence the conditional fidelity equals the probability that the state is the intended one:

\[ \boxed{F_{\text{logical}}(p)= \frac{P_{\text{corr}}}{P_{\text{pass}}} =\frac{1-2p+\dfrac{76}{75}p^{2}} {1-\dfrac{8}{5}p+\dfrac{194}{225}p^{2}} }. \]

Expanding to second order in \(p\),

\[ F_{\text{logical}}(p)= 1-\frac{2}{5}p-\frac{22}{45}p^{2}+O(p^{3}), \]

so post-selection suppresses the leading‐order infidelity from \(1.6\,p\) (physical state) down to \(0.4\,p\) at the logical level.


Final Answer:
The post-selected two-qubit logical GHZ state has fidelity

\[ \boxed{\,F_{\mathrm{logical}}(p)= \frac{1-2p+\dfrac{76}{75}\,p^{2}} {1-\dfrac{8}{5}\,p+\dfrac{194}{225}\,p^{2}} =1-\frac{2}{5}p-\frac{22}{45}p^{2}+O(p^{3})\,}. \]
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 - 2*p + sp.Rational(76, 75)*p**2) / (1 - sp.Rational(8, 5)*p + sp.Rational(194, 225)*p**2)
    # ---------------------------------------------------------------

    return F_logical