【代码贡献】新增QPE量子相位估计算法 - #34
Open
1446170411 wants to merge 10 commits into
Open
Conversation
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.
新增 QPE(量子相位估计)模块
量子相位估计是量子计算的基础算法,是 HHL、QAE、Shor 等算法的核心子程序。
新增内容
pyqpanda_alg/QPE/qpe.py — QPE 主类,支持:
任意酉算子 U 的相位估计
可配置计数 qubit 数(精度控制)
自定义本征态制备电路
Statevector 模式(shots=-1)和采样模式(shots>0)
run_dict() 返回完整概率分布
test/QPE/Test_qpe.py — 7 个 pytest 用例
test/10-VQE/demo03-qpe-basic.ipynb — Z 门基础演示
test/10-VQE/demo04-qpe-advanced.ipynb — 旋转门 + 精度对比