This paper proposes QDFO, a dataflow-based optimization approach to Microsoft QIR. QDFO consists of two main functions: one is to preprocess the QIR code so that the LLVM optimizer can capture more optimization opportunities, and the other is to optimize the QIR code so that duplicate loading and constructing of qubits and qubit arrays can be avoided. We evaluated our work on the IBM Challenge Dataset, the results show that our method effectively reduces redundant operations in the QIR code. We also completed a preliminary implementation of QDFO and conducted a case study on the real-world code. Our observational study indicates that the LLVM optimizer can further optimize the QIR code preprocessed by our algorithm. Both the experiments and the case study demonstrate the effectiveness of our approach.
翻译:本文提出QDFO,一种基于数据流的Microsoft QIR优化方法。QDFO包含两大核心功能:一是对QIR代码进行预处理,使LLVM优化器能够捕捉更多优化机会;二是优化QIR代码以避免量子比特及量子比特数组的重复加载与构建。我们在IBM挑战数据集上评估了本工作,结果表明该方法能有效减少QIR代码中的冗余操作。我们还完成了QDFO的初步实现,并对实际代码进行了案例研究。观察性研究表明,LLVM优化器可对我们算法预处理后的QIR代码实施进一步优化。实验与案例研究共同验证了本方法的有效性。