@@ -116,6 +116,7 @@ def load_device_noise_properties(processor_id: str) -> cirq_google.GoogleNoisePr
116
116
117
117
Args:
118
118
processor_id: name of the processor to simulate.
119
+ Use `list_virtual_processors` to obtain available names.
119
120
120
121
Raises:
121
122
ValueError: if processor_id is not a supported QCS processor.
@@ -141,6 +142,7 @@ def load_median_device_calibration(processor_id: str) -> calibration.Calibration
141
142
142
143
Args:
143
144
processor_id: name of the processor to simulate.
145
+ Use `list_virtual_processors` to obtain available names.
144
146
145
147
Raises:
146
148
ValueError: if processor_id is not a supported QCS processor.
@@ -234,9 +236,8 @@ def create_noiseless_virtual_engine_from_device(
234
236
a default validator, and a provided device.
235
237
236
238
Args:
237
- processor_id: name of the processor to simulate. This is an arbitrary
238
- string identifier and does not have to match the processor's name
239
- in QCS.
239
+ processor_id: name of the virtual processor to simulate.
240
+ Use `list_virtual_processors` to obtain available names.
240
241
device: A `cirq.Device` to validate circuits against.
241
242
device_specification: a` DeviceSpecification` proto that the processor
242
243
should return if `get_device_specification()` is queried.
@@ -255,9 +256,8 @@ def create_noiseless_virtual_processor_from_proto(
255
256
and can be retrieved from a stored "proto.txt" file or from the QCS API.
256
257
257
258
Args:
258
- processor_id: name of the processor to simulate. This is an arbitrary
259
- string identifier and does not have to match the processor's name
260
- in QCS.
259
+ processor_id: name of the processor to simulate.
260
+ Use `list_virtual_processors` to obtain available names.
261
261
device_specification: `v2.device_pb2.DeviceSpecification` proto to create
262
262
a validating device from.
263
263
gate_sets: Iterable of serializers to use in the processor.
@@ -283,6 +283,7 @@ def create_noiseless_virtual_engine_from_proto(
283
283
processor_ids: names of the processors to simulate. These are arbitrary
284
284
string identifiers and do not have to match the processors' names
285
285
in QCS. This can be a single string or list of strings.
286
+ Use `list_virtual_processors` to obtain recognized names.
286
287
device_specifications: `v2.device_pb2.DeviceSpecification` proto to create
287
288
validating devices from. This can be a single DeviceSpecification
288
289
or a list of them. There should be one DeviceSpecification for each
@@ -323,6 +324,7 @@ def create_device_spec_from_processor_id(processor_id: str) -> v2.device_pb2.Dev
323
324
324
325
Args:
325
326
processor_id: name of the processor to simulate.
327
+ Use `list_virtual_processors` to obtain available names.
326
328
327
329
Raises:
328
330
ValueError: if processor_id is not a supported QCS processor.
@@ -338,6 +340,7 @@ def create_device_from_processor_id(processor_id: str) -> grid_device.GridDevice
338
340
339
341
Args:
340
342
processor_id: name of the processor to simulate.
343
+ Use `list_virtual_processors` to obtain available names.
341
344
342
345
Raises:
343
346
ValueError: if processor_id is not a supported QCS processor.
@@ -352,9 +355,8 @@ def create_noiseless_virtual_processor_from_template(
352
355
"""Creates a simulated local processor from a device specification template.
353
356
354
357
Args:
355
- processor_id: name of the processor to simulate. This is an arbitrary
356
- string identifier and does not have to match the processor's name
357
- in QCS.
358
+ processor_id: name of the processor to simulate.
359
+ Use `list_virtual_processors` to obtain available names.
358
360
template_name: File name of the device specification template, see
359
361
cirq_google/devices/specifications for valid templates.
360
362
gate_sets: Iterable of serializers to use in the processor.
@@ -373,7 +375,7 @@ def create_noiseless_virtual_engine_from_templates(
373
375
processor_ids: names of the processors to simulate. These are arbitrary
374
376
string identifiers and do not have to match the processors' names
375
377
in QCS. There can be a single string or a list of strings for multiple
376
- processors.
378
+ processors. Use `list_virtual_processors` to obtain recognized names.
377
379
template_names: File names of the device specification templates, see
378
380
cirq_google/devices/specifications for valid templates. There can
379
381
be a single str for a template name or a list of strings. Each
@@ -421,6 +423,7 @@ def create_default_noisy_quantum_virtual_machine(
421
423
422
424
Args:
423
425
processor_id: The string name of a processor that has available noise data.
426
+ Use `list_virtual_processors` to obtain available names.
424
427
simulator_class: The class of the type of simulator to be initialized. The
425
428
simulator class initializer needs to support the `noise` parameter.
426
429
**kwargs: Other arguments which are passed through to the simulator initializer.
@@ -495,3 +498,11 @@ def extract_gate_times_ns_from_device(
495
498
# cirq.WaitGate has variable duration and should not be included here.
496
499
_ = gate_times_ns .pop (cirq .WaitGate , None )
497
500
return gate_times_ns
501
+
502
+
503
+ def list_virtual_processors () -> list [str ]:
504
+ """Return a sorted list of known virtual processor names.
505
+
506
+ These are accepted for the ``processor_id`` argument in factory functions.
507
+ """
508
+ return sorted (MOST_RECENT_TEMPLATES .keys ())
0 commit comments