Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error : Nan detected in local energy #169

Open
f-fathurrahman opened this issue Mar 25, 2024 · 0 comments
Open

Error : Nan detected in local energy #169

f-fathurrahman opened this issue Mar 25, 2024 · 0 comments
Labels
bug Something isn't working

Comments

@f-fathurrahman
Copy link

I am trying to follow the tutorial about getting energy of water molecule and get the following when running the solver:

>>> obs = solver.single_point()
INFO:QMCTorch|
INFO:QMCTorch|  Single Point Calculation : 100 walkers | 500 steps
INFO:QMCTorch|  Sampling: 100%|████████████████████████████████████████████████████████████████| 500/500 [00:00<00:00, 823.47it/s]
INFO:QMCTorch|   Acceptance rate     : 0.00 %
INFO:QMCTorch|   Timing statistics   : 823.08 steps/sec.
INFO:QMCTorch|   Total Time          : 0.61 sec.
INFO:QMCTorch|  Energy   : nan +/- nan
INFO:QMCTorch|  Variance : nan
INFO:QMCTorch|
INFO:QMCTorch| Warning : dump to hdf5
INFO:QMCTorch| Object single_point already exists in water_pyscf_sto-3g_QMCTorch.hdf5
INFO:QMCTorch| Object name changed to single_point_2
INFO:QMCTorch|

I also get similar error when trying to run tests/solver/test_h2.py:

r$ python test_h2.py
INFO:QMCTorch|  ____    __  ______________             _
INFO:QMCTorch| / __ \  /  |/  / ___/_  __/__  ________/ /
INFO:QMCTorch|/ /_/ / / /|_/ / /__  / / / _ \/ __/ __/ _ \
INFO:QMCTorch|\___\_\/_/  /_/\___/ /_/  \___/_/  \__/_//_/
INFO:QMCTorch|
INFO:QMCTorch| SCF Calculation
INFO:QMCTorch|  Running scf  calculation
converged SCF energy = -1.11718492179418
INFO:QMCTorch|  Molecule name       : H2
INFO:QMCTorch|  Number of electrons : 2
INFO:QMCTorch|  SCF calculator      : pyscf
INFO:QMCTorch|  Basis set           : sto-3g
INFO:QMCTorch|  SCF                 : HF
INFO:QMCTorch|  Number of AOs       : 2
INFO:QMCTorch|  Number of MOs       : 2
INFO:QMCTorch|  SCF Energy          : -1.117 Hartree
INFO:QMCTorch|
INFO:QMCTorch| Wave Function
INFO:QMCTorch|  Jastrow factor      : True
INFO:QMCTorch|  Jastrow kernel      : PadeJastrowKernel
INFO:QMCTorch|  Highest MO included : 2
INFO:QMCTorch|  Configurations      : single(2,2)
INFO:QMCTorch|  Number of confs     : 3
INFO:QMCTorch|  Kinetic energy      : auto
INFO:QMCTorch|  Number var  param   : 20
INFO:QMCTorch|  Cuda support        : False
INFO:QMCTorch|
INFO:QMCTorch| Monte-Carlo Sampler
INFO:QMCTorch|  Number of walkers   : 1000
INFO:QMCTorch|  Number of steps     : 2000
INFO:QMCTorch|  Step size           : 0.5
INFO:QMCTorch|  Thermalization steps: -1
INFO:QMCTorch|  Decorelation steps  : 1
INFO:QMCTorch|  Walkers init pos    : normal
INFO:QMCTorch|  Move type           : all-elec
INFO:QMCTorch|  Move proba          : normal
INFO:QMCTorch|
INFO:QMCTorch| Monte-Carlo Sampler
INFO:QMCTorch|  Number of walkers   : 100
INFO:QMCTorch|  Number of steps     : 200
INFO:QMCTorch|  Step size           : 0.1
INFO:QMCTorch|  Thermalization steps: -1
INFO:QMCTorch|  Decorelation steps  : 1
INFO:QMCTorch|  Walkers init pos    : normal
INFO:QMCTorch|
INFO:QMCTorch| QMC Solver
INFO:QMCTorch|  WaveFunction        : SlaterJastrow
INFO:QMCTorch|  Sampler             : Metropolis
INFO:QMCTorch|  Optimizer           : Adam
INFO:QMCTorch|
INFO:QMCTorch|  Optimization
INFO:QMCTorch|  Task                :
INFO:QMCTorch|  Number Parameters   : 14
INFO:QMCTorch|  Number of epoch     : 5
INFO:QMCTorch|  Batch size          : 1000
INFO:QMCTorch|  Loss function       : energy
INFO:QMCTorch|  Clip Loss           : False
INFO:QMCTorch|  Gradients           : auto
INFO:QMCTorch|  Resampling mode     : update
INFO:QMCTorch|  Resampling every    : 1
INFO:QMCTorch|  Resampling steps    : 25
INFO:QMCTorch|  Output file         : H2_pyscf_sto-3g_QMCTorch.hdf5
INFO:QMCTorch|  Checkpoint every    : None
INFO:QMCTorch|
INFO:QMCTorch|
INFO:QMCTorch|  epoch 0
INFO:QMCTorch|Error : Nan detected in local energy
``

I have not located yet where this `Nan` appears.

Output of `pip list`:

```text
Package           Version
----------------- -----------
ase               3.22.1
asttokens         2.4.1
colorama          0.4.6
contourpy         1.2.0
cycler            0.12.1
decorator         5.1.1
dill              0.3.8
dill              0.3.8
executing         2.0.1
filelock          3.9.0
fonttools         4.50.0
fsspec            2023.4.0
geometric         1.0.2
greenlet          3.0.3
h5py              3.10.0
ipython           8.22.2
jedi              0.19.1
Jinja2            3.1.2
kiwisolver        1.4.5
MarkupSafe        2.1.3
matplotlib        3.8.3
matplotlib-inline 0.1.6
mendeleev         0.15.0
mpi4py            3.1.4
mpmath            1.3.0
networkx          3.2.1
numpy             1.26.4
packaging         24.0
pandas            2.2.1
parso             0.8.3
pexpect           4.9.0
pillow            10.2.0
pip               23.3.1
plams             1.5.1
plams             1.5.1
prompt-toolkit    3.0.43
ptyprocess        0.7.0
pure-eval         0.2.2
pyberny           0.6.3
pyfiglet          0.8.post1
Pygments          2.17.2
pyparsing         3.1.2
pyqmc             0.6.0
pyscf             2.5.0
pyscf-qsdopt      0.1.0
python-dateutil   2.9.0.post0
pytz              2024.1
qmctorch          0.3.2
qmctorch          0.3.2
scipy             1.12.0
setuptools        68.2.2
six               1.16.0
SQLAlchemy        2.0.29
stack-data        0.6.3
sympy             1.12
torch             2.2.1+cpu
torchaudio        2.2.1+cpu
torchvision       0.17.1+cpu
tqdm              4.66.2
traitlets         5.14.2
Twiggy            0.5.1
typing_extensions 4.8.0
tzdata            2024.1
wcwidth           0.2.13
wheel             0.41.2
@f-fathurrahman f-fathurrahman added the bug Something isn't working label Mar 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant