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

test case breaks for b88 and lyp #10

Open
alexm-gc opened this issue Sep 1, 2022 · 0 comments
Open

test case breaks for b88 and lyp #10

alexm-gc opened this issue Sep 1, 2022 · 0 comments

Comments

@alexm-gc
Copy link

alexm-gc commented Sep 1, 2022

I'm probably doing something wrong here, but I get different values when I add your b88 and lyp and compare it against PySCF.

Question Can anyone spot my mistake?

from xcauto.functionals import b88_n_gnn, lyp_n_gnn
import pyscf.dft

print(lyp_n_gnn(1, 1))
print(b88_n_gnn(1, 1))
print( lyp_n_gnn(1, 1) + b88_n_gnn(1,1))
_hyb, fn_facs = pyscf.dft.libxc.parse_xc("1 * B88, 1 * LYP ")
exc = pyscf.dft.libxc._eval_xc(_hyb, fn_facs, np.ones((4, 1)), spin=0, relativity=0, deriv=1, verbose=False)[0]
print(exc)
-0.79051954
[-0.79936469]

I expected the outputs would be the same.

Update: if I change the second argument to 3 it works for some reason. Do you think this is just a coincidence, or is this expected?

print( b88_n_gnn(1,3) + lyp_n_gnn(1,3))
print(pyscf.dft.libxc._eval_xc(_hyb, fn_facs, np.ones((4, 1)), spin=0, relativity=0, deriv=1, verbose=False)[0] 
-0.7993647
[-0.79936469]

I managed to get a similar test case to pass for wvn. I imagine my confusion is that wvn only takes one argument, the electron density n, whereas b88 and lyp takes two arguments, n and gnn. I haven't been able to find any documentation for what that is.

import xcauto.functionals 
import pyscf.dft

print( xcauto.functionals.vwn5_n(1) )
_hyb, fn_facs = pyscf.dft.libxc.parse_xc(".2 * HF + .08 * LDA + .72 * B88, .810 * LYP + 1 * VWN")
exc = pyscf.dft.libxc._eval_xc(_hyb, fn_facs[3:4], np.ones((4, 1)), spin=0, relativity=0, deriv=1, verbose=False)[0]
print(exc)
-0.07159259
[-0.07159261]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant