MerLean-example

19 Def 9: Syndrome

The syndrome of a spacetime fault \(F\) is the set of detectors violated by \(F\). Formally:

\[ \mathrm{syndrome}(F) = \{ D : D \text{ is a detector and } D \text{ reports } {-1} \text{ in the presence of } F\} . \]

Equivalently, the syndrome is the binary vector over the set of all detectors, where entry \(D\) is \(1\) if detector \(D\) is violated and \(0\) otherwise.

Key properties:

  1. The syndrome function is \(\mathbb {Z}_2\)-linear: \(\mathrm{syndrome}(F_1 \cdot F_2) = \mathrm{syndrome}(F_1) + \mathrm{syndrome}(F_2)\) (symmetric difference).

  2. A spacetime stabilizer (trivial fault) has empty syndrome.

  3. A logical fault is a non-trivial fault with empty syndrome.

Definition 618 Syndrome
#

The syndrome of a spacetime fault over types \(V\), \(E\), \(M\) is defined as a finite set of detectors:

\[ \mathrm{Syndrome}(V, E, M) := \mathrm{Finset}(\mathrm{Detector}\; V\; E\; M). \]
Definition 619 Empty Syndrome
#

The empty syndrome (no detectors violated) is defined as:

\[ \mathrm{empty} := \emptyset . \]
Definition 620 Syndrome Addition
#

The addition of two syndromes \(s_1\) and \(s_2\) is defined via symmetric difference (\(\mathbb {Z}_2\) addition):

\[ \mathrm{add}(s_1, s_2) := s_1 \triangle s_2. \]
Theorem 621 Syndrome Addition is Commutative
#

For all syndromes \(s_1, s_2\),

\[ \mathrm{add}(s_1, s_2) = \mathrm{add}(s_2, s_1). \]
Proof

This follows directly from the commutativity of symmetric difference: \(s_1 \triangle s_2 = s_2 \triangle s_1\).

Theorem 622 Syndrome Addition is Associative
#

For all syndromes \(s_1, s_2, s_3\),

\[ \mathrm{add}(\mathrm{add}(s_1, s_2), s_3) = \mathrm{add}(s_1, \mathrm{add}(s_2, s_3)). \]
Proof

This follows directly from the associativity of symmetric difference: \((s_1 \triangle s_2) \triangle s_3 = s_1 \triangle (s_2 \triangle s_3)\).

Theorem 623 Empty Syndrome is Right Identity

For all syndromes \(s\),

\[ \mathrm{add}(s, \mathrm{empty}) = s. \]
Proof

By simplification using the definitions of \(\mathrm{add}\) and \(\mathrm{empty}\), we have \(s \triangle \emptyset = s\) since \(\emptyset \) is the bottom element under symmetric difference.

Theorem 624 Empty Syndrome is Left Identity

For all syndromes \(s\),

\[ \mathrm{add}(\mathrm{empty}, s) = s. \]
Proof

By simplification using the definitions of \(\mathrm{add}\) and \(\mathrm{empty}\), we have \(\emptyset \triangle s = s\) since \(\emptyset \) is the bottom element under symmetric difference.

Theorem 625 Syndrome is Self-Inverse

For all syndromes \(s\),

\[ \mathrm{add}(s, s) = \mathrm{empty}. \]

Every syndrome is its own inverse in \(\mathbb {Z}_2\).

Proof

By simplification: \(s \triangle s = \emptyset \) since the symmetric difference of a set with itself is empty.

Definition 626 Syndrome Cardinality
#

The cardinality of a syndrome \(s\) (number of violated detectors) is:

\[ \mathrm{card}(s) := |s|. \]
Lemma 627 Empty Syndrome iff Zero Cardinality

A syndrome \(s\) is empty if and only if its cardinality is zero:

\[ s = \mathrm{empty} \iff \mathrm{card}(s) = 0. \]
Proof

By simplification using the definitions of \(\mathrm{card}\) and \(\mathrm{empty}\), this reduces to the standard fact that a finite set has cardinality zero if and only if it is empty.

Definition 628 Apply Fault to Outcomes
#

Given base measurement outcomes and a spacetime fault, the faulted outcomes are obtained by flipping the classical measurement outcome at each location where a time-fault is active:

\[ \mathrm{applyFaultToOutcomes'}(\mathrm{base}, F)(m, t) := \begin{cases} \mathrm{base}(m, t) + 1 & \text{if } F.\mathrm{timeErrors}(m, t) = \mathrm{true}, \\ \mathrm{base}(m, t) & \text{otherwise}. \end{cases} \]
Definition 629 Syndrome Computation
#

Given a detector collection \(\mathrm{DC}\), base outcomes, and a spacetime fault \(F\), the syndrome is:

\[ \mathrm{syndrome}(\mathrm{DC}, \mathrm{base}, F) := \{ D \in \mathrm{DC}.\mathrm{detectors} \mid D.\mathrm{isViolated}(\mathrm{applyFaultToOutcomes'}(\mathrm{base}, F))\} . \]
Definition 630 Empty Syndrome Predicate
#

A fault \(F\) has empty syndrome if it violates no detectors:

\[ \mathrm{hasEmptySyndrome'}(\mathrm{DC}, \mathrm{base}, F) \iff \mathrm{syndrome}(\mathrm{DC}, \mathrm{base}, F) = \emptyset . \]
Definition 631 Syndrome Vector
#

The syndrome as a function to \(\mathbb {Z}/2\mathbb {Z}\): for each detector \(D\),

\[ \mathrm{syndromeVector}(\mathrm{DC}, \mathrm{base}, F)(D) := \begin{cases} 1 & \text{if } D \in \mathrm{syndrome}(\mathrm{DC}, \mathrm{base}, F), \\ 0 & \text{otherwise}. \end{cases} \]
Theorem 632 Syndrome Vector Equals One iff Violated

For any detector \(D \in \mathrm{DC}.\mathrm{detectors}\),

\[ \mathrm{syndromeVector}(\mathrm{DC}, \mathrm{base}, F)(D) = 1 \iff D.\mathrm{isViolated}(\mathrm{applyFaultToOutcomes'}(\mathrm{base}, F)). \]
Proof

We prove both directions. For the forward direction, assume \(\mathrm{syndromeVector}(\mathrm{DC}, \mathrm{base}, F)(D) = 1\). By the definition of \(\mathrm{syndromeVector}\) and \(\mathrm{syndrome}\), we split on whether \(D\) is a member of the syndrome (a filtered set). If \(D\) is in the filter, then by the filter condition \(D.\mathrm{isViolated}\) holds. If \(D\) is not in the filter, then the syndrome vector would be \(0\), contradicting the hypothesis via simplification. For the reverse direction, assume \(D.\mathrm{isViolated}(\mathrm{applyFaultToOutcomes'}(\mathrm{base}, F))\). Then directly applying the lemma syndromeVector_violated with hypotheses \(D \in \mathrm{DC}.\mathrm{detectors}\) and the violation condition yields the result.

Theorem 633 Identity Fault has Empty Syndrome

If the base outcomes satisfy all detectors, then the identity fault has empty syndrome:

\[ \mathrm{DC}.\mathrm{allSatisfied}(\mathrm{base}) \implies \mathrm{syndrome}(\mathrm{DC}, \mathrm{base}, \mathbf{1}) = \emptyset . \]
Proof

By simplification, \(\mathrm{syndrome}\) is a filter, so it suffices to show that no detector in \(\mathrm{DC}.\mathrm{detectors}\) is violated. Let \(D \in \mathrm{DC}.\mathrm{detectors}\). We first establish that applying the identity fault to outcomes yields the base outcomes unchanged: for all \(m, t\), since \(\mathbf{1}.\mathrm{timeErrors}(m,t) = \mathrm{false}\), the if-branch is not taken, so \(\mathrm{applyFaultToOutcomes'}(\mathrm{base}, \mathbf{1}) = \mathrm{base}\). This holds by reflexivity. Rewriting with this equality and using the equivalence \(\mathrm{isSatisfied} \iff \neg \, \mathrm{isViolated}\), we need \(D.\mathrm{isSatisfied}(\mathrm{base})\). Rewriting the hypothesis \(\mathrm{DC}.\mathrm{allSatisfied}(\mathrm{base})\) using the characterization DetectorCollection.allSatisfied_iff, we obtain that all detectors in the collection are satisfied, and the result follows.

Theorem 634 Empty Syndrome Characterization

A fault has empty syndrome if and only if all detectors in the collection are satisfied:

\[ \mathrm{hasEmptySyndrome'}(\mathrm{DC}, \mathrm{base}, F) \iff \forall D \in \mathrm{DC}.\mathrm{detectors},\; D.\mathrm{isSatisfied}(\mathrm{applyFaultToOutcomes'}(\mathrm{base}, F)). \]
Proof

Unfolding the definitions of \(\mathrm{hasEmptySyndrome'}\) and \(\mathrm{syndrome}\), and rewriting using the characterization that a filter is empty iff the predicate holds for no element, we prove both directions. For the forward direction, assume the filter is empty and let \(D \in \mathrm{DC}.\mathrm{detectors}\). Rewriting \(\mathrm{isSatisfied}\) as \(\neg \, \mathrm{isViolated}\), this follows from the emptiness of the filter. For the reverse direction, assume all detectors are satisfied and let \(D \in \mathrm{DC}.\mathrm{detectors}\). Rewriting \(\neg \, \mathrm{isViolated}\) as \(\mathrm{isSatisfied}\), the result follows from the hypothesis.

Definition 635 Syndrome Linearity Condition
#

A syndrome linearity condition for a detector collection \(\mathrm{DC}\) and base outcomes consists of two properties:

  1. Local dependence: For all spacetime faults \(f, g\) and all detectors \(D \in \mathrm{DC}.\mathrm{detectors}\), if \(f\) and \(g\) agree on all time-errors at \(D\)’s measurement events, then \(D\) is violated by \(f\) if and only if it is violated by \(g\).

  2. Parity determines violation: For all faults \(f\) and detectors \(D \in \mathrm{DC}.\mathrm{detectors}\), detector \(D\) is violated if and only if the number of measurement events of \(D\) at which \(f\) has a time-error is odd:

    \[ D.\mathrm{isViolated}(\mathrm{applyFaultToOutcomes'}(\mathrm{base}, f)) \iff |\{ e \in D.\mathrm{measEvents} \mid f.\mathrm{timeErrors}(e.\mathrm{measurement}, e.\mathrm{time})\} | \equiv 1 \pmod{2}. \]
Theorem 636 Syndrome Respects Multiplication

Under the syndrome linearity condition, the syndrome is \(\mathbb {Z}_2\)-linear with respect to fault composition:

\[ \mathrm{syndrome}(\mathrm{DC}, \mathrm{base}, f \cdot g) = \mathrm{syndrome}(\mathrm{DC}, \mathrm{base}, f) \; \triangle \; \mathrm{syndrome}(\mathrm{DC}, \mathrm{base}, g). \]
Proof

By extensionality, it suffices to show that for each detector \(D\), membership in the left-hand side is equivalent to membership in the symmetric difference on the right.

By the definition of syndrome as a filter, \(D\) is in the left-hand side iff \(D \in \mathrm{DC}.\mathrm{detectors}\) and \(D\) is violated by \(f \cdot g\). By the symmetric difference characterization, \(D\) is on the right iff it is in exactly one of the two syndromes.

Forward direction. Assume \(D \in \mathrm{DC}.\mathrm{detectors}\) and \(D\) is violated by \(f \cdot g\). Using the parity-determines property of the linearity condition, \(D\) is violated by the composite iff the count of measurement events where \((f \cdot g)\) has a time-error is odd. Since \((f \cdot g).\mathrm{timeErrors}(m, t) = f.\mathrm{timeErrors}(m, t) \oplus g.\mathrm{timeErrors}(m, t)\) (XOR), the set of faulted events for the product is the symmetric difference of the individual faulted event sets. Using the helper lemma on symmetric difference cardinality (\(|A \triangle B| \equiv |A| + |B| \pmod{2}\)), the sum of the individual counts is odd. By integer arithmetic, this means exactly one of \(|A| \bmod 2 = 1\) and \(|B| \bmod 2 = 1\) holds. In each case, we construct membership in exactly one syndrome with non-membership in the other, using the parity-determines characterization.

Reverse direction. Assume \(D\) is in the symmetric difference. We consider two cases.

Case 1: \(D\) is in the syndrome of \(f\) but not \(g\). Then \(D \in \mathrm{DC}.\mathrm{detectors}\). Using parity-determines, the count for \(f\) is odd and the count for \(g\) is even. As in the forward direction, we establish that \((f \cdot g).\mathrm{timeErrors}\) corresponds to XOR, so the faulted event set for the product is the symmetric difference of the individual sets. Using the cardinality-mod-2 lemma, the product count has parity equal to the sum of parities. Since the \(f\)-count is odd and the \(g\)-count is even (by negation of the odd condition), by integer arithmetic the sum is odd, establishing the violation.

Case 2: \(D\) is in the syndrome of \(g\) but not \(f\). By a symmetric argument: \(D \in \mathrm{DC}.\mathrm{detectors}\), the \(g\)-count is odd and the \(f\)-count is even, and by the same XOR and symmetric difference cardinality reasoning, the product count is odd.

Theorem 637 Syndrome of Inverse

Under the syndrome linearity condition, the syndrome of the inverse fault equals the syndrome of the original:

\[ \mathrm{syndrome}(\mathrm{DC}, \mathrm{base}, F^{-1}) = \mathrm{syndrome}(\mathrm{DC}, \mathrm{base}, F). \]
Proof

By extensionality on detector \(D\), membership in the syndrome is equivalent to \(D \in \mathrm{DC}.\mathrm{detectors}\) and \(D\) being violated. For the forward direction, assume \(D \in \mathrm{DC}.\mathrm{detectors}\) and \(D\) is violated by \(F^{-1}\). Using the parity-determines property for \(F^{-1}\) and then for \(F\), we convert both violation conditions to parity conditions on the filtered measurement events, and these are equal. The reverse direction follows by the same argument in the opposite direction.

Definition 638 Spacetime Stabilizer
#

A spacetime fault \(F\) is a spacetime stabilizer if it has empty syndrome and is trivial:

\[ \mathrm{IsSpacetimeStabilizer'}(\mathrm{DC}, \mathrm{base}, \mathrm{isTrivial}, F) \iff \mathrm{hasEmptySyndrome'}(\mathrm{DC}, \mathrm{base}, F) \land \mathrm{isTrivial}(F). \]
Definition 639 Logical Fault
#

A spacetime fault \(F\) is a logical fault if it has empty syndrome but is non-trivial:

\[ \mathrm{IsLogicalFault}(\mathrm{DC}, \mathrm{base}, \mathrm{isTrivial}, F) \iff \mathrm{hasEmptySyndrome'}(\mathrm{DC}, \mathrm{base}, F) \land \neg \, \mathrm{isTrivial}(F). \]
Theorem 640 Empty Syndrome Dichotomy

If a fault has empty syndrome, then it is either a spacetime stabilizer or a logical fault:

\[ \mathrm{hasEmptySyndrome'}(\mathrm{DC}, \mathrm{base}, F) \implies \mathrm{IsSpacetimeStabilizer'}(\mathrm{DC}, \mathrm{base}, \mathrm{isTrivial}, F) \lor \mathrm{IsLogicalFault}(\mathrm{DC}, \mathrm{base}, \mathrm{isTrivial}, F). \]
Proof

We decide by cases on whether \(\mathrm{isTrivial}(F)\) holds. If \(\mathrm{isTrivial}(F)\), then the left disjunct holds by pairing the empty syndrome hypothesis with the triviality. If \(\neg \, \mathrm{isTrivial}(F)\), then the right disjunct holds by pairing the empty syndrome hypothesis with non-triviality.

Theorem 641 Stabilizers and Logical Faults are Mutually Exclusive

A fault cannot be simultaneously a spacetime stabilizer and a logical fault:

\[ \neg \bigl(\mathrm{IsSpacetimeStabilizer'}(\mathrm{DC}, \mathrm{base}, \mathrm{isTrivial}, F) \land \mathrm{IsLogicalFault}(\mathrm{DC}, \mathrm{base}, \mathrm{isTrivial}, F)\bigr). \]
Proof

Assume both hold. From the stabilizer hypothesis, \(\mathrm{isTrivial}(F)\) holds. From the logical fault hypothesis, \(\neg \, \mathrm{isTrivial}(F)\) holds. This is a contradiction.

Theorem 642 Logical Fault Characterization

A fault is a logical fault if and only if it has empty syndrome and is non-trivial:

\[ \mathrm{IsLogicalFault}(\mathrm{DC}, \mathrm{base}, \mathrm{isTrivial}, F) \iff \mathrm{hasEmptySyndrome'}(\mathrm{DC}, \mathrm{base}, F) \land \neg \, \mathrm{isTrivial}(F). \]
Proof

This holds by reflexivity of the biconditional, since the left-hand side is definitionally equal to the right-hand side.

Theorem 643 Syndrome Membership Characterization

A detector \(D \in \mathrm{DC}.\mathrm{detectors}\) is in the syndrome if and only if it is violated by the fault:

\[ D \in \mathrm{syndrome}(\mathrm{DC}, \mathrm{base}, F) \iff D.\mathrm{isViolated}(\mathrm{applyFaultToOutcomes'}(\mathrm{base}, F)). \]
Proof

By simplification: the syndrome is defined as a filter of \(\mathrm{DC}.\mathrm{detectors}\) by the violation predicate. Since \(D \in \mathrm{DC}.\mathrm{detectors}\) is given, membership in the filter reduces to the violation condition.

Theorem 644 Syndrome is a Subset of Detectors
#

The syndrome is always a subset of the detector collection:

\[ \mathrm{syndrome}(\mathrm{DC}, \mathrm{base}, F) \subseteq \mathrm{DC}.\mathrm{detectors}. \]
Proof

Let \(D \in \mathrm{syndrome}(\mathrm{DC}, \mathrm{base}, F)\). By the definition of syndrome as a filter of \(\mathrm{DC}.\mathrm{detectors}\), membership in the filter implies membership in \(\mathrm{DC}.\mathrm{detectors}\), which is the first component of the conjunction.