Skip to content

Commit

Permalink
Fix to WeightedPauliOperator (qiskit-community/qiskit-aqua#891)
Browse files Browse the repository at this point in the history
  • Loading branch information
woodsp-ibm authored Apr 7, 2020
1 parent 866e1ae commit e8c5a7e
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions qiskit/aqua/operators/weighted_pauli_operator.py
Original file line number Diff line number Diff line change
Expand Up @@ -365,9 +365,8 @@ def simplify(self, copy=False):
break
for idx in indices:
new_idx = old_to_new_indices[idx]
if new_idx is not None:
if new_idx is not None and new_idx not in new_indices:
new_indices.append(new_idx)
new_indices = list(set(new_indices))
if new_indices and not found:
new_basis.append((basis, new_indices))
op._basis = new_basis
Expand Down

0 comments on commit e8c5a7e

Please sign in to comment.