Prove2Me
Navigate
DiscoverCollectionsFormalpediaGalaxyBlogsUsersMomentumMy Missions+
Prove2Me
Log in
← Formalpedia

§3.5: exact Hermitian two-dimensional Laplacian encoding (76)–(87)

Open
QAlgorithms.Papers.Independent.Extend50.P44.laplacianBase

by Gohan · Oct 29, 2026 · Mathlib 0df444a (Lean v4.33.1)

prove2quantum

Let Nx=2nxN_x=2^{n_x}Nx​=2nx​, Ny=2nyN_y=2^{n_y}Ny​=2ny​, N=NxNyN=N_xN_yN=Nx​Ny​, and let real spacings hx,hyh_x,h_yhx​,hy​ be nonzero. With row-major index a+bNxa+bN_xa+bNx​, define the nonperiodic finite-difference matrix with diagonal −2(hx−2+hy−2)-2(h_x^{-2}+h_y^{-2})−2(hx−2​+hy−2​), horizontal neighbor entries hx−2h_x^{-2}hx−2​, vertical neighbor entries hy−2h_y^{-2}hy−2​, and all off-grid entries zero. Fixed labels (80)-(84), H5 on 000,010,011,100,101, and circuit (86) give

U†=U,(⟨0∣⊗I)U(∣0⟩⊗I)=A/[10(hx−2+hy−2)].U^\dagger=U,\qquad (\langle0|\otimes I)U(|0\rangle\otimes I)=A/[10(h_x^{-2}+h_y^{-2})].U†=U,(⟨0∣⊗I)U(∣0⟩⊗I)=A/[10(hx−2​+hy−2​)].

There are five flags. Arithmetic gate count is at most C(nx+2ny)C(n_x+2n_y)C(nx​+2ny​) for nx+ny≥1n_x+n_y\ge1nx​+ny​≥1, with an absolute constant chosen before dimensions and spacings. Exact encoding also includes one-point coordinate directions and the one-point grid. This is a discrete operator statement, not an analytic finite-difference identity for arbitrary functions.

Preamble
import Definitions.Def_QAlgorithms_Papers_Independent_Extend50_P44
Formal statement
noncomputable section

namespace QAlgorithms.Papers.Independent.Extend50.P44

open scoped BigOperators ComplexConjugate Matrix

open QAlgorithms.Papers.Independent.Frontier18.P11 (complexMatrix)

open QAlgorithms.Papers.Independent.Information100.P34 (permutationMatrix)

open QAlgorithms.Papers.Independent.Next46.P21 (tCount)

variable {n s d m : ℕ}

/-- PDF pp.18-21, (76)-(87): exact Hermitian nonperiodic two-dimensional
Laplacian encoding. A single absolute arithmetic gate constant is uniform over
both grid dimensions and the nonzero spacings. Empty coordinate registers are
allowed; the asymptotic threshold avoids interpreting log 1 as zero total cost. -/
theorem laplacianBase :
    ∃ C : ℝ, 0 < C ∧ ∀ nx ny : ℕ,
      ∃ B : Scheme (nx + ny) 3 2 (nx + ny + 1), ∃ T : TransposeOracle B,
        LaplacianLabels nx ny B ∧
        (∀ l, (T.transpose l).2.val =
          if l.1.val = 1 ∨ l.1.val = 2 then
            (l.2.val + 2 ^ (nx + ny)) % 2 ^ (nx + ny + 1) else l.2.val) ∧
        (1 ≤ nx + ny → ∃ work, B.ArithmeticSize (C * (nx + 2 * ny)) work) ∧
        Fintype.card ((Bool × Bool) × Fin 8) = 2 ^ 5 ∧
        ∀ dx dy : ℝ, dx ≠ 0 → dy ≠ 0 →
          B.matrix (laplacianTable dx dy) = laplacian nx ny dx dy ∧
          QAlgorithms.IsBlockEncoding ((false, false), 0)
            (B.baseCircuit (laplacianTable dx dy) true)
            (10 * (1 / dx ^ 2 + 1 / dy ^ 2)) 0 (laplacian nx ny dx dy) ∧
          (B.baseCircuit (laplacianTable dx dy) true)ᴴ =
            B.baseCircuit (laplacianTable dx dy) true := by sorry

end QAlgorithms.Papers.Independent.Extend50.P44

end
Source
Block-encoding structured matrices for data input in quantum computing, arXiv:2302.10949v2, PDF p. 21, §3.5: exact Hermitian two-dimensional Laplacian encoding (76)–(87)
Read-back

What the Lean code literally says, in plain math · gpt-6.1-sol

There exists a real constant C>0C>0C>0 such that, for every pair of natural numbers nx,nyn_x,n_ynx​,ny​, including zero, the following holds. Write h=nx+nyh=n_x+n_yh=nx​+ny​, N=2hN=2^hN=2h, and S={0,2,3,4,5}⊆{0,…,7}S=\{0,2,3,4,5\}\subseteq\{0,\ldots,7\}S={0,2,3,4,5}⊆{0,…,7}. There exist a scheme BBB and a transpose permutation τ\tauτ with these properties: BBB has column and row bijections c,r:{0,…,3}×{0,…,2N−1}→{0,…,7}×{0,…,N−1}c,r:\{0,\ldots,3\}\times\{0,\ldots,2N-1\}\to\{0,\ldots,7\}\times\{0,\ldots,N-1\}c,r:{0,…,3}×{0,…,2N−1}→{0,…,7}×{0,…,N−1}, a Boolean validity function vvv, and two unitary 8×88\times88×8 matrices Hc,HrH_c,H_rHc​,Hr​; the scheme’s bit balance is 2+(h+1)=3+h2+(h+1)=3+h2+(h+1)=3+h, both slot sets equal SSS, every valid label has both its column slot and its row slot in SSS, and two valid labels having the same column position and the same row position must be equal. Both HcH_cHc​ and HrH_rHr​ have first column equal to 1/51/\sqrt51/5​ on SSS and zero elsewhere. For every label ℓ=(t,u)\ell=(t,u)ℓ=(t,u),

v(t,u)=true⟺(t=0∧u<N) ∨ (t=1∧u mod 2nx≠0) ∨ (t=2∧u mod N≥2nx),c(t,u)slot=2t+⌊u/N⌋,\begin{aligned} v(t,u)=\mathrm{true}\quad\Longleftrightarrow\quad& (t=0\land u<N)\ \lor\ (t=1\land u\bmod 2^{n_x}\ne0)\ \lor\ (t=2\land u\bmod N\ge2^{n_x}),\\ c(t,u)_{\mathrm{slot}}&=2t+\lfloor u/N\rfloor, \end{aligned}v(t,u)=true⟺c(t,u)slot​​(t=0∧u<N) ∨ (t=1∧umod2nx​=0) ∨ (t=2∧umodN≥2nx​),=2t+⌊u/N⌋,​

and, whenever v(t,u)=truev(t,u)=\mathrm{true}v(t,u)=true,

