Skip to content
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

Remove deprecated class SerializableDevice #5743

Merged

Conversation

pavoljuhas
Copy link
Collaborator

@pavoljuhas pavoljuhas commented Jul 12, 2022

Remove deprecated property GridDevice.qubits.
Clean up documentation references to the SerializableDevice and
update the circuit validation example in the specification.md doc.

Part of #5050

@pavoljuhas pavoljuhas requested review from wcourtney, a team, vtomole, cduck and verult as code owners July 12, 2022 22:22
@CirqBot CirqBot added the size: L 250< lines changed <1000 label Jul 12, 2022
@pavoljuhas pavoljuhas requested a review from dabacon July 12, 2022 22:23
@pavoljuhas
Copy link
Collaborator Author

Can someone better versed with the proto-to-GridDevice process please check the docs/google/*.md files in this PR if they still make sense?

Copy link
Collaborator

@dabacon dabacon left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There are occurrences in known_devices_test.py that I don't see here. Also a reference in quantum_runtime.py

@@ -14,7 +14,6 @@
'SYC_GATESET',
'Sycamore',
'Sycamore23',
'SerializableDevice',
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lol good thing a SerializableDevice was never json serialized.

@pavoljuhas
Copy link
Collaborator Author

There are occurrences in known_devices_test.py that I don't see here. Also a reference in quantum_runtime.py

I fail to see the one in known_devices_test.py, perhaps we look at different versions?

$ git grep -i 'serializable.*device' '*known_devi*test*'

Cleaning up the reference in quantum_runtime.py as below causes some test failures so I'd rather leave it for a separate PR.

diff --git a/cirq-google/cirq_google/workflow/quantum_runtime.py b/cirq-google/cirq_google/workflow/quantum_runtime.py
index 56fa0a33..644f6b94 100644
--- a/cirq-google/cirq_google/workflow/quantum_runtime.py
+++ b/cirq-google/cirq_google/workflow/quantum_runtime.py
@@ -59,10 +59,7 @@ class SharedRuntimeInfo:
         return 'cirq.google'

     def _json_dict_(self) -> Dict[str, Any]:
-        d = dataclass_json_dict(self)
-        # TODO (gh-4699): serialize `device` as well once SerializableDevice is serializable.
-        del d['device']
-        return d
+        return dataclass_json_dict(self)

     def __repr__(self) -> str:
         return _compat.dataclass_repr(self, namespace='cirq_google')

@review-notebook-app
Copy link

Check out this pull request on  ReviewNB

See visual diffs & provide feedback on Jupyter Notebooks.


Powered by ReviewNB

@pavoljuhas pavoljuhas requested a review from dabacon July 12, 2022 23:22
@dabacon
Copy link
Collaborator

dabacon commented Jul 12, 2022

Oh damn github search index is .... not fast.

Copy link
Collaborator

@dabacon dabacon left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM modulo one comment in specification.md

docs/google/specification.md Show resolved Hide resolved
@pavoljuhas pavoljuhas added the automerge Tells CirqBot to sync and merge this PR. (If it's running.) label Jul 13, 2022
@CirqBot CirqBot added the front_of_queue_automerge CirqBot uses this label to indicate (and remember) what's being merged next. label Jul 13, 2022
@CirqBot CirqBot merged commit 8ef8aef into quantumlib:master Jul 13, 2022
@CirqBot CirqBot removed automerge Tells CirqBot to sync and merge this PR. (If it's running.) front_of_queue_automerge CirqBot uses this label to indicate (and remember) what's being merged next. labels Jul 13, 2022
@pavoljuhas pavoljuhas deleted the drop-cirq_google.SerializableDevice branch July 13, 2022 01:29
rht pushed a commit to rht/Cirq that referenced this pull request May 1, 2023
Remove deprecated property GridDevice.qubits.
Clean up documentation references to the SerializableDevice and
update the circuit validation example in the specification.md doc.

Part of quantumlib#5050
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
size: L 250< lines changed <1000
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants