Quantum entanglement plays a crucial role in quantum computing. Entangling information has important implications for understanding the behavior of quantum programs and avoiding entanglement-induced errors. Entanglement analysis is a static code analysis technique that determines which qubit may entangle with another qubit and establishes an entanglement graph to represent the whole picture of interactions between entangled qubits. This paper presents the first static entanglement analysis method for quantum programs developed in the practical quantum programming language Q\#. Our method first constructs an interprocedural control flow graph (ICFG) for a Q\# program and then calculates the entanglement information not only within each module but also between modules of the program. The analysis results can help improve the reliability and security of quantum programs.
翻译:量子纠缠在量子计算中扮演着关键角色。纠缠信息对于理解量子程序的行为以及避免纠缠引发的错误具有重要意义。纠缠分析是一种静态代码分析技术,它能够确定哪些量子比特可能与其他量子比特发生纠缠,并建立纠缠图以全面展示纠缠量子比特之间的相互作用。本文提出了首个针对实用量子编程语言Q#开发的量子程序的静态纠缠分析方法。该方法首先为Q#程序构建过程间控制流图(ICFG),然后不仅计算程序各模块内部的纠缠信息,还计算模块之间的纠缠信息。该分析结果有助于提升量子程序的可靠性和安全性。