Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 14 additions & 14 deletions source/Makefile.Objects
Original file line number Diff line number Diff line change
Expand Up @@ -502,20 +502,20 @@ OBJS_SYMMETRY=symm_other.o\

OBJS_XC=xc_functional.o\
xc_functional_op.o\
xc_functional_vxc.o\
xc_functional_gradcorr.o\
xc_functional_wrapper_xc.o\
xc_functional_wrapper_gcxc.o\
xc_functional_libxc.o\
xc_functional_libxc_tools.o\
xc_functional_libxc_vxc.o\
xc_functional_libxc_wrapper_xc.o\
xc_functional_libxc_wrapper_gcxc.o\
xc_functional_libxc_wrapper_tauxc.o\
xc_funct_exch_lda.o\
xc_funct_corr_lda.o\
xc_funct_exch_gga.o\
xc_funct_corr_gga.o\
xc_pot.o\
xc_grad.o\
xc_lda_wrap.o\
xc_gga_wrap.o\
libxc_setup.o\
libxc_tools.o\
libxc_pot.o\
libxc_lda_wrap.o\
libxc_gga_wrap.o\
libxc_mgga_wrap.o\
xc_lda_exch.o\
xc_lda_corr.o\
xc_gga_exch.o\
xc_gga_corr.o\
xc_funct_hcth.o\
exx_info.o\

Expand Down
2 changes: 1 addition & 1 deletion source/source_estate/module_pot/pot_xc.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
#include "source_hamilt/module_xc/xc_functional.h"

#ifdef USE_LIBXC
#include "source_hamilt/module_xc/xc_functional_libxc.h"
#include "source_hamilt/module_xc/libxc_abacus.h"
#endif

namespace elecstate
Expand Down
36 changes: 18 additions & 18 deletions source/source_hamilt/module_surchem/test/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -30,28 +30,28 @@ AddTest(
TARGET MODULE_HAMILT_surchem_cal_vcav
LIBS parameter ${math_libs} planewave device base container
SOURCES cal_vcav_test.cpp ../cal_vcav.cpp ../surchem.cpp ../../../source_pw/module_pwdft/parallel_grid.cpp
../../module_xc/xc_functional_gradcorr.cpp ../../module_xc/xc_functional.cpp
../../module_xc/xc_functional_wrapper_xc.cpp ../../module_xc/xc_functional_wrapper_gcxc.cpp
../../module_xc/xc_functional_libxc.cpp
../../module_xc/xc_functional_libxc_vxc.cpp
../../module_xc/xc_functional_libxc_wrapper_xc.cpp
../../module_xc/xc_functional_libxc_wrapper_gcxc.cpp
../../module_xc/xc_functional_libxc_wrapper_tauxc.cpp
../../module_xc/xc_funct_corr_gga.cpp ../../module_xc/xc_funct_corr_lda.cpp ../../module_xc/xc_funct_exch_gga.cpp
../../module_xc/xc_funct_exch_lda.cpp ../../module_xc/xc_funct_hcth.cpp
../../module_xc/xc_grad.cpp ../../module_xc/xc_functional.cpp
../../module_xc/xc_lda_wrap.cpp ../../module_xc/xc_gga_wrap.cpp
../../module_xc/libxc_setup.cpp
../../module_xc/libxc_pot.cpp
../../module_xc/libxc_lda_wrap.cpp
../../module_xc/libxc_gga_wrap.cpp
../../module_xc/libxc_mgga_wrap.cpp
../../module_xc/xc_gga_corr.cpp ../../module_xc/xc_lda_corr.cpp ../../module_xc/xc_gga_exch.cpp
../../module_xc/xc_lda_exch.cpp ../../module_xc/xc_hcth.cpp
)

