We introduce Qunity, a new quantum programming language designed around the central goal of treating quantum computing as a natural generalization of classical computing. Qunity presents a unified syntax where familiar programming constructs can have both quantum and classical effects. For example, one can use sum types to implement the direct sum of linear operators, exception handling syntax to implement projective measurements, and aliasing to induce entanglement. Further, Qunity takes advantage of the overlooked BQP subroutine theorem, allowing one to construct reversible subroutines from irreversible quantum algorithms through the uncomputation of "garbage" outputs. Unlike existing languages that enable quantum aspects with a separate add-on (e.g., gates added to a classical language), we unify quantum and classical computing through novel compositional semantics based on Kraus operators. We present Qunity's syntax, type system, and denotational semantics, showing how it can cleanly express several quantum algorithms. We also outline how Qunity could be compiled to OpenQASM, demonstrating the realizability of our design.
翻译:我们引入了 " 团结 ",这是围绕将量子计算作为古典计算的一种自然概括的中央目标设计的一种新的量子编程语言。 " 团结 " 是一种统一的语法,熟悉的编程结构可以同时产生量子效应和古典效应。例如,可以使用总和类型来实施线性操作员的直接总和,使用例外处理语法来实施投影测量,并用别名诱导纠缠。此外, " 团结 " 利用被忽视的 BQP 子例程理论,允许人们通过对 " Garbage" 输出的不转换,从不可逆转的量子算法中构建可逆的子例。 与现有的语言不同,这些语言可以使量子方面具有单独的附加效果( 例如,向古典语言添加门 ), 我们通过基于克拉斯 操作者的新构思义的语义语系来统一量和经典计算。 我们展示了“ Qunity” 的语法、 类型系统, 以及非注性语系, 表明它如何清洁地表达几种量子算法。 我们还概述了如何将“ QOS ” 。