51 integrate_v_rspace_one_center
64#include "./base/base_uses.f90"
70 CHARACTER(len=*),
PARAMETER,
PRIVATE :: moduleN =
'kg_correction'
90 SUBROUTINE kg_ekin_subset(qs_env, ks_matrix, ekin_mol, calc_force, do_kernel, pmat_ext)
93 REAL(kind=
dp),
INTENT(out) :: ekin_mol
94 LOGICAL,
INTENT(IN) :: calc_force, do_kernel
102 CALL get_qs_env(qs_env, kg_env=kg_env, dft_control=dft_control)
103 lrigpw = dft_control%qs_control%lrigpw
106 kg_uses_kinetic_energy_density(kg_env, dft_control%lsd))
THEN
107 cpabort(
"KG LRI/RI embedding with meta-kinetic energy functionals not implemented")
111 CALL kg_ekin_embed_lri(qs_env, kg_env, ks_matrix, ekin_mol, calc_force)
113 CALL kg_ekin_embed(qs_env, kg_env, ks_matrix, ekin_mol, calc_force, &
117 CALL kg_ekin_ri_embed(qs_env, kg_env, ks_matrix, ekin_mol, calc_force, &
120 CALL kg_ekin_atomic(qs_env, ks_matrix, ekin_mol)
124 cpabort(
"Unknown KG embedding method")
135 FUNCTION kg_uses_kinetic_energy_density(kg_env, lsd)
RESULT(res)
137 LOGICAL,
INTENT(IN) :: lsd
144 IF (.NOT.
ASSOCIATED(kg_env%xc_section_kg))
RETURN
150 END FUNCTION kg_uses_kinetic_energy_density
162 SUBROUTINE kg_ekin_embed(qs_env, kg_env, ks_matrix, ekin_mol, calc_force, do_kernel, pmat_ext)
166 REAL(kind=
dp),
INTENT(out) :: ekin_mol
167 LOGICAL,
INTENT(IN) :: calc_force, do_kernel
171 CHARACTER(LEN=*),
PARAMETER :: routinen =
'kg_ekin_embed'
173 CHARACTER(LEN=10) :: basis_type
174 INTEGER :: handle, iounit, ispin, isub, nspins
175 LOGICAL :: gapw, gapw_xc, use_gapw_soft, use_virial
176 REAL(kind=
dp) :: alpha, ekin_imol
177 REAL(kind=
dp),
DIMENSION(3, 3) :: xcvirial
179 TYPE(
dbcsr_p_type),
DIMENSION(:),
POINTER :: density_matrix
184 TYPE(
pw_r3d_rs_type),
DIMENSION(:),
POINTER :: rho1_r, rho_r, tau1_r, vxc_rho, vxc_tau
186 TYPE(
qs_rho_type),
POINTER :: old_rho, rho1, rho1_use, rho1_xc, &
187 rho_struct, rho_use, rho_xc
191 CALL timeset(routinen, handle)
196 NULLIFY (ks_env, dft_control, old_rho, pw_env, rho1_use, rho1_xc, rho_struct, &
197 rho_use, rho_xc, virial, vxc_rho, vxc_tau)
202 dft_control=dft_control, &
205 nspins = dft_control%nspins
206 gapw = dft_control%qs_control%gapw
207 gapw_xc = dft_control%qs_control%gapw_xc
208 use_gapw_soft = gapw .OR. gapw_xc
209 IF (use_gapw_soft)
THEN
210 basis_type =
"ORB_SOFT"
214 use_virial = virial%pv_availability .AND. (.NOT. virial%pv_numer)
215 use_virial = use_virial .AND. calc_force
222 IF (do_kernel .AND. .NOT. calc_force .AND. nspins == 1) alpha = 2.0_dp
224 NULLIFY (auxbas_pw_pool)
225 CALL pw_env_get(pw_env, auxbas_pw_pool=auxbas_pw_pool)
228 CALL qs_rho_get(old_rho, rho_ao=density_matrix)
230 ALLOCATE (rho_struct)
233 CALL qs_rho_set(rho_struct, rho_ao=density_matrix)
234 CALL qs_rho_rebuild(rho_struct, qs_env, rebuild_ao=.false., rebuild_grids=.true.)
238 CALL qs_rho_rebuild(rho_xc, qs_env, rebuild_ao=.true., rebuild_grids=.true.)
246 rho_use => rho_struct
255 IF (
PRESENT(pmat_ext))
THEN
259 CALL qs_rho_rebuild(rho1, qs_env, rebuild_ao=.false., rebuild_grids=.true.)
263 CALL qs_rho_rebuild(rho1_xc, qs_env, rebuild_ao=.true., rebuild_grids=.true.)
274 xc_section => kg_env%xc_section_kg
281 IF (use_virial) virial%pv_xc = 0.0_dp
282 CALL qs_rho_get(rho1_use, rho_r=rho1_r, rho_g=rho1_g, tau_r=tau1_r)
290 xc_section=xc_section, &
291 compute_virial=use_virial, &
292 virial_xc=virial%pv_xc)
295 rho_struct=rho_use, &
296 xc_section=xc_section, &
303 IF (
PRESENT(pmat_ext) .AND. .NOT. do_kernel)
THEN
305 CALL qs_rho_get(rho1_use, rho_r=rho1_r, tau_r=tau1_r)
311 ekin_imol = ekin_imol +
pw_integral_ab(rho1_r(ispin), vxc_rho(ispin))
312 IF (
ASSOCIATED(vxc_tau))
THEN
313 ekin_imol = ekin_imol +
pw_integral_ab(tau1_r(ispin), vxc_tau(ispin))
320 CALL pw_scale(vxc_rho(ispin), alpha*vxc_rho(ispin)%pw_grid%dvol)
324 CALL integrate_v_rspace(v_rspace=vxc_rho(ispin), &
325 pmat=density_matrix(ispin), hmat=ks_matrix(ispin), &
326 qs_env=qs_env, calculate_forces=calc_force, gapw=use_gapw_soft)
327 CALL auxbas_pw_pool%give_back_pw(vxc_rho(ispin))
328 IF (
ASSOCIATED(vxc_tau))
THEN
329 CALL pw_scale(vxc_tau(ispin), alpha*vxc_tau(ispin)%pw_grid%dvol)
330 CALL integrate_v_rspace(v_rspace=vxc_tau(ispin), &
331 pmat=density_matrix(ispin), hmat=ks_matrix(ispin), &
332 qs_env=qs_env, compute_tau=.true., &
333 calculate_forces=calc_force, gapw=use_gapw_soft)
334 CALL auxbas_pw_pool%give_back_pw(vxc_tau(ispin))
338 IF (
ASSOCIATED(vxc_tau))
DEALLOCATE (vxc_tau)
339 ekin_mol = -ekin_imol
340 xcvirial(1:3, 1:3) = 0.0_dp
342 xcvirial(1:3, 1:3) = xcvirial(1:3, 1:3) - virial%pv_xc(1:3, 1:3)
346 DO isub = 1, kg_env%nsubsets
351 task_list_external=kg_env%subset(isub)%task_list, &
352 task_list_external_soft=kg_env%subset(isub)%task_list)
356 task_list_external=kg_env%subset(isub)%task_list)
357 rho_use => rho_struct
360 IF (
PRESENT(pmat_ext))
THEN
363 task_list_external=kg_env%subset(isub)%task_list, &
364 task_list_external_soft=kg_env%subset(isub)%task_list)
368 task_list_external=kg_env%subset(isub)%task_list)
374 NULLIFY (vxc_rho, vxc_tau)
382 IF (use_virial) virial%pv_xc = 0.0_dp
383 CALL qs_rho_get(rho1_use, rho_r=rho1_r, rho_g=rho1_g, tau_r=tau1_r)
391 xc_section=xc_section, &
392 compute_virial=use_virial, &
393 virial_xc=virial%pv_xc)
396 rho_struct=rho_use, &
397 xc_section=xc_section, &
404 IF (
PRESENT(pmat_ext) .AND. .NOT. do_kernel)
THEN
406 CALL qs_rho_get(rho1_use, rho_r=rho1_r, tau_r=tau1_r)
412 ekin_imol = ekin_imol +
pw_integral_ab(rho1_r(ispin), vxc_rho(ispin))
413 IF (
ASSOCIATED(vxc_tau))
THEN
414 ekin_imol = ekin_imol +
pw_integral_ab(tau1_r(ispin), vxc_tau(ispin))
421 CALL pw_scale(vxc_rho(ispin), -alpha*vxc_rho(ispin)%pw_grid%dvol)
423 CALL integrate_v_rspace(v_rspace=vxc_rho(ispin), &
424 pmat=density_matrix(ispin), &
425 hmat=ks_matrix(ispin), &
427 calculate_forces=calc_force, &
428 basis_type=basis_type, &
429 task_list_external=kg_env%subset(isub)%task_list)
431 CALL auxbas_pw_pool%give_back_pw(vxc_rho(ispin))
432 IF (
ASSOCIATED(vxc_tau))
THEN
433 CALL pw_scale(vxc_tau(ispin), -alpha*vxc_tau(ispin)%pw_grid%dvol)
434 CALL integrate_v_rspace(v_rspace=vxc_tau(ispin), &
435 pmat=density_matrix(ispin), &
436 hmat=ks_matrix(ispin), &
438 compute_tau=.true., &
439 calculate_forces=calc_force, &
440 basis_type=basis_type, &
441 task_list_external=kg_env%subset(isub)%task_list)
443 CALL auxbas_pw_pool%give_back_pw(vxc_tau(ispin))
447 IF (
ASSOCIATED(vxc_tau))
DEALLOCATE (vxc_tau)
449 ekin_mol = ekin_mol + ekin_imol
452 xcvirial(1:3, 1:3) = xcvirial(1:3, 1:3) + virial%pv_xc(1:3, 1:3)
458 virial%pv_xc(1:3, 1:3) = xcvirial(1:3, 1:3)
464 DEALLOCATE (rho_struct)
465 IF (
ASSOCIATED(rho_xc))
THEN
469 IF (
PRESENT(pmat_ext))
THEN
473 IF (
ASSOCIATED(rho1_xc))
THEN
479 CALL timestop(handle)
481 END SUBROUTINE kg_ekin_embed
491 SUBROUTINE kg_ekin_embed_lri(qs_env, kg_env, ks_matrix, ekin_mol, calc_force)
495 REAL(kind=
dp),
INTENT(out) :: ekin_mol
496 LOGICAL :: calc_force
498 CHARACTER(LEN=*),
PARAMETER :: routinen =
'kg_ekin_embed_lri'
500 INTEGER :: color, handle, iatom, ikind, imol, &
501 ispin, isub, natom, nkind, nspins
502 INTEGER,
ALLOCATABLE,
DIMENSION(:) :: atomlist
503 LOGICAL :: use_virial
504 REAL(kind=
dp) :: ekin_imol
505 REAL(kind=
dp),
DIMENSION(3, 3) :: xcvirial
507 TYPE(
dbcsr_p_type),
DIMENSION(:),
POINTER :: density_matrix, ksmat
521 CALL timeset(routinen, handle)
523 NULLIFY (vxc_rho, vxc_tau, old_rho, rho_struct, ks_env)
525 CALL get_qs_env(qs_env, dft_control=dft_control)
532 dft_control=dft_control, &
537 nspins = dft_control%nspins
538 use_virial = virial%pv_availability .AND. (.NOT. virial%pv_numer)
539 use_virial = use_virial .AND. calc_force
541 CALL pw_env_get(pw_env, auxbas_pw_pool=auxbas_pw_pool)
544 CALL qs_rho_get(old_rho, rho_ao=density_matrix)
546 ALLOCATE (rho_struct)
549 CALL qs_rho_set(rho_struct, rho_ao=density_matrix)
550 CALL qs_rho_rebuild(rho_struct, qs_env, rebuild_ao=.false., rebuild_grids=.true.)
552 CALL get_qs_env(qs_env, lri_env=lri_env, lri_density=lri_density, nkind=nkind)
553 IF (lri_env%exact_1c_terms)
THEN
554 cpabort(
" KG with LRI and exact one-center terms not implemented")
556 ALLOCATE (atomlist(natom))
558 lri_v_int => lri_density%lri_coefs(ispin)%lri_kinds
560 lri_v_int(ikind)%v_int = 0.0_dp
562 lri_v_int(ikind)%v_dadr = 0.0_dp
563 lri_v_int(ikind)%v_dfdr = 0.0_dp
572 CALL qs_vxc_create(ks_env=ks_env, rho_struct=rho_struct, xc_section=kg_env%xc_section_kg, &
573 vxc_rho=vxc_rho, vxc_tau=vxc_tau, exc=ekin_imol)
574 IF (
ASSOCIATED(vxc_tau))
THEN
575 cpabort(
" KG with meta-kinetic energy functionals not implemented")
578 CALL pw_scale(vxc_rho(ispin), vxc_rho(ispin)%pw_grid%dvol)
579 lri_v_int => lri_density%lri_coefs(ispin)%lri_kinds
580 CALL integrate_v_rspace_one_center(vxc_rho(ispin), qs_env, lri_v_int, calc_force,
"LRI_AUX")
581 CALL auxbas_pw_pool%give_back_pw(vxc_rho(ispin))
584 ekin_mol = -ekin_imol
585 xcvirial(1:3, 1:3) = 0.0_dp
586 IF (use_virial) xcvirial(1:3, 1:3) = xcvirial(1:3, 1:3) - virial%pv_xc(1:3, 1:3)
589 DO isub = 1, kg_env%nsubsets
592 imol = kg_env%atom_to_molecule(iatom)
593 color = kg_env%subset_of_mol(imol)
594 IF (color == isub) atomlist(iatom) = 1
600 CALL qs_vxc_create(ks_env=ks_env, rho_struct=rho_struct, xc_section=kg_env%xc_section_kg, &
601 vxc_rho=vxc_rho, vxc_tau=vxc_tau, exc=ekin_imol)
602 ekin_mol = ekin_mol + ekin_imol
605 CALL pw_scale(vxc_rho(ispin), -vxc_rho(ispin)%pw_grid%dvol)
606 lri_v_int => lri_density%lri_coefs(ispin)%lri_kinds
607 CALL integrate_v_rspace_one_center(vxc_rho(ispin), qs_env, &
608 lri_v_int, calc_force, &
609 "LRI_AUX", atomlist=atomlist)
611 CALL auxbas_pw_pool%give_back_pw(vxc_rho(ispin))
616 xcvirial(1:3, 1:3) = xcvirial(1:3, 1:3) + virial%pv_xc(1:3, 1:3)
622 virial%pv_xc(1:3, 1:3) = xcvirial(1:3, 1:3)
625 CALL get_qs_env(qs_env, atomic_kind_set=atomic_kind_set)
628 lri_v_int => lri_density%lri_coefs(ispin)%lri_kinds
630 CALL para_env%sum(lri_v_int(ikind)%v_int)
632 ksmat(1)%matrix => ks_matrix(ispin)%matrix
636 pmat(1:nspins, 1:1) => density_matrix(1:nspins)
639 DEALLOCATE (atomlist, ksmat)
644 DEALLOCATE (rho_struct)
646 CALL timestop(handle)
648 END SUBROUTINE kg_ekin_embed_lri
660 SUBROUTINE kg_ekin_ri_embed(qs_env, kg_env, ks_matrix, ekin_mol, calc_force, &
665 REAL(kind=
dp),
INTENT(out) :: ekin_mol
666 LOGICAL :: calc_force, do_kernel
670 CHARACTER(LEN=*),
PARAMETER :: routinen =
'kg_ekin_ri_embed'
672 INTEGER :: color, handle, iatom, ikind, imol, &
673 iounit, ispin, isub, natom, nkind, &
675 INTEGER,
ALLOCATABLE,
DIMENSION(:) :: atomlist
676 INTEGER,
DIMENSION(:, :, :),
POINTER :: cell_to_index
677 LOGICAL :: use_virial
678 REAL(kind=
dp) :: alpha, ekin_imol
679 REAL(kind=
dp),
DIMENSION(3, 3) :: xcvirial
682 TYPE(
dbcsr_p_type),
DIMENSION(:),
POINTER :: density_matrix, ksmat
692 TYPE(
pw_r3d_rs_type),
DIMENSION(:),
POINTER :: rho1_r, tau1_r, vxc_rho, vxc_tau
694 TYPE(
qs_rho_type),
POINTER :: rho, rho1, rho_struct
698 CALL timeset(routinen, handle)
708 dft_control=dft_control, &
713 nspins = dft_control%nspins
714 use_virial = virial%pv_availability .AND. (.NOT. virial%pv_numer)
715 use_virial = use_virial .AND. calc_force
722 IF (do_kernel .AND. .NOT. calc_force .AND. nspins == 1) alpha = 2.0_dp
724 CALL pw_env_get(pw_env, auxbas_pw_pool=auxbas_pw_pool)
730 ALLOCATE (rho_struct)
733 CALL qs_rho_set(rho_struct, rho_ao=density_matrix)
734 CALL qs_rho_rebuild(rho_struct, qs_env, rebuild_ao=.false., rebuild_grids=.true.)
736 CALL get_qs_env(qs_env, atomic_kind_set=atomic_kind_set)
737 ALLOCATE (cell_to_index(1, 1, 1))
738 cell_to_index(1, 1, 1) = 1
739 lri_env => kg_env%lri_env
740 lri_density => kg_env%lri_density
743 ALLOCATE (pmat(nspins, 1))
745 pmat(ispin, 1)%matrix => density_matrix(ispin)%matrix
748 rho_struct, atomic_kind_set, para_env, response_density=.false.)
749 kg_env%lri_density => lri_density
753 IF (
PRESENT(pmat_ext))
THEN
761 CALL qs_rho_rebuild(rho1, qs_env, rebuild_ao=.false., rebuild_grids=.true.)
763 lri_env1 => kg_env%lri_env1
764 lri_rho1 => kg_env%lri_rho1
767 ALLOCATE (pmat(nspins, 1))
769 pmat(ispin, 1)%matrix => pmat_ext(ispin)%matrix
772 rho1, atomic_kind_set, para_env, response_density=.false.)
773 kg_env%lri_rho1 => lri_rho1
780 xc_section => kg_env%xc_section_kg
784 NULLIFY (vxc_rho, vxc_tau)
790 CALL qs_rho_get(rho1, rho_r=rho1_r, rho_g=rho1_g, tau_r=tau1_r)
798 xc_section=xc_section)
802 rho_struct=rho_struct, &
803 xc_section=xc_section, &
810 IF (
ASSOCIATED(vxc_tau))
THEN
811 cpabort(
" KG with meta-kinetic energy functionals not implemented")
815 CALL pw_scale(vxc_rho(ispin), alpha*vxc_rho(ispin)%pw_grid%dvol)
817 IF (
PRESENT(pmat_ext) .AND. .NOT. do_kernel)
THEN
819 lri_v_int => lri_rho1%lri_coefs(ispin)%lri_kinds
822 lri_v_int => lri_density%lri_coefs(ispin)%lri_kinds
824 CALL integrate_v_rspace_one_center(vxc_rho(ispin), qs_env, lri_v_int, calc_force,
"LRI_AUX")
825 CALL auxbas_pw_pool%give_back_pw(vxc_rho(ispin))
829 ekin_mol = -ekin_imol
830 xcvirial(1:3, 1:3) = 0.0_dp
831 IF (use_virial) xcvirial(1:3, 1:3) = xcvirial(1:3, 1:3) - virial%pv_xc(1:3, 1:3)
834 ALLOCATE (atomlist(natom))
835 DO isub = 1, kg_env%nsubsets
838 imol = kg_env%atom_to_molecule(iatom)
839 color = kg_env%subset_of_mol(imol)
840 IF (color == isub) atomlist(iatom) = 1
846 IF (
PRESENT(pmat_ext))
THEN
853 NULLIFY (vxc_rho, vxc_tau)
858 CALL qs_rho_get(rho1, rho_r=rho1_r, rho_g=rho1_g, tau_r=tau1_r)
866 xc_section=xc_section)
871 rho_struct=rho_struct, &
872 xc_section=xc_section, &
877 ekin_mol = ekin_mol + ekin_imol
880 CALL pw_scale(vxc_rho(ispin), -alpha*vxc_rho(ispin)%pw_grid%dvol)
882 IF (
PRESENT(pmat_ext) .AND. .NOT. do_kernel)
THEN
884 lri_v_int => lri_rho1%lri_coefs(ispin)%lri_kinds
887 lri_v_int => lri_density%lri_coefs(ispin)%lri_kinds
890 CALL integrate_v_rspace_one_center(vxc_rho(ispin), qs_env, &
891 lri_v_int, calc_force, &
892 "LRI_AUX", atomlist=atomlist)
894 CALL auxbas_pw_pool%give_back_pw(vxc_rho(ispin))
899 xcvirial(1:3, 1:3) = xcvirial(1:3, 1:3) + virial%pv_xc(1:3, 1:3)
905 virial%pv_xc(1:3, 1:3) = xcvirial(1:3, 1:3)
910 ksmat(1)%matrix => ks_matrix(ispin)%matrix
911 IF (
PRESENT(pmat_ext) .AND. .NOT. do_kernel)
THEN
913 lri_v_int => lri_rho1%lri_coefs(ispin)%lri_kinds
915 CALL para_env%sum(lri_v_int(ikind)%v_int)
920 lri_v_int => lri_density%lri_coefs(ispin)%lri_kinds
922 CALL para_env%sum(lri_v_int(ikind)%v_int)
931 ALLOCATE (pmat(nspins, 1))
933 IF (
PRESENT(pmat_ext) .AND. .NOT. do_kernel)
THEN
936 pmat(ispin, 1)%matrix => pmat_ext(ispin)%matrix
942 pmat(ispin, 1)%matrix => density_matrix(ispin)%matrix
950 DEALLOCATE (atomlist, ksmat)
955 DEALLOCATE (rho_struct)
956 IF (
PRESENT(pmat_ext))
THEN
961 DEALLOCATE (cell_to_index)
963 CALL timestop(handle)
965 END SUBROUTINE kg_ekin_ri_embed
973 SUBROUTINE kg_ekin_atomic(qs_env, ks_matrix, ekin_mol)
976 REAL(kind=
dp),
INTENT(out) :: ekin_mol
978 CHARACTER(LEN=*),
PARAMETER :: routinen =
'kg_ekin_atomic'
980 INTEGER :: handle, ispin, nspins
981 TYPE(
dbcsr_p_type),
DIMENSION(:),
POINTER :: density_matrix, tnadd_matrix
985 NULLIFY (rho, kg_env, density_matrix, tnadd_matrix)
987 CALL timeset(routinen, handle)
988 CALL get_qs_env(qs_env, kg_env=kg_env, rho=rho)
990 nspins =
SIZE(ks_matrix)
994 tnadd_matrix => kg_env%tnadd_mat
998 CALL dbcsr_dot(tnadd_matrix(1)%matrix, density_matrix(ispin)%matrix, ekin_mol)
999 CALL dbcsr_add(ks_matrix(ispin)%matrix, tnadd_matrix(1)%matrix, &
1000 alpha_scalar=1.0_dp, beta_scalar=1.0_dp)
1003 ekin_mol = -ekin_mol
1005 CALL timestop(handle)
1007 END SUBROUTINE kg_ekin_atomic
Define the atomic kind types and their sub types.
Defines control structures, which contain the parameters and the settings for the DFT-based calculati...
subroutine, public dbcsr_add(matrix_a, matrix_b, alpha_scalar, beta_scalar)
...
subroutine, public dbcsr_dot(matrix_a, matrix_b, trace)
Computes the dot product of two matrices, also known as the trace of their matrix product.
various routines to log and control the output. The idea is that decisions about where to log should ...
recursive integer function, public cp_logger_get_default_unit_nr(logger, local, skip_not_ionode)
asks the default unit number of the given logger. try to use cp_logger_get_unit_nr
type(cp_logger_type) function, pointer, public cp_get_default_logger()
returns the default logger
Routines used for Harris functional Kohn-Sham calculation.
subroutine, public create_kernel(qs_env, vxc, vxc_tau, rho, rho1_r, rho1_g, tau1_r, xc_section, compute_virial, virial_xc)
Creation of second derivative xc-potential.
Routines for a Kim-Gordon-like partitioning into molecular subunits.
subroutine, public kg_ekin_subset(qs_env, ks_matrix, ekin_mol, calc_force, do_kernel, pmat_ext)
Calculates the subsystem Hohenberg-Kohn kinetic energy and the forces.
Types needed for a Kim-Gordon-like partitioning into molecular subunits.
Defines the basic variable types.
integer, parameter, public dp
Calculates integral matrices for LRIGPW method lri : local resolution of the identity.
subroutine, public lri_kg_rho_update(rho_struct, qs_env, lri_env, lri_density, atomlist)
...
subroutine, public calculate_lri_densities(lri_env, lri_density, qs_env, pmatrix, cell_to_index, lri_rho_struct, atomic_kind_set, para_env, response_density)
performs the fitting of the density and distributes the fitted density on the grid
contains the types and subroutines for dealing with the lri_env lri : local resolution of the identit...
Calculates forces for LRIGPW method lri : local resolution of the identity.
subroutine, public calculate_lri_forces(lri_env, lri_density, qs_env, pmatrix, atomic_kind_set)
calculates the lri forces
routines that build the Kohn-Sham matrix for the LRIGPW and xc parts
subroutine, public calculate_lri_ks_matrix(lri_env, lri_v_int, h_matrix, atomic_kind_set, cell_to_index)
update of LRIGPW KS matrix
Interface to the message passing library MPI.
container for various plainwaves related things
subroutine, public pw_env_get(pw_env, pw_pools, cube_info, gridlevel_info, auxbas_pw_pool, auxbas_grid, auxbas_rs_desc, auxbas_rs_grid, rs_descs, rs_grids, xc_pw_pool, vdw_pw_pool, poisson_env, interp_section)
returns the various attributes of the pw env
Manages a pool of grids (to be used for example as tmp objects), but can also be used to instantiate ...
subroutine, public get_qs_env(qs_env, atomic_kind_set, qs_kind_set, cell, super_cell, cell_ref, use_ref_cell, kpoints, dft_control, mos, sab_orb, sab_all, qmmm, qmmm_periodic, mimic, sac_ae, sac_ppl, sac_lri, sap_ppnl, sab_vdw, sab_scp, sap_oce, sab_lrc, sab_se, sab_xtbe, sab_tbe, sab_core, sab_xb, sab_xtb_pp, sab_xtb_nonbond, sab_almo, sab_kp, sab_kp_nosym, sab_cneo, particle_set, energy, force, matrix_h, matrix_h_im, matrix_ks, matrix_ks_im, matrix_vxc, run_rtp, rtp, matrix_h_kp, matrix_h_im_kp, matrix_ks_kp, matrix_ks_im_kp, matrix_vxc_kp, kinetic_kp, matrix_s_kp, matrix_w_kp, matrix_s_ri_aux_kp, matrix_s, matrix_s_ri_aux, matrix_w, matrix_p_mp2, matrix_p_mp2_admm, matrix_vhxc, rho, rho_xc, pw_env, ewald_env, ewald_pw, active_space, mpools, input, para_env, blacs_env, scf_control, rel_control, kinetic, qs_charges, vppl, xcint_weights, rho_core, rho_nlcc, rho_nlcc_g, ks_env, ks_qmmm_env, wf_history, scf_env, local_particles, local_molecules, distribution_2d, dbcsr_dist, molecule_kind_set, molecule_set, subsys, cp_subsys, oce, local_rho_set, rho_atom_set, task_list, task_list_soft, rho0_atom_set, rho0_mpole, rhoz_set, rhoz_cneo_set, ecoul_1c, rho0_s_rs, rho0_s_gs, rhoz_cneo_s_rs, rhoz_cneo_s_gs, do_kpoints, has_unit_metric, requires_mo_derivs, mo_derivs, mo_loc_history, nkind, natom, nelectron_total, nelectron_spin, efield, neighbor_list_id, linres_control, xas_env, virial, cp_ddapc_env, cp_ddapc_ewald, outer_scf_history, outer_scf_ihistory, x_data, et_coupling, dftb_potential, results, se_taper, se_store_int_env, se_nddo_mpole, se_nonbond_env, admm_env, lri_env, lri_density, exstate_env, ec_env, harris_env, dispersion_env, gcp_env, vee, rho_external, external_vxc, mask, mp2_env, bs_env, kg_env, wanniercentres, atprop, ls_scf_env, do_transport, transport_env, v_hartree_rspace, s_mstruct_changed, rho_changed, potential_changed, forces_up_to_date, mscfg_env, almo_scf_env, gradient_history, variable_history, embed_pot, spin_embed_pot, polar_env, mos_last_converged, eeq, rhs, do_rixs, tb_tblite)
Get the QUICKSTEP environment.
Integrate single or product functions over a potential on a RS grid.
methods of the rho structure (defined in qs_rho_types)
subroutine, public qs_rho_update_rho(rho_struct, qs_env, rho_xc_external, local_rho_set, task_list_external, task_list_external_soft, pw_env_external, para_env_external)
updates rho_r and rho_g to the rhorho_ao. if use_kinetic_energy_density also computes tau_r and tau_g...
subroutine, public qs_rho_rebuild(rho, qs_env, rebuild_ao, rebuild_grids, admm, pw_env_external)
rebuilds rho (if necessary allocating and initializing it)
superstucture that hold various representations of the density and keeps track of which ones are vali...
subroutine, public qs_rho_set(rho_struct, rho_ao, rho_ao_im, rho_ao_kp, rho_ao_im_kp, rho_r, drho_r, rho_g, drho_g, tau_r, tau_g, rho_r_valid, drho_r_valid, rho_g_valid, drho_g_valid, tau_r_valid, tau_g_valid, tot_rho_r, tot_rho_g, rho_r_sccs, soft_valid, complex_rho_ao)
...
subroutine, public qs_rho_get(rho_struct, rho_ao, rho_ao_im, rho_ao_kp, rho_ao_im_kp, rho_r, drho_r, rho_g, drho_g, tau_r, tau_g, rho_r_valid, drho_r_valid, rho_g_valid, drho_g_valid, tau_r_valid, tau_g_valid, tot_rho_r, tot_rho_g, rho_r_sccs, soft_valid, complex_rho_ao)
returns info about the density described by this object. If some representation is not available an e...
subroutine, public qs_rho_unset_rho_ao(rho_struct)
Unsets the rho_ao / rho_ao_kp field without calling kpoint_transitional_release().
subroutine, public qs_rho_create(rho)
Allocates a new instance of rho.
subroutine, public qs_rho_release(rho_struct)
releases a rho_struct by decreasing the reference count by one and deallocating if it reaches 0 (to b...
subroutine, public qs_vxc_create(ks_env, rho_struct, xc_section, vxc_rho, vxc_tau, exc, just_energy, edisp, dispersion_env, adiabatic_rescale_factor, pw_env_external, native_skala_atom_force)
calculates and allocates the xc potential, already reducing it to the dependence on rho and the one o...
Exchange and Correlation functional calculations.
logical function, public xc_uses_kinetic_energy_density(xc_fun_section, lsd)
...
Provides all information about an atomic kind.
type of a logger, at the moment it contains just a print level starting at which level it should be l...
Contains all the info needed for KG runs...
stores all the informations relevant to an mpi environment
contained for different pw related things
Manages a pool of grids (to be used for example as tmp objects), but can also be used to instantiate ...
calculation environment to calculate the ks matrix, holds all the needed vars. assumes that the core ...
keeps the density in various representations, keeping track of which ones are valid.