Skip to content

Commit

Permalink
Clarify RI-HFXk input
Browse files Browse the repository at this point in the history
  • Loading branch information
abussy committed Jan 17, 2024
1 parent e1e5a3e commit bde1f30
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 23 deletions.
7 changes: 2 additions & 5 deletions src/hfx_ri_kp.F
Original file line number Diff line number Diff line change
Expand Up @@ -4154,7 +4154,7 @@ SUBROUTINE get_kp_and_ri_images(ri_data, qs_env)
INTEGER, ALLOCATABLE, DIMENSION(:) :: dist_AO_1, dist_AO_2, dist_RI, &
nRI_per_atom, present_img, RI_cells
INTEGER, DIMENSION(:, :, :), POINTER :: cell_to_index
REAL(dp) :: bump_fact, dij, dik, fact, image_range, &
REAL(dp) :: bump_fact, dij, dik, image_range, &
RI_range, rij(3), rik(3)
TYPE(dbt_type) :: t_dummy
TYPE(dft_control_type), POINTER :: dft_control
Expand Down Expand Up @@ -4189,7 +4189,6 @@ SUBROUTINE get_kp_and_ri_images(ri_data, qs_env)
kp_index_ubounds = UBOUND(cell_to_index)

hfx_section => section_vals_get_subs_vals(qs_env%input, "DFT%XC%HF%RI")
CALL section_vals_val_get(hfx_section, "KP_RI_EXTENSION_FACTOR", r_val=fact)
CALL section_vals_val_get(hfx_section, "KP_NGROUPS", i_val=ngroups)

ALLOCATE (basis_set_RI(nkind), basis_set_AO(nkind))
Expand All @@ -4207,7 +4206,7 @@ SUBROUTINE get_kp_and_ri_images(ri_data, qs_env)
ri_data%kp_image_range = 0.0_dp
DO ikind = 1, nkind

CALL init_interaction_radii_orb_basis(basis_set_AO(ikind)%gto_basis_set, fact*ri_data%eps_pgf_orb)
CALL init_interaction_radii_orb_basis(basis_set_AO(ikind)%gto_basis_set, ri_data%eps_pgf_orb)
CALL get_gto_basis_set(basis_set_AO(ikind)%gto_basis_set, kind_radius=RI_range)
ri_data%kp_RI_range = MAX(RI_range, ri_data%kp_RI_range)

Expand Down Expand Up @@ -4330,8 +4329,6 @@ SUBROUTINE get_kp_and_ri_images(ri_data, qs_env)
IF (ri_data%unit_nr > 0) THEN
WRITE (ri_data%unit_nr, FMT="(/T3,A,I29)") &
"KP-HFX_RI_INFO| Number of RI-KP parallel groups:", ngroups
WRITE (ri_data%unit_nr, FMT="(T3,A,F35.3)") &
"KP-HFX_RI_INFO| RI basis extension factor:", fact
WRITE (ri_data%unit_nr, FMT="(T3,A,F31.3,A)") &
"KP-HFX_RI_INFO| RI basis extension radius:", ri_data%kp_RI_range*angstrom, " Ang"
WRITE (ri_data%unit_nr, FMT="(T3,A,F12.3,A, F6.3, A)") &
Expand Down
27 changes: 9 additions & 18 deletions src/input_cp2k_hfx.F
Original file line number Diff line number Diff line change
Expand Up @@ -484,7 +484,9 @@ SUBROUTINE create_hf_ri_section(section)

CPASSERT(.NOT. ASSOCIATED(section))
CALL section_create(section, __LOCATION__, name="RI", &
description="Parameters for RI method in HFX (experimental, forces not yet implemented).")
description="Parameters for RI methods in HFX, including RI-HFXk with "// &
"k-point sampling. All keywords relevant to RI-HFXk have an "// &
"alias starting with KP_")

