🤖 AI Summary
This paper addresses the challenge of statically predicting and verifying circuit resources—such as gate count and qubit width—in the Proto-Quipper family of quantum programming languages. We propose the first denotational semantics for Proto-Quipper based on an indexed monad, integrating a circuit algebra and effect separation to rigorously distinguish between term evaluation results and side-effect–induced quantum circuit generation. Supported by an enriched type system, our model enables quantitative characterization of circuit size and guarantees robustness under compiler optimizations. Our key contributions are: (1) a monadic semantic framework that provides an interpretable effect-type system; (2) static reasoning about circuit resources—including optimization-aware analysis; and (3) the first formal guarantee of preservation of circuit-count properties across program transformations, thereby establishing a rigorous semantic foundation for quantum program resource analysis.
📝 Abstract
In this paper, a monad-based denotational model is introduced and shown adequate for the Proto-Quipper family of calculi, themselves being idealized versions of the Quipper programming language. The use of a monadic approach allows us to separate the value to which a term reduces from the circuit that the term itself produces as a side effect. In turn, this enables the denotational interpretation and validation of rich type systems in which the size of the produced circuit can be controlled. Notably, the proposed semantic framework, through the novel concept of circuit algebra, suggests forms of effect typing guaranteeing quantitative properties about the resulting circuit, even in presence of optimizations.