arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2303.14500quant-phcs.PL
收藏

代码安全的量子中间表示形式化

Formalization of Quantum Intermediate Representations for Code Safety

Junjie Luo, Jianjun Zhao

摘要:

量子中间表示(QIR)是微软开发的,基于LLVM的量子程序编译器中间表示。QIR旨在为量子程序编译器提供一个独立于前端语言和后端硬件的通用解决方案,从而避免中间表示和编译器的重复开发。由于QIR仍在开发中,它是用自然语言描述的,缺乏正式的定义,导致其解释模糊不清,实现量子功能时缺乏严谨性。本文给出了QIR的数据类型和指令集的形式化定义,旨在为QIR中的操作和中间代码转换提供正确性和安全性保证。为了验证我们的设计,我们展示了一些不安全的QIR代码样本,其中错误可以通过我们的正式方法检测到。

英文摘要:

Quantum Intermediate Representation (QIR) is a Microsoft-developed, LLVM-based intermediate representation for quantum program compilers. QIR aims to provide a general solution for quantum program compilers independent of front-end languages and back-end hardware, thus avoiding duplicate development of intermediate representations and compilers. Since it is still under development, QIR is described in natural language and lacks a formal definition, leading to ambiguity in its interpretation and a lack of rigor in implementing quantum functions. In this paper, we provide formal definitions for the data types and instruction sets of QIR, aiming to provide correctness and security guarantees for operations and intermediate code conversions in QIR. To validate our design, we show some samples of unsafe QIR code where errors can be detected by our formal approach.

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

↑