9 Def 4: Deformed Code
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 \):
If \(s\) has no \(Z\)-support on \(V\), then the deformed check with \(\gamma = 0\) satisfies
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.
This holds by definitional equality (reflexivity), since \(\operatorname {deformedCheck}\) is defined as \(\operatorname {deformedOpExt}\).
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\):
This follows directly from the theorem that the deformed operator extension commutes with Gauss’s law when the boundary condition holds.
For any Pauli operator \(s\) on \(V\) and edge-path \(\gamma : E(G) \to \mathbb {Z}_2\), the deformed check is self-inverse:
This follows directly from the self-inverse property of the deformed operator extension.
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\).
The Gauss’s law checks on the extended qubit system \(V \oplus E(G)\) are defined by
for each vertex \(v \in V\).
The flux checks on the extended qubit system \(V \oplus E(G)\) are defined by
for each cycle \(p \in C\).
The deformed original checks \(\tilde{s}_j\) for each \(j \in J\) are defined using the edge-paths from the deformed code data:
where \(\gamma _j\) is the edge-path provided by the deformed code data.
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\).
The full set of checks for the deformed code is the function
defined by:
For all \(v, w \in V\), the Gauss’s law checks commute:
This follows directly from the commutation of Gauss’s law operators (Theorem 117).
For all \(p, q \in C\), the flux checks commute:
This follows directly from the commutation of flux operators (Theorem 118).
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:
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:
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:
This holds because flux operators are pure \(Z\)-type and deformed checks have no \(X\)-support on edges.
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
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
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:
On edges both deformed checks are pure \(Z\)-type (\(Z\) commutes with \(Z\)); on vertices the commutation is inherited from the original checks.
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
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
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:
For every cycle \(c \in C\) and vertex \(v \in V\), the number of edges in the cycle incident to \(v\) is even.
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)\),
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.
For all \(v \in V\), the Gauss’s law check is self-inverse:
This follows directly from the fact that every Pauli operator is self-inverse (\(P \cdot P = \mathbf{1}\)).
For all \(p \in C\), the flux check is self-inverse:
This follows directly from the self-inverse property of Pauli operators.
For any deformed code data and all \(j \in J\), the deformed original check is self-inverse:
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)\),
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.
For all \(v \in V\), the Gauss’s law check \(A_v\) is pure \(X\)-type, i.e., it has no \(Z\)-support:
This follows directly from the fact that the Gauss’s law operator has zero \(Z\)-vector.
For all \(p \in C\), the flux check \(B_p\) is pure \(Z\)-type, i.e., it has no \(X\)-support:
This follows directly from the fact that the flux operator has zero \(X\)-vector.
The product of all Gauss’s law checks equals the logical operator \(L\):
We convert the goal to the statement of the Gauss’s law product theorem and apply it directly.
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.
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\):
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\} |\).
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
defined as \(\operatorname {allChecks}(G, \mathrm{cycles}, \mathrm{checks}, \mathrm{data})\), mapping:
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: