qiskit-community / ffsim

Faster simulations of fermionic quantum circuits.
https://qiskit-community.github.io/ffsim/
Apache License 2.0
19 stars 5 forks source link

Fix edge case in fermi_hubbard_1d #142

Closed bartandrews closed 3 months ago

bartandrews commented 3 months ago

This PR fixes an edge case in fermi_hubbard_1d, which appears when the number of spatial orbitals N=2, and periodic boundary conditions are set (i.e. a ring with two sites). In this case, the hopping due to the periodic boundary conditions has the same dictionary key as the internal hopping. Instead of this dictionary key being overwritten, it should be added.