Skip to content
Open access

Granthi: Higher-Order Quantum Programming via Unitary Wiring

Aug 2026 · Proceedings of the ACM on Programming Languages · Vol 10, pp. 1384 - 1410 · 0 citations · 39 references
Physics Computer Science

TL;DR

Granthi is 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.

Abstract

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.

Read PDF

Similar papers

Preprint Oct 2026

Breaking the chain: geometry-native state preparation with ASPIRE

Loading data into quantum computers is a key bottleneck that threatens end-to-end quantum advantage. Quantum-circuit compilers for structured states like matrix product states (MPS) are a critical enabler to manage this in quantum chemistry, finance, and many-body quantum simulation. Approximate preparation of MPS typi...

Fredrik Hasselgren, Matthew L. Sims-Goh · 0 citations
Preprint Sep 2026

Why Are We Unrolling? The Importance of Structured Quantum Programs for Compilation

This work presents important patterns and algorithms from fault-tolerant quantum applications which admit a structured representation that it is argued is crucial to preserve, and sets a challenge to the community to compile such representations without unrolling them into straight-line quantum circuits.

Damian Rovara, Daniel Haag, Mark Koch et al. · 0 citations
Preprint Aug 2026

Witnessing the architecture of quantum circuits

A general framework to define quantum circuit architecture witnesses, which certify the incompatibility of a unitary transformation with a specified quantum circuit architecture, and exploit the stabiliser formalism to reduce the construction to linear programming.

R. Mothe, O. Gühne · 0 citations
Preprint Sep 2026

Quantum computers will not be that different: A blueprint for quantum computer architecture at scale

It is argued that utility-scale quantum architecture is primarily a cost-performance problem across a coupled quantum-classical system, leading to a blueprint for scalable quantum processing unit (QPU) design, which closely resembles the architecture of high-performance network stacks.

T. Hoefler, M. Troyer · 0 citations
Preprint Oct 2026

Avoiding Exponentially Large Groups with Open Quantum System Technology

We propose a novel approach to state preparation by embracing the full power of open quantum systems. Instead of working with the whole unitary group in $n$ qubits, we identify a small Lie group $G$ in $(n+3)$ qubits. The dimension of its Lie algebra is $\text{poly}(n)$. Every state can be approximated starting from an...

Ji-Hong Cai, Advith Govindarajan, M. Junge · 0 citations

We use cookies to run the site and, with your consent, for analytics and to show ads. See our Cookie Policy.