Sign in
Sign up
Explore
Enterprise
Education
Search
Help
Terms of use
About Us
Explore
Enterprise
Education
Gitee Premium
Gitee AI
Sign in
Sign up
Fetch the repository succeeded.
Open Source
>
New Tech
>
quantum
&&
Donate
Please sign in before you donate.
Cancel
Sign in
Scan WeChat QR to Pay
Cancel
Complete
Prompt
Switch to Alipay.
OK
Cancel
Watch
Unwatch
Watching
Releases Only
Ignoring
1.8K
Star
3.1K
Fork
4.3K
GVP
MindSpore
/
mindquantum
Code
Issues
57
Pull Requests
1
Wiki
Insights
Pipelines
Service
Quality Analysis
Jenkins for Gitee
Tencent CloudBase
Tencent Cloud Serverless
悬镜安全
Aliyun SAE
Codeblitz
SBOM
Don’t show this again
2210
[CXX] Fix bug for parameter shift rule
Merged
donghufeng:dev
MindSpore:master
donghufeng
create on 2023-12-25 23:30
Clone/Download
HTTPS
SSH
Copy
Email Patch
Diff file
In parameter shift rule, if the gate is a multi parameters gate and some of the parameter is parameterized and some of them are not, then parameter shift rule will throw bug. Here is a code to repeat the bug: ```python from mindquantum import * import numpy as np ham = Hamiltonian(QubitOperator('Z0')) circ = Circuit([ BitFlipChannel(1).on(0), FSim('a', 0).on([0, 1]), # the second parameter is not parameterized. ]) sim = Simulator('mqvector', circ.n_qubits) grad_ops = sim.get_expectation_with_grad(ham, circ) print(grad_ops(np.array([0.1]))) ```
This pull request needs to pass some approval items
Type
Assign personnel
Status
Reviewer
donghufeng
Damien Nguyen
dsdsdshe
Kurari
mqcontributor
Completed
(0/0 )
How to merge Pull Request
git checkout master
git pull https://gitee.com/donghufeng/mindquantum.git dev
git push origin master
Comments
2
Commits
2
Files
2
Checks
Code problems
0
Bulk operation
Expand
Collapse
Reviewer
Code Owner
Reviewer
kyang
kangyangzc
cmlee
cmleecm
Kurari
Kurari
Damien Nguyen
dnguyen
mqcontributor
mqcontributor
Waikikilick
herunhong
lujiale
ljl0711
donghufeng
donghufeng
dorothy20212021
dorothy20212021
dsdsdshe
dsdsdshe
melody
cmy_melody
fangwenyi
fangwenyi
No Setting
Min number
0
Tester
kyang
kangyangzc
cmlee
cmleecm
Kurari
Kurari
Damien Nguyen
dnguyen
mqcontributor
mqcontributor
Waikikilick
herunhong
lujiale
ljl0711
donghufeng
donghufeng
dorothy20212021
dorothy20212021
dsdsdshe
dsdsdshe
melody
cmy_melody
fangwenyi
fangwenyi
No Setting
Min number
0
Priority
Not specified
Serious
Main
Secondary
Unimportant
Label
mindspore-cla/yes
ci-pipeline-passed
ci-compile-passed
sig/ms-quantum
Link Issue
No link issue
Successfully merged pull requests will close issues
Milestone
No related milestones
MindQuantum 0.10.0
MindQuantum 0.11.0
Participators
(2)
Cherry-pick Commit
Cherry-pick allows you to select and apply a
specific commit
from one branch to another, enabling quick integration of specific changes without merging the entire branch.
Please select the target branch to apply the Cherry-pick commit to
New branch
The current account does not have a Fork repository, it is recommended to cherry-pick to the Fork repository.
Fork repository
Submit list
Commit SHA
Commit Message
Create a Pull Request based on the Cherry-pick branch
Cancel
Cherry-pick
Python
1
https://gitee.com/mindspore/mindquantum.git
git@gitee.com:mindspore/mindquantum.git
mindspore
mindquantum
mindquantum
Going to Help Center
Search
Git 命令在线学习
如何在 Gitee 导入 GitHub 仓库
Git 仓库基础操作
企业版和社区版功能对比
SSH 公钥设置
如何处理代码冲突
仓库体积过大,如何减小?
如何找回被删除的仓库数据
Gitee 产品配额说明
GitHub仓库快速导入Gitee及同步更新
什么是 Release(发行版)
将 PHP 项目自动发布到 packagist.org
Repository Report
Back to the top
Login prompt
This operation requires login to the code cloud account. Please log in before operating.
Go to login
No account. Register