Add classical conditions to cirq_google proto#7250
Merged
dstrain115 merged 12 commits intoquantumlib:mainfrom Apr 9, 2025
Merged
Add classical conditions to cirq_google proto#7250dstrain115 merged 12 commits intoquantumlib:mainfrom
dstrain115 merged 12 commits intoquantumlib:mainfrom
Conversation
- Adds support for (potentially nested) tuples of mismatched types - Adds support for serializing ndarrays - Adds support for serializing complex numbers
Co-authored-by: Pavol Juhas <pavol.juhas@gmail.com>
- Adds classical conditions to cirq_google proto. - Adds fields to MeasurementKey to support various (possibly nested) conditions. - Centralize and generalize sympy operations. Add comparison operators (==, !=, <, >, <=, >=) - Add support for KeyCondition, SympyCondition, and BitMaskKeyCondition - Adds conditioned_on to Operation proto. - Adds repeat_until and conditioned_on to CircuitOperation proto.
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #7250 +/- ##
==========================================
+ Coverage 98.64% 98.66% +0.01%
==========================================
Files 1106 1106
Lines 95990 96049 +59
==========================================
+ Hits 94691 94768 +77
+ Misses 1299 1281 -18 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Collaborator
|
@dstrain115 - do we need to include this in the upcoming 1.5.0 or can it wait for a dev version after? |
Collaborator
Author
|
It can wait. |
Collaborator
NoureldinYosri
left a comment
There was a problem hiding this comment.
overall looks good ... just a minor request to support this feature #6914
| sympy.StrictGreaterThan: ">", | ||
| sympy.LessThan: "<=", | ||
| sympy.StrictLessThan: "<", | ||
| } |
Collaborator
There was a problem hiding this comment.
for SympyCondition we also need the bitswise functions And, OR, Not, Xor, sympy.Indexed and sympy.IndexedBase
NoureldinYosri
approved these changes
Apr 9, 2025
This was referenced May 30, 2025
BichengYing
pushed a commit
to BichengYing/Cirq
that referenced
this pull request
Jun 20, 2025
* Add tuples, ndarrays, and complex numbers to cirq_google proto - Adds support for (potentially nested) tuples of mismatched types - Adds support for serializing ndarrays - Adds support for serializing complex numbers * my o my, it's mypy * Fix all the review comments, add set support. * Fix invert mask, which assumes list, so it can accept tuples. * Update cirq-google/cirq_google/serialization/arg_func_langs.py Co-authored-by: Pavol Juhas <pavol.juhas@gmail.com> * Fix coverage. * Add classical conditions to cirq_google proto - Adds classical conditions to cirq_google proto. - Adds fields to MeasurementKey to support various (possibly nested) conditions. - Centralize and generalize sympy operations. Add comparison operators (==, !=, <, >, <=, >=) - Add support for KeyCondition, SympyCondition, and BitMaskKeyCondition - Adds conditioned_on to Operation proto. - Adds repeat_until and conditioned_on to CircuitOperation proto. * Add use_repetitions_id * Add sympy booleans and indexed. * Fix indexed issue. --------- Co-authored-by: Pavol Juhas <pavol.juhas@gmail.com>
This was referenced Aug 5, 2025
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.
conditions.
(==, !=, <, >, <=, >=)