Skip to content

Commit

Permalink
Merge pull request #1419 from qiboteam/router_sabre
Browse files Browse the repository at this point in the history
SABRE + CircuitMap Optimization
  • Loading branch information
Simone-Bordoni authored Sep 16, 2024
2 parents 434989e + 24ecc7a commit 1b6eb8a
Show file tree
Hide file tree
Showing 3 changed files with 312 additions and 206 deletions.
4 changes: 2 additions & 2 deletions src/qibo/transpiler/placer.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ def assert_mapping_consistency(layout: dict, connectivity: nx.Graph = None):
ref_keys = (
["q" + str(i) for i in nodes] if isinstance(physical_qubits[0], str) else nodes
)
if physical_qubits != ref_keys:
if sorted(physical_qubits) != sorted(ref_keys):
raise_error(
PlacementError,
"Some physical qubits in the layout may be missing or duplicated.",
Expand Down Expand Up @@ -411,7 +411,6 @@ def __init__(
):
self.connectivity = connectivity
self.routing_algorithm = routing_algorithm
self.routing_algorithm.connectivity = connectivity
self.depth = depth

def __call__(self, circuit: Circuit):
Expand All @@ -425,6 +424,7 @@ def __call__(self, circuit: Circuit):
"""
initial_placer = Trivial(self.connectivity)
initial_placement = initial_placer(circuit=circuit)
self.routing_algorithm.connectivity = self.connectivity
new_circuit = self._assemble_circuit(circuit)
final_placement = self._routing_step(initial_placement, new_circuit)

Expand Down
Loading

0 comments on commit 1b6eb8a

Please sign in to comment.