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

metaGGA functionals not usable through the Python bindings #141

Open
robertodr opened this issue Sep 15, 2020 · 4 comments
Open

metaGGA functionals not usable through the Python bindings #141

robertodr opened this issue Sep 15, 2020 · 4 comments
Assignees

Comments

@robertodr
Copy link
Contributor

As noted in #140, it is not possible to use metaGGA functionals through the high-level Python class Functional. One needs to use the pybind11-generated bindings directly:

# create empty functional
xc = xcfun_new()
# fill it with SCANc
ierr = xcfun_set(xc, "SCANc", 1.0)
# set evaluation variables enum (I'm not sure what you'd need here...)
vars = XC_N_S_GNN_GNS_GSS_TAUN_TAUS 
# set evaluation mode enum (you might want another mode)
mode = XC_PARTIAL_DERIVATIVES
# set the order (0 for energy, etc)
order = 0 
# set up evaluation mode
xcfun_eval_setup(xc, vars, mode, order)
# set input variables as a numpy array
dens = ...
# evaluate, the return value is a numpy array
ret = xcfun_eval(xc, dens)
# clean up functional
xcfun_delete(xc)
@chjacob-tubs chjacob-tubs self-assigned this Sep 16, 2020
@chjacob-tubs
Copy link
Contributor

I will put this on my list and will work on extending the high-level Python interface as soon as I find some time for this.

@susilehtola
Copy link
Contributor

A meta-GGA interface would be highly valuable.

@susilehtola
Copy link
Contributor

@chjacob-tubs is this still on your todo list?

@chjacob-tubs
Copy link
Contributor

Thanks for the reminder, I had forgotten about it because we currently dont need it.

I will try to have a look in the next weeks, that would be a nice change from all the administration work I am currently doing. If nothing happens, please keep the reminders coming!

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

3 participants