diff --git a/qopt_best_practices/transpilation/swap_cancellation_pass.py b/qopt_best_practices/transpilation/swap_cancellation_pass.py index 0f2d7e7..431a4bf 100644 --- a/qopt_best_practices/transpilation/swap_cancellation_pass.py +++ b/qopt_best_practices/transpilation/swap_cancellation_pass.py @@ -18,7 +18,7 @@ def run(self, dag: DAGCircuit): qmap = self.property_set["virtual_permutation_layout"] - qreg = dag.qregs["q"] + qreg = dag.qregs[next(iter(dag.qregs))] # This will remove SWAP gates that are applied before anything else # This remove is executed multiple times until there are no more SWAP