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

Deprecate common serializers #5611

Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 16 additions & 8 deletions cirq-google/cirq_google/devices/known_devices_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,10 +65,14 @@ def test_create_device_proto_for_irregular_grid():

def test_multiple_gate_sets():
# Deprecations: cirq_google.SerializableGateSets class,
# well-known cirq_google SerializableGateSets (e.g. cirq_google.SYC_GATESET), and
# cirq_google.devices.known_devices.create_device_proto_from_diagram
# well-known cirq_google SerializableGateSets (e.g. cirq_google.SYC_GATESET), common serializers
# and cirq_google.devices.known_devices.create_device_proto_from_diagram
with cirq.testing.assert_deprecated(
'SerializableGateSet', 'no longer be available', deadline='v0.16', count=4
'SerializableGateSet',
'CircuitSerializer',
'no longer be available',
deadline='v0.16',
count=8,
):
halfPiGateSet = cirq_google.SerializableGateSet(
gate_set_name='half_pi_gateset',
Expand Down Expand Up @@ -229,7 +233,7 @@ def test_multiple_gate_sets():


def test_sycamore_circuitop_device():
# Deprecations: cirq_google.SerializableGateSets class,
# Deprecations: cirq_google.SerializableDevice, cirq_google.SerializableGateSets class,
# well-known cirq_google SerializableGateSets (e.g. cirq_google.SYC_GATESET), and
# cirq_google.devices.known_devices.create_device_proto_from_diagram
with cirq.testing.assert_deprecated(
Expand Down Expand Up @@ -337,14 +341,16 @@ def test_proto_with_circuitop():


def test_proto_with_waitgate():
# Deprecations: cirq_google.SerializableDevice, cirq_google.SerializableGateSet, and
# Deprecations: cirq_google.SerializableDevice, cirq_google.SerializableGateSet,
# common serializers, and
# cirq_google.devices.known_devices.create_device_proto_from_diagram
with cirq.testing.assert_deprecated(
'Use cirq_google.GridDevice',
'SerializableGateSet',
'CircuitSerializer',
'no longer be available',
deadline='v0.16',
count=5,
count=7,
):
wait_gateset = cirq_google.SerializableGateSet(
gate_set_name='wait_gateset',
Expand Down Expand Up @@ -408,14 +414,16 @@ def test_proto_with_waitgate():


def test_adding_gates_multiple_times():
# Deprecations: cirq_google.SerializableDevice, cirq_google.SerializableGateSet, and
# Deprecations: cirq_google.SerializableDevice, cirq_google.SerializableGateSet,
# common serializers, and
# cirq_google.devices.known_devices.create_device_proto_from_diagram
with cirq.testing.assert_deprecated(
'Use cirq_google.GridDevice',
'SerializableGateSet',
'CircuitSerializer',
'no longer be available',
deadline='v0.16',
count=5,
count=11,
):
waiting_for_godot = cirq_google.SerializableGateSet(
gate_set_name='wait_gateset',
Expand Down
24 changes: 15 additions & 9 deletions cirq-google/cirq_google/devices/serializable_device_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -395,14 +395,16 @@ def test_mixing_types():


def test_multiple_gatesets():
# Deprecations: cirq_google.SerializableDevice, cirq_google.SerializableGateSet, and
# cirq_google.devices.known_devices.create_device_proto_from_diagram
# Deprecations: cirq_google.SerializableDevice, cirq_google.SerializableGateSet,
# common serializers, and
# cirq_google.devices.known_devices.create_device_proto_from_diagram,
with cirq.testing.assert_deprecated(
'Use cirq_google.GridDevice',
'SerializableGateSet',
'CircuitSerializer',
'no longer be available',
deadline='v0.16',
count=6,
count=10,
):
halfPiGateSet = cirq_google.SerializableGateSet(
gate_set_name='half_pi_gateset',
Expand Down Expand Up @@ -437,14 +439,16 @@ def test_half_pi_takes_half_duration():
gate perform correctly. In this case, we set the XPowGate to be
half the duration of the full exponent and make sure it still works.
"""
# Deprecations: cirq_google.SerializableDevice, cirq_google.SerializableGateSet, and
# cirq_google.devices.known_devices.create_device_proto_from_diagram
# Deprecations: cirq_google.SerializableDevice, cirq_google.SerializableGateSet,
# common serializers, and
# cirq_google.devices.known_devices.create_device_proto_from_diagram,
with cirq.testing.assert_deprecated(
'Use cirq_google.GridDevice',
'SerializableGateSet',
'CircuitSerializer',
'no longer be available',
deadline='v0.16',
count=5,
count=7,
):
half_pi_gs = cirq_google.SerializableGateSet(
gate_set_name='half_pi',
Expand All @@ -470,14 +474,16 @@ def test_multiple_fsim_gatesets():
gate perform correctly. In this case, we set the XPowGate to be
half the duration of the full exponent and make sure it still works.
"""
# Deprecations: cirq_google.SerializableDevice, cirq_google.SerializableGateSet, and
# cirq_google.devices.known_devices.create_device_proto_from_diagram
# Deprecations: cirq_google.SerializableDevice, cirq_google.SerializableGateSet,
# common serializers, and
# cirq_google.devices.known_devices.create_device_proto_from_diagram,
with cirq.testing.assert_deprecated(
'Use cirq_google.GridDevice',
'SerializableGateSet',
'CircuitSerializer',
'no longer be available',
deadline='v0.16',
count=5,
count=7,
):
half_pi_gs = cirq_google.SerializableGateSet(
gate_set_name='half_pi',
Expand Down
Loading