Skip to content

Commit

Permalink
Remove deprecated class SerializableDevice (#5743)
Browse files Browse the repository at this point in the history
Remove deprecated property GridDevice.qubits.
Clean up documentation references to the SerializableDevice and
update the circuit validation example in the specification.md doc.

Part of #5050
  • Loading branch information
pavoljuhas authored Jul 13, 2022
1 parent aac36aa commit 8ef8aef
Show file tree
Hide file tree
Showing 12 changed files with 11 additions and 645 deletions.
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.

Loading

0 comments on commit 8ef8aef

Please sign in to comment.