MerLean-example

38 Rem 15: Hypergraph Generalization of Gauging Measurement

The gauging measurement procedure can be generalized by replacing the graph \(G\) with a hypergraph to measure multiple operators simultaneously. For qubits, this is equivalent to replacing the graph \(G\) with a hypergraph. The generalized gauging procedure performs a code deformation by introducing a qubit for each hyperedge and measuring into new Gauss’s law checks \(A_v\) given by the product of \(X\) on a vertex and the adjacent hyperedges.

Definition 1204 Hypergraph
#

A hypergraph on vertices \(V\) with hyperedges indexed by \(H\) is a structure consisting of an incidence function

\[ \mathrm{incidence} : H \to \mathrm{Finset}(V), \]

mapping each hyperedge to the set of its incident vertices. This generalizes a graph, where each edge connects exactly two vertices, to the case where each hyperedge may connect an arbitrary subset of vertices.

Definition 1205 Incidence Entry

The incidence entry of a hypergraph \(\mathrm{HG}\) at hyperedge \(h\) and vertex \(v\) is defined as

\[ \mathrm{incidenceEntry}(h, v) = \begin{cases} 1 & \text{if } v \in \mathrm{incidence}(h), \\ 0 & \text{otherwise,} \end{cases} \]

where the values are taken in \(\mathbb {Z}/2\mathbb {Z}\).

Definition 1206 Parity-Check Map

The parity-check map \(H_Z : \mathbb {Z}_2^V \to \mathbb {Z}_2^H\) of a hypergraph \(\mathrm{HG}\) is the \(\mathbb {Z}_2\)-linear map defined by

\[ (H_Z(x))_h = \sum _{v \in \mathrm{incidence}(h)} x_v \pmod{2} \]

for each hyperedge \(h \in H\). The kernel of this map characterizes the abelian group of commuting \(X\)-type operators.

Definition 1207 Operator Kernel

The operator kernel of a hypergraph \(\mathrm{HG}\) is the kernel of the parity-check map:

\[ \ker (H_Z) = \{ x \in \mathbb {Z}_2^V \mid H_Z(x) = 0 \} . \]

This is a \(\mathbb {Z}_2\)-submodule of \(\mathbb {Z}_2^V\) that characterizes the abelian group of commuting \(X\)-type operators.

Theorem 1208 Kernel Membership Characterization

For a hypergraph \(\mathrm{HG}\) and a vector \(x \in \mathbb {Z}_2^V\),

\[ x \in \ker (H_Z) \iff \forall h \in H,\; \sum _{v \in \mathrm{incidence}(h)} x_v = 0. \]
Proof

We unfold the definition of \(\mathrm{operatorKernel}\) as \(\ker (\mathrm{parityCheckMap})\). We prove both directions. For the forward direction, assume \(H_Z(x) = 0\). For any hyperedge \(h\), we extract the \(h\)-th component of this equation, which by simplification gives \(\sum _{v \in \mathrm{incidence}(h)} x_v = 0\). For the reverse direction, assume \(\sum _{v \in \mathrm{incidence}(h)} x_v = 0\) for all \(h\). By extensionality, we show \(H_Z(x) = 0\) component-wise, which follows by simplification using the hypothesis applied to each \(h\).

Definition 1209 \(k\)-Local Hyperedge

A hyperedge \(h\) is \(k\)-local if it contains at most \(k\) vertices:

\[ |\mathrm{incidence}(h)| \le k. \]
Definition 1210 \(k\)-Local Hypergraph

A hypergraph is \(k\)-local if all of its hyperedges are \(k\)-local:

\[ \forall h \in H,\; |\mathrm{incidence}(h)| \le k. \]
Theorem 1211 \(k\)-Locality Implies Sparse Rows

If a hyperedge \(h\) is \(k\)-local, then the corresponding row of the incidence matrix has at most \(k\) nonzero entries:

\[ |\{ v \in V \mid \mathrm{incidenceEntry}(h, v) \neq 0 \} | \le k. \]
Proof

We first establish that the set \(\{ v \in V \mid \mathrm{incidenceEntry}(h,v) \neq 0\} \) equals the set \(\{ v \in V \mid v \in \mathrm{incidence}(h)\} \). By extensionality, for each vertex \(v\): if \(\mathrm{incidenceEntry}(h,v) \neq 0\), we argue by contradiction that \(v \in \mathrm{incidence}(h)\) (since \(v \notin \mathrm{incidence}(h)\) would give \(\mathrm{incidenceEntry}(h,v) = 0\), contradiction); conversely, if \(v \in \mathrm{incidence}(h)\), then by simplification \(\mathrm{incidenceEntry}(h,v) = 1 \neq 0\). Rewriting with this equality, we compute

