-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Add classical conditions to cirq_google proto #7250
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
Add classical conditions to cirq_google proto #7250
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:
|
@dstrain115 - do we need to include this in the upcoming 1.5.0 or can it wait for a dev version after? |
It can wait. |
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.
overall looks good ... just a minor request to support this feature #6914
sympy.StrictGreaterThan: ">", | ||
sympy.LessThan: "<=", | ||
sympy.StrictLessThan: "<", | ||
} |
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.
for SympyCondition
we also need the bitswise functions And
, OR
, Not
, Xor
, sympy.Indexed
and sympy.IndexedBase
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.
Done.
* 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>
conditions.
(==, !=, <, >, <=, >=)