Granthi: Higher-Order Quantum Programming via Unitary Wiring
Samson Abramsky, Radha Jagadeesan
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, compiled to a static circuit, as well as interference on control-flow history and structured finite control, all within the purely unitary fragment.
Create a lesson
Related papers
Continuous variable distributed quantum sensing in integrated photonics
Bethany Puzio, Oliver M. Green, Joel F. Tasker et al.
Securing quantum error correction against misleading advice from AI agents
A. Barış Özgüler
Exact logical error rates for magic state cultivation
Kwok Ho Wan, Ainhoa Zapirain
Hamiltonian engineering via pulses: beyond group averaging
Ivan Beschastnyi, Lucah Patel, David Tinoco
Logarithmic-depth quantum simulation of boson sampling
Changhun Oh
Entanglement swapping across a five-node relay in a multiplexed quantum-classical network
Andrew R. Cameron, Jordan M. Thomas, Alexandru Macridin et al.