\[ |\{ v \in V \mid v \in \mathrm{incidence}(h)\} | \le |\mathrm{incidence}(h)| \le k, \]

where the first inequality follows because the filter is a subset of \(\mathrm{incidence}(h)\), and the second is the \(k\)-locality hypothesis.

Definition 1212 Incident Hyperedges

The set of hyperedges incident to vertex \(v\) is

\[ \mathrm{incidentHyperedges}(v) = \{ h \in H \mid v \in \mathrm{incidence}(h) \} . \]
Definition 1213 Gauss Law Vertex Support

The vertex support of the generalized Gauss law operator \(A_v\) is a binary vector on \(V\) with \(1\) at position \(v\) and \(0\) elsewhere, representing the \(X_v\) factor:

\[ \mathrm{gaussLawVertexSupport}(v)(w) = \begin{cases} 1 & \text{if } w = v, \\ 0 & \text{otherwise.} \end{cases} \]
Definition 1214 Gauss Law Hyperedge Support

The hyperedge support of \(A_v\) is a binary vector on \(H\) with \(1\) at each hyperedge containing \(v\):

\[ \mathrm{gaussLawHyperedgeSupport}(v)(h) = \begin{cases} 1 & \text{if } v \in \mathrm{incidence}(h), \\ 0 & \text{otherwise.} \end{cases} \]
Definition 1215 Gauss Law \(Z\)-Type Support

The \(Z\)-type support of \(A_v\) on vertex qubits is the zero vector, since \(A_v\) is a purely \(X\)-type operator:

\[ \mathrm{gaussLawZTypeSupport}(v) = 0 \in \mathbb {Z}_2^V. \]
Definition 1216 Gauss Law \(Z\)-Type Hyperedge Support

The \(Z\)-type hyperedge support of \(A_v\) is also the zero vector:

\[ \mathrm{gaussLawZTypeHyperedgeSupport}(v) = 0 \in \mathbb {Z}_2^H. \]
Definition 1217 Symplectic Inner Product on Vertices

The symplectic inner product on vertex qubits for two Pauli operators with \(X\)-type supports \(xS_1, xS_2\) and \(Z\)-type supports \(zS_1, zS_2\) is

\[ \langle (xS_1, zS_1), (xS_2, zS_2) \rangle _{\mathrm{symp}} = \sum _{i \in V} \bigl( xS_1(i) \cdot zS_2(i) + zS_1(i) \cdot xS_2(i) \bigr). \]
Definition 1218 Symplectic Inner Product on Hyperedges

The symplectic inner product on hyperedge qubits is defined analogously:

\[ \langle (xS_1, zS_1), (xS_2, zS_2) \rangle _{\mathrm{symp}} = \sum _{i \in H} \bigl( xS_1(i) \cdot zS_2(i) + zS_1(i) \cdot xS_2(i) \bigr). \]

For any two vertices \(v_1, v_2 \in V\), the generalized Gauss law operators \(A_{v_1}\) and \(A_{v_2}\) commute. Specifically, the symplectic inner product of their supports is zero on both vertex and hyperedge qubits:

\[ \langle A_{v_1}, A_{v_2} \rangle _{\mathrm{symp}}^V = 0 \quad \text{and} \quad \langle A_{v_1}, A_{v_2} \rangle _{\mathrm{symp}}^H = 0. \]
Proof

We prove each conjunct separately. For the vertex part, we unfold the definitions of \(\mathrm{symplecticInnerProductV}\) and \(\mathrm{gaussLawZTypeSupport}\). Since the \(Z\)-type support is the zero vector, every term in the sum \(xS_1(i) \cdot 0 + 0 \cdot xS_2(i) = 0\), so the entire sum simplifies to \(0\). The hyperedge part follows identically using \(\mathrm{symplecticInnerProductH}\) and \(\mathrm{gaussLawZTypeHyperedgeSupport} = 0\).

Theorem 1220 Vertex Support Sum Is All-Ones

The sum of all vertex supports equals the all-ones vector on \(V\):

\[ \sum _{v \in V} \mathrm{gaussLawVertexSupport}(v) = \mathbf{1}_V, \]

corresponding to \(\prod _v A_v\) having \(L = \prod _v X_v\) as its vertex component.

Proof

