-
Notifications
You must be signed in to change notification settings - Fork 598
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
[New Device Capabilities] Add capabilities
to the device API (WIP)
#6433
base: device-cap
Are you sure you want to change the base?
Conversation
Hello. You may have forgotten to update the changelog!
|
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## device-cap #6433 +/- ##
===========================================
Coverage 99.38% 99.38%
===========================================
Files 448 448
Lines 42560 42576 +16
===========================================
+ Hits 42300 42316 +16
Misses 260 260 ☔ View full report in Codecov by Sentry. |
def capabilities(self) -> dict: | ||
"""To override the Device class's capabilities property | ||
|
||
TODO: unify the behaviour of the old `capabilities` and the new. | ||
|
||
""" | ||
return self._device.capabilities() | ||
|
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.
Unless we can map the child capabilities to a DeviceCapabiltiies
class, we should probably just return None
here.
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.
Does any legacy device still depends on its capabilities
being a method that returns a dictionary? Many of our tests currently do, e.g.,
pennylane/tests/measurements/test_state.py
Line 357 in 4986a3a
capabilities = dev.capabilities().copy() |
Should we update the tests to get rid of its dependency on the capabilities
method?
@@ -121,6 +123,25 @@ class Device(abc.ABC): | |||
|
|||
""" | |||
|
|||
config: Optional[str] = None |
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.
What would you think of config_location
instead?
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.
How about config_file
?
Follow up PR to #6407, adds
capabilities
to the device API.[sc-71716]
[sc-71709]