|
42 | 42 |
|
43 | 43 | logger = logging.getLogger(__name__) |
44 | 44 |
|
| 45 | +NON_UNITARY_ISA_INSTRUCTIONS = frozenset(("measure", "delay", "reset")) |
| 46 | +"""The names of non-unitary Qiskit instructions. |
| 47 | +
|
| 48 | +Not every backend supports the full set of non-unitary instructions. To know which instructions |
| 49 | +are supported by a given backend, one can inspect ``backend.supported_operations``. |
| 50 | +""" |
| 51 | + |
45 | 52 |
|
46 | 53 | def convert_to_target( # type: ignore[no-untyped-def] |
47 | 54 | configuration: BackendConfiguration, |
@@ -108,7 +115,7 @@ def convert_to_target( # type: ignore[no-untyped-def] |
108 | 115 | # `instruction_signatures` (see below) and handled separately |
109 | 116 | all_instructions = set.union( |
110 | 117 | basis_gates, |
111 | | - supported_instructions.intersection({"measure", "delay", "reset"}), |
| 118 | + supported_instructions.intersection(NON_UNITARY_ISA_INSTRUCTIONS), |
112 | 119 | supported_instructions.intersection(CONTROL_FLOW_OP_NAMES), |
113 | 120 | ) |
114 | 121 | inst_name_map = {} |
@@ -281,7 +288,7 @@ def _get_value(prop_dict: dict, prop_name: str) -> Any: |
281 | 288 | duration=_get_value(qubit_prop, "readout_length"), # type: ignore[arg-type] |
282 | 289 | ) |
283 | 290 |
|
284 | | - for op in supported_instructions.intersection({"measure", "delay", "reset"}): |
| 291 | + for op in supported_instructions.intersection(NON_UNITARY_ISA_INSTRUCTIONS): |
285 | 292 | # Map required ops to each operational qubit |
286 | 293 | if prop_name_map[op] is None: |
287 | 294 | prop_name_map[op] = { |
|
0 commit comments