MerLean-example

13 Def 3: Flux Operators

Given a connected graph \(G = (V_G, E_G)\) with a generating set of cycles \(\{ p\} _C\) (where \(C = |E_G| - |V_G| + 1\) is the number of independent cycles by Euler’s formula for connected graphs), the flux operators are the set \(\mathcal{B} = \{ B_p\} _{p \in C}\) where:

\[ B_p = \prod _{e \in p} Z_e \]

Here \(Z_e\) is the Pauli-\(Z\) operator on the edge qubit \(e\), and the product is over all edges \(e\) that belong to cycle \(p\).

The flux operators arise from the initial state \(\lvert 0\rangle ^{\otimes E_G}\) of the edge qubits:

  1. Initially, \(Z_e \lvert 0\rangle _e = \lvert 0\rangle _e\) for each edge, so each \(Z_e\) is a stabilizer.

  2. After measuring the Gauss’s law operators \(A_v\) (which involve \(X_e\) terms), individual \(Z_e\) operators are no longer stabilizers.

  3. However, products \(B_p = \prod _{e \in p} Z_e\) over cycles remain stabilizers because they commute with all \(A_v\): \([B_p, A_v] = 0\) for all \(p, v\).

To verify: \(B_p\) and \(A_v\) commute because the number of edges in cycle \(p\) incident to vertex \(v\) is always even (either 0 or 2), so the number of anticommuting \(X_e\)–\(Z_e\) pairs is even.

Definition 348 Independent Cycle Count
#

The number of independent cycles in a connected graph according to Euler’s formula. For a connected graph with vertex set \(V\) and edge set \(E\):

\[ C = |E| - |V| + 1. \]

We represent this as an integer to handle the subtraction correctly:

\[ \operatorname {independentCycleCount} := (\operatorname {card}(E) : \mathbb {Z}) - (\operatorname {card}(V) : \mathbb {Z}) + 1. \]
Definition 349 Flux Operator Vertex Support

The vertex support of flux operator \(B_p\): zero everywhere. Since \(B_p\) is a \(Z\)-type operator, it has no \(X\) component on vertices. For any graph \(G\) and cycle \(p\):

\[ \operatorname {fluxOperator\_ vertexSupport}(G, p) := \mathbf{0} \in (\mathbb {Z}/2\mathbb {Z})^V. \]
Definition 350 Flux Operator Edge Support

The edge support of flux operator \(B_p\): \(1\) at edges in cycle \(p\), \(0\) elsewhere. This represents \(B_p = \prod _{e \in p} Z_e\). For a graph \(G\) and cycle \(p\):

\[ \operatorname {fluxOperator\_ edgeSupport}(G, p) := \partial _2(e_p), \]

i.e., the image of cycle \(p\) under the second boundary map.

Lemma 351 Flux Operator Edge Support In Cycle

For a graph \(G\), cycle \(p\), and edge \(e\) with \(e \in \operatorname {cycles}(G, p)\):

\[ \operatorname {fluxOperator\_ edgeSupport}(G, p)(e) = 1. \]
Proof

By simplification using the definitions of fluxOperator_edgeSupport and boundary2OfCycle_apply, together with the hypothesis \(e \in \operatorname {cycles}(G, p)\), the result follows.

Lemma 352 Flux Operator Edge Support Not In Cycle

For a graph \(G\), cycle \(p\), and edge \(e\) with \(e \notin \operatorname {cycles}(G, p)\):

\[ \operatorname {fluxOperator\_ edgeSupport}(G, p)(e) = 0. \]
Proof

By simplification using the definitions of fluxOperator_edgeSupport and boundary2OfCycle_apply, together with the hypothesis \(e \notin \operatorname {cycles}(G, p)\), the result follows.

Lemma 353 Flux Operator Edge Support Apply

For a graph \(G\), cycle \(p\), and edge \(e\):

\[ \operatorname {fluxOperator\_ edgeSupport}(G, p)(e) = \begin{cases} 1 & \text{if } e \in \operatorname {cycles}(G, p), \\ 0 & \text{otherwise.}\end{cases} \]
Proof

By simplification using the definitions of fluxOperator_edgeSupport and boundary2OfCycle_apply, the result follows directly.

Theorem 354 Flux Edge Support Squared

\(B_p^2 = I\) on edge support: in \(\mathbb {Z}/2\mathbb {Z}\), the edge support added to itself equals zero:

\[ \operatorname {fluxOperator\_ edgeSupport}(G, p) + \operatorname {fluxOperator\_ edgeSupport}(G, p) = \mathbf{0}. \]
Proof

By extensionality, it suffices to show equality for an arbitrary edge \(e\). Using the pointwise addition of \(\Pi \)-types and the zero function, the goal reduces to showing \(f(e) + f(e) = 0\) for each component. This follows directly from the lemma that \(x + x = 0\) in \(\mathbb {Z}/2\mathbb {Z}\) for any \(x\).

Theorem 355 Flux Hermitian

\(B_p\) is Hermitian with eigenvalues \(\pm 1\). This is represented by \(B_p^2 = I\), which in \(\mathbb {Z}/2\mathbb {Z}\) is: \(2 \cdot \operatorname {support} = 0\). Formally, for all edges \(e\):

\[ 2 \cdot \operatorname {fluxOperator\_ edgeSupport}(G, p)(e) = 0. \]
Proof

Let \(e\) be an arbitrary edge. Rewriting \(2 \cdot x\) as \(\operatorname {Nat.cast}(2) \cdot x\), we establish that \((2 : \mathbb {Z}/2\mathbb {Z}) = 0\) by computation (decide). Then by simplification with this fact, the result follows.

Definition 356 Flux X-Support on Vertices
#

The \(X\)-support of a flux operator on vertices is empty (\(Z\)-type operators have no \(X\) component):

\[ \operatorname {flux\_ XSupport\_ vertex}(G, p) := \emptyset . \]
Definition 357 Flux X-Support on Edges
#

The \(X\)-support of a flux operator on edges is also empty:

\[ \operatorname {flux\_ XSupport\_ edge}(G, p) := \emptyset . \]
Definition 358 Flux Symplectic Form
#

The symplectic form between two flux operators. For \(Z\)-type operators:

\[ \omega (B_p, B_q) = |X_p \cap Z_q| + |Z_p \cap X_q| = |\emptyset | + |\emptyset | = 0. \]

Formally:

\[ \operatorname {flux\_ symplectic}(G, p, q) := |\operatorname {flux\_ XSupport\_ edge}(G, q)| + |\operatorname {flux\_ XSupport\_ edge}(G, p)|. \]
Theorem 359 Flux Symplectic Zero

The symplectic form is zero for \(Z\)-type operators:

\[ \operatorname {flux\_ symplectic}(G, p, q) = 0. \]
Proof

By simplification using the definition of flux_symplectic and the fact that both \(X\)-supports are empty, the cardinalities are both \(0\), so the sum is \(0\).

Theorem 360 Flux Operators Commute

Two flux operators commute: \([B_p, B_q] = 0\) since \(\omega (B_p, B_q) = 0\) (\(Z\)-type operators always commute). Formally:

\[ \operatorname {flux\_ symplectic}(G, p, q) \bmod 2 = 0. \]
Proof

By simplification using the fact that flux_symplectic_zero gives \(\operatorname {flux\_ symplectic}(G, p, q) = 0\), the result \(0 \bmod 2 = 0\) follows immediately.

Definition 361 Cycle Edges Incident to Vertex
#

The set of edges that are both in cycle \(p\) and incident to vertex \(v\):

\[ \operatorname {cycleEdgesIncidentTo}(G, p, v) := \{ e \in \operatorname {cycles}(G, p) \mid \operatorname {isIncident}(e, v)\} . \]
Definition 362 Flux–Gauss Law Symplectic Form

The symplectic form between a flux operator \(B_p\) and a Gauss law operator \(A_v\):

\[ \omega (B_p, A_v) = |\operatorname {cycleEdgesIncidentTo}(G, p, v)|, \]

i.e., the number of edges in cycle \(p\) that are incident to vertex \(v\).

Theorem 363 Cycle Edges Incident Cardinality Even

The number of edges in a cycle incident to any vertex is even (0 or 2). For a cycle \(p\) and vertex \(v\), if

\[ |\operatorname {cycleEdgesIncidentTo}(G, p, v)| = 0 \quad \text{or} \quad |\operatorname {cycleEdgesIncidentTo}(G, p, v)| = 2, \]

then

\[ |\operatorname {cycleEdgesIncidentTo}(G, p, v)| \bmod 2 = 0. \]
Proof

We consider two cases from the hypothesis. Case 1: if the cardinality is \(0\), then \(0 \bmod 2 = 0\) follows by simplification. Case 2: if the cardinality is \(2\), then \(2 \bmod 2 = 0\) follows by simplification.

Theorem 364 Flux Commutes with Gauss Law

Flux operators commute with Gauss law operators. Given the cycle validity hypothesis that each vertex has an even number of incident edges from the cycle:

\[ |\operatorname {cycleEdgesIncidentTo}(G, p, v)| \bmod 2 = 0 \implies \omega (B_p, A_v) \bmod 2 = 0. \]
Proof

By simplification using the definition of flux_gaussLaw_symplectic, the goal reduces to the hypothesis \(|\operatorname {cycleEdgesIncidentTo}(G, p, v)| \bmod 2 = 0\), which is exactly the given assumption.

Theorem 365 Flux Eigenvalue on Zero State

In the computational basis, \(\lvert 0\rangle \) is a \(+1\) eigenstate of \(Z\). The eigenvalue of \(B_p\) on \(\lvert 0\rangle ^{\otimes E}\) is \((+1)^{|p|} = +1\). In \(\mathbb {Z}/2\mathbb {Z}\), the phase contribution from \(Z\) operators on \(\lvert 0\rangle \) states is \(0\):

\[ \sum _{e \in \operatorname {cycles}(G,p)} 0 = 0. \]
Proof

By simplification, a sum of zeros over any index set equals zero.

Definition 366 Initial Edge Stabilizer Outcome
#

The initial stabilizer condition: each edge qubit in state \(\lvert 0\rangle \) is stabilized by \(Z_e\). Represented as \(Z\lvert 0\rangle = +\lvert 0\rangle \), so the measurement outcome is \(0\) (for \(+1\)) in \(\mathbb {Z}/2\mathbb {Z}\):

\[ \operatorname {initialEdgeStabilizerOutcome}(e) := 0. \]
Theorem 367 Flux Stabilizes Initial State

Product of initial stabilizer outcomes for \(B_p\) is \(+1\) (represented as \(0\) in \(\mathbb {Z}/2\mathbb {Z}\)):

\[ \sum _{e \in \operatorname {cycles}(G,p)} \operatorname {initialEdgeStabilizerOutcome}(e) = 0. \]
Proof

By simplification using the definition of initialEdgeStabilizerOutcome (which is identically \(0\)), the sum reduces to \(0\).

Theorem 368 Flux Operator Edge Support Equals Second Boundary

The edge support of \(B_p\) equals the second boundary of the basis vector at \(p\):

\[ \operatorname {fluxOperator\_ edgeSupport}(G, p) = \partial _2(\mathbf{e}_p). \]
Proof

By simplification using the definition of fluxOperator_edgeSupport, the left-hand side unfolds to \(\operatorname {boundary2OfCycle}(G, p)\). Rewriting using boundary2Map_basisC, which states that \(\partial _2(\mathbf{e}_p) = \operatorname {boundary2OfCycle}(G, p)\), the result follows.

Theorem 369 Flux Operator Edge Support Characteristic

The flux operator support is exactly the characteristic vector of the cycle. For all edges \(e\):

\[ \operatorname {fluxOperator\_ edgeSupport}(G, p)(e) = \begin{cases} 1 & \text{if } e \in \operatorname {cycles}(G, p), \\ 0 & \text{otherwise.}\end{cases} \]
Proof

Let \(e\) be an arbitrary edge. The result follows directly from fluxOperator_edgeSupport_apply.

Theorem 370 Flux Operator Edge Support Size

The support size of \(B_p\) on edge qubits equals the size of cycle \(p\):

\[ |\{ e \in E \mid \operatorname {fluxOperator\_ edgeSupport}(G, p)(e) = 1\} | = |\operatorname {cycles}(G, p)|. \]
Proof

We show the two finsets are equal by applying congr 1 and then extensionality. For an arbitrary edge \(e\), using membership in the universal finset and filter, together with fluxOperator_edgeSupport_apply, we split on whether \(e \in \operatorname {cycles}(G, p)\). In the positive case, the support value is \(1\), so membership holds by simplification. In the negative case, the support value is \(0 \neq 1\), so non-membership holds by simplification.

Definition 371 Flux Operator Weight
#

The weight of flux operator \(B_p\), defined as the number of edges in cycle \(p\):

\[ \operatorname {fluxOperator\_ weight}(G, p) := |\operatorname {cycles}(G, p)|. \]
Theorem 372 Flux Operator Weight Equals Support

The weight equals the support size:

\[ \operatorname {fluxOperator\_ weight}(G, p) = |\{ e \in E \mid \operatorname {fluxOperator\_ edgeSupport}(G, p)(e) = 1\} |. \]
Proof

Rewriting using fluxOperator_edgeSupport_size, the right-hand side becomes \(|\operatorname {cycles}(G,p)|\), which equals the left-hand side by definition (rfl).

Lemma 373 Flux Product Edge Support

The sum (product) of edge supports of two flux operators corresponds to the symmetric difference. For any edge \(e\):

\[ (\operatorname {fluxOperator\_ edgeSupport}(G, p) + \operatorname {fluxOperator\_ edgeSupport}(G, q))(e) = \begin{cases} 1 & \text{if } (e \in \operatorname {cycles}(G,p)) \neq (e \in \operatorname {cycles}(G,q)), \\ 0 & \text{otherwise.}\end{cases} \]
Proof

By simplification using pointwise addition and fluxOperator_edgeSupport_apply, we case-split on whether \(e \in \operatorname {cycles}(G,p)\) and \(e \in \operatorname {cycles}(G,q)\). In each of the four cases:

  • \(e \in p\), \(e \in q\): the XOR condition is false, and \(1 + 1 = 0\) in \(\mathbb {Z}/2\mathbb {Z}\), by reflexivity.

  • \(e \in p\), \(e \notin q\): the XOR condition is true, and \(1 + 0 = 1\), verified by computation.

  • \(e \notin p\), \(e \in q\): the XOR condition is true, and \(0 + 1 = 1\), verified by computation.

  • \(e \notin p\), \(e \notin q\): the XOR condition is false, and \(0 + 0 = 0\), by simplification.

Definition 374 Flux Z-Support
#

The \(Z\)-support of \(B_p\) on edges (edges in cycle \(p\)):

\[ \operatorname {flux\_ ZSupport}(G, p) := \operatorname {cycles}(G, p). \]
Definition 375 Gauss Law X-Support
#

The \(X\)-support of \(A_v\) on edges (edges incident to \(v\)):

\[ \operatorname {gaussLaw\_ XSupport}(G, v) := \operatorname {incidentEdges}(G, v). \]
Definition 376 Flux–Gauss Law Intersection

The intersection of the \(Z\)-support of \(B_p\) and the \(X\)-support of \(A_v\):

\[ \operatorname {flux\_ gaussLaw\_ intersection}(G, p, v) := \operatorname {flux\_ ZSupport}(G, p) \cap \operatorname {gaussLaw\_ XSupport}(G, v). \]
Theorem 377 Flux–Gauss Law Intersection Equals Cycle Edges Incident

The intersection equals the cycle edges incident to \(v\):

\[ \operatorname {flux\_ gaussLaw\_ intersection}(G, p, v) = \operatorname {cycleEdgesIncidentTo}(G, p, v). \]
Proof

By extensionality on an arbitrary edge \(e\). Unfolding the definitions of flux_gaussLaw_intersection, flux_ZSupport, gaussLaw_XSupport, cycleEdgesIncidentTo, and incidentEdges, membership in the intersection of two finsets and membership in a filtered finset both reduce to the conjunction of \(e \in \operatorname {cycles}(G,p)\) and \(\operatorname {isIncident}(e, v)\), by simplification.

Theorem 378 Flux–Gauss Law Symplectic Equals Intersection Cardinality

The symplectic form equals the cardinality of the intersection:

\[ \omega (B_p, A_v) = |\operatorname {flux\_ gaussLaw\_ intersection}(G, p, v)|. \]
Proof

By simplification using flux_gaussLaw_symplectic and flux_gaussLaw_intersection_eq, the result follows directly.

Theorem 379 Flux is Z-Type on Vertices

\(B_p\) is purely \(Z\)-type: no \(X\) support on vertices. For all \(v \in V\):

\[ \operatorname {fluxOperator\_ vertexSupport}(G, p)(v) = 0. \]
Proof

Let \(v\) be an arbitrary vertex. This holds by reflexivity, since the vertex support is defined to be identically zero.

Theorem 380 Flux is Z-Type on Edges

\(B_p\) is purely \(Z\)-type: no \(X\) support on edges:

\[ \operatorname {flux\_ XSupport\_ edge}(G, p) = \emptyset . \]
Proof

This holds by reflexivity, since the \(X\)-support on edges is defined to be the empty set.

Theorem 381 Gauss Law is X-Type

\(A_v\) is \(X\)-type (\(Z\)-support empty):

\[ \operatorname {gaussLaw\_ ZSupport\_ vertex}(G, v) = \emptyset \quad \text{and} \quad \operatorname {gaussLaw\_ ZSupport\_ edge}(G, v) = \emptyset . \]
Proof

Both components hold by reflexivity, since both \(Z\)-supports are defined to be empty sets. We verify both conditions by the constructor and rfl for each.

Theorem 382 Flux is Z-Type

\(B_p\) is \(Z\)-type (\(X\)-support empty):

\[ \operatorname {flux\_ XSupport\_ vertex}(G, p) = \emptyset \quad \text{and} \quad \operatorname {flux\_ XSupport\_ edge}(G, p) = \emptyset . \]
Proof

Both components hold by reflexivity, since both \(X\)-supports are defined to be empty sets. We verify both conditions by the constructor and rfl for each.

Theorem 383 Flux–Gauss Law Symplectic Characterization

The symplectic form \(\omega (B_p, A_v)\) counts edges in cycle \(p\) incident to \(v\):

\[ \omega (B_p, A_v) = |\operatorname {cycleEdgesIncidentTo}(G, p, v)|. \]
Proof

This holds by reflexivity (definitional equality).

Definition 384 Valid Cycle
#

A cycle \(p\) is valid if every vertex has \(0\) or \(2\) incident edges from the cycle:

\[ \operatorname {IsValidCycle}(G, p) \iff \forall v \in V,\; |\operatorname {cycleEdgesIncidentTo}(G, p, v)| = 0 \; \lor \; |\operatorname {cycleEdgesIncidentTo}(G, p, v)| = 2. \]
Theorem 385 Flux Commutes with All Gauss Law Operators

For valid cycles, flux operators commute with all Gauss law operators. If \(p\) is a valid cycle, then for all \(v \in V\):

\[ \omega (B_p, A_v) \bmod 2 = 0. \]
Proof

Let \(v\) be an arbitrary vertex. We apply flux_commutes_with_gaussLaw to \(G\), \(p\), \(v\), supplying the hypothesis that \(|\operatorname {cycleEdgesIncidentTo}(G, p, v)| \bmod 2 = 0\). This hypothesis is obtained from cycleEdgesIncidentTo_card_even applied to \(G\), \(p\), \(v\), and the validity condition \(h\_ {\text{valid}}(v)\) which gives \(|\operatorname {cycleEdgesIncidentTo}(G, p, v)| \in \{ 0, 2\} \).

Theorem 386 Euler’s Formula for Cycles

Euler’s formula for connected graphs: the cycle rank (first Betti number) is \(|E| - |V| + 1\). If \(|V| \le |E|\) and \(|C| = |E| - |V| + 1\) (as natural numbers), then:

\[ (|C| : \mathbb {Z}) = \operatorname {independentCycleCount}. \]
Proof

By simplification using the definition of independentCycleCount. Rewriting with the hypothesis \(|C| = |E| - |V| + 1\), and using that natural number casts distribute over addition and that \(1\) maps to \(1\), it suffices to show the cast of the natural number subtraction equals the integer subtraction. Using congr 1, this reduces to \(\operatorname {Int.ofNat}(|E| - |V|) = (|E| : \mathbb {Z}) - (|V| : \mathbb {Z})\), which follows from Int.ofNat_sub applied to the hypothesis \(|V| \le |E|\).