Skip to content

Commit

Permalink
lint
Browse files Browse the repository at this point in the history
  • Loading branch information
kevinsung committed May 10, 2024
1 parent 136c476 commit 2205d32
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
9 changes: 5 additions & 4 deletions qiskit/transpiler/passes/optimization/drop_negligible.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,6 @@

import math

import numpy as np

from qiskit.circuit.library import (
CPhaseGate,
PhaseGate,
Expand Down Expand Up @@ -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
1 change: 0 additions & 1 deletion test/python/transpiler/test_drop_negligible.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit 2205d32

Please sign in to comment.