Skip to content
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

Fix bug in autograph implementation for ctrl and adjoint #6685

Merged
merged 121 commits into from
Dec 16, 2024

Conversation

lillian542
Copy link
Contributor

@lillian542 lillian542 commented Dec 6, 2024

Context:

The checks in the existing implementation of autograph have handling for conversion if a function is passed to qml.ctrl or qml.adjoint.

Unfortunately, these checks were breaking the case where a fully initialized operator was passed to qml.ctrl or qml.adjoint, because they expect the check to always receive a callable.

Description of the Change:
We have autograph track the _capture_adjoint_transform and _capture_ctrl_transform functions instead, since at that point the function really does always receive a callable.

[sc-80037]

@lillian542 lillian542 changed the title update and add tests Fix bug in autograph implementation for ctrl and adjoint Dec 6, 2024
@lillian542 lillian542 marked this pull request as ready for review December 6, 2024 21:26

This comment was marked as resolved.

@lillian542
Copy link
Contributor Author

The documentation check failures are because I accidentally based this PR on the Autograph documentation PR, so that is resolved there and not relevant for this PR

Copy link
Contributor

@PietropaoloFrisoni PietropaoloFrisoni left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚀

Base automatically changed from autograph_docs to master December 13, 2024 16:05
@lillian542 lillian542 enabled auto-merge (squash) December 16, 2024 20:00
@lillian542 lillian542 merged commit 4555833 into master Dec 16, 2024
46 checks passed
@lillian542 lillian542 deleted the autograph_bugfix branch December 16, 2024 20:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants