Twist:量子程序中纯性和纠缠的合理推理
Twist: Sound Reasoning for Purity and Entanglement in Quantum Programs
摘要:
量子程序设计语言使开发人员能够实现量子计算机的算法,这些算法有望在经典棘手的任务中实现计算突破。对量子计算机进行编程需要意识到纠缠,即量子比特的测量结果相互关联的现象。纠缠可以决定算法的正确性和编程模式的适用性。在这项工作中,我们将纯度形式化为自动推理量子程序中纠缠的核心工具。纯表达式是其评估不受其不拥有的量子比特的测量结果影响的表达式,这意味着在计算中不与任何其他表达式纠缠。我们提出扭曲,第一种语言,具有一个类型系统的健全的推理纯度。类型系统使开发人员能够使用类型注释来标识纯表达式。Twist还具有纯度断言算子,该算子声明量子门的输出中不存在纠缠。为了正确地检查这些断言,Twist使用了静态分析和运行时验证的组合。我们评估了Twist的类型系统,并在模拟中对一套基准量子程序进行了分析,证明了Twist可以表达量子算法,捕获其中的编程错误,并支持几种语言不允许的程序,同时产生的运行时验证开销小于3.5%。
英文摘要:
Quantum programming languages enable developers to implement algorithms for quantum computers that promise computational breakthroughs in classically intractable tasks. Programming quantum computers requires awareness of entanglement, the phenomenon in which measurement outcomes of qubits are correlated. Entanglement can determine the correctness of algorithms and suitability of programming patterns. In this work, we formalize purity as a central tool for automating reasoning about entanglement in quantum programs. A pure expression is one whose evaluation is unaffected by the measurement outcomes of qubits that it does not own, implying freedom from entanglement with any other expression in the computation. We present Twist, the first language that features a type system for sound reasoning about purity. The type system enables the developer to identify pure expressions using type annotations. Twist also features purity assertion operators that state the absence of entanglement in the output of quantum gates. To soundly check these assertions, Twist uses a combination of static analysis and runtime verification. We evaluate Twist's type system and analyses on a benchmark suite of quantum programs in simulation, demonstrating that Twist can express quantum algorithms, catch programming errors in them, and support programs that several languages disallow, while incurring runtime verification overhead of less than 3.5%.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。