-
Notifications
You must be signed in to change notification settings - Fork 54
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
Make sure no zero-bitsize connections appear #1105
Conversation
cc @NoureldinYosri found this in reviewing #1057 |
@tanujkhattar
|
passed as selection bitsize to @tanujkhattar can you fix |
@tanujkhattar can you approve. Looks like the failures are indeed fixed :) |
This adds additional assertions to
qualtran.testing
to make sure none of theConnection
objects have zero bitsize. The presence of such registers/connections likely breaks assumptions used by the rest of the library. cc #1102Originally, I was going to add asserts to the
QDType
s themselves, but 1) they're used in several places other than defining registers that actually appear in a composite bloq causing "false positives" in the test 2) performing those assertions at QDType instantiation makes it impossible to get around; whereas this current change will only result in a failure if you're usingqlt_testing.assert_valid_bloq_decomposition
or its friends (or thebloq_autotester
) so this PR probably has some false negatives still remaining.