SNAPKITTYWEST commited on
Commit
4ddbfc7
·
verified ·
1 Parent(s): feb1620

Sync from GitHub AHMADALIPARR/cpsc-qft@34c4bab: add paper/PAPER.tex

Browse files
Files changed (3) hide show
  1. README.md +1 -1
  2. paper/PAPER.md +2 -2
  3. paper/PAPER.tex +459 -0
README.md CHANGED
@@ -15,7 +15,7 @@ tags:
15
  - quantum-computing
16
  ---
17
 
18
- > Mirrored from [https://github.com/AHMADALIPARR/cpsc-qft](https://github.com/AHMADALIPARR/cpsc-qft) at commit `9b102cf`. Part of the **SnapKitty October 2026 main drop**. Paper: [Snapkitty/cpsc-qft-paper](https://huggingface.co/datasets/Snapkitty/cpsc-qft-paper).
19
 
20
  <!--
21
  Copyright (c) 2026 Ahmad Ali Parr and others.
 
15
  - quantum-computing
16
  ---
17
 
18
+ > Mirrored from [https://github.com/AHMADALIPARR/cpsc-qft](https://github.com/AHMADALIPARR/cpsc-qft) at commit `34c4bab`. Part of the **SnapKitty October 2026 main drop**. Paper: [Snapkitty/cpsc-qft-paper](https://huggingface.co/datasets/Snapkitty/cpsc-qft-paper).
19
 
20
  <!--
21
  Copyright (c) 2026 Ahmad Ali Parr and others.
paper/PAPER.md CHANGED
@@ -7,7 +7,7 @@ SPDX-License-Identifier: LicenseRef-CPSC-ESCL-1.0 OR AGPL-3.0-only
7
 
8
  Ahmad Ali Parr · 10 October 2026
9
 
10
- **Read the paper: [PAPER.pdf](PAPER.pdf)** (source: [PAPER.tex](PAPER.tex)). Build with `latexmk -xelatex PAPER.tex`.
11
 
12
  ## Abstract
13
 
@@ -25,7 +25,7 @@ theorem admitted_trotter_commutes (mode : CPSC.Mode) (ι : R) (ang : Angles R)
25
 
26
  Rejection is not vacuous. When sin θ ≠ 0, a transverse rotation moves magnetization (`rx_not_comm_Mag`) and a lone Z rotation breaks ∏ X (`rz_not_comm_PiX`).
27
 
28
- Appendix A of the paper gives each proof in ordinary mathematics and names the Lean theorem that checks it. Appendix B maps the Lean files. Informal sketches are also in [OPERATOR_PROOFS.md](OPERATOR_PROOFS.md).
29
 
30
  ## Reproduce
31
 
 
7
 
8
  Ahmad Ali Parr · 10 October 2026
9
 
10
+ **The paper is [PAPER.tex](PAPER.tex).** Build with `latexmk -xelatex PAPER.tex` (or lualatex). Informal sketches of the same proofs are in [OPERATOR_PROOFS.md](OPERATOR_PROOFS.md).
11
 
12
  ## Abstract
13
 
 
25
 
26
  Rejection is not vacuous. When sin θ ≠ 0, a transverse rotation moves magnetization (`rx_not_comm_Mag`) and a lone Z rotation breaks ∏ X (`rz_not_comm_PiX`).
27
 
28
+ Appendix A of PAPER.tex gives each proof in ordinary mathematics and names the Lean theorem that checks it. Appendix B maps the Lean files.
29
 
30
  ## Reproduce
31
 
paper/PAPER.tex ADDED
@@ -0,0 +1,459 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ % Copyright (c) 2026 Ahmad Ali Parr and others.
2
+ % SPDX-License-Identifier: LicenseRef-CPSC-ESCL-1.0 OR AGPL-3.0-only
3
+ %
4
+ % Build: latexmk -xelatex PAPER.tex (lualatex also works)
5
+ \documentclass[11pt]{article}
6
+
7
+ \usepackage[a4paper,margin=2.5cm]{geometry}
8
+ \usepackage{amsmath,amsthm}
9
+ \usepackage{unicode-math}
10
+ \setmainfont{Latin Modern Roman}
11
+ \setmathfont{Latin Modern Math}
12
+ \setmonofont{DejaVu Sans Mono}[Scale=0.82]
13
+ \usepackage{microtype}
14
+ \usepackage{booktabs}
15
+ \usepackage{array}
16
+ \usepackage{float}
17
+ \newcolumntype{L}[1]{>{\raggedright\arraybackslash}p{#1}}
18
+ \setlength{\emergencystretch}{2em}
19
+ \usepackage{enumitem}
20
+ \usepackage{fancyvrb}
21
+ \usepackage{xcolor}
22
+ \usepackage[font=small,labelfont=bf]{caption}
23
+ \usepackage[colorlinks=true,linkcolor=blue!50!black,citecolor=blue!50!black,urlcolor=blue!50!black]{hyperref}
24
+
25
+ \newtheorem{theorem}{Theorem}[section]
26
+ \newtheorem{proposition}[theorem]{Proposition}
27
+ \newtheorem{lemma}[theorem]{Lemma}
28
+ \newtheorem{corollary}[theorem]{Corollary}
29
+ \theoremstyle{definition}
30
+ \newtheorem{definition}[theorem]{Definition}
31
+
32
+ \newcommand{\lean}[1]{\texttt{#1}}
33
+ \newcommand{\leanref}[1]{\par\smallskip\noindent{\small\textit{Lean:} \lean{#1}}}
34
+ \newcommand{\PiX}{\Pi_X}
35
+ \newcommand{\Mag}{M}
36
+ \newcommand{\sgn}{\operatorname{sgn}}
37
+
38
+ \fvset{fontsize=\small,frame=single,framesep=2mm,rulecolor=\color{black!30}}
39
+
40
+ \title{Conservation-Preserving Compilation for a 1+1D Lattice Shadow of $\phi^4$}
41
+ \author{Ahmad Ali Parr}
42
+ \date{10 October 2026}
43
+
44
+ \begin{document}
45
+ \maketitle
46
+
47
+ \begin{abstract}
48
+ \noindent
49
+ We implement a compilation architecture for lattice scattering in which the symmetries of the target Hamiltonian constrain circuit synthesis rather than filter measured shots. The working model is the periodic transverse-field Ising chain, the qubit shadow of 1+1D $\phi^4$, not continuum $\phi^4$.
50
+
51
+ Two facts fix the compiler. The quartic written as $\sum_i X_i^4$ is a multiple of the identity. Z-parity is a symmetry only at $\lambda = 0$; for $\lambda \neq 0$ the conserved operator is the global spin flip $\prod_i X_i$.
52
+
53
+ The repository supplies a symmetry analyzer, a translation-orbit check, a first-order Trotter product of admitted gates, a Q\# emission of those factors, and a certificate whose SHA-256 digest is bound to the gate list. On a 4-site chain the Ising schedule has Z-parity leakage 0, and the spin-flip schedule has $\prod X$ leakage 0 within roundoff. Inserting a forbidden gate fails compilation. A Lean development proves, without project axioms, that every admitted Trotter schedule commutes with the conserved operator on $(\mathbb{C}^2)^{\otimes N}$ for every lattice size and every angle.
54
+
55
+ This paper describes what the code does. It proves operator commutation in Lean for every admitted schedule. It does not claim a continuum scattering amplitude.
56
+ \end{abstract}
57
+
58
+ \section{Introduction}
59
+
60
+ NISQ scattering experiments typically evolve a Trotter circuit and then discard shots whose measured quantum numbers disagree with the input state. Post-selection of this kind is a diagnostic. It does not make the illegal amplitude unavailable to the device, and it gives a later hardware rewrite no reason to refuse a gate.
61
+
62
+ The Conservation-Preserving Scattering Compiler (CPSC) inverts that order. A schedule is emitted only if every factor preserves the active symmetry and the gate support is closed under lattice translation. The emitted artifact carries a digest of the schedule, so changing any gate changes the digest and the edited circuit no longer matches its certificate.
63
+
64
+ The target is not continuum $\phi^4$, for which Jordan, Lee, and Preskill gave the first quantum scattering algorithm~\cite{jlp2012,jlp2014}. It is the periodic transverse-field Ising model (TFIM) on $N$ qubits, with indices taken mod $N$:
65
+ \begin{equation}
66
+ H = -J \sum_{i=0}^{N-1} Z_i Z_{i+1} + \lambda \sum_{i=0}^{N-1} X_i .
67
+ \label{eq:H}
68
+ \end{equation}
69
+ The original draft also carried a quartic term $(g/24)\sum_i X_i^4$. Because $X^2 = I$ for a Pauli operator, this term is a constant:
70
+ \begin{equation}
71
+ \frac{g}{24}\sum_{i=0}^{N-1} X_i^4 = \frac{gN}{24}\, I .
72
+ \end{equation}
73
+ It shifts the zero of energy and opens no scattering channel. The implementation records the shift and drops it. A genuine $\phi^4$ interaction requires a truncated-oscillator encoding with more than one qubit per site, which is left to future work (Section~\ref{sec:open}).
74
+
75
+ \paragraph{Contributions.}
76
+ (i) A correct identification of the conserved operator in each coupling regime, with a compile-time mode switch at $\lambda = 0$.
77
+ (ii) A synthesis path that admits only symmetry-preserving, translation-closed factors and has no post-selection step.
78
+ (iii) A SHA-256 certificate bound to the admitted schedule, rendered as a Lean fragment that carries a machine-checked operator commutation theorem (Appendix~\ref{app:proofs}).
79
+ (iv) A Q\# emission whose operations are the hardware image of the admitted factors.
80
+
81
+ \section{Which operator is actually conserved}
82
+ \label{sec:symmetry}
83
+
84
+ The conserved operator depends on $\lambda$: total Z-magnetization at $\lambda = 0$, and the global spin flip $\PiX$ for $\lambda \neq 0$. The draft listed $\Pi_Q = \sum_i Z_i$ as a symmetry of the interacting theory, which is false once $\lambda \neq 0$.
85
+
86
+ \subsection{Magnetization fails at \texorpdfstring{$\lambda \neq 0$}{lambda != 0}}
87
+
88
+ A single $X_j$ anticommutes with $Z_j$ and commutes with every other $Z_i$. Acting on a computational basis state it flips one spin and changes the magnetization by $\pm 2$:
89
+ \begin{equation}
90
+ \Bigl[X_j, \sum_i Z_i\Bigr] = [X_j, Z_j] = -2i\,Y_j \neq 0 .
91
+ \end{equation}
92
+ It also anticommutes with the Z-parity $\prod_i Z_i$. The transverse field is a sum of such terms, so neither magnetization nor Z-parity commutes with $H$ when $\lambda \neq 0$.
93
+
94
+ \subsection{The spin flip is conserved for all \texorpdfstring{$\lambda$}{lambda}}
95
+
96
+ The operator that commutes with both the bonds and the field is
97
+ \begin{equation}
98
+ \PiX = \prod_{i=0}^{N-1} X_i .
99
+ \end{equation}
100
+ Conjugation by $\PiX$ sends each $Z_i$ to $-Z_i$. A bond $Z_a Z_b$ picks up two minus signs and is invariant. Each $X_i$ commutes with $\PiX$ trivially. A lone $Z_i$ picks up one sign and anticommutes. Hence $[H, \PiX] = 0$ for every $J$ and $\lambda$.
101
+
102
+ \subsection{Translation and energy}
103
+
104
+ Translation $T\colon i \mapsto i + 1 \bmod N$ is a symmetry because the couplings are uniform and the lattice is periodic. Energy is not a separate compilation constraint: a time-independent $H$ already satisfies $[H, H] = 0$. A first-order Trotter product does not conserve $H$ exactly, so filtering on $\langle H \rangle$ after a step measures Trotter error, not a conservation-law violation.
105
+
106
+ \subsection{Two compilation modes}
107
+
108
+ \begin{table}[h]
109
+ \centering
110
+ \begin{tabular}{@{}lllll@{}}
111
+ \toprule
112
+ Mode & Condition & Conserved operator & Admitted & Rejected \\
113
+ \midrule
114
+ Ising & $\lambda = 0$ & $\sum_i Z_i$ (and $\prod_i Z_i$) & ZZ ring, lone Z & single X \\
115
+ Spin-flip & $\lambda \neq 0$ & $\PiX = \prod_i X_i$ & ZZ ring, full X orbit & lone Z \\
116
+ \bottomrule
117
+ \end{tabular}
118
+ \caption{Admission rule per mode.}
119
+ \label{tab:modes}
120
+ \end{table}
121
+
122
+ In both modes a schedule must also be a union of cyclic images. One bond is not a translation-invariant interaction; the ring $\{Z_0Z_1, Z_1Z_2, \dots, Z_{N-1}Z_0\}$ is.
123
+
124
+ \section{Compiler}
125
+
126
+ \lean{compile\_scattering} either emits a certified Trotter schedule or raises \lean{CompilationRejected}; there is no third outcome. It runs five steps:
127
+ \begin{enumerate}[nosep]
128
+ \item Choose the mode from $\lambda$: Ising if $\lambda = 0$, spin-flip otherwise.
129
+ \item Check each requested gate against the mode's admission rule (Table~\ref{tab:modes}). Any forbidden gate raises \lean{CompilationRejected}.
130
+ \item Reject any support that is not closed under the cyclic shift $i \mapsto i + 1 \bmod N$.
131
+ \item Build a first-order Trotter product of the admitted local terms.
132
+ \item Bind a certificate to the admitted list, the mode, and the Trotter parameters (Section~\ref{sec:cert}).
133
+ \end{enumerate}
134
+
135
+ \subsection{Trotter factors}
136
+
137
+ With $n$ steps of size $dt = t/n$, the emitted unitary is
138
+ \begin{equation}
139
+ U(t) \approx \Bigl[\, \prod_{\langle a,b\rangle} e^{\,iJ\,dt\,Z_aZ_b} \prod_j e^{-i\lambda\,dt\,X_j} \Bigr]^{n} .
140
+ \end{equation}
141
+ ZZ gates apply $\exp(iJ\,dt\,Z_aZ_b)$, matching the $-J$ sign in $H$. X gates apply $\exp(-i\lambda\,dt\,X)$. A lone Z, when admitted in Ising mode, is a spectator: it carries no coupling in $H$ and does not evolve the state.
142
+
143
+ Every factor commutes with the active symmetry, so the product does too. This is why the Trotter error described in Section~\ref{sec:symmetry} cannot leak amplitude out of the symmetry sector, even though it does perturb the energy. Theorem~\ref{thm:main} makes this statement exact and machine-checked.
144
+
145
+ \subsection{Input sectors}
146
+
147
+ In Ising mode the input is a computational basis state $|b\rangle$, which is an eigenstate of $\sum_i Z_i$. In spin-flip mode a raw basis state is not an eigenstate of $\PiX$, so it carries the wrong sector label. The input is instead the even cat state, a $+1$ eigenstate of $\PiX$:
148
+ \begin{equation}
149
+ |\psi_0\rangle = \tfrac{1}{\sqrt2}\bigl(|b\rangle + |\bar b\rangle\bigr), \qquad \PiX|\psi_0\rangle = +|\psi_0\rangle ,
150
+ \end{equation}
151
+ where $\bar b$ is the bitwise complement of $b$.
152
+
153
+ \subsection{No post-selection}
154
+
155
+ The compiler has no post-selection step. Leakage out of the sector is computed only as a check that the emitted product stayed where synthesis put it.
156
+
157
+ \section{Certificate}
158
+ \label{sec:cert}
159
+
160
+ The certificate is the SHA-256 digest of a canonical JSON payload that fixes the whole schedule. The payload contains the gate names, supports, and kinds; the mode; and $N$, $\lambda$, $J$, total time, and step count. Any edit to these fields changes the digest.
161
+
162
+ The same payload is rendered as a Lean fragment. For the 4-site Ising ring the compiler emits:
163
+ \begin{Verbatim}
164
+ def emittedHash : String :=
165
+ "e92f82910385ae3c46acc5479d57f4c6357cbbf9bf77d668e469a64b281db8e5"
166
+ def emittedGates : List GateKind := [.zz 0 1, .zz 1 2, .zz 2 3, .zz 3 0]
167
+ theorem emitted_admitted :
168
+ allPreserve preservesMagnetization emittedGates = true := by
169
+ rfl
170
+ theorem emitted_commutes {R : Type} [Lean.Grind.CommRing R] {n : Nat}
171
+ (ι : R) (ang : Operator.Angles R) (steps : Nat) :
172
+ Operator.Commutes (Operator.trotterOp (n := n) ι ang emittedGates steps)
173
+ (Operator.invariant .ising) :=
174
+ Operator.admitted_trotter_commutes .ising ι ang emittedGates
175
+ emitted_admitted steps
176
+ \end{Verbatim}
177
+ \lean{emitted\_admitted} is the Boolean admission check, discharged by reduction; \lean{rfl} fails if a forbidden constructor is inserted. \lean{emitted\_commutes} is the operator statement for the same gate list: every Trotter power of the emitted schedule commutes with the mode's conserved operator. The fragment is checked in \lean{lean/CPSC/Emitted.lean}.
178
+
179
+ \paragraph{Operator commutation.}
180
+ The file \lean{lean/CPSC/Operator.lean} lifts the Boolean check to operators. A state on $N$ qubits is a map from basis strings to a commutative ring $R$, so $R = \mathbb{C}$ gives $(\mathbb{C}^2)^{\otimes N}$, and operator product is composition. Each gate is written $c\,I + \iota s\,P$ for its Pauli generator $P$; since $P^2 = I$, this is $\exp(i\theta P)$ with $c = \cos\theta$ and $s = \sin\theta$. The file proves that every schedule the analyzer admits, repeated for any number of Trotter steps, commutes with $\sum_i Z_i$ in Ising mode and with $\PiX$ in spin-flip mode (Theorem~\ref{thm:main}). The result holds for every lattice size, ring, and angle, and its only axioms are Lean's standard \lean{propext}, \lean{Classical.choice}, and \lean{Quot.sound}. It also proves that rejection is not vacuous: when $\sin\theta \neq 0$, a transverse rotation moves magnetization and a lone Z rotation breaks $\PiX$ (Proposition~\ref{prop:neg}). The proofs are written out in Appendix~\ref{app:proofs} and the Lean development is mapped in Appendix~\ref{app:lean}.
181
+
182
+ \section{Q\# emission}
183
+
184
+ \lean{qsharp/ConservationPreservingScattering.qs} is the hardware image of the admitted factors, not a second analyzer. Its operations map one-to-one onto the compiler's output (Table~\ref{tab:qsharp}). Admission is decided once, on the host. The Q\# layer re-asserts that decision through \lean{RequireAdmitted} rather than re-deriving it.
185
+
186
+ \begin{table}[h]
187
+ \centering
188
+ \begin{tabular}{@{}ll@{}}
189
+ \toprule
190
+ Operation & Role \\
191
+ \midrule
192
+ \lean{ApplyZZRing} & The full bond orbit under translation \\
193
+ \lean{ApplyTransverseField} & The full X orbit; used only by the spin-flip schedule \\
194
+ \lean{IsingEvolution} & Trotter loop for Ising mode \\
195
+ \lean{SpinFlipEvolution} & Trotter loop for spin-flip mode \\
196
+ \lean{RequireAdmitted} & Fails if the host passes a schedule the analyzer refused \\
197
+ \lean{MeasureZParity} & Diagnostic only; it is not the compiler \\
198
+ \bottomrule
199
+ \end{tabular}
200
+ \caption{Q\# operations.}
201
+ \label{tab:qsharp}
202
+ \end{table}
203
+
204
+ \section{Checks}
205
+
206
+ All six numerical checks pass: both legal schedules show zero sector leakage, and all three illegal schedules are rejected at compile time (Table~\ref{tab:checks}). Figures come from the statevector prototype with $N = 4$, $J = 1$, $t = 0.4$, and eight Trotter steps. The \lean{pytest} suite reports 14 passed.
207
+
208
+ \begin{table}[h]
209
+ \centering
210
+ \small
211
+ \begin{tabular}{@{}llllL{5.6cm}@{}}
212
+ \toprule
213
+ Case & Mode & Seed & $\lambda$ & Observed \\
214
+ \midrule
215
+ ZZ ring & Ising & \lean{0b0011} & 0 & Emitted; Z-parity leakage 0; certificate matches the ring, not the ring with \lean{X[0]} substituted \\
216
+ ZZ ring + \lean{X[2]} & Ising & -- & 0 & Rejected: odd X support changes Z-parity \\
217
+ Single bond & Ising & -- & 0 & Rejected: translation orbit not closed \\
218
+ ZZ ring + X orbit & Spin-flip & \lean{0b0001} & 0.5 & Emitted; $\prod X$ leakage 0 (roundoff $3.6\times10^{-15}$ clamped) \\
219
+ Spin-flip + \lean{Z[1]} & Spin-flip & -- & 0.5 & Rejected: lone Z anticommutes with $\prod X$ \\
220
+ Dropped quartic & -- & -- & -- & $Ng/24 = 0.1667$ at $g = 1$, on the identity \\
221
+ \bottomrule
222
+ \end{tabular}
223
+ \caption{Numerical checks.}
224
+ \label{tab:checks}
225
+ \end{table}
226
+
227
+ The Lean side is checked the same way. \lean{lake build} succeeds on Lean 4.22.0 with no external dependencies. \lean{lake env lean Audit.lean} prints the axioms each main theorem depends on; every one lists only \lean{propext}, \lean{Classical.choice}, and \lean{Quot.sound}, and the sources contain no \lean{axiom}, \lean{sorry}, or \lean{native\_decide}. Inserting \lean{.transverseFlip 2} into the emitted Ising gate list makes \lean{emitted\_admitted} fail to compile, so the operator theorem cannot be stated for a tampered schedule.
228
+
229
+ These checks are noiseless. Ideal zero leakage does not survive decoherence on hardware, and the certificate makes no claim that it does.
230
+
231
+ \section{What is not proved}
232
+ \label{sec:open}
233
+
234
+ Operator commutation is closed (Section~\ref{sec:cert}, Appendix~\ref{app:proofs}). Four obligations remain open:
235
+ \begin{itemize}[nosep]
236
+ \item \emph{Instantiation at $\mathbb{C}$.} The proof is over an arbitrary commutative ring with gates written as $c\,I + \iota s\,P$. Connecting it to Mathlib's complex numbers and matrix exponential, so that $\exp(i\theta P) = \cos\theta\, I + i\sin\theta\, P$ is itself machine-checked, is not done.
237
+ \item A noise bound relating device error rates to sector leakage.
238
+ \item A truncated-oscillator encoding of genuine $\phi^4$, where the quartic is not an identity.
239
+ \item A Lean checker wired into CI, so every emitted certificate is checked on commit.
240
+ \end{itemize}
241
+
242
+ Completeness holds inside each mode by construction of $H$. The Ising limit conserves magnetization, and the transverse-field model conserves $\PiX$. Projecting onto a magnetization sector at $\lambda \neq 0$ is refused, because that projection would discard part of the true evolution.
243
+
244
+ The general construction overlaps with symmetry-sector simulators and with verified circuit compilers. What is specific here is the admission rule for this lattice shadow, the mode switch at $\lambda = 0$, and the digest bound to an admitted schedule whose operator semantics is proved.
245
+
246
+ \section{Related work}
247
+
248
+ Block-diagonalization of a Hamiltonian by a conserved charge is standard in exact diagonalization and tensor-network methods. Symmetry verification and post-selection~\cite{bonetmonroig2018,sagastizabal2019} are the error-mitigation approach this compiler declines to substitute for synthesis. Subspace-preserving evolution in existing quantum toolkits already builds a sector unitary once a symmetry is declared; CPSC differs in deriving which symmetry is valid from $\lambda$ and in refusing the wrong one.
249
+
250
+ Machine-checked circuit semantics exist in other verification stacks, such as the Coq-verified VOQC optimizer~\cite{voqc}, but they do not encode this Hamiltonian or its admission rule. Formalization of free bosonic quantum field theory in Lean~\cite{douglas2026} targets continuum Euclidean axioms, not a lattice scattering schedule. The development here uses Lean~4~\cite{lean4} without Mathlib.
251
+
252
+ Wave-packet scattering is the closest experimental neighbor. Zemlevskiy simulated two-particle wave-packet scattering in 1+1D scalar field theory on 120 qubits of IBM's Heron processor, the first such simulation in an interacting field theory, using symmetry- and locality-informed variational circuits~\cite{zemlevskiy2024}. For the Ising chain itself, Bennewitz et al.\ proposed preparing and colliding Gaussian meson wave packets on spin quantum simulators~\cite{bennewitz2024}, and Hite gave a simplified fermionic wave-packet preparation for the transverse-field Ising model, tested on IonQ hardware~\cite{hite2025}. CPSC currently uses basis and cat-state inputs; admitting wave-packet preparation circuits under the same certificate is a natural extension.
253
+
254
+ \section{Conclusion}
255
+
256
+ For the periodic transverse-field Ising chain, conservation can be enforced at synthesis rather than by discarding shots. The correct symmetry is Z-magnetization at $\lambda = 0$ and the global spin flip $\PiX$ for $\lambda \neq 0$; the draft's quartic term is a constant and is dropped. On a 4-site ring, legal schedules show zero ideal leakage, illegal ones fail to compile, and each emitted schedule carries a digest that breaks under edits. Operator commutation is proved in Lean for every admitted schedule; the next steps are a noise bound and a genuine $\phi^4$ encoding.
257
+
258
+ \paragraph{AI assistance.}
259
+ Drafting, editing, and the Lean operator development were assisted by Claude (Anthropic). The author reviewed the text; all Lean proofs are checked by the Lean kernel, and all numerical results come from the repository's test suite.
260
+
261
+ \paragraph{Code and license.}
262
+ Source: \url{https://github.com/AHMADALIPARR/cpsc-qft}. Dual strict copyleft: \lean{LicenseRef-CPSC-ESCL-1.0} OR \lean{AGPL-3.0-only}. Copyright \copyright\ 2026 Ahmad Ali Parr and others.
263
+
264
+ \appendix
265
+
266
+ \section{Operator proofs}
267
+ \label{app:proofs}
268
+
269
+ This appendix gives the mathematical argument that \lean{lean/CPSC/Operator.lean} checks. Each result names the Lean theorem that proves it. The proofs are elementary; the point of the formalization is that the Boolean admission predicate the compiler uses is now tied, by a kernel-checked proof, to the operator it is meant to approximate.
270
+
271
+ \subsection{Setting}
272
+
273
+ Fix a lattice of $N = n + 1 \ge 1$ sites and a commutative ring $R$. A \emph{basis string} is a map $b\colon \{0,\dots,N-1\} \to \{0,1\}$. A \emph{state} is a map $v$ from basis strings to $R$; for $R = \mathbb{C}$ the states form $(\mathbb{C}^2)^{\otimes N}$ in the computational basis. An \emph{operator} is a map on states, and the product $AB$ is composition. Operators $A$ and $P$ \emph{commute} if $A(Pv) = P(Av)$ for every state $v$ (\lean{Commutes}).
274
+
275
+ Write $\sgn(x) = (-1)^x \in R$ for a bit $x$, $b^{(q)}$ for $b$ with bit $q$ flipped (\lean{flipAt}), and $\bar b$ for $b$ with every bit flipped (\lean{flipAll}). The operators are
276
+ \begin{align*}
277
+ (Z_q v)(b) &= \sgn(b_q)\, v(b), &
278
+ (X_q v)(b) &= v(b^{(q)}), \\
279
+ (\PiX v)(b) &= v(\bar b), &
280
+ (\Mag v)(b) &= m(b)\, v(b), \quad m(b) = \textstyle\sum_k \sgn(b_k).
281
+ \end{align*}
282
+ These are the standard actions of $Z_q$, $X_q$, $\prod_k X_k$, and $\sum_k Z_k$ on computational basis states. Fix an element $\iota \in R$ and coefficients $c, s \in R$. The gates are
283
+ \begin{align*}
284
+ \mathrm{RZZ}_{pq}(v)(b) &= \bigl(c + \iota s\, \sgn(b_p)\sgn(b_q)\bigr)\, v(b), &
285
+ \mathrm{RX}_q(v)(b) &= c\, v(b) - \iota s\, v(b^{(q)}), \\
286
+ \mathrm{RZ}_q(v)(b) &= \bigl(c + \iota s\, \sgn(b_q)\bigr)\, v(b), &
287
+ \mathrm{PAIR}_{pq} &= \mathrm{RX}_p\, \mathrm{RX}_q .
288
+ \end{align*}
289
+ These are exactly the factors applied by \lean{cpsc.channel}.
290
+
291
+ \subsection{Gates are rotations}
292
+
293
+ \begin{lemma}[Pauli squares]
294
+ $Z_q^2 = I$, $X_q^2 = I$, and $\sgn(\bar x) = -\sgn(x)$, $\sgn(x)^2 = 1$.
295
+ \leanref{Z\_sq, X\_sq, sgn\_not, sgn\_sq}
296
+ \end{lemma}
297
+ \begin{proof}
298
+ $\sgn$ takes values $\pm1$ and flipping a bit swaps them. Flipping bit $q$ twice returns $b$.
299
+ \end{proof}
300
+
301
+ \begin{proposition}[Gate form]
302
+ \label{prop:form}
303
+ $\mathrm{RZZ}_{pq} = c\,I + \iota s\, Z_pZ_q$, $\mathrm{RX}_q = c\,I - \iota s\, X_q$, and $\mathrm{RZ}_q = c\,I + \iota s\, Z_q$. If $\iota^2 = -1$ and $c^2 + s^2 = 1$, the gate with $s$ replaced by $-s$ inverts $\mathrm{RX}_q$.
304
+ \leanref{rzz\_eq, rx\_eq, rz\_eq, rx\_inverse}
305
+ \end{proposition}
306
+ \begin{proof}
307
+ The first three identities follow by evaluating both sides at a basis string. For the inverse,
308
+ \[
309
+ (c\,I + \iota s X_q)(c\,I - \iota s X_q) = c^2 I - \iota^2 s^2 X_q^2 = (c^2 + s^2)\, I = I .
310
+ \]
311
+ \end{proof}
312
+
313
+ Over $R = \mathbb{C}$ with $\iota = i$, $c = \cos\theta$, $s = \sin\theta$: since $P^2 = I$ for each generator, the power series gives $\exp(\pm i\theta P) = \cos\theta\, I \pm i \sin\theta\, P$. So the gates are the rotations $e^{i\theta Z_pZ_q}$, $e^{-i\theta X_q}$, and $e^{i\theta Z_q}$. This last identification is the one step not formalized (Section~\ref{sec:open}).
314
+
315
+ \subsection{Commutation is closed under products}
316
+
317
+ \begin{lemma}
318
+ \label{lem:comp}
319
+ The identity commutes with every $P$. If $A$ and $B$ commute with $P$, so does $AB$.
320
+ \leanref{commutes\_id, commutes\_comp}
321
+ \end{lemma}
322
+ \begin{proof}
323
+ $A(B(Pv)) = A(P(Bv)) = P(A(Bv))$.
324
+ \end{proof}
325
+
326
+ \subsection{Admitted gates commute with the invariant}
327
+
328
+ \begin{lemma}
329
+ $\overline{b^{(q)}} = \bar b^{(q)}$: flipping one bit commutes with flipping all bits.
330
+ \leanref{flipAt\_flipAll}
331
+ \end{lemma}
332
+
333
+ \begin{proposition}[Spin flip]
334
+ \label{prop:spin}
335
+ $\mathrm{RZZ}_{pq}$, $\mathrm{RX}_q$, and $\mathrm{PAIR}_{pq}$ commute with $\PiX$, for all $c, s, \iota$.
336
+ \leanref{rzz\_comm\_PiX, rx\_comm\_PiX, pair\_comm\_PiX}
337
+ \end{proposition}
338
+ \begin{proof}
339
+ For RZZ, both $(\mathrm{RZZ}\,\PiX v)(b)$ and $(\PiX\,\mathrm{RZZ}\, v)(b)$ equal a coefficient times $v(\bar b)$. The coefficients are $c + \iota s\,\sgn(b_p)\sgn(b_q)$ and $c + \iota s\,\sgn(\bar b_p)\sgn(\bar b_q)$, and these agree because the two sign changes cancel. For RX,
340
+ \[
341
+ (\mathrm{RX}_q \PiX v)(b) = c\,v(\bar b) - \iota s\, v(\overline{b^{(q)}}), \qquad
342
+ (\PiX \mathrm{RX}_q v)(b) = c\,v(\bar b) - \iota s\, v(\bar b^{(q)}),
343
+ \]
344
+ which agree by the preceding lemma. PAIR follows by Lemma~\ref{lem:comp}.
345
+ \end{proof}
346
+
347
+ \begin{proposition}[Magnetization]
348
+ \label{prop:mag}
349
+ $\mathrm{RZZ}_{pq}$ and $\mathrm{RZ}_q$ commute with $\Mag$, for all $c, s, \iota$.
350
+ \leanref{diag\_comm\_Mag, rzz\_comm\_Mag, rz\_comm\_Mag}
351
+ \end{proposition}
352
+ \begin{proof}
353
+ All three are diagonal: each multiplies $v(b)$ by a function of $b$. Diagonal operators commute because $R$ is commutative.
354
+ \end{proof}
355
+
356
+ \subsection{Rejection is not vacuous}
357
+
358
+ \begin{lemma}
359
+ \label{lem:magflip}
360
+ $m(b^{(q)}) = m(b) + \sgn(\bar b_q) - \sgn(b_q) = m(b) - 2\sgn(b_q)$.
361
+ \leanref{magUpTo\_flipAt, magVal\_flipAt}
362
+ \end{lemma}
363
+ \begin{proof}
364
+ Only the $q$-th term of the sum changes. Lean proves the statement for every partial sum $\sum_{k<m}$ by induction on $m$.
365
+ \end{proof}
366
+
367
+ \begin{proposition}
368
+ \label{prop:neg}
369
+ If $2\iota s \neq 0$ (over $\mathbb{C}$: $\sin\theta \neq 0$), then $\mathrm{RX}_q$ does not commute with $\Mag$ and $\mathrm{RZ}_q$ does not commute with $\PiX$.
370
+ \leanref{rx\_not\_comm\_Mag, rz\_not\_comm\_PiX}
371
+ \end{proposition}
372
+ \begin{proof}
373
+ Take $v \equiv 1$ and evaluate at the all-zero string $0$. By Lemma~\ref{lem:magflip}, $m(0^{(q)}) = m(0) - 2$, so
374
+ \[
375
+ (\Mag\,\mathrm{RX}_q v)(0) - (\mathrm{RX}_q \Mag v)(0) = m(0)(c - \iota s) - \bigl(c\,m(0) - \iota s\,(m(0) - 2)\bigr) = -2\iota s \neq 0 .
376
+ \]
377
+ For RZ, $(\mathrm{RZ}_q \PiX v)(0) = c + \iota s$ while $(\PiX\, \mathrm{RZ}_q v)(0) = c + \iota s\,\sgn(1) = c - \iota s$. They differ by $2\iota s \neq 0$.
378
+ \end{proof}
379
+
380
+ The hypothesis is necessary. At $\theta = 0$ or $\theta = \pi$ the rotation is $\pm I$, which commutes with everything. An earlier axiomatization asserted these non-commutations unconditionally, and also that a forbidden factor cannot be cancelled by a later one; both are false for real unitaries (take the inverse rotation), and both have been removed.
381
+
382
+ \subsection{Main theorem}
383
+
384
+ Gate kinds carry natural-number indices, read modulo $N$ to match the periodic ring (\lean{site}). An angle map assigns $(c, s)$ to each gate kind; for a Trotter step, ZZ gates use $\theta = J\,dt$ and transverse gates use $\theta = \lambda\, dt$. \lean{gateOp} sends each gate kind to its operator, \lean{circuitOp} composes a gate list with the head gate acting first, and \lean{trotterOp} repeats the layer a given number of times.
385
+
386
+ \begin{theorem}[Admitted schedules conserve the invariant]
387
+ \label{thm:main}
388
+ Let the mode be Ising or spin-flip, with invariant $\Mag$ or $\PiX$ respectively. For every lattice size, commutative ring $R$, $\iota \in R$, angle map, gate list admitted by the analyzer in that mode, and number of Trotter steps $k$, the operator $\bigl(\prod_{g} \mathrm{gateOp}(g)\bigr)^k$ commutes with the invariant.
389
+ \leanref{admitted\_trotter\_commutes}
390
+ \end{theorem}
391
+ \begin{proof}
392
+ Admission means every gate passes the mode's Boolean predicate. By case analysis on the gate kind, a gate passing \lean{preservesMagnetization} is RZZ or RZ, which commutes with $\Mag$ by Proposition~\ref{prop:mag}. A gate passing \lean{preservesSpinFlip} is RZZ, RX, or PAIR, which commutes with $\PiX$ by Proposition~\ref{prop:spin} (\lean{mag\_of\_bool}, \lean{spin\_of\_bool}). Induction on the list with Lemma~\ref{lem:comp} gives the layer (\lean{circuit\_comm}), and induction on $k$ gives the Trotter power (\lean{trotter\_comm}).
393
+ \end{proof}
394
+
395
+ \begin{corollary}[Sector preservation]
396
+ If $\mathcal{P}\psi_0 = \mu\psi_0$ for the invariant $\mathcal{P}$, then $\mathcal{P}U\psi_0 = \mu U\psi_0$ for the emitted Trotter operator $U$. In particular the even cat state stays in the $+1$ sector of $\PiX$, and a basis state stays in its magnetization sector, at every step.
397
+ \end{corollary}
398
+ \begin{proof}
399
+ $\mathcal{P}U\psi_0 = U\mathcal{P}\psi_0 = \mu U\psi_0$, using linearity of $U$.
400
+ \end{proof}
401
+ The corollary is the mathematical content of the zero-leakage rows in Table~\ref{tab:checks}; the numerical runs confirm it up to floating-point roundoff.
402
+
403
+ \section{Lean development}
404
+ \label{app:lean}
405
+
406
+ The development builds with \lean{lake build} on Lean 4.22.0 and has no dependencies beyond the Lean core library. Ring identities are discharged by the core \lean{grind} tactic.
407
+
408
+ \begin{table}[H]
409
+ \centering
410
+ \small
411
+ \begin{tabular}{@{}lL{10.4cm}@{}}
412
+ \toprule
413
+ File & Contents \\
414
+ \midrule
415
+ \lean{CPSC/Certificate.lean} & Gate kinds, modes, Boolean admission predicates, the 4-site rings, and adversarial rejections, all by \lean{rfl}. \\
416
+ \lean{CPSC/Operator.lean} & The operator model, gate forms, commutation and non-commutation results, \lean{gateOp}, \lean{circuitOp}, \lean{trotterOp}, and Theorem~\ref{thm:main}. \\
417
+ \lean{CPSC/Lemmas.lean} & \lean{OperatorCommutation} (the former open obligation, now a theorem), \lean{completeness\_of\_admitted}, and gate-kind forms of Proposition~\ref{prop:neg}. \\
418
+ \lean{CPSC/Emitted.lean} & The certificate emitted for the 4-site Ising ring, with \lean{emitted\_commutes}. \\
419
+ \lean{Audit.lean} & \lean{\#print axioms} for the main results. \\
420
+ \bottomrule
421
+ \end{tabular}
422
+ \caption{Lean files.}
423
+ \end{table}
424
+
425
+ The central statement, as checked:
426
+ \begin{Verbatim}
427
+ theorem admitted_trotter_commutes (mode : CPSC.Mode) (ι : R) (ang : Angles R)
428
+ (gs : List CPSC.GateKind) (h : CPSC.admitted mode gs = true) (steps : Nat) :
429
+ Commutes (trotterOp (n := n) ι ang gs steps) (invariant mode)
430
+ \end{Verbatim}
431
+ The audit output:
432
+ \begin{Verbatim}
433
+ 'CPSC.Operator.admitted_trotter_commutes' depends on axioms:
434
+ [propext, Classical.choice, Quot.sound]
435
+ 'CPSC.operator_commutation' depends on axioms:
436
+ [propext, Classical.choice, Quot.sound]
437
+ 'CPSC.Emitted.emitted_commutes' depends on axioms:
438
+ [propext, Classical.choice, Quot.sound]
439
+ \end{Verbatim}
440
+ To reproduce:
441
+ \begin{Verbatim}
442
+ cd lean && lake build && lake env lean Audit.lean
443
+ PYTHONPATH=src python3 -m pytest -q
444
+ \end{Verbatim}
445
+
446
+ \begin{thebibliography}{10}
447
+ \bibitem{jlp2012} S.~P. Jordan, K.~S.~M. Lee, J.~Preskill. Quantum algorithms for quantum field theories. \emph{Science} 336, 1130--1133 (2012). \href{https://arxiv.org/abs/1111.3633}{arXiv:1111.3633}.
448
+ \bibitem{jlp2014} S.~P. Jordan, K.~S.~M. Lee, J.~Preskill. Quantum computation of scattering in scalar quantum field theories. \href{https://arxiv.org/abs/1112.4833}{arXiv:1112.4833}.
449
+ \bibitem{bonetmonroig2018} X.~Bonet-Monroig, R.~Sagastizabal, M.~Singh, T.~E. O'Brien. Low-cost error mitigation by symmetry verification. \emph{Phys. Rev. A} 98, 062339 (2018). \href{https://arxiv.org/abs/1807.10050}{arXiv:1807.10050}.
450
+ \bibitem{sagastizabal2019} R.~Sagastizabal, X.~Bonet-Monroig, M.~Singh, et al. Experimental error mitigation via symmetry verification in a variational quantum eigensolver. \emph{Phys. Rev. A} 100, 010302 (2019).
451
+ \bibitem{voqc} K.~Hietala, R.~Rand, S.-H. Hung, X.~Wu, M.~Hicks. A verified optimizer for quantum circuits. \emph{Proc. ACM Program. Lang.} 5 (POPL) (2021). \href{https://arxiv.org/abs/1912.02250}{arXiv:1912.02250}.
452
+ \bibitem{douglas2026} M.~R. Douglas, S.~Hoback, A.~Mei, R.~Nissim. Formalization of QFT. \href{https://arxiv.org/abs/2603.15770}{arXiv:2603.15770} (2026).
453
+ \bibitem{zemlevskiy2024} N.~A. Zemlevskiy. Scalable quantum simulations of scattering in scalar field theory on 120 qubits. \href{https://arxiv.org/abs/2411.02486}{arXiv:2411.02486}.
454
+ \bibitem{bennewitz2024} E.~R. Bennewitz et al. Simulating meson scattering on spin quantum simulators. \href{https://arxiv.org/abs/2403.07061}{arXiv:2403.07061}.
455
+ \bibitem{hite2025} M.~Hite. Simplified fermionic scattering state preparation for the NISQ era. \href{https://arxiv.org/abs/2505.00476}{arXiv:2505.00476} (2025).
456
+ \bibitem{lean4} L.~de Moura, S.~Ullrich. The Lean 4 theorem prover and programming language. In \emph{CADE-28}, LNCS 12699 (2021).
457
+ \end{thebibliography}
458
+
459
+ \end{document}