diff --git a/src/qibo/transpiler/pipeline.py b/src/qibo/transpiler/pipeline.py index 7d9b68e130..04c1072d0a 100644 --- a/src/qibo/transpiler/pipeline.py +++ b/src/qibo/transpiler/pipeline.py @@ -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 @@ -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,