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

Add Builtin LDA Electron-Proton Correlation Functionals #38

Merged
merged 12 commits into from
May 3, 2024
4 changes: 2 additions & 2 deletions src/libxc.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -231,8 +231,8 @@ bool LibxcKernelImpl::is_polarized_() const noexcept {
}

bool LibxcKernelImpl::is_epc_() const noexcept {
//EXCHCXX_BOOL_CHECK("Libxc EPC Wrapper NYI", false);
return false;
int xcNumber = xc_info()->number;
return xcNumber == 328 or xcNumber == 329 or xcNumber == 330 or xcNumber or 331;
wavefunction91 marked this conversation as resolved.
Show resolved Hide resolved
}


Expand Down
39 changes: 29 additions & 10 deletions test/xc_kernel_test.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -769,9 +769,8 @@ void compare_libxc_builtin( TestInterface interface, EvalType evaltype,

const int npts = npts_lda;

XCKernel func_builtin( Backend::builtin, kern, polar );
if( func_builtin.is_epc() ) return;
XCKernel func_libxc ( Backend::libxc, kern, polar );
XCKernel func_builtin( Backend::builtin, kern, polar );


const int len_rho = func_libxc.rho_buffer_len( npts );
Expand Down Expand Up @@ -902,20 +901,25 @@ void compare_libxc_builtin( TestInterface interface, EvalType evaltype,
TEST_CASE( "Builtin Corectness Test", "[xc-builtin]" ) {

SECTION( "Unpolarized Regular Eval : EXC" ) {
for( auto kern : builtin_supported_kernels )
for( auto kern : builtin_supported_kernels ) {
if(is_epc(kern)) continue;
compare_libxc_builtin( TestInterface::EXC, EvalType::Regular,
kern, Spin::Unpolarized );
}
}

SECTION( "Unpolarized Regular Eval : EXC + VXC" ) {
for( auto kern : builtin_supported_kernels )
for( auto kern : builtin_supported_kernels ) {
if(is_epc(kern)) continue;
compare_libxc_builtin( TestInterface::EXC_VXC, EvalType::Regular,
kern, Spin::Unpolarized );
}
}

SECTION( "Unpolarized Small Eval : EXC" ) {
for( auto kern : builtin_supported_kernels ) {
if(is_unstable_small(kern)) continue;
if(is_epc(kern)) continue;
compare_libxc_builtin( TestInterface::EXC, EvalType::Small,
kern, Spin::Unpolarized );
}
Expand All @@ -924,21 +928,26 @@ TEST_CASE( "Builtin Corectness Test", "[xc-builtin]" ) {
SECTION( "Unpolarized Small Eval : EXC + VXC" ) {
for( auto kern : builtin_supported_kernels ) {
if(is_unstable_small(kern)) continue;
if(is_epc(kern)) continue;
compare_libxc_builtin( TestInterface::EXC_VXC, EvalType::Small,
kern, Spin::Unpolarized );
}
}

SECTION( "Unpolarized Zero Eval : EXC" ) {
for( auto kern : builtin_supported_kernels )
for( auto kern : builtin_supported_kernels ) {
if(is_epc(kern)) continue;
compare_libxc_builtin( TestInterface::EXC, EvalType::Zero,
kern, Spin::Unpolarized );
}
}

SECTION( "Unpolarized Zero Eval : EXC + VXC" ) {
for( auto kern : builtin_supported_kernels )
for( auto kern : builtin_supported_kernels ) {
if(is_epc(kern)) continue;
compare_libxc_builtin( TestInterface::EXC_VXC, EvalType::Zero,
kern, Spin::Unpolarized );
}
}


Expand All @@ -947,20 +956,25 @@ TEST_CASE( "Builtin Corectness Test", "[xc-builtin]" ) {


SECTION( "Polarized Regular Eval : EXC" ) {
for( auto kern : builtin_supported_kernels )
for( auto kern : builtin_supported_kernels ) {
if(is_epc(kern)) continue;
compare_libxc_builtin( TestInterface::EXC, EvalType::Regular,
kern, Spin::Polarized );
}
}

SECTION( "Polarized Regular Eval : EXC + VXC" ) {
for( auto kern : builtin_supported_kernels )
for( auto kern : builtin_supported_kernels ) {
if(is_epc(kern)) continue;
compare_libxc_builtin( TestInterface::EXC_VXC, EvalType::Regular,
kern, Spin::Polarized );
}
}

SECTION( "Polarized Small Eval : EXC" ) {
for( auto kern : builtin_supported_kernels ) {
if(is_unstable_small(kern)) continue;
if(is_epc(kern)) continue;
compare_libxc_builtin( TestInterface::EXC, EvalType::Small,
kern, Spin::Polarized );
}
Expand All @@ -969,21 +983,26 @@ TEST_CASE( "Builtin Corectness Test", "[xc-builtin]" ) {
SECTION( "Polarized Small Eval : EXC + VXC" ) {
for( auto kern : builtin_supported_kernels ) {
if(is_unstable_small(kern)) continue;
if(is_epc(kern)) continue;
compare_libxc_builtin( TestInterface::EXC_VXC, EvalType::Small,
kern, Spin::Polarized );
}
}

SECTION( "Polarized Zero Eval : EXC" ) {
for( auto kern : builtin_supported_kernels )
for( auto kern : builtin_supported_kernels ) {
if(is_epc(kern)) continue;
compare_libxc_builtin( TestInterface::EXC, EvalType::Zero,
kern, Spin::Polarized );
}
}

SECTION( "Polarized Zero Eval : EXC + VXC" ) {
for( auto kern : builtin_supported_kernels )
for( auto kern : builtin_supported_kernels ) {
if(is_epc(kern)) continue;
compare_libxc_builtin( TestInterface::EXC_VXC, EvalType::Zero,
kern, Spin::Polarized );
}
}

}
Expand Down