Skip to content

Commit

Permalink
XAS_TDP| Removed truncated Coulomb operator from RI_METRIC
Browse files Browse the repository at this point in the history
  • Loading branch information
abussy committed Mar 30, 2020
1 parent 445b182 commit ea7686c
Show file tree
Hide file tree
Showing 6 changed files with 26 additions and 49 deletions.
27 changes: 4 additions & 23 deletions src/input_cp2k_dft.F
Original file line number Diff line number Diff line change
Expand Up @@ -8418,7 +8418,7 @@ SUBROUTINE create_xas_tdp_section(section)
"stands for the exchange potential and ! for the metric "// &
"potential. This allows for drastic screening of the "// &
"3-center integrals by selecting shorter range metric.", &
n_keywords=5, &
n_keywords=2, &
n_subsections=0, &
repeats=.FALSE.)

Expand All @@ -8436,29 +8436,10 @@ SUBROUTINE create_xas_tdp_section(section)
usage="OPERATOR {string}", &
repeats=.FALSE., &
default_i_val=do_potential_id, &
enum_c_vals=s2a("OVERLAP", "TRUNCATED", "SHORTRANGE"), &
enum_c_vals=s2a("OVERLAP", "SHORTRANGE"), &
enum_desc=s2a("Overlap operator (=identity)", &
"Truncated Coulomb operator: 1/r if r < R_c, 0 otherwise ", &
"Short range: erfc(omega*r)/r"), &
enum_i_vals=(/do_potential_id, do_potential_truncated, &
do_potential_short/))
CALL section_add_keyword(subsubsubsection, keyword)
CALL keyword_release(keyword)

CALL keyword_create(keyword, __LOCATION__, name="CUTOFF_RADIUS", &
variants=s2a("R_C", "RC", "RANGE"), &
description="The cutoff radius (in Angstrom) for the truncated Coulomb operator.", &
usage="CUTOFF_RADIUS {double}", &
default_r_val=0.0_dp, &
repeats=.FALSE.)
CALL section_add_keyword(subsubsubsection, keyword)
CALL keyword_release(keyword)

CALL keyword_create(keyword, __LOCATION__, name="T_C_G_DATA", &
description="Location of the file t_c_g.dat that contains the data for the "// &
"evaluation of the truncated gamma function ", &
usage="T_C_G_DATA {string}", &
default_c_val="t_c_g.dat")
enum_i_vals=(/do_potential_id, do_potential_short/))
CALL section_add_keyword(subsubsubsection, keyword)
CALL keyword_release(keyword)

Expand Down Expand Up @@ -8538,7 +8519,7 @@ SUBROUTINE create_xas_tdp_section(section)
"and corresponding excitation energies such that "// &
"the program can be restarted for PDOS or CUBE "// &
"printing without the heavy computing.", &
print_level=medium_print_level, filename="", common_iter_levels=3)
print_level=high_print_level, filename="", common_iter_levels=3)
CALL section_add_subsection(subsection, print_key)
CALL section_release(print_key)

Expand Down
13 changes: 0 additions & 13 deletions src/xas_tdp_types.F
Original file line number Diff line number Diff line change
Expand Up @@ -602,19 +602,6 @@ SUBROUTINE read_xas_tdp_control(xas_tdp_control, xas_tdp_section)

CALL section_vals_val_get(xas_tdp_section, "KERNEL%EXACT_EXCHANGE%RI_METRIC%POTENTIAL_TYPE", &
i_val=xas_tdp_control%ri_m_potential%potential_type)
!truncated Coulomb
IF (xas_tdp_control%ri_m_potential%potential_type == do_potential_truncated) THEN
CALL section_vals_val_get(xas_tdp_section, "KERNEL%EXACT_EXCHANGE%RI_METRIC%T_C_G_DATA", &
c_val=xas_tdp_control%ri_m_potential%filename)
IF (.NOT. file_exists(xas_tdp_control%ri_m_potential%filename)) THEN
CPABORT("Could not find provided T_C_G_DATA file.")
END IF
CALL section_vals_val_get(xas_tdp_section, "KERNEL%EXACT_EXCHANGE%RI_METRIC%CUTOFF_RADIUS", &
r_val=xas_tdp_control%ri_m_potential%cutoff_radius)
!store the range in bohrs
xas_tdp_control%ri_m_potential%cutoff_radius = bohr*xas_tdp_control%ri_m_potential%cutoff_radius
END IF

