edgepedia

物质世界与数学 / 物理学 / 量子物理学 / Quantum information science / Quantum computing and algorithms / Quantum simulation / Quantum simulation for chemistry and electronic structure

综合 · Edgepedia阅读需 6 分钟

OpenFermion

阅读英文原文

OpenFermion 是一个开源 Python 库,采用 Apache 2.0 许可证,用于编译和分析模拟费米子系统(包括量子化学)的量子算法。它提供数据结构和工具,用于获取和操作费米子与量子比特哈密顿量的表示形式,并能将分子规格转换为可作为量子电路运行的形式。1 • 2

关键事实详情
简介用于编译和分析模拟费米子系统(包括量子化学)的量子算法的开源 Python 包1
首次发布2017 年 10 月 25 日公布,Google 称其为首个将化学与材料问题转化为量子电路的开源平台3
许可证与论文Apache 2.0;发布论文由 Jarrod R. McClean 及另外 34 位作者撰写,arXiv:1710.07629,2017 年 10 月 20 日提交2
核心数据结构FermionOperator,即费米子产生算符 ak† a^\dagger_k 与湮灭算符 ak a_k 之积的加权和4
量子比特映射Jordan-Wigner 变换与 Bravyi-Kitaev 变换可将 FermionOperator 映射为 QubitOperator,同时保持正则反对易关系5
插件电子结构方面有 OpenFermion-Psi4、OpenFermion-PySCF、OpenFermion-Dirac 和 OpenFermion-QChem;电路框架方面有 Forest-OpenFermion 和 SFOpenBoson;模拟方面有 OpenFermion-FQE1
当前版本v1.8.1,恢复了 PolynomialTensor.rotate_basis() 在 1.8.0 之前的行为;v1.7.0 将最低 Python 版本要求提高到 3.106

目的与起源

在量子计算机上模拟化学与材料问题,有望成为近期乃至容错量子设备的主要用途之一,然而为这些问题设计算法需要同时具备化学和量子算法两方面的专业知识。OpenFermion 正是为了弥合这一鸿沟而创建的:它简化了分子规格与量子电路之间的转换,将进入该领域所需的专业知识降到最低。2

该项目始于 Google,苏黎世联邦理工学院、劳伦斯伯克利国家实验室、密歇根大学、哈佛大学、牛津大学、达特茅斯学院、Rigetti Computing 和 NASA 的合作者参与了 alpha 版本的开发。3 发布论文《OpenFermion:面向量子计算机的电子结构软件包》由 Jarrod R. McClean、Kevin J. Sung、Ian D. Kivlichan、曹宇东及另外 31 位作者于 2017 年 10 月 20 日提交至 arXiv,Ryan Babbush 亦为贡献者之一。2

如何表示费米子系统

费米子系统在二次量子化(以场而非粒子数为基本对象的表述形式)框架下处理,其中算符由满足正则反对易关系 {ai†,aj†}={ai,aj}=0 \{a^\dagger_i, a^\dagger_j\} = \{a_i, a_j\} = 0 与 {ai,aj†}=δij \{a_i, a^\dagger_j\} = \delta_{ij} 的产生算符 ak† a^\dagger_k 和湮灭算符 ak a_k 构建。这些升降算符之积的任意加权和由 FermionOperator 类表示,其实现为一个 Python 字典,键编码算符字符串,值存储系数。4

对于结构已知的哈密顿量,则用专门的基于数组的结构来存储,以便快速进行数值操作:7

将费米子映射到量子比特

费米子变换将 FermionOperator 映射为 QubitOperator,同时保持正则反对易关系。最基本的变换是 Jordan-Wigner 变换(JWT)与 Bravyi-Kitaev 变换(BKT);BKT 要求预先确定量子比特总数,而凡隐式应用变换之处,用的都是 JWT。5 OpenFermion 还实现了 Bravyi-Kitaev 超快(BKSF)变换。8

插件与生态

OpenFermion 的大量功能依赖模块化插件包,用于模拟和编译量子电路,以及执行经典电子结构计算:1

Cirq 集成通过独立的 OpenFermion-Cirq 包提供,其文档涵盖门、原语、哈密顿量模拟、变分算法和优化。11 计算结果保存在 OpenFermion 的 MolecularData 对象中,并采用数据溯源策略,将关键结果(包括指向分子积分文件的指针)存储在 HDF5 容器中。9

与其他化学工具的关系

OpenFermion、Qiskit Nature 以及 PennyLane 的量子化学模块都处理费米子到量子比特哈密顿量的构建问题,但设计理念各不相同。OpenFermion 暴露 FermionOperator、InteractionOperator 和各个映射函数等较底层的原语,其核心与框架无关,允许将哈密顿量导出到 Cirq、Qiskit 或 PennyLane 等执行框架;代价是用户需要自行搭建转译与执行流水线。Qiskit Nature 和 PennyLane 则将更多流水线封装进高层求解器类中。12 • 13 PennyLane 可通过其 import_operator() 函数,将用 OpenFermion 工具构建的哈密顿量转换为 PennyLane 可观测量。14

安装与当前开发

OpenFermion 可通过 pip 从 PyPI 安装(python -m pip install --user openfermion),已在 Mac、Windows 和 Linux 上测试,但电子结构插件仅兼容 Mac 和 Linux;其他情况下可使用预装 OpenFermion 及部分插件的 Docker 镜像。文档托管于 quantumai.google/openfermion,交互式 Jupyter 教程可在 Colab 或 MyBinder 中运行。1

近期版本显示出对周边 Python 生态兼容性的积极维护。1.7.0 版将最低 Python 版本提高到 3.10,并更新了 Cirq 等依赖项;1.7.1 版增加了对 NumPy 2 的兼容性;1.8.0 版新增了 trotter_steps_required_propagator、MolecularData 中对任意多重度的支持,以及 SymbolicOperator.isclose 的容差参数;1.8.1 版修复了 1.8.0 引入的 PolynomialTensor.rotate_basis() 向后不兼容问题,通过显式的 transpose 参数默认恢复原有行为。6 该 GitHub 仓库隶属于 quantumlib 组织,约有 1700 颗星和 442 次复刻。1

References

  1. OpenFermion GitHub repository (quantumlib/OpenFermion)
  2. McClean, J. R., et al. OpenFermion: The Electronic Structure Package for Quantum Computers. arXiv:1710.07629
  3. Announcing OpenFermion: the open source chemistry package for quantum computers, Google Open Source Blog (October 25, 2017)
  4. Introduction to OpenFermion, Google Quantum AI
  5. Quantum simulation of electronic structure workshop exercises (Colab notebook), Google Quantum AI
  6. Releases, quantumlib/OpenFermion, GitHub
  7. Quantum simulation of electronic structure tutorial, Google Quantum AI
  8. OpenFermion: The Electronic Structure Package for Quantum Computers (PDF), Google Research
  9. Introduction to OpenFermion (data provenance and plugins), Google Quantum AI
  10. Rubin, N. C., et al. The Fermionic Quantum Emulator. arXiv:2104.13944
  11. OpenFermion-Cirq documentation
  12. OpenFermion Reference Dictionary, Quantum Computing Courses
  13. Qiskit Nature vs OpenFermion: Chemistry Hamiltonian Guide, Inference Systems
  14. Quantum Chemistry, PennyLane documentation

Initially written Oct 22, 2026

© 2026 Biostate AI。依据 Edgepedia Community License,注明出处即可免费使用。 嵌入参考卡片。

报告错误

OpenFermion

请至少选择一个原因。