Skip to content

Commit

Permalink
Update qiskit/transpiler/passes/routing/stochastic_swap.py
Browse files Browse the repository at this point in the history
Co-authored-by: Jake Lishman <[email protected]>
  • Loading branch information
ewinston and jakelishman authored Oct 5, 2022
1 parent 1487b80 commit 06dfe40
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions qiskit/transpiler/passes/routing/stochastic_swap.py
Original file line number Diff line number Diff line change
Expand Up @@ -99,9 +99,8 @@ def run(self, dag):
raise TranspilerError("The layout does not match the amount of qubits in the DAG")

canonical_register = dag.qregs["q"]
self.trivial_layout = Layout.generate_trivial_layout(canonical_register)
if self.initial_layout is None:
self.initial_layout = self.trivial_layout
self.initial_layout = Layout.generate_trivial_layout(canonical_register)
self._qubit_indices = {bit: idx for idx, bit in enumerate(dag.qubits)}

self.qregs = dag.qregs
Expand Down

0 comments on commit 06dfe40

Please sign in to comment.