Skip to content

Commit 62e786d

Browse files
committed
CR
1 parent de5f9a3 commit 62e786d

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

qiskit_ibm_runtime/utils/backend_converter.py

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,13 @@
4242

4343
logger = logging.getLogger(__name__)
4444

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+
4552

4653
def convert_to_target( # type: ignore[no-untyped-def]
4754
configuration: BackendConfiguration,
@@ -108,7 +115,7 @@ def convert_to_target( # type: ignore[no-untyped-def]
108115
# `instruction_signatures` (see below) and handled separately
109116
all_instructions = set.union(
110117
basis_gates,
111-
supported_instructions.intersection({"measure", "delay", "reset"}),
118+
supported_instructions.intersection(NON_UNITARY_ISA_INSTRUCTIONS),
112119
supported_instructions.intersection(CONTROL_FLOW_OP_NAMES),
113120
)
114121
inst_name_map = {}
@@ -281,7 +288,7 @@ def _get_value(prop_dict: dict, prop_name: str) -> Any:
281288
duration=_get_value(qubit_prop, "readout_length"), # type: ignore[arg-type]
282289
)
283290

284-
for op in supported_instructions.intersection({"measure", "delay", "reset"}):
291+
for op in supported_instructions.intersection(NON_UNITARY_ISA_INSTRUCTIONS):
285292
# Map required ops to each operational qubit
286293
if prop_name_map[op] is None:
287294
prop_name_map[op] = {

0 commit comments

Comments
 (0)