Hi,
I just had a look at https://github.com/sunqm/pyscf/blob/master/dft/libxc.py and noticed that you're using hardcoded functional lists.
However, libxc has had the functionality to parse functional keywords and id numbers for a long time:
int XC(functional_get_number)(const char *name);
char *XC(functional_get_name)(int number);
which implement the necessary functionality. I would recommend removing XC_CODES, XC_KEYS, LDA_IDS, GGA_IDS, etc from dft/libxc.py, and replacing them with the two above functionals.
The functions is_lda, is_gga and so on can be reimplemented by checking the functional family with
int XC(family_from_id)(int id, int *family, int *number);
or by checking the func.info->family entry of
xc_func_type func;
that has been initialized to the used functional. The character of the functional (x, c, or xc) can be similarly checked from func.info->kind.
It doesn't really make sense to replicate this information, since that entails more maintenance. The stuff is already maintained within libxc, where it is always up to date.
Also, I don't see how you handle range separated hybrids. Are they not supported in pyscf?
Hi,
I just had a look at https://github.com/sunqm/pyscf/blob/master/dft/libxc.py and noticed that you're using hardcoded functional lists.
However, libxc has had the functionality to parse functional keywords and id numbers for a long time:
int XC(functional_get_number)(const char *name);
char *XC(functional_get_name)(int number);
which implement the necessary functionality. I would recommend removing XC_CODES, XC_KEYS, LDA_IDS, GGA_IDS, etc from dft/libxc.py, and replacing them with the two above functionals.
The functions is_lda, is_gga and so on can be reimplemented by checking the functional family with
int XC(family_from_id)(int id, int *family, int *number);
or by checking the func.info->family entry of
xc_func_type func;
that has been initialized to the used functional. The character of the functional (x, c, or xc) can be similarly checked from func.info->kind.
It doesn't really make sense to replicate this information, since that entails more maintenance. The stuff is already maintained within libxc, where it is always up to date.
Also, I don't see how you handle range separated hybrids. Are they not supported in pyscf?