21 dbcsr_type_antisymmetric, dbcsr_type_symmetric
65#include "./base/base_uses.f90"
70 LOGICAL,
PRIVATE,
PARAMETER :: debug_this_module = .true.
71 CHARACTER(len=*),
PARAMETER,
PRIVATE :: moduleN =
'qs_rho_methods'
99 SUBROUTINE qs_rho_rebuild(rho, qs_env, rebuild_ao, rebuild_grids, admm, pw_env_external)
102 LOGICAL,
INTENT(in),
OPTIONAL :: rebuild_ao, rebuild_grids, admm
103 TYPE(
pw_env_type),
OPTIONAL,
POINTER :: pw_env_external
105 CHARACTER(LEN=*),
PARAMETER :: routinen =
'qs_rho_rebuild'
107 CHARACTER(LEN=default_string_length) :: headline
108 INTEGER :: handle, i, ic, j, nimg, nspins
109 LOGICAL :: do_kpoints, my_admm, my_rebuild_ao, &
110 my_rebuild_grids, rho_ao_is_complex
111 REAL(kind=
dp),
DIMENSION(:),
POINTER :: tot_rho_r
112 TYPE(
dbcsr_p_type),
DIMENSION(:, :),
POINTER :: matrix_s_kp, rho_ao_im_kp, rho_ao_kp
113 TYPE(
dbcsr_type),
POINTER :: refmatrix, tmatrix
126 CALL timeset(routinen, handle)
128 NULLIFY (pw_env, auxbas_pw_pool, matrix_s_kp, dft_control)
129 NULLIFY (tot_rho_r, rho_ao_kp, rho_r, rho_g, drho_r, drho_g, tau_r, tau_g, rho_ao_im_kp)
132 my_rebuild_ao = .true.
133 my_rebuild_grids = .true.
135 IF (
PRESENT(rebuild_ao)) my_rebuild_ao = rebuild_ao
136 IF (
PRESENT(rebuild_grids)) my_rebuild_grids = rebuild_grids
137 IF (
PRESENT(admm)) my_admm = admm
141 do_kpoints=do_kpoints, &
143 dft_control=dft_control)
144 IF (
PRESENT(pw_env_external))
THEN
145 pw_env => pw_env_external
148 nimg = dft_control%nimages
151 CALL get_admm_env(qs_env%admm_env, sab_aux_fit=sab_orb, matrix_s_aux_fit_kp=matrix_s_kp)
153 CALL get_qs_env(qs_env, matrix_s_kp=matrix_s_kp)
161 refmatrix => matrix_s_kp(1, 1)%matrix
163 CALL pw_env_get(pw_env, auxbas_pw_pool=auxbas_pw_pool)
164 nspins = dft_control%nspins
167 tot_rho_r=tot_rho_r, &
168 rho_ao_kp=rho_ao_kp, &
169 rho_ao_im_kp=rho_ao_im_kp, &
176 rho_r_sccs=rho_r_sccs, &
177 complex_rho_ao=rho_ao_is_complex)
179 IF (.NOT.
ASSOCIATED(tot_rho_r))
THEN
180 ALLOCATE (tot_rho_r(nspins))
186 IF (my_rebuild_ao .OR. (.NOT.
ASSOCIATED(rho_ao_kp)))
THEN
187 IF (
ASSOCIATED(rho_ao_kp))
THEN
197 headline =
"DENSITY MATRIX FOR ALPHA SPIN"
199 headline =
"DENSITY MATRIX FOR BETA SPIN"
202 headline =
"DENSITY MATRIX"
204 ALLOCATE (rho_ao_kp(i, ic)%matrix)
205 tmatrix => rho_ao_kp(i, ic)%matrix
206 CALL dbcsr_create(matrix=tmatrix, template=refmatrix, name=trim(headline), &
207 matrix_type=dbcsr_type_symmetric)
212 IF (rho_ao_is_complex)
THEN
213 IF (
ASSOCIATED(rho_ao_im_kp))
THEN
217 CALL qs_rho_set(rho, rho_ao_im_kp=rho_ao_im_kp)
222 headline =
"IMAGINARY PART OF DENSITY MATRIX FOR ALPHA SPIN"
224 headline =
"IMAGINARY PART OF DENSITY MATRIX FOR BETA SPIN"
227 headline =
"IMAGINARY PART OF DENSITY MATRIX"
229 ALLOCATE (rho_ao_im_kp(i, ic)%matrix)
230 tmatrix => rho_ao_im_kp(i, ic)%matrix
231 CALL dbcsr_create(matrix=tmatrix, template=refmatrix, name=trim(headline), &
232 matrix_type=dbcsr_type_antisymmetric)
241 IF (my_rebuild_grids .OR. .NOT.
ASSOCIATED(rho_r))
THEN
242 IF (
ASSOCIATED(rho_r))
THEN
243 DO i = 1,
SIZE(rho_r)
244 CALL rho_r(i)%release()
248 ALLOCATE (rho_r(nspins))
251 CALL auxbas_pw_pool%create_pw(rho_r(i))
256 IF (my_rebuild_grids .OR. .NOT.
ASSOCIATED(rho_g))
THEN
257 IF (
ASSOCIATED(rho_g))
THEN
258 DO i = 1,
SIZE(rho_g)
259 CALL rho_g(i)%release()
263 ALLOCATE (rho_g(nspins))
266 CALL auxbas_pw_pool%create_pw(rho_g(i))
271 IF (dft_control%do_sccs)
THEN
272 IF (my_rebuild_grids .OR. (.NOT.
ASSOCIATED(rho_r_sccs)))
THEN
273 IF (
ASSOCIATED(rho_r_sccs))
THEN
274 CALL rho_r_sccs%release()
275 DEALLOCATE (rho_r_sccs)
277 ALLOCATE (rho_r_sccs)
279 CALL auxbas_pw_pool%create_pw(rho_r_sccs)
285 IF (dft_control%drho_by_collocation)
THEN
287 IF (my_rebuild_grids .OR. .NOT.
ASSOCIATED(drho_r))
THEN
288 IF (
ASSOCIATED(drho_r))
THEN
289 DO j = 1,
SIZE(drho_r, 2)
290 DO i = 1,
SIZE(drho_r, 1)
291 CALL drho_r(i, j)%release()
296 ALLOCATE (drho_r(3, nspins))
300 CALL auxbas_pw_pool%create_pw(drho_r(i, j))
305 IF (my_rebuild_grids .OR. .NOT.
ASSOCIATED(drho_g))
THEN
306 IF (
ASSOCIATED(drho_g))
THEN
307 DO j = 1,
SIZE(drho_g, 2)
308 DO i = 1,
SIZE(drho_r, 1)
309 CALL drho_g(i, j)%release()
314 ALLOCATE (drho_g(3, nspins))
318 CALL auxbas_pw_pool%create_pw(drho_g(i, j))
325 IF (dft_control%use_kinetic_energy_density)
THEN
327 IF (my_rebuild_grids .OR. .NOT.
ASSOCIATED(tau_r))
THEN
328 IF (
ASSOCIATED(tau_r))
THEN
329 DO i = 1,
SIZE(tau_r)
330 CALL tau_r(i)%release()
334 ALLOCATE (tau_r(nspins))
337 CALL auxbas_pw_pool%create_pw(tau_r(i))
342 IF (my_rebuild_grids .OR. .NOT.
ASSOCIATED(tau_g))
THEN
343 IF (
ASSOCIATED(tau_g))
THEN
344 DO i = 1,
SIZE(tau_g)
345 CALL tau_g(i)%release()
349 ALLOCATE (tau_g(nspins))
352 CALL auxbas_pw_pool%create_pw(tau_g(i))
357 CALL timestop(handle)
379 task_list_external, task_list_external_soft, &
380 pw_env_external, para_env_external)
383 TYPE(
qs_rho_type),
OPTIONAL,
POINTER :: rho_xc_external
386 task_list_external_soft
387 TYPE(
pw_env_type),
OPTIONAL,
POINTER :: pw_env_external
390 INTEGER,
DIMENSION(:, :, :),
POINTER :: cell_to_index
393 TYPE(
dbcsr_p_type),
DIMENSION(:, :),
POINTER :: rho_ao_kp
402 CALL get_qs_env(qs_env, dft_control=dft_control, &
403 atomic_kind_set=atomic_kind_set, &
405 IF (
PRESENT(para_env_external)) para_env => para_env_external
407 IF (qs_env%harris_method)
THEN
408 CALL get_qs_env(qs_env, harris_env=harris_env)
410 CALL qs_rho_set(rho_struct, rho_r_valid=.true., rho_g_valid=.true.)
412 ELSE IF (dft_control%qs_control%semi_empirical .OR. &
413 dft_control%qs_control%dftb .OR. dft_control%qs_control%xtb)
THEN
415 CALL qs_rho_set(rho_struct, rho_r_valid=.false., rho_g_valid=.false.)
417 ELSE IF (dft_control%qs_control%lrigpw)
THEN
418 cpassert(.NOT. dft_control%use_kinetic_energy_density)
419 cpassert(.NOT. dft_control%drho_by_collocation)
420 CALL qs_rho_get(rho_struct, rho_ao_kp=rho_ao_kp)
422 CALL get_ks_env(ks_env=ks_env, kpoints=kpoints)
424 CALL get_qs_env(qs_env, lri_env=lri_env, lri_density=lri_density)
426 lri_rho_struct=rho_struct, &
427 atomic_kind_set=atomic_kind_set, &
429 response_density=.false.)
430 CALL set_qs_env(qs_env, lri_density=lri_density)
431 CALL qs_rho_set(rho_struct, rho_r_valid=.true., rho_g_valid=.true.)
433 ELSE IF (dft_control%qs_control%rigpw)
THEN
434 cpassert(.NOT. dft_control%use_kinetic_energy_density)
435 cpassert(.NOT. dft_control%drho_by_collocation)
439 lri_rho_struct=rho_struct, &
440 atomic_kind_set=atomic_kind_set, &
442 CALL qs_rho_set(rho_struct, rho_r_valid=.true., rho_g_valid=.true.)
445 CALL qs_rho_update_rho_low(rho_struct=rho_struct, qs_env=qs_env, &
446 rho_xc_external=rho_xc_external, &
447 local_rho_set=local_rho_set, &
448 task_list_external=task_list_external, &
449 task_list_external_soft=task_list_external_soft, &
450 pw_env_external=pw_env_external, &
451 para_env_external=para_env_external)
473 SUBROUTINE qs_rho_update_rho_low(rho_struct, qs_env, rho_xc_external, &
474 local_rho_set, pw_env_external, &
475 task_list_external, task_list_external_soft, &
479 TYPE(
qs_rho_type),
OPTIONAL,
POINTER :: rho_xc_external
481 TYPE(
pw_env_type),
OPTIONAL,
POINTER :: pw_env_external
483 task_list_external_soft
486 CHARACTER(len=*),
PARAMETER :: routinen =
'qs_rho_update_rho_low'
488 INTEGER :: handle, img, ispin, nimg, nspins
489 LOGICAL :: gapw, gapw_xc
491 REAL(kind=
dp),
DIMENSION(:),
POINTER :: tot_rho_r, tot_rho_r_xc
494 TYPE(
dbcsr_p_type),
DIMENSION(:, :),
POINTER :: rho_ao_kp, rho_xc_ao
500 TYPE(
pw_c1d_gs_type),
DIMENSION(:),
POINTER :: rho_g, rho_xc_g, tau_g, tau_xc_g
501 TYPE(
pw_c1d_gs_type),
DIMENSION(:, :),
POINTER :: drho_g, drho_xc_g
503 TYPE(
pw_r3d_rs_type),
DIMENSION(:),
POINTER :: rho_r, rho_xc_r, tau_r, tau_xc_r
504 TYPE(
pw_r3d_rs_type),
DIMENSION(:, :),
POINTER :: drho_r, drho_xc_r
505 TYPE(
qs_kind_type),
DIMENSION(:),
POINTER :: qs_kind_set
511 CALL timeset(routinen, handle)
513 NULLIFY (dft_control, rho_xc, ks_env, rho_ao, rho_r, rho_g, drho_r, drho_g, tau_r, tau_g)
514 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)
515 NULLIFY (para_env, pw_env, atomic_kind_set)
519 dft_control=dft_control, &
520 atomic_kind_set=atomic_kind_set)
525 tot_rho_r=tot_rho_r, &
531 CALL get_qs_env(qs_env, task_list=task_list, &
532 para_env=para_env, pw_env=pw_env)
533 IF (
PRESENT(pw_env_external)) pw_env => pw_env_external
534 IF (
PRESENT(task_list_external)) task_list => task_list_external
535 IF (
PRESENT(para_env_external)) para_env => para_env_external
537 nspins = dft_control%nspins
538 nimg = dft_control%nimages
539 gapw = dft_control%qs_control%gapw
540 gapw_xc = dft_control%qs_control%gapw_xc
542 CALL qs_rho_get(rho_struct, rho_ao_kp=rho_ao_kp)
544 rho_ao => rho_ao_kp(ispin, :)
547 rho_gspace=rho_g(ispin), &
548 total_rho=tot_rho_r(ispin), &
549 ks_env=ks_env, soft_valid=gapw, &
550 task_list_external=task_list_external, &
551 pw_env_external=pw_env_external)
553 CALL qs_rho_set(rho_struct, rho_r_valid=.true., rho_g_valid=.true.)
556 IF (
PRESENT(rho_xc_external))
THEN
557 rho_xc => rho_xc_external
562 rho_ao_kp=rho_xc_ao, &
565 tot_rho_r=tot_rho_r_xc)
569 CALL dbcsr_copy(rho_xc_ao(ispin, img)%matrix, rho_ao_kp(ispin, img)%matrix)
573 rho_ao => rho_xc_ao(ispin, :)
575 rho=rho_xc_r(ispin), &
576 rho_gspace=rho_xc_g(ispin), &
577 total_rho=tot_rho_r_xc(ispin), &
578 ks_env=ks_env, soft_valid=gapw_xc, &
579 task_list_external=task_list_external_soft, &
580 pw_env_external=pw_env_external)
582 CALL qs_rho_set(rho_xc, rho_r_valid=.true., rho_g_valid=.true.)
586 IF (gapw .OR. gapw_xc)
THEN
588 rho_atom_set=rho_atom_set, &
589 qs_kind_set=qs_kind_set, &
590 oce=oce, sab_orb=sab)
591 IF (
PRESENT(local_rho_set)) rho_atom_set => local_rho_set%rho_atom_set
592 cpassert(
ASSOCIATED(rho_atom_set))
593 CALL qs_rho_get(rho_struct, rho_ao_kp=rho_ao_kp)
597 IF (.NOT. gapw_xc)
THEN
599 IF (dft_control%drho_by_collocation)
THEN
600 CALL qs_rho_get(rho_struct, rho_ao_kp=rho_ao_kp)
601 cpassert(.NOT.
PRESENT(task_list_external))
603 rho_ao => rho_ao_kp(ispin, :)
605 drho=drho_r(:, ispin), &
606 drho_gspace=drho_g(:, ispin), &
607 qs_env=qs_env, soft_valid=gapw)
609 CALL qs_rho_set(rho_struct, drho_r_valid=.true., drho_g_valid=.true.)
612 IF (dft_control%use_kinetic_energy_density)
THEN
613 CALL qs_rho_get(rho_struct, rho_ao_kp=rho_ao_kp)
615 rho_ao => rho_ao_kp(ispin, :)
618 rho_gspace=tau_g(ispin), &
620 ks_env=ks_env, soft_valid=gapw, &
621 compute_tau=.true., &
622 task_list_external=task_list_external, &
623 pw_env_external=pw_env_external)
625 CALL qs_rho_set(rho_struct, tau_r_valid=.true., tau_g_valid=.true.)
634 IF (dft_control%drho_by_collocation)
THEN
635 cpassert(.NOT.
PRESENT(task_list_external))
637 rho_ao => rho_xc_ao(ispin, :)
639 drho=drho_xc_r(:, ispin), &
640 drho_gspace=drho_xc_g(:, ispin), &
641 qs_env=qs_env, soft_valid=gapw_xc)
643 CALL qs_rho_set(rho_xc, drho_r_valid=.true., drho_g_valid=.true.)
646 IF (dft_control%use_kinetic_energy_density)
THEN
648 rho_ao => rho_xc_ao(ispin, :)
650 rho=tau_xc_r(ispin), &
651 rho_gspace=tau_xc_g(ispin), &
652 ks_env=ks_env, soft_valid=gapw_xc, &
653 compute_tau=.true., &
654 task_list_external=task_list_external_soft, &
655 pw_env_external=pw_env_external)
657 CALL qs_rho_set(rho_xc, tau_r_valid=.true., tau_g_valid=.true.)
661 CALL timestop(handle)
663 END SUBROUTINE qs_rho_update_rho_low
681 para_env_external, tddfpt_lri_env, tddfpt_lri_density)
684 TYPE(
pw_env_type),
OPTIONAL,
POINTER :: pw_env_external
690 CHARACTER(len=*),
PARAMETER :: routinen =
'qs_rho_update_tddfpt'
692 INTEGER :: handle, ispin, nspins
693 INTEGER,
DIMENSION(:, :, :),
POINTER :: cell_to_index
694 LOGICAL :: lri_response
695 REAL(kind=
dp),
DIMENSION(:),
POINTER :: tot_rho_r
698 TYPE(
dbcsr_p_type),
DIMENSION(:, :),
POINTER :: rho_ao_kp
708 CALL timeset(routinen, handle)
712 dft_control=dft_control, &
713 atomic_kind_set=atomic_kind_set, &
714 task_list=task_list, &
717 IF (
PRESENT(pw_env_external)) pw_env => pw_env_external
718 IF (
PRESENT(task_list_external)) task_list => task_list_external
719 IF (
PRESENT(para_env_external)) para_env => para_env_external
726 nspins = dft_control%nspins
728 lri_response =
PRESENT(tddfpt_lri_env)
729 IF (lri_response)
THEN
730 cpassert(
PRESENT(tddfpt_lri_density))
733 cpassert(.NOT. dft_control%drho_by_collocation)
734 cpassert(.NOT. dft_control%use_kinetic_energy_density)
735 cpassert(.NOT. dft_control%qs_control%gapw)
736 cpassert(.NOT. dft_control%qs_control%gapw_xc)
738 IF (lri_response)
THEN
739 CALL get_ks_env(ks_env=ks_env, kpoints=kpoints)
741 CALL qs_rho_get(rho_struct, rho_ao_kp=rho_ao_kp)
743 lri_rho_struct=rho_struct, &
744 atomic_kind_set=atomic_kind_set, &
746 response_density=lri_response)
747 CALL qs_rho_set(rho_struct, rho_r_valid=.true., rho_g_valid=.true.)
749 CALL qs_rho_get(rho_struct, rho_ao_kp=rho_ao_kp)
751 rho_ao => rho_ao_kp(ispin, :)
754 rho_gspace=rho_g(ispin), &
755 total_rho=tot_rho_r(ispin), &
757 task_list_external=task_list_external, &
758 pw_env_external=pw_env_external)
760 CALL qs_rho_set(rho_struct, rho_r_valid=.true., rho_g_valid=.true.)
763 CALL timestop(handle)
778 SUBROUTINE qs_rho_copy(rho_input, rho_output, auxbas_pw_pool, mspin, factor)
783 INTEGER,
INTENT(IN) :: mspin
784 REAL(kind=
dp),
INTENT(IN),
OPTIONAL :: factor
786 CHARACTER(len=*),
PARAMETER :: routinen =
'qs_rho_copy'
788 INTEGER :: handle, i, j, nspins
789 LOGICAL :: complex_rho_ao, drho_g_valid_in, drho_r_valid_in, rho_g_valid_in, rho_r_valid_in, &
790 soft_valid_in, tau_g_valid_in, tau_r_valid_in
791 REAL(kind=
dp) :: ospin
792 REAL(kind=
dp),
DIMENSION(:),
POINTER :: tot_rho_g_in, tot_rho_g_out, &
793 tot_rho_r_in, tot_rho_r_out
794 TYPE(
dbcsr_p_type),
DIMENSION(:),
POINTER :: rho_ao_im_in, rho_ao_im_out, rho_ao_in, &
796 TYPE(
dbcsr_p_type),
DIMENSION(:, :),
POINTER :: rho_ao_kp_in
797 TYPE(
pw_c1d_gs_type),
DIMENSION(:),
POINTER :: rho_g_in, rho_g_out, tau_g_in, tau_g_out
798 TYPE(
pw_c1d_gs_type),
DIMENSION(:, :),
POINTER :: drho_g_in, drho_g_out
799 TYPE(
pw_r3d_rs_type),
DIMENSION(:),
POINTER :: rho_r_in, rho_r_out, tau_r_in, tau_r_out
800 TYPE(
pw_r3d_rs_type),
DIMENSION(:, :),
POINTER :: drho_r_in, drho_r_out
803 CALL timeset(routinen, handle)
805 cpassert(mspin == 1 .OR. mspin == 2)
806 ospin = 1._dp/real(mspin, kind=
dp)
807 IF (
PRESENT(factor))
THEN
813 NULLIFY (rho_ao_in, rho_ao_kp_in, rho_ao_im_in, rho_r_in, rho_g_in, drho_r_in, &
814 drho_g_in, tau_r_in, tau_g_in, tot_rho_r_in, tot_rho_g_in, rho_r_sccs_in)
818 rho_ao_kp=rho_ao_kp_in, &
819 rho_ao_im=rho_ao_im_in, &
826 tot_rho_r=tot_rho_r_in, &
827 tot_rho_g=tot_rho_g_in, &
828 rho_g_valid=rho_g_valid_in, &
829 rho_r_valid=rho_r_valid_in, &
830 drho_g_valid=drho_g_valid_in, &
831 drho_r_valid=drho_r_valid_in, &
832 tau_r_valid=tau_r_valid_in, &
833 tau_g_valid=tau_g_valid_in, &
834 rho_r_sccs=rho_r_sccs_in, &
835 soft_valid=soft_valid_in, &
836 complex_rho_ao=complex_rho_ao)
838 NULLIFY (rho_ao_out, rho_ao_im_out, rho_r_out, rho_g_out, drho_r_out, &
839 drho_g_out, tau_r_out, tau_g_out, tot_rho_r_out, tot_rho_g_out, rho_r_sccs_out)
841 IF (
ASSOCIATED(rho_ao_in))
THEN
842 nspins =
SIZE(rho_ao_in)
843 cpassert(mspin >= nspins)
845 CALL qs_rho_set(rho_output, rho_ao=rho_ao_out)
846 IF (mspin > nspins)
THEN
848 ALLOCATE (rho_ao_out(i)%matrix)
849 CALL dbcsr_copy(rho_ao_out(i)%matrix, rho_ao_in(1)%matrix, name=
"RHO copy")
854 ALLOCATE (rho_ao_out(i)%matrix)
855 CALL dbcsr_copy(rho_ao_out(i)%matrix, rho_ao_in(i)%matrix, name=
"RHO copy")
867 IF (
ASSOCIATED(rho_ao_im_in))
THEN
868 nspins =
SIZE(rho_ao_im_in)
869 cpassert(mspin >= nspins)
871 CALL qs_rho_set(rho_output, rho_ao_im=rho_ao_im_out)
872 IF (mspin > nspins)
THEN
874 ALLOCATE (rho_ao_im_out(i)%matrix)
875 CALL dbcsr_copy(rho_ao_im_out(i)%matrix, rho_ao_im_in(1)%matrix, name=
"RHO copy")
880 ALLOCATE (rho_ao_im_out(i)%matrix)
881 CALL dbcsr_copy(rho_ao_im_out(i)%matrix, rho_ao_im_in(i)%matrix, name=
"RHO copy")
887 IF (
ASSOCIATED(rho_r_in))
THEN
888 nspins =
SIZE(rho_r_in)
889 cpassert(mspin >= nspins)
890 ALLOCATE (rho_r_out(mspin))
892 IF (mspin > nspins)
THEN
894 CALL auxbas_pw_pool%create_pw(rho_r_out(i))
895 CALL pw_copy(rho_r_in(1), rho_r_out(i))
900 CALL auxbas_pw_pool%create_pw(rho_r_out(i))
901 CALL pw_copy(rho_r_in(i), rho_r_out(i))
907 IF (
ASSOCIATED(rho_g_in))
THEN
908 nspins =
SIZE(rho_g_in)
909 cpassert(mspin >= nspins)
910 ALLOCATE (rho_g_out(mspin))
912 IF (mspin > nspins)
THEN
914 CALL auxbas_pw_pool%create_pw(rho_g_out(i))
915 CALL pw_copy(rho_g_in(1), rho_g_out(i))
920 CALL auxbas_pw_pool%create_pw(rho_g_out(i))
921 CALL pw_copy(rho_g_in(i), rho_g_out(i))
927 IF (
ASSOCIATED(rho_r_sccs_in))
THEN
928 CALL qs_rho_set(rho_output, rho_r_sccs=rho_r_sccs_out)
929 CALL auxbas_pw_pool%create_pw(rho_r_sccs_out)
930 CALL pw_copy(rho_r_sccs_in, rho_r_sccs_out)
934 IF (
ASSOCIATED(drho_r_in))
THEN
935 nspins =
SIZE(drho_r_in)
936 cpassert(mspin >= nspins)
937 ALLOCATE (drho_r_out(3, mspin))
938 CALL qs_rho_set(rho_output, drho_r=drho_r_out)
939 IF (mspin > nspins)
THEN
942 CALL auxbas_pw_pool%create_pw(drho_r_out(i, j))
943 CALL pw_copy(drho_r_in(i, 1), drho_r_out(i, j))
944 CALL pw_scale(drho_r_out(i, j), ospin)
950 CALL auxbas_pw_pool%create_pw(drho_r_out(i, j))
951 CALL pw_copy(drho_r_in(i, j), drho_r_out(i, j))
958 IF (
ASSOCIATED(drho_g_in))
THEN
959 nspins =
SIZE(drho_g_in)
960 cpassert(mspin >= nspins)
961 ALLOCATE (drho_g_out(3, mspin))
962 CALL qs_rho_set(rho_output, drho_g=drho_g_out)
963 IF (mspin > nspins)
THEN
966 CALL auxbas_pw_pool%create_pw(drho_g_out(i, j))
967 CALL pw_copy(drho_g_in(i, 1), drho_g_out(i, j))
968 CALL pw_scale(drho_g_out(i, j), ospin)
974 CALL auxbas_pw_pool%create_pw(drho_g_out(i, j))
975 CALL pw_copy(drho_g_in(i, j), drho_g_out(i, j))
982 IF (
ASSOCIATED(tau_r_in))
THEN
983 nspins =
SIZE(tau_r_in)
984 cpassert(mspin >= nspins)
985 ALLOCATE (tau_r_out(mspin))
987 IF (mspin > nspins)
THEN
989 CALL auxbas_pw_pool%create_pw(tau_r_out(i))
990 CALL pw_copy(tau_r_in(1), tau_r_out(i))
995 CALL auxbas_pw_pool%create_pw(tau_r_out(i))
996 CALL pw_copy(tau_r_in(i), tau_r_out(i))
1002 IF (
ASSOCIATED(tau_g_in))
THEN
1003 nspins =
SIZE(tau_g_in)
1004 cpassert(mspin >= nspins)
1005 ALLOCATE (tau_g_out(mspin))
1007 IF (mspin > nspins)
THEN
1009 CALL auxbas_pw_pool%create_pw(tau_g_out(i))
1010 CALL pw_copy(tau_g_in(1), tau_g_out(i))
1015 CALL auxbas_pw_pool%create_pw(tau_g_out(i))
1016 CALL pw_copy(tau_g_in(i), tau_g_out(i))
1022 IF (
ASSOCIATED(tot_rho_r_in))
THEN
1023 nspins =
SIZE(tot_rho_r_in)
1024 cpassert(mspin >= nspins)
1025 ALLOCATE (tot_rho_r_out(mspin))
1026 CALL qs_rho_set(rho_output, tot_rho_r=tot_rho_r_out)
1027 IF (mspin > nspins)
THEN
1029 tot_rho_r_out(i) = tot_rho_r_in(1)*ospin
1033 tot_rho_r_out(i) = tot_rho_r_in(i)
1039 IF (
ASSOCIATED(tot_rho_g_in))
THEN
1040 nspins =
SIZE(tot_rho_g_in)
1041 cpassert(mspin >= nspins)
1042 ALLOCATE (tot_rho_g_out(mspin))
1043 CALL qs_rho_set(rho_output, tot_rho_g=tot_rho_g_out)
1044 IF (mspin > nspins)
THEN
1046 tot_rho_g_out(i) = tot_rho_g_in(1)*ospin
1050 tot_rho_g_out(i) = tot_rho_g_in(i)
1056 rho_g_valid=rho_g_valid_in, &
1057 rho_r_valid=rho_r_valid_in, &
1058 drho_g_valid=drho_g_valid_in, &
1059 drho_r_valid=drho_r_valid_in, &
1060 tau_r_valid=tau_r_valid_in, &
1061 tau_g_valid=tau_g_valid_in, &
1062 soft_valid=soft_valid_in, &
1063 complex_rho_ao=complex_rho_ao)
1065 CALL timestop(handle)
1083 CHARACTER(len=*),
PARAMETER :: routinen =
'qs_rho_transfer'
1085 INTEGER :: handle, i, j, nspins
1086 LOGICAL :: complex_rho_ao, drho_g_valid_in, drho_r_valid_in, rho_g_valid_in, rho_r_valid_in, &
1087 soft_valid_in, tau_g_valid_in, tau_r_valid_in
1088 REAL(kind=
dp),
DIMENSION(:),
POINTER :: tot_rho_g_in, tot_rho_g_out, &
1089 tot_rho_r_in, tot_rho_r_out
1090 TYPE(
dbcsr_p_type),
DIMENSION(:),
POINTER :: rho_ao_im_in, rho_ao_im_out, rho_ao_in, &
1092 TYPE(
dbcsr_p_type),
DIMENSION(:, :),
POINTER :: rho_ao_kp_in
1093 TYPE(
pw_c1d_gs_type),
DIMENSION(:),
POINTER :: rho_g_in, rho_g_out, tau_g_in, tau_g_out
1094 TYPE(
pw_c1d_gs_type),
DIMENSION(:, :),
POINTER :: drho_g_in, drho_g_out
1095 TYPE(
pw_r3d_rs_type),
DIMENSION(:),
POINTER :: rho_r_in, rho_r_out, tau_r_in, tau_r_out
1096 TYPE(
pw_r3d_rs_type),
DIMENSION(:, :),
POINTER :: drho_r_in, drho_r_out
1099 CALL timeset(routinen, handle)
1103 NULLIFY (rho_ao_in, rho_ao_kp_in, rho_ao_im_in, rho_r_in, rho_g_in, drho_r_in, &
1104 drho_g_in, tau_r_in, tau_g_in, tot_rho_r_in, tot_rho_g_in, rho_r_sccs_in)
1108 rho_ao_kp=rho_ao_kp_in, &
1109 rho_ao_im=rho_ao_im_in, &
1116 tot_rho_r=tot_rho_r_in, &
1117 tot_rho_g=tot_rho_g_in, &
1118 rho_g_valid=rho_g_valid_in, &
1119 rho_r_valid=rho_r_valid_in, &
1120 drho_g_valid=drho_g_valid_in, &
1121 drho_r_valid=drho_r_valid_in, &
1122 tau_r_valid=tau_r_valid_in, &
1123 tau_g_valid=tau_g_valid_in, &
1124 rho_r_sccs=rho_r_sccs_in, &
1125 soft_valid=soft_valid_in, &
1126 complex_rho_ao=complex_rho_ao)
1128 NULLIFY (rho_ao_out, rho_ao_im_out, rho_r_out, rho_g_out, drho_r_out, &
1129 drho_g_out, tau_r_out, tau_g_out, tot_rho_r_out, tot_rho_g_out, rho_r_sccs_out)
1131 IF (
ASSOCIATED(rho_ao_in))
THEN
1132 nspins =
SIZE(rho_ao_in)
1134 CALL qs_rho_set(rho_output, rho_ao=rho_ao_out)
1136 ALLOCATE (rho_ao_out(i)%matrix)
1137 CALL dbcsr_copy(rho_ao_out(i)%matrix, rho_ao_in(i)%matrix, name=
"RHO copy")
1148 IF (
ASSOCIATED(rho_ao_im_in))
THEN
1149 nspins =
SIZE(rho_ao_im_in)
1151 CALL qs_rho_set(rho_output, rho_ao_im=rho_ao_im_out)
1153 ALLOCATE (rho_ao_im_out(i)%matrix)
1154 CALL dbcsr_copy(rho_ao_im_out(i)%matrix, rho_ao_im_in(i)%matrix, name=
"RHO copy")
1159 IF (
ASSOCIATED(rho_g_in))
THEN
1160 nspins =
SIZE(rho_g_in)
1161 ALLOCATE (rho_g_out(nspins))
1163 IF (
ASSOCIATED(rho_r_in))
THEN
1164 ALLOCATE (rho_r_out(nspins))
1168 CALL out_pw_pool%create_pw(rho_g_out(i))
1170 IF (
ASSOCIATED(rho_r_in))
THEN
1171 CALL out_pw_pool%create_pw(rho_r_out(i))
1175 ELSE IF (
ASSOCIATED(rho_r_in))
THEN
1176 nspins =
SIZE(rho_r_in)
1177 ALLOCATE (rho_r_out(nspins))
1180 CALL out_pw_pool%create_pw(rho_r_out(i))
1183 CALL in_pw_pool%create_pw(grho_in)
1184 CALL out_pw_pool%create_pw(grho_out)
1188 CALL out_pw_pool%give_back_pw(grho_out)
1189 CALL in_pw_pool%give_back_pw(grho_in)
1195 IF (
ASSOCIATED(rho_r_sccs_in))
THEN
1196 CALL qs_rho_set(rho_output, rho_r_sccs=rho_r_sccs_out)
1197 CALL out_pw_pool%create_pw(rho_r_sccs_out)
1200 CALL in_pw_pool%create_pw(grho_in)
1201 CALL out_pw_pool%create_pw(grho_out)
1205 CALL out_pw_pool%give_back_pw(grho_out)
1206 CALL in_pw_pool%give_back_pw(grho_in)
1211 IF (
ASSOCIATED(drho_g_in))
THEN
1212 nspins =
SIZE(drho_g_in)
1213 ALLOCATE (drho_g_out(3, nspins))
1214 CALL qs_rho_set(rho_output, drho_g=drho_g_out)
1215 IF (
ASSOCIATED(drho_r_in))
THEN
1216 ALLOCATE (drho_r_out(3, nspins))
1217 CALL qs_rho_set(rho_output, drho_r=drho_r_out)
1221 CALL out_pw_pool%create_pw(drho_g_out(j, i))
1222 CALL pw_transfer(drho_g_in(j, i), drho_g_out(j, i))
1223 IF (
ASSOCIATED(drho_r_in))
THEN
1224 CALL out_pw_pool%create_pw(drho_r_out(j, i))
1225 CALL pw_transfer(drho_g_out(j, i), drho_r_out(j, i))
1229 ELSE IF (
ASSOCIATED(drho_r_in))
THEN
1230 nspins =
SIZE(drho_r_in)
1231 ALLOCATE (drho_r_out(3, nspins))
1232 CALL qs_rho_set(rho_output, drho_r=drho_r_out)
1235 TYPE(pw_c1d_gs_type) :: grho_in, grho_out
1236 CALL in_pw_pool%create_pw(grho_in)
1237 CALL out_pw_pool%create_pw(grho_out)
1239 CALL out_pw_pool%create_pw(drho_r_out(j, i))
1240 CALL pw_transfer(drho_r_in(j, i), grho_in)
1241 CALL pw_transfer(grho_in, grho_out)
1242 CALL pw_transfer(grho_out, drho_r_out(j, i))
1244 CALL out_pw_pool%give_back_pw(grho_out)
1245 CALL in_pw_pool%give_back_pw(grho_in)
1251 IF (
ASSOCIATED(tau_g_in))
THEN
1252 nspins =
SIZE(tau_g_in)
1253 ALLOCATE (tau_g_out(nspins))
1254 CALL qs_rho_set(rho_output, tau_g=tau_g_out)
1255 IF (
ASSOCIATED(tau_r_in))
THEN
1256 ALLOCATE (tau_r_out(nspins))
1257 CALL qs_rho_set(rho_output, tau_r=tau_r_out)
1260 CALL out_pw_pool%create_pw(tau_g_out(i))
1261 CALL pw_transfer(tau_g_in(i), tau_g_out(i))
1262 IF (
ASSOCIATED(tau_r_in))
THEN
1263 CALL out_pw_pool%create_pw(tau_r_out(i))
1264 CALL pw_transfer(tau_g_out(i), tau_r_out(i))
1267 ELSE IF (
ASSOCIATED(tau_r_in))
THEN
1268 nspins =
SIZE(tau_r_in)
1269 ALLOCATE (tau_r_out(nspins))
1270 CALL qs_rho_set(rho_output, tau_r=tau_r_out)
1272 CALL out_pw_pool%create_pw(tau_r_out(i))
1274 TYPE(pw_c1d_gs_type) :: gtau_in, gtau_out
1275 CALL in_pw_pool%create_pw(gtau_in)
1276 CALL out_pw_pool%create_pw(gtau_out)
1277 CALL pw_transfer(tau_r_in(i), gtau_in)
1278 CALL pw_transfer(gtau_in, gtau_out)
1279 CALL pw_transfer(gtau_out, tau_r_out(i))
1280 CALL out_pw_pool%give_back_pw(gtau_out)
1281 CALL in_pw_pool%give_back_pw(gtau_in)
1287 IF (
ASSOCIATED(tot_rho_r_in))
THEN
1288 nspins =
SIZE(tot_rho_r_in)
1289 ALLOCATE (tot_rho_r_out(nspins))
1290 CALL qs_rho_set(rho_output, tot_rho_r=tot_rho_r_out)
1292 tot_rho_r_out(i) = tot_rho_r_in(i)
1297 IF (
ASSOCIATED(tot_rho_g_in))
THEN
1298 nspins =
SIZE(tot_rho_g_in)
1299 ALLOCATE (tot_rho_g_out(nspins))
1300 CALL qs_rho_set(rho_output, tot_rho_g=tot_rho_g_out)
1302 tot_rho_g_out(i) = tot_rho_g_in(i)
1306 CALL qs_rho_set(rho_output, &
1307 rho_g_valid=rho_g_valid_in, &
1308 rho_r_valid=rho_r_valid_in, &
1309 drho_g_valid=drho_g_valid_in, &
1310 drho_r_valid=drho_r_valid_in, &
1311 tau_r_valid=tau_r_valid_in, &
1312 tau_g_valid=tau_g_valid_in, &
1313 soft_valid=soft_valid_in, &
1314 complex_rho_ao=complex_rho_ao)
1316 CALL timestop(handle)
1329 TYPE(qs_rho_type),
INTENT(IN) :: rhoa, rhob
1330 REAL(kind=dp),
INTENT(IN) :: alpha, beta
1332 CHARACTER(len=*),
PARAMETER :: routinen =
'qs_rho_scale_and_add_b'
1335 REAL(kind=dp),
DIMENSION(:),
POINTER :: tot_rho_g_a, tot_rho_g_b, tot_rho_r_a, &
1337 TYPE(dbcsr_p_type),
DIMENSION(:),
POINTER :: rho_ao_a, rho_ao_b, rho_ao_im_a, &
1339 TYPE(pw_c1d_gs_type),
DIMENSION(:),
POINTER :: rho_g_a, rho_g_b, tau_g_a, tau_g_b
1340 TYPE(pw_c1d_gs_type),
DIMENSION(:, :),
POINTER :: drho_g_a, drho_g_b
1341 TYPE(pw_r3d_rs_type),
DIMENSION(:),
POINTER :: rho_r_a, rho_r_b, tau_r_a, tau_r_b
1342 TYPE(pw_r3d_rs_type),
DIMENSION(:, :),
POINTER :: drho_r_a, drho_r_b
1343 TYPE(pw_r3d_rs_type),
POINTER :: rho_r_sccs_a, rho_r_sccs_b
1345 CALL timeset(routinen, handle)
1347 NULLIFY (rho_ao_a, rho_ao_im_a, rho_r_a, rho_g_a, drho_r_a, &
1348 drho_g_a, tau_r_a, tau_g_a, tot_rho_r_a, tot_rho_g_a, rho_r_sccs_a)
1350 CALL qs_rho_get(rhoa, &
1352 rho_ao_im=rho_ao_im_a, &
1359 tot_rho_r=tot_rho_r_a, &
1360 tot_rho_g=tot_rho_g_a, &
1361 rho_r_sccs=rho_r_sccs_a)
1363 NULLIFY (rho_ao_b, rho_ao_im_b, rho_r_b, rho_g_b, drho_r_b, &
1364 drho_g_b, tau_r_b, tau_g_b, tot_rho_r_b, tot_rho_g_b, rho_r_sccs_b)
1366 CALL qs_rho_get(rhob, &
1368 rho_ao_im=rho_ao_im_b, &
1375 tot_rho_r=tot_rho_r_b, &
1376 tot_rho_g=tot_rho_g_b, &
1377 rho_r_sccs=rho_r_sccs_b)
1379 IF (
ASSOCIATED(rho_ao_a) .AND.
ASSOCIATED(rho_ao_b))
THEN
1380 CALL dbcsr_add(rho_ao_a(2)%matrix, rho_ao_b(1)%matrix, alpha, beta)
1384 IF (
ASSOCIATED(rho_ao_im_a) .AND.
ASSOCIATED(rho_ao_im_b))
THEN
1385 CALL dbcsr_add(rho_ao_im_a(2)%matrix, rho_ao_im_b(1)%matrix, alpha, beta)
1389 IF (
ASSOCIATED(rho_r_a) .AND.
ASSOCIATED(rho_r_b))
THEN
1390 CALL pw_axpy(rho_r_b(1), rho_r_a(2), beta, alpha)
1394 IF (
ASSOCIATED(rho_g_a) .AND.
ASSOCIATED(rho_g_b))
THEN
1395 CALL pw_axpy(rho_g_b(1), rho_g_a(2), beta, alpha)
1399 IF (
ASSOCIATED(rho_r_sccs_a) .AND.
ASSOCIATED(rho_r_sccs_b))
THEN
1400 CALL pw_axpy(rho_r_sccs_b, rho_r_sccs_a, beta, alpha)
1404 IF (
ASSOCIATED(drho_r_a) .AND.
ASSOCIATED(drho_r_b))
THEN
1405 cpassert(
ASSOCIATED(drho_r_a) .AND.
ASSOCIATED(drho_r_b))
1409 IF (
ASSOCIATED(drho_g_a) .AND.
ASSOCIATED(drho_g_b))
THEN
1410 cpassert(
ASSOCIATED(drho_g_a) .AND.
ASSOCIATED(drho_g_b))
1414 IF (
ASSOCIATED(tau_r_a) .AND.
ASSOCIATED(tau_r_b))
THEN
1415 CALL pw_axpy(tau_r_b(1), tau_r_a(2), beta, alpha)
1419 IF (
ASSOCIATED(tau_g_a) .AND.
ASSOCIATED(tau_g_b))
THEN
1420 CALL pw_axpy(tau_g_b(1), tau_g_a(2), beta, alpha)
1424 IF (
ASSOCIATED(tot_rho_r_a) .AND.
ASSOCIATED(tot_rho_r_b))
THEN
1425 tot_rho_r_a(2) = alpha*tot_rho_r_a(2) + beta*tot_rho_r_b(1)
1429 IF (
ASSOCIATED(tot_rho_g_a) .AND.
ASSOCIATED(tot_rho_g_b))
THEN
1430 tot_rho_g_a(2) = alpha*tot_rho_g_a(2) + beta*tot_rho_g_b(1)
1433 CALL timestop(handle)
1446 TYPE(qs_rho_type),
INTENT(IN) :: rhoa, rhob
1447 REAL(kind=dp),
INTENT(IN) :: alpha, beta
1449 CHARACTER(len=*),
PARAMETER :: routinen =
'qs_rho_scale_and_add'
1451 INTEGER :: handle, i, j, nspina, nspinb, nspins
1452 REAL(kind=dp),
DIMENSION(:),
POINTER :: tot_rho_g_a, tot_rho_g_b, tot_rho_r_a, &
1454 TYPE(dbcsr_p_type),
DIMENSION(:),
POINTER :: rho_ao_a, rho_ao_b, rho_ao_im_a, &
1456 TYPE(pw_c1d_gs_type),
DIMENSION(:),
POINTER :: rho_g_a, rho_g_b, tau_g_a, tau_g_b
1457 TYPE(pw_c1d_gs_type),
DIMENSION(:, :),
POINTER :: drho_g_a, drho_g_b
1458 TYPE(pw_r3d_rs_type),
DIMENSION(:),
POINTER :: rho_r_a, rho_r_b, tau_r_a, tau_r_b
1459 TYPE(pw_r3d_rs_type),
DIMENSION(:, :),
POINTER :: drho_r_a, drho_r_b
1460 TYPE(pw_r3d_rs_type),
POINTER :: rho_r_sccs_a, rho_r_sccs_b
1462 CALL timeset(routinen, handle)
1464 NULLIFY (rho_ao_a, rho_ao_im_a, rho_r_a, rho_g_a, drho_r_a, &
1465 drho_g_a, tau_r_a, tau_g_a, tot_rho_r_a, tot_rho_g_a, rho_r_sccs_a)
1467 CALL qs_rho_get(rhoa, &
1469 rho_ao_im=rho_ao_im_a, &
1476 tot_rho_r=tot_rho_r_a, &
1477 tot_rho_g=tot_rho_g_a, &
1478 rho_r_sccs=rho_r_sccs_a)
1480 NULLIFY (rho_ao_b, rho_ao_im_b, rho_r_b, rho_g_b, drho_r_b, &
1481 drho_g_b, tau_r_b, tau_g_b, tot_rho_r_b, tot_rho_g_b, rho_r_sccs_b)
1483 CALL qs_rho_get(rhob, &
1485 rho_ao_im=rho_ao_im_b, &
1492 tot_rho_r=tot_rho_r_b, &
1493 tot_rho_g=tot_rho_g_b, &
1494 rho_r_sccs=rho_r_sccs_b)
1496 IF (
ASSOCIATED(rho_ao_a) .AND.
ASSOCIATED(rho_ao_b))
THEN
1497 nspina =
SIZE(rho_ao_a)
1498 nspinb =
SIZE(rho_ao_b)
1499 nspins = min(nspina, nspinb)
1501 CALL dbcsr_add(rho_ao_a(i)%matrix, rho_ao_b(i)%matrix, alpha, beta)
1506 IF (
ASSOCIATED(rho_ao_im_a) .AND.
ASSOCIATED(rho_ao_im_b))
THEN
1507 nspina =
SIZE(rho_ao_im_a)
1508 nspinb =
SIZE(rho_ao_im_b)
1509 nspins = min(nspina, nspinb)
1511 CALL dbcsr_add(rho_ao_im_a(i)%matrix, rho_ao_im_b(i)%matrix, alpha, beta)
1516 IF (
ASSOCIATED(rho_r_a) .AND.
ASSOCIATED(rho_r_b))
THEN
1517 nspina =
SIZE(rho_ao_a)
1518 nspinb =
SIZE(rho_ao_b)
1519 nspins = min(nspina, nspinb)
1521 CALL pw_axpy(rho_r_b(i), rho_r_a(i), beta, alpha)
1526 IF (
ASSOCIATED(rho_g_a) .AND.
ASSOCIATED(rho_g_b))
THEN
1527 nspina =
SIZE(rho_ao_a)
1528 nspinb =
SIZE(rho_ao_b)
1529 nspins = min(nspina, nspinb)
1531 CALL pw_axpy(rho_g_b(i), rho_g_a(i), beta, alpha)
1536 IF (
ASSOCIATED(rho_r_sccs_a) .AND.
ASSOCIATED(rho_r_sccs_b))
THEN
1537 CALL pw_axpy(rho_r_sccs_b, rho_r_sccs_a, beta, alpha)
1541 IF (
ASSOCIATED(drho_r_a) .AND.
ASSOCIATED(drho_r_b))
THEN
1542 cpassert(all(shape(drho_r_a) == shape(drho_r_b)))
1543 DO j = 1,
SIZE(drho_r_a, 2)
1544 DO i = 1,
SIZE(drho_r_a, 1)
1545 CALL pw_axpy(drho_r_b(i, j), drho_r_a(i, j), beta, alpha)
1551 IF (
ASSOCIATED(drho_g_a) .AND.
ASSOCIATED(drho_g_b))
THEN
1552 cpassert(all(shape(drho_g_a) == shape(drho_g_b)))
1553 DO j = 1,
SIZE(drho_g_a, 2)
1554 DO i = 1,
SIZE(drho_g_a, 1)
1555 CALL pw_axpy(drho_g_b(i, j), drho_g_a(i, j), beta, alpha)
1561 IF (
ASSOCIATED(tau_r_a) .AND.
ASSOCIATED(tau_r_b))
THEN
1562 nspina =
SIZE(rho_ao_a)
1563 nspinb =
SIZE(rho_ao_b)
1564 nspins = min(nspina, nspinb)
1566 CALL pw_axpy(tau_r_b(i), tau_r_a(i), beta, alpha)
1571 IF (
ASSOCIATED(tau_g_a) .AND.
ASSOCIATED(tau_g_b))
THEN
1572 nspina =
SIZE(rho_ao_a)
1573 nspinb =
SIZE(rho_ao_b)
1574 nspins = min(nspina, nspinb)
1576 CALL pw_axpy(tau_g_b(i), tau_g_a(i), beta, alpha)
1581 IF (
ASSOCIATED(tot_rho_r_a) .AND.
ASSOCIATED(tot_rho_r_b))
THEN
1582 nspina =
SIZE(rho_ao_a)
1583 nspinb =
SIZE(rho_ao_b)
1584 nspins = min(nspina, nspinb)
1586 tot_rho_r_a(i) = alpha*tot_rho_r_a(i) + beta*tot_rho_r_b(i)
1591 IF (
ASSOCIATED(tot_rho_g_a) .AND.
ASSOCIATED(tot_rho_g_b))
THEN
1592 nspina =
SIZE(rho_ao_a)
1593 nspinb =
SIZE(rho_ao_b)
1594 nspins = min(nspina, nspinb)
1596 tot_rho_g_a(i) = alpha*tot_rho_g_a(i) + beta*tot_rho_g_b(i)
1600 CALL timestop(handle)
1618 TYPE(qs_rho_type),
INTENT(INOUT) :: rho_input, rho_output
1619 TYPE(qs_environment_type),
POINTER :: qs_env
1621 CHARACTER(len=*),
PARAMETER :: routinen =
'duplicate_rho_type'
1623 INTEGER :: handle, i, j, nspins
1624 LOGICAL :: complex_rho_ao_in, drho_g_valid_in, drho_r_valid_in, rho_g_valid_in, &
1625 rho_r_valid_in, soft_valid_in, tau_g_valid_in, tau_r_valid_in
1626 REAL(kind=dp),
DIMENSION(:),
POINTER :: tot_rho_g_in, tot_rho_g_out, &
1627 tot_rho_r_in, tot_rho_r_out
1628 TYPE(dbcsr_p_type),
DIMENSION(:),
POINTER :: rho_ao_im_in, rho_ao_im_out, rho_ao_in, &
1630 TYPE(dft_control_type),
POINTER :: dft_control
1631 TYPE(pw_c1d_gs_type),
DIMENSION(:),
POINTER :: rho_g_in, rho_g_out, tau_g_in, tau_g_out
1632 TYPE(pw_c1d_gs_type),
DIMENSION(:, :),
POINTER :: drho_g_in, drho_g_out
1633 TYPE(pw_env_type),
POINTER :: pw_env
1634 TYPE(pw_pool_type),
POINTER :: auxbas_pw_pool
1635 TYPE(pw_r3d_rs_type),
DIMENSION(:),
POINTER :: rho_r_in, rho_r_out, tau_r_in, tau_r_out
1636 TYPE(pw_r3d_rs_type),
DIMENSION(:, :),
POINTER :: drho_r_in, drho_r_out
1637 TYPE(pw_r3d_rs_type),
POINTER :: rho_r_sccs_in, rho_r_sccs_out
1639 CALL timeset(routinen, handle)
1641 NULLIFY (dft_control, pw_env, auxbas_pw_pool)
1642 NULLIFY (rho_ao_in, rho_ao_out, rho_ao_im_in, rho_ao_im_out)
1643 NULLIFY (rho_r_in, rho_r_out, rho_g_in, rho_g_out, drho_r_in, drho_r_out)
1644 NULLIFY (drho_g_in, drho_g_out, tau_r_in, tau_r_out, tau_g_in, tau_g_out)
1645 NULLIFY (tot_rho_r_in, tot_rho_r_out, tot_rho_g_in, tot_rho_g_out)
1646 NULLIFY (rho_r_sccs_in, rho_r_sccs_out)
1648 cpassert(
ASSOCIATED(qs_env))
1650 CALL get_qs_env(qs_env=qs_env, pw_env=pw_env, dft_control=dft_control)
1651 CALL pw_env_get(pw_env=pw_env, auxbas_pw_pool=auxbas_pw_pool)
1652 nspins = dft_control%nspins
1654 CALL qs_rho_clear(rho_output)
1656 CALL qs_rho_get(rho_input, &
1658 rho_ao_im=rho_ao_im_in, &
1665 tot_rho_r=tot_rho_r_in, &
1666 tot_rho_g=tot_rho_g_in, &
1667 rho_g_valid=rho_g_valid_in, &
1668 rho_r_valid=rho_r_valid_in, &
1669 drho_g_valid=drho_g_valid_in, &
1670 drho_r_valid=drho_r_valid_in, &
1671 tau_r_valid=tau_r_valid_in, &
1672 tau_g_valid=tau_g_valid_in, &
1673 rho_r_sccs=rho_r_sccs_in, &
1674 soft_valid=soft_valid_in, &
1675 complex_rho_ao=complex_rho_ao_in)
1678 IF (
ASSOCIATED(rho_ao_in))
THEN
1679 CALL dbcsr_allocate_matrix_set(rho_ao_out, nspins)
1680 CALL qs_rho_set(rho_output, rho_ao=rho_ao_out)
1682 ALLOCATE (rho_ao_out(i)%matrix)
1683 CALL dbcsr_copy(rho_ao_out(i)%matrix, rho_ao_in(i)%matrix, &
1684 name=
"myDensityMatrix_for_Spin_"//trim(adjustl(cp_to_string(i))))
1685 CALL dbcsr_set(rho_ao_out(i)%matrix, 0.0_dp)
1690 IF (
ASSOCIATED(rho_ao_im_in))
THEN
1691 CALL dbcsr_allocate_matrix_set(rho_ao_im_out, nspins)
1692 CALL qs_rho_set(rho_output, rho_ao=rho_ao_im_out)
1694 ALLOCATE (rho_ao_im_out(i)%matrix)
1695 CALL dbcsr_copy(rho_ao_im_out(i)%matrix, rho_ao_im_in(i)%matrix, &
1696 name=
"myImagDensityMatrix_for_Spin_"//trim(adjustl(cp_to_string(i))))
1697 CALL dbcsr_set(rho_ao_im_out(i)%matrix, 0.0_dp)
1702 IF (
ASSOCIATED(rho_r_in))
THEN
1703 ALLOCATE (rho_r_out(nspins))
1704 CALL qs_rho_set(rho_output, rho_r=rho_r_out)
1706 CALL auxbas_pw_pool%create_pw(rho_r_out(i))
1707 CALL pw_copy(rho_r_in(i), rho_r_out(i))
1712 IF (
ASSOCIATED(rho_g_in))
THEN
1713 ALLOCATE (rho_g_out(nspins))
1714 CALL qs_rho_set(rho_output, rho_g=rho_g_out)
1716 CALL auxbas_pw_pool%create_pw(rho_g_out(i))
1717 CALL pw_copy(rho_g_in(i), rho_g_out(i))
1722 IF (
ASSOCIATED(rho_r_sccs_in))
THEN
1723 CALL qs_rho_set(rho_output, rho_r_sccs=rho_r_sccs_out)
1724 CALL auxbas_pw_pool%create_pw(rho_r_sccs_out)
1725 CALL pw_copy(rho_r_sccs_in, rho_r_sccs_out)
1729 IF (dft_control%drho_by_collocation)
THEN
1731 IF (
ASSOCIATED(drho_r_in))
THEN
1732 ALLOCATE (drho_r_out(3, nspins))
1733 CALL qs_rho_set(rho_output, drho_r=drho_r_out)
1736 CALL auxbas_pw_pool%create_pw(drho_r_out(i, j))
1737 CALL pw_copy(drho_r_in(i, j), drho_r_out(i, j))
1743 IF (
ASSOCIATED(drho_g_in))
THEN
1744 ALLOCATE (drho_g_out(3, nspins))
1745 CALL qs_rho_set(rho_output, drho_g=drho_g_out)
1748 CALL auxbas_pw_pool%create_pw(drho_g_out(i, j))
1749 CALL pw_copy(drho_g_in(i, j), drho_g_out(i, j))
1758 IF (dft_control%use_kinetic_energy_density)
THEN
1760 IF (
ASSOCIATED(tau_r_in))
THEN
1761 ALLOCATE (tau_r_out(nspins))
1762 CALL qs_rho_set(rho_output, tau_r=tau_r_out)
1764 CALL auxbas_pw_pool%create_pw(tau_r_out(i))
1765 CALL pw_copy(tau_r_in(i), tau_r_out(i))
1770 IF (
ASSOCIATED(tau_g_in))
THEN
1771 ALLOCATE (tau_g_out(nspins))
1772 CALL qs_rho_set(rho_output, tau_g=tau_g_out)
1774 CALL auxbas_pw_pool%create_pw(tau_g_out(i))
1775 CALL pw_copy(tau_g_in(i), tau_g_out(i))
1780 CALL qs_rho_set(rho_output, &
1781 rho_g_valid=rho_g_valid_in, &
1782 rho_r_valid=rho_r_valid_in, &
1783 drho_g_valid=drho_g_valid_in, &
1784 drho_r_valid=drho_r_valid_in, &
1785 tau_r_valid=tau_r_valid_in, &
1786 tau_g_valid=tau_g_valid_in, &
1787 soft_valid=soft_valid_in, &
1788 complex_rho_ao=complex_rho_ao_in)
1791 IF (
ASSOCIATED(tot_rho_r_in))
THEN
1792 ALLOCATE (tot_rho_r_out(nspins))
1793 CALL qs_rho_set(rho_output, tot_rho_r=tot_rho_r_out)
1795 tot_rho_r_out(i) = tot_rho_r_in(i)
1800 IF (
ASSOCIATED(tot_rho_g_in))
THEN
1801 ALLOCATE (tot_rho_g_out(nspins))
1802 CALL qs_rho_set(rho_output, tot_rho_g=tot_rho_g_out)
1804 tot_rho_g_out(i) = tot_rho_g_in(i)
1809 CALL timestop(handle)
1819 TYPE(qs_rho_type),
POINTER :: rho
1820 TYPE(qs_environment_type),
POINTER :: qs_env
1822 CHARACTER(LEN=default_string_length) :: headline
1823 INTEGER :: i, ic, nimages, nspins
1824 TYPE(dbcsr_p_type),
DIMENSION(:, :),
POINTER :: rho_ao_im_kp, rho_ao_kp
1825 TYPE(dbcsr_type),
POINTER :: template
1826 TYPE(dft_control_type),
POINTER :: dft_control
1827 TYPE(neighbor_list_set_p_type),
DIMENSION(:), &
1830 NULLIFY (rho_ao_im_kp, rho_ao_kp, dft_control, template, sab_orb)
1832 CALL get_qs_env(qs_env, &
1833 dft_control=dft_control, &
1836 CALL qs_rho_get(rho, rho_ao_im_kp=rho_ao_im_kp, rho_ao_kp=rho_ao_kp)
1838 nspins = dft_control%nspins
1839 nimages = dft_control%nimages
1841 cpassert(nspins ==
SIZE(rho_ao_kp, 1))
1842 cpassert(nimages ==
SIZE(rho_ao_kp, 2))
1844 CALL dbcsr_allocate_matrix_set(rho_ao_im_kp, nspins, nimages)
1845 CALL qs_rho_set(rho, rho_ao_im_kp=rho_ao_im_kp)
1848 IF (nspins > 1)
THEN
1850 headline =
"IMAGINARY PART OF DENSITY MATRIX FOR ALPHA SPIN"
1852 headline =
"IMAGINARY PART OF DENSITY MATRIX FOR BETA SPIN"
1855 headline =
"IMAGINARY PART OF DENSITY MATRIX"
1857 ALLOCATE (rho_ao_im_kp(i, ic)%matrix)
1858 template => rho_ao_kp(i, ic)%matrix
1859 CALL dbcsr_create(matrix=rho_ao_im_kp(i, ic)%matrix, template=template, &
1860 name=trim(headline), matrix_type=dbcsr_type_antisymmetric)
1861 CALL cp_dbcsr_alloc_block_from_nbl(rho_ao_im_kp(i, ic)%matrix, sab_orb)
1862 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, inversion_symmetry_only, symmetry_backend, symmetry_reduction_method, gamma_centered, lattice_fft)
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, 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.
subroutine, public set_qs_env(qs_env, super_cell, mos, qmmm, qmmm_periodic, mimic, 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, rhoz_cneo_set, 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, do_rixs, tb_tblite)
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, harris_env, 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, exc_accint, 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_vhxc, 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, xcint_weights, 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, sab_cneo, 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 qs_rho_copy(rho_input, rho_output, auxbas_pw_pool, mspin, factor)
Allocate a density structure and fill it with data from an input structure SIZE(rho_input) == mspin =...
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_scale_and_add_b(rhoa, rhob, alpha, beta)
rhoa(2) = alpha*rhoa(2)+beta*rhob(1)
subroutine, public qs_rho_scale_and_add(rhoa, rhob, alpha, beta)
rhoa = alpha*rhoa+beta*rhob
subroutine, public qs_rho_transfer(rho_input, rho_output, in_pw_pool, out_pw_pool)
Allocate a density structure and fill it with data from an input structure Transfer all data to input...
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.