diff --git a/qiskit/transpiler/passes/optimization/drop_negligible.py b/qiskit/transpiler/passes/optimization/drop_negligible.py index 50fee79c3b2b..c108a2d51cf7 100644 --- a/qiskit/transpiler/passes/optimization/drop_negligible.py +++ b/qiskit/transpiler/passes/optimization/drop_negligible.py @@ -16,8 +16,6 @@ import math -import numpy as np - from qiskit.circuit.library import ( CPhaseGate, PhaseGate, @@ -66,10 +64,13 @@ def run(self, dag: DAGCircuit) -> DAGCircuit: for node in dag.op_nodes(): if not isinstance(node.op, DROP_NEGLIGIBLE_GATE_CLASSES): continue - if not all(isinstance(param, (int, float, complex)) for param in node.op.params): + if not all( + isinstance(param, (int, float, complex)) for param in node.op.params + ): continue if all( - math.isclose(param, 0, rel_tol=0, abs_tol=self.atol) for param in node.op.params + math.isclose(param, 0, rel_tol=0, abs_tol=self.atol) + for param in node.op.params ): dag.remove_op_node(node) return dag diff --git a/test/python/transpiler/test_drop_negligible.py b/test/python/transpiler/test_drop_negligible.py index 6000b87858c3..367d9b514dd4 100644 --- a/test/python/transpiler/test_drop_negligible.py +++ b/test/python/transpiler/test_drop_negligible.py @@ -14,7 +14,6 @@ import numpy as np -from qiskit import QuantumCircuit, QuantumRegister from qiskit.circuit import Parameter, QuantumCircuit, QuantumRegister from qiskit.circuit.library import ( CPhaseGate,