google-deepmind / ferminet

An implementation of the Fermionic Neural Network for ab-initio electronic structure calculations
Apache License 2.0
740 stars 129 forks source link

Natural Excited States to nan #76

Closed KingDamLiu closed 2 months ago

KingDamLiu commented 3 months ago

Even in a small system like LiH with states=4, it is easy to nan in thousands to tens of thousands of steps. I am not sure why, can you help with this?

dashu233 commented 2 months ago

While I'm not the owner of this repo, I met the same question as yours. In my experience, using float64 is helpful and solves almost all the nan issues. See https://jax.readthedocs.io/en/latest/notebooks/Common_Gotchas_in_JAX.html#double-64bit-precision for details about using float64 in JAX.

jsspencer commented 2 months ago

Float64 is important in some cases but we did not need it for our excited state calculations. Other thoughts:

We just updated the code and the latest version might be worth trying. It is hard to know what the issue is without the exact setup and parameters you are using.

Finally, for research questions, please try sending email rather than (anonymous) github issues.