!short range erfc
IF (xas_tdp_control%ri_m_potential%potential_type == do_potential_short) THEN
CALL section_vals_val_get(xas_tdp_section, "KERNEL%EXACT_EXCHANGE%RI_METRIC%OMEGA", &
Expand Down
3 changes: 3 additions & 0 deletions src/xas_tdp_utils.F
Original file line number Diff line number Diff line change
Expand Up @@ -1261,6 +1261,7 @@ END SUBROUTINE build_aux_matrix
!> the integrals in the xas_tdp_env as global (small) arrays. Does that for a given excited
!> kind. The quantity stored is M^-1 (P|Q) M^-1, where M is the RI metric. If the metric is
!> the same as the exchange potential, then we end up with the V-approximation (P|Q)^-1
!> By default (if no metric), the ri_m_potential is a copy of the x_potential
!> \param ex_kind ...
!> \param xas_tdp_env ...
!> \param xas_tdp_control ...
Expand Down Expand Up @@ -1293,6 +1294,8 @@ SUBROUTINE compute_ri_exchange2_int(ex_kind, xas_tdp_env, xas_tdp_control, qs_en
NULLIFY (ri_basis, qs_kind_set, para_env, lmin, lmax, npgf_set, zet, rpgf, first_sgf)
NULLIFY (sphi, nsgf_set)

!TODO: when refactoring to remove TC from metric option, also need to adapt regtests

! Initialization
CALL get_qs_env(qs_env, qs_kind_set=qs_kind_set, para_env=para_env)
IF (ASSOCIATED(xas_tdp_env%ri_inv_ex)) THEN
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
&GLOBAL
PROJECT Ne-pbc-truncated-metric
PROJECT Ne-pbc-shortrange-ovlp_metric
PRINT_LEVEL LOW
&END GLOBAL
&FORCE_EVAL
Expand All @@ -18,16 +18,22 @@
&LIBXC
FUNCTIONAL LDA_C_VWN
&END LIBXC
!Range separated, need 100% of long-range and 75% of short range LDA exchange
!Long-range obtained by substracting short-range from normal => end up with -0.25 scale
&LIBXC
FUNCTIONAL LDA_X
SCALE 0.75
&END LIBXC
&LIBXC
FUNCTIONAL LDA_X_ERF
SCALE -0.25
PARAMETERS 0.6
&END LIBXC
&END XC_FUNCTIONAL
&HF
FRACTION 0.25
&INTERACTION_POTENTIAL
POTENTIAL_TYPE TRUNCATED
CUTOFF_RADIUS 3.0
POTENTIAL_TYPE SHORTRANGE
OMEGA 0.6
&END INTERACTION_POTENTIAL
&END HF
&END XC
Expand All @@ -51,19 +57,19 @@
FUNCTIONAL LDA_C_VWN
&END LIBXC
&LIBXC
FUNCTIONAL LDA_X
FUNCTIONAL LDA_X_ERF
SCALE 0.75
PARAMETERS 0.6
&END LIBXC
&END XC_FUNCTIONAL

&EXACT_EXCHANGE
FRACTION 0.25
OPERATOR TRUNCATED
CUTOFF_RADIUS 3.0
OPERATOR SHORTRANGE
OMEGA 0.6
EPS_SCREENING 1.0E-8
&RI_METRIC
OPERATOR TRUNCATED
CUTOFF_RADIUS 1.5
OPERATOR OVERLAP
&END RI_METRIC
&END EXACT_EXCHANGE
&END KERNEL
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
&GLOBAL
PROJECT Ne-pbc-shortrange-metric
PROJECT Ne-pbc-shortrange-sr_metric
PRINT_LEVEL LOW
&END GLOBAL
&FORCE_EVAL
Expand Down
6 changes: 3 additions & 3 deletions tests/QS/regtest-xastdp/TEST_FILES
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,10 @@ H2O-B3LYP-full-restart.inp 0
C2H2-PBE-ri_region.inp 88 1e-08 269.849841
#Checking truncated and shortrange operators for exchange in PBCs
#as well as the use of RI metrics for screening
Ne-pbc-shortrange.inp 88 1e-08 890.494623
Ne-pbc-shortrange-metric.inp 88 1e-08 890.495800
Ne-pbc-truncated.inp 88 1e-08 890.773794
Ne-pbc-truncated-metric.inp 88 1e-08 890.780820
Ne-pbc-shortrange.inp 88 1e-08 890.494623
Ne-pbc-shortrange-sr_metric.inp 88 1e-08 890.495800
Ne-pbc-shortrange-ovlp_metric.inp 88 1e-08 890.501870
#Checking the use of pseudo-potential and ADMM
SiH4-PBE0-admm-pseudo.inp 88 1e-08 146.188189
#Checking open-shell calculation with non-singlet ground state
Expand Down

0 comments on commit ea7686c

Please sign in to comment.