From 961c8ad106761ed18c08ed9657ba04ba1d5fa560 Mon Sep 17 00:00:00 2001 From: "Kevin J. Sung" Date: Wed, 18 Dec 2024 13:07:42 -0500 Subject: [PATCH 1/3] import CircuitInstruction to fix Pylance complaint --- qiskit/circuit/quantumcircuitdata.py | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/qiskit/circuit/quantumcircuitdata.py b/qiskit/circuit/quantumcircuitdata.py index d4baafce12c7..2d192c77bf05 100644 --- a/qiskit/circuit/quantumcircuitdata.py +++ b/qiskit/circuit/quantumcircuitdata.py @@ -16,15 +16,13 @@ from collections.abc import MutableSequence import qiskit._accelerate.circuit +from qiskit._accelerate.circuit import CircuitInstruction from .exceptions import CircuitError from .instruction import Instruction from .operation import Operation -CircuitInstruction = qiskit._accelerate.circuit.CircuitInstruction - - class QuantumCircuitData(MutableSequence): """A wrapper class for the purposes of validating modifications to QuantumCircuit.data while maintaining the interface of a python list.""" From da6cd860c07324ed11ad4877136b46bddf2daa5a Mon Sep 17 00:00:00 2001 From: "Kevin J. Sung" Date: Wed, 18 Dec 2024 15:12:52 -0500 Subject: [PATCH 2/3] pylint: disable=unused-import --- qiskit/circuit/quantumcircuitdata.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/qiskit/circuit/quantumcircuitdata.py b/qiskit/circuit/quantumcircuitdata.py index 2d192c77bf05..b3930cfb4a7c 100644 --- a/qiskit/circuit/quantumcircuitdata.py +++ b/qiskit/circuit/quantumcircuitdata.py @@ -16,7 +16,7 @@ from collections.abc import MutableSequence import qiskit._accelerate.circuit -from qiskit._accelerate.circuit import CircuitInstruction +from qiskit._accelerate.circuit import CircuitInstruction # pylint: disable=unused-import from .exceptions import CircuitError from .instruction import Instruction From 1095611e0d6733859f092940ad5d23d47c33fa18 Mon Sep 17 00:00:00 2001 From: "Kevin J. Sung" Date: Wed, 18 Dec 2024 16:55:58 -0500 Subject: [PATCH 3/3] fix imports --- qiskit/circuit/quantumcircuitdata.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/qiskit/circuit/quantumcircuitdata.py b/qiskit/circuit/quantumcircuitdata.py index b3930cfb4a7c..7041df867a08 100644 --- a/qiskit/circuit/quantumcircuitdata.py +++ b/qiskit/circuit/quantumcircuitdata.py @@ -15,8 +15,7 @@ from collections.abc import MutableSequence -import qiskit._accelerate.circuit -from qiskit._accelerate.circuit import CircuitInstruction # pylint: disable=unused-import +from qiskit._accelerate.circuit import CircuitInstruction from .exceptions import CircuitError from .instruction import Instruction