Skip to content

Commit 3e9609e

Browse files
pavoljuhasrht
authored andcommitted
Remove deprecated class SerializableDevice (quantumlib#5743)
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 quantumlib#5050
1 parent 7912e35 commit 3e9609e

12 files changed

+11
-645
lines changed

cirq-google/cirq_google/__init__.py

-1
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,6 @@
5959
GoogleNoiseProperties,
6060
GridDevice,
6161
NoiseModelFromGoogleNoiseProperties,
62-
SerializableDevice,
6362
Sycamore,
6463
Sycamore23,
6564
)

cirq-google/cirq_google/devices/__init__.py

-2
Original file line numberDiff line numberDiff line change
@@ -20,5 +20,3 @@
2020
from cirq_google.devices.known_devices import Sycamore, Sycamore23
2121

2222
from cirq_google.devices.grid_device import GridDevice
23-
24-
from cirq_google.devices.serializable_device import SerializableDevice

cirq-google/cirq_google/devices/grid_device.py

-9
Original file line numberDiff line numberDiff line change
@@ -308,15 +308,6 @@ def metadata(self) -> cirq.GridDeviceMetadata:
308308
"""Get metadata information for the device."""
309309
return self._metadata
310310

311-
# Some user code using SerializableDevices gets the qubit list via `device.qubits`.
312-
# This is a stopgap solution to prevent user breakage with the change to GridDevice.
313-
@property # type: ignore
314-
@cirq._compat.deprecated(
315-
deadline='v0.16', fix='Change `device.qubits` to `device.metadata.qubit_set`.'
316-
)
317-
def qubits(self) -> List[cirq.Qid]:
318-
return sorted(self._metadata.qubit_set)
319-
320311
def validate_operation(self, operation: cirq.Operation) -> None:
321312
"""Raises an exception if an operation is not valid.
322313

cirq-google/cirq_google/devices/grid_device_test.py

-8
Original file line numberDiff line numberDiff line change
@@ -490,11 +490,3 @@ def test_to_proto_empty():
490490
assert len(device.metadata.qubit_pairs) == 0
491491
assert device.metadata.gateset == cirq.Gateset()
492492
assert device.metadata.gate_durations is None
493-
494-
495-
def test_grid_device_qubits():
496-
device_info, spec = _create_device_spec_with_horizontal_couplings()
497-
device = cirq_google.GridDevice.from_proto(spec)
498-
499-
with cirq.testing.assert_deprecated('device.qubits', deadline='v0.16'):
500-
assert device.qubits == device_info.grid_qubits

cirq-google/cirq_google/devices/serializable_device.py

-347
This file was deleted.

0 commit comments

Comments
 (0)