Do not allow creating registers with bitsize 0#6298
Merged
tanujkhattar merged 2 commits intoquantumlib:masterfrom Sep 25, 2023
Merged
Do not allow creating registers with bitsize 0#6298tanujkhattar merged 2 commits intoquantumlib:masterfrom
tanujkhattar merged 2 commits intoquantumlib:masterfrom
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. |
mpharrigan
reviewed
Sep 25, 2023
| @cached_property | ||
| def target_registers(self) -> Tuple[infra.Register, ...]: | ||
| total_iteration_size = np.product( | ||
| total_iteration_size = np.prod( |
Collaborator
There was a problem hiding this comment.
for my edification: why this change?
Collaborator
Author
There was a problem hiding this comment.
It fails mypy checks because np.product has been deprecated.
mpharrigan
approved these changes
Sep 25, 2023
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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
bitsizeshould always be a positive integer.cc @mpharrigan