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 state prepared by the circuit:
  • Apply H2 then CNOT21: this prepares a Bell state on qubits (2,1),
\[ |\Phi^+\rangle_{21} = \frac{|00\rangle_{21} + |11\rangle_{21}}{\sqrt{2}}. \]
  • Apply H0 then CNOT03: this prepares a Bell state on qubits (0,3),
\[ |\Phi^+\rangle_{03} = \frac{|00\rangle_{03} + |11\rangle_{03}}{\sqrt{2}}. \]
  • Therefore the ideal final 4-qubit state is a product of Bell pairs
\[ |\psi_{\text{ideal}}\rangle = |\Phi^+\rangle_{03} \otimes |\Phi^+\rangle_{21}. \]
Equivalently, it is the unique +1 eigenstate of the commuting generators
\[ \{XXXX,\; ZZZZ,\; IXXI,\; IZZI\}, \]
i.e., the [[4,2,2]] code stabilizers plus logical GHZ stabilizers.
  • Noise model and factorization:
  • After CNOT21, a two-qubit depolarizing channel acts on qubits (2,1):
\[ \mathcal{E}_{21}(\rho) = (1-p)\rho + \frac{p}{15}\sum_{P\in\mathcal{P}_2\setminus\{II\}} P\rho P, \]
where the sum is over the 15 non-identity two-qubit Paulis on that pair.
  • After CNOT03, an identical channel acts on qubits (0,3), independently:
\[ \mathcal{E}_{03}(\rho) = (1-p)\rho + \frac{p}{15}\sum_{Q\in\mathcal{P}_2\setminus\{II\}} Q\rho Q. \]
  • Because the remaining gates after each CNOT act on disjoint qubits, each channel is effectively applied at the end, and the total channel factors:
\[ \rho_{\text{final}} = \big(\mathcal{E}_{03}\otimes \mathcal{E}_{21}\big)\big(|\psi_{\text{ideal}}\rangle\langle\psi_{\text{ideal}}|\big). \]
  • Since the target state is a product and the channel factors across the two pairs, the physical state fidelity factorizes:
\[ \]
where
\[ F_{\Phi^+}(p) = \langle\Phi^+|\mathcal{E}(|\Phi^+\rangle\langle\Phi^+|)|\Phi^+\rangle \]
is the single-pair (two-qubit) fidelity under the depolarizing channel.
  • Single Bell-pair fidelity under two-qubit depolarizing:
  • For a pure stabilizer state,
\[ F = \sum_j p_j\,|\langle\psi|P_j|\psi\rangle|^2, \]
where the sum runs over the Pauli errors in the channel. For |Φ+, the only two-qubit Paulis with nonzero expectation are its (projective) stabilizers. The stabilizer of |Φ+ is generated by XX and ZZ, implying that the three non-identity Paulis
\[ \{X\otimes X,\; Y\otimes Y,\; Z\otimes Z\} \]
map |Φ+⟩ to itself up to a phase. All other 12 non-identity two-qubit Paulis are orthogonal (zero overlap).
  • Hence,
\[ F_{\Phi^+}(p) = (1-p)\cdot 1 + \frac{p}{15}\cdot 3 = 1 - \frac{12}{15}p = 1 - \frac{4}{5}p. \]
  • Total fidelity:
\[ \]
  1. Mathematical Typesetting
  • As above.
  1. Conventions and Units
  • Noise is applied only after CNOT gates as specified; single-qubit H gates are taken to be ideal.
  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 target and its stabilizer
  • The given circuit prepares the 4-qubit state
\[ \]
which encodes the logical Bell/GHZ state on qubits A,B.
  • A convenient generating set for the stabilizer of this state is
\[ \mathcal{S}_\psi=\langle X_0X_3,\ Z_0Z_3,\ X_2X_1,\ Z_2Z_1\rangle. \]
  • The code stabilizers are
\[ \mathcal{S}_{\rm code}=\langle XXXX,\ ZZZZ\rangle. \]
  • Noise model
  • There are two noisy CNOTs, on pairs (2,1) and (0,3). Each is followed by an independent two-qubit depolarizing channel:
\[ \mathcal{E}(\rho)=(1-p)\rho + \frac{p}{15}\sum_{P\in\mathcal{P}_2\setminus\{II\}} P\rho P. \]
  • The net error is a 4-qubit Pauli of the form
