《计算机应用》唯一官方网站 ›› 2023, Vol. 43 ›› Issue (8): 2486-2492.DOI: 10.11772/j.issn.1001-9081.2022091456

• 先进计算 • 上一篇    下一篇

基于新一代神威超算的量子计算模拟器加速和优化

史新民1, 刘勇2, 陈垚键3, 宋佳伟2, 刘鑫2()   

  1. 1.信息工程大学 网络空间安全学院, 郑州 450001
    2.国家并行计算机工程技术研究中心, 北京 100190
    3.清华大学 计算机科学与技术系, 北京 100084
  • 收稿日期:2022-09-29 修回日期:2023-02-07 接受日期:2023-02-10 发布日期:2023-08-07 出版日期:2023-08-10
  • 通讯作者: 刘鑫
  • 作者简介:史新民(1997—),男,河北唐山人,硕士研究生,主要研究方向:量子模拟器、并行算法优化
    刘勇(1980—),男,湖南邵阳人,副研究员,博士,主要研究方向:并行算法优化、量子计算模拟
    陈垚键(1999—),男,广西桂林人,博士研究生,主要研究方向:并行算法优化、量子计算模拟
    宋佳伟(1989—),男,江苏无锡人,工程师,主要研究方向:并行算法优化、量子计算模拟;
  • 基金资助:
    国家科技重大专项(2017?I?0004?0004)

Acceleration and optimization of quantum computing simulator implemented on new Sunway supercomputer

Xinmin SHI1, Yong LIU2, Yaojian CHEN3, Jiawei SONG2, Xin LIU2()   

  1. 1.School of Cyber Security,Information Engineering University,Zhengzhou Henan 450001,China
    2.National Research Center of Parallel Computer Engineering and Technology,Beijing 100190,China
    3.Department of Computer Science and Technology,Tsinghua University,Beijing 100084,China
  • Received:2022-09-29 Revised:2023-02-07 Accepted:2023-02-10 Online:2023-08-07 Published:2023-08-10
  • Contact: Xin LIU
  • About author:SHI Xinmin, born in 1997, M. S. candidate. His research interests include quantum simulator, parallel algorithm optimization.
    LIU Yong, born in 1980, Ph. D., associate research fellow. His research interests include parallel algorithm optimization, quantum computing simulation.
    CHEN Yaojian, born in 1999, Ph. D. candidate. His research interests include parallel algorithm optimization, quantum computing simulation.
    SONG Jiawei, born in 1989, engineer. His research interests include parallel algorithm optimization, quantum computing simulation.
  • Supported by:
    National Science and Technology Major Project(2017-I-0004-0004)

摘要:

针对量子硬件规模逐步扩大、当下量子计算经典模拟速度不高的问题,提出了基于神威超算量子模拟器的两种优化方法。首先,通过改进张量转置策略和计算策略重新构建了张量收缩算子库SWTT,从而提高了部分张量收缩的计算内核效率并减少了冗余访存;其次,通过提高数据局部性的收缩路径调整方法实现了路径计算复杂度和计算效率之间的均衡。测试结果表明,该算子库改进方法可将“悬铃木”量子霸权电路模拟效率提升5.4%,单步张量收缩效率最高提升49.7倍;该路径调整方法可在路径计算复杂度膨胀2倍条件下提升约4倍的浮点效率。两种优化方法使神威超算整机模拟谷歌53量子比特20层量子芯片随机电路百万振幅采样的单精度和混合精度浮点运算效率分别从3.98%和1.69%提升至18.48%和7.42%,理论估计模拟时间从单精度的470 s降至226 s,混合精度的304 s降至134 s,证明两种方法大幅提高了量子计算模拟速度。

关键词: 量子模拟器, 神威超算体系结构, 收缩路径, 张量收缩算子库, 张量网络收缩

Abstract:

Two optimization methods for quantum simulator implemented on Sunway supercomputer were proposed aiming at the problems of gradual scaling of quantum hardware and insufficient classical simulation speed. Firstly, the tensor contraction operator library SWTT was reconstructed by improving the tensor transposition strategy and computation strategy, which improved the computing kernel efficiency of partial tensor contraction and reduced redundant memory access. Secondly, the balance between complexity and efficiency of path computation was achieved by the contraction path adjustment method based on data locality optimization. Test results show that the improvement method of operator library can improve the simulation efficiency of the "Sycamore" quantum supremacy circuit by 5.4% and the single-step tensor contraction efficiency by up to 49.7 times; the path adjustment method can improve the floating-point efficiency by about 4 times with the path computational complexity inflated by a factor of 2. The two optimization methods have the efficiencies of single-precision and mixed-precision floating-point operations for the simulation of Google’s 53-bit, 20-layer quantum chip random circuit with a million amplitude sampling improved from 3.98% and 1.69% to 18.48% and 7.42% respectively, and reduce the theoretical estimated simulation time from 470 s to 226 s for single-precision and 304 s to 134 s for mixed-precision, verifying that the two methods significantly improve the quantum computational simulation speed.

Key words: quantum simulator, Sunway supercomputer architecture, contraction path, tensor contraction operator library, tensor network contraction

中图分类号: