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

QSSA:一种基于SSA的量子计算IR

QSSA: An SSA-based IR for Quantum Computing

Anurudh Peduri, Siddharth Bhat

摘要:

量子计算硬件发展迅速。与此同时,用于量子计算的程序设计语言和程序优化工具也在激增。现有的量子编译器使用中间表示(IR),其中量子程序被描述为电路。这样的IR无法利用编译器优化的现有工作。在这样的IR中,静态地检查物理约束是不平凡的,例如不可克隆定理,该定理规定量子位不能被复制。我们介绍了QSSA,这是一种基于静态单一赋值(SSA)的新型量子IR,它使数十年的编译器优化研究能够应用于量子编译。QSSA将量子操作建模为无副作用。操作的输入和输出是一一对应的;量子位不能被创建或销毁。因此,我们的IR支持一个静态分析过程,该过程在编译时验证无克隆。量子电路完全编码在IR的def-use链中,使我们能够利用SSA表示的现有优化传递,例如冗余消除和死码消除。在QASMBench和IBM Quantum Challenge数据集上运行我们基于QSSA的编译器,我们表明我们的优化对IBM的Qiskit量子编译器基础设施进行了优化。QSSA允许我们使用SSA表示的鲁棒理论来表示、分析和转换量子程序,将量子编译带入了易于理解的理论和实践领域。

英文摘要:

Quantum computing hardware has progressed rapidly. Simultaneously, there has been a proliferation of programming languages and program optimization tools for quantum computing. Existing quantum compilers use intermediate representations (IRs) where quantum programs are described as circuits. Such IRs fail to leverage existing work on compiler optimizations. In such IRs, it is non-trivial to statically check for physical constraints such as the no-cloning theorem, which states that qubits cannot be copied. We introduce QSSA, a novel quantum IR based on static single assignment (SSA) that enables decades of research in compiler optimizations to be applied to quantum compilation. QSSA models quantum operations as being side-effect-free. The inputs and outputs of the operation are in one-to-one correspondence; qubits cannot be created or destroyed. As a result, our IR supports a static analysis pass that verifies no-cloning at compile-time. The quantum circuit is fully encoded within the def-use chain of the IR, allowing us to leverage existing optimization passes on SSA representations such as redundancy elimination and dead-code elimination. Running our QSSA-based compiler on the QASMBench and IBM Quantum Challenge datasets, we show that our optimizations perform comparably to IBM's Qiskit quantum compiler infrastructure. QSSA allows us to represent, analyze, and transform quantum programs using the robust theory of SSA representations, bringing quantum compilation into the realm of well-understood theory and practice.

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

↑