๐ค AI Summary
Hybrid quantum-classical programs lack an intermediate representation (IR) that simultaneously ensures expressiveness, scalability, and formal guarantees. Method: This paper introduces HUGRโa hierarchical, graph-based IR integrating a static type system with a linear quantum type system to enforce quantum resource safety; inspired by MLIR, it supports multi-level abstraction refinement and pattern-matching compilation, enabling unified modeling of near-term NISQ devices, future fault-tolerant architectures, and emerging quantum programming paradigms. Contribution/Results: HUGR balances machine efficiency with human readability, facilitating scalable toolchain development and formal verification. We provide a complete formal specification, an open-source reference implementation, and empirically validate its expressiveness, compilation efficiency, and type safety on real-world quantum programs.
๐ Abstract
We introduce the Hierarchical Unified Graph Representation (HUGR): a novel graph based intermediate representation for mixed quantum-classical programs. HUGR's design features high expressivity and extensibility to capture the capabilities of near-term and forthcoming quantum computing devices, as well as new and evolving abstractions from novel quantum programming paradigms. The graph based structure is machine-friendly and supports powerful pattern matching based compilation techniques. Inspired by MLIR, HUGR's extensibility further allows compilation tooling to reason about programs at multiple levels of abstraction, lowering smoothly between them. Safety guarantees in the structure including strict, static typing and linear quantum types allow rapid development of compilation tooling without fear of program invalidation. A full specification of HUGR and reference implementation are open-source and available online.