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

Raise error on applying transform to qjit #5826

Merged
merged 5 commits into from
Jun 10, 2024
Merged

Conversation

albi3ro
Copy link
Contributor

@albi3ro albi3ro commented Jun 10, 2024

Context:

Applying a transform to a qjit object treat treats the qjit object as an arbitrary callable quantum function, and returns a returns a new "quantum function". But a qjit object cannot be treated as a quantum function, and that is not what users would expect to see outputted.

Description of the Change:

Adds an explicit error if a transform is applied to a qjit object.

Benefits:

Less confusion

Possible Drawbacks:

Related GitHub Issues:

[sc-65406]

Copy link
Contributor

@isaacdevlugt isaacdevlugt left a comment

Choose a reason for hiding this comment

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

Works for me!

pennylane/transforms/core/transform_dispatcher.py Outdated Show resolved Hide resolved
albi3ro and others added 2 commits June 10, 2024 10:12
Co-authored-by: Isaac De Vlugt <34751083+isaacdevlugt@users.noreply.github.com>
Copy link

codecov bot commented Jun 10, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 99.66%. Comparing base (2100476) to head (fe04178).
Report is 2 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #5826      +/-   ##
==========================================
- Coverage   99.66%   99.66%   -0.01%     
==========================================
  Files         415      415              
  Lines       39786    39506     -280     
==========================================
- Hits        39654    39373     -281     
- Misses        132      133       +1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@albi3ro albi3ro enabled auto-merge (squash) June 10, 2024 14:44
@albi3ro albi3ro merged commit bec5bb0 into master Jun 10, 2024
40 checks passed
@albi3ro albi3ro deleted the transform-qjit-error branch June 10, 2024 15:12
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.

None yet

3 participants