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, mathematical identities or numerical codes.
  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
  • Start from |0000⟩ on qubits (0,1,2,3). Apply the circuit U = CNOT03 H0 CNOT21 H2 (right-to-left order).
  • H2: |0⟩2 → |+⟩2, so
\[ |\psi_1\rangle=\frac{1}{\sqrt{2}}\,|0\rangle_0|0\rangle_1(|0\rangle_2+|1\rangle_2)|0\rangle_3. \]
  • CNOT21 (control 2, target 1):
\[ |\psi_2\rangle=\frac{1}{\sqrt{2}}\,|0\rangle_0\,(|00\rangle_{1,2}+|11\rangle_{1,2})\,|0\rangle_3. \]
  • H0:
\[ |\psi_3\rangle=\frac{1}{\sqrt{2}}\,|+\rangle_0\,(|00\rangle_{1,2}+|11\rangle_{1,2})\,|0\rangle_3. \]
  • CNOT03 (control 0, target 3):
\[ |\psi_{\text{ideal}}\rangle=\frac{1}{2}\, (|00\rangle_{0,3}+|11\rangle_{0,3})\otimes(|00\rangle_{1,2}+|11\rangle_{1,2}). \]

Thus, the ideal four-qubit state is a product of two Bell states:

\[ |\psi_{\text{ideal}}\rangle=|\Phi^+\rangle_{0,3}\otimes|\Phi^+\rangle_{1,2},\quad |\Phi^+\rangle=\frac{|00\rangle+|11\rangle}{\sqrt{2}}. \]
  • Noise model and its placement
  • Each CNOT is followed by a two-qubit depolarizing channel on its two qubits:
\[ \mathcal{D}_p(\rho)=(1-p)\rho+\frac{p}{15}\sum_{P\in\mathcal{P}_{2}\setminus\{II\}} P\rho P, \]
where $\mathcal{P}_{2}=\{I,X,Y,Z\}^{\otimes 2}$ on that pair.
  • The first channel acts on qubits (2,1) immediately after CNOT21; the remaining gates act only on qubits (0,3), so this noise does not propagate or mix with later gates.
  • The second channel acts on qubits (0,3) after the final CNOT03. Therefore the final state is
\[ \rho_{\text{final}}=\mathcal{D}_p^{(0,3)}\!\big(|\Phi^+\rangle\langle\Phi^+|_{0,3}\big)\;\otimes\;\mathcal{D}_p^{(1,2)}\!\big(|\Phi^+\rangle\langle\Phi^+|_{1,2}\big). \]
  • Fidelity factorizes
  • The physical state fidelity with the ideal pure product state is
\[ \]
where $F_{a,b}=\langle\Phi^+|\mathcal{D}_p^{(a,b)}(|\Phi^+\rangle\langle\Phi^+|)|\Phi^+\rangle$.
  • Since both channels are identical, \(F_{0,3}=F_{1,2}\equiv F_{\text{pair}}\), hence \(F=F_{\text{pair}}^2\).

  • Two-qubit fidelity on a Bell state

  • For \(|\Phi^+\rangle\), the only two-qubit Paulis (modulo phase) that map \(|\Phi^+\rangle\) to \(\pm|\Phi^+\rangle\) are \(\{II,XX,YY,ZZ\}\). All other 12 Paulis map it to orthogonal Bell states.
  • Therefore
\[ F_{\text{pair}}=(1-p)+3\left(\frac{p}{15}\right)=1-p+\frac{p}{5}=1-\frac{4p}{5}. \]
  • Combine the two independent pairs
\[ F(p)=\Big(1-\frac{4p}{5}\Big)^2=1-\frac{8}{5}p+\frac{16}{25}p^2. \]
  1. Mathematical Typesetting
  • See equations above.
  1. Conventions and Units
  • Probabilities are unitless. The depolarizing probability per two-qubit gate is \(p\).
  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 (noise-free) output of the circuit
  • As in Subproblem 1, starting from |0000⟩ and applying H2 → CNOT21 → H0 → CNOT03 gives the pure 4-qubit state
\[ =|\Phi^+\rangle_{0,3}\otimes|\Phi^+\rangle_{1,2},\qquad \]
  • This state lies in the [[4,2,2]] code space (it is +1 for both stabilizers \(S_X=XXXX=(XX)_{03}(XX)_{12}\) and \(S_Z=ZZZZ=(ZZ)_{03}(ZZ)_{12}\)), and encodes the logical Bell state \((|00\rangle_{AB}+|11\rangle_{AB})/\sqrt{2}\) with logical stabilizers \(X_AX_B=(XX)_{12}\) and \(Z_AZ_B=(ZZ)_{12}\).

  • Noise model and locality

  • Each CNOT is followed by a 2-qubit depolarizing channel on its two qubits:
\[ \mathcal{D}_p(\rho)=(1-p)\rho+\frac{p}{15}\sum_{P\neq II}P\rho P, \]
with $P\in\{I,X,Y,Z\}^{\otimes 2}$ on that pair.
  • The two channels act independently on disjoint pairs: after CNOT21 on (1,2) and after CNOT03 on (0,3). Because the later gates do not couple these pairs, we can treat the final noisy state as
\[ \rho=\mathcal{D}_p^{(0,3)}\!\otimes\,\mathcal{D}_p^{(1,2)}\big(|\psi_{\text{ideal}}\rangle\langle\psi_{\text{ideal}}|\big). \]
  • Bell-pair flip classification
  • For any two-qubit Pauli \(P\) acting on a Bell pair, define the flip vector
\[ v(P)=(\delta_X,\delta_Z)\in\{0,1\}^2, \]
where $\delta_X$ is 1 if $P$ anticommutes with $XX$ on that pair, and $\delta_Z$ is 1 if $P$ anticommutes with $ZZ$ on that pair. Then
- $v=(0,0)$ maps $|\Phi^+\rangle$ to itself,
- $v=(1,0)$ maps $|\Phi^+\rangle\to|\Phi^-\rangle$,
- $v=(0,1)$ maps $|\Phi^+\rangle\to|\Psi^+\rangle$,
- $v=(1,1)$ maps $|\Phi^+\rangle\to|\Psi^-\rangle$.
  • On a given pair, the 16 Paulis partition evenly into four classes by \(v\), with
