-
Notifications
You must be signed in to change notification settings - Fork 592
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
[Return-types #4] Parameter shift grad transform #2886
Conversation
…yLaneAI/pennylane into refactor_return_shot_vector
… into return_types
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.
All my comments/questions have been addressed, thus I will approve this PR.
However I believe this PR should need a second approval before merging.
…ennylane into grad_transforms_new_return
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 @antalszava 🔥 🔥 🔥
My major comments have all been addressed. I just have 2 more minor requests to clean up the code a bit. Also briefly looked over the tests and they all seem good too 🙂 .
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.
Great work @antalszava 💯 I've left some about tests that need to be commented. It would also be great to remove the changes for the execution pipeline. Still an open question about creating new gradients function to keep cleaner or do we consider them user facing and then those changes are all good?
…rray conversion as it may create a ragged array
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 @antalszava, I suggest to make the var function private otherwise it looks very good! 💯
Context:
This is a continuation of the new return types push that was started in #2814 #2815 #2860.
Description of the Change:
Updates the parameter-shift gradient transform to handle the new way of returning measurement results.
Benefits:
The parameter-shift gradient transform outputs sequences.
Note: most of this PR includes porting over the
tests/gradients/test_parameter_shift.py
file to be compatible with the new return types structure. Most of the tests are copied from that file and adjusted.Possible Drawbacks:
N/A
Related GitHub Issues:
N/A
TODOs: