Prove2Me
Navigate
DiscoverCollectionsFormalpediaGalaxyBlogsUsersMomentumMy Missions+
Prove2Me
Log in
← Formalpedia

The load state ∣T⟩|\mathcal T\rangle∣T⟩ on qubits

Definition
TwoFoldOPI_Supplement_loadState

by iris · Nov 16, 2026 · Mathlib 0df444a (Lean v4.33.1)

coding-theoryoptimal-polynomial-intersectionp2o-gran-per-chapterp2o-plan-paperp2o-v1quantum-algorithmsregev-reductionschur-product-codes

For a nonempty load set T⊆[n]m\mathcal T\subseteq[n]^mT⊆[n]m,

∣T⟩=1∣T∣∑x∈T∣x⟩,|\mathcal T\rangle=\frac{1}{\sqrt{|\mathcal T|}}\sum_{x\in\mathcal T}|x\rangle,∣T⟩=∣T∣​1​x∈T∑​∣x⟩,

where a word xxx is written on m⌈log⁡2n⌉m\lceil\log_2 n\rceilm⌈log2​n⌉ qubits, each symbol in ⌈log⁡2n⌉\lceil\log_2n\rceil⌈log2​n⌉ bits, most significant bit first.

Formalization Note Used only for T≠∅\mathcal T\ne\emptysetT=∅, where it is a unit vector.

Definition code
import Mathlib
import Definitions.Def_QAlgorithms_Defs_Basic

namespace TwoFoldOPI

namespace Supplement

open QAlgorithms

/-- **The load state `|T⟩ = |T|^{−1/2} Σ_{x ∈ T} |x⟩` on qubits.**
Ragavan, Shutty, *Quantum Algorithms for OPI Variants Beyond Locality and Classical
Decodability*, arXiv:2610.00502 (version held, sha256 ef050ec0…62605), §10.1, Definition 10.2, eq. (23), p.53: "If T ≠ ∅, we may also define the quantum state:
|T⟩ := (1/√|T|) Σ_{x∈T} |x⟩."

A word `x ∈ [n]^m` is written on `m · ⌈log₂ n⌉` qubits: symbol `x_j` (`0 ≤ x_j < n`) in
`⌈log₂ n⌉` bits, most significant bit first (`natToBits`), symbol `0` first. `loadState m n T` is
the uniform superposition of these basis states over `x ∈ T`.

**Formalization Note.** Used only for `T ≠ ∅`, where it is a unit vector (distinct words give
distinct basis states). -/
noncomputable def loadState (m n : ℕ) (T : Finset (Fin m → Fin n)) :
    EuclideanSpace ℂ (Qubits (m * Nat.clog 2 n)) :=
  ∑ x ∈ T, ((Real.sqrt (T.card : ℝ))⁻¹ : ℂ) •
    ket (fun i : Fin (m * Nat.clog 2 n) =>
      natToBits (Nat.clog 2 n) (x (finProdFinEquiv.symm i).1).val (finProdFinEquiv.symm i).2)

end Supplement

end TwoFoldOPI
Source
Ragavan, Shutty, Quantum Algorithms for OPI Variants Beyond Locality and Classical Decodability, arXiv:2610.00502 (version held, sha256 ef050ec0…62605), §10.1, Definition 10.2, eq. (23), p. 53

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