CALL keyword_create(keyword, __LOCATION__, name="_SECTION_PARAMETERS_", &
description="controls the activation of RI", &
Expand All @@ -495,7 +497,8 @@ SUBROUTINE create_hf_ri_section(section)
CALL keyword_release(keyword)

CALL keyword_create(keyword, __LOCATION__, name="EPS_FILTER", &
description="Filter threshold for DBCSR tensor contraction.", &
description="Filter threshold for DBT tensor contraction.", &
variants=(/"KP_EPS_FILTER"/), &
default_r_val=1.0E-09_dp)
CALL section_add_keyword(section, keyword)
CALL keyword_release(keyword)
Expand Down Expand Up @@ -524,6 +527,7 @@ SUBROUTINE create_hf_ri_section(section)
CALL keyword_create(keyword, __LOCATION__, name="OMEGA", &
description="The range parameter for the short range operator (in 1/a0). "// &
"Default is OMEGA from INTERACTION_POTENTIAL. ", &
variants=(/"KP_OMEGA"/), &
default_r_val=0.0_dp, &
repeats=.FALSE.)
CALL section_add_keyword(section, keyword)
Expand All @@ -532,6 +536,7 @@ SUBROUTINE create_hf_ri_section(section)
CALL keyword_create(keyword, __LOCATION__, name="CUTOFF_RADIUS", &
description="The cutoff radius (in Angstroms) for the truncated Coulomb operator. "// &
"Default is CUTOFF_RADIUS from INTERACTION_POTENTIAL. ", &
variants=(/"KP_CUTOFF_RADIUS"/), &
default_r_val=0.0_dp, &
repeats=.FALSE., &
unit_str="angstrom")
Expand Down Expand Up @@ -578,22 +583,6 @@ SUBROUTINE create_hf_ri_section(section)
CALL section_add_keyword(section, keyword)
CALL keyword_release(keyword)

CALL keyword_create(keyword, __LOCATION__, name="KP_RI_EXTENSION_FACTOR", &
variants=s2a("RI_EXTENSION_FACTOR", "RI_EXT", "RI_EXT_FACT", "KP_RI_EXT", &
"KP_RI_EXT_FACT", "KP_RI_BASIS_EXT", "RI_BASIS_EXT"), &
description="In KP-RI-HFX, each atom has its own local RI basis. The RI "// &
"basis is defined by a sphere of radius R centered on the atom, "// &
"whereby all neighboring atoms within that sphere contribute their "// &
"RI basis elements. The radius of that sphere is calculated based "// &
"on the systems' most diffuse orbital PGF (with exponant alpha), such "// &
"that EPS_PGF_ORB * KP_RI_EXTENSION_FACTOR = exp(-alpha*R^2). "// &
"The default value of 1.0 is safe. More accurate results can be "// &
"obtained with a value < 1.0, at greated computational cost.", &
default_r_val=1.0_dp, &
repeats=.FALSE.)
CALL section_add_keyword(section, keyword)
CALL keyword_release(keyword)

CALL keyword_create(keyword, __LOCATION__, name="KP_RI_BUMP_FACTOR", &
variants=s2a("RI_BUMP", "BUMP", "BUMP_FACTOR"), &
description="In KP-RI-HFX, the extended RI basis set has a bump radius. "// &
Expand All @@ -614,6 +603,7 @@ SUBROUTINE create_hf_ri_section(section)
"Coulomb operator cannot be used in periodic systems.", &
usage="OPERATOR {string}", &
repeats=.FALSE., &
variants=(/"KP_RI_METRIC"/), &
default_i_val=0, &
enum_c_vals=s2a("HFX", "COULOMB", "IDENTITY", "TRUNCATED", "SHORTRANGE"), &
enum_desc=s2a("Same as HFX operator", &
Expand Down Expand Up @@ -677,6 +667,7 @@ SUBROUTINE create_hf_ri_section(section)

CALL keyword_create(keyword, __LOCATION__, name="EPS_PGF_ORB", &
description="Sets precision of the integral tensors.", &
variants=(/"KP_EPS_PGF_ORB"/), &
default_r_val=1.0E-5_dp)
CALL section_add_keyword(section, keyword)
CALL keyword_release(keyword)
Expand Down

0 comments on commit bde1f30

Please sign in to comment.