-
Notifications
You must be signed in to change notification settings - Fork 22
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
A new LibXC interface based on CFFI and new MC-DCFT code #70
base: master
Are you sure you want to change the base?
Conversation
…or cp37, which makes HDF5 backend missing for trexio
I took a quick look at the cmake part, and I noticed it adds a CFFI build section. Is the CFFI build necessary? Using CFFI for the interface would require building a wheel for each Python version, which adds efforts to devops maintenance. |
…wheels for cp37, which makes HDF5 backend missing for trexio" This reverts commit fe54aa1.
|
If I understand correctly, the use of CFFI is basically an alternative to writing several new functions in `libxc_itrf.c', as in the final version of this PR. |
The current implementation is performed in the CFFI API mode, which requires a CFFI build. If we re-write in ABI mode, it will probably not require a build, but it is not the recommended way according to the manual, as ABI mode is slower and is more prone to problems. Therefore, I personally prefer API mode.
This is a good suggestion. I added the comments in the files that are adapted from PySCF core modules.
There is already one test case in
The reason I prefer to put |
I have now implemented the interface using the CFFI ABI mode, which should no longer need a separate wheel for each Python version. This will be the default mode when users install the package with |
OK, but can you add an example script for the use of that straightforward high-level API? |
Yes, I just added an example script to show how users can set functional parameters using the high-level API in MC-DCFT. |
Can you also add the meta-GGA functional available for MC-PDFT as well? This way OpenMolcas (with this PR) and PySCF would be up to date with regards to functional functionality. |
After carefully consideration, I strongly recommend removing the dependency on |
Could you describe your modifications and report the commit hash from which you copied those files in those comments? |
This pull request consists of two contributions:
The new interface uses the CFFI library to call LibXC. It is located in a separate package named
dft2
. The new interface is fully backward compatible with the current interface as demonstrated by the test cases. It is implemented based on the PySCF 2.7 LibXC interface code. Compared to the current LibXC interface, the new interface has several advantages:lib/dft/libxc_itrf.c
are not needed and can be replaced by a Python equivalent, as performed in this pull request. This makes it easier for future interface development, in case LibXC introduces new features such as double hybrid functionals as mentioned in double hybrid functional #52.XCFunctional
is provided, which is intended to be served as a high-level API representing an exchange–correlation functional, and perhaps potentially be used to replace thexc_code
string in DFT codes to enhance performance. The design of the high-level API is still not mature, so I am open to suggestions from the PySCF community.This pull request enhances the code for multiconfiguration density coherence functional theory (MC-DCFT, doi: 10.1021/acs.jctc.0c01346) by integrating with the abovementioned LibXC interface. It allows users to perform calculations with our recently developed density coherence functional DC24 (doi: 10.26434/chemrxiv-2024-78tt8).