-
Notifications
You must be signed in to change notification settings - Fork 51
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
Propagate split dtype to join #817
Propagate split dtype to join #817
Conversation
…ualtran into propagate_split_dtype_to_join
Pass == dtype_ is preserved the whole way |
^^ I'm not actually sure the cirq-interop splits and joins are correct looking and the picture. |
@fdmalone What are your concerns? One concern I see is that the I think we default to using |
Maybe it's unrelated, I was concerned by the integer-like QFxp(4, 0) splitting into a QFxp(2,2), but I think this fine. I was having some issues with this bloq in classical sim with Fxp but probably unrelated. Ignore my previous comment :) |
@tanujkhattar PTAL |
Debugging. Tidy.
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.
Left a round of comments. Looking good overall. Main question is regarding the special casing for QFxp
in _ensure_in_reg_exists
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.
LGTM % one final question
assert isinstance( | ||
soq.reg.dtype, QBit | ||
), f"Found non-QBit type register which shouldn't happen: {soq.reg.name} {soq.reg.dtype}" | ||
if not isinstance(in_reg.dtype, QBit): | ||
err_msg = ( | ||
"Found non-QBit type register which shouldn't happen: " | ||
f"{soq.reg.name} {soq.reg.dtype}" | ||
) | ||
assert isinstance(soq.reg.dtype, QBit), err_msg |
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.
The assertion probably does belon above since in both the if / else cases we assume that soq.reg.dtype
is of type QBit
?
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.
Reverted
…ualtran into propagate_split_dtype_to_join
Fixes #722:
Adds back types to joins to ensure no loss of information when a split is followed by a join. I added a severity level to how strictly we may want to enforce type checking:
I added an autotester to colorize the check to show how strictly enforced our type checking currently is, and updated the cirq interop to handle the splits and joins there