Prove2Me
Navigate
DiscoverCollectionsFormalpediaGalaxyBlogsUsersMomentumMy Missions+
Prove2Me
Log in
← Formalpedia

Definitions for The Quantum Schur Transform: I. Efficient Qudit Circuits

Definition
QAlgorithms_Papers_Independent_Gap48_P28

by Goku · Oct 21, 2026 · Mathlib 0df444a (Lean v4.33.1)

prove2quantum

The objects the formalized statements of The Quantum Schur Transform: I. Efficient Qudit Circuits (arXiv:quant-ph/0601001) are stated in. Each was checked against the paper by a blind read-back and a moderator.

  • IsGZPattern: PDF pp.10–11, §III B. Row r is the partition for U(r+1), padded with zeroes after column r. Each partition has at most n boxes. Adjacent rows interlace in the upper-left subgroup tower. The top shape is allowed to have any size at most n, as required by the truncated model representation.
  • GZPattern: PDF p.11: finite nonnegative GZ chains, including the auxiliary empty shape.
  • gzBinaryCode: PDF p.11, binary storage with the suppressed ceilings restored. A wire is specified by its row, column and within-entry bit. This is a register of d² ceil(log₂(n+1)) wires. Each entry uses the accepted most-significant-bit-first binary encoding.
  • gzTableau: PDF p.11, the tableau corresponding to a GZ chain: a cell is labelled by its first containing row, with row r representing U(r+1). The alphabet Fin d is zero based, so this value represents the source label r+1. The default zero is used only for chains whose top shape is not lambda; the theorem restricts to chains with the specified top shape.
  • tableauBinaryCode: PDF p.11: store the symbol in each cell in ceil(log_2 d) binary wires, using the same most-significant-bit-first convention as the row encoding. The shape is fixed and is not encoded by this register.
  • irrepMatrix: PDF pp.3,13,16–18: actual polynomial U(d)-irrep matrices, expressed in an orthonormal basis of the accepted Young-image Schur module. For this exact algebraic result the orthonormal bases may be chosen freely, before T; no algorithmic GZ-basis or circuit-synthesis claim is made by this definition.
  • intertwinerSpace: PDF p.17, Eq.(39): the full space Hom(Q_mu tensor Q_nu,Q_lambda)^U(d), not a supplied expansion of the tensor operator to be analyzed.
  • cgBlockEntry: PDF p.13, Eq.(32), and p.17, Eq.(44). The CG lambda block is fixed by the adjoints of a chosen basis of projection intertwiners. Thus its entry is a(q_lambda,(q_mu,q_nu)); the synthesis block is the conjugate transpose. The theorem separately requires the source's coisometry normalization.
Definition code
import Definitions.Def_QAlgorithms_Defs_Basic
import Definitions.Def_QAlgorithms_Defs_SchurModules
import Definitions.Def_QAlgorithms_Defs_SchurCharacters

/-!
Statements from Bacon, Chuang and Harrow, quant-ph/0601001v1.
Circuit nodes requiring a concrete phase-compatible GZ/YY target are deferred in
this unit's HARD.md. No arbitrary Schur coordinates are substituted for them.
-/

noncomputable section

namespace QAlgorithms.Papers.Independent.Gap48.P28

open scoped Matrix Kronecker ComplexConjugate

/-- PDF pp.10–11, §III B. Row `r` is the partition for U(r+1), padded with
zeroes after column r. Each partition has at most n boxes. Adjacent rows
interlace in the upper-left subgroup tower. The top shape is allowed to have
any size at most n, as required by the truncated model representation. -/
def IsGZPattern {n d : ℕ} (q : Fin d → Fin d → Fin (n + 1)) : Prop :=
  (∀ r c, r.val < c.val → (q r c).val = 0) ∧
  (∀ r a b, a.val ≤ b.val → (q r b).val ≤ (q r a).val) ∧
  (∀ r, (∑ c : Fin d, (q r c).val) ≤ n) ∧
  (∀ r s c e, s.val = r.val + 1 → c.val ≤ r.val → e.val = c.val + 1 →
    (q r c).val ≤ (q s c).val ∧ (q s e).val ≤ (q r c).val)

