arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2412.19463cs.PL
收藏

量子编程定律

Laws of Quantum Programming

Mingsheng Ying, Li Zhou, Gilles Barthe

AI总结:

本文将经典编程基本定律扩展至量子场景,刻画量子程序代数性质,证明循环不动点、尾递归实现及两个范式定理,并全部在 Coq 中机械化验证。

摘要:

在本文中,我们研究量子编程的基本定律。我们将 Hoare 等人关于经典编程的一整套基本定律扩展到量子环境。这些定律刻画了量子程序的代数性质,例如顺序复合对(量子)if 语句的分配律,以及嵌套(量子)if 语句的展开。同时,我们阐明了经典编程的某些定律与其量子对应定律之间的一些细微差别。此外,我们推导了量子 while 循环的不动点刻画,以及量子编程中尾递归的基于循环的实现。进一步地,我们建立了两个范式定理:一个针对量子电路,另一个针对有限量子程序。建立这些定律所依据的理论在 Coq 证明辅助工具中被形式化,并且所有这些定律都经过了机械化验证。作为我们定律的一个应用案例,我们展示了动态量子电路中延迟测量原理的形式化推导。我们期望这些定律可用于量子编程中的保正确性变换、编译和自动代码优化。特别是,由于这些定律已在 Coq 中得到形式化验证,它们可以被放心地应用于量子程序开发。

英文摘要:

In this paper, we investigate the fundamental laws of quantum programming. We extend a comprehensive set of Hoare et al.'s basic laws of classical programming to the quantum setting. These laws characterise the algebraic properties of quantum programs, such as the distributivity of sequential composition over (quantum) if-statements and the unfolding of nested (quantum) if-statements. At the same time, we clarify some subtle differences between certain laws of classical programming and their quantum counterparts. Additionally, we derive a fixpoint characterisation of quantum while-loops and a loop-based realisation of tail recursion in quantum programming. Furthermore, we establish two normal form theorems: one for quantum circuits and one for finite quantum programs. The theory in which these laws are established is formalised in the Coq proof assistant, and all of these laws are mechanically verified. As an application case of our laws, we present a formal derivation of the principle of deferred measurements in dynamic quantum circuits. We expect that these laws can be utilised in correctness-preserving transformation, compilation, and automatic code optimisation in quantum programming. In particular, because these laws are formally verified in Coq, they can be confidently applied in quantum program development.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