diff --git a/qiskit/transpiler/passes/routing/stochastic_swap.py b/qiskit/transpiler/passes/routing/stochastic_swap.py index ae924fe122d7..1abc12e0345f 100644 --- a/qiskit/transpiler/passes/routing/stochastic_swap.py +++ b/qiskit/transpiler/passes/routing/stochastic_swap.py @@ -15,7 +15,6 @@ """Map a DAGCircuit onto a `coupling_map` adding swap gates.""" from logging import getLogger -from pprint import pformat from math import inf from collections import OrderedDict import numpy as np @@ -158,8 +157,8 @@ def _layer_update(self, i, best_layout, best_depth, that the _mapper method is building. """ layout = best_layout - logger.debug("layer_update: layout = %s", pformat(layout)) - logger.debug("layer_update: self.trivial_layout = %s", pformat(self.trivial_layout)) + logger.debug("layer_update: layout = %s", layout) + logger.debug("layer_update: self.trivial_layout = %s", self.trivial_layout) dagcircuit_output = DAGCircuit() for qubit in layout.get_virtual_bits().keys(): if qubit.register not in dagcircuit_output.qregs.values(): @@ -292,10 +291,10 @@ def _mapper(self, circuit_graph, coupling_graph, trials=20): # This is the final edgemap. We might use it to correctly replace # any measurements that needed to be removed earlier. - logger.debug("mapper: self.trivial_layout = %s", pformat(self.trivial_layout)) - logger.debug("mapper: layout = %s", pformat(layout)) + logger.debug("mapper: self.trivial_layout = %s", self.trivial_layout) + logger.debug("mapper: layout = %s", layout) last_edgemap = layout.combine_into_edge_map(self.trivial_layout) - logger.debug("mapper: last_edgemap = %s", pformat(last_edgemap)) + logger.debug("mapper: last_edgemap = %s", last_edgemap) return dagcircuit_output @@ -326,11 +325,11 @@ def _layer_permutation(layer_partition, layout, qubit_subset, TranspilerError: if anything went wrong. """ logger.debug("layer_permutation: layer_partition = %s", - pformat(layer_partition)) + layer_partition) logger.debug("layer_permutation: layout = %s", - pformat(layout.get_virtual_bits())) + layout.get_virtual_bits()) logger.debug("layer_permutation: qubit_subset = %s", - pformat(qubit_subset)) + qubit_subset) logger.debug("layer_permutation: trials = %s", trials) # The input dag is on a flat canonical register @@ -344,7 +343,7 @@ def _layer_permutation(layer_partition, layout, qubit_subset, raise TranspilerError("Layer contains > 2-qubit gates") if len(gate_args) == 2: gates.append(tuple(gate_args)) - logger.debug("layer_permutation: gates = %s", pformat(gates)) + logger.debug("layer_permutation: gates = %s", gates) # Can we already apply the gates? If so, there is no work to do. dist = sum([coupling.distance(layout[g[0]], layout[g[1]])