一句话:将相位折叠重铸为仿射关系分析,借助经典关系域把优化扩展到含复杂控制流的量子程序。
现有相位折叠优化依赖电路的精确线性代数表示,只能处理直线量子电路或基本块。本文将其重新表述为仿射关系分析,从而可直接借用经典仿射关系技术,将相位折叠扩展到具有嵌套循环、过程调用等任意复杂经典控制流的量子程序。作者进一步以其他经典关系域替换分析域,尤其是非线性关系域,以处理涉及经典算术的电路;并利用 sum-over-paths 技术从仅含线性操作的门集(如 Clifford+T)中提取直线电路的精确符号转移关系,提高分析精度。实验表明,该方法能生成并使用非平凡的循环不变式来优化量子程序,并实现一些以往只能手工完成的常见电路优化。
The phase folding optimization is a circuit optimization used in many quantum compilers as a fast and effective way of reducing the number of high-cost gates in a quantum circuit. However, existing formulations of the optimization rely on an exact, linear algebraic representation of the circuit, restricting the optimization to being performed on straightline quantum circuits or basic blocks in a larger quantum program. We show that the phase folding optimization can be re-cast as an affine relation analysis , which allows the direct application of classical techniques for affine relations to extend phase folding to quantum programs with arbitrarily complicated classical control flow including nested loops and procedure calls. Through the lens of relational analysis, we show that the optimization can be powered-up by substituting other classical relational domains, particularly ones for non-linear relations which are useful in analyzing circuits involving classical arithmetic. To increase the precision of our analysis and infer non-linear relations from gate sets involving only linear operations – such as Clifford+ t – we show that the sum-over-paths technique can be used to extract precise symbolic transition relations for straightline circuits. Our experiments show that our methods are able to generate and use non-trivial loop invariants for quantum program optimization, as well as achieve some optimizations of common circuits which were previously attainable only by hand.
DOI 原文 · arXiv · PDF(开放获取) · DBLP
@article{AmyL25,
title = {Linear and Non-linear Relational Analyses for Quantum Program Optimization},
author = {Matthew Amy and Joseph Lunderville},
journal = {Proceedings of the ACM on Programming Languages},
volume = {9},
number = {POPL},
year = {2025},
doi = {10.1145/3704873}
}