Skip to content

Commit

Permalink
Instanciate AIRouting backend attribute for all the cases
Browse files Browse the repository at this point in the history
  • Loading branch information
y4izus committed Nov 6, 2024
1 parent b31b5fc commit 75e5ea4
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions qiskit_ibm_transpiler/ai/routing.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,9 +68,11 @@ def __init__(
if backend_name is not None:
self.backend = backend_name
elif coupling_map is not None:
if isinstance(coupling_map, list):
if isinstance(coupling_map, CouplingMap):
self.backend = coupling_map
elif isinstance(coupling_map, list):
self.backend = CouplingMap(coupling_map)
elif not isinstance(coupling_map, CouplingMap):
else:
raise ValueError(
f"ERROR. coupling_map should either be a list of int tuples or a Qiskit CouplingMap object."
)
Expand Down

0 comments on commit 75e5ea4

Please sign in to comment.