WagnerGroup / pyqmc

Python library for real space quantum Monte Carlo
MIT License
81 stars 33 forks source link

Fix numerical precision error in twists #450

Closed willwheelera closed 1 month ago

willwheelera commented 2 months ago

when the kpts are converted to fractional coordinates in pbc.enforce_pbc, if the fractions are 1 - 1e-16, they don't mod back to zero. Instead of calling enforce_pbc, run it in create_supercell_twists and round the fractions to tol.

The other change to the orbital object kpts shape helps with consistency.

lkwagner commented 2 months ago

Can you give an example of this happening and the fix "fixing it"?