diff --git a/src/input_cp2k_dft.F b/src/input_cp2k_dft.F index 3d862ffcdb..ce588ac112 100644 --- a/src/input_cp2k_dft.F +++ b/src/input_cp2k_dft.F @@ -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.) @@ -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) @@ -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) diff --git a/src/xas_tdp_types.F b/src/xas_tdp_types.F index adf6bd47ca..f8f52d4a72 100644 --- a/src/xas_tdp_types.F +++ b/src/xas_tdp_types.F @@ -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", & diff --git a/src/xas_tdp_utils.F b/src/xas_tdp_utils.F index 35615a8fcf..56282caf40 100644 --- a/src/xas_tdp_utils.F +++ b/src/xas_tdp_utils.F @@ -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 ... @@ -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 diff --git a/tests/QS/regtest-xastdp/Ne-pbc-truncated-metric.inp b/tests/QS/regtest-xastdp/Ne-pbc-shortrange-ovlp_metric.inp similarity index 73% rename from tests/QS/regtest-xastdp/Ne-pbc-truncated-metric.inp rename to tests/QS/regtest-xastdp/Ne-pbc-shortrange-ovlp_metric.inp index 1f4ab7b8dc..7a7d630ddb 100644 --- a/tests/QS/regtest-xastdp/Ne-pbc-truncated-metric.inp +++ b/tests/QS/regtest-xastdp/Ne-pbc-shortrange-ovlp_metric.inp @@ -1,5 +1,5 @@ &GLOBAL - PROJECT Ne-pbc-truncated-metric + PROJECT Ne-pbc-shortrange-ovlp_metric PRINT_LEVEL LOW &END GLOBAL &FORCE_EVAL @@ -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 @@ -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 diff --git a/tests/QS/regtest-xastdp/Ne-pbc-shortrange-metric.inp b/tests/QS/regtest-xastdp/Ne-pbc-shortrange-sr_metric.inp similarity index 98% rename from tests/QS/regtest-xastdp/Ne-pbc-shortrange-metric.inp rename to tests/QS/regtest-xastdp/Ne-pbc-shortrange-sr_metric.inp index 660c07599f..e3a54e2f71 100644 --- a/tests/QS/regtest-xastdp/Ne-pbc-shortrange-metric.inp +++ b/tests/QS/regtest-xastdp/Ne-pbc-shortrange-sr_metric.inp @@ -1,5 +1,5 @@ &GLOBAL - PROJECT Ne-pbc-shortrange-metric + PROJECT Ne-pbc-shortrange-sr_metric PRINT_LEVEL LOW &END GLOBAL &FORCE_EVAL diff --git a/tests/QS/regtest-xastdp/TEST_FILES b/tests/QS/regtest-xastdp/TEST_FILES index 4efead30f0..1a19594951 100644 --- a/tests/QS/regtest-xastdp/TEST_FILES +++ b/tests/QS/regtest-xastdp/TEST_FILES @@ -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