Skip to content

Commit 1b6eb8a

Browse files
Merge pull request #1419 from qiboteam/router_sabre
SABRE + CircuitMap Optimization
2 parents 434989e + 24ecc7a commit 1b6eb8a

File tree

3 files changed

+312
-206
lines changed

3 files changed

+312
-206
lines changed

src/qibo/transpiler/placer.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ def assert_mapping_consistency(layout: dict, connectivity: nx.Graph = None):
5454
ref_keys = (
5555
["q" + str(i) for i in nodes] if isinstance(physical_qubits[0], str) else nodes
5656
)
57-
if physical_qubits != ref_keys:
57+
if sorted(physical_qubits) != sorted(ref_keys):
5858
raise_error(
5959
PlacementError,
6060
"Some physical qubits in the layout may be missing or duplicated.",
@@ -411,7 +411,6 @@ def __init__(
411411
):
412412
self.connectivity = connectivity
413413
self.routing_algorithm = routing_algorithm
414-
self.routing_algorithm.connectivity = connectivity
415414
self.depth = depth
416415

417416
def __call__(self, circuit: Circuit):
@@ -425,6 +424,7 @@ def __call__(self, circuit: Circuit):
425424
"""
426425
initial_placer = Trivial(self.connectivity)
427426
initial_placement = initial_placer(circuit=circuit)
427+
self.routing_algorithm.connectivity = self.connectivity
428428
new_circuit = self._assemble_circuit(circuit)
429429
final_placement = self._routing_step(initial_placement, new_circuit)
430430

0 commit comments

Comments
 (0)