21 dbcsr_type_antisymmetric, dbcsr_type_symmetric
64#include "./base/base_uses.f90"
69 LOGICAL,
PRIVATE,
PARAMETER :: debug_this_module = .true.
70 CHARACTER(len=*),
PARAMETER,
PRIVATE :: moduleN =
'qs_rho_methods'
97 SUBROUTINE qs_rho_rebuild(rho, qs_env, rebuild_ao, rebuild_grids, admm, pw_env_external)
100 LOGICAL,
INTENT(in),
OPTIONAL :: rebuild_ao, rebuild_grids, admm
101 TYPE(
pw_env_type),
OPTIONAL,
POINTER :: pw_env_external
103 CHARACTER(LEN=*),
PARAMETER :: routinen =
'qs_rho_rebuild'
105 CHARACTER(LEN=default_string_length) :: headline
106 INTEGER :: handle, i, ic, j, nimg, nspins
107 LOGICAL :: do_kpoints, my_admm, my_rebuild_ao, &
108 my_rebuild_grids, rho_ao_is_complex
109 REAL(kind=
dp),
DIMENSION(:),
POINTER :: tot_rho_r
110 TYPE(
dbcsr_p_type),
DIMENSION(:, :),
POINTER :: matrix_s_kp, rho_ao_im_kp, rho_ao_kp
111 TYPE(
dbcsr_type),
POINTER :: refmatrix, tmatrix
124 CALL timeset(routinen, handle)
126 NULLIFY (pw_env, auxbas_pw_pool, matrix_s_kp, dft_control)
127 NULLIFY (tot_rho_r, rho_ao_kp, rho_r, rho_g, drho_r, drho_g, tau_r, tau_g, rho_ao_im_kp)
130 my_rebuild_ao = .true.
131 my_rebuild_grids = .true.
133 IF (
PRESENT(rebuild_ao)) my_rebuild_ao = rebuild_ao
134 IF (
PRESENT(rebuild_grids)) my_rebuild_grids = rebuild_grids
135 IF (
PRESENT(admm)) my_admm = admm
139 do_kpoints=do_kpoints, &
141 dft_control=dft_control)
142 IF (
PRESENT(pw_env_external)) &
143 pw_env => pw_env_external
145 nimg = dft_control%nimages
148 CALL get_admm_env(qs_env%admm_env, sab_aux_fit=sab_orb, matrix_s_aux_fit_kp=matrix_s_kp)
150 CALL get_qs_env(qs_env, matrix_s_kp=matrix_s_kp)
158 refmatrix => matrix_s_kp(1, 1)%matrix
160 CALL pw_env_get(pw_env, auxbas_pw_pool=auxbas_pw_pool)
161 nspins = dft_control%nspins
164 tot_rho_r=tot_rho_r, &
165 rho_ao_kp=rho_ao_kp, &
166 rho_ao_im_kp=rho_ao_im_kp, &
173 rho_r_sccs=rho_r_sccs, &
174 complex_rho_ao=rho_ao_is_complex)
176 IF (.NOT.
ASSOCIATED(tot_rho_r))
THEN
177 ALLOCATE (tot_rho_r(nspins))
183 IF (my_rebuild_ao .OR. (.NOT.
ASSOCIATED(rho_ao_kp)))
THEN
184 IF (
ASSOCIATED(rho_ao_kp)) &
193 headline =
"DENSITY MATRIX FOR ALPHA SPIN"
195 headline =
"DENSITY MATRIX FOR BETA SPIN"
198 headline =
"DENSITY MATRIX"
200 ALLOCATE (rho_ao_kp(i, ic)%matrix)
201 tmatrix => rho_ao_kp(i, ic)%matrix
202 CALL dbcsr_create(matrix=tmatrix, template=refmatrix, name=trim(headline), &
203 matrix_type=dbcsr_type_symmetric)
208 IF (rho_ao_is_complex)
THEN
209 IF (
ASSOCIATED(rho_ao_im_kp))
THEN
213 CALL qs_rho_set(rho, rho_ao_im_kp=rho_ao_im_kp)
218 headline =
"IMAGINARY PART OF DENSITY MATRIX FOR ALPHA SPIN"
220 headline =
"IMAGINARY PART OF DENSITY MATRIX FOR BETA SPIN"
223 headline =
"IMAGINARY PART OF DENSITY MATRIX"
225 ALLOCATE (rho_ao_im_kp(i, ic)%matrix)
226 tmatrix => rho_ao_im_kp(i, ic)%matrix
227 CALL dbcsr_create(matrix=tmatrix, template=refmatrix, name=trim(headline), &
228 matrix_type=dbcsr_type_antisymmetric)
237 IF (my_rebuild_grids .OR. .NOT.
ASSOCIATED(rho_r))
THEN
238 IF (
ASSOCIATED(rho_r))
THEN
239 DO i = 1,
SIZE(rho_r)
240 CALL rho_r(i)%release()
244 ALLOCATE (rho_r(nspins))
247 CALL auxbas_pw_pool%create_pw(rho_r(i))
252 IF (my_rebuild_grids .OR. .NOT.
ASSOCIATED(rho_g))
THEN
253 IF (
ASSOCIATED(rho_g))
THEN
254 DO i = 1,
SIZE(rho_g)
255 CALL rho_g(i)%release()
259 ALLOCATE (rho_g(nspins))
262 CALL auxbas_pw_pool%create_pw(rho_g(i))
267 IF (dft_control%do_sccs)
THEN
268 IF (my_rebuild_grids .OR. (.NOT.
ASSOCIATED(rho_r_sccs)))
THEN
269 IF (
ASSOCIATED(rho_r_sccs))
THEN
270 CALL rho_r_sccs%release()
271 DEALLOCATE (rho_r_sccs)
273 ALLOCATE (rho_r_sccs)
275 CALL auxbas_pw_pool%create_pw(rho_r_sccs)
281 IF (dft_control%drho_by_collocation)
THEN
283 IF (my_rebuild_grids .OR. .NOT.
ASSOCIATED(drho_r))
THEN
284 IF (
ASSOCIATED(drho_r))
THEN
285 DO j = 1,
SIZE(drho_r, 2)
286 DO i = 1,
SIZE(drho_r, 1)
287 CALL drho_r(i, j)%release()
292 ALLOCATE (drho_r(3, nspins))
296 CALL auxbas_pw_pool%create_pw(drho_r(i, j))
301 IF (my_rebuild_grids .OR. .NOT.
ASSOCIATED(drho_g))
THEN
302 IF (
ASSOCIATED(drho_g))
THEN
303 DO j = 1,
SIZE(drho_g, 2)
304 DO i = 1,
SIZE(drho_r, 1)
305 CALL drho_g(i, j)%release()
310 ALLOCATE (drho_g(3, nspins))
314 CALL auxbas_pw_pool%create_pw(drho_g(i, j))
321 IF (dft_control%use_kinetic_energy_density)
THEN
323 IF (my_rebuild_grids .OR. .NOT.
ASSOCIATED(tau_r))
THEN
324 IF (
ASSOCIATED(tau_r))
THEN
325 DO i = 1,
SIZE(tau_r)
326 CALL tau_r(i)%release()
330 ALLOCATE (tau_r(nspins))
333 CALL auxbas_pw_pool%create_pw(tau_r(i))
338 IF (my_rebuild_grids .OR. .NOT.
ASSOCIATED(tau_g))
THEN
339 IF (
ASSOCIATED(tau_g))
THEN
340 DO i = 1,
SIZE(tau_g)
341 CALL tau_g(i)%release()
345 ALLOCATE (tau_g(nspins))
348 CALL auxbas_pw_pool%create_pw(tau_g(i))
353 CALL timestop(handle)
375 task_list_external, task_list_external_soft, &
376 pw_env_external, para_env_external)
379 TYPE(
qs_rho_type),
OPTIONAL,
POINTER :: rho_xc_external
382 task_list_external_soft
383 TYPE(
pw_env_type),
OPTIONAL,
POINTER :: pw_env_external
386 INTEGER,
DIMENSION(:, :, :),
POINTER :: cell_to_index
389 TYPE(
dbcsr_p_type),
DIMENSION(:, :),
POINTER :: rho_ao_kp
398 CALL get_qs_env(qs_env, dft_control=dft_control, &
399 atomic_kind_set=atomic_kind_set, &
401 IF (
PRESENT(para_env_external)) para_env => para_env_external
403 IF (qs_env%harris_method)
THEN
404 CALL get_qs_env(qs_env, harris_env=harris_env)
406 CALL qs_rho_set(rho_struct, rho_r_valid=.true., rho_g_valid=.true.)
408 ELSEIF (dft_control%qs_control%semi_empirical .OR. &
409 dft_control%qs_control%dftb .OR. dft_control%qs_control%xtb)
THEN
411 CALL qs_rho_set(rho_struct, rho_r_valid=.false., rho_g_valid=.false.)
413 ELSEIF (dft_control%qs_control%lrigpw)
THEN
414 cpassert(.NOT. dft_control%use_kinetic_energy_density)
415 cpassert(.NOT. dft_control%drho_by_collocation)
416 CALL qs_rho_get(rho_struct, rho_ao_kp=rho_ao_kp)
418 CALL get_ks_env(ks_env=ks_env, kpoints=kpoints)
420 CALL get_qs_env(qs_env, lri_env=lri_env, lri_density=lri_density)
422 lri_rho_struct=rho_struct, &
423 atomic_kind_set=atomic_kind_set, &
425 response_density=.false.)
426 CALL set_qs_env(qs_env, lri_density=lri_density)
427 CALL qs_rho_set(rho_struct, rho_r_valid=.true., rho_g_valid=.true.)
429 ELSEIF (dft_control%qs_control%rigpw)
THEN
430 cpassert(.NOT. dft_control%use_kinetic_energy_density)
431 cpassert(.NOT. dft_control%drho_by_collocation)
435 lri_rho_struct=rho_struct, &
436 atomic_kind_set=atomic_kind_set, &
438 CALL qs_rho_set(rho_struct, rho_r_valid=.true., rho_g_valid=.true.)
441 CALL qs_rho_update_rho_low(rho_struct=rho_struct, qs_env=qs_env, &
442 rho_xc_external=rho_xc_external, &
443 local_rho_set=local_rho_set, &
444 task_list_external=task_list_external, &
445 task_list_external_soft=task_list_external_soft, &
446 pw_env_external=pw_env_external, &
447 para_env_external=para_env_external)
469 SUBROUTINE qs_rho_update_rho_low(rho_struct, qs_env, rho_xc_external, &
470 local_rho_set, pw_env_external, &
471 task_list_external, task_list_external_soft, &
475 TYPE(
qs_rho_type),
OPTIONAL,
POINTER :: rho_xc_external
477 TYPE(
pw_env_type),
OPTIONAL,
POINTER :: pw_env_external
479 task_list_external_soft
482 CHARACTER(len=*),
PARAMETER :: routinen =
'qs_rho_update_rho_low'
484 INTEGER :: handle, img, ispin, nimg, nspins
485 LOGICAL :: gapw, gapw_xc
487 REAL(kind=
dp),
DIMENSION(:),
POINTER :: tot_rho_r, tot_rho_r_xc
490 TYPE(
dbcsr_p_type),
DIMENSION(:, :),
POINTER :: rho_ao_kp, rho_xc_ao
496 TYPE(
pw_c1d_gs_type),
DIMENSION(:),
POINTER :: rho_g, rho_xc_g, tau_g, tau_xc_g
497 TYPE(
pw_c1d_gs_type),
DIMENSION(:, :),
POINTER :: drho_g, drho_xc_g
499 TYPE(
pw_r3d_rs_type),
DIMENSION(:),
POINTER :: rho_r, rho_xc_r, tau_r, tau_xc_r
500 TYPE(
pw_r3d_rs_type),
DIMENSION(:, :),
POINTER :: drho_r, drho_xc_r
501 TYPE(
qs_kind_type),
DIMENSION(:),
POINTER :: qs_kind_set
507 CALL timeset(routinen, handle)
509 NULLIFY (dft_control, rho_xc, ks_env, rho_ao, rho_r, rho_g, drho_r, drho_g, tau_r, tau_g)
510 NULLIFY (rho_xc_ao, rho_xc_g, rho_xc_r, drho_xc_g, tau_xc_r, tau_xc_g, tot_rho_r, tot_rho_r_xc)
511 NULLIFY (para_env, pw_env, atomic_kind_set)
515 dft_control=dft_control, &
516 atomic_kind_set=atomic_kind_set)
521 tot_rho_r=tot_rho_r, &
527 CALL get_qs_env(qs_env, task_list=task_list, &
528 para_env=para_env, pw_env=pw_env)
529 IF (
PRESENT(pw_env_external)) pw_env => pw_env_external
530 IF (
PRESENT(task_list_external)) task_list => task_list_external
531 IF (
PRESENT(para_env_external)) para_env => para_env_external
533 nspins = dft_control%nspins
534 nimg = dft_control%nimages
535 gapw = dft_control%qs_control%gapw
536 gapw_xc = dft_control%qs_control%gapw_xc
538 CALL qs_rho_get(rho_struct, rho_ao_kp=rho_ao_kp)
540 rho_ao => rho_ao_kp(ispin, :)
543 rho_gspace=rho_g(ispin), &
544 total_rho=tot_rho_r(ispin), &
545 ks_env=ks_env, soft_valid=gapw, &
546 task_list_external=task_list_external, &
547 pw_env_external=pw_env_external)
549 CALL qs_rho_set(rho_struct, rho_r_valid=.true., rho_g_valid=.true.)
552 IF (
PRESENT(rho_xc_external))
THEN
553 rho_xc => rho_xc_external
558 rho_ao_kp=rho_xc_ao, &
561 tot_rho_r=tot_rho_r_xc)
565 CALL dbcsr_copy(rho_xc_ao(ispin, img)%matrix, rho_ao_kp(ispin, img)%matrix)
569 rho_ao => rho_xc_ao(ispin, :)
571 rho=rho_xc_r(ispin), &
572 rho_gspace=rho_xc_g(ispin), &
573 total_rho=tot_rho_r_xc(ispin), &
574 ks_env=ks_env, soft_valid=gapw_xc, &
575 task_list_external=task_list_external_soft, &
576 pw_env_external=pw_env_external)
578 CALL qs_rho_set(rho_xc, rho_r_valid=.true., rho_g_valid=.true.)
582 IF (gapw .OR. gapw_xc)
THEN
584 rho_atom_set=rho_atom_set, &
585 qs_kind_set=qs_kind_set, &
586 oce=oce, sab_orb=sab)
587 IF (
PRESENT(local_rho_set)) rho_atom_set => local_rho_set%rho_atom_set
588 cpassert(
ASSOCIATED(rho_atom_set))
589 CALL qs_rho_get(rho_struct, rho_ao_kp=rho_ao_kp)
593 IF (.NOT. gapw_xc)
THEN
595 IF (dft_control%drho_by_collocation)
THEN
596 CALL qs_rho_get(rho_struct, rho_ao_kp=rho_ao_kp)
597 cpassert(.NOT.
PRESENT(task_list_external))
599 rho_ao => rho_ao_kp(ispin, :)
601 drho=drho_r(:, ispin), &
602 drho_gspace=drho_g(:, ispin), &
603 qs_env=qs_env, soft_valid=gapw)
605 CALL qs_rho_set(rho_struct, drho_r_valid=.true., drho_g_valid=.true.)
608 IF (dft_control%use_kinetic_energy_density)
THEN
609 CALL qs_rho_get(rho_struct, rho_ao_kp=rho_ao_kp)
611 rho_ao => rho_ao_kp(ispin, :)
614 rho_gspace=tau_g(ispin), &
616 ks_env=ks_env, soft_valid=gapw, &
617 compute_tau=.true., &
618 task_list_external=task_list_external, &
619 pw_env_external=pw_env_external)
621 CALL qs_rho_set(rho_struct, tau_r_valid=.true., tau_g_valid=.true.)
630 IF (dft_control%drho_by_collocation)
THEN
631 cpassert(.NOT.
PRESENT(task_list_external))
633 rho_ao => rho_xc_ao(ispin, :)
635 drho=drho_xc_r(:, ispin), &
636 drho_gspace=drho_xc_g(:, ispin), &
637 qs_env=qs_env, soft_valid=gapw_xc)
639 CALL qs_rho_set(rho_xc, drho_r_valid=.true., drho_g_valid=.true.)
642 IF (dft_control%use_kinetic_energy_density)
THEN
644 rho_ao => rho_xc_ao(ispin, :)
646 rho=tau_xc_r(ispin), &
647 rho_gspace=tau_xc_g(ispin), &
648 ks_env=ks_env, soft_valid=gapw_xc, &
649 compute_tau=.true., &
650 task_list_external=task_list_external_soft, &
651 pw_env_external=pw_env_external)
653 CALL qs_rho_set(rho_xc, tau_r_valid=.true., tau_g_valid=.true.)
657 CALL timestop(handle)
659 END SUBROUTINE qs_rho_update_rho_low
677 para_env_external, tddfpt_lri_env, tddfpt_lri_density)
680 TYPE(
pw_env_type),
OPTIONAL,
POINTER :: pw_env_external
686 CHARACTER(len=*),
PARAMETER :: routinen =
'qs_rho_update_tddfpt'
688 INTEGER :: handle, ispin, nspins
689 INTEGER,
DIMENSION(:, :, :),
POINTER :: cell_to_index
690 LOGICAL :: lri_response
691 REAL(kind=
dp),
DIMENSION(:),
POINTER :: tot_rho_r
694 TYPE(
dbcsr_p_type),
DIMENSION(:, :),
POINTER :: rho_ao_kp
704 CALL timeset(routinen, handle)
708 dft_control=dft_control, &
709 atomic_kind_set=atomic_kind_set, &
710 task_list=task_list, &
713 IF (
PRESENT(pw_env_external)) pw_env => pw_env_external
714 IF (
PRESENT(task_list_external)) task_list => task_list_external
715 IF (
PRESENT(para_env_external)) para_env => para_env_external
722 nspins = dft_control%nspins
724 lri_response =
PRESENT(tddfpt_lri_env)
725 IF (lri_response)
THEN
726 cpassert(
PRESENT(tddfpt_lri_density))
729 cpassert(.NOT. dft_control%drho_by_collocation)
730 cpassert(.NOT. dft_control%use_kinetic_energy_density)
731 cpassert(.NOT. dft_control%qs_control%gapw)
732 cpassert(.NOT. dft_control%qs_control%gapw_xc)
734 IF (lri_response)
THEN
735 CALL get_ks_env(ks_env=ks_env, kpoints=kpoints)
737 CALL qs_rho_get(rho_struct, rho_ao_kp=rho_ao_kp)
739 lri_rho_struct=rho_struct, &
740 atomic_kind_set=atomic_kind_set, &
742 response_density=lri_response)
743 CALL qs_rho_set(rho_struct, rho_r_valid=.true., rho_g_valid=.true.)
745 CALL qs_rho_get(rho_struct, rho_ao_kp=rho_ao_kp)
747 rho_ao => rho_ao_kp(ispin, :)
750 rho_gspace=rho_g(ispin), &
751 total_rho=tot_rho_r(ispin), &
753 task_list_external=task_list_external, &
754 pw_env_external=pw_env_external)
756 CALL qs_rho_set(rho_struct, rho_r_valid=.true., rho_g_valid=.true.)
759 CALL timestop(handle)
773 SUBROUTINE qs_rho_copy(rho_input, rho_output, auxbas_pw_pool, mspin)
778 INTEGER,
INTENT(IN) :: mspin
780 CHARACTER(len=*),
PARAMETER :: routinen =
'qs_rho_copy'
782 INTEGER :: handle, i, j, nspins
783 LOGICAL :: complex_rho_ao, drho_g_valid_in, drho_r_valid_in, rho_g_valid_in, rho_r_valid_in, &
784 soft_valid_in, tau_g_valid_in, tau_r_valid_in
785 REAL(kind=
dp) :: ospin
786 REAL(kind=
dp),
DIMENSION(:),
POINTER :: tot_rho_g_in, tot_rho_g_out, &
787 tot_rho_r_in, tot_rho_r_out
788 TYPE(
dbcsr_p_type),
DIMENSION(:),
POINTER :: rho_ao_im_in, rho_ao_im_out, rho_ao_in, &
790 TYPE(
dbcsr_p_type),
DIMENSION(:, :),
POINTER :: rho_ao_kp_in
791 TYPE(
pw_c1d_gs_type),
DIMENSION(:),
POINTER :: rho_g_in, rho_g_out, tau_g_in, tau_g_out
792 TYPE(
pw_c1d_gs_type),
DIMENSION(:, :),
POINTER :: drho_g_in, drho_g_out
793 TYPE(
pw_r3d_rs_type),
DIMENSION(:),
POINTER :: rho_r_in, rho_r_out, tau_r_in, tau_r_out
794 TYPE(
pw_r3d_rs_type),
DIMENSION(:, :),
POINTER :: drho_r_in, drho_r_out
797 CALL timeset(routinen, handle)
799 cpassert(mspin == 1 .OR. mspin == 2)
800 ospin = 1._dp/real(mspin, kind=
dp)
804 NULLIFY (rho_ao_in, rho_ao_kp_in, rho_ao_im_in, rho_r_in, rho_g_in, drho_r_in, &
805 drho_g_in, tau_r_in, tau_g_in, tot_rho_r_in, tot_rho_g_in, rho_r_sccs_in)
809 rho_ao_kp=rho_ao_kp_in, &
810 rho_ao_im=rho_ao_im_in, &
817 tot_rho_r=tot_rho_r_in, &
818 tot_rho_g=tot_rho_g_in, &
819 rho_g_valid=rho_g_valid_in, &
820 rho_r_valid=rho_r_valid_in, &
821 drho_g_valid=drho_g_valid_in, &
822 drho_r_valid=drho_r_valid_in, &
823 tau_r_valid=tau_r_valid_in, &
824 tau_g_valid=tau_g_valid_in, &
825 rho_r_sccs=rho_r_sccs_in, &
826 soft_valid=soft_valid_in, &
827 complex_rho_ao=complex_rho_ao)
829 NULLIFY (rho_ao_out, rho_ao_im_out, rho_r_out, rho_g_out, drho_r_out, &
830 drho_g_out, tau_r_out, tau_g_out, tot_rho_r_out, tot_rho_g_out, rho_r_sccs_out)
832 IF (
ASSOCIATED(rho_ao_in))
THEN
833 nspins =
SIZE(rho_ao_in)
834 cpassert(mspin >= nspins)
836 CALL qs_rho_set(rho_output, rho_ao=rho_ao_out)
837 IF (mspin > nspins)
THEN
839 ALLOCATE (rho_ao_out(i)%matrix)
840 CALL dbcsr_copy(rho_ao_out(i)%matrix, rho_ao_in(1)%matrix, name=
"RHO copy")
845 ALLOCATE (rho_ao_out(i)%matrix)
846 CALL dbcsr_copy(rho_ao_out(i)%matrix, rho_ao_in(i)%matrix, name=
"RHO copy")
858 IF (
ASSOCIATED(rho_ao_im_in))
THEN
859 nspins =
SIZE(rho_ao_im_in)
860 cpassert(mspin >= nspins)
862 CALL qs_rho_set(rho_output, rho_ao_im=rho_ao_im_out)
863 IF (mspin > nspins)
THEN
865 ALLOCATE (rho_ao_im_out(i)%matrix)
866 CALL dbcsr_copy(rho_ao_im_out(i)%matrix, rho_ao_im_in(1)%matrix, name=
"RHO copy")
871 ALLOCATE (rho_ao_im_out(i)%matrix)
872 CALL dbcsr_copy(rho_ao_im_out(i)%matrix, rho_ao_im_in(i)%matrix, name=
"RHO copy")
878 IF (
ASSOCIATED(rho_r_in))
THEN
879 nspins =
SIZE(rho_r_in)
880 cpassert(mspin >= nspins)
881 ALLOCATE (rho_r_out(mspin))
883 IF (mspin > nspins)
THEN
885 CALL auxbas_pw_pool%create_pw(rho_r_out(i))
886 CALL pw_copy(rho_r_in(1), rho_r_out(i))
891 CALL auxbas_pw_pool%create_pw(rho_r_out(i))
892 CALL pw_copy(rho_r_in(i), rho_r_out(i))
898 IF (
ASSOCIATED(rho_g_in))
THEN
899 nspins =
SIZE(rho_g_in)
900 cpassert(mspin >= nspins)
901 ALLOCATE (rho_g_out(mspin))
903 IF (mspin > nspins)
THEN
905 CALL auxbas_pw_pool%create_pw(rho_g_out(i))
906 CALL pw_copy(rho_g_in(1), rho_g_out(i))
911 CALL auxbas_pw_pool%create_pw(rho_g_out(i))
912 CALL pw_copy(rho_g_in(i), rho_g_out(i))
918 IF (
ASSOCIATED(rho_r_sccs_in))
THEN
919 CALL qs_rho_set(rho_output, rho_r_sccs=rho_r_sccs_out)
920 CALL auxbas_pw_pool%create_pw(rho_r_sccs_out)
921 CALL pw_copy(rho_r_sccs_in, rho_r_sccs_out)
925 IF (
ASSOCIATED(drho_r_in))
THEN
926 nspins =
SIZE(drho_r_in)
927 cpassert(mspin >= nspins)
928 ALLOCATE (drho_r_out(3, mspin))
929 CALL qs_rho_set(rho_output, drho_r=drho_r_out)
930 IF (mspin > nspins)
THEN
933 CALL auxbas_pw_pool%create_pw(drho_r_out(i, j))
934 CALL pw_copy(drho_r_in(i, 1), drho_r_out(i, j))
935 CALL pw_scale(drho_r_out(i, j), ospin)
941 CALL auxbas_pw_pool%create_pw(drho_r_out(i, j))
942 CALL pw_copy(drho_r_in(i, j), drho_r_out(i, j))
949 IF (
ASSOCIATED(drho_g_in))
THEN
950 nspins =
SIZE(drho_g_in)
951 cpassert(mspin >= nspins)
952 ALLOCATE (drho_g_out(3, mspin))
953 CALL qs_rho_set(rho_output, drho_g=drho_g_out)
954 IF (mspin > nspins)
THEN
957 CALL auxbas_pw_pool%create_pw(drho_g_out(i, j))
958 CALL pw_copy(drho_g_in(i, 1), drho_g_out(i, j))
959 CALL pw_scale(drho_g_out(i, j), ospin)
965 CALL auxbas_pw_pool%create_pw(drho_g_out(i, j))
966 CALL pw_copy(drho_g_in(i, j), drho_g_out(i, j))
973 IF (
ASSOCIATED(tau_r_in))
THEN
974 nspins =
SIZE(tau_r_in)
975 cpassert(mspin >= nspins)
976 ALLOCATE (tau_r_out(mspin))
978 IF (mspin > nspins)
THEN
980 CALL auxbas_pw_pool%create_pw(tau_r_out(i))
981 CALL pw_copy(tau_r_in(1), tau_r_out(i))
986 CALL auxbas_pw_pool%create_pw(tau_r_out(i))
987 CALL pw_copy(tau_r_in(i), tau_r_out(i))
993 IF (
ASSOCIATED(tau_g_in))
THEN
994 nspins =
SIZE(tau_g_in)
995 cpassert(mspin >= nspins)
996 ALLOCATE (tau_g_out(mspin))
998 IF (mspin > nspins)
THEN
1000 CALL auxbas_pw_pool%create_pw(tau_g_out(i))
1001 CALL pw_copy(tau_g_in(1), tau_g_out(i))
1006 CALL auxbas_pw_pool%create_pw(tau_g_out(i))
1007 CALL pw_copy(tau_g_in(i), tau_g_out(i))
1013 IF (
ASSOCIATED(tot_rho_r_in))
THEN
1014 nspins =
SIZE(tot_rho_r_in)
1015 cpassert(mspin >= nspins)
1016 ALLOCATE (tot_rho_r_out(mspin))
1017 CALL qs_rho_set(rho_output, tot_rho_r=tot_rho_r_out)
1018 IF (mspin > nspins)
THEN
1020 tot_rho_r_out(i) = tot_rho_r_in(1)*ospin
1024 tot_rho_r_out(i) = tot_rho_r_in(i)
1030 IF (
ASSOCIATED(tot_rho_g_in))
THEN
1031 nspins =
SIZE(tot_rho_g_in)
1032 cpassert(mspin >= nspins)
1033 ALLOCATE (tot_rho_g_out(mspin))
1034 CALL qs_rho_set(rho_output, tot_rho_g=tot_rho_g_out)
1035 IF (mspin > nspins)
THEN
1037 tot_rho_g_out(i) = tot_rho_g_in(1)*ospin
1041 tot_rho_g_out(i) = tot_rho_g_in(i)
1047 rho_g_valid=rho_g_valid_in, &
1048 rho_r_valid=rho_r_valid_in, &
1049 drho_g_valid=drho_g_valid_in, &
1050 drho_r_valid=drho_r_valid_in, &
1051 tau_r_valid=tau_r_valid_in, &
1052 tau_g_valid=tau_g_valid_in, &
1053 soft_valid=soft_valid_in, &
1054 complex_rho_ao=complex_rho_ao)
1056 CALL timestop(handle)
1070 REAL(kind=
dp),
INTENT(IN) :: alpha, beta
1072 CHARACTER(len=*),
PARAMETER :: routinen =
'qs_rho_scale_and_add'
1074 INTEGER :: handle, i, j, nspina, nspinb, nspins
1075 REAL(kind=
dp),
DIMENSION(:),
POINTER :: tot_rho_g_a, tot_rho_g_b, tot_rho_r_a, &
1077 TYPE(
dbcsr_p_type),
DIMENSION(:),
POINTER :: rho_ao_a, rho_ao_b, rho_ao_im_a, &
1079 TYPE(
pw_c1d_gs_type),
DIMENSION(:),
POINTER :: rho_g_a, rho_g_b, tau_g_a, tau_g_b
1080 TYPE(
pw_c1d_gs_type),
DIMENSION(:, :),
POINTER :: drho_g_a, drho_g_b
1081 TYPE(
pw_r3d_rs_type),
DIMENSION(:),
POINTER :: rho_r_a, rho_r_b, tau_r_a, tau_r_b
1082 TYPE(
pw_r3d_rs_type),
DIMENSION(:, :),
POINTER :: drho_r_a, drho_r_b
1085 CALL timeset(routinen, handle)
1087 NULLIFY (rho_ao_a, rho_ao_im_a, rho_r_a, rho_g_a, drho_r_a, &
1088 drho_g_a, tau_r_a, tau_g_a, tot_rho_r_a, tot_rho_g_a, rho_r_sccs_a)
1092 rho_ao_im=rho_ao_im_a, &
1099 tot_rho_r=tot_rho_r_a, &
1100 tot_rho_g=tot_rho_g_a, &
1101 rho_r_sccs=rho_r_sccs_a)
1103 NULLIFY (rho_ao_b, rho_ao_im_b, rho_r_b, rho_g_b, drho_r_b, &
1104 drho_g_b, tau_r_b, tau_g_b, tot_rho_r_b, tot_rho_g_b, rho_r_sccs_b)
1108 rho_ao_im=rho_ao_im_b, &
1115 tot_rho_r=tot_rho_r_b, &
1116 tot_rho_g=tot_rho_g_b, &
1117 rho_r_sccs=rho_r_sccs_b)
1119 IF (
ASSOCIATED(rho_ao_a) .AND.
ASSOCIATED(rho_ao_b))
THEN
1120 nspina =
SIZE(rho_ao_a)
1121 nspinb =
SIZE(rho_ao_b)
1122 nspins = min(nspina, nspinb)
1124 CALL dbcsr_add(rho_ao_a(i)%matrix, rho_ao_b(i)%matrix, alpha, beta)
1129 IF (
ASSOCIATED(rho_ao_im_a) .AND.
ASSOCIATED(rho_ao_im_b))
THEN
1130 nspina =
SIZE(rho_ao_im_a)
1131 nspinb =
SIZE(rho_ao_im_b)
1132 nspins = min(nspina, nspinb)
1134 CALL dbcsr_add(rho_ao_im_a(i)%matrix, rho_ao_im_b(i)%matrix, alpha, beta)
1139 IF (
ASSOCIATED(rho_r_a) .AND.
ASSOCIATED(rho_r_b))
THEN
1140 nspina =
SIZE(rho_ao_a)
1141 nspinb =
SIZE(rho_ao_b)
1142 nspins = min(nspina, nspinb)
1144 CALL pw_axpy(rho_r_b(i), rho_r_a(i), beta, alpha)
1149 IF (
ASSOCIATED(rho_g_a) .AND.
ASSOCIATED(rho_g_b))
THEN
1150 nspina =
SIZE(rho_ao_a)
1151 nspinb =
SIZE(rho_ao_b)
1152 nspins = min(nspina, nspinb)
1154 CALL pw_axpy(rho_g_b(i), rho_g_a(i), beta, alpha)
1159 IF (
ASSOCIATED(rho_r_sccs_a) .AND.
ASSOCIATED(rho_r_sccs_b))
THEN
1160 CALL pw_axpy(rho_r_sccs_b, rho_r_sccs_a, beta, alpha)
1164 IF (
ASSOCIATED(drho_r_a) .AND.
ASSOCIATED(drho_r_b))
THEN
1165 cpassert(all(shape(drho_r_a) == shape(drho_r_b)))
1166 DO j = 1,
SIZE(drho_r_a, 2)
1167 DO i = 1,
SIZE(drho_r_a, 1)
1168 CALL pw_axpy(drho_r_b(i, j), drho_r_a(i, j), beta, alpha)
1174 IF (
ASSOCIATED(drho_g_a) .AND.
ASSOCIATED(drho_g_b))
THEN
1175 cpassert(all(shape(drho_g_a) == shape(drho_g_b)))
1176 DO j = 1,
SIZE(drho_g_a, 2)
1177 DO i = 1,
SIZE(drho_g_a, 1)
1178 CALL pw_axpy(drho_g_b(i, j), drho_g_a(i, j), beta, alpha)
1184 IF (
ASSOCIATED(tau_r_a) .AND.
ASSOCIATED(tau_r_b))
THEN
1185 nspina =
SIZE(rho_ao_a)
1186 nspinb =
SIZE(rho_ao_b)
1187 nspins = min(nspina, nspinb)
1189 CALL pw_axpy(tau_r_b(i), tau_r_a(i), beta, alpha)
1194 IF (
ASSOCIATED(tau_g_a) .AND.
ASSOCIATED(tau_g_b))
THEN
1195 nspina =
SIZE(rho_ao_a)
1196 nspinb =
SIZE(rho_ao_b)
1197 nspins = min(nspina, nspinb)
1199 CALL pw_axpy(tau_g_b(i), tau_g_a(i), beta, alpha)
1204 IF (
ASSOCIATED(tot_rho_r_a) .AND.
ASSOCIATED(tot_rho_r_b))
THEN
1205 nspina =
SIZE(rho_ao_a)
1206 nspinb =
SIZE(rho_ao_b)
1207 nspins = min(nspina, nspinb)
1209 tot_rho_r_a(i) = alpha*tot_rho_r_a(i) + beta*tot_rho_r_b(i)
1214 IF (
ASSOCIATED(tot_rho_g_a) .AND.
ASSOCIATED(tot_rho_g_b))
THEN
1215 nspina =
SIZE(rho_ao_a)
1216 nspinb =
SIZE(rho_ao_b)
1217 nspins = min(nspina, nspinb)
1219 tot_rho_g_a(i) = alpha*tot_rho_g_a(i) + beta*tot_rho_g_b(i)
1223 CALL timestop(handle)
1241 TYPE(
qs_rho_type),
INTENT(INOUT) :: rho_input, rho_output
1244 CHARACTER(len=*),
PARAMETER :: routinen =
'duplicate_rho_type'
1246 INTEGER :: handle, i, j, nspins
1247 LOGICAL :: complex_rho_ao_in, drho_g_valid_in, drho_r_valid_in, rho_g_valid_in, &
1248 rho_r_valid_in, soft_valid_in, tau_g_valid_in, tau_r_valid_in
1249 REAL(kind=
dp),
DIMENSION(:),
POINTER :: tot_rho_g_in, tot_rho_g_out, &
1250 tot_rho_r_in, tot_rho_r_out
1251 TYPE(
dbcsr_p_type),
DIMENSION(:),
POINTER :: rho_ao_im_in, rho_ao_im_out, rho_ao_in, &
1254 TYPE(
pw_c1d_gs_type),
DIMENSION(:),
POINTER :: rho_g_in, rho_g_out, tau_g_in, tau_g_out
1255 TYPE(
pw_c1d_gs_type),
DIMENSION(:, :),
POINTER :: drho_g_in, drho_g_out
1258 TYPE(
pw_r3d_rs_type),
DIMENSION(:),
POINTER :: rho_r_in, rho_r_out, tau_r_in, tau_r_out
1259 TYPE(
pw_r3d_rs_type),
DIMENSION(:, :),
POINTER :: drho_r_in, drho_r_out
1262 CALL timeset(routinen, handle)
1264 NULLIFY (dft_control, pw_env, auxbas_pw_pool)
1265 NULLIFY (rho_ao_in, rho_ao_out, rho_ao_im_in, rho_ao_im_out)
1266 NULLIFY (rho_r_in, rho_r_out, rho_g_in, rho_g_out, drho_r_in, drho_r_out)
1267 NULLIFY (drho_g_in, drho_g_out, tau_r_in, tau_r_out, tau_g_in, tau_g_out)
1268 NULLIFY (tot_rho_r_in, tot_rho_r_out, tot_rho_g_in, tot_rho_g_out)
1269 NULLIFY (rho_r_sccs_in, rho_r_sccs_out)
1271 cpassert(
ASSOCIATED(qs_env))
1273 CALL get_qs_env(qs_env=qs_env, pw_env=pw_env, dft_control=dft_control)
1274 CALL pw_env_get(pw_env=pw_env, auxbas_pw_pool=auxbas_pw_pool)
1275 nspins = dft_control%nspins
1281 rho_ao_im=rho_ao_im_in, &
1288 tot_rho_r=tot_rho_r_in, &
1289 tot_rho_g=tot_rho_g_in, &
1290 rho_g_valid=rho_g_valid_in, &
1291 rho_r_valid=rho_r_valid_in, &
1292 drho_g_valid=drho_g_valid_in, &
1293 drho_r_valid=drho_r_valid_in, &
1294 tau_r_valid=tau_r_valid_in, &
1295 tau_g_valid=tau_g_valid_in, &
1296 rho_r_sccs=rho_r_sccs_in, &
1297 soft_valid=soft_valid_in, &
1298 complex_rho_ao=complex_rho_ao_in)
1301 IF (
ASSOCIATED(rho_ao_in))
THEN
1303 CALL qs_rho_set(rho_output, rho_ao=rho_ao_out)
1305 ALLOCATE (rho_ao_out(i)%matrix)
1306 CALL dbcsr_copy(rho_ao_out(i)%matrix, rho_ao_in(i)%matrix, &
1307 name=
"myDensityMatrix_for_Spin_"//trim(adjustl(
cp_to_string(i))))
1308 CALL dbcsr_set(rho_ao_out(i)%matrix, 0.0_dp)
1313 IF (
ASSOCIATED(rho_ao_im_in))
THEN
1315 CALL qs_rho_set(rho_output, rho_ao=rho_ao_im_out)
1317 ALLOCATE (rho_ao_im_out(i)%matrix)
1318 CALL dbcsr_copy(rho_ao_im_out(i)%matrix, rho_ao_im_in(i)%matrix, &
1319 name=
"myImagDensityMatrix_for_Spin_"//trim(adjustl(
cp_to_string(i))))
1320 CALL dbcsr_set(rho_ao_im_out(i)%matrix, 0.0_dp)
1325 IF (
ASSOCIATED(rho_r_in))
THEN
1326 ALLOCATE (rho_r_out(nspins))
1329 CALL auxbas_pw_pool%create_pw(rho_r_out(i))
1330 CALL pw_copy(rho_r_in(i), rho_r_out(i))
1335 IF (
ASSOCIATED(rho_g_in))
THEN
1336 ALLOCATE (rho_g_out(nspins))
1339 CALL auxbas_pw_pool%create_pw(rho_g_out(i))
1340 CALL pw_copy(rho_g_in(i), rho_g_out(i))
1345 IF (
ASSOCIATED(rho_r_sccs_in))
THEN
1346 CALL qs_rho_set(rho_output, rho_r_sccs=rho_r_sccs_out)
1347 CALL auxbas_pw_pool%create_pw(rho_r_sccs_out)
1348 CALL pw_copy(rho_r_sccs_in, rho_r_sccs_out)
1352 IF (dft_control%drho_by_collocation)
THEN
1354 IF (
ASSOCIATED(drho_r_in))
THEN
1355 ALLOCATE (drho_r_out(3, nspins))
1356 CALL qs_rho_set(rho_output, drho_r=drho_r_out)
1359 CALL auxbas_pw_pool%create_pw(drho_r_out(i, j))
1360 CALL pw_copy(drho_r_in(i, j), drho_r_out(i, j))
1366 IF (
ASSOCIATED(drho_g_in))
THEN
1367 ALLOCATE (drho_g_out(3, nspins))
1368 CALL qs_rho_set(rho_output, drho_g=drho_g_out)
1371 CALL auxbas_pw_pool%create_pw(drho_g_out(i, j))
1372 CALL pw_copy(drho_g_in(i, j), drho_g_out(i, j))
1381 IF (dft_control%use_kinetic_energy_density)
THEN
1383 IF (
ASSOCIATED(tau_r_in))
THEN
1384 ALLOCATE (tau_r_out(nspins))
1387 CALL auxbas_pw_pool%create_pw(tau_r_out(i))
1388 CALL pw_copy(tau_r_in(i), tau_r_out(i))
1393 IF (
ASSOCIATED(tau_g_in))
THEN
1394 ALLOCATE (tau_g_out(nspins))
1397 CALL auxbas_pw_pool%create_pw(tau_g_out(i))
1398 CALL pw_copy(tau_g_in(i), tau_g_out(i))
1404 rho_g_valid=rho_g_valid_in, &
1405 rho_r_valid=rho_r_valid_in, &
1406 drho_g_valid=drho_g_valid_in, &
1407 drho_r_valid=drho_r_valid_in, &
1408 tau_r_valid=tau_r_valid_in, &
1409 tau_g_valid=tau_g_valid_in, &
1410 soft_valid=soft_valid_in, &
1411 complex_rho_ao=complex_rho_ao_in)
1414 IF (
ASSOCIATED(tot_rho_r_in))
THEN
1415 ALLOCATE (tot_rho_r_out(nspins))
1416 CALL qs_rho_set(rho_output, tot_rho_r=tot_rho_r_out)
1418 tot_rho_r_out(i) = tot_rho_r_in(i)
1423 IF (
ASSOCIATED(tot_rho_g_in))
THEN
1424 ALLOCATE (tot_rho_g_out(nspins))
1425 CALL qs_rho_set(rho_output, tot_rho_g=tot_rho_g_out)
1427 tot_rho_g_out(i) = tot_rho_g_in(i)
1432 CALL timestop(handle)
1445 CHARACTER(LEN=default_string_length) :: headline
1446 INTEGER :: i, ic, nimages, nspins
1447 TYPE(
dbcsr_p_type),
DIMENSION(:, :),
POINTER :: rho_ao_im_kp, rho_ao_kp
1453 NULLIFY (rho_ao_im_kp, rho_ao_kp, dft_control, template, sab_orb)
1456 dft_control=dft_control, &
1459 CALL qs_rho_get(rho, rho_ao_im_kp=rho_ao_im_kp, rho_ao_kp=rho_ao_kp)
1461 nspins = dft_control%nspins
1462 nimages = dft_control%nimages
1464 cpassert(nspins .EQ.
SIZE(rho_ao_kp, 1))
1465 cpassert(nimages .EQ.
SIZE(rho_ao_kp, 2))
1468 CALL qs_rho_set(rho, rho_ao_im_kp=rho_ao_im_kp)
1471 IF (nspins > 1)
THEN
1473 headline =
"IMAGINARY PART OF DENSITY MATRIX FOR ALPHA SPIN"
1475 headline =
"IMAGINARY PART OF DENSITY MATRIX FOR BETA SPIN"
1478 headline =
"IMAGINARY PART OF DENSITY MATRIX"
1480 ALLOCATE (rho_ao_im_kp(i, ic)%matrix)
1481 template => rho_ao_kp(i, ic)%matrix
1482 CALL dbcsr_create(matrix=rho_ao_im_kp(i, ic)%matrix, template=template, &
1483 name=trim(headline), matrix_type=dbcsr_type_antisymmetric)
1485 CALL dbcsr_set(rho_ao_im_kp(i, ic)%matrix, 0.0_dp)
Types and set/get functions for auxiliary density matrix methods.
subroutine, public get_admm_env(admm_env, mo_derivs_aux_fit, mos_aux_fit, sab_aux_fit, sab_aux_fit_asymm, sab_aux_fit_vs_orb, matrix_s_aux_fit, matrix_s_aux_fit_kp, matrix_s_aux_fit_vs_orb, matrix_s_aux_fit_vs_orb_kp, task_list_aux_fit, matrix_ks_aux_fit, matrix_ks_aux_fit_kp, matrix_ks_aux_fit_im, matrix_ks_aux_fit_dft, matrix_ks_aux_fit_hfx, matrix_ks_aux_fit_dft_kp, matrix_ks_aux_fit_hfx_kp, rho_aux_fit, rho_aux_fit_buffer, admm_dm)
Get routine for the ADMM env.
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_scale(matrix, alpha_scalar)
...
subroutine, public dbcsr_copy(matrix_b, matrix_a, name, keep_sparsity, keep_imaginary)
...
subroutine, public dbcsr_set(matrix, alpha)
...
subroutine, public dbcsr_add(matrix_a, matrix_b, alpha_scalar, beta_scalar)
...
Routines that link DBCSR and CP2K concepts together.
subroutine, public cp_dbcsr_alloc_block_from_nbl(matrix, sab_orb, desymmetrize)
allocate the blocks of a dbcsr based on the neighbor list
DBCSR operations in CP2K.
various routines to log and control the output. The idea is that decisions about where to log should ...
Defines the basic variable types.
integer, parameter, public dp
integer, parameter, public default_string_length
Types and basic routines needed for a kpoint calculation.
subroutine, public get_kpoint_info(kpoint, kp_scheme, nkp_grid, kp_shift, symmetry, verbose, full_grid, use_real_wfn, eps_geo, parallel_group_size, kp_range, nkp, xkp, wkp, para_env, blacs_env_all, para_env_kp, para_env_inter_kp, blacs_env, kp_env, kp_aux_env, mpools, iogrp, nkp_groups, kp_dist, cell_to_index, index_to_cell, sab_nl, sab_nl_nosym)
Retrieve information from a kpoint environment.
Calculates integral matrices for LRIGPW method lri : local resolution of the identity.
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...
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 ...
Calculate the plane wave density by collocating the primitive Gaussian functions (pgf).
subroutine, public calculate_drho_elec(matrix_p, matrix_p_kp, drho, drho_gspace, qs_env, soft_valid, basis_type)
computes the gradient of the density corresponding to a given density matrix on the grid
subroutine, public calculate_rho_elec(matrix_p, matrix_p_kp, rho, rho_gspace, total_rho, ks_env, soft_valid, compute_tau, compute_grad, basis_type, der_type, idir, task_list_external, pw_env_external)
computes the density corresponding to a given density matrix on the grid
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, 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, 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, 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, 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, ecoul_1c, rho0_s_rs, rho0_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)
Get the QUICKSTEP environment.
subroutine, public set_qs_env(qs_env, super_cell, mos, qmmm, qmmm_periodic, ewald_env, ewald_pw, mpools, rho_external, external_vxc, mask, scf_control, rel_control, qs_charges, ks_env, ks_qmmm_env, wf_history, scf_env, active_space, input, oce, rho_atom_set, rho0_atom_set, rho0_mpole, run_rtp, rtp, rhoz_set, rhoz_tot, ecoul_1c, has_unit_metric, requires_mo_derivs, mo_derivs, mo_loc_history, efield, linres_control, xas_env, cp_ddapc_env, cp_ddapc_ewald, outer_scf_history, outer_scf_ihistory, x_data, et_coupling, dftb_potential, se_taper, se_store_int_env, se_nddo_mpole, se_nonbond_env, admm_env, ls_scf_env, do_transport, transport_env, lri_env, lri_density, exstate_env, ec_env, dispersion_env, harris_env, gcp_env, mp2_env, bs_env, kg_env, force, kpoints, wanniercentres, almo_scf_env, gradient_history, variable_history, embed_pot, spin_embed_pot, polar_env, mos_last_converged, eeq, rhs)
Set the QUICKSTEP environment.
Types needed for a for a Harris model calculation.
Harris method environment setup and handling.
subroutine, public calculate_harris_density(qs_env, rhoin, rho_struct)
...
Define the quickstep kind type and their sub types.
subroutine, public get_ks_env(ks_env, v_hartree_rspace, s_mstruct_changed, rho_changed, potential_changed, forces_up_to_date, complex_ks, matrix_h, matrix_h_im, matrix_ks, matrix_ks_im, matrix_vxc, kinetic, matrix_s, matrix_s_ri_aux, matrix_w, matrix_p_mp2, matrix_p_mp2_admm, matrix_h_kp, matrix_h_im_kp, matrix_ks_kp, matrix_vxc_kp, kinetic_kp, matrix_s_kp, matrix_w_kp, matrix_s_ri_aux_kp, matrix_ks_im_kp, rho, rho_xc, vppl, rho_core, rho_nlcc, rho_nlcc_g, vee, neighbor_list_id, sab_orb, sab_all, sac_ae, sac_ppl, sac_lri, sap_ppnl, sap_oce, sab_lrc, sab_se, sab_xtbe, sab_tbe, sab_core, sab_xb, sab_xtb_pp, sab_xtb_nonbond, sab_vdw, sab_scp, sab_almo, sab_kp, sab_kp_nosym, task_list, task_list_soft, kpoints, do_kpoints, atomic_kind_set, qs_kind_set, cell, cell_ref, use_ref_cell, particle_set, energy, force, local_particles, local_molecules, molecule_kind_set, molecule_set, subsys, cp_subsys, virial, results, atprop, nkind, natom, dft_control, dbcsr_dist, distribution_2d, pw_env, para_env, blacs_env, nelectron_total, nelectron_spin)
...
Define the neighbor list data types and the corresponding functionality.
subroutine, public calculate_rho_atom_coeff(qs_env, rho_ao, rho_atom_set, qs_kind_set, oce, sab, para_env)
...
methods of the rho structure (defined in qs_rho_types)
subroutine, public qs_rho_update_tddfpt(rho_struct, qs_env, pw_env_external, task_list_external, para_env_external, tddfpt_lri_env, tddfpt_lri_density)
updates rho_r and rho_g to the rhorho_ao. if use_kinetic_energy_density also computes tau_r and tau_g
subroutine, public allocate_rho_ao_imag_from_real(rho, qs_env)
(Re-)allocates rho_ao_im from real part rho_ao
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 duplicate_rho_type(rho_input, rho_output, qs_env)
Duplicates a pointer physically.
subroutine, public qs_rho_copy(rho_input, rho_output, auxbas_pw_pool, mspin)
Allocate a density structure and fill it with data from an input structure SIZE(rho_input) == mspin =...
subroutine, public qs_rho_scale_and_add(rhoa, rhob, alpha, beta)
rhoa = alpha*rhoa+beta*rhob
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_clear(rho_struct)
Deallocates all components, without deallocating rho_struct itself.
Calculates integral matrices for RIGPW method.
subroutine, public calculate_ri_densities(lri_env, qs_env, pmatrix, lri_rho_struct, atomic_kind_set, para_env)
performs the fitting of the density and distributes the fitted density on the grid
Provides all information about an atomic kind.
Contains information about kpoints.
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 ...
Contains information on the Harris method.
Provides all information about a quickstep kind.
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.