Skip to main content
QUICK REVIEW

[论文解读] Relaxed Peephole Optimization: A Novel Compiler Optimization for Quantum Circuits

Ji Liu, Luciano Bello|arXiv (Cornell University)|Dec 14, 2020
Quantum Computing Algorithms and Architecture参考文献 37被引用 5
一句话总结

本文提出了一种新型的量子编译器优化技术——宽松窥探优化(Relaxed Peephole Optimization, RPO),通过在编译时利用已知的量子比特基态或纯态,减少CNOT门的数量。通过在编译时静态识别量子比特状态,RPO将昂贵的门(如CNOT)替换为等效但更简单的操作(例如当控制量子比特处于|1⟩时,用NOT门替代CNOT门),在平均情况下将CNOT门数量减少18.0%,编译速度提升7.1%,在真实硬件上对3量子比特量子相位估计算法的成功率提升达2.30倍。

ABSTRACT

In this paper, we propose a novel quantum compiler optimization, named relaxed peephole optimization (RPO) for quantum computers. RPO leverages the single-qubit state information that can be determined statically by the compiler. We define that a qubit is in a basis state when, at a given point in time, its state is either in the X-, Y-, or Z-basis. When basis qubits are used as inputs to quantum gates, there exist opportunities for strength reduction, which replaces quantum operations with equivalent but less expensive ones. Compared to the existing peephole optimization for quantum programs, the difference is that our proposed optimization does not require an identical unitary matrix, thereby named `relaxed' peephole optimization. We also extend our approach to optimize the quantum gates when some input qubits are in known pure states. Both optimizations, namely the Quantum Basis-state Optimization (QBO) and the Quantum Pure-state Optimization (QPO), are implemented in the IBM's Qiskit transpiler. Our experimental results show that our proposed optimization pass is fast and effective. The circuits optimized with our compiler optimizations obtain up to 18.0% (11.7% on average) fewer CNOT gates and up to 8.2% (7.1% on average) lower transpilation time than that of the most aggressive optimization level in the Qiskit compiler. When running on real quantum computers, the success rates of 3-qubit quantum phase estimation algorithm improve by 2.30X due to the reduced gate counts.

研究动机与目标

  • 为解决近期量子计算机中因门数过多和噪声导致的性能瓶颈,特别是昂贵的CNOT门带来的影响。
  • 开发一种编译器优化技术,利用对量子比特状态的静态知识来减少门数,而无需要求单位矩阵完全相同。
  • 通过允许比传统窥探技术更激进的优化,提升真实量子硬件上的编译效率和电路保真度。
  • 提供一种实用、快速且高效的优化模块,可与现有量子编译器(如Qiskit)兼容。

提出的方法

  • 该方法引入两种优化阶段:量子基态优化(Quantum Basis-state Optimization, QBO)和量子纯态优化(Quantum Pure-state Optimization, QPO),在编译时分析量子比特状态,以识别基态(|0⟩, |1⟩, |+⟩, |−⟩, |L⟩, |R⟩)或纯态。
  • RPO在输入量子比特处于已知基态或纯态时支持门的替换,即使整体单位矩阵发生变化,因此称为“宽松”窥探优化。
  • 一个静态量子态分析引擎可跨电路确定量子比特状态,利用类型推断和编译器分析传播状态知识。
  • 该方法支持程序员注解,以指导状态推断,并在量子操作间保持优化机会。
  • 该优化作为IBM Qiskit编译器中的一个优化阶段实现,集成在布局映射和优化之前。
  • 该方法在包括Grover算法和量子相位估计算法(QPE)在内的基准测试上进行了评估,测量CNOT门数量、电路深度、编译时间以及真实设备上的成功率。

实验结果

研究问题

  • RQ1量子编译器优化是否能通过在编译时利用已知的量子比特状态来减少CNOT门的数量?
  • RQ2与现有优化级别相比,宽松窥探优化在减少门数和编译时间方面的有效性如何?
  • RQ3减少CNOT门在真实量子硬件执行中能在多大程度上提升成功率?
  • RQ4后端连通性如何影响该优化对门数和性能的影响?

主要发现

  • 所提出的RPO优化相比Qiskit中最激进的优化级别,将CNOT门数量最多减少18.0%(平均减少11.7%)。
  • 使用RPO后,编译时间最多减少8.2%(平均减少7.1%),比Qiskit的最高优化级别更快。
  • 在真实量子硬件上,3量子比特量子相位估计算法由于门数减少,成功率平均提升2.30倍。
  • 该优化在连通性较差的设备上效果最显著,在ibmq_rochester(耦合图最差)上减少了20.6%的CNOT门。
  • 使用程序员注解可在迭代型量子电路中恢复优化机会,使CNOT门减少率从约30%提升至约7.4%。
  • 该方法在不同量子后端上均有效,CNOT门减少率在15.2%至20.6%之间,编译时间减少率在4.6%至5.5%之间。

更好的研究,从现在开始

从阅读论文到最终审阅,大幅缩短您的研究时间。

无需绑定信用卡

本解读由 AI 生成,并经人工编辑审核。