POPL 2027
Sun 10 - Sat 16 January 2027 Mexico City, Mexico

Hybrid quantum-classical computing systems consist of a classical control system that sends quantum circuits and receives measurement results from a quantum co-processor. Such systems allow us to model algorithms that require the classical control system to generate quantum circuits on the fly, potentially based on prior measurement results. This is challenging in practice, as the classical control system must generate quantum circuits that manipulate live quantum states, e.g., for quantum error correction. These quantum states are noisy and can decohere over the time it takes for the classical control system to generate the next quantum circuit to execute.

We introduce HyQ (pronounced \emph{haiku}), a multi-modal language based on adjoint logic that pre-generates quantum circuits before executing a hybrid quantum-classical program. We achieve this by separating our semantics into two distinct stages: 1) compile-time generation of quantum circuits and classical runtime code and 2) a quantum runtime, i.e., the execution of the hybrid code. This separation between stages allows us to formally guarantee that all circuit-generation logic occurs before the instrumentation logic, i.e., the actual runtime, and minimizes the idling of the quantum co-processor at runtime. We give a type system, a circuit-normalization semantics for the compile-time stage, which eagerly performs all circuit-generation logic, and a runtime semantics for HyQ that corresponds to the second stage. We prove type preservation and progress for both semantics.