Skip to content

Commit e8c5a7e

Browse files
authored
Fix to WeightedPauliOperator (qiskit-community/qiskit-aqua#891)
1 parent 866e1ae commit e8c5a7e

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

qiskit/aqua/operators/weighted_pauli_operator.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -365,9 +365,8 @@ def simplify(self, copy=False):
365365
break
366366
for idx in indices:
367367
new_idx = old_to_new_indices[idx]
368-
if new_idx is not None:
368+
if new_idx is not None and new_idx not in new_indices:
369369
new_indices.append(new_idx)
370-
new_indices = list(set(new_indices))
371370
if new_indices and not found:
372371
new_basis.append((basis, new_indices))
373372
op._basis = new_basis

0 commit comments

Comments
 (0)