def _get_device_calibration(device_name: str): """Get device calibration. Use an LRU cache to avoid repeated calls to the web interface. It's possible this is not what you want. TODO: move to recirq.engine_utils. """ processor_id = recirq.get_processor_id_by_device_name(device_name) if processor_id is None: # TODO: https://github.com/quantumlib/ReCirq/issues/14 device_obj = recirq.get_device_obj_by_name(device_name) dummy_graph = ccr.gridqubits_to_graph_device(device_obj.qubits) nx.set_edge_attributes(dummy_graph, name='weight', values=0.01) return dummy_graph calibration = cg.get_engine_calibration(processor_id) err_graph = calibration_data_to_graph(calibration) return err_graph
def test_processor_id(): assert recirq.get_processor_id_by_device_name('Sycamore23') == 'rainbow' assert recirq.get_processor_id_by_device_name('Syc23-simulator') is None