diff --git a/qiskit_experiments/library/randomized_benchmarking/clifford_synthesis.py b/qiskit_experiments/library/randomized_benchmarking/clifford_synthesis.py index 29873fb37f..d1a88d7480 100644 --- a/qiskit_experiments/library/randomized_benchmarking/clifford_synthesis.py +++ b/qiskit_experiments/library/randomized_benchmarking/clifford_synthesis.py @@ -19,6 +19,7 @@ from qiskit.circuit import QuantumCircuit, Operation from qiskit.circuit.equivalence_library import SessionEquivalenceLibrary as sel from qiskit.exceptions import QiskitError +from qiskit.passmanager.flow_controllers import ConditionalController from qiskit.synthesis.clifford import synth_clifford_full from qiskit.transpiler import PassManager, CouplingMap, Layout, Target from qiskit.transpiler.passes import ( @@ -94,8 +95,8 @@ def _direction_condition(property_set): undo_layout_change, BasisTranslator(sel, basis_gates), CheckGateDirection(coupling_map), + ConditionalController(GateDirection(coupling_map), condition=_direction_condition), + Optimize1qGatesDecomposition(basis=basis_gates), ] ) - pm.append([GateDirection(coupling_map)], condition=_direction_condition) - pm.append([Optimize1qGatesDecomposition(basis=basis_gates)]) return pm.run(circ)