AddTest(
TARGET MODULE_HAMILT_surchem_cal_vel
LIBS parameter ${math_libs} planewave device base container
SOURCES cal_vel_test.cpp ../cal_vel.cpp ../surchem.cpp ../cal_epsilon.cpp ../minimize_cg.cpp ../../../source_pw/module_pwdft/parallel_grid.cpp
../../module_xc/xc_functional_gradcorr.cpp ../../module_xc/xc_functional.cpp
../../module_xc/xc_functional_wrapper_xc.cpp ../../module_xc/xc_functional_wrapper_gcxc.cpp
../../module_xc/xc_functional_libxc.cpp
../../module_xc/xc_functional_libxc_vxc.cpp
../../module_xc/xc_functional_libxc_wrapper_xc.cpp
../../module_xc/xc_functional_libxc_wrapper_gcxc.cpp
../../module_xc/xc_functional_libxc_wrapper_tauxc.cpp
../../module_xc/xc_funct_corr_gga.cpp ../../module_xc/xc_funct_corr_lda.cpp ../../module_xc/xc_funct_exch_gga.cpp
../../module_xc/xc_funct_exch_lda.cpp ../../module_xc/xc_funct_hcth.cpp
../../module_xc/xc_grad.cpp ../../module_xc/xc_functional.cpp
../../module_xc/xc_lda_wrap.cpp ../../module_xc/xc_gga_wrap.cpp
../../module_xc/libxc_setup.cpp
../../module_xc/libxc_pot.cpp
../../module_xc/libxc_lda_wrap.cpp
../../module_xc/libxc_gga_wrap.cpp
../../module_xc/libxc_mgga_wrap.cpp
../../module_xc/xc_gga_corr.cpp ../../module_xc/xc_lda_corr.cpp ../../module_xc/xc_gga_exch.cpp
../../module_xc/xc_lda_exch.cpp ../../module_xc/xc_hcth.cpp
)
30 changes: 15 additions & 15 deletions source/source_hamilt/module_xc/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,21 +2,21 @@ add_library(
xc_
OBJECT
xc_functional.cpp
xc_functional_vxc.cpp
xc_functional_gradcorr.cpp
xc_functional_wrapper_xc.cpp
xc_functional_wrapper_gcxc.cpp
xc_funct_exch_lda.cpp
xc_funct_corr_lda.cpp
xc_funct_exch_gga.cpp
xc_funct_corr_gga.cpp
xc_funct_hcth.cpp
xc_functional_libxc.cpp
xc_functional_libxc_tools.cpp
xc_functional_libxc_vxc.cpp
xc_functional_libxc_wrapper_xc.cpp
xc_functional_libxc_wrapper_gcxc.cpp
xc_functional_libxc_wrapper_tauxc.cpp
xc_pot.cpp
xc_grad.cpp
xc_lda_wrap.cpp
xc_gga_wrap.cpp
xc_lda_exch.cpp
xc_lda_corr.cpp
xc_gga_exch.cpp
xc_gga_corr.cpp
xc_hcth.cpp
libxc_setup.cpp
libxc_tools.cpp
libxc_pot.cpp
libxc_lda_wrap.cpp
libxc_gga_wrap.cpp
libxc_mgga_wrap.cpp
exx_info.cpp
)

Expand Down
101 changes: 9 additions & 92 deletions source/source_hamilt/module_xc/exx_info.h
Original file line number Diff line number Diff line change
@@ -1,106 +1,23 @@
#ifndef EXX_INFO_H
#define EXX_INFO_H

#include "source_lcao/module_ri/conv_coulomb_pot_k.h"

#include <vector>
#include <map>
#include <string>
#include "exx_info_global.h"
#include "exx_info_lip.h"
#include "exx_info_ri.h"
#include "exx_info_opt_abfs.h"

struct Exx_Info
{
struct Exx_Info_Global
{
bool cal_exx = false;

std::map<Conv_Coulomb_Pot_K::Coulomb_Type, std::vector<std::map<std::string,std::string>>> coulomb_param;

// Fock:
// "alpha": "0"
// "singularity_correction": "limits" / "spencer" / "revised_spencer" / "massidda" / "carrier"
// "lambda": "0.3"
// "Rcut"
// Erfc:
// "alpha": "0"
// "omega": "0.11"
// "singularity_correction": "limits" / "spencer" / "revised_spencer"
// "Rcut"

Conv_Coulomb_Pot_K::Ccp_Type ccp_type;
double hybrid_alpha = 0.25;
double hse_omega = 0.11;
double mixing_beta_for_loop1 = 1.0;

bool separate_loop = true;
size_t hybrid_step = 1;
};
Exx_Info_Global info_global;

struct Exx_Info_Lip
{
const Conv_Coulomb_Pot_K::Ccp_Type& ccp_type;
const double& hse_omega;
double lambda = 0.3;

Exx_Info_Lip(const Exx_Info::Exx_Info_Global& info_global)
:ccp_type(info_global.ccp_type),
hse_omega(info_global.hse_omega) {}
};
Exx_Info_Lip info_lip;

struct Exx_Info_RI
{
const std::map<Conv_Coulomb_Pot_K::Coulomb_Type, std::vector<std::map<std::string,std::string>>> &coulomb_param;

bool real_number = false;
bool coul_moment = false;
bool rotate_abfs = false;

double pca_threshold = 0;
std::vector<std::string> files_abfs;
std::vector<std::string> files_shrink_abfs;
double C_threshold = 0;
double V_threshold = 0;
double dm_threshold = 0;
double C_grad_threshold = 0;
double V_grad_threshold = 0;
double C_grad_R_threshold = 0;
double V_grad_R_threshold = 0;
double ccp_rmesh_times = 10;
bool exx_symmetry_realspace = true;
double kmesh_times = 4;
double Cs_inv_thr = -1;

double shrink_abfs_pca_thr = -1;
double shrink_LU_inv_thr = 1e-6;
double multip_moments_threshold = 1e-10;
double exx_cs_inv_thr = -1;

int abfs_Lmax = 0; // tmp

Exx_Info_RI(const Exx_Info::Exx_Info_Global& info_global)
: coulomb_param(info_global.coulomb_param)
{
}
};
Exx_Info_RI info_ri;

struct Exx_Info_Opt_ABFs
{
int abfs_Lmax = 0;
double ecut_exx = 60;
double tolerence = 1E-12;
std::vector<std::string> files_jles;

double pca_threshold = 0;
std::vector<std::string> files_abfs;

double kmesh_times = 4;
};
Exx_Info_Opt_ABFs info_opt_abfs;

Exx_Info() : info_lip(this->info_global), info_ri(this->info_global)
void sync_from_global()
{
info_lip.ccp_type = info_global.ccp_type;
info_lip.hse_omega = info_global.hse_omega;
info_ri.coulomb_param = info_global.coulomb_param;
}
};

Expand All @@ -109,4 +26,4 @@ namespace GlobalC
extern Exx_Info exx_info;
}

#endif
#endif
37 changes: 37 additions & 0 deletions source/source_hamilt/module_xc/exx_info_global.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
#ifndef EXX_INFO_GLOBAL_H
#define EXX_INFO_GLOBAL_H

#include "source_lcao/module_ri/conv_coulomb_pot_k.h"

#include <vector>
#include <map>
#include <string>
#include <cstddef>

struct Exx_Info_Global
{
bool cal_exx = false;

std::map<Conv_Coulomb_Pot_K::Coulomb_Type, std::vector<std::map<std::string, std::string>>> coulomb_param;

// Fock:
// "alpha": "0"
// "singularity_correction": "limits" / "spencer" / "revised_spencer" / "massidda" / "carrier"
// "lambda": "0.3"
// "Rcut"
// Erfc:
// "alpha": "0"
// "omega": "0.11"
// "singularity_correction": "limits" / "spencer" / "revised_spencer"
// "Rcut"

Conv_Coulomb_Pot_K::Ccp_Type ccp_type;
double hybrid_alpha = 0.25;
double hse_omega = 0.11;
double mixing_beta_for_loop1 = 1.0;

bool separate_loop = true;
size_t hybrid_step = 1;
};

#endif
13 changes: 13 additions & 0 deletions source/source_hamilt/module_xc/exx_info_lip.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
#ifndef EXX_INFO_LIP_H
#define EXX_INFO_LIP_H

#include "source_lcao/module_ri/conv_coulomb_pot_k.h"

struct Exx_Info_Lip
{
Conv_Coulomb_Pot_K::Ccp_Type ccp_type;
double hse_omega = 0.11;
double lambda = 0.3;
};

#endif
20 changes: 20 additions & 0 deletions source/source_hamilt/module_xc/exx_info_opt_abfs.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
#ifndef EXX_INFO_OPT_ABFS_H
#define EXX_INFO_OPT_ABFS_H

#include <vector>
#include <string>

struct Exx_Info_Opt_ABFs
{
int abfs_Lmax = 0;
double ecut_exx = 60;
double tolerence = 1E-12;
std::vector<std::string> files_jles;

double pca_threshold = 0;
std::vector<std::string> files_abfs;

double kmesh_times = 4;
};

#endif
41 changes: 41 additions & 0 deletions source/source_hamilt/module_xc/exx_info_ri.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
#ifndef EXX_INFO_RI_H
#define EXX_INFO_RI_H

#include "source_lcao/module_ri/conv_coulomb_pot_k.h"

#include <vector>
#include <string>
#include <map>

struct Exx_Info_RI
{
std::map<Conv_Coulomb_Pot_K::Coulomb_Type, std::vector<std::map<std::string, std::string>>> coulomb_param;

bool real_number = false;
bool coul_moment = false;
bool rotate_abfs = false;

double pca_threshold = 0;
std::vector<std::string> files_abfs;
std::vector<std::string> files_shrink_abfs;
double C_threshold = 0;
double V_threshold = 0;
double dm_threshold = 0;
double C_grad_threshold = 0;
double V_grad_threshold = 0;
double C_grad_R_threshold = 0;
double V_grad_R_threshold = 0;
double ccp_rmesh_times = 10;
bool exx_symmetry_realspace = true;
double kmesh_times = 4;
double Cs_inv_thr = -1;

double shrink_abfs_pca_thr = -1;
double shrink_LU_inv_thr = 1e-6;
double multip_moments_threshold = 1e-10;
double exx_cs_inv_thr = -1;

int abfs_Lmax = 0;
};

#endif
Loading
Loading