• 中国计算机学会会刊
  • 中国科技核心期刊
  • 中文核心期刊

计算机工程与科学 ›› 2025, Vol. 47 ›› Issue (3): 412-421.

• 高性能计算 • 上一篇    下一篇

QTorch:基于独立的量子程序设计语言的量子-经典混合机器学习框架

陈文锦   

  1. (国防科技大学计算机学院量子信息研究所兼高性能计算国家重点实验室,湖南 长沙 410073)

  • 收稿日期:2023-09-12 修回日期:2023-12-24 出版日期:2025-03-25 发布日期:2025-04-01

QTorch:A quantum-classical hybrid machine learning framework built on a standalone quantum programming language

CHEN Wenjin   

  1. (Institute for Quantum Information & State Key Laboratory of High Performance Computing,
    College of Computer Science and Technology,National University of Defense Technology,Changsha 410073,China)
  • Received:2023-09-12 Revised:2023-12-24 Online:2025-03-25 Published:2025-04-01

摘要: 近年来,量子计算系统在特定采样问题上展现出量子优势,标志着人类进入了含噪声中等规模量子NISQ时代。通过量子机器学习算法在具有实用意义的问题求解上展现量子优势,成为量子计算的一个热点问题。现有的量子-经典混合机器学习框架难以支撑量子机器学习算法的高效描述和编译,严重影响了算法开发效率。针对这一现状,基于开源经典机器学习框架PyTorch和独立的量子程序设计语言,提出并实现了量子-经典混合机器学习框架QTorch,实现了面向真实量子硬件和量子-经典混合机器学习算法的自动微分技术,提出并实现了并行训练和参数替换优化2种时间性能优化技术,并通过多组实验证实了以上功能与优势,为量子-经典混合机器学习算法提供了高效的运行平台支持,促进了量子机器学习领域的发展。

关键词: 量子机器学习, 变分量子线路, 含噪声中等规模量子(NISQ), 时间性能优化

Abstract: In recent years, quantum computing systems have demonstrated their quantum supremacy in specific sampling problems, marking humanity’s entry into the noisy intermediate-scale quantum (NISQ) era. Quantum machine learning (QML) algorithms have garnered significant attention in the field of quantum computing due to their potential to leverage quantum supremacy in solving practical problems of significance. This has made them a prominent and highly relevant topics in quantum computing research. However, efficiently describing and compiling QML algorithms using existing hybrid quantum-classical machine learning frameworks remains a significant challenge, hindering the development of algorithms. This paper addresses this challenge by introducing QTorch, a quantum-classical hybrid machine learning framework. QTorch is constructed by leveraging PyTorch, an open-source classical machine learning framework, in conjunction with a standalone quantum programming language. It incorporates automatic differentiation techniques tailored for real quantum hardware and quantum-classical hybrid machine learning algorithms. Additionally, QTorch introduces parallel training optimization and parameter substitution optimization, two key features designed to enhance time performance. To evaluate the effectiveness of QTorch, a series of experiments were conducted to validate its capabilities and advantages. The results demonstrate that QTorch serves as an efficient platform supporting the development and implementation of quantum-classical hybrid machine learning algorithms, thereby propelling advancements in the field of QML.

Key words: quantum machine learning, variational quantum circuit, noisy intermediate-scale quantum(NISQ), time performance optimization ,