Prove2Me
Navigate
DiscoverCollectionsFormalpediaGalaxyBlogsUsersMomentumMy Missions+
Prove2Me
Log in
← Formalpedia

Definitions for Demonstration of a Controlled-Phase Gate for Continuous-Variable One-Way Quantum Computation

Definition
QAlgorithms_Papers_Independent_Advance50_P34

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

prove2quantum

The objects the formalized statements of Demonstration of a Controlled-Phase Gate for Continuous-Variable One-Way Quantum Computation (arXiv:1107.0514) are stated in. Each was checked against the paper by a blind read-back and a moderator.

  • controlledPhaseShear: PDF p.2: M s in the order (x_first,p_first,x_second,p_second), where M has blocks (I,S;S,I), S=(0,0;1,0).
  • controlledPhasePullback: PDF p.2: M-transpose k, the dual argument for exp(i k.R). This is not the inverse map or the active displacement shear.
  • twoModeDisplacement: PDF p.2, displacement convention: D(s_x+i s_p) shifts x,p by s_x,s_p. The symmetric Weyl displacement differs from the printed ordered X Z only by scalar phase; its action on density operators is exactly the same.
  • opticalWeyl: PDF p.2: W(k)=exp(i k.R) with the source's hbar=1/2. Since a=x+i p, its one-mode displacement argument is (-k_p+i k_x)/2.
  • RealizesControlledPhase: PDF p.2: bounded all-Weyl characterization of C_Z=exp(2i x_first x_second), up to scalar phase. Its Heisenberg action is U-adjoint R U=M R. Existence of an actual unitary satisfying this predicate is a theorem conclusion.
Definition code
import Mathlib
import Definitions.Def_QAlgorithms_Papers_Independent_Dependency50_P33
import Definitions.Def_QAlgorithms_Papers_Independent_Dependency50_P39
import Definitions.Def_QAlgorithms_Papers_Independent_Frontier30_P14

/-!
Ukai et al., arXiv:1107.0514v1, PDF pp.2,4, Fig.1(b) and note [18].

The independent-paper override permits pinned accepted paper modules as definition
providers. The completed two-mode space is l2(N x N), without a photon cutoff.
The optical normalization is x=(a+a-adjoint)/2, p=(a-a-adjoint)/(2i),
[x,p]=i/2 and vacuum variance 1/4. Only bounded Weyl operators are used.

This module states the ideal displacement propagation rule underlying composition.
The actual Bell/homodyne/feedforward instrument, its finite-squeezing predictions,
and the experimental claims are explicitly deferred in HARD.md and GAPS.json.
In particular, no normalized infinitely squeezed resource is introduced.
Compilation and independent moderation are pending the separate batch handoff.
-/

noncomputable section

open scoped BigOperators

namespace QAlgorithms.Papers.Independent.Advance50.P34

open QAlgorithms.RealRegisters (Hilbert)
open QAlgorithms.Papers.Independent.Dependency50.P33 (State productCoeff tensorApply)
open QAlgorithms.Papers.Independent.Dependency50.P39 (displacementMatrix)
open QAlgorithms.Papers.Independent.Frontier30.P14
  (unitaryCoeff boundedUnitaryConjugation)

/-- PDF p.2: M s in the order (x_first,p_first,x_second,p_second),
where M has blocks (I,S;S,I), S=(0,0;1,0). -/
def controlledPhaseShear (s : Fin 4 → ℝ) : Fin 4 → ℝ :=
  ![s 0, s 1 + s 2, s 2, s 3 + s 0]

/-- PDF p.2: M-transpose k, the dual argument for exp(i k.R).
This is not the inverse map or the active displacement shear. -/
def controlledPhasePullback (k : Fin 4 → ℝ) : Fin 4 → ℝ :=
  ![k 0 + k 3, k 1, k 2 + k 1, k 3]

/-- PDF p.2, displacement convention: D(s_x+i s_p) shifts x,p by s_x,s_p.
The symmetric Weyl displacement differs from the printed ordered X Z only
by scalar phase; its action on density operators is exactly the same. -/
def twoModeDisplacement (s : Fin 4 → ℝ) : Matrix (ℕ × ℕ) (ℕ × ℕ) ℂ :=
  productCoeff
    (displacementMatrix ((s 0 : ℂ) + Complex.I * (s 1 : ℂ)))
    (displacementMatrix ((s 2 : ℂ) + Complex.I * (s 3 : ℂ)))

