Skip to content

Conversation

@verult
Copy link
Collaborator

@verult verult commented Jun 14, 2022

Preferred alternative over #5476 (renaming GridDevice to GoogleGridDevice). This resolves the issue of JSON name collisions between cirq_google and elsewhere by including the cirq.google namespace.

Furthermore, by staying with GridDevice as the class name, we require the caller to include the cirq-google module name in cases when multiple GridDevice classes are used (for example in the server side code today).

@95-martin-orion @mpharrigan
cc @dstrain115 @tanujkhattar

@verult verult requested review from a team, cduck, vtomole and wcourtney as code owners June 14, 2022 01:43
@CirqBot CirqBot added the Size: XS <10 lines changed label Jun 14, 2022
Copy link
Collaborator

@95-martin-orion 95-martin-orion left a comment

Choose a reason for hiding this comment

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

+1

'GoogleNoiseProperties': cirq_google.GoogleNoiseProperties,
'SycamoreGate': cirq_google.SycamoreGate,
'GateTabulation': cirq_google.GateTabulation,
'GridDevice': cirq_google.GridDevice,
Copy link
Collaborator

Choose a reason for hiding this comment

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

[No change needed] As discussed, this is safe because GridDevice has not yet appeared in a Cirq release.

@mpharrigan
Copy link
Collaborator

Yes, using the json "namespacing" feature is much preferred to coming up with new names that don't match the class name. All objects would ideally be namespaced (with a carveout for top-level cirq. items)

@verult verult added the automerge Tells CirqBot to sync and merge this PR. (If it's running.) label Jun 14, 2022
@CirqBot CirqBot added the front_of_queue_automerge CirqBot uses this label to indicate (and remember) what's being merged next. label Jun 14, 2022
@CirqBot CirqBot merged commit ce99bf4 into quantumlib:master Jun 14, 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 Jun 14, 2022
augustehirth pushed a commit to augustehirth/Cirq that referenced this pull request Jun 15, 2022
…#5512)

Preferred alternative over quantumlib#5476 (renaming `GridDevice` to `GoogleGridDevice`). This resolves the issue of JSON name collisions between cirq_google and elsewhere by including the `cirq.google` namespace.

Furthermore, by staying with `GridDevice` as the class name, we require the caller to include the `cirq-google` module name in cases when multiple `GridDevice` classes are used (for example in the server side code today).

@95-martin-orion @mpharrigan 
cc @dstrain115 @tanujkhattar
rht pushed a commit to rht/Cirq that referenced this pull request May 1, 2023
…#5512)

Preferred alternative over quantumlib#5476 (renaming `GridDevice` to `GoogleGridDevice`). This resolves the issue of JSON name collisions between cirq_google and elsewhere by including the `cirq.google` namespace.

Furthermore, by staying with `GridDevice` as the class name, we require the caller to include the `cirq-google` module name in cases when multiple `GridDevice` classes are used (for example in the server side code today).

@95-martin-orion @mpharrigan 
cc @dstrain115 @tanujkhattar
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Size: XS <10 lines changed

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants