[Bugfix] Re-allow non-integral line/grid qubits#7110
Merged
daxfohl merged 6 commits intoquantumlib:mainfrom Mar 3, 2025
Merged
[Bugfix] Re-allow non-integral line/grid qubits#7110daxfohl merged 6 commits intoquantumlib:mainfrom
daxfohl merged 6 commits intoquantumlib:mainfrom
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #7110 +/- ##
==========================================
- Coverage 98.15% 98.15% -0.01%
==========================================
Files 1089 1089
Lines 95251 95255 +4
==========================================
- Hits 93497 93495 -2
- Misses 1754 1760 +6 ☔ View full report in Codecov by Sentry. |
dstrain115
approved these changes
Mar 3, 2025
Collaborator
dstrain115
left a comment
There was a problem hiding this comment.
Thanks for fixing this!
pavoljuhas
approved these changes
Mar 3, 2025
Collaborator
pavoljuhas
left a comment
There was a problem hiding this comment.
LGTM with a couple of small comments. Thank you!
pavoljuhas
reviewed
Mar 3, 2025
BichengYing
pushed a commit
to BichengYing/Cirq
that referenced
this pull request
Jun 20, 2025
* Allow non-integral line/grid qubits * tests * fix numpy overflow * fix tests * fix tests on windows * Address PR comments
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.
Fixes #7102. No longer coerces x/row/col to int. Wraps hash expression with
hashinstead.On my laptop it's also a tiny bit faster. It creates 10,000,000 LineQubits in 2.1s; old code took 2.5s.
Also, note that I left all the type annotations
int, which is what they have always been. I looked into changing these intonumbers.RationalorSupportsFloator something, but it's too invasive. Lots of code seems to assume integral x/row/col values, and mypy blows up when you try to expand it.