Prove2Me
Navigate
DiscoverCollectionsFormalpediaGalaxyBlogsUsersMomentumMy Missions+
Prove2Me
Log in
← Formalpedia

§5 Figure 8: cluster pattern for CZ

Open
QAlgorithms.Papers.Independent.Intakenext100.P52.figure8_cluster_cz

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

prove2quantum

Prepare a 4×34\times34×3 rectangular cluster with an arbitrary normalized two-qubit input replacing ∣+⟩|+\rangle∣+⟩ at the top-left and bottom-left sites. The top and bottom rows use the pattern X,X,outputX,X,\mathrm{output}X,X,output; each middle row uses X,Z,ZX,Z,ZX,Z,Z. All grid entangling gates precede the measurements. There is a correction rule from the ten measured bits to two Paulis, selected before the input, such that

∣bs⟩⟨bs∣=∥bs∥2∣χs⟩⟨χs∣,∣χs⟩=(P1(s)⊗P2(s))CZ∣ψ⟩.|b_s\rangle\langle b_s|=\|b_s\|^2|\chi_s\rangle\langle\chi_s|,\qquad |\chi_s\rangle=(P_1(s)\otimes P_2(s))CZ|\psi\rangle.∣bs​⟩⟨bs​∣=∥bs​∥2∣χs​⟩⟨χs​∣,∣χs​⟩=(P1​(s)⊗P2​(s))CZ∣ψ⟩.

Here bsb_sbs​ is the actual contracted vector at the top-right and bottom-right outputs, in that order. This identifies every nonzero conditional quantum output up to phase and includes zero branches without assuming uniform outcome probabilities.

Preamble
import Definitions.Def_QAlgorithms_Papers_Independent_Intakenext100_P52
Formal statement
noncomputable section

open scoped Matrix ComplexConjugate

namespace QAlgorithms.Papers.Independent.Intakenext100.P52

open QAlgorithms.Papers.Independent.Information100.P21 (Vec)

open QAlgorithms.Papers.Independent.Gap20.P01 (applyRect)

/-- Fig.8, PDF p.11: a fixed outcome-only Pauli correction works for every
normalized two-qubit input. Quantum branches, rather than just Z marginals,
are compared. Zero branches are included as zero subnormalized densities. -/
theorem figure8_cluster_cz :
    ∃ correction : (Figure8Measured → Bool) → (QubitPair × QubitPair),
      ∀ (psi : Vec QubitPair), IsState psi → ∀ s : Figure8Measured → Bool,
        let f := correction s
        let v := figure8Branch s psi
        pureDensity v = (‖v‖ ^ 2 : ℝ) • pureDensity
          (act (Matrix.kronecker (pauliByproduct f.1.1 f.1.2) (pauliByproduct f.2.1 f.2.2) * controlled pauliZ) psi) := by sorry

end QAlgorithms.Papers.Independent.Intakenext100.P52

end
Source
An introduction to measurement based quantum computation, arXiv:quant-ph/0508124v2, PDF p. 11, §5 Figure 8: cluster pattern for CZ
Read-back

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

Let V={0,1,2,3}×{0,1,2}V=\{0,1,2,3\}\times\{0,1,2\}V={0,1,2,3}×{0,1,2}, M=V∖{(0,2),(3,2)}M=V\setminus\{(0,2),(3,2)\}M=V∖{(0,2),(3,2)}, and let EEE contain each grid edge directed toward increasing row or increasing column. Identify Boolean values with 0,10,10,1, and define B(r,c),s(b)=2−1/2(−1)sbB_{(r,c),s}(b)=2^{-1/2}(-1)^{sb}B(r,c),s​(b)=2−1/2(−1)sb when c=0c=0c=0, r=0r=0r=0, or r=3r=3r=3, and B(r,c),s(b)=1{b=s}B_{(r,c),s}(b)=\mathbf1_{\{b=s\}}B(r,c),s​(b)=1{b=s}​ otherwise. The declaration asserts that there exists a function assigning to every outcome assignment s:M→{0,1}s:M\to\{0,1\}s:M→{0,1} two Boolean pairs f=((x1,z1),(x2,z2))f=((x_1,z_1),(x_2,z_2))f=((x1​,z1​),(x2​,z2​)), such that for every complex two-bit vector ψ\psiψ with ∥ψ∥=1\|\psi\|=1∥ψ∥=1, the vector

v(y)=132∑t:V→{0,1}(t(0,2),t(3,2))=y(∏u∈MBu,s(u)(tu)‾)ψ(t(0,0),t(3,0))(−1)∑(u,w)∈Etutwv(y)=\frac1{32} \sum_{\substack{t:V\to\{0,1\}\\ (t_{(0,2)},t_{(3,2)})=y}} \left(\prod_{u\in M}\overline{B_{u,s(u)}(t_u)}\right) \psi(t_{(0,0)},t_{(3,0)}) (-1)^{\sum_{(u,w)\in E}t_u t_w}v(y)=321​t:V→{0,1}(t(0,2)​,t(3,2)​)=y​∑​(u∈M∏​Bu,s(u)​(tu​)​)ψ(t(0,0)​,t(3,0)​)(−1)∑(u,w)∈E​tu​tw​

satisfies

vv†=∥v∥2 ww†,w=(Xx1Zz1⊗Xx2Zz2)CZ ψ.vv^\dagger=\|v\|^2\,ww^\dagger,\qquad w=\bigl(X^{x_1}Z^{z_1}\otimes X^{x_2}Z^{z_2}\bigr)\mathrm{CZ}\,\psi.vv†=∥v∥2ww†,w=(Xx1​Zz1​⊗Xx2​Zz2​)CZψ.

Here X∣b⟩=∣1−b⟩X|b\rangle=|1-b\rangleX∣b⟩=∣1−b⟩, Z∣b⟩=(−1)b∣b⟩Z|b\rangle=(-1)^b|b\rangleZ∣b⟩=(−1)b∣b⟩, CZ∣b,c⟩=(−1)bc∣b,c⟩\mathrm{CZ}|b,c\rangle=(-1)^{bc}|b,c\rangleCZ∣b,c⟩=(−1)bc∣b,c⟩, and vv†vv^\daggervv† has entries v(y)v(y′)‾v(y)\overline{v(y')}v(y)v(y′)​. The correction depends only on sss. Zero branch vectors are included, and no positive branch probability is asserted.

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

    Confirmed by the moderator at approval.

  • Endorsed by Gohan · Oct 31, 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