-
Notifications
You must be signed in to change notification settings - Fork 18
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
Update mGGA implementation to new API and add unrestricted case #84
Conversation
@wavefunction91 I have tested the restricted and unrestricted VXC and everything looks good. I have not tested gradients as our code is not yet ready for that. We can comment that out, your call. I activated the Laplacian contribution, which is always computed for simplicity. This poses a significant slowdown for tau-MGGAs as one ends up manipulating lots of zeros, but the logic to disable that contribution is already there, we just need to query the functional (which I think has to be through ExchCXX). |
@dmejiar I added an issue in ExchCXX to track the laplacian check |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Before checking this in, we'll need to add some unit tests. We can intercept ExaChem data directly if that's helpful. I have an example of how to write a fully compliant reference file here:
GauXC/tests/standalone_driver.cxx
Lines 447 to 486 in a777fa2
if( input.containsData("GAUXC.OUTFILE") ) { | |
// Create File | |
auto outfname = input.getData<std::string>("GAUXC.OUTFILE"); | |
{ HighFive::File( outfname, HighFive::File::Truncate ); } | |
// Write molecule | |
write_hdf5_record( mol, outfname, "/MOLECULE" ); | |
// Write Basis | |
write_hdf5_record( basis, outfname, "/BASIS" ); | |
// Write out matrices | |
HighFive::File file( outfname, HighFive::File::ReadWrite ); | |
HighFive::DataSpace mat_space( basis.nbf(), basis.nbf() ); | |
HighFive::DataSpace sca_space( 1 ); | |
auto dset = file.createDataSet<double>( "/DENSITY", mat_space ); | |
dset.write_raw( P.data() ); | |
if( integrate_vxc ) { | |
dset = file.createDataSet<double>( "/VXC", mat_space ); | |
dset.write_raw( VXC.data() ); | |
dset = file.createDataSet<double>( "/EXC", sca_space ); | |
dset.write_raw( &EXC ); | |
} | |
if( integrate_exx ) { | |
dset = file.createDataSet<double>( "/K", mat_space ); | |
dset.write_raw( K.data() ); | |
} | |
if( integrate_exc_grad ) { | |
HighFive::DataSpace grad_space( mol.size(), 3 ); | |
dset = file.createDataSet<double>( "/EXC_GRAD", grad_space ); | |
dset.write_raw( EXC_GRAD.data() ); | |
} | |
} | |
} |
Essentially - we need the basis, density, molecule, and EXC/VXC written out in that standard HDF5 file.
Also, we're going to need to add a check in the GPU code to preclude mGGAs for the time being. I'll add the implementation soon after this is merged.
src/xc_integrator/local_work_driver/host/reference_local_host_work_driver.cxx
Outdated
Show resolved
Hide resolved
src/xc_integrator/local_work_driver/host/reference_local_host_work_driver.cxx
Outdated
Show resolved
Hide resolved
src/xc_integrator/local_work_driver/host/reference_local_host_work_driver.cxx
Outdated
Show resolved
Hide resolved
src/xc_integrator/replicated/host/reference_replicated_xc_host_integrator_exc_grad.hpp
Outdated
Show resolved
Hide resolved
src/xc_integrator/replicated/host/reference_replicated_xc_host_integrator_exc_grad.hpp
Show resolved
Hide resolved
src/xc_integrator/replicated/host/reference_replicated_xc_host_integrator_exc_grad.hpp
Show resolved
Hide resolved
src/xc_integrator/replicated/host/reference_replicated_xc_host_integrator_exc_vxc.hpp
Show resolved
Hide resolved
src/xc_integrator/replicated/host/reference_replicated_xc_host_integrator_exc_vxc.hpp
Show resolved
Hide resolved
I have generated such files, but to enable the tests we need to either use the LibXC backend or have built-in implementations of mGGA functionals (tau and lapl) in ExchCXX.
I added an early check while setting up the integral factory, do you think this would work? |
OK - can you make a quick list of the mGGA functionals you'd like to see proper infrastructure for? Also can you add these reference files to the
Yep, that works for now. Thanks!! |
@dmejiar Any info about how the reference files were generated? Bfn tolerances? Grids? Pruning? |
Hopefully the names of the file convey some of that info. These were obtained with the UltraFineGrid, SSF partitioning, and Robust pruning. I am not sure at what bfn tolerances you refer (we don't modify them in ExaChem) so they must have been the default |
@dmejiar Can you share how you construct the XC functional for SCAN? Do you just add Also, for the cytosine test cases, are the UKS different spin states? Or are they just RKS run though the UKS code? If the latter, I'd prefer an actual UKS test is added, the way the UKS code works is pretty uninteresting for RKS data. |
|
Unit tests added, but one of the reference files is missing data
I added the stubs for that unit test here. Update the file, uncomment the test and we're g2g. |
@wavefunction91 file updated |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Daniel Mejia-Rodriguez added the CPU implementation of the meta-GGA XC integrator in #84.
@wavefunction91 This adds restricted and unrestricted tau-mGGAs. The code for Laplacian mGGAs is also there but it is deactivated for now. I marked it as WIP as I did not have time to test the code.