Change DType's real -> Bit casting rule - #16927
Open
Ian Hincks (ihincks) wants to merge 1 commit into
Open
Conversation
Ian Hincks (ihincks)
requested review from
Jeevan (jeevan0920)
and removed request for
a team
September 3, 2026 15:04
Collaborator
|
One or more of the following people are relevant to this code:
|
Ian Hincks (ihincks)
requested review from
Matthew Treinish (mtreinish)
and removed request for
Jeevan (jeevan0920)
September 3, 2026 15:05
Coverage Report for CI Build 34398814989Coverage increased (+0.001%) to 88.1%Details
Uncovered Changes
Coverage Regressions3 previously-covered lines in 2 files lost coverage.
Coverage Stats
💛 - Coveralls |
Ian Hincks (ihincks)
force-pushed
the
ihincks/qp-07-bit-cast
branch
from
September 3, 2026 20:37
1748964 to
02793f6
Compare
Ian Hincks (ihincks)
changed the base branch from
ihincks/qp-06-quantum-program
to
ihincks/qp-06c-shot-loop
September 3, 2026 22:13
Ian Hincks (ihincks)
force-pushed
the
ihincks/qp-07-bit-cast
branch
from
September 9, 2026 17:39
02793f6 to
92d9941
Compare
A `Bit` tensor holds only 0 or 1. Casting `2.5` to `Bit` produced `2`, which `bitwise_not` reads as `2 ^ 1 == 3`. The cast now compares against zero, like NumPy's cast to `bool`.
Matthew Treinish (mtreinish)
force-pushed
the
ihincks/qp-07-bit-cast
branch
from
September 9, 2026 20:04
92d9941 to
493cd86
Compare
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.
This PR makes the real->Bit casting rule follow NumPy's convention.
The current definition doesn't really make sense, it populates the 7 bits with junk.
AI/LLM disclosure
Stack created with GitHub Stacks CLI • Give Feedback 💬