Skip to content

Commit 7b162b1

Browse files
committed
fix doctest
1 parent 6cd3910 commit 7b162b1

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

pennylane/estimator/compact_hamiltonian.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -303,7 +303,7 @@ class PauliHamiltonian:
303303
>>> pauli_ham
304304
PauliHamiltonian(num_qubits=40, num_pauli_words=100, max_weight=2, one_norm=14.5)
305305
>>> pauli_ham.pauli_dist
306-
defaultdict(<class 'int'>, {'X': 40, 'XX': 30, 'YY': 30})
306+
{'X': 40, 'XX': 30, 'YY': 30}
307307
>>> pauli_ham.commuting_groups
308308
({'X': 40, 'XX': 30}, {'YY': 30})
309309
@@ -425,7 +425,7 @@ def _pauli_dist_from_commuting_groups(commuting_groups: tuple[dict]):
425425
total_pauli_dist = Counter()
426426
for group in commuting_groups:
427427
total_pauli_dist.update(group)
428-
return total_pauli_dist
428+
return dict(total_pauli_dist)
429429

430430

431431
def _preprocess_inputs(

0 commit comments

Comments
 (0)