Skip to content

Commit

Permalink
Merge pull request #1356 from qiboteam/fix_transpiler
Browse files Browse the repository at this point in the history
Fix transpiler bug
  • Loading branch information
BrunoLiegiBastonLiegi authored Jun 17, 2024
2 parents 5676a8a + 8d29397 commit 0d86ec5
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/qibo/transpiler/pipeline.py
Original file line number Diff line number Diff line change
Expand Up @@ -225,7 +225,7 @@ def __call__(self, circuit):
physical (keys) to logical (values) qubit. If `int_qubit_name` is `True`
each key `i` correspond to the `i-th` qubit in the graph.
"""
final_layout = self.initial_layout
self.initial_layout = None
for transpiler_pass in self.passes:
if isinstance(transpiler_pass, Optimizer):
transpiler_pass.connectivity = self.connectivity
Expand All @@ -234,6 +234,9 @@ def __call__(self, circuit):
transpiler_pass.connectivity = self.connectivity
if self.initial_layout == None:
self.initial_layout = transpiler_pass(circuit)
final_layout = (
self.initial_layout
) # This way the final layout will be the same as the initial layout if no router is used
else:
raise_error(
TranspilerPipelineError,
Expand Down

0 comments on commit 0d86ec5

Please sign in to comment.