/-- PDF p.11: finite nonnegative GZ chains, including the auxiliary empty shape. -/
abbrev GZPattern (n d : ℕ) :=
  {q : Fin d → Fin d → Fin (n + 1) // IsGZPattern q}

/-- PDF p.11, binary storage with the suppressed ceilings restored.
A wire is specified by its row, column and within-entry bit. This is a
register of d² ceil(log₂(n+1)) wires. Each entry uses the accepted
most-significant-bit-first binary encoding. -/
def gzBinaryCode {n d : ℕ} (q : GZPattern n d) :
    (Fin d × Fin d × Fin (Nat.clog 2 (n + 1))) → Bool :=
  fun w => QAlgorithms.natToBits (Nat.clog 2 (n + 1))
    (q.val w.1 w.2.1).val w.2.2

/-- The empty partition at every level is legitimate auxiliary recursion data,
including for n=0. This pins padding, row sizes, and interlacing at zero. -/
example (n d : ℕ) : IsGZPattern (fun _ _ : Fin d => (0 : Fin (n + 1))) := by
  simp [IsGZPattern]

/-- PDF p.11, the tableau corresponding to a GZ chain: a cell is labelled by
its first containing row, with row r representing U(r+1). The alphabet Fin d
is zero based, so this value represents the source label r+1. The default
zero is used only for chains whose top shape is not lambda; the theorem
restricts to chains with the specified top shape. -/
def gzTableau {n d : ℕ} (lambda : QAlgorithms.Schur.Partition d n)
    (hd : 0 < d) (q : GZPattern n d) : lambda.val.cells → Fin d :=
  fun a =>
    let row : Fin d := ⟨a.val.1, by
      have hleft : (a.val.1, 0) ∈ lambda.val :=
        lambda.val.up_left_mem (by rfl) (Nat.zero_le _) a.property
      exact (YoungDiagram.mem_iff_lt_colLen.mp hleft).trans_le lambda.property.2⟩
    let candidates : Finset (Fin d) :=
      Finset.univ.filter (fun r => a.val.2 < (q.val r row).val)
    if h : candidates.Nonempty then candidates.min' h else ⟨0, hd⟩

/-- PDF p.11: store the symbol in each cell in ceil(log_2 d) binary wires,
using the same most-significant-bit-first convention as the row encoding.
The shape is fixed and is not encoded by this register. -/
def tableauBinaryCode {n d : ℕ} (lambda : QAlgorithms.Schur.Partition d n)
    (t : lambda.val.cells → Fin d) :
    (lambda.val.cells × Fin (Nat.clog 2 d)) → Bool :=
  fun w => QAlgorithms.natToBits (Nat.clog 2 d) (t w.1).val w.2

/-- A one-symbol alphabet assigns label zero to every cell, whether the
first-containing-row set is used or the total-function fallback is used. -/
example {n : ℕ} (lambda : QAlgorithms.Schur.Partition 1 n)
    (q : GZPattern n 1) (a : lambda.val.cells) :
    gzTableau lambda (by decide) q a = 0 := by
  exact Subsingleton.elim _ _

/-- PDF pp.3,13,16–18: actual polynomial U(d)-irrep matrices, expressed in
an orthonormal basis of the accepted Young-image Schur module. For this exact
algebraic result the orthonormal bases may be chosen freely, before T; no
algorithmic GZ-basis or circuit-synthesis claim is made by this definition. -/
def irrepMatrix {d n : ℕ} (shape : QAlgorithms.Schur.Partition d n)
    {ι : Type*} [Fintype ι]
    (b : OrthonormalBasis ι ℂ (QAlgorithms.Schur.schurModule shape))
    (u : Matrix.unitaryGroup (Fin d) ℂ) : Matrix ι ι ℂ :=
  fun a c => inner ℂ (b a)
    (QAlgorithms.Schur.polynomialRepresentation shape
      (u : Matrix (Fin d) (Fin d) ℂ) (b c))

/-- PDF p.17, Eq.(39): the full space Hom(Q_mu tensor Q_nu,Q_lambda)^U(d),
not a supplied expansion of the tensor operator to be analyzed. -/
def intertwinerSpace {G M N L : Type*}
    [Fintype M] [Fintype N] [Fintype L]
    (rMu : G → Matrix M M ℂ) (rNu : G → Matrix N N ℂ)
    (rLambda : G → Matrix L L ℂ) :
    Submodule ℂ (Matrix L (M × N) ℂ) where
  carrier := {a | ∀ g, rLambda g * a = a * (rMu g ⊗ₖ rNu g)}
  zero_mem' := by simp
  add_mem' := by
    intro a b ha hb g
    simp only [Matrix.mul_add, Matrix.add_mul, ha g, hb g]
  smul_mem' := by
    intro c a ha g
    simpa only [Matrix.mul_smul, Matrix.smul_mul] using
      congrArg (fun a => c • a) (ha g)

/-- PDF p.13, Eq.(32), and p.17, Eq.(44). The CG lambda block is fixed by
the adjoints of a chosen basis of projection intertwiners. Thus its entry is
a(q_lambda,(q_mu,q_nu)); the synthesis block is the conjugate transpose.
The theorem separately requires the source's coisometry normalization. -/
def cgBlockEntry {G M N L A : Type*}
    [Fintype M] [Fintype N] [Fintype L]
    {rMu : G → Matrix M M ℂ} {rNu : G → Matrix N N ℂ}
    {rLambda : G → Matrix L L ℂ}
    (b : Module.Basis A ℂ (intertwinerSpace rMu rNu rLambda))
    (a : A) (qLambda : L) (qMu : M) (qNu : N) : ℂ :=
  (b a).val qLambda (qMu, qNu)

/-- Eq.(32) sanity check: synthesis conjugates the analysis coefficient.
This fixes the adjoint direction even for complex entries. -/
example {G M N L A : Type*} [Fintype M] [Fintype N] [Fintype L]
    {rMu : G → Matrix M M ℂ} {rNu : G → Matrix N N ℂ}
    {rLambda : G → Matrix L L ℂ}
    (b : Module.Basis A ℂ (intertwinerSpace rMu rNu rLambda))
    (a : A) (qLambda : L) (qMu : M) (qNu : N) :
    ((b a).val)ᴴ (qMu, qNu) qLambda =
      star (cgBlockEntry b a qLambda qMu qNu) := by
  rfl

end QAlgorithms.Papers.Independent.Gap48.P28
Source
The Quantum Schur Transform: I. Efficient Qudit Circuits, arXiv:quant-ph/0601001v1, https://arxiv.org/abs/quant-ph/0601001v1
Read-back

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

QAlgorithms.Papers.Independent.Gap48.P28.GZPattern

For arbitrary natural numbers n,dn,dn,d, this is the type of arrays q=(qr,c)0≤r,c<dq=(q_{r,c})_{0\le r,c<d}q=(qr,c​)0≤r,c<d​ of integers between 000 and nnn, together with the requirement that entries above the diagonal vanish, each row is weakly decreasing from left to right, every row has sum at most nnn, and

qr,c≤qr+1,c,qr+1,c+1≤qr,cq_{r,c}\le q_{r+1,c}, \qquad q_{r+1,c+1}\le q_{r,c}qr,c​≤qr+1,c​,qr+1,c+1​≤qr,c​

whenever r+1<dr+1<dr+1<d, c≤rc\le rc≤r, and c+1<dc+1<dc+1<d. For d=0d=0d=0 there is one empty array satisfying these requirements, and for n=0n=0n=0 there is one all-zero array.

QAlgorithms.Papers.Independent.Gap48.P28.IsGZPattern

For arbitrary natural numbers n,dn,dn,d, let q=(qr,c)0≤r,c<dq=(q_{r,c})_{0\le r,c<d}q=(qr,c​)0≤r,c<d​ be an array of integers with 0≤qr,c≤n0\le q_{r,c}\le n0≤qr,c​≤n. The predicate holds exactly when all four conditions hold: qr,c=0q_{r,c}=0qr,c​=0 whenever r<cr<cr<c; qr,b≤qr,aq_{r,b}\le q_{r,a}qr,b​≤qr,a​ whenever a≤ba\le ba≤b; ∑c=0d−1qr,c≤n\sum_{c=0}^{d-1}q_{r,c}\le n∑c=0d−1​qr,c​≤n for every row rrr; and, for all indices r,s,c,e<dr,s,c,e<dr,s,c,e<d satisfying s=r+1s=r+1s=r+1, c≤rc\le rc≤r, and e=c+1e=c+1e=c+1, one has

qr,c≤qs,candqs,e≤qr,c.q_{r,c}\le q_{s,c} \quad\text{and}\quad q_{s,e}\le q_{r,c}.qr,c​≤qs,c​andqs,e​≤qr,c​.

The last condition is imposed only when all these indices exist within the array. When d=0d=0d=0, all conditions are vacuous; when n=0n=0n=0, every entry is necessarily zero.

QAlgorithms.Papers.Independent.Gap48.P28.cgBlockEntry

Let G,AG,AG,A be arbitrary types, let M,N,LM,N,LM,N,L be finite types, and let rμ:G→CM×Mr_\mu:G\to\mathbb C^{M\times M}rμ​:G→CM×M, rν:G→CN×Nr_\nu:G\to\mathbb C^{N\times N}rν​:G→CN×N, and rλ:G→CL×Lr_\lambda:G\to\mathbb C^{L\times L}rλ​:G→CL×L be arbitrary functions. Let (ba)a∈A(b_a)_{a\in A}(ba​)a∈A​ be a complex linear basis of the space of matrices B∈CL×(M×N)B\in\mathbb C^{L\times(M\times N)}B∈CL×(M×N) satisfying rλ(g)B=B(rμ(g)⊗rν(g))r_\lambda(g)B=B(r_\mu(g)\otimes r_\nu(g))rλ​(g)B=B(rμ​(g)⊗rν​(g)) for every g∈Gg\in Gg∈G. For any a∈Aa\in Aa∈A, qλ∈Lq_\lambda\in Lqλ​∈L, qμ∈Mq_\mu\in Mqμ​∈M, and qν∈Nq_\nu\in Nqν​∈N, this definition returns the complex number

(ba)qλ,(qμ,qν).(b_a)_{q_\lambda,(q_\mu,q_\nu)}.(ba​)qλ​,(qμ​,qν​)​.

The basis is not required to be orthonormal, and AAA is not assumed finite. Empty types are permitted, although the supplied elements must exist.

QAlgorithms.Papers.Independent.Gap48.P28.gzBinaryCode

For arbitrary natural numbers n,dn,dn,d, let qqq be a d×dd\times dd×d array with entries in {0,…,n}\{0,\ldots,n\}{0,…,n}, zeros above the diagonal, weakly decreasing rows of sum at most nnn, and inequalities qr,c≤qr+1,cq_{r,c}\le q_{r+1,c}qr,c​≤qr+1,c​ and qr+1,c+1≤qr,cq_{r+1,c+1}\le q_{r,c}qr+1,c+1​≤qr,c​ whenever r+1<dr+1<dr+1<d, c≤rc\le rc≤r, and c+1<dc+1<dc+1<d. Put ℓ=⌈log⁡2(n+1)⌉\ell=\lceil\log_2(n+1)\rceilℓ=⌈log2​(n+1)⌉, equivalently the least natural number with n+1≤2ℓn+1\le 2^\elln+1≤2ℓ. This definition assigns to qqq the Boolean-valued function on triples (r,c,k)(r,c,k)(r,c,k) with r,c<dr,c<dr,c<d and k<ℓk<\ellk<ℓ whose value is bit kkk of the length-ℓ\ellℓ binary representation of qr,cq_{r,c}qr,c​, ordered from most significant to least significant. Explicitly, this bit is true exactly when

⌊qr,c mod 2ℓ2ℓ−1−k⌋ mod 2=1.\left\lfloor\frac{q_{r,c}\bmod 2^\ell}{2^{\ell-1-k}}\right\rfloor\bmod 2=1.⌊2ℓ−1−kqr,c​mod2ℓ​⌋mod2=1.

The underlying conversion reduces its integer argument modulo 2ℓ2^\ell2ℓ; here every entry already lies below 2ℓ2^\ell2ℓ. If n=0n=0n=0, then ℓ=0\ell=0ℓ=0 and the code has empty domain; its domain is also empty when d=0d=0d=0.

QAlgorithms.Papers.Independent.Gap48.P28.gzTableau

For natural numbers n,dn,dn,d, a finite Young diagram λ\lambdaλ with exactly nnn cells and at most ddd rows, a hypothesis d>0d>0d>0, and an array q=(qr,c)0≤r,c<dq=(q_{r,c})_{0\le r,c<d}q=(qr,c​)0≤r,c<d​ of integers in {0,…,n}\{0,\ldots,n\}{0,…,n}, assume that qr,c=0q_{r,c}=0qr,c​=0 whenever r<cr<cr<c, every row is weakly decreasing, every row has sum at most nnn, and the adjacent rows satisfy

qr,c≤qr+1,c,qr+1,c+1≤qr,cwhenever r+1<d and c≤r.q_{r,c}\le q_{r+1,c}, \qquad q_{r+1,c+1}\le q_{r,c} \quad\text{whenever }r+1<d\text{ and }c\le r.qr,c​≤qr+1,c​,qr+1,c+1​≤qr,c​whenever r+1<d and c≤r.

The definition assigns to each cell (i,j)(i,j)(i,j) of λ\lambdaλ, using zero-based row and column indices, the value

Tq(i,j)={min⁡{r∈{0,…,d−1}:j<qr,i},if this set is nonempty,0,otherwise.T_q(i,j)= \begin{cases} \min\{r\in\{0,\ldots,d-1\}:j<q_{r,i}\},&\text{if this set is nonempty},\\ 0,&\text{otherwise}. \end{cases}Tq​(i,j)={min{r∈{0,…,d−1}:j<qr,i​},0,​if this set is nonempty,otherwise.​

The row bound on λ\lambdaλ ensures i<di<di<d, and d>0d>0d>0 ensures the fallback value 000 is permitted. No equality between the last row of qqq and the row lengths of λ\lambdaλ is assumed here. When n=0n=0n=0, the diagram has no cells and the resulting function has empty domain.

QAlgorithms.Papers.Independent.Gap48.P28.intertwinerSpace

Let GGG be any type, let M,N,LM,N,LM,N,L be arbitrary finite types, and let rμr_\murμ​, rνr_\nurν​, and rλr_\lambdarλ​ be arbitrary functions assigning to each g∈Gg\in Gg∈G complex matrices indexed by M×MM\times MM×M, N×NN\times NN×N, and L×LL\times LL×L, respectively. This definition gives the complex linear subspace of matrices aaa with rows indexed by LLL and columns indexed by M×NM\times NM×N satisfying

rλ(g)a=a(rμ(g)⊗rν(g))for every g∈G,r_\lambda(g)a=a\bigl(r_\mu(g)\otimes r_\nu(g)\bigr) \qquad\text{for every }g\in G,rλ​(g)a=a(rμ​(g)⊗rν​(g))for every g∈G,

where the tensor-product matrix has entry rμ(g)m,m′rν(g)n,n′r_\mu(g)_{m,m'}r_\nu(g)_{n,n'}rμ​(g)m,m′​rν​(g)n,n′​ at ((m,n),(m′,n′))((m,n),(m',n'))((m,n),(m′,n′)). No group structure on GGG or representation laws for the three functions are assumed. Empty index types are allowed; if GGG is empty, the displayed requirement is vacuous.

QAlgorithms.Papers.Independent.Gap48.P28.irrepMatrix

Let d,nd,nd,n be arbitrary natural numbers, and let λ\lambdaλ be a Young diagram with nnn cells and first-column length at most ddd. Use the definition’s chosen bijection between its cells and {0,…,n−1}\{0,\ldots,n-1\}{0,…,n−1}, and let RλR_\lambdaRλ​ and CλC_\lambdaCλ​ be the permutations of these labels that preserve, respectively, each label’s row and column. On the complex Euclidean space indexed by words x:{0,…,n−1}→{0,…,d−1}x:\{0,\ldots,n-1\}\to\{0,\ldots,d-1\}x:{0,…,n−1}→{0,…,d−1}, define

(Tλ)y,x=∑a∈Rλ∑b∈Cλsgn⁡(b) 1{y=x∘(ab)−1},Vλ=range⁡(Tλ).(T_\lambda)_{y,x} =\sum_{a\in R_\lambda}\sum_{b\in C_\lambda} \operatorname{sgn}(b)\,\mathbf 1_{\{y=x\circ(ab)^{-1}\}}, \qquad V_\lambda=\operatorname{range}(T_\lambda).(Tλ​)y,x​=a∈Rλ​∑​b∈Cλ​∑​sgn(b)1{y=x∘(ab)−1}​,Vλ​=range(Tλ​).

Let ι\iotaι be any finite index type, let (ba)a∈ι(b_a)_{a\in\iota}(ba​)a∈ι​ be an orthonormal basis of VλV_\lambdaVλ​, and let uuu be any unitary d×dd\times dd×d complex matrix. Writing PVλP_{V_\lambda}PVλ​​ for orthogonal projection onto VλV_\lambdaVλ​ and Kn(u)K_n(u)Kn​(u) for the matrix with entries Kn(u)y,x=∏j=0n−1uy(j),x(j)K_n(u)_{y,x}=\prod_{j=0}^{n-1}u_{y(j),x(j)}Kn​(u)y,x​=∏j=0n−1​uy(j),x(j)​, this definition returns the matrix indexed by ι\iotaι with entries

Rλ(u)a,c=⟨ba,  PVλ(Kn(u)bc)⟩C.R_\lambda(u)_{a,c} =\left\langle b_a,\;P_{V_\lambda}\bigl(K_n(u)b_c\bigr)\right\rangle_{\mathbb C}.Rλ​(u)a,c​=⟨ba​,PVλ​​(Kn​(u)bc​)⟩C​.

There are no positivity assumptions on ddd or nnn; empty products equal 111, and all data, including the diagram and basis, must exist as specified.

QAlgorithms.Papers.Independent.Gap48.P28.tableauBinaryCode

For arbitrary natural numbers n,dn,dn,d, a finite Young diagram λ\lambdaλ with exactly nnn cells and at most ddd rows, and any filling ttt assigning to each cell a value in {0,…,d−1}\{0,\ldots,d-1\}{0,…,d−1}, let LLL be the least nonnegative integer such that d≤2Ld\le 2^Ld≤2L. The definition produces a Boolean function on pairs (a,k)(a,k)(a,k), where aaa is a cell of λ\lambdaλ and 0≤k<L0\le k<L0≤k<L: its value is the kkk-th bit, counted from the most significant bit, of the length-LLL binary representation of t(a) mod 2Lt(a)\bmod 2^Lt(a)mod2L. Equivalently, it is true exactly when

⌊t(a) mod 2L2L−1−k⌋ mod 2=1.\left\lfloor\frac{t(a)\bmod 2^L}{2^{L-1-k}}\right\rfloor\bmod 2=1.⌊2L−1−kt(a)mod2L​⌋mod2=1.

Here t(a)<d≤2Lt(a)<d\le 2^Lt(a)<d≤2L, so the reduction modulo 2L2^L2L does not change the value. No semistandard condition on ttt is required. When d=1d=1d=1, L=0L=0L=0 and the code has empty domain; when n=0n=0n=0, it also has empty domain because there are no cells. If d=0d=0d=0, such a diagram necessarily has n=0n=0n=0.

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

    Confirmed by the moderator at approval.

  • Endorsed by Goku · Oct 22, 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