/-- PDF p.2: W(k)=exp(i k.R) with the source's hbar=1/2.
Since a=x+i p, its one-mode displacement argument is (-k_p+i k_x)/2. -/
def opticalWeyl (k : Fin 4 → ℝ) : Matrix (ℕ × ℕ) (ℕ × ℕ) ℂ :=
  productCoeff
    (displacementMatrix ((-(k 1 : ℂ) + Complex.I * (k 0 : ℂ)) / 2))
    (displacementMatrix ((-(k 3 : ℂ) + Complex.I * (k 2 : ℂ)) / 2))

/-- PDF p.2: bounded all-Weyl characterization of C_Z=exp(2i x_first x_second),
up to scalar phase. Its Heisenberg action is U-adjoint R U=M R.
Existence of an actual unitary satisfying this predicate is a theorem conclusion. -/
def RealizesControlledPhase
    (U : Hilbert (ℕ × ℕ) ≃ₗᵢ[ℂ] Hilbert (ℕ × ℕ)) : Prop :=
  ∀ k : Fin 4 → ℝ,
    boundedUnitaryConjugation U.symm (opticalWeyl k) =
      opticalWeyl (controlledPhasePullback k)

/-- Sanity: a position displacement of the first mode produces the positive
momentum displacement of the second mode dictated by the source's C_Z sign. -/
example (s : Fin 4 → ℝ) : controlledPhaseShear s 3 = s 3 + s 0 := by
  rfl

/-- Sanity: the dual pullback adds the fourth Weyl coefficient to the first. -/
example (k : Fin 4 → ℝ) : controlledPhasePullback k 0 = k 0 + k 3 := by
  rfl

/-- Sanity: the undisplaced two-mode vacuum diagonal is one, not zero. -/
example : twoModeDisplacement 0 (0, 0) (0, 0) = 1 := by
  simp [twoModeDisplacement, productCoeff, displacementMatrix]

/-- Sanity: the zero Weyl parameter has unit two-mode vacuum expectation. -/
example : opticalWeyl 0 (0, 0) (0, 0) = 1 := by
  simp [opticalWeyl, productCoeff, displacementMatrix]

end QAlgorithms.Papers.Independent.Advance50.P34
Source
Demonstration of a Controlled-Phase Gate for Continuous-Variable One-Way Quantum Computation, arXiv:1107.0514v1, https://arxiv.org/abs/1107.0514v1
Read-back

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

QAlgorithms.Papers.Independent.Advance50.P34.RealizesControlledPhase

Let H=ℓ2(N×N;C)H=\ell^2(\mathbb N\times\mathbb N;\mathbb C)H=ℓ2(N×N;C), and let U:H→HU:H\to HU:H→H be a bijective complex-linear norm-preserving map. This defines the property that, for every real quadruple kkk, the following equality of matrices holds:

CU−1(Ok)=OP(k),P(k)=(k0+k3, k1, k2+k1, k3).C_{U^{-1}}(O_k)=O_{P(k)}, \qquad P(k)=(k_0+k_3,\ k_1,\ k_2+k_1,\ k_3).CU−1​(Ok​)=OP(k)​,P(k)=(k0​+k3​, k1​, k2​+k1​, k3​).

Here, writing eae_aea​ for the vector with coordinate 111 at aaa and 000 elsewhere, the matrix transformation associated with any such map WWW is defined entrywise by

CW(X)p,q=∑a∈N2(Wea)p(∑b∈N2Xa,b (Web)q‾),C_W(X)_{p,q} =\sum_{a\in\mathbb N^2}(We_a)_p \left(\sum_{b\in\mathbb N^2}X_{a,b}\, \overline{(We_b)_q}\right),CW​(X)p,q​=a∈N2∑​(Wea​)p​(b∈N2∑​Xa,b​(Web​)q​​),

and the matrices OkO_kOk​ are explicitly

(Ok)(a,c),(b,d)=D ⁣(−k1+ik02)a,bD ⁣(−k3+ik22)c,d,D(z)m,n=e−∣z∣2/2m! n!∑j=0min⁡(m,n)zm−j(−z‾)n−jj! (m−j)! (n−j)!.(O_k)_{(a,c),(b,d)} =D\!\left(\frac{-k_1+\mathrm i k_0}{2}\right)_{a,b} D\!\left(\frac{-k_3+\mathrm i k_2}{2}\right)_{c,d}, \qquad D(z)_{m,n} =e^{-|z|^2/2}\sqrt{m!\,n!} \sum_{j=0}^{\min(m,n)} \frac{z^{m-j}(-\overline z)^{n-j}} {j!\,(m-j)!\,(n-j)!}.(Ok​)(a,c),(b,d)​=D(2−k1​+ik0​​)a,b​D(2−k3​+ik2​​)c,d​,D(z)m,n​=e−∣z∣2/2m!n!​j=0∑min(m,n)​j!(m−j)!(n−j)!zm−j(−z)n−j​.