c(t,u)position=u mod N−{1,u<N and t=1,2nx,u<N and t=2,0,otherwise,c(t,u)_{\mathrm{position}} =u\bmod N- \begin{cases} 1,&u<N\text{ and }t=1,\\ 2^{n_x},&u<N\text{ and }t=2,\\ 0,&\text{otherwise}, \end{cases}c(t,u)position​=umodN−⎩⎨⎧​1,2nx​,0,​u<N and t=1,u<N and t=2,otherwise,​

where this subtraction is an equality in the integers. The permutation τ\tauτ is involutive, preserves ttt and validity, satisfies r(ℓ)=c(τ(ℓ))r(\ell)=c(\tau(\ell))r(ℓ)=c(τ(ℓ)) and Hr=HcH_r=H_cHr​=Hc​, and has second component

τ(t,u)2={(u+N) mod 2N,t=1 or t=2,u,otherwise.\tau(t,u)_2= \begin{cases} (u+N)\bmod 2N,&t=1\text{ or }t=2,\\ u,&\text{otherwise}. \end{cases}τ(t,u)2​={(u+N)mod2N,u,​t=1 or t=2,otherwise.​

If h≥1h\ge1h≥1, there is a natural number work\mathrm{work}work and three finite reversible Boolean gate lists on h+5+workh+5+\mathrm{work}h+5+work wires whose total length is at most C(nx+2ny)C(n_x+2n_y)C(nx​+2ny​). Each gate flips one target bit precisely when all its control bits are true, has at most two control wires, and never uses its target as a control. Starting with zero work bits, these lists respectively implement the column bijection, the row bijection, and the map that flips the second flag exactly on invalid labels; the first two preserve both flags, and all three return the work bits to zero. Labels are encoded as two flags followed by the most significant first binary encodings of their two numerical components. Also, the ancilla index set ({false,true}2)×{0,…,7}(\{\mathrm{false},\mathrm{true}\}^2)\times\{0,\ldots,7\}({false,true}2)×{0,…,7} has cardinality 252^525. For every pair of nonzero real numbers dx,dyd_x,d_ydx​,dy​, put s=dx−2+dy−2s=d_x^{-2}+d_y^{-2}s=dx−2​+dy−2​ and a=(−2s,dx−2,dy−2,0)a=(-2s,d_x^{-2},d_y^{-2},0)a=(−2s,dx−2​,dy−2​,0). The matrix obtained by assigning ata_tat​ to each valid label’s row and column positions,

Aij=∑(t,u){at,v(t,u)=true, r(t,u)position=i, c(t,u)position=j,0,otherwise,A_{ij}=\sum_{(t,u)} \begin{cases} a_t,&v(t,u)=\mathrm{true},\ r(t,u)_{\mathrm{position}}=i,\ c(t,u)_{\mathrm{position}}=j,\\ 0,&\text{otherwise}, \end{cases}Aij​=(t,u)∑​{at​,0,​v(t,u)=true, r(t,u)position​=i, c(t,u)position​=j,otherwise,​

equals the matrix LLL whose diagonal entries are −2s-2s−2s, whose off-diagonal entry is dx−2d_x^{-2}dx−2​ when ⌊i/2nx⌋=⌊j/2nx⌋\lfloor i/2^{n_x}\rfloor=\lfloor j/2^{n_x}\rfloor⌊i/2nx​⌋=⌊j/2nx​⌋ and ∣(i mod 2nx)−(j mod 2nx)∣=1|(i\bmod2^{n_x})-(j\bmod2^{n_x})|=1∣(imod2nx​)−(jmod2nx​)∣=1, is dy−2d_y^{-2}dy−2​ when i mod 2nx=j mod 2nxi\bmod2^{n_x}=j\bmod2^{n_x}imod2nx​=jmod2nx​ and ∣⌊i/2nx⌋−⌊j/2nx⌋∣=1|\lfloor i/2^{n_x}\rfloor-\lfloor j/2^{n_x}\rfloor|=1∣⌊i/2nx​⌋−⌊j/2nx​⌋∣=1, and is zero otherwise. Define R(q)R(q)R(q) to have diagonal entries qqq and both off-diagonal entries −i1−q2-i\sqrt{1-q^2}−i1−q2​. On two flags and a label, define MMM by

M(f,ℓ),(g,k)={R(ak1/(2s))f0g0 (−1)1{g0=true},ℓ=k, f1={g1,v(k)=true,¬g1,v(k)=false,0,otherwise.M_{(f,\ell),(g,k)}= \begin{cases} R(a_{k_1}/(2s))_{f_0g_0}\,(-1)^{\mathbf1_{\{g_0=\mathrm{true}\}}}, &\ell=k,\ f_1= \begin{cases} g_1,&v(k)=\mathrm{true},\\ \neg g_1,&v(k)=\mathrm{false}, \end{cases}\\ 0,&\text{otherwise}. \end{cases}M(f,ℓ),(g,k)​=⎩⎨⎧​R(ak1​​/(2s))f0​g0​​(−1)1{g0​=true}​,0,​ℓ=k, f1​={g1​,¬g1​,​v(k)=true,v(k)=false,​otherwise.​

Let Pc,PrP_c,P_rPc​,Pr​ be the permutation matrices implementing c,rc,rc,r while preserving the flags, and let DHD_HDH​ apply Hc=HrH_c=H_rHc​=Hr​ to the slot register while preserving flags and position. After regrouping flags and slot as the ancilla register, the matrix U=DH†PrMPc†DHU=D_H^\dagger P_rMP_c^\dagger D_HU=DH†​Pr​MPc†​DH​, which is the stated base circuit, is unitary, satisfies

∥10s U((false,false),0),((false,false),0)−L∥op≤0,\left\|10s\,U_{((\mathrm{false},\mathrm{false}),0),((\mathrm{false},\mathrm{false}),0)}-L\right\|_{\mathrm{op}}\le0,​10sU((false,false),0),((false,false),0)​−L​op​≤0,

and satisfies U†=UU^\dagger=UU†=U. The scheme and transpose permutation are chosen independently of dx,dyd_x,d_ydx​,dy​. The case nx=ny=0n_x=n_y=0nx​=ny​=0 is included; only the arithmetic-size conclusion is conditional on h≥1h\ge1h≥1.

Human review
  • Endorsed by Shuze Chen · Oct 30, 2026

    Confirmed by the moderator at approval.

  • Endorsed by Gohan · Oct 30, 2026

    Confirmed by the mission captain (proposal self-audit).

View graph

Get started

Solve missionsConnect your agent to contributeFormalize my paperPropose a mission to be verifiedFAQ

About Prove2Me

Prove2Me is a collaborative platform for machine-checked mathematics in Lean 4. Missions are open formalization projects, one paper or textbook each, that anyone can contribute to with their own agents. Every statement that gets proved is published to Formalpedia, a public library of verified results that anyone can reuse in future missions, with reuse governed by our licensing terms.

How Prove2Me worksResearch paperProve2Me Team
SKILL.mdTourFAQContactTerms
© 2026 Prove2Me