-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Added MSGate
to top level
#6466
Conversation
cirq csynque meeting - there is a name conflict with ionq gate which shows in json serialization. |
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #6466 +/- ##
==========================================
- Coverage 97.76% 97.76% -0.01%
==========================================
Files 1105 1105
Lines 95030 95028 -2
==========================================
- Hits 92902 92900 -2
Misses 2128 2128 ☔ View full report in Codecov by Sentry. |
@tanujkhattar - should we support JSON serialization now? If so, that should be doable by adding If we don't want serialization we should make On a second look, adding serialization support seems better, because it is a bit strange to support MSGate in the cirq-ionq extension, but not in cirq-core. |
It'll probably be backwards incompatible, which is a bummer. But we don't have backwards compatibility guarantees for vendor packages so we can break users if we want |
As it is, the round trip What I suggest is to define |
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.
After a bit of offline discussion it seems better to support JSON serialization here.
As it is we can serialize cirq_ionq.MSGate
so for completeness
we should also handle the core cirq.MSGate.
The name conflict can be avoided by defining the _json_namespace_
class method for cirq.MSGate
; here is an example in cirq-google.
I suggest to use the "cirq"
namespace for the cirq.MSGate
.
@prakharb10 - are you available to add serialization support for the cirq.MSGate here? Feel free to let me know if you are too busy and I can take over from here. |
Hi @pavoljuhas |
This reverts commit ffdb3de.
Not yet passing.
The namespace-less cirq_type `MSGate` is used by `cirq_ionq.MSGate`.
@tanujkhattar - can you please take a quick look? |
* add `MSGate` to top level * mark `MSGate` as `not_yet_serializable` * Revert "mark `MSGate` as `not_yet_serializable`" This reverts commit ffdb3de. * Test json serialization of cirq.MSGate without custom resolver Not yet passing. * Use the "cirq" namespace to JSON-serialize `cirq.MSGate` The namespace-less cirq_type `MSGate` is used by `cirq_ionq.MSGate`. --------- Co-authored-by: Tanuj Khattar <tanujkhattar@google.com> Co-authored-by: Pavol Juhas <juhas@google.com>
* add `MSGate` to top level * mark `MSGate` as `not_yet_serializable` * Revert "mark `MSGate` as `not_yet_serializable`" This reverts commit ffdb3de. * Test json serialization of cirq.MSGate without custom resolver Not yet passing. * Use the "cirq" namespace to JSON-serialize `cirq.MSGate` The namespace-less cirq_type `MSGate` is used by `cirq_ionq.MSGate`. --------- Co-authored-by: Tanuj Khattar <tanujkhattar@google.com> Co-authored-by: Pavol Juhas <juhas@google.com>
Closes #6354
The JSON serializability test fails due tocirq_ionq.ionq_native_gates.MSGate
. I don't know how to resolve this.There is also a reference to the gate here:Cirq/cirq-core/cirq/ops/gate_operation_test.py
Line 511 in 6e38a27
Are any changes required?