By extensionality, it suffices to show equality for an arbitrary vertex \(w\). We unfold the pointwise sum and \(\mathrm{gaussLawVertexSupport}\). Using \(\mathrm{Finset.sum\_ eq\_ single}\; w\), we isolate the term \(v = w\), which contributes \(\mathrm{Pi.single}\; w\; 1\; w = 1\) by simplification. For any \(v \neq w\), \(\mathrm{Pi.single}\; v\; 1\; w = 0\) by the definition of \(\mathrm{Pi.single}\) for distinct indices. The case that \(w \notin \mathrm{univ}\) is absurd since \(w \in \mathrm{Finset.univ}\).

Theorem 1221 Hyperedge Support Sum

For each hyperedge \(h\), the sum of hyperedge supports over all vertices equals the cardinality of \(h\) modulo \(2\):

\[ \sum _{v \in V} \mathrm{gaussLawHyperedgeSupport}(v)(h) = |\mathrm{incidence}(h)| \pmod{2}. \]
Proof

We unfold \(\mathrm{gaussLawHyperedgeSupport}\) and split the sum over \(V\) into vertices that belong to \(\mathrm{incidence}(h)\) and those that do not, using \(\mathrm{Finset.sum\_ filter\_ add\_ sum\_ filter\_ not}\). For vertices \(v \in \mathrm{incidence}(h)\), the conditional evaluates to \(1\); for vertices \(v \notin \mathrm{incidence}(h)\), it evaluates to \(0\). Rewriting via \(\mathrm{Finset.sum\_ congr}\) for each part, the sum over the complement contributes \(0\), and the sum over \(\mathrm{incidence}(h)\) contributes \(|\mathrm{incidence}(h)| \cdot 1\). We then observe that \(\{ v \in \mathrm{univ} \mid v \in \mathrm{incidence}(h)\} = \mathrm{incidence}(h)\) and simplify.

Theorem 1222 Graph Case: Product of Hyperedge Supports Is Zero

If every hyperedge has exactly \(2\) vertices (graph-like case), then for each hyperedge \(h\),

\[ \sum _{v \in V} \mathrm{gaussLawHyperedgeSupport}(v)(h) = 0 \pmod{2}. \]
Proof

Rewriting using the hyperedge support sum theorem, the sum equals \(|\mathrm{incidence}(h)| \pmod{2}\). By the graph-like hypothesis, \(|\mathrm{incidence}(h)| = 2\), so the result is \(2 \pmod{2} = 0\), which is verified by computation.

Definition 1223 Graph-Like Hypergraph

A hypergraph is graph-like if every hyperedge has exactly \(2\) vertices:

\[ \forall h \in H,\; |\mathrm{incidence}(h)| = 2. \]
Definition 1224 Hypergraph from Graph

Given a \(\mathrm{GraphWithCycles}\) \(G\) on vertices \(V\), edges \(E\), and cycles \(C\), we construct a hypergraph on vertices \(V\) with hyperedges indexed by \(E\) by setting

\[ \mathrm{incidence}(e) = \mathrm{edgeVertices}(e) \]

for each edge \(e \in E\). This embeds ordinary graphs into the hypergraph framework.

Theorem 1225 Graphs Are Graph-Like Hypergraphs

A hypergraph constructed from a \(\mathrm{GraphWithCycles}\) is graph-like.

Proof

Let \(e\) be an edge. We unfold the definitions of \(\mathrm{ofGraphWithCycles}\) and \(\mathrm{isGraphLike}\). The incidence set of \(e\) is \(\mathrm{edgeVertices}(e) = \{ G.\mathrm{edgeStart}(e),\, G.\mathrm{edgeEnd}(e)\} \). Since the two endpoints are distinct (by \(G.\mathrm{edge\_ endpoints\_ ne}\)), the cardinality of this pair equals \(2\).

Theorem 1226 Sparse Rows for \(k\)-Local Hypergraphs

For a \(k\)-local hypergraph, the parity-check matrix has at most \(k\) entries per row:

\[ \forall h \in H,\; |\mathrm{incidence}(h)| \le k. \]
Proof

This follows directly from the definition of \(k\)-local hypergraph applied to \(h\).

Theorem 1227 Total Entries Bound

For a \(k\)-local hypergraph, the total number of nonzero entries in the incidence matrix is bounded by \(k \cdot |H|\):

\[ \sum _{h \in H} |\mathrm{incidence}(h)| \le k \cdot |H|. \]
Proof

We compute:

\[ \sum _{h \in H} |\mathrm{incidence}(h)| \le \sum _{h \in H} k = k \cdot |H|, \]

