-
Notifications
You must be signed in to change notification settings - Fork 47
Implement automatic qubit management #1788
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
Conversation
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, some smaller suggestions for improvements:
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #1788 +/- ##
=======================================
Coverage 96.60% 96.61%
=======================================
Files 82 82
Lines 9233 9260 +27
Branches 872 875 +3
=======================================
+ Hits 8920 8947 +27
Misses 254 254
Partials 59 59 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
…it_management field
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.
Excellent 💯
Context:
We wish to support automatic qubit management, i.e. when the user does not specify the number of wires in device initialization
Description of the Change:
A new unit attribute,
auto_qubit_management
, is added to the device init op. If no wires are specified during device init in user python, we trace to device init op with this attribute turned on.In runtime, when a new user wire index is encountered in
__catalyst__rt__array_get_element_ptr_1d
, if the device is in automatic management mode (as indicated by theRTDevice
constructor, set from the new attribute we added), we allocate new device qubits so that this new user wire index is an available qubit.Benefits:
The automatic qubit management feature is now supported.
Possible Drawbacks:
qml.map_wires
#1800[sc-86500]