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

Deprecate XmonDevice, Foxtail and Bristlecone. #4864

Merged
merged 3 commits into from
Jan 21, 2022

Conversation

MichaelBroughton
Copy link
Collaborator

@MichaelBroughton MichaelBroughton commented Jan 20, 2022

Resolves #4856 .

qcs_notebook fxn now returns a Sycamore device which feels like "more correct" behavior.

BREAKING_CHANGE=Json and repr files were removed for these objects since it looks like they were never really needed.

The Foxtail and Bristlecone objects were just static singleton datastores we had in the library itself - in their current form there would never be any need to serialize them. Plus working in the deserialization of global singletons to avoid some warnings isn't something that seemed worth doing for this removal.

xref #4744

Copy link
Collaborator

@tanujkhattar tanujkhattar left a comment

Choose a reason for hiding this comment

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

Looks good overall. Left a few minor comments. Will approve once they are fixed.

cirq-google/cirq_google/__init__.py Show resolved Hide resolved
@@ -150,3 +151,13 @@
from cirq_google.json_resolver_cache import _class_resolver_dictionary

_register_resolver(_class_resolver_dictionary)

__spec_copy__ = sys.modules[__name__].__spec__
Copy link
Collaborator

Choose a reason for hiding this comment

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

Why do we need to explicitly copy the spec and then pass it to deprecate_attributes ? Can't we just do:

sys.modules[__name__] = _compat.deprecate_attributes(
    sys.modules[__name__],
    {
        'Bristlecone': ('v0.15', 'Bristlecone will no longer be supported.'),
        'Foxtail': ('v0.15', 'Foxtail will no longer be supported.'),
    },
)

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

for some reason this update clobbers the spec entry in sys.modules I'm not a python wizard, but this worked well enough. So it is needed.

@@ -43,7 +43,8 @@ def qubits(self):
raise NotImplementedError()


def test_init():
@mock.patch.dict(os.environ, clear='CIRQ_TESTING')
Copy link
Collaborator

Choose a reason for hiding this comment

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

You can just add a ALLOW_DEPRECATION_IN_TEST = 'ALLOW_DEPRECATION_IN_TEST' at the beginning of the file instead of adding a patch to each individual test

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Try as I might I couldn't get this for some reason or other, so I just left as mocks.

cirq-google/cirq_google/json_resolver_cache.py Outdated Show resolved Hide resolved
cirq-google/cirq_google/json_test_data/spec.py Outdated Show resolved Hide resolved
@MichaelBroughton MichaelBroughton added the automerge Tells CirqBot to sync and merge this PR. (If it's running.) label Jan 21, 2022
@CirqBot CirqBot added the front_of_queue_automerge CirqBot uses this label to indicate (and remember) what's being merged next. label Jan 21, 2022
@CirqBot
Copy link
Collaborator

CirqBot commented Jan 21, 2022

Automerge cancelled: A status check is failing.

@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 Jan 21, 2022
@tanujkhattar tanujkhattar merged commit ee9bd68 into quantumlib:master Jan 21, 2022
@MichaelBroughton MichaelBroughton deleted the dep_xmon branch January 21, 2022 03:56
MichaelBroughton added a commit to MichaelBroughton/Cirq that referenced this pull request Jan 22, 2022
* Deprecate XmonDevice, Foxtail and Bristlecone.

* Tanuj feedback.

Co-authored-by: Cirq Bot <[email protected]>
rht pushed a commit to rht/Cirq that referenced this pull request May 1, 2023
* Deprecate XmonDevice, Foxtail and Bristlecone.

* Tanuj feedback.

Co-authored-by: Cirq Bot <[email protected]>
harry-phasecraft pushed a commit to PhaseCraft/Cirq that referenced this pull request Oct 31, 2024
* Deprecate XmonDevice, Foxtail and Bristlecone.

* Tanuj feedback.

Co-authored-by: Cirq Bot <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
size: XL lines changed >1000
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[cirq-google] Proposal: Remove XmonDevice, Bristlecone, Foxtail and rename optimize_for_xmon.
3 participants