MerLean-example

6 Def 2: Gauss’s Law and Flux Operators

Given a graph \(G = (V, E)\) and a collection of cycles \(C\), we define Pauli operators on the extended qubit system \(V \oplus E\) (vertex qubits \(+\) edge qubits):

  1. Gauss’s law operator \(A_v = X_v \prod _{e \ni v} X_e\) for each vertex \(v \in V\)

  2. Flux operator \(B_p = \prod _{e \in p} Z_e\) for each cycle \(p \in C\)

Definition 108 Extended Qubit Type
#

The extended qubit type for a graph \(G = (V,E)\) is the sum type

\[ \operatorname {ExtQubit}(G) := V \oplus G.\operatorname {edgeSet}, \]

where \(\operatorname {Sum.inl}(v)\) represents a vertex qubit and \(\operatorname {Sum.inr}(e)\) represents an edge qubit.

Definition 109 Incident Edges
#

For a vertex \(v \in V\), the incident edges of \(v\) is the finset

\[ \operatorname {incidentEdges}(G, v) := \{ e \in G.\operatorname {edgeSet} \mid v \in e \} . \]
Lemma 110 Membership in Incident Edges

For a vertex \(v \in V\) and an edge \(e \in G.\operatorname {edgeSet}\),

\[ e \in \operatorname {incidentEdges}(G, v) \iff v \in e. \]
Proof

By simplification using the definition of \(\operatorname {incidentEdges}\), which is a filter on the universe by the predicate \(v \in e\), this equivalence holds directly.

Definition 111 Gauss’s Law Operator
#

The Gauss’s law operator \(A_v\) on the extended system \(V \oplus E\) is the Pauli operator defined by:

\[ A_v.\operatorname {xVec}(q) = \begin{cases} 1 & \text{if } q = \operatorname {inl}(w) \text{ and } w = v, \\ 1 & \text{if } q = \operatorname {inr}(e) \text{ and } v \in e, \\ 0 & \text{otherwise}, \end{cases} \qquad A_v.\operatorname {zVec} = 0. \]

That is, \(A_v = X_v \prod _{e \ni v} X_e\): it acts with \(X\) on vertex qubit \(v\) and all incident edge qubits.

Lemma 112 Gauss Operator Z-Vector

For all \(v \in V\), \(A_v.\operatorname {zVec} = 0\).

Proof

This holds by reflexivity, since the \(\operatorname {zVec}\) component of \(\operatorname {gaussLawOp}\) is defined to be \(0\).

Definition 113 Flux Operator
#

The flux operator \(B_p\) on the extended system \(V \oplus E\) is the Pauli operator defined by:

\[ B_p.\operatorname {xVec} = 0, \qquad B_p.\operatorname {zVec}(q) = \begin{cases} 1 & \text{if } q = \operatorname {inr}(e) \text{ and } e \in \operatorname {cycles}(p), \\ 0 & \text{otherwise}. \end{cases} \]

That is, \(B_p = \prod _{e \in p} Z_e\): it acts with \(Z\) on all edge qubits in cycle \(p\).

Lemma 114 Flux Operator X-Vector
#

For all \(p \in C\), \(B_p.\operatorname {xVec} = 0\).

Proof

This holds by reflexivity, since the \(\operatorname {xVec}\) component of \(\operatorname {fluxOp}\) is defined to be \(0\).

Theorem 115 Gauss Operator is Pure X-Type

\(A_v\) is pure \(X\)-type: it has no \(Z\) support.

\[ \operatorname {supportZ}(A_v) = \emptyset . \]
Proof

By extensionality, for any qubit \(q\), we simplify using the definitions of \(\operatorname {supportZ}\) and \(\operatorname {gaussLawOp}\). Since \(A_v.\operatorname {zVec} = 0\), no qubit \(q\) can belong to \(\operatorname {supportZ}(A_v)\), so \(\operatorname {supportZ}(A_v) = \emptyset \).

Theorem 116 Flux Operator is Pure Z-Type

