一句话:提出纯酉高阶量子语言 Granthi,让量子程序成为可传递、相干复合的一等值并编译为静态量子电路。
现有量子编程语言把高阶结构局限在经典宿主语言中,量子层只能对量子比特做一阶操作。本文提出 Granthi——一种纯酉(purely unitary)的高阶量子编程语言,基于三条设计准则:量子程序是一等值,可被传递、返回并相干地复合;加法结构被实现为保持标签的路由而非可观测分支,因此控制可以处于叠加态;面向程序员的有限标签类型与具名可逆操作为其提供领域级控制空间而无需暴露标签管理。语言保证每个良类型项(包括函数类型的项)都在其边界接口上表示一个酉算子,编译器则把这一连线精确实现为物理量子比特布局上的量子电路(假设 pytket 后端正确)。Granthi 已端到端实现:一个 OCaml DSL 通过无 binder 的核心 IR 将表层程序 elaboration 为经 pytket 生成的可执行量子电路。该语言直接支持量子 switch(论文的贯穿示例,被编译为静态电路),以及控制流历史上的干涉与结构化有限控制。
Existing quantum programming languages confine higher-order structure to a classical host while restricting the quantum layer to first-order operations on qubits. This paper presents Granthi, a purely unitary higher-order quantum programming language built on three design commitments: quantum programs are first-class values that may be passed, returned, and coherently composed; additive structure is tag-preserving routing rather than observational branching, so control may remain in superposition; and programmer-facing finite label types with named reversible operations provide domain-level control spaces without exposing tag management. Every well-typed term—including at function type—denotes a unitary on its boundary interface, and the compiler realizes exactly its wiring as a quantum circuit on the physical qubit layout (assuming correctness of the pytket backend). Granthi is implemented end-to-end: an OCaml DSL elaborates surface programs through a binder-free core IR to executable quantum circuits via pytket. The language directly supports the quantum switch—the paper’s running example, compiled to a static circuit—as well as interference on control-flow history and structured finite control, all within the purely unitary fragment.
@article{paperbot12096,
title = {Granthi: Higher-Order Quantum Programming via Unitary Wiring},
author = {Samson Abramsky and Radha Jagadeesan},
journal = {Proceedings of the ACM on Programming Languages},
volume = {10},
number = {OOPSLA2},
year = {2026},
doi = {10.1145/3839496}
}