\[ E=P_{03}\,Q_{21},\qquad P_{03},Q_{21}\in\{I,X,Y,Z\}^{\otimes 2}. \]
  • Post-selection criterion (detectable-error rejection)
  • Measuring the code stabilizers accepts (post-selects) iff the error commutes with both XXXX and ZZZZ.
  • For a two-qubit Pauli on a given pair, define the parity vector
\[ s(R)=(u(R),v(R))\in\mathbb{Z}_2^2, \]
where u is the parity of letters in {Z,Y} and v is the parity of letters in {X,Y} across the two qubits of the pair. Then:
- R commutes with XXXX iff u(R)=0,
- R commutes with ZZZZ iff v(R)=0.
  • Hence E=P_{03}Q_{21} is accepted iff
\[ s(P_{03})=s(Q_{21}). \]
  • Classification on one pair: Among the 16 two-qubit Paulis,
    • the class s=(0,0) consists of {II, XX, YY, ZZ} (4 elements),
    • the classes s∈{(1,0),(0,1),(1,1)} each also have 4 elements.
  • With the depolarizing distribution on one pair:
\[ \Pr[s=(0,0)]=a:=1-\frac{4}{5}p,\qquad \Pr[s\in\{(1,0),(0,1),(1,1)\}]=b:=\frac{4}{15}p. \]
  • Acceptance probability
  • By independence across the two pairs and the “match” rule s(P_{03})=s(Q_{21}),
\[ =\Big(1-\frac{4}{5}p\Big)^2+3\Big(\frac{4}{15}p\Big)^2 \]
  • Which accepted errors preserve the target state?
  • For a stabilizer state |ψ⟩, a Pauli E has overlap |⟨ψ|E|ψ⟩|^2=1 iff E∈±𝒮ψ; otherwise the overlap is 0.
  • Elements of ±𝒮ψ are precisely those with s(P_{03})=s(Q_{21})=(0,0) (i.e., on each pair either II, XX, YY, or ZZ). Thus the total probability of accepted “harmless” errors is
\[ \Pr[E\in\pm\mathcal{S}_\psi]=a^2=\Big(1-\frac{4}{5}p\Big)^2. \]
  • Logical (post-selected) fidelity
  • Decoding is an isometry on the code space, so the logical fidelity equals the physical fidelity conditioned on acceptance:
\[ =\frac{a^2}{a^2+3b^2} \]
  • Closed-form:
\[ \]
  • Small-p expansion:
\[ F_{\rm logical}(p)=1-\frac{16}{75}p^2+O(p^3). \]
  1. Mathematical Typesetting
  • As above.
  1. Conventions and Units
  • Only two-qubit gates are noisy as specified; H gates are ideal. Post-selection keeps runs with +1 outcomes for both XXXX and ZZZZ.
  1. Final Answer: F_logical(p) = [(1 - 4p/5)^2] / [(1 - 4p/5)^2 + 3 (4p/15)^2] = (75 - 120 p + 48 p^2) / (75 - 120 p + 64 p^2) = 1 - (16/75) p^2 + O(p^3).
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)
import itertools
from math import comb

# Pauli binary symplectic representation utilities
# Represent Pauli on n qubits as (x,z) binary lists length n, ignoring global phase.

I = (0,0)
X = (1,0)
Z = (0,1)
Y = (1,1)

pauli_letter_to_xz = {'I':I,'X':X,'Y':Y,'Z':Z}
letters = ['I','X','Y','Z']

n=5  # qubits 0..3 data, 4 ancilla

# Conjugation by CNOT(c,t):
def conj_cnot(x,z,c,t):
    # x,z are lists of length n
    x = x.copy(); z = z.copy()
    # Update: x_t' = x_t XOR x_c; z_c' = z_c XOR z_t
    x[t] ^= x[c]
    z[c] ^= z[t]
    return x,z

# Multiply two Paulis: XOR x and z

def multiply_pauli(x1,z1,x2,z2):
    x = [(a^b) for a,b in zip(x1,x2)]
    z = [(a^b) for a,b in zip(z1,z2)]
    return x,z

# Build two-qubit Pauli on pair (i,j) given letters li, lj, embedded in n qubits

def twoq_pauli_xz(n, i, j, li, lj):
    x = [0]*n
    z = [0]*n
    xi,zi = pauli_letter_to_xz[li]
    xj,zj = pauli_letter_to_xz[lj]
    x[i]=xi; z[i]=zi
    x[j]=xj; z[j]=zj
    return x,z