\(B_p\) is pure \(Z\)-type: it has no \(X\) support.

\[ \operatorname {supportX}(B_p) = \emptyset . \]
Proof

By extensionality, for any qubit \(q\), we simplify using the definitions of \(\operatorname {supportX}\) and \(\operatorname {fluxOp}\). Since \(B_p.\operatorname {xVec} = 0\), no qubit \(q\) can belong to \(\operatorname {supportX}(B_p)\), so \(\operatorname {supportX}(B_p) = \emptyset \).

Theorem 117 Gauss Operators Mutually Commute

All Gauss’s law operators mutually commute: for all \(v, w \in V\),

\[ [A_v, A_w] = 0. \]

This holds because they are all pure \(X\)-type.

Proof

We unfold the definitions of \(\operatorname {PauliCommute}\) and \(\operatorname {symplecticInner}\). The symplectic inner product is a sum over all qubits \(q\):

\[ \langle A_v, A_w \rangle _s = \sum _q \bigl( (A_v)_x(q) \cdot (A_w)_z(q) + (A_v)_z(q) \cdot (A_w)_x(q) \bigr). \]

We show each summand is zero. For each \(q\), since both \(A_v\) and \(A_w\) have \(\operatorname {zVec} = 0\), both terms in the sum vanish by simplification using the definition of \(\operatorname {gaussLawOp}\).

Theorem 118 Flux Operators Mutually Commute

All flux operators mutually commute: for all \(p, q \in C\),

\[ [B_p, B_q] = 0. \]

This holds because they are all pure \(Z\)-type.

Proof

We unfold the definitions of \(\operatorname {PauliCommute}\) and \(\operatorname {symplecticInner}\). The symplectic inner product is a sum over all qubits \(r\). We show each summand is zero. For each \(r\), since both \(B_p\) and \(B_q\) have \(\operatorname {xVec} = 0\), both terms in the sum vanish by simplification using the definition of \(\operatorname {fluxOp}\).

Definition 119 Cycle Incident Count
#

The cycle incident count of a vertex \(v\) and a cycle \(p\) is the number of edges in \(p\) that are incident to \(v\):

\[ \operatorname {cycleIncidentCount}(v, p) := \bigl|\{ e \in G.\operatorname {edgeSet} \mid e \in \operatorname {cycles}(p) \land v \in e \} \bigr|. \]

For a valid cycle, this is always even (either \(0\) or \(2\)).

Gauss’s law operators commute with flux operators: assuming for every cycle \(c \in C\) and every vertex \(v \in V\) the number of edges in \(c\) incident to \(v\) is even, then for all \(v \in V\) and \(p \in C\),

\[ [A_v, B_p] = 0. \]
Proof

We unfold the definitions of \(\operatorname {PauliCommute}\) and \(\operatorname {symplecticInner}\). The symplectic inner product is

\[ \langle A_v, B_p \rangle _s = \sum _q \bigl( (A_v)_x(q) \cdot (B_p)_z(q) + (A_v)_z(q) \cdot (B_p)_x(q) \bigr). \]

Since \(A_v\) is pure \(X\)-type (\(\operatorname {zVec} = 0\)) and \(B_p\) is pure \(Z\)-type (\(\operatorname {xVec} = 0\)), the second term in each summand vanishes. We establish that

\[ \langle A_v, B_p \rangle _s = \sum _q (A_v)_x(q) \cdot (B_p)_z(q) \]

by congruence: for each \(q\), the extra terms simplify to zero using the definitions of \(\operatorname {gaussLawOp}\) and \(\operatorname {fluxOp}\). Rewriting with this identity, we split the sum over \(V \oplus E\) into vertex and edge parts using \(\operatorname {Fintype.sum\_ sum\_ type}\).

For the vertex part: \(\sum _{w \in V} (A_v)_x(\operatorname {inl}(w)) \cdot (B_p)_z(\operatorname {inl}(w)) = 0\), because \(B_p\) has \(\operatorname {zVec} = 0\) on vertices. We show each summand is zero by simplification, then rewrite with this identity and \(0 + (\cdot ) = (\cdot )\).

For the edge part: we establish that

\[ \sum _{e \in G.\operatorname {edgeSet}} (A_v)_x(\operatorname {inr}(e)) \cdot (B_p)_z(\operatorname {inr}(e)) = \sum _e \begin{cases} 1 & \text{if } e \in \operatorname {cycles}(p) \land v \in e, \\ 0 & \text{otherwise}. \end{cases} \]

This is shown by congruence and case analysis: for each edge \(e\), we consider the cases \(v \in e\) and \(e \in \operatorname {cycles}(p)\) and simplify. Rewriting with this identity, we apply \(\operatorname {Finset.sum\_ boole}\) to convert the sum of indicators to a cardinality:

\[ \sum _e [\! [e \in \operatorname {cycles}(p) \land v \in e]\! ] = \bigl|\{ e \mid e \in \operatorname {cycles}(p) \land v \in e\} \bigr| \pmod{2}. \]

By \(\operatorname {ZMod.natCast\_ eq\_ zero\_ iff\_ even}\), this is \(0 \in \mathbb {Z}/2\mathbb {Z}\) if and only if the count is even. The result then follows directly from the hypothesis \(\operatorname {hcyc}(p, v)\).

Theorem 121 Gauss Operator X-Support on Vertices

The \(X\)-support of \(A_v\) on vertex qubits is \(\{ v\} \): for all \(w \in V\),

\[ \operatorname {inl}(w) \in \operatorname {supportX}(A_v) \iff w = v. \]
Proof

Let \(w\) be an arbitrary vertex. We simplify using the definitions of \(\operatorname {supportX}\) and \(\operatorname {gaussLawOp}\). The \(X\)-vector of \(A_v\) at \(\operatorname {inl}(w)\) is \(1\) if \(w = v\) and \(0\) otherwise, so the result follows directly.

Theorem 122 Gauss Operator X-Support on Edges

The \(X\)-support of \(A_v\) on edge qubits is the set of incident edges: for all \(e \in G.\operatorname {edgeSet}\),

\[ \operatorname {inr}(e) \in \operatorname {supportX}(A_v) \iff v \in e. \]
Proof

Let \(e\) be an arbitrary edge. We simplify using the definitionsof \(\operatorname {supportX}\) and \(\operatorname {gaussLawOp}\). The \(X\)-vector of \(A_v\) at \(\operatorname {inr}(e)\) is \(1\) if \(v \in e\) and \(0\) otherwise, so the result follows directly.

Theorem 123 Flux Operator Z-Support on Edges

The \(Z\)-support of \(B_p\) on edge qubits is the set of edges in the cycle: for all \(e \in G.\operatorname {edgeSet}\),

\[ \operatorname {inr}(e) \in \operatorname {supportZ}(B_p) \iff e \in \operatorname {cycles}(p). \]
Proof

Let \(e\) be an arbitrary edge. We simplify using the definitions of \(\operatorname {supportZ}\) and \(\operatorname {fluxOp}\). The \(Z\)-vector of \(B_p\) at \(\operatorname {inr}(e)\) is \(1\) if \(e \in \operatorname {cycles}(p)\) and \(0\) otherwise, so the result follows directly.

Theorem 124 Flux Operator Z-Support on Vertices is Empty

The \(Z\)-support of \(B_p\) on vertex qubits is empty: for all \(w \in V\),

\[ \operatorname {inl}(w) \notin \operatorname {supportZ}(B_p). \]
Proof

Let \(w\) be an arbitrary vertex. We simplify using the definitions of \(\operatorname {supportZ}\) and \(\operatorname {fluxOp}\). Since \(B_p.\operatorname {zVec}(\operatorname {inl}(w)) = 0\), the vertex qubit \(\operatorname {inl}(w)\) does not belong to \(\operatorname {supportZ}(B_p)\).

Definition 125 Logical Operator
#

