量子电子学报 ›› 2022, Vol. 39 ›› Issue (3): 431-438.doi: 10.3969/j.issn.1007-5461.2022.03.015

• 量子光学 • 上一篇    下一篇

基于 Cirq 的Grover 搜索算法的电路实现

吴希, 李志强∗   

  1. ( 扬州大学信息工程学院, 江苏扬州225100 )
  • 收稿日期:2020-08-26 修回日期:2020-10-29 出版日期:2022-05-28 发布日期:2022-05-28
  • 通讯作者: E-mail: yzqqLzq@163.com E-mail:yzqqLzq@163.com
  • 作者简介:吴希( 1997 - ), 女, 江苏无锡人, 研究生, 主要从事量子电路综合方面的研究。E-mail: wxyzdd@163.com
  • 基金资助:
    Supported by National Natural Science Foundation of China (国家自然科学基金, 61070240), Natural Science Foundation of Universities in Jiangsu Province (江苏省高校基金, 10KJB520021)

Circuit realization of Grover algorithm based on Cirq

WU Xi, LI Zhiqiang∗   

  1. ( College of Information Engineering, Yangzhou University, Yangzhou 225100, China )
  • Received:2020-08-26 Revised:2020-10-29 Published:2022-05-28 Online:2022-05-28

摘要: Grover 量子算法能对传统的搜索算法起到平方级加速的效果, 因此自提出以来一直受到人们的广泛关 注。首先将基于Python 的Cirq 框架与Grover 搜索算法进行结合, 并对其进行模拟实现, 可以直观地看到算法的 电路实现细节, 同时, 实验验证了该算法的特点与存在的不足。进而针对搜索成功率存在的不足, 从理论上介绍 一种基于相位角旋转的精准Grover 改进算法, 并通过Cirq 框架对其进行模拟实现, 验证了该算法成功率始终为 1 的有效性。Cirq 框架的引入为量子算法的研究以及量子电路的优化提供了强大的工具支持。

关键词: 量子信息, 量子电路, Grover 算法, Cirq 框架

Abstract: Grover quantum search algorithm can speed up the traditional search algorithm by square order, so it has been widely concerned since it was put forward. In this paper, the Cirq framework based on Python is introduced into the traditional Grover algorithm and the circuit details of the algorithm is realized by simulation at first, and at the same time, the characteristics and defects of the algorithm are verified intuitively through experimental results. Then, in view of the shortcomings of the search success rate of the traditional Grover algorithm, a precise improved Grover algorithm based on phase angle rotation is theoretically introduced, and it is simulated by Cirq framework, which verifies the effectiveness of the algorithm with a success rate of 1. It is believed that the introduction of the Cirq framework can provide a powerful tool support for the research of quantum algorithms and the optimization of quantum circuits.

Key words: quantum information, quantum circuit, Grover algorithm, Cirq framework

中图分类号: