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.
翻译:在本文中, 我们提出一个新的量子编译优化, 名为“ 放松视洞优化 ” ( RPO ), 用于量子计算机 。 REPO 将单方位状态信息用于可由编译者静态确定的信息。 我们定义了当某时间点, 其状态在X- 、 Y- 或 Z- 基点时, 其状态处于一个基点状态。 当基点用作量门的输入时, 存在减量的机会, 以等值但成本较低的量运行取代量量运行。 与现有量子程序基位优化相比, 我们提议的优化并不要求相同的单一矩阵矩阵矩阵, 从而名为“ 放松” 。 当某些投入Q- 、 Y- 或 Z- 基点处于已知的纯状态时, 我们还会扩展了优化量门的方法。 两种优化, 即Qummum- 基础值优化(QBOO) 和Qumt- state- state 直径操作(QPO), 与 IBM QIskit Qt 优化相比, 我们的降为QQQQQQQQQQ. 1 平流的平流,,, 平流的平流率, 和最高平流 平流 平流, 我们的平流的平流,,,, 平流 平流 最高平, 。