The logical operator \(L = \prod _{v \in V} X_v\) on the extended system is the Pauli operator defined by:

\[ L.\operatorname {xVec}(q) = \begin{cases} 1 & \text{if } q = \operatorname {inl}(w) \text{ for some } w \in V, \\ 0 & \text{if } q = \operatorname {inr}(e), \end{cases} \qquad L.\operatorname {zVec} = 0. \]

That is, \(L\) acts with \(X\) on all vertex qubits and with the identity on all edge qubits.

Lemma 126 Gauss Product X-Vector on Vertices

For each vertex \(v \in V\),

\[ \sum _{w \in V} (A_w)_x(\operatorname {inl}(v)) = 1. \]
Proof

By simplification using the definition of \(\operatorname {gaussLawOp}\). The \(X\)-vector of \(A_w\) at \(\operatorname {inl}(v)\) is \(1\) if \(w = v\) and \(0\) otherwise, so the sum picks out exactly the single term \(w = v\), giving \(1\).

Lemma 127 Gauss Product X-Vector on Edges

For each edge \(e \in G.\operatorname {edgeSet}\),

\[ \sum _{v \in V} (A_v)_x(\operatorname {inr}(e)) = 0. \]
Proof

We unfold the definition of \(\operatorname {gaussLawOp}\). The sum counts, modulo \(2\), the number of vertices \(v\) with \(v \in e\). We decompose the edge: let \(e = \{ a, b\} \) with \(a \neq b\) (since \(G\) has no loops). The sum \(\sum _{v \in V} [\! [v \in \{ a,b\} ]\! ]\) equals \(([\! [v = a]\! ] + [\! [v = b]\! ])\) summed over \(v\).

We establish for each \(v\) that the indicator \([\! [v \in \{ a,b\} ]\! ] = [\! [v = a]\! ] + [\! [v = b]\! ]\) by case analysis: if \(v = a\), we use \(a \neq b\) and simplify via \(\operatorname {Sym2.mem\_ iff}\); if \(v = b\), similarly; if \(v \neq a\) and \(v \neq b\), then \(v \notin \{ a,b\} \) by \(\operatorname {Sym2.mem\_ iff}\) and pushing negation.

Rewriting with this identity, we distribute the sum: \(\sum _v ([\! [v = a]\! ] + [\! [v = b]\! ]) = \sum _v [\! [v = a]\! ] + \sum _v [\! [v = b]\! ]\). Each sum evaluates to \(1\) by \(\operatorname {Finset.sum\_ ite\_ eq’}\) over the universe. The result is \(1 + 1 = 0\) in \(\mathbb {Z}/2\mathbb {Z}\) by \(\operatorname {CharTwo.add\_ self\_ eq\_ zero}\).

Theorem 128 Gauss Product Property

The product of all Gauss’s law operators equals the logical operator:

\[ \prod _{v \in V} A_v = L. \]

Each vertex gets \(X\) exactly once; each edge gets \(X^2 = I\).

Proof

By extensionality, we must show that the \(\operatorname {xVec}\) and \(\operatorname {zVec}\) components agree.

For xVec: We rewrite the \(\operatorname {xVec}\) of the product as a sum over the universe, then apply the private helper lemma prod_pauliOp_xVec to express \((\prod _v A_v)_x(q) = \sum _v (A_v)_x(q)\). We case-split on \(q\):

  • If \(q = \operatorname {inl}(w)\) for a vertex \(w\): by simplification using \(\operatorname {gaussLawOp}\) and \(\operatorname {logicalOp}\), we rewrite the sum \(\sum _v [\! [v = w]\! ]\) using \(\operatorname {Finset.sum\_ ite\_ eq’}\) over the universe to obtain \(1\), which matches \(L_x(\operatorname {inl}(w)) = 1\).

  • If \(q = \operatorname {inr}(e)\) for an edge \(e\): by simplification using \(\operatorname {gaussLawOp}\) and \(\operatorname {logicalOp}\), the result follows from \(\operatorname {gaussLaw\_ product\_ xVec\_ inr}\), which gives \(0 = L_x(\operatorname {inr}(e))\).

For zVec: We similarly rewrite using prod_pauliOp_zVec. Since every \(A_v\) has \(\operatorname {zVec} = 0\), the sum is \(0\) for all \(q\), matching \(L.\operatorname {zVec} = 0\). This is verified by simplification using the definitions of \(\operatorname {gaussLawOp}\) and \(\operatorname {logicalOp}\).

Theorem 129 Logical Operator is Pure X-Type

The logical operator \(L\) is pure \(X\)-type:

\[ \operatorname {supportZ}(L) = \emptyset . \]
Proof

By extensionality, for any qubit \(q\), we simplify using the definitions of \(\operatorname {supportZ}\) and \(\operatorname {logicalOp}\). Since \(L.\operatorname {zVec} = 0\), no qubit belongs to \(\operatorname {supportZ}(L)\).

Theorem 130 Logical Operator Commutes with Flux

The logical operator commutes with all flux operators: for all \(p \in C\),

\[ [L, B_p] = 0. \]
Proof

We unfold the definitions of \(\operatorname {PauliCommute}\) and \(\operatorname {symplecticInner}\). The symplectic inner product is a sum over all qubits \(q\). We show each summand is zero by case-splitting on \(q\):

  • If \(q = \operatorname {inl}(w)\): by simplification using the definitions of \(\operatorname {logicalOp}\) and \(\operatorname {fluxOp}\), the term vanishes since \(B_p.\operatorname {zVec}(\operatorname {inl}(w)) = 0\) and \(B_p.\operatorname {xVec} = 0\).

  • If \(q = \operatorname {inr}(e)\): by simplification using the definitions of \(\operatorname {logicalOp}\) and \(\operatorname {fluxOp}\), the term vanishes since \(L.\operatorname {zVec} = 0\) and \(L.\operatorname {xVec}(\operatorname {inr}(e)) = 0\).

All three commutation relations hold simultaneously, assuming the cycle incidence condition:

  1. \([A_v, A_w] = 0\) for all \(v, w \in V\),

  2. \([B_p, B_q] = 0\) for all \(p, q \in C\),

  3. \([A_v, B_p] = 0\) for all \(v \in V\), \(p \in C\).

Proof

This follows directly by combining the three individual commutation theorems: part (i) from \(\operatorname {gaussLaw\_ commute}\), part (ii) from \(\operatorname {flux\_ commute}\), and part (iii) from \(\operatorname {gauss\_ flux\_ commute}\).

Theorem 132 Gauss Operator X-Vector Equals Coboundary

The Gauss’s law operator \(A_v\) has \(X\)-support on edges related to the coboundary map: for each edge \(e\),

\[ (A_v)_x(\operatorname {inr}(e)) = \delta (\mathbf{1}_v)(e), \]

where \(\delta \) is the coboundary map and \(\mathbf{1}_v\) is the indicator of vertex \(v\).

Proof

We unfold the definition of \(\operatorname {gaussLawOp}\) and then rewrite using \(\operatorname {GraphMaps.coboundaryMap\_ single}\), which expresses the coboundary of a basis vector \(\mathbf{1}_v\) in exactly the same indicator form as \((A_v)_x\) on edges.

Theorem 133 Flux Operator Z-Vector Equals Second Boundary

The flux operator \(B_p\) has \(Z\)-support on edges related to the second boundary map: for each edge \(e\),

\[ (B_p)_z(\operatorname {inr}(e)) = \partial _2(\mathbf{1}_p)(e), \]

where \(\partial _2\) is the second boundary map and \(\mathbf{1}_p\) is the indicator of cycle \(p\).

Proof

We unfold the definition of \(\operatorname {fluxOp}\) and then rewrite using \(\operatorname {GraphMaps.secondBoundaryMap\_ single}\), which expresses the second boundary of a basis vector \(\mathbf{1}_p\) in exactly the same indicator form as \((B_p)_z\) on edges.