-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Do not allow creating registers with bitsize 0 #6298
Do not allow creating registers with bitsize 0 #6298
Conversation
Codecov ReportPatch coverage:
Additional details and impacted files@@ Coverage Diff @@
## master #6298 +/- ##
=======================================
Coverage 97.88% 97.88%
=======================================
Files 1104 1104
Lines 95863 95869 +6
=======================================
+ Hits 93840 93846 +6
Misses 2023 2023
☔ View full report in Codecov by Sentry. |
@@ -77,7 +77,7 @@ def selection_registers(self) -> Tuple[infra.SelectionRegister, ...]: | |||
|
|||
@cached_property | |||
def target_registers(self) -> Tuple[infra.Register, ...]: | |||
total_iteration_size = np.product( | |||
total_iteration_size = np.prod( |
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.
for my edification: why this change?
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.
It fails mypy checks because np.product
has been deprecated.
Registers with bitsize 0 are ambiguous since they you are not really passing any qubits to instantiate those registers. They also complicate the interop with Qualtran. This PR removes this workflow by adding an explicit validation that
bitsize
should always be a positive integer.cc @mpharrigan