MerLean-example

9 Def 4: Deformed Code

Definition 169 Deformed Check
#

Given a graph \(G = (V, E)\), an original check \(s \in \mathcal{P}_V\) (a Pauli operator on \(V\)), and an edge-path \(\gamma : E(G) \to \mathbb {Z}_2\) satisfying the boundary condition, the deformed check is the deformed operator extension of \(s\) by \(\gamma \):

\[ \tilde{s} := \widetilde{s}^{(\gamma )} = \operatorname {deformedOpExt}(G, s, \gamma ). \]
Theorem 170 Deformed Check with No Z-Support

If \(s\) has no \(Z\)-support on \(V\), then the deformed check with \(\gamma = 0\) satisfies

\[ \operatorname {deformedCheck}(G, s, 0) = \operatorname {deformedOpExt}(G, s, 0). \]

That is, when \(s\) has no \(Z\)-support, the zero edge-path suffices and the deformed check acts as \(s\) on vertex qubits and as the identity on edge qubits.

Proof

This holds by definitional equality (reflexivity), since \(\operatorname {deformedCheck}\) is defined as \(\operatorname {deformedOpExt}\).

Theorem 171 Deformed Check Commutes with Gauss’s Law

Let \(s\) be a Pauli operator on \(V\), \(\gamma : E(G) \to \mathbb {Z}_2\) an edge-path satisfying the boundary condition \(\partial \gamma = S_Z(s)|_V\), and \(v \in V\). Then the deformed check \(\tilde{s}\) commutes with the Gauss’s law operator \(A_v\):

\[ [\tilde{s},\, A_v] = 0. \]
Proof

This follows directly from the theorem that the deformed operator extension commutes with Gauss’s law when the boundary condition holds.

Theorem 172 Deformed Check is Self-Inverse

For any Pauli operator \(s\) on \(V\) and edge-path \(\gamma : E(G) \to \mathbb {Z}_2\), the deformed check is self-inverse:

\[ \tilde{s} \cdot \tilde{s} = \mathbf{1}. \]
Proof

This follows directly from the self-inverse property of the deformed operator extension.

Definition 173 Deformed Code Data
#

The deformed code data consists of:

  • For each original check index \(j \in J\), an edge-path \(\gamma _j : E(G) \to \mathbb {Z}_2\).

  • For each \(j \in J\), a proof that the boundary condition holds: \(\partial \gamma _j = S_Z(s_j)|_V\).

Definition 174 Gauss’s Law Checks

The Gauss’s law checks on the extended qubit system \(V \oplus E(G)\) are defined by

\[ A_v := \operatorname {gaussLawOp}(G, v) \]

for each vertex \(v \in V\).

Definition 175 Flux Checks
#

The flux checks on the extended qubit system \(V \oplus E(G)\) are defined by

\[ B_p := \operatorname {fluxOp}(G, \mathrm{cycles}, p) \]

for each cycle \(p \in C\).

Definition 176 Deformed Original Checks

The deformed original checks \(\tilde{s}_j\) for each \(j \in J\) are defined using the edge-paths from the deformed code data:

\[ \tilde{s}_j := \operatorname {deformedCheck}(G,\, s_j,\, \gamma _j) \]

where \(\gamma _j\) is the edge-path provided by the deformed code data.

Definition 177 Check Index Type
#

The check index type for the deformed code is the inductive type \(\operatorname {CheckIndex}(V, C, J)\) with three constructors:

  • \(\operatorname {gaussLaw}(v)\) for \(v \in V\), indexing the Gauss’s law checks,

  • \(\operatorname {flux}(p)\) for \(p \in C\), indexing the flux checks,

  • \(\operatorname {deformed}(j)\) for \(j \in J\), indexing the deformed original checks.

This type is equivalent to the sum type \(V \oplus C \oplus J\).

Definition 178 All Checks Map

The full set of checks for the deformed code is the function

\[ \operatorname {allChecks} : \operatorname {CheckIndex}(V, C, J) \to \mathcal{P}_{V \oplus E(G)} \]

defined by:

\begin{align*} \operatorname {allChecks}(\operatorname {gaussLaw}(v)) & = A_v, \\ \operatorname {allChecks}(\operatorname {flux}(p)) & = B_p, \\ \operatorname {allChecks}(\operatorname {deformed}(j)) & = \tilde{s}_j. \end{align*}
Theorem 179 Gauss–Gauss Commutation

