Move Engine interfaces to GridDevice - #5558
Merged
CirqBot merged 3 commits intoJun 20, 2022
Merged
Conversation
verult
requested review from
a team,
cduck,
vtomole and
wcourtney
as code owners
June 18, 2022 22:07
verult
force-pushed
the
cg-device-refactor/reroute-getdevice
branch
from
June 20, 2022 01:50
77c1d75 to
1e68ce6
Compare
CirqBot
pushed a commit
that referenced
this pull request
Jun 21, 2022
Moves the various device-related functions in `virtual_engine_processor.py` to GridDevice. This is blocking SerializableDevice deprecation (#5522) because library code cannot call the deprecated SerializableDevice. * Rerouted functions in `virtual_engine_processor.py` to `GridDevice` * Deprecated the `gate_sets` parameter in `virtual_engine_processor.py` * Move `create_device_from_processor_id()` to GridDevice. @95-martin-orion * Made the return type more general by changing it to `cirq.Device` to allow for new device implementations in the future. * Created copies of existing rainbow and weber DeviceSpecifications and changed them to match the new DeviceSpecification format. * This update needs to happen now because `create_noiseless_virtual_engine_from_templates()` is updated to return a `GridDevice`, and the templates (rainbow and weber DeviceSpecifications) need to contain data in the new format in order to parse into GridDevice properly. * There are no publicly available devices since weber, so I chose to repurpose the existing rainbow and weber information. This was done manually since these devices are no longer available. * Gateset and gate_duration information should match previous versions. In particular, they both include the CZ gate with no duration information. **Reviewer Note**: The first 3 commits are from another pending PR (#5558); please start with the commit "[Move virtual engine functions to GridDevice](2e9ef33)". Don't be discouraged by the line count :) other than the 3 borrowed commits, ~600 lines are from the two new DeviceSpecification messages. @mpharrigan cc @MichaelBroughton @dstrain115
rht
pushed a commit
to rht/Cirq
that referenced
this pull request
May 1, 2023
* Migrate the different `processor.get_device()` methods and `Engine.get_engine_device()` to GridDevice * Deprecate the `gate_sets` parameter in various `get_device()` methods, and remove `gate_sets` usages. A dedicated deprecation decorator was added in order to handle `gate_sets` parameter being passed in as a positional argument. Originally I had planned to do this after the 0.15 release, but because library code is not allowed to rely on deprecated code within tests, this is blocking SerializableDevice deprecation (quantumlib#5522). @dstrain115 @MichaelBroughton
rht
pushed a commit
to rht/Cirq
that referenced
this pull request
May 1, 2023
Moves the various device-related functions in `virtual_engine_processor.py` to GridDevice. This is blocking SerializableDevice deprecation (quantumlib#5522) because library code cannot call the deprecated SerializableDevice. * Rerouted functions in `virtual_engine_processor.py` to `GridDevice` * Deprecated the `gate_sets` parameter in `virtual_engine_processor.py` * Move `create_device_from_processor_id()` to GridDevice. @95-martin-orion * Made the return type more general by changing it to `cirq.Device` to allow for new device implementations in the future. * Created copies of existing rainbow and weber DeviceSpecifications and changed them to match the new DeviceSpecification format. * This update needs to happen now because `create_noiseless_virtual_engine_from_templates()` is updated to return a `GridDevice`, and the templates (rainbow and weber DeviceSpecifications) need to contain data in the new format in order to parse into GridDevice properly. * There are no publicly available devices since weber, so I chose to repurpose the existing rainbow and weber information. This was done manually since these devices are no longer available. * Gateset and gate_duration information should match previous versions. In particular, they both include the CZ gate with no duration information. **Reviewer Note**: The first 3 commits are from another pending PR (quantumlib#5558); please start with the commit "[Move virtual engine functions to GridDevice](quantumlib@2e9ef33)". Don't be discouraged by the line count :) other than the 3 borrowed commits, ~600 lines are from the two new DeviceSpecification messages. @mpharrigan cc @MichaelBroughton @dstrain115
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
processor.get_device()methods andEngine.get_engine_device()to GridDevicegate_setsparameter in variousget_device()methods, and removegate_setsusages.A dedicated deprecation decorator was added in order to handle
gate_setsparameter being passed in as a positional argument.Originally I had planned to do this after the 0.15 release, but because library code is not allowed to rely on deprecated code within tests, this is blocking SerializableDevice deprecation (#5522).
@dstrain115 @MichaelBroughton