\[ \#\{P:\,v(P)=v\}=4\quad\text{for each }v, \]
and explicitly $v=(0,0)$ corresponds to $\{II,XX,YY,ZZ\}$; each of the other three classes contains four non-identity operators.
  • Post-selection on the code
  • The code stabilizers are \(S_X=(XX)_{03}(XX)_{12}\) and \(S_Z=(ZZ)_{03}(ZZ)_{12}\). After applying Pauli errors \(P_{03}\) on (0,3) and \(Q_{12}\) on (1,2), the total eigenvalue flips of \(S_X\) and \(S_Z\) are given by
\[ v(P_{03}\otimes Q_{12})=v(P_{03})\oplus v(Q_{12}). \]
  • Post-selecting on “no detected error” means we keep only those terms with \(v(P_{03})=v(Q_{12})\) (so the net flips of \(S_X,S_Z\) are zero).

  • Weights per class

  • For a single depolarizing channel on one pair:
    • The identity has weight \(w(I)=1-p\).
    • Each non-identity has weight \(w_{\neq I}=p/15\).
  • Hence the total weight in each class on one pair is
\[ \]
  • Acceptance probability and conditional distribution
  • Acceptance requires the two pairs have the same class \(v\), so the total accepted weight is
\[ =\Big(1-\frac{4p}{5}\Big)^2+3\Big(\frac{4p}{15}\Big)^2 \]
  • Logical fidelity conditioned on acceptance
  • The encoded Bell state is stabilized by the logical operators \(X_AX_B\) and \(Z_AZ_B\), whose physical representatives can be taken as \((XX)_{12}\) and \((ZZ)_{12}\). Therefore the logical state remains the target \((|00\rangle_{AB}+|11\rangle_{AB})/\sqrt{2}\) if and only if the (1,2) pair stays in \(|\Phi^+\rangle\), i.e., \(v(Q_{12})=(0,0)\).
  • Because acceptance also requires \(v(P_{03})=v(Q_{12})\), the accepted events that preserve the logical state are exactly those with \(v=(0,0)\) on both pairs. Their total weight is \(W_{00}^2\).
  • Thus the logical state fidelity after post-selection is
\[ \]
  • Closed forms and small-p expansion
  • Simplifying,
\[ \]
  • For small \(p\),
\[ F_L(p)=1-\frac{16}{75}\,p^2+O(p^3), \]
i.e., logical infidelity is second order in $p$ under post-selection.
  1. Mathematical Typesetting
  • See equations above.
  1. Conventions and Units
  • Probabilities are unitless; \(p\) is the two-qubit depolarizing probability per CNOT.
  1. Final Answer:
\[ \]
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
Tool Call (code to execute)
# We'll enumerate error patterns for the given circuit and compute conditional logical fidelity.
# 5 data qubits (0..3) + ancilla (4)
# Circuit order (executed right-to-left): H1, CNOT12, CNOT10, CNOT23, CNOT34, CNOT04, M4
# Errors after each CNOT: E1 after CNOT12, E2 after CNOT10, E3 after CNOT23, E4 after CNOT34, E5 after CNOT04.

from itertools import product

n=5

# Bit masks
DATA_MASK = (1<<4)-1  # qubits 0..3
ANC_BIT = 1<<4

# Symplectic representation helpers
# Pauli mapping: 0:I, 1:X, 2:Y, 3:Z
px = [0,1,1,0]
pz = [0,0,1,1]

# Conjugation by CNOT c->t on symplectic bits (x,z) integers

def conj_cnot(x,z,c,t):
    # x_t' = x_t XOR x_c
    # z_c' = z_c XOR z_t
    xc = (x>>c)&1
    xt = (x>>t)&1
    zc = (z>>c)&1
    zt = (z>>t)&1
    # update bits
    xt_new = xt ^ xc
    zc_new = zc ^ zt
    # apply updates
    if xt_new != xt:
        x ^= (1<<t)
    if zc_new != zc:
        z ^= (1<<c)
    return x,z

# Build suffix gate lists for each error location (after that gate)
# order: after CNOT12 -> gates: CNOT10, CNOT23, CNOT34, CNOT04
suffixes = [
    [(1,0),(2,3),(3,4),(0,4)],
    [(2,3),(3,4),(0,4)],
    [(3,4),(0,4)],
    [(0,4)],
    []
]

# For each location, map 16 2-qubit Paulis on its gate qubits to final (x,z)
# gate qubit pairs in order
pairs = [(1,2),(1,0),(2,3),(3,4),(0,4)]

# Precompute mapping arrays E_maps[loc][p_idx] -> (x,z)
E_maps = []
for loc,(c,t) in enumerate(pairs):
    arr = []
    for a in range(4):
        for b in range(4):
            # Build initial x,z
            x = 0
            z = 0
            if a:
                x |= px[a]<<c
                z |= pz[a]<<c
            if b:
                x |= px[b]<<t
                z |= pz[b]<<t
            # propagate through suffix
            for (cc,tt) in suffixes[loc]:
                x,z = conj_cnot(x,z,cc,tt)
            arr.append((x,z))
    E_maps.append(arr)

# Build stabilizer state generators for |00>_L on data qubits: S_X=XXXX, S_Z=ZZZZ, Z_A=ZZII, Z_B=ZIZI
# Represented as (x,z) on 4 data qubits; ancilla qubit ignored here
SX_x = 0b1111; SX_z = 0
SZ_x = 0; SZ_z = 0b1111
ZA_x = 0; ZA_z = (1<<0)|(1<<1)  # Z0 Z1
ZB_x = 0; ZB_z = (1<<0)|(1<<2)  # Z0 Z2

# Generate the 16-element stabilizer group of the GHZ |00>_L state on 4 qubits
stab_set = set()
# We can generate by combining the four independent generators
gens = [(SX_x,SX_z),(SZ_x,SZ_z),(ZA_x,ZA_z),(ZB_x,ZB_z)]
# enumerate all 16 products ignoring phase; XOR for bits
for s0 in [0,1]:
    for s1 in [0,1]:
        for s2 in [0,1]:
            for s3 in [0,1]:
                x=z=0
                if s0:
                    x ^= gens[0][0]; z ^= gens[0][1]
                if s1:
                    x ^= gens[1][0]; z ^= gens[1][1]
                if s2:
                    x ^= gens[2][0]; z ^= gens[2][1]
                if s3:
                    x ^= gens[3][0]; z ^= gens[3][1]
                stab_set.add((x,z))

# Now enumerate all 16^5 patterns
from collections import defaultdict
N_acc = [0]*6  # counts of accepted patterns by k errors
N_good = [0]*6
N_total_by_k = [0]*6
N_acc_total = 0
N_good_total = 0

# We'll also verify single-fault detection property by counting accepted k=1 events

for a0 in range(16):
    x0,z0 = E_maps[0][a0]
    for a1 in range(16):
        x1,z1 = E_maps[1][a1]
        x01 = x0 ^ x1
        z01 = z0 ^ z1
        for a2 in range(16):
            x2,z2 = E_maps[2][a2]
            x012 = x01 ^ x2
            z012 = z01 ^ z2
            for a3 in range(16):
                x3,z3 = E_maps[3][a3]
                x0123 = x012 ^ x3
                z0123 = z012 ^ z3
                for a4 in range(16):
                    x4,z4 = E_maps[4][a4]
                    xfin = x0123 ^ x4
                    zfin = z0123 ^ z4
                    # number of non-identity errors k
                    k = (a0!=0) + (a1!=0) + (a2!=0) + (a3!=0) + (a4!=0)
                    N_total_by_k[k] += 1
                    # acceptance: ancilla X must be 0, and commute with SX,SZ on data
                    anc_x = (xfin>>4)&1
                    if anc_x:
                        continue
                    # data bits
                    xdat = xfin & DATA_MASK
                    zdat = zfin & DATA_MASK
                    # commute with SX: parity of zdat must be 0
                    # commute with SZ: parity of xdat must be 0
                    if (bin(zdat).count('1') & 1) != 0:
                        continue
                    if (bin(xdat).count('1') & 1) != 0:
                        continue
                    # accepted
                    N_acc[k] += 1
                    # good if (xdat,zdat) in stab_set
                    if (xdat,zdat) in stab_set:
                        N_good[k] += 1

# Summaries
print("N_total_by_k:", N_total_by_k)
print("N_acc by k:", N_acc)
print("N_good by k:", N_good)

# Now produce symbolic numerator and denominator coefficients for F(p)
# Prob per pattern with k errors: (1-p)^(5-k)*(p/15)^k
# So N_good(p) = sum_k N_good[k] * (1-p)^(5-k) * (p/15)^k
# P_acc(p) = sum_k N_acc[k] * (1-p)^(5-k) * (p/15)^k
# We'll express as polynomials in p up to degree 5. Let q=1-p.

from fractions import Fraction

# We'll compute exact rational coefficients for numerator and denominator in terms of p^k.
# Expand (1-p)^(5-k) p^k * (1/15)^k = sum_{j=0}^{5-k} C(5-k,j) (-p)^j p^k * 15^{-k}
# = sum_{t=k}^{5} C(5-k, t-k) (-1)^{t-k} p^t * 15^{-k}
# We'll compute arrays coeff_num[t], coeff_den[t] rational numbers.

import math
coeff_num = [Fraction(0,1) for _ in range(6)]
coeff_den = [Fraction(0,1) for _ in range(6)]

for k in range(6):
    for t in range(k,6):
        comb = math.comb(5-k, t-k)
        factor = Fraction(((-1)**(t-k)) * comb, 15**k)
        coeff_num[t] += Fraction(N_good[k],1) * factor
        coeff_den[t] += Fraction(N_acc[k],1) * factor

print("Numerator coeffs (p^t):", coeff_num)
print("Denominator coeffs (p^t):", coeff_den)

# Optionally, display F(p) rational polynomial: [We'll present as quotient of these polynomials]

# Let's also produce simplified rational function as a ratio of polynomials with integer coefficients by multiplying out denominators gcd.

def lcm(a,b):
    from math import gcd
    return a*b//gcd(a,b)

# Find common denominator for numerator and denominator polynomials
from math import gcd

D_num = 1
D_den = 1
for c in coeff_num:
    D_num = lcm(D_num, c.denominator)
for c in coeff_den:
    D_den = lcm(D_den, c.denominator)

int_num = [int(c*D_num) for c in coeff_num]
int_den = [int(c*D_den) for c in coeff_den]
print("Integer-coeff numerator (over {}):".format(D_num), int_num)
print("Integer-coeff denominator (over {}):".format(D_den), int_den)

# For sanity, compute small-p expansion of F(p) to p^2 or higher by series division
import decimal

def series_div(a,b):
    # compute series c such that sum a_i p^i / sum b_i p^i = sum c_i p^i up to len(a)-1
    n = len(a)
    c = [0.0]*n
    c[0] = a[0]/b[0]
    for i in range(1,n):
        s = a[i]
        for j in range(i):
            s -= c[j]*b[i-j]
        c[i] = s/b[0]
    return c

# Convert to floats for series
an = [float(c) for c in coeff_num]
bd = [float(c) for c in coeff_den]
ser = series_div(an,bd)
print("Series coefficients (to p^5):", ser)
Tool #7
N_total_by_k: [1, 75, 2250, 33750, 253125, 759375]
N_acc by k: [1, 7, 282, 4222, 31637, 94923]
N_good by k: [1, 7, 138, 1198, 7397, 24027]
Numerator coeffs (p^t): [Fraction(1, 1), Fraction(-68, 15), Fraction(656, 75), Fraction(-29312, 3375), Fraction(223232, 50625), Fraction(-229376, 253125)]
Denominator coeffs (p^t): [Fraction(1, 1), Fraction(-68, 15), Fraction(704, 75), Fraction(-32768, 3375), Fraction(253952, 50625), Fraction(-262144, 253125)]
Integer-coeff numerator (over 253125): [253125, -1147500, 2214000, -2198400, 1116160, -229376]
Integer-coeff denominator (over 253125): [253125, -1147500, 2376000, -2457600, 1269760, -262144]
Series coefficients (to p^5): [1.0, 0.0, -0.6400000000000006, -1.8773333333333366, -3.1099259259259355, -2.5607585185185364]
Assistant #8
Tool Call (code to execute)
# Evaluate F_L(p) numerically for sample p values
import math

coeff_num = [1.0, -68/15, 656/75, -29312/3375, 223232/50625, -229376/253125]
coeff_den = [1.0, -68/15, 704/75, -32768/3375, 253952/50625, -262144/253125]

def poly_val(coeffs,p):
    return sum(coeffs[i]*(p**i) for i in range(len(coeffs)))

for p in [0.0, 1e-3, 1e-2, 0.02, 0.05, 0.1]:
    num = poly_val(coeff_num,p)
    den = poly_val(coeff_den,p)
    F = num/den
    print(p, F)
Tool #9
0.0 1.0
0.001 0.999999358119554
0.01 0.9999340913140434
0.02 0.9997284757339905
0.05 0.9981451484841417
0.1 0.9913903803885744
Assistant #10
  1. Step-by-Step Derivation
  • Ideal (noise-free) state prepared by the circuit
  • Start in |00000⟩ on qubits (0,1,2,3,4).
  • Apply H1 → CNOT12 → CNOT10 → CNOT23 to get a 4-qubit GHZ on the data and ancilla |0⟩:
\[ |\psi_{\text{data}}\rangle=\frac{|0000\rangle_{0..3}+|1111\rangle_{0..3}}{\sqrt{2}},\qquad |0\rangle_4. \]
  • The pair of CNOTs CNOT34, CNOT04 computes the Z-parity Z0Z3 onto the ancilla. In the ideal GHZ state this parity is +1, so M4 deterministically yields 0.
  • The 4-qubit GHZ is stabilized by S_X=XXXX and S_Z=ZZZZ and is the logical state |00⟩AB, since
\[ Z_A=Z_0Z_1,\quad Z_B=Z_0Z_2,\quad Z_A|\psi\rangle=Z_B|\psi\rangle=+|\psi\rangle. \]
  • Noise model and algebraic reduction
  • After each CNOT, a two-qubit depolarizing channel acts on that gate’s two qubits:
\[ \mathcal{D}_p(\rho)=(1-p)\rho+\frac{p}{15}\sum_{P\neq II}P\rho P. \]
  • There are 5 CNOTs, hence 5 error locations. Because the circuit is Clifford and the noise is Pauli, each error can be conjugated through the suffix of the circuit to a single Pauli at the end. Multiple errors multiply (up to a global phase that is irrelevant).

  • Post-selection (acceptance) conditions

  • Ancilla post-selection M4=0: at the end of the circuit, an X or Y on the ancilla flips the measurement bit, so acceptance requires the ancilla Pauli be I or Z (no X-part on qubit 4).
  • Code post-selection “all detectable errors”: at the end, the data Pauli must commute with S_X=XXXX and S_Z=ZZZZ. In symplectic form this is equivalent to requiring an even number of X-type factors and an even number of Z-type factors on the data qubits 0..3.

  • Logical fidelity conditioned on acceptance

  • The target logical state |00⟩AB is the unique +1 eigenstate of the four commuting generators {S_X, S_Z, Z_A, Z_B}. Thus, among accepted events, the logical state is correct if and only if the final data Pauli lies in the 16-element stabilizer group G=⟨S_X,S_Z,Z_A,Z_B⟩. Any accepted Pauli outside G is a nontrivial logical operator (e.g., contains X_A and/or X_B) and maps |00⟩AB to an orthogonal logical computational basis state.
  • Therefore, the logical fidelity equals the total probability weight of accepted-and-correct patterns divided by the total accepted weight.

  • Exact counting over all Pauli-error patterns

  • Each of the 5 error locations contributes 16 possibilities (I or one of 15 non-identity Paulis), so there are 16^5 patterns. For a pattern with k non-identity errors, the probability weight is (1−p)^(5−k) (p/15)^k.
  • Conjugating each error to the end and multiplying yields a final 5-qubit Pauli. We accept a pattern if:
    • the ancilla has no X-part (I or Z on qubit 4), and
    • the data part commutes with S_X and S_Z.
  • Among accepted patterns, the pattern is “good” (preserves |00⟩AB) if the data Pauli ∈ G=⟨S_X,S_Z,Z_A,Z_B⟩.

The acceptance and “good” counts by k (number of error locations with a non-identity Pauli) are: - N_acc(k) = [1, 7, 282, 4222, 31637, 94923] for k=0..5, - N_good(k) = [1, 7, 138, 1198, 7397, 24027] for k=0..5.

  • Logical fidelity as a function of p
  • Let
\[ N_{\text{good}}(p)&=\sum_{k=0}^{5} N_{\text{good}}(k)\,(1-p)^{5-k}\left(\frac{p}{15}\right)^k,\\ P_{\text{acc}}(p)&=\sum_{k=0}^{5} N_{\text{acc}}(k)\,(1-p)^{5-k}\left(\frac{p}{15}\right)^k. \]
  • Then
\[ F_L(p)=\frac{N_{\text{good}}(p)}{P_{\text{acc}}(p)}. \]

Expanding and collecting powers of p gives the exact rational polynomials

\[ N_{\text{good}}(p)&=1-\frac{68}{15}p+\frac{656}{75}p^2-\frac{29312}{3375}p^3+\frac{223232}{50625}p^4-\frac{229376}{253125}p^5,\\ P_{\text{acc}}(p)&=1-\frac{68}{15}p+\frac{704}{75}p^2-\frac{32768}{3375}p^3+\frac{253952}{50625}p^4-\frac{262144}{253125}p^5, \]

so that

\[ F_L(p)=\frac{1-\frac{68}{15}p+\frac{656}{75}p^2-\frac{29312}{3375}p^3+\frac{223232}{50625}p^4-\frac{229376}{253125}p^5}{1-\frac{68}{15}p+\frac{704}{75}p^2-\frac{32768}{3375}p^3+\frac{253952}{50625}p^4-\frac{262144}{253125}p^5}. \]

Equivalently, multiplying numerator and denominator by 253125 gives integer-coefficient polynomials:

\[ F_L(p)=\frac{253125-1147500\,p+2214000\,p^2-2198400\,p^3+1116160\,p^4-229376\,p^5}{253125-1147500\,p+2376000\,p^2-2457600\,p^3+1269760\,p^4-262144\,p^5}. \]
  • Small-p expansion
\[ F_L(p)=1-\frac{16}{25}p^2-\frac{2816}{1500}p^3+O(p^4), \]

i.e., the logical infidelity is second order in p (as expected for a fault-tolerant, post-selected preparation), with leading coefficient 16/25.

  1. Mathematical Typesetting
  • See equations above.
  1. Conventions and Units
  • Probabilities are unitless; p is the two-qubit depolarizing probability per CNOT. The measurement is assumed ideal.
  1. Final Answer:
\[ F_L(p)=\frac{1-\frac{68}{15}p+\frac{656}{75}p^2-\frac{29312}{3375}p^3+\frac{223232}{50625}p^4-\frac{229376}{253125}p^5}{1-\frac{68}{15}p+\frac{704}{75}p^2-\frac{32768}{3375}p^3+\frac{253952}{50625}p^4-\frac{262144}{253125}p^5}\,, \]

so that for small p,

\[ F_L(p)=1-\frac{16}{25}p^2+O(p^3). \]
User #11

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 #12
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 = (253125 - 1147500*p + 2214000*p**2 - 2198400*p**3 + 1116160*p**4 - 229376*p**5) / (253125 - 1147500*p + 2376000*p**2 - 2457600*p**3 + 1269760*p**4 - 262144*p**5)
    # ---------------------------------------------------------------

    return F_logical