Move moment index into circuit message#7008
Merged
dstrain115 merged 8 commits intoquantumlib:mainfrom Feb 4, 2025
Merged
Conversation
Collaborator
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
pavoljuhas
requested changes
Jan 31, 2025
Collaborator
pavoljuhas
left a comment
There was a problem hiding this comment.
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): | |||
Collaborator
There was a problem hiding this comment.
Let us handle corner case when moment is at index 0.
Suggested change
| 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.
Collaborator
Author
There was a problem hiding this comment.
Good call. Done.
pavoljuhas
approved these changes
Feb 3, 2025
BichengYing
pushed a commit
to BichengYing/Cirq
that referenced
this pull request
Jun 20, 2025
* 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.
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.