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

Refactor device code around capabilities [NFC] #1149

Merged
merged 9 commits into from
Sep 23, 2024
Merged

Conversation

dime10
Copy link
Collaborator

@dime10 dime10 commented Sep 23, 2024

Simplifies device related code around capability checks and decomposition, and eliminates the use of "Adjoint(*)" and "C(*)" declarations in favour of DeviceCapabilities and OperationProperties dataclasses.

Includes the following (non-functional) changes:

  • simplify get_device_capability signature
  • simplify catalyst_decompose signature
  • simplify QJITDevice.__init__ signature
  • eliminate pennylane_operation_set and use DeviceCapabilities instead
  • remove legacy-device operations, observables, and measurement_processes properties from our device classes

Some of the code seems to have been written solely to facilitate testing, which should be avoided.

[sc-67124]

.. to no longer take a ProgramFeatures argument,
since that information can be deduced from the supplied device.
.. to no longer take a stopping condition argument,
since that information can be obtained from the supplied capabilities.

Also eliminate the max_expension argument since PL is moving away from
it.
.. to not take backend and capability arguments,
since those can be computed from the supplied device.
.. instead of legacy-device-style op strings.
.. and remove obsolete device properties.
@dime10 dime10 added the frontend Pull requests that update the frontend label Sep 23, 2024
Copy link

codecov bot commented Sep 23, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 97.87%. Comparing base (c13cd9b) to head (8318d6f).
Report is 1 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1149      +/-   ##
==========================================
- Coverage   97.88%   97.87%   -0.02%     
==========================================
  Files          76       76              
  Lines       10863    10847      -16     
  Branches     1283     1282       -1     
==========================================
- Hits        10633    10616      -17     
  Misses        179      179              
- Partials       51       52       +1     

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

Copy link
Contributor

@rauletorresc rauletorresc left a comment

Choose a reason for hiding this comment

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

Apart from the code factor warning, I am happy to approve!

@dime10 dime10 merged commit 242244d into main Sep 23, 2024
42 checks passed
@dime10 dime10 deleted the device_simplications branch September 23, 2024 22:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
frontend Pull requests that update the frontend
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants