-
Notifications
You must be signed in to change notification settings - Fork 603
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Set grad_method=None
for ControlledSequence
, Reflection
, AmplitudeAmplification
, and Qubitization
.
#5806
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #5806 +/- ##
==========================================
- Coverage 99.66% 99.66% -0.01%
==========================================
Files 415 415
Lines 39601 39309 -292
==========================================
- Hits 39469 39176 -293
- Misses 132 133 +1 ☔ View full report in Codecov by Sentry. |
…o template-grads
CC @KetpuntoG |
|
I've done some investigation but haven't found out why directly taking parameter shift on the templates return incorrect results. See #5802 for more details. |
To clarify, this doesn't say "don't use parameter shift with these templates". It is "decompose before applying parameter shift". Theoretically, we could develop parameter shift rules for the templates and add them to the Would there be a benefit to being able to natively apply parameter shift to these templates instead of to their decomposed form? For some templates, like |
Ah okey! That's perfect: first decompose, then shift-rule |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks! It looks good to me :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me! 🎉 Thanks!
Context:
Templates that are not actually supported by
parameter_shift
should havegrad_method=None
so that they are decomposed by_expand_transform_param_shift
Description of the Change:
data
of components of the templates to thedata
of the templates such that trainable parameters are trackedgrad_method=None
forControlledSequence
,Reflection
,AmplitudeAmplification
, andQubitization
.Related GitHub Issues:
Fixes #5802
[sc-64967]