where the first inequality uses \(\mathrm{Finset.sum\_ le\_ sum}\) with the \(k\)-locality bound \(|\mathrm{incidence}(h)| \le k\) for each \(h\), and the second equality follows by rewriting the constant sum as \(k \cdot |\mathrm{Finset.univ}|\) and using \(|\mathrm{Finset.univ}| = |H|\).

The kernel of the parity-check map forms a \(\mathbb {Z}_2\)-submodule (abelian group over \(\mathbb {F}_2\)):

\[ \exists \, S \le \mathbb {Z}_2^V,\; \forall x \in \mathbb {Z}_2^V,\; x \in S \iff H_Z(x) = 0. \]
Proof

We take \(S = \mathrm{operatorKernel} = \ker (H_Z)\). The equivalence \(x \in S \iff H_Z(x) = 0\) is exactly \(\mathrm{LinearMap.mem\_ ker}\).

Theorem 1229 Zero in Kernel

The zero vector is always in the kernel: \(0 \in \ker (H_Z)\).

Proof

We unfold the definition of \(\mathrm{operatorKernel}\) and apply \(\mathrm{LinearMap.mem\_ ker}\). Since \(H_Z\) is a linear map, \(H_Z(0) = 0\) by \(\mathrm{map\_ zero}\).

Theorem 1230 Kernel Closed Under Addition

The kernel is closed under addition: if \(x, y \in \ker (H_Z)\), then \(x + y \in \ker (H_Z)\).

Proof

This follows directly from the fact that \(\mathrm{operatorKernel}\) is a submodule, and submodules are closed under addition.

Definition 1231 New Qubit Count

The number of new qubits introduced in the generalized gauging procedure equals the number of hyperedges:

\[ \mathrm{newQubitCount} = |H|. \]
Definition 1232 New Check Count

The number of new checks equals the number of vertices (one \(A_v\) per vertex):

\[ \mathrm{newCheckCount} = |V|. \]
Definition 1233 Hypergraph Coboundary Map

The generalized coboundary map \(\delta : \mathbb {Z}_2^V \to \mathbb {Z}_2^H\) for the hypergraph is the \(\mathbb {Z}_2\)-linear map defined by

\[ (\delta (x))_h = \sum _{v \in \mathrm{incidence}(h)} x_v. \]

This is the transpose of the incidence matrix.

The hypergraph coboundary map equals the parity-check map:

\[ \delta = H_Z. \]
Proof

By extensionality in both the input vector \(x\) and the hyperedge \(h\), both maps evaluate to \(\sum _{v \in \mathrm{incidence}(h)} x_v\), which holds by simplification of the definitions.

Definition 1235 All-Ones Vector

The all-ones vector on \(V\) is the constant function \(\mathbf{1}_V : V \to \mathbb {Z}_2\) defined by \(\mathbf{1}_V(v) = 1\) for all \(v \in V\). This represents the logical operator \(L = \prod _v X_v\).

Theorem 1236 Logical in Kernel Iff Even Cardinality

The logical operator \(L\) (represented by the all-ones vector) is in the kernel if and only if every hyperedge has even cardinality:

\[ \mathbf{1}_V \in \ker (H_Z) \iff \forall h \in H,\; |\mathrm{incidence}(h)| \equiv 0 \pmod{2}. \]
Proof

We rewrite using the kernel membership characterization with \(x = \mathbf{1}_V\). For the forward direction, assume \(\sum _{v \in \mathrm{incidence}(h)} 1 = 0\) in \(\mathbb {Z}_2\) for all \(h\). Since \(\sum _{v \in \mathrm{incidence}(h)} 1 = |\mathrm{incidence}(h)| \cdot 1\), taking the \(\mathrm{ZMod.val}\) of both sides yields \(|\mathrm{incidence}(h)| \bmod 2 = 0\). For the reverse direction, assume \(|\mathrm{incidence}(h)| \bmod 2 = 0\) for all \(h\). Then \(|\mathrm{incidence}(h)|\) is even, so its natural number cast into \(\mathbb {Z}_2\) is \(0\), giving \(\sum _{v \in \mathrm{incidence}(h)} 1 = 0\) as required.

In the graph case (every hyperedge has exactly \(2\) vertices), the logical operator \(L\) is always in the kernel.

Proof

We rewrite using the characterization that \(\mathbf{1}_V \in \ker (H_Z)\) iff all hyperedges have even cardinality. For each hyperedge \(h\), the graph-like hypothesis gives \(|\mathrm{incidence}(h)| = 2\), and \(2 \bmod 2 = 0\).