Skip to content
This repository was archived by the owner on Dec 7, 2021. It is now read-only.

Commit 393bf2d

Browse files
Fix lint in controlled circuit and Instruction.definition change (#1100)
* Fix lint in controlled circuit * Fixed change to Instruction.definition
1 parent 6f9629d commit 393bf2d

File tree

4 files changed

+6
-3
lines changed

4 files changed

+6
-3
lines changed

.pylintdict

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -599,6 +599,7 @@ subspaces
599599
substrings
600600
succ
601601
sudo
602+
summands
602603
summedops
603604
superclass
604605
superfast

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

qiskit/aqua/utils/controlled_circuit.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@ def get_controlled_circuit(circuit, ctl_qubit, tgt_circuit=None, use_basis_gates
122122
elif op[0].name == 'u3':
123123
apply_cu3(qc, *op[0].params, ctl_qubit, op[1][0], use_basis_gates=use_basis_gates)
124124
elif op[0].name == 'cx':
125-
apply_ccx(qc, ctl_qubit, *op[1], use_basis_gates=use_basis_gates)
125+
apply_ccx(qc, ctl_qubit, op[1][0], op[1][1], use_basis_gates=use_basis_gates)
126126
elif op[0].name == 'measure':
127127
qc.measure(op[1], op[2])
128128
elif op[0].name == 'barrier':

0 commit comments

Comments
 (0)