Finite-Dimensional Quantum Programming from Relative Adjunctions
Linear/non-linear (LNL) models give the standard semantics of quantum circuit-description languages such as QWIRE and Proto-Quipper-M. There, linearity is used structurally, with the exponential ! marking duplicable circuits. Classically parameterized circuits, such as the oracle for a classical function, need features from outside the LNL model, for instance presheaves. In LNL models where linearity means linear combination, like the free–forgetful adjunction between sets and vector spaces, the oracle for a classical function is just the linear extension of that classical function. But infinite classical types then give infinite-dimensional spaces. Restricting to the finitary case, as needed to compile to finite circuits or to form uniform superpositions, breaks the adjunction: finite sets and finite-dimensional vector spaces are not adjoint. They are, however, adjoint relative to the inclusion of finite sets into sets.
We study this relative adjunction from a programming-languages perspective. We define relative LNL models and show that they soundly model relative intuitionistic linear logic (rILL), the fragment of ILL in which the bang modality applies only to bang-free types. Adding a second relative adjoint yields an explicit linearity monad for classically parameterized computation. Instantiating the construction with finite sets and finite-dimensional vector spaces gives a language for finitary quantum computation. In it, exponential-free programs denote finite-dimensional linear operators, and uniform superpositions over finite classical types are expressible.