diff --git a/src/qibo/backends/__init__.py b/src/qibo/backends/__init__.py index f8b10e413c..6fa7ae1950 100644 --- a/src/qibo/backends/__init__.py +++ b/src/qibo/backends/__init__.py @@ -152,7 +152,9 @@ def _default_transpiler(cls): edges = [ (node_mapping[e[0]], node_mapping[e[1]]) for e in connectivity_edges ] - connectivity = nx.Graph(edges) + connectivity = nx.Graph() + connectivity.add_nodes_from(list(node_mapping.values())) + connectivity.add_edges_from(edges) return Passes( connectivity=connectivity,