-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Move moment index into circuit message #7008
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
Conversation
dstrain115
commented
Jan 30, 2025
- This addresses design review comments that the moment_index should be outside the Moment message to be consistent and avoid a message construction.
- This PR also simplifies the code to deserialize all the constants first, which removes the need for lookup tables and logic later.
- In addition, this puts the deserialization of a moment into its own function.
- This addresses design review comments that the moment_index should be outside the Moment message to be consistent and avoid a message construction. - This PR also simplifies the code to deserialize all the constants first, which removes the need for lookup tables and logic later. - In addition, this puts the deserialization of a moment into its own function.
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #7008 +/- ##
==========================================
- Coverage 97.89% 97.89% -0.01%
==========================================
Files 1085 1085
Lines 95131 95126 -5
==========================================
- Hits 93124 93119 -5
Misses 2007 2007 ☔ View full report in Codecov by Sentry. |
…/Cirq-1 into move_circuit_index_up
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 with a couple of small changes.
@@ -111,8 +111,7 @@ def _serialize_circuit( | |||
if self.use_constants_table_for_moments: | |||
if moment_index := raw_constants.get(moment, None): |
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.
Let us handle corner case when moment
is at index 0
.
if moment_index := raw_constants.get(moment, None): | |
if moment_index := raw_constants.get(moment, None) is not None: |
same for the similar constructs at lines 112, 135.
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.
Good call. Done.
* Move moment index into circuit message - This addresses design review comments that the moment_index should be outside the Moment message to be consistent and avoid a message construction. - This PR also simplifies the code to deserialize all the constants first, which removes the need for lookup tables and logic later. - In addition, this puts the deserialization of a moment into its own function. * types * typo]]]] * Fix build protos to whatever version thing I was missing. * Address review comments.