diff --git a/cirq-google/cirq_google/devices/known_devices.py b/cirq-google/cirq_google/devices/known_devices.py index 0532486ada3..9255b3e7f54 100644 --- a/cirq-google/cirq_google/devices/known_devices.py +++ b/cirq-google/cirq_google/devices/known_devices.py @@ -280,6 +280,7 @@ def populate_qubit_pairs_in_device_proto( sycamore_gate.SYC, cirq.SQRT_ISWAP, cirq.SQRT_ISWAP_INV, + cirq.CZ, cirq.PhasedXZGate, # Physical Z and virtual Z gates are represented separately because they # have different gate durations. diff --git a/cirq-google/cirq_google/devices/specifications/README.md b/cirq-google/cirq_google/devices/specifications/README.md new file mode 100644 index 00000000000..601f6d10e25 --- /dev/null +++ b/cirq-google/cirq_google/devices/specifications/README.md @@ -0,0 +1,6 @@ +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 +without the prefix, but in the new `DeviceSpecification` format which is parsed into +`cirq_google.GridDevice`. \ No newline at end of file diff --git a/cirq-google/cirq_google/devices/specifications/rainbow_2021_12_10_device_spec_for_grid_device.proto.txt b/cirq-google/cirq_google/devices/specifications/rainbow_2021_12_10_device_spec_for_grid_device.proto.txt new file mode 100644 index 00000000000..ef573c5bb0b --- /dev/null +++ b/cirq-google/cirq_google/devices/specifications/rainbow_2021_12_10_device_spec_for_grid_device.proto.txt @@ -0,0 +1,201 @@ +valid_qubits: "3_2" +valid_qubits: "4_1" +valid_qubits: "4_2" +valid_qubits: "4_3" +valid_qubits: "5_0" +valid_qubits: "5_1" +valid_qubits: "5_2" +valid_qubits: "5_3" +valid_qubits: "5_4" +valid_qubits: "6_1" +valid_qubits: "6_2" +valid_qubits: "6_3" +valid_qubits: "6_4" +valid_qubits: "6_5" +valid_qubits: "7_2" +valid_qubits: "7_3" +valid_qubits: "7_4" +valid_qubits: "7_5" +valid_qubits: "7_6" +valid_qubits: "8_3" +valid_qubits: "8_4" +valid_qubits: "8_5" +valid_qubits: "9_4" +valid_targets { + name: "2_qubit_targets" + target_ordering: SYMMETRIC + targets { + ids: "3_2" + ids: "4_2" + } + targets { + ids: "4_1" + ids: "4_2" + } + targets { + ids: "4_1" + ids: "5_1" + } + targets { + ids: "4_2" + ids: "4_3" + } + targets { + ids: "4_2" + ids: "5_2" + } + targets { + ids: "4_3" + ids: "5_3" + } + targets { + ids: "5_0" + ids: "5_1" + } + targets { + ids: "5_1" + ids: "5_2" + } + targets { + ids: "5_1" + ids: "6_1" + } + targets { + ids: "5_2" + ids: "5_3" + } + targets { + ids: "5_2" + ids: "6_2" + } + targets { + ids: "5_3" + ids: "5_4" + } + targets { + ids: "5_3" + ids: "6_3" + } + targets { + ids: "5_4" + ids: "6_4" + } + targets { + ids: "6_1" + ids: "6_2" + } + targets { + ids: "6_2" + ids: "6_3" + } + targets { + ids: "6_2" + ids: "7_2" + } + targets { + ids: "6_3" + ids: "6_4" + } + targets { + ids: "6_3" + ids: "7_3" + } + targets { + ids: "6_4" + ids: "6_5" + } + targets { + ids: "6_4" + ids: "7_4" + } + targets { + ids: "6_5" + ids: "7_5" + } + targets { + ids: "7_2" + ids: "7_3" + } + targets { + ids: "7_3" + ids: "7_4" + } + targets { + ids: "7_3" + ids: "8_3" + } + targets { + ids: "7_4" + ids: "7_5" + } + targets { + ids: "7_4" + ids: "8_4" + } + targets { + ids: "7_5" + ids: "7_6" + } + targets { + ids: "7_5" + ids: "8_5" + } + targets { + ids: "8_3" + ids: "8_4" + } + targets { + ids: "8_4" + ids: "8_5" + } + targets { + ids: "8_4" + ids: "9_4" + } +} +valid_gates { + coupler_pulse { + } +} +valid_gates { + cz { + } +} +valid_gates { + gate_duration_picos: 4000000000 + meas { + } +} +valid_gates { + gate_duration_picos: 25000 + phased_xz { + } +} +valid_gates { + gate_duration_picos: 20000 + physical_zpow { + } +} +valid_gates { + gate_duration_picos: 32000 + sqrt_iswap { + } +} +valid_gates { + gate_duration_picos: 32000 + sqrt_iswap_inv { + } +} +valid_gates { + gate_duration_picos: 12000 + syc { + } +} +valid_gates { + virtual_zpow { + } +} +valid_gates { + wait { + } +} diff --git a/cirq-google/cirq_google/devices/specifications/weber_2021_12_10_device_spec_for_grid_device.proto.txt b/cirq-google/cirq_google/devices/specifications/weber_2021_12_10_device_spec_for_grid_device.proto.txt new file mode 100644 index 00000000000..717904eed97 --- /dev/null +++ b/cirq-google/cirq_google/devices/specifications/weber_2021_12_10_device_spec_for_grid_device.proto.txt @@ -0,0 +1,447 @@ +valid_qubits: "0_5" +valid_qubits: "0_6" +valid_qubits: "1_4" +valid_qubits: "1_5" +valid_qubits: "1_6" +valid_qubits: "1_7" +valid_qubits: "2_4" +valid_qubits: "2_5" +valid_qubits: "2_6" +valid_qubits: "2_7" +valid_qubits: "2_8" +valid_qubits: "3_2" +valid_qubits: "3_3" +valid_qubits: "3_4" +valid_qubits: "3_5" +valid_qubits: "3_6" +valid_qubits: "3_7" +valid_qubits: "3_8" +valid_qubits: "3_9" +valid_qubits: "4_1" +valid_qubits: "4_2" +valid_qubits: "4_3" +valid_qubits: "4_4" +valid_qubits: "4_5" +valid_qubits: "4_6" +valid_qubits: "4_7" +valid_qubits: "4_8" +valid_qubits: "4_9" +valid_qubits: "5_0" +valid_qubits: "5_1" +valid_qubits: "5_2" +valid_qubits: "5_3" +valid_qubits: "5_4" +valid_qubits: "5_5" +valid_qubits: "5_6" +valid_qubits: "5_7" +valid_qubits: "5_8" +valid_qubits: "6_1" +valid_qubits: "6_2" +valid_qubits: "6_3" +valid_qubits: "6_4" +valid_qubits: "6_5" +valid_qubits: "6_6" +valid_qubits: "6_7" +valid_qubits: "7_2" +valid_qubits: "7_3" +valid_qubits: "7_4" +valid_qubits: "7_5" +valid_qubits: "7_6" +valid_qubits: "8_3" +valid_qubits: "8_4" +valid_qubits: "8_5" +valid_qubits: "9_4" +valid_targets { + name: "2_qubit_targets" + target_ordering: SYMMETRIC + targets { + ids: "0_5" + ids: "0_6" + } + targets { + ids: "0_5" + ids: "1_5" + } + targets { + ids: "0_6" + ids: "1_6" + } + targets { + ids: "1_4" + ids: "1_5" + } + targets { + ids: "1_4" + ids: "2_4" + } + targets { + ids: "1_5" + ids: "1_6" + } + targets { + ids: "1_5" + ids: "2_5" + } + targets { + ids: "1_6" + ids: "1_7" + } + targets { + ids: "1_6" + ids: "2_6" + } + targets { + ids: "1_7" + ids: "2_7" + } + targets { + ids: "2_4" + ids: "2_5" + } + targets { + ids: "2_4" + ids: "3_4" + } + targets { + ids: "2_5" + ids: "2_6" + } + targets { + ids: "2_5" + ids: "3_5" + } + targets { + ids: "2_6" + ids: "2_7" + } + targets { + ids: "2_6" + ids: "3_6" + } + targets { + ids: "2_7" + ids: "2_8" + } + targets { + ids: "2_7" + ids: "3_7" + } + targets { + ids: "2_8" + ids: "3_8" + } + targets { + ids: "3_2" + ids: "3_3" + } + targets { + ids: "3_2" + ids: "4_2" + } + targets { + ids: "3_3" + ids: "3_4" + } + targets { + ids: "3_3" + ids: "4_3" + } + targets { + ids: "3_4" + ids: "3_5" + } + targets { + ids: "3_4" + ids: "4_4" + } + targets { + ids: "3_5" + ids: "3_6" + } + targets { + ids: "3_5" + ids: "4_5" + } + targets { + ids: "3_6" + ids: "3_7" + } + targets { + ids: "3_6" + ids: "4_6" + } + targets { + ids: "3_7" + ids: "3_8" + } + targets { + ids: "3_7" + ids: "4_7" + } + targets { + ids: "3_8" + ids: "3_9" + } + targets { + ids: "3_8" + ids: "4_8" + } + targets { + ids: "3_9" + ids: "4_9" + } + targets { + ids: "4_1" + ids: "4_2" + } + targets { + ids: "4_1" + ids: "5_1" + } + targets { + ids: "4_2" + ids: "4_3" + } + targets { + ids: "4_2" + ids: "5_2" + } + targets { + ids: "4_3" + ids: "4_4" + } + targets { + ids: "4_3" + ids: "5_3" + } + targets { + ids: "4_4" + ids: "4_5" + } + targets { + ids: "4_4" + ids: "5_4" + } + targets { + ids: "4_5" + ids: "4_6" + } + targets { + ids: "4_5" + ids: "5_5" + } + targets { + ids: "4_6" + ids: "4_7" + } + targets { + ids: "4_6" + ids: "5_6" + } + targets { + ids: "4_7" + ids: "4_8" + } + targets { + ids: "4_7" + ids: "5_7" + } + targets { + ids: "4_8" + ids: "4_9" + } + targets { + ids: "4_8" + ids: "5_8" + } + targets { + ids: "5_0" + ids: "5_1" + } + targets { + ids: "5_1" + ids: "5_2" + } + targets { + ids: "5_1" + ids: "6_1" + } + targets { + ids: "5_2" + ids: "5_3" + } + targets { + ids: "5_2" + ids: "6_2" + } + targets { + ids: "5_3" + ids: "5_4" + } + targets { + ids: "5_3" + ids: "6_3" + } + targets { + ids: "5_4" + ids: "5_5" + } + targets { + ids: "5_4" + ids: "6_4" + } + targets { + ids: "5_5" + ids: "5_6" + } + targets { + ids: "5_5" + ids: "6_5" + } + targets { + ids: "5_6" + ids: "5_7" + } + targets { + ids: "5_6" + ids: "6_6" + } + targets { + ids: "5_7" + ids: "5_8" + } + targets { + ids: "5_7" + ids: "6_7" + } + targets { + ids: "6_1" + ids: "6_2" + } + targets { + ids: "6_2" + ids: "6_3" + } + targets { + ids: "6_2" + ids: "7_2" + } + targets { + ids: "6_3" + ids: "6_4" + } + targets { + ids: "6_3" + ids: "7_3" + } + targets { + ids: "6_4" + ids: "6_5" + } + targets { + ids: "6_4" + ids: "7_4" + } + targets { + ids: "6_5" + ids: "6_6" + } + targets { + ids: "6_5" + ids: "7_5" + } + targets { + ids: "6_6" + ids: "6_7" + } + targets { + ids: "6_6" + ids: "7_6" + } + targets { + ids: "7_2" + ids: "7_3" + } + targets { + ids: "7_3" + ids: "7_4" + } + targets { + ids: "7_3" + ids: "8_3" + } + targets { + ids: "7_4" + ids: "7_5" + } + targets { + ids: "7_4" + ids: "8_4" + } + targets { + ids: "7_5" + ids: "7_6" + } + targets { + ids: "7_5" + ids: "8_5" + } + targets { + ids: "8_3" + ids: "8_4" + } + targets { + ids: "8_4" + ids: "8_5" + } + targets { + ids: "8_4" + ids: "9_4" + } +} +valid_gates { + coupler_pulse { + } +} +valid_gates { + cz { + } +} +valid_gates { + gate_duration_picos: 4000000000 + meas { + } +} +valid_gates { + gate_duration_picos: 25000 + phased_xz { + } +} +valid_gates { + gate_duration_picos: 20000 + physical_zpow { + } +} +valid_gates { + gate_duration_picos: 32000 + sqrt_iswap { + } +} +valid_gates { + gate_duration_picos: 32000 + sqrt_iswap_inv { + } +} +valid_gates { + gate_duration_picos: 12000 + syc { + } +} +valid_gates { + virtual_zpow { + } +} +valid_gates { + wait { + } +} diff --git a/cirq-google/cirq_google/engine/virtual_engine_factory.py b/cirq-google/cirq_google/engine/virtual_engine_factory.py index 142012b86f5..be30910ac3a 100644 --- a/cirq-google/cirq_google/engine/virtual_engine_factory.py +++ b/cirq-google/cirq_google/engine/virtual_engine_factory.py @@ -27,10 +27,9 @@ from cirq_google.engine.simulated_local_engine import SimulatedLocalEngine from cirq_google.engine.simulated_local_processor import SimulatedLocalProcessor -# TODO(verult) update to new DeviceSpecification proto MOST_RECENT_TEMPLATES = { - 'rainbow': 'rainbow_2021_12_10_device_spec.proto.txt', - 'weber': 'weber_2021_12_10_device_spec.proto.txt', + 'rainbow': 'rainbow_2021_12_10_device_spec_for_grid_device.proto.txt', + 'weber': 'weber_2021_12_10_device_spec_for_grid_device.proto.txt', } MEDIAN_CALIBRATIONS = { diff --git a/cirq-google/cirq_google/engine/virtual_engine_factory_test.py b/cirq-google/cirq_google/engine/virtual_engine_factory_test.py index 284700da0cb..c8a646023ca 100644 --- a/cirq-google/cirq_google/engine/virtual_engine_factory_test.py +++ b/cirq-google/cirq_google/engine/virtual_engine_factory_test.py @@ -145,12 +145,12 @@ def test_create_from_proto(): def test_create_from_template(): engine = factory.create_noiseless_virtual_engine_from_templates( - 'sycamore', 'weber_2021_12_10_device_spec.proto.txt' + 'sycamore', 'weber_2021_12_10_device_spec_for_grid_device.proto.txt' ) _test_processor(engine.get_processor('sycamore')) processor = factory.create_noiseless_virtual_processor_from_template( - 'sycamore', 'weber_2021_12_10_device_spec.proto.txt' + 'sycamore', 'weber_2021_12_10_device_spec_for_grid_device.proto.txt' ) _test_processor(processor)