Skip to content

Commit 49536ba

Browse files
Fix lint in controlled circuit and Instruction.definition change (qiskit-community/qiskit-aqua#1100)
* Fix lint in controlled circuit * Fixed change to Instruction.definition
1 parent 50ef536 commit 49536ba

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

qiskit/aqua/operators/primitive_ops/circuit_op.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -223,7 +223,8 @@ def reduce(self) -> OperatorBase:
223223
# Check if Identity or empty instruction (need to check that type is exactly
224224
# Instruction because some gates have lazy gate.definition population)
225225
# pylint: disable=unidiomatic-typecheck
226-
if isinstance(gate, IGate) or (type(gate) == Instruction and gate.definition == []):
226+
if isinstance(gate, IGate) or (type(gate) == Instruction and
227+
gate.definition.data == []):
227228
del self.primitive.data[i] # type: ignore
228229
return self
229230

qiskit/aqua/operators/state_fns/circuit_state_fn.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -349,7 +349,8 @@ def reduce(self) -> OperatorBase:
349349
# Check if Identity or empty instruction (need to check that type is exactly
350350
# Instruction because some gates have lazy gate.definition population)
351351
# pylint: disable=unidiomatic-typecheck
352-
if isinstance(gate, IGate) or (type(gate) == Instruction and gate.definition == []):
352+
if isinstance(gate, IGate) or (type(gate) == Instruction and
353+
gate.definition.data == []):
353354
del self.primitive.data[i]
354355
return self
355356

0 commit comments

Comments
 (0)