-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Disallow passing types as tags #6947
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
- This has caused confusion when passing a tag type with PhysicalZTag as a tag when you mean the instance PhysicalZTag().
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #6947 +/- ##
=======================================
Coverage 97.86% 97.86%
=======================================
Files 1084 1084
Lines 94408 94408
=======================================
+ Hits 92393 92397 +4
+ Misses 2015 2011 -4 ☔ View full report in Codecov by Sentry. |
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, thanks! Please consider updating a few comments before merging -
diff --git a/cirq-google/cirq_google/api/v2/program.proto b/cirq-google/cirq_google/api/v2/program.proto
index cbc66cc4..c0b4dc32 100644
--- a/cirq-google/cirq_google/api/v2/program.proto
+++ b/cirq-google/cirq_google/api/v2/program.proto
@@ -146 +146 @@ message ZPowGate {
- // cirq.ZPowGate(...).with_tags(cirq.google.PhysicalZTag)
+ // cirq.ZPowGate(...).with_tags(cirq.google.PhysicalZTag())
diff --git a/cirq-google/cirq_google/transformers/target_gatesets/google_cz_gateset.py b/cirq-google/cirq_google/transformers/target_gatesets/google_cz_gateset.py
index dacefe8c..fe59e26b 100644
--- a/cirq-google/cirq_google/transformers/target_gatesets/google_cz_gateset.py
+++ b/cirq-google/cirq_google/transformers/target_gatesets/google_cz_gateset.py
@@ -40 +40 @@ class GoogleCZTargetGateset(cirq.CZTargetGateset):
- `cirq_google.PhysicalZTag`) from single-qubit Pauli operations. Defaults to False.
+ `cirq_google.PhysicalZTag()`) from single-qubit Pauli operations. Defaults to False.
* Disallow passing types as tags - This has caused confusion when passing a tag type with PhysicalZTag as a tag when you mean the instance PhysicalZTag(). - Adds comments to TaggedOperation and Operation to explain the limitation.
Fixes: #3897