The nested infinite sums in CWC_WCW​ are the specified total complex sums: an individual nonsummable family has sum zero. The equality is required for every kkk, including the zero quadruple, and for every row and column index.

QAlgorithms.Papers.Independent.Advance50.P34.controlledPhasePullback

For every real quadruple k=(k0,k1,k2,k3)k=(k_0,k_1,k_2,k_3)k=(k0​,k1​,k2​,k3​), this defines the real quadruple

P(k)=(k0+k3, k1, k2+k1, k3).P(k)=(k_0+k_3,\ k_1,\ k_2+k_1,\ k_3).P(k)=(k0​+k3​, k1​, k2​+k1​, k3​).

There are no restrictions on the four coordinates.

QAlgorithms.Papers.Independent.Advance50.P34.controlledPhaseShear

For every real quadruple s=(s0,s1,s2,s3)s=(s_0,s_1,s_2,s_3)s=(s0​,s1​,s2​,s3​), this defines the real quadruple

S(s)=(s0, s1+s2, s2, s3+s0).S(s)=(s_0,\ s_1+s_2,\ s_2,\ s_3+s_0).S(s)=(s0​, s1​+s2​, s2​, s3​+s0​).

There are no restrictions on the four coordinates.

QAlgorithms.Papers.Independent.Advance50.P34.opticalWeyl

For every real quadruple k=(k0,k1,k2,k3)k=(k_0,k_1,k_2,k_3)k=(k0​,k1​,k2​,k3​), this defines a complex matrix OkO_kOk​ whose rows and columns are indexed by N×N\mathbb N\times\mathbb NN×N, with entries

(Ok)(a,c),(b,d)=D ⁣(−k1+ik02)a,b D ⁣(−k3+ik22)c,d,(O_k)_{(a,c),(b,d)} =D\!\left(\frac{-k_1+\mathrm i k_0}{2}\right)_{a,b}\, D\!\left(\frac{-k_3+\mathrm i k_2}{2}\right)_{c,d},(Ok​)(a,c),(b,d)​=D(2−k1​+ik0​​)a,b​D(2−k3​+ik2​​)c,d​,

where, for every z∈Cz\in\mathbb Cz∈C and m,n∈Nm,n\in\mathbb Nm,n∈N,

D(z)m,n=e−∣z∣2/2m! n!∑j=0min⁡(m,n)zm−j(−z‾)n−jj! (m−j)! (n−j)!.D(z)_{m,n} =e^{-|z|^2/2}\sqrt{m!\,n!} \sum_{j=0}^{\min(m,n)} \frac{z^{m-j}(-\overline z)^{n-j}} {j!\,(m-j)!\,(n-j)!}.D(z)m,n​=e−∣z∣2/2m!n!​j=0∑min(m,n)​j!(m−j)!(n−j)!zm−j(−z)n−j​.

All natural-number indices include zero, with 0!=10!=10!=1 and zeroth powers equal to 111. The quadruple kkk is unrestricted, and this definition itself asserts only the displayed matrix formula.

QAlgorithms.Papers.Independent.Advance50.P34.twoModeDisplacement

For every real quadruple s=(s0,s1,s2,s3)s=(s_0,s_1,s_2,s_3)s=(s0​,s1​,s2​,s3​), this defines a complex matrix TsT_sTs​ whose rows and columns are indexed by N×N\mathbb N\times\mathbb NN×N, with entries

(Ts)(a,c),(b,d)=D(s0+is1)a,b D(s2+is3)c,d,(T_s)_{(a,c),(b,d)} =D(s_0+\mathrm i s_1)_{a,b}\, D(s_2+\mathrm i s_3)_{c,d},(Ts​)(a,c),(b,d)​=D(s0​+is1​)a,b​D(s2​+is3​)c,d​,

where, for every z∈Cz\in\mathbb Cz∈C and m,n∈Nm,n\in\mathbb Nm,n∈N,

D(z)m,n=e−∣z∣2/2m! n!∑j=0min⁡(m,n)zm−j(−z‾)n−jj! (m−j)! (n−j)!.D(z)_{m,n} =e^{-|z|^2/2}\sqrt{m!\,n!} \sum_{j=0}^{\min(m,n)} \frac{z^{m-j}(-\overline z)^{n-j}} {j!\,(m-j)!\,(n-j)!}.D(z)m,n​=e−∣z∣2/2m!n!​j=0∑min(m,n)​j!(m−j)!(n−j)!zm−j(−z)n−j​.

All natural-number indices include zero; the finite sum includes both endpoints, 0!=10!=10!=1, and zeroth powers are 111, including when their base is zero. This definition specifies matrix entries without asserting that they represent a bounded or unitary operator.

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

    Confirmed by the moderator at approval.

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