feat: 新增 VQE(变分量子本征求解器)模块#20
Open
debaobai wants to merge 1 commit into
Open
Conversation
- PauliHamiltonian: Hamiltonian as weighted sum of Pauli strings - hardware_efficient_ansatz & ry_linear_ansatz: parameterized circuits - measure_expectation: Pauli term expectation via probability readout - VQESolver: hybrid quantum-classical optimization loop - 3 sample scripts (H2 molecule, optimizer comparison, Heisenberg model) - VQE_README.md: setup guide with algorithm explanation (Chinese) - Compatible with Python 3.11/3.12/3.13 Author: Bai
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
概述
新增 VQE(Variational Quantum Eigensolver)模块,实现基于变分原理的量子-经典混合优化求解器,用于求解哈密顿量的最小本征值(基态能量)。
新增文件
VQE/__init__.pyVQE/hamiltonian.pyVQE/ansatz.pyVQE/measurement.pyVQE/vqe_solver.pyVQE/VQE_README.mdVQE/sample_01_h2_molecule.pyVQE/sample_02_optimizer_comparison.pyVQE/sample_03_custom_hamiltonian.py修改文件
pyqpanda_alg/__init__.py:启用from . import VQE(原代码已有注释占位)测试结果
设计说明
CPUQVM+get_prob_list()获取概率分布(与项目其他模块一致)Author: Bai