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

Since PySCF-2.3, B3LYP (and B3P86) are changed... #171

Open
Konjkov opened this issue Dec 3, 2024 · 5 comments
Open

Since PySCF-2.3, B3LYP (and B3P86) are changed... #171

Konjkov opened this issue Dec 3, 2024 · 5 comments
Labels
bug Something isn't working

Comments

@Konjkov
Copy link

Konjkov commented Dec 3, 2024

Use your best judgment to provide a useful level of information. Depending on the nature of the issue, consider including, e.g.

  • Which version of the software you're running
  • Any logging or error output you see

Hello QMCTorch developers.
I'am running tests of your program of latest (0.3.2) and
platform linux -- Python 3.10.12, pytest-6.2.5, py-1.10.0, pluggy-0.13.0

on simple test pytest scf/test_gto2sto_fit.py
I get a lot of warnings:

../../../.local/lib/python3.10/site-packages/pyscf/dft/libxc.py:771
  /home/vladimir/.local/lib/python3.10/site-packages/pyscf/dft/libxc.py:771: UserWarning: Since PySCF-2.3, B3LYP (and B3P86) are changed to the VWN-RPA variant, corresponding to the original definition by Stephens et al. (issue 1480) and the same as the B3LYP functional in Gaussian. To restore the VWN5 definition, you can put the setting "B3LYP_WITH_VWN5 = True" in pyscf_conf.py
    warnings.warn('Since PySCF-2.3, B3LYP (and B3P86) are changed to the VWN-RPA variant, '

tests/scf/test_gto2sto_fit.py::TestGTO2STOFit::test_forward
  /home/vladimir/.local/lib/python3.10/site-packages/torch/__init__.py:1144: UserWarning: torch.set_default_tensor_type() is deprecated as of PyTorch 2.1, please use torch.set_default_dtype() and torch.set_default_device() as alternatives. (Triggered internally at ../torch/csrc/tensor/python_tensor.cpp:432.)
    _C._set_default_tensor_type(t)

and error

FAILED scf/test_gto2sto_fit.py::TestGTO2STOFit::test_forward - ValueError: array must not contain infs or NaNs

maybe the error is a consequence of using an outdated method torch.set_default_tensor_type, but it seems to me that the tests are a bit outdated.

Best, Vladimir.

@Konjkov Konjkov added the bug Something isn't working label Dec 3, 2024
@NicoRenaud
Copy link
Contributor

Thanks for the report @Konjkov !
I'm going to update the code as a few issues are popping up.
I'll keep everyone updated when I'm done !

Thanks

@NicoRenaud
Copy link
Contributor

Hey @Konjkov,

I've fixed the torch warning that you flagged in the branch issue170. The test are passing on GH Action (here). Could you tell me two things:

  • which OS are you using ? I've only tested the code on Ubuntu so the code might misbehave on OSX
  • do you remember how you installed qmctorch ? Did you use the pip release or did you clone the repo and pip installed it ?

Thanks again for your help !

@Konjkov
Copy link
Author

Konjkov commented Dec 5, 2024

Hello Nico.

I just wanted to get acquainted with the project. I'am usinh Ubuntu 22.04, clone the repo and pip installed, torch==2.5.1.

I put .pyscf_conf.py with

B3LYP_WITH_VWN5=True

this fixes the 2nd warning but I can't understand if this will affect the execution of the rest of the tests.

I also constantly get an error

Error : Nan detected in local energy

perhaps it is discussed elsewhere #170

Vladimir

@NicoRenaud
Copy link
Contributor

Hi Vladimir,

Thanks for the info !
I've found the issue, some obscure problem with the new implementation of the scipy.special.f2 function.
I've fixed the issue in the branch called issue170 and I will merge that with main as soon as the test are done.
That should fixed the NaN issue.

I think that the pyscf warning you ran into is something different and I'm not sure I can do something about it on my side. I'll look into it though :)

Thanks !

@NicoRenaud
Copy link
Contributor

I've merged the fix in master, the NaN error should not happen anymore

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

2 participants