Skip to content

Commit

Permalink
Merge branch 'master' into log_entropies
Browse files Browse the repository at this point in the history
  • Loading branch information
renatomello committed Jun 17, 2024
2 parents 6a13965 + 0d86ec5 commit 8f2d00f
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 8f2d00f

Please sign in to comment.