# Define gates sequence (CNOTs) indices in execution order (right to left in provided formula)
# The list of (control, target)
sequence = [(1,2),(1,0),(2,3),(3,4),(0,4)]

# Precompute propagated error for each gate and each 2q Pauli (including identity)
propagated = []  # list for each gate: dict mapping (li, lj) -> (x,z)
nonid_flag = []  # list for each gate: dict mapping (li, lj) -> 0/1

for g_idx,(c,t) in enumerate(sequence):
    # subsequent gates to conjugate through are the ones after g_idx
    subs = sequence[g_idx+1:]
    table = {}
    flags = {}
    for li in letters:
        for lj in letters:
            x,z = twoq_pauli_xz(n, c if c< t else t, t if c< t else c, 'I','I')
            # Actually need to place on qubits c and t specifically
            x,z = twoq_pauli_xz(n, c, t, li, lj)
            # Conjugate forward through subsequent gates
            for (cc,tt) in subs:
                x,z = conj_cnot(x,z,cc,tt)
            table[(li,lj)] = (tuple(x), tuple(z))
            flags[(li,lj)] = 0 if (li=='I' and lj=='I') else 1
    propagated.append(table)
    nonid_flag.append(flags)

# Build GHZ_4 stabilizer group on data qubits 0..3
# Generators g1=XXXX, g2=Z0Z1, g3=Z1Z2, g4=Z2Z3

def pauli_from_gen_list(gens):
    # gens is list of (x,z)
    # return set of (x_data, z_data) tuples for 4-qubit data
    m = len(gens)
    elems = set()
    for mask in range(1<<m):
        x = [0]*4
        z = [0]*4
        for i in range(m):
            if (mask>>i)&1:
                gx, gz = gens[i]
                x = [a^b for a,b in zip(x,gx)]
                z = [a^b for a,b in zip(z,gz)]
        elems.add((tuple(x), tuple(z)))
    return elems

# Generators in 4-qubit space
x_g1 = ([1,1,1,1],[0,0,0,0])
z_g2 = ([0,0,0,0],[1,1,0,0])
z_g3 = ([0,0,0,0],[0,1,1,0])
z_g4 = ([0,0,0,0],[0,0,1,1])
GHZ_stab = pauli_from_gen_list([x_g1, z_g2, z_g3, z_g4])

# For sanity, size should be 16
assert len(GHZ_stab)==16

# Acceptance checks
# Code acceptance: parity of x and z on data are even.
# Ancilla acceptance: x[4]==0

def accept(x,z):
    # data parity even conditions
    if (sum(z[q] for q in range(4))%2)!=0: return False
    if (sum(x[q] for q in range(4))%2)!=0: return False
    # ancilla
    if x[4]!=0: return False
    return True

# Goodness: data part in GHZ stabilizer

def good(x,z):
    x_d = tuple(x[:4])
    z_d = tuple(z[:4])
    return (x_d, z_d) in GHZ_stab

# Enumerate over all 16^5 combinations and count
from collections import defaultdict

A_counts = [0]*6  # good accepted counts by k non-identity errors
B_counts = [0]*6  # accepted counts by k

# We'll also compute exact polynomials if needed later

choices_per_gate = [list(propagated[g].keys()) for g in range(5)]

# We'll pre-extract (x,z) and flag for speed
prop_lists = []
flag_lists = []
for g in range(5):
    prop_lists.append([propagated[g][key] for key in choices_per_gate[g]])
    flag_lists.append([nonid_flag[g][key] for key in choices_per_gate[g]])

# For speed: number of combinations is 1,048,576 loops; should be OK
count_total = 0
for idx0 in range(16):
    x0,z0 = prop_lists[0][idx0]
    f0 = flag_lists[0][idx0]
    for idx1 in range(16):
        x1,z1 = prop_lists[1][idx1]
        f1 = flag_lists[1][idx1]
        # mul 0*1
        x01 = [a^b for a,b in zip(x0,x1)]
        z01 = [a^b for a,b in zip(z0,z1)]
        k01 = f0+f1
        for idx2 in range(16):
            x2,z2 = prop_lists[2][idx2]
            f2 = flag_lists[2][idx2]
            x012 = [a^b for a,b in zip(x01,x2)]
            z012 = [a^b for a,b in zip(z01,z2)]
            k012 = k01+f2
            for idx3 in range(16):
                x3,z3 = prop_lists[3][idx3]
                f3 = flag_lists[3][idx3]
                x0123 = [a^b for a,b in zip(x012,x3)]
                z0123 = [a^b for a,b in zip(z012,z3)]
                k0123 = k012+f3
                for idx4 in range(16):
                    x4,z4 = prop_lists[4][idx4]
                    f4 = flag_lists[4][idx4]
                    x_final = [a^b for a,b in zip(x0123,x4)]
                    z_final = [a^b for a,b in zip(z0123,z4)]
                    k = k0123+f4
                    if accept(x_final, z_final):
                        B_counts[k]+=1
                        if good(x_final, z_final):
                            A_counts[k]+=1
                    count_total+=1

print("Total combos:", count_total)
print("Accepted counts B_k:", B_counts)
print("Good accepted counts A_k:", A_counts)

# Now construct P_acc(p) and P_good(p) polynomials: sum_k B_k (1-p)^{5-k} (p/15)^k
# We'll expand into polynomial in p up to degree 5: (1-p)^{5-k} * p^k = sum_{t=0}^{5-k} (-1)^t C(5-k, t) p^{t+k}
# Thus P_acc(p) = sum_{m=0}^{5} c_m p^m with coefficients rational numbers with denominator 15^{m'} ??? We'll keep as fractions of 15^k.

from fractions import Fraction

# Compute coefficients as Fractions

# Denominator due to 15^k; We'll keep them separate or convert to rational function form later

# We'll compute P(p) = sum_m coeff[m] * p^m, where coeff[m] is Fraction

def poly_coeffs_from_counts(counts):
    coeff = [Fraction(0,1) for _ in range(6)]
    for k in range(6):
        Bk = counts[k]
        # weight factor: (1)^(5-k) for constant; then expansion:
        for t in range(0, 6-k):
            m = t + k
            # contribution: Bk * C(5-k, t) * (-1)^t * 1 * (1) / 15^k
            val = Fraction(Bk * comb(5-k, t) * ((-1)**t), 15**k)
            coeff[m] += val
    return coeff

coeff_acc = poly_coeffs_from_counts(B_counts)
coeff_good = poly_coeffs_from_counts(A_counts)

print("P_acc polynomial coeffs (p^0..p^5):", coeff_acc)
print("P_good polynomial coeffs (p^0..p^5):", coeff_good)

# Simplify to decimal or rational forms; Also compute F_logical(p) = P_good / P_acc as rational function.

# For presentation, we can give both series expansion up to p^2 and exact rational function via quotient of polynomials.

# Let's also compute exact rational function numerator and denominator polynomials with integer coefficients by clearing denominators.

def scale_to_common_denom(coeffs):
    # coeffs is list of Fractions
    from math import lcm
    denoms = [c.denominator for c in coeffs]
    D = 1
    for d in denoms:
        from math import gcd
        D = (D*d)//__import__('math').gcd(D,d)
    ints = [int(c*D) for c in coeffs]
    return D, ints

D_acc, poly_acc = scale_to_common_denom(coeff_acc)
D_good, poly_good = scale_to_common_denom(coeff_good)
print("Acc denom:", D_acc)
print("Acc integer poly:", poly_acc)
print("Good denom:", D_good)
print("Good integer poly:", poly_good)

# Now F(p) = (poly_good/D_good)/(poly_acc/D_acc) = (poly_good * D_acc) / (poly_acc * D_good)
# We'll try to reduce common factor if any

from math import gcd

def poly_gcd_int(a,b):
    # naive gcd of integer polynomials by content GCD (not polynomial gcd), we'll just reduce by gcd of coefficients
    g = 0
    for v in a:
        g = gcd(g, abs(v))
    h = 0
    for v in b:
        h = gcd(h, abs(v))
    return g,h

# We'll also compute small-p expansion of F(p) up to p^3 by series division

import sympy as sp
p=sp.symbols('p')
Poly_acc = sum(sp.Rational(c.numerator,c.denominator)*p**i for i,c in enumerate(coeff_acc))
Poly_good = sum(sp.Rational(c.numerator,c.denominator)*p**i for i,c in enumerate(coeff_good))
F_series = sp.series(Poly_good/Poly_acc, p, 0, 4)  # up to p^3
print("F_series:", F_series)

# Try to express F as rational function with (small) integer coefficients by multiplying numerator and denominator by LCM denominators
F_simplified = sp.simplify(Poly_good/Poly_acc)
print("F_simplified rational:", sp.together(F_simplified))
Tool #7
Total combos: 1048576
Accepted counts B_k: [1, 7, 282, 4222, 31637, 94923]
Good accepted counts A_k: [1, 7, 138, 1198, 7397, 24027]
P_acc polynomial coeffs (p^0..p^5): [Fraction(1, 1), Fraction(-68, 15), Fraction(704, 75), Fraction(-32768, 3375), Fraction(253952, 50625), Fraction(-262144, 253125)]
P_good polynomial coeffs (p^0..p^5): [Fraction(1, 1), Fraction(-68, 15), Fraction(656, 75), Fraction(-29312, 3375), Fraction(223232, 50625), Fraction(-229376, 253125)]
Acc denom: 253125
Acc integer poly: [253125, -1147500, 2376000, -2457600, 1269760, -262144]
Good denom: 253125
Good integer poly: [253125, -1147500, 2214000, -2198400, 1116160, -229376]
F_series: 1 - 16*p**2/25 - 704*p**3/375 + O(p**4)
F_simplified rational: (229376*p**5 - 1116160*p**4 + 2198400*p**3 - 2214000*p**2 + 1147500*p - 253125)/(262144*p**5 - 1269760*p**4 + 2457600*p**3 - 2376000*p**2 + 1147500*p - 253125)
Assistant #8
Tool Call (code to execute)
import sympy as sp
p=sp.symbols('p')
Pacc = sp.Rational(1,1) + sp.Rational(-68,15)*p + sp.Rational(704,75)*p**2 + sp.Rational(-32768,3375)*p**3 + sp.Rational(253952,50625)*p**4 + sp.Rational(-262144,253125)*p**5
Pgood = sp.Rational(1,1) + sp.Rational(-68,15)*p + sp.Rational(656,75)*p**2 + sp.Rational(-29312,3375)*p**3 + sp.Rational(223232,50625)*p**4 + sp.Rational(-229376,253125)*p**5
F = sp.simplify(Pgood/Pacc)
for val in [0, sp.Rational(1,100), sp.Rational(1,20), sp.Rational(1,10)]:
    print(val, float(F.subs(p,val)))
print('P_acc at p=0.1', float(Pacc.subs(p, sp.Rational(1,10))))
Tool #9
0 1.0
1/100 0.9999340913140432
1/20 0.9981451484841416
1/10 0.9913903803885744
P_acc at p=0.1 0.6313155735703704
Assistant #10
  1. Step-by-Step Derivation
  • Ideal encoded target
  • The circuit acts (right-to-left) as 1) prepare |0…0⟩ and apply H on qubit 1, 2) CNOT12, CNOT10, CNOT23, 3) parity check onto ancilla with CNOT34, CNOT04, 4) measure ancilla in Z and postselect on 0.
  • After H1–CNOT12–CNOT10–CNOT23 the data qubits 0–3 are in the 4-qubit GHZ state
\[ |\text{GHZ}_4\rangle=\frac{|0000\rangle_{0123}+|1111\rangle_{0123}}{\sqrt{2}}. \]
  • With the [[4,2,2]] conventions, \(Z_A=Z_0Z_1\) and \(Z_B=Z_0Z_2\). One checks
\[ Z_A|\text{GHZ}_4\rangle=|\text{GHZ}_4\rangle,\qquad Z_B|\text{GHZ}_4\rangle=|\text{GHZ}_4\rangle, \]
and $|\text{GHZ}_4\rangle$ is also the +1 eigenstate of the code stabilizers $XXXX$ and $ZZZZ$. Hence $|\text{GHZ}_4\rangle$ is the encoded logical $|00\rangle_{AB}$.
  • Noise model and Pauli propagation
  • Each of the five CNOTs is followed by an independent two-qubit depolarizing channel on that pair:
\[ \mathcal{E}(\rho)=(1-p)\rho+\frac{p}{15}\sum_{P\in\mathcal{P}_2\setminus\{II\}}P\rho P. \]
  • Because the circuit is Clifford and errors are Pauli, every error can be pushed to the end of the circuit by conjugation, turning each error into a Pauli on the 5 qubits. The product of all five (pushed-forward) errors is a single 5-qubit Pauli