For all \(v, w \in V\), the Gauss’s law checks commute:

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

This follows directly from the commutation of Gauss’s law operators (Theorem 117).

Theorem 180 Flux–Flux Commutation

For all \(p, q \in C\), the flux checks commute:

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

This follows directly from the commutation of flux operators (Theorem 118).

Theorem 181 Gauss–Flux Commutation

Assume that for every cycle \(c \in C\) and vertex \(v \in V\), the number of edges in the cycle incident to \(v\) is even. Then for all \(v \in V\) and \(p \in C\), the Gauss’s law and flux checks commute:

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

This follows directly from the Gauss–flux commutation theorem (Theorem 120).

For any deformed code data, for all \(v \in V\) and \(j \in J\), the Gauss’s law checks commute with the deformed original checks:

\[ [A_v,\, \tilde{s}_j] = 0. \]
Proof

By the commutativity of Pauli commutation (i.e., \([A, B] = 0 \Leftrightarrow [B, A] = 0\)), it suffices to show that \(\tilde{s}_j\) commutes with \(A_v\). This follows directly from the theorem that the deformed operator extension commutes with Gauss’s law when the boundary condition holds, which is guaranteed by the deformed code data.

For any deformed code data, for all \(j \in J\) and \(p \in C\), the deformed original checks commute with the flux checks:

\[ [\tilde{s}_j,\, B_p] = 0. \]

This holds because flux operators are pure \(Z\)-type and deformed checks have no \(X\)-support on edges.

Proof

We unfold the definitions of the deformed original checks, deformed check, and flux checks, and express the Pauli commutation condition in terms of the symplectic inner product. We decompose the sum over the extended qubit system \(V \oplus E(G)\) into the vertex part and the edge part using \(\operatorname {Fintype.sum\_ sum\_ type}\).

Vertex part: We show that

\[ \sum _{v \in V} \bigl( x_{\tilde{s}_j}(v) \cdot z_{B_p}(v) + z_{\tilde{s}_j}(v) \cdot x_{B_p}(v) \bigr) = 0. \]

For each vertex \(v\), by the definitions of \(\operatorname {deformedOpExt}\) and \(\operatorname {fluxOp}\), we have \(z_{B_p}(v) = 0\) and \(x_{B_p}(v) = 0\) on vertex qubits, so each summand vanishes. By summing zero terms, the vertex contribution is \(0\).

We rewrite using \(0 + (\text{edge sum}) = (\text{edge sum})\).

Edge part: We show that

\[ \sum _{e \in E(G)} \bigl( x_{\tilde{s}_j}(e) \cdot z_{B_p}(e) + z_{\tilde{s}_j}(e) \cdot x_{B_p}(e) \bigr) = 0. \]

For each edge \(e\), by the definitions of \(\operatorname {deformedOpExt}\) and \(\operatorname {fluxOp}\), the deformed check has \(x_{\tilde{s}_j}(e) = 0\) on edge qubits (no \(X\)-support on edges), and the flux operator has \(x_{B_p}(e) = 0\) (pure \(Z\)-type). Thus each summand vanishes, and the edge contribution is \(0\).

Assume that the original checks pairwise commute: for all \(i, j \in J\), \([s_i, s_j] = 0\). Then for any deformed code data and all \(i, j \in J\), the deformed original checks commute:

\[ [\tilde{s}_i,\, \tilde{s}_j] = 0. \]

On edges both deformed checks are pure \(Z\)-type (\(Z\) commutes with \(Z\)); on vertices the commutation is inherited from the original checks.

Proof

We unfold the definitions of the deformed original checks and deformed check, and express the Pauli commutation condition via the symplectic inner product. We decompose the sum over \(V \oplus E(G)\) into the vertex and edge parts.

Edge part: We show that

\[ \sum _{e \in E(G)} \bigl( x_{\tilde{s}_i}(e) \cdot z_{\tilde{s}_j}(e) + z_{\tilde{s}_i}(e) \cdot x_{\tilde{s}_j}(e) \bigr) = 0. \]

For each edge \(e\), by the definition of \(\operatorname {deformedOpExt}\), both deformed checks have \(x_{\tilde{s}_k}(e) = 0\) on edge qubits. Thus each summand vanishes and the edge sum is \(0\).

Vertex part: We show that

\[ \sum _{v \in V} \bigl( x_{\tilde{s}_i}(v) \cdot z_{\tilde{s}_j}(v) + z_{\tilde{s}_i}(v) \cdot x_{\tilde{s}_j}(v) \bigr) = 0. \]

From the hypothesis, the original checks \(s_i\) and \(s_j\) commute, i.e., \(\langle s_i, s_j \rangle _{\mathrm{symp}} = 0\). Since the deformed operator extension on vertex qubits agrees with the original operator, the vertex sum equals the symplectic inner product of the original checks, which is \(0\) by hypothesis. We use convert to match the goal with the hypothesis \(h_{ij}\).

Combining both parts: the total symplectic inner product is \(0 + 0 = 0\).

Assume that:

  1. For every cycle \(c \in C\) and vertex \(v \in V\), the number of edges in the cycle incident to \(v\) is even.

  2. The original checks pairwise commute: for all \(i, j \in J\), \([s_i, s_j] = 0\).

Then all checks in the deformed code pairwise commute: for all \(a, b \in \operatorname {CheckIndex}(V, C, J)\),

\[ [\operatorname {allChecks}(a),\, \operatorname {allChecks}(b)] = 0. \]
Proof

We proceed by case analysis on the check indices \(a\) and \(b\).

Case \(a = \operatorname {gaussLaw}(v)\):

  • If \(b = \operatorname {gaussLaw}(w)\): by Gauss–Gauss commutation.

  • If \(b = \operatorname {flux}(p)\): by Gauss–flux commutation.

  • If \(b = \operatorname {deformed}(j)\): by Gauss–deformed commutation.

Case \(a = \operatorname {flux}(p)\):

  • If \(b = \operatorname {gaussLaw}(v)\): by commutativity of Pauli commutation and Gauss–flux commutation.

  • If \(b = \operatorname {flux}(q)\): by flux–flux commutation.

  • If \(b = \operatorname {deformed}(j)\): by commutativity of Pauli commutation and deformed–flux commutation.

Case \(a = \operatorname {deformed}(i)\):

  • If \(b = \operatorname {gaussLaw}(v)\): by commutativity of Pauli commutation and Gauss–deformed commutation.

  • If \(b = \operatorname {flux}(p)\): by deformed–flux commutation.

  • If \(b = \operatorname {deformed}(j)\): by deformed–deformed commutation.

Theorem 186 Gauss’s Law Checks are Self-Inverse

For all \(v \in V\), the Gauss’s law check is self-inverse:

\[ A_v \cdot A_v = \mathbf{1}. \]
Proof

This follows directly from the fact that every Pauli operator is self-inverse (\(P \cdot P = \mathbf{1}\)).

Theorem 187 Flux Checks are Self-Inverse

For all \(p \in C\), the flux check is self-inverse:

\[ B_p \cdot B_p = \mathbf{1}. \]
Proof

This follows directly from the self-inverse property of Pauli operators.

Theorem 188 Deformed Original Checks are Self-Inverse

For any deformed code data and all \(j \in J\), the deformed original check is self-inverse:

\[ \tilde{s}_j \cdot \tilde{s}_j = \mathbf{1}. \]
Proof

This follows from the self-inverse property of the deformed check applied to \(s_j\) and \(\gamma _j\).

For any deformed code data and all check indices \(a \in \operatorname {CheckIndex}(V, C, J)\),

\[ \operatorname {allChecks}(a) \cdot \operatorname {allChecks}(a) = \mathbf{1}. \]
Proof

We proceed by case analysis on \(a\):

  • If \(a = \operatorname {gaussLaw}(v)\): by self-inverse property of Gauss’s law checks.

  • If \(a = \operatorname {flux}(p)\): by self-inverse property of flux checks.

  • If \(a = \operatorname {deformed}(j)\): by self-inverse property of deformed original checks.

Theorem 190 Gauss’s Law Checks are Pure X-Type

For all \(v \in V\), the Gauss’s law check \(A_v\) is pure \(X\)-type, i.e., it has no \(Z\)-support:

\[ z_{A_v} = 0. \]
Proof

This follows directly from the fact that the Gauss’s law operator has zero \(Z\)-vector.

Theorem 191 Flux Checks are Pure Z-Type

For all \(p \in C\), the flux check \(B_p\) is pure \(Z\)-type, i.e., it has no \(X\)-support:

\[ x_{B_p} = 0. \]
Proof

This follows directly from the fact that the flux operator has zero \(X\)-vector.

Theorem 192 Product of Gauss’s Law Checks Equals Logical Operator

The product of all Gauss’s law checks equals the logical operator \(L\):

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

We convert the goal to the statement of the Gauss’s law product theorem and apply it directly.

Definition 193 Constructor for Deformed Code Data

Given edge-paths \(\gamma _j : E(G) \to \mathbb {Z}_2\) for each \(j \in J\) and proofs that the boundary condition \(\partial \gamma _j = S_Z(s_j)|_V\) holds for each \(j\), construct the deformed code data.

Definition 194 Constructor for No Z-Support Case

When all original checks \(s_j\) have no \(Z\)-support on \(V\), the deformed code data can be constructed by setting all edge-paths to zero: \(\gamma _j = 0\) for all \(j \in J\). The boundary condition is satisfied because the zero edge-path has zero boundary, which equals the (empty) \(Z\)-support restriction when there is no \(Z\)-support.

The weight of the flux check \(B_p\) equals the number of edges in the cycle \(p\):

\[ \operatorname {wt}(B_p) = |\{ e \in E(G) : e \in p\} |. \]
Proof

We unfold the definitions of the flux checks and Pauli operator weight.

First, we establish that \(B_p\) has no \(X\)-support: \(\operatorname {supportX}(B_p) = \emptyset \), which follows from the fact that flux operators are pure \(Z\)-type.

Next, we characterize the \(Z\)-support of \(B_p\). By extensionality, for each qubit \(q\) in the extended system \(V \oplus E(G)\):

  • If \(q = \operatorname {inl}(v)\) for some vertex \(v\): the \(Z\)-component of \(\operatorname {fluxOp}\) is \(0\) on vertices, so \(q \notin \operatorname {supportZ}(B_p)\). No edge maps to a vertex under \(\operatorname {inr}\), confirming both directions of the equivalence.

  • If \(q = \operatorname {inr}(e)\) for some edge \(e\): \(q \in \operatorname {supportZ}(B_p)\) if and only if \(e \in p\). In the forward direction, if \(e \notin p\) then by definition of \(\operatorname {fluxOp}\) the \(Z\)-component is \(0\), a contradiction. In the reverse direction, if \(e \in p\) then the \(Z\)-component is \(1 \neq 0\).

Thus \(\operatorname {supportZ}(B_p) = \operatorname {inr}(\{ e \in E(G) : e \in p\} )\), i.e., it is the image of the set of edges in the cycle under the embedding \(\operatorname {inr}\).

Since \(\operatorname {support}(B_p) = \operatorname {supportX}(B_p) \cup \operatorname {supportZ}(B_p) = \emptyset \cup \operatorname {supportZ}(B_p) = \operatorname {supportZ}(B_p)\), the weight equals \(|\operatorname {supportZ}(B_p)|\). Since \(\operatorname {inr}\) is injective, \(|\operatorname {inr}(\{ e \in E(G) : e \in p\} )| = |\{ e \in E(G) : e \in p\} |\).

Definition 196 Deformed Code Checks

The generating checks for the deformed code on the extended qubit system \(V \oplus E(G)\) is the main definition from Definition 4 of the paper. It is the function

\[ \operatorname {deformedCodeChecks} : \operatorname {CheckIndex}(V, C, J) \to \mathcal{P}_{V \oplus E(G)} \]

defined as \(\operatorname {allChecks}(G, \mathrm{cycles}, \mathrm{checks}, \mathrm{data})\), mapping:

\begin{align*} \operatorname {gaussLaw}(v) & \mapsto A_v \quad \text{(Gauss's law operator for vertex } v\text{)}, \\ \operatorname {flux}(p) & \mapsto B_p \quad \text{(flux operator for cycle } p\text{)}, \\ \operatorname {deformed}(j) & \mapsto \tilde{s}_j \quad \text{(deformed original check for index } j\text{)}. \end{align*}

I’ll start by reading the Lean file to understand its contents.This is the root import file for the QEC1 library. It simply imports all the other modules and doesn’t contain any definitions, theorems, or lemmas of its own. Since there are no declarations to translate, I should not generate any LaTeX output for this file — it’s just an organizational file that aggregates imports.

However, since the instructions say each file becomes its own chapter, and this file has no mathematical content, let me produce a minimal chapter that documents it as the root module: