Skip to content

Commit

Permalink
Handle BackendV2 in transpiler._parse_inst_map
Browse files Browse the repository at this point in the history
  • Loading branch information
HuangJunye committed Mar 4, 2022
1 parent f01e8db commit fa4f142
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions qiskit/compiler/transpiler.py
Original file line number Diff line number Diff line change
Expand Up @@ -673,9 +673,7 @@ def _parse_inst_map(inst_map, backend, num_circuits):
if hasattr(backend, "defaults"):
inst_map = getattr(backend.defaults(), "instruction_schedule_map", None)
else:
# BackendV2 always have `defaults` attribute
if backend.defaults():
inst_map = getattr(backend.defaults(), "instruction_schedule_map", None)
inst_map = backend.target.instruction_schedule_map()

# inst_maps could be None, or single entry
if inst_map is None or isinstance(inst_map, InstructionScheduleMap):
Expand Down

0 comments on commit fa4f142

Please sign in to comment.