\[ E=E_{12}'\,E_{10}'\,E_{23}'\,E_{34}'\,E_{04}' \in \mathcal{P}_5/\{\pm1,\pm i\}. \]
Conjugation through CNOT(c→t) is tracked in the binary symplectic representation by
\[ x_t\leftarrow x_t\oplus x_c,\qquad z_c\leftarrow z_c\oplus z_t, \]
with other components unchanged.
  • Post-selection (acceptance) conditions, expressed on the final Pauli E
  • Ancilla check: measurement is of \(Z_4\) at the end; the outcome flips iff \(E\) anticommutes with \(Z_4\). Thus postselecting on ancilla outcome 0 requires that the final Pauli has no \(X\)/\(Y\) on qubit 4:
\[ x_4=0 \quad\Longleftrightarrow\quad E|_{4}\in\{I,Z\}. \]
  • Code detection: postselect on +1 outcomes of both \(XXXX\) and \(ZZZZ\). A Pauli \(E\) on the data commutes with \(XXXX\) iff the number of \(Z/Y\) letters on data is even, and with \(ZZZZ\) iff the number of \(X/Y\) letters on data is even. In binary symplectic form (with \(x_i=1\) for \(X/Y\) on data qubit i and \(z_i=1\) for \(Z/Y\)),
\[ \sum_{i=0}^3 z_i\equiv 0\ (\text{mod }2),\qquad \sum_{i=0}^3 x_i\equiv 0\ (\text{mod }2). \]
  • “Good” (harmless) accepted errors
  • Among accepted errors, the logical state is unchanged iff the data part of \(E\) is in the stabilizer of \(|\text{GHZ}_4\rangle\). A generating set is
\[ \mathcal{S}_{\text{GHZ}_4}=\langle X_0X_1X_2X_3,\ Z_0Z_1,\ Z_1Z_2,\ Z_2Z_3\rangle, \]
a group of size 16. Errors with data part in $\pm\mathcal{S}_{\text{GHZ}_4}$ (and ancilla part $I$ or $Z$) are “good”; otherwise they are accepted logical errors.
  • Exact counting (Clifford–Pauli enumeration)
  • For each of the 5 noisy CNOTs, there are 16 error possibilities (II with prob 1−p, and 15 non-identity with prob p/15). We enumerate all 16^5 error patterns, propagate each to the end using the above conjugation rule, and test:
    • acceptance (ancilla and code checks),
    • goodness (data part in \(\pm\mathcal{S}_{\text{GHZ}_4}\)).
  • Grouping by the number k of non-identity faults, let B_k be the number of accepted patterns and A_k the number of “good accepted” patterns. The exact counts are
\[ \]
  • Therefore
\[ \]
Expanding,
\[ 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,\\ P_{\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. \]
  • The post-selected logical fidelity is the conditional overlap with the ideal logical state,
\[ F_{\text{logical}}(p)=\frac{P_{\text{good}}(p)}{P_{\text{acc}}(p)}. \]
In closed form,
\[ =\frac{229376\,p^5-1116160\,p^4+2198400\,p^3-2214000\,p^2+1147500\,p-253125} \]
  • Small-\(p\) expansion (showing fault tolerance; no linear term):
\[ F_{\text{logical}}(p)=1-\frac{16}{25}p^2-\frac{704}{375}p^3+O(p^4). \]
  1. Mathematical Typesetting
  • As above.
  1. Conventions and Units
  • Only the two-qubit gates are noisy with the stated depolarizing channel; single-qubit H and measurement are ideal.
  • Post-selection accepts runs with ancilla outcome 0 and +1 outcomes for both code stabilizers \(XXXX\) and \(ZZZZ\).
  1. Final Answer: F_logical(p) = [229376 p^5 − 1116160 p^4 + 2198400 p^3 − 2214000 p^2 + 1147500 p − 253125] / [262144 p^5 − 1269760 p^4 + 2457600 p^3 − 2376000 p^2 + 1147500 p − 253125] = 1 − (16/25) p^2 − (704/375) p^3 + O(p^4).
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 = (229376*p**5 - 1116160*p**4 + 2198400*p**3 - 2214000*p**2 + 1147500*p - 253125) / (262144*p**5 - 1269760*p**4 + 2457600*p**3 - 2376000*p**2 + 1147500*p - 253125)
    # ---------------------------------------------------------------

    return F_logical