-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Move virtual engine processor to GridDevice #5561
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
Move virtual engine processor to GridDevice #5561
Conversation
1da5768 to
e7f1d88
Compare
* Change return type to `cirq.Device` to allow device implementation to be swapped in the future.
e7f1d88 to
a0aec4a
Compare
MichaelBroughton
left a comment
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.
LGTM will leave to @dstrain115 for a quick check off.
…factor/virtual-engine-grid-device
| This directory contains snapshots of `DeviceSpecification` proto messages | ||
| (defined in `cirq-google/cirq_google/api/v2/device.proto`) describing Google devices. | ||
|
|
||
| Files with the prefix `_for_grid_device` are equivalent representations of corresponding proto files |
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.
suffix?
|
|
||
|
|
||
| def test_get_device_specification(): | ||
| # TODO(verult) |
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.
???
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.
Oops added as a reminder to come back and update the test but forgot to remove it after that. Thanks!
dstrain115
left a comment
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.
Looks fine to me besides the unfinished test.
| def test_get_device_specification(): | ||
| # TODO(verult) | ||
| processor = cg.EngineProcessor('a', 'p', EngineContext(), _processor=quantum.QuantumProcessor()) | ||
| assert processor.get_device_specification() is None |
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.
Why is this None? Is this an incomplete test?
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.
This was here from the previous iteration of the test. I think this part just verifies that an unset DeviceSpecification doesn't break anything. The next section verifies an actual DeviceSpecification.
|
Automerge cancelled: A required status check is not present. Missing statuses: ['Build docs', 'Build protos', 'Coverage check', 'Misc check', 'Pytest MacOS (3.7)', 'Pytest MacOS (3.8)', 'Pytest MacOS (3.9)', 'Pytest Ubuntu (3.7)', 'Pytest Ubuntu (3.8)', 'Pytest Ubuntu (3.9)', 'Pytest Windows (3.7)', 'Pytest Windows (3.8)', 'Pytest Windows (3.9)', 'Typescript lint check', 'Typescript tests', 'Typescript tests coverage'] |
|
Automerge cancelled: A status check is failing. |
|
Automerge cancelled: A status check is failing. |
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
Moves the various device-related functions in
virtual_engine_processor.pyto GridDevice. This is blocking SerializableDevice deprecation (#5522) because library code cannot call the deprecated SerializableDevice.virtual_engine_processor.pytoGridDevicegate_setsparameter invirtual_engine_processor.pycreate_device_from_processor_id()to GridDevice. @95-martin-orioncirq.Deviceto allow for new device implementations in the future.create_noiseless_virtual_engine_from_templates()is updated to return aGridDevice, and the templates (rainbow and weber DeviceSpecifications) need to contain data in the new format in order to parse into GridDevice properly.Reviewer Note: The first 3 commits are from another pending PR (#5558); please start with the commit "Move virtual engine functions to GridDevice". 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