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
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
1 change: 0 additions & 1 deletion cirq-google/cirq_google/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,6 @@
GoogleNoiseProperties,
GridDevice,
NoiseModelFromGoogleNoiseProperties,
SerializableDevice,
Sycamore,
Sycamore23,
)
Expand Down
2 changes: 0 additions & 2 deletions cirq-google/cirq_google/devices/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,5 +20,3 @@
from cirq_google.devices.known_devices import Sycamore, Sycamore23

from cirq_google.devices.grid_device import GridDevice

from cirq_google.devices.serializable_device import SerializableDevice
9 changes: 0 additions & 9 deletions cirq-google/cirq_google/devices/grid_device.py
Original file line number Diff line number Diff line change
Expand Up @@ -308,15 +308,6 @@ def metadata(self) -> cirq.GridDeviceMetadata:
"""Get metadata information for the device."""
return self._metadata

# Some user code using SerializableDevices gets the qubit list via `device.qubits`.
# This is a stopgap solution to prevent user breakage with the change to GridDevice.
@property # type: ignore
@cirq._compat.deprecated(
deadline='v0.16', fix='Change `device.qubits` to `device.metadata.qubit_set`.'
)
def qubits(self) -> List[cirq.Qid]:
return sorted(self._metadata.qubit_set)

def validate_operation(self, operation: cirq.Operation) -> None:
"""Raises an exception if an operation is not valid.

Expand Down
8 changes: 0 additions & 8 deletions cirq-google/cirq_google/devices/grid_device_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -490,11 +490,3 @@ def test_to_proto_empty():
assert len(device.metadata.qubit_pairs) == 0
assert device.metadata.gateset == cirq.Gateset()
assert device.metadata.gate_durations is None


def test_grid_device_qubits():
device_info, spec = _create_device_spec_with_horizontal_couplings()
device = cirq_google.GridDevice.from_proto(spec)

with cirq.testing.assert_deprecated('device.qubits', deadline='v0.16'):
assert device.qubits == device_info.grid_qubits
347 changes: 0 additions & 347 deletions cirq-google/cirq_google/devices/serializable_device.py

This file was deleted.