Skip to content
Permalink
Browse files

Reimplement missing TDDFT features:

  * independent adiabatic kernel xc-functional;

  * limit the number of unoccupied states.
  • Loading branch information...
schulkov committed Apr 10, 2019
1 parent e3a505f commit b83bb4e656782061bf698d50d583c229aa261143
Showing with 202 additions and 77 deletions.
  1. +2 −0 src/cp_control_types.F
  2. +11 −1 src/cp_control_utils.F
  3. +14 −1 src/input_cp2k_properties_dft.F
  4. +2 −1 src/qs_scf_post_gpw.F
  5. +173 −74 src/qs_tddfpt2_methods.F
@@ -395,6 +395,8 @@ MODULE cp_control_types
INTEGER :: niters
!> maximal number of Krylov space vectors
INTEGER :: nkvs
!> number of unoccupied (virtual) molecular orbitals to consider
INTEGER :: nlumo
!> minimal number of MPI processes to be used per excited state
INTEGER :: nprocs
!> target accuracy
@@ -40,6 +40,7 @@ MODULE cp_control_utils
sccs_derivative_cd7, sccs_derivative_fft, sccs_fattebert_gygi, sic_ad, sic_eo, &
sic_list_all, sic_list_unpaired, sic_mauri_spz, sic_mauri_us, sic_none, slater, &
tddfpt_excitations, use_mom_ref_user, xas_dip_len
USE input_cp2k_check, ONLY: xc_functionals_expand
USE input_cp2k_dft, ONLY: create_dft_section,&
create_qs_section
USE input_enumeration_types, ONLY: enum_i2c,&
@@ -1170,7 +1171,8 @@ SUBROUTINE read_tddfpt2_control(t_control, t_section, qs_control)
INTEGER :: handle
INTEGER, ALLOCATABLE, DIMENSION(:) :: inds
LOGICAL :: explicit, multigrid_set
TYPE(section_vals_type), POINTER :: dipole_section, mgrid_section
TYPE(section_vals_type), POINTER :: dipole_section, mgrid_section, xc_func, &
xc_section

CALL timeset(routineN, handle)

@@ -1179,6 +1181,7 @@ SUBROUTINE read_tddfpt2_control(t_control, t_section, qs_control)
CALL section_vals_val_get(t_section, "NSTATES", i_val=t_control%nstates)
CALL section_vals_val_get(t_section, "MAX_ITER", i_val=t_control%niters)
CALL section_vals_val_get(t_section, "MAX_KV", i_val=t_control%nkvs)
CALL section_vals_val_get(t_section, "NLUMO", i_val=t_control%nlumo)
CALL section_vals_val_get(t_section, "NPROC_STATE", i_val=t_control%nprocs)

CALL section_vals_val_get(t_section, "CONVERGENCE", r_val=t_control%conv)
@@ -1267,6 +1270,13 @@ SUBROUTINE read_tddfpt2_control(t_control, t_section, qs_control)
END IF
END IF

! expand XC subsection (if given explicitly)
xc_section => section_vals_get_subs_vals(t_section, "XC")
xc_func => section_vals_get_subs_vals(xc_section, "XC_FUNCTIONAL")
CALL section_vals_get(xc_func, explicit=explicit)
IF (explicit) &
CALL xc_functionals_expand(xc_func, xc_section)

CALL timestop(handle)
END SUBROUTINE read_tddfpt2_control

@@ -1116,7 +1116,7 @@ SUBROUTINE create_tddfpt2_section(section)
description="Parameters needed to set up the Time-Dependent Density Functional Perturbation Theory. "// &
"Current implementation works for hybrid functionals. "// &
"Can be used with Gaussian and Plane Waves (GPW) method only.", &
n_keywords=15, n_subsections=3, repeats=.FALSE., &
n_keywords=12, n_subsections=4, repeats=.FALSE., &
citations=(/Iannuzzi2005/))

NULLIFY (keyword, print_key, subsection)
@@ -1152,6 +1152,14 @@ SUBROUTINE create_tddfpt2_section(section)
CALL section_add_keyword(section, keyword)
CALL keyword_release(keyword)

CALL keyword_create(keyword, name="NLUMO", &
description="Number of unoccupied orbitals to consider. "// &
" Default is to use all unoccupied orbitals (-1).", &
n_var=1, type_of_var=integer_t, &
default_i_val=-1)
CALL section_add_keyword(section, keyword)
CALL keyword_release(keyword)

CALL keyword_create(keyword, name="NPROC_STATE", &
description="Number of MPI processes to be used per excited state. "// &
" Default is to use all processors (0).", &
@@ -1252,6 +1260,11 @@ SUBROUTINE create_tddfpt2_section(section)
CALL section_add_subsection(section, subsection)
CALL section_release(subsection)

! kernel XC functional
CALL create_xc_section(subsection)
CALL section_add_subsection(section, subsection)
CALL section_release(subsection)

! MGRID subsection
CALL create_mgrid_section(subsection, create_subsections=.FALSE.)
CALL section_add_subsection(section, subsection)
@@ -206,6 +206,7 @@ MODULE qs_scf_post_gpw
qs_scf_post_moments, &
write_available_results, &
write_mo_free_results
PUBLIC :: make_lumo

! **************************************************************************************************

@@ -742,7 +743,7 @@ SUBROUTINE make_lumo(qs_env, scf_env, unoccupied_orbs, unoccupied_evals, nlumo,
TYPE(qs_scf_env_type), POINTER :: scf_env
TYPE(cp_fm_p_type), DIMENSION(:), POINTER :: unoccupied_orbs
TYPE(cp_1d_r_p_type), DIMENSION(:), POINTER :: unoccupied_evals
INTEGER :: nlumo
INTEGER, INTENT(IN) :: nlumo
INTEGER, INTENT(OUT) :: nlumos

CHARACTER(len=*), PARAMETER :: routineN = 'make_lumo', routineP = moduleN//':'//routineN
Oops, something went wrong.

0 comments on commit b83bb4e

Please sign in to comment.
You can’t perform that action at this time.