Skip to content

Commit 3507ba7

Browse files
authored
Update dag_fixed_point.py
1 parent 66ee428 commit 3507ba7

1 file changed

Lines changed: 5 additions & 7 deletions

File tree

qiskit/transpiler/passes/utils/dag_fixed_point.py

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -9,14 +9,13 @@
99
# Any modifications or derivative works of this code must retain this
1010
# copyright notice, and modified files need to carry a notice indicating
1111
# that they have been altered from the originals.
12-
1312
"""Check if the DAG has reached a fixed point."""
14-
15-
from __future__ import annotations
16-
1713
from copy import deepcopy
14+
from typing import TYPE_CHECKING
15+
16+
if TYPE_CHECKING:
17+
from qiskit.dagcircuit import DAGCircuit
1818

19-
from qiskit.dagcircuit import DAGCircuit
2019
from qiskit.transpiler.basepasses import AnalysisPass
2120

2221

@@ -29,11 +28,10 @@ class DAGFixedPoint(AnalysisPass):
2928
"""
3029

3130
def run(self, dag: DAGCircuit) -> None:
32-
"""Run the DAGFixedPoint pass on *dag*."""
31+
"""Run the DAGFixedPoint pass on ``dag``."""
3332
if self.property_set["_dag_fixed_point_previous_dag"] is None:
3433
self.property_set["dag_fixed_point"] = False
3534
else:
3635
fixed_point_reached = self.property_set["_dag_fixed_point_previous_dag"] == dag
3736
self.property_set["dag_fixed_point"] = fixed_point_reached
38-
3937
self.property_set["_dag_fixed_point_previous_dag"] = deepcopy(dag)

0 commit comments

Comments
 (0)