Skip to content

Commit

Permalink
add defaultdict(float)
Browse files Browse the repository at this point in the history
  • Loading branch information
bartandrews committed Apr 24, 2024
1 parent 3d54e2e commit e4c8c99
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion python/ffsim/operators/fermi_hubbard.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ def fermi_hubbard_1d(
.. _The Hubbard Model: https://doi.org/10.1146/annurev-conmatphys-031620-102024
"""
coeffs: dict[tuple[tuple[bool, bool, int], ...], complex] = defaultdict(lambda: 0)
coeffs: dict[tuple[tuple[bool, bool, int], ...], complex] = defaultdict(float)

for p in range(norb - 1 + periodic):
coeffs[(cre_a(p), des_a((p + 1) % norb))] -= tunneling
Expand Down

0 comments on commit e4c8c99

Please sign in to comment.