【代码贡献】新增 Parameter-Shift 变分量子梯度模块 - #87
Open
tokenjunkielabs wants to merge 16 commits into
Open
tokenjunkielabs wants to merge 16 commits into
tokenjunkielabs wants to merge 16 commits into
Conversation
【代码贡献】新增 Deutsch-Jozsa 与 Bernstein-Vazirani oracle-learning 模块
…op-integration-20260914 stage(origin-cup): integrate QWalk contribution
…-integration-20260914 stage(origin-cup): integrate QEC repetition-code contribution
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.
关联 #13(2026 本源杯开源创新赛道|代码贡献)。
概要
新增
pyqpanda_alg/ParameterShift,为变分量子算法提供后端无关的解析参数移位梯度层,避免把梯度逻辑绑死到单一本地模拟器。主要内容
1/2[f(θ+π/2)-f(θ-π/2)],并支持不同 spectral gap;build_shift_schedule将所有移位参数点显式化,便于 CPUQVM、QCloud 或真实 QPU 做批量提交;ParameterShiftSchedule.reconstruct可从远端返回结果重建完整 Jacobian,并为冻结参数保留零行;evaluate_shift_batch支持一次远端调用执行整批移位点;该设计把“生成要执行的量子任务”和“从结果重建梯度”拆开,使同一 API 可用于本地模拟和远程硬件工作流。
Exact owner head:
632b4abfdef3872607db08186643dd576abf1d90.