111#include "./base/base_uses.f90"
117 CHARACTER(len=*),
PARAMETER,
PRIVATE :: moduleN =
'mp2_ri_2c'
162 SUBROUTINE get_2c_integrals(qs_env, eri_method, eri_param, para_env, para_env_sub, mp2_memory, &
163 my_Lrows, my_Vrows, fm_matrix_PQ, ngroup, color_sub, dimen_RI, dimen_RI_red, &
164 kpoints, my_group_L_size, my_group_L_start, my_group_L_end, &
165 gd_array, calc_PQ_cond_num, do_svd, eps_svd, potential, ri_metric, &
166 cfm_matrix_L_kpoints, cfm_matrix_Minv_L_kpoints, fm_matrix_Minv_L_gamma, &
167 fm_matrix_Minv, fm_matrix_Minv_Vtrunc_Minv, &
168 do_im_time, do_kpoints, mp2_eps_pgf_orb_S, qs_kind_set, sab_orb_sub, calc_forces, unit_nr)
171 INTEGER,
INTENT(IN) :: eri_method
174 REAL(kind=
dp),
INTENT(IN) :: mp2_memory
175 REAL(kind=
dp),
ALLOCATABLE,
DIMENSION(:, :), &
176 INTENT(OUT) :: my_lrows, my_vrows
178 INTEGER,
INTENT(IN) :: ngroup, color_sub
179 INTEGER,
INTENT(OUT) :: dimen_ri, dimen_ri_red
181 INTEGER,
INTENT(OUT) :: my_group_l_size, my_group_l_start, &
184 LOGICAL,
INTENT(IN) :: calc_pq_cond_num, do_svd
185 REAL(kind=
dp),
INTENT(IN) :: eps_svd
186 TYPE(libint_potential_type) :: potential, ri_metric
187 TYPE(
cp_cfm_type),
ALLOCATABLE,
DIMENSION(:) :: cfm_matrix_l_kpoints, &
188 cfm_matrix_minv_l_kpoints
189 TYPE(
cp_fm_type),
ALLOCATABLE,
DIMENSION(:, :), &
190 INTENT(OUT) :: fm_matrix_minv_l_gamma
191 TYPE(
cp_fm_type),
ALLOCATABLE,
DIMENSION(:, :) :: fm_matrix_minv, &
192 fm_matrix_minv_vtrunc_minv
193 LOGICAL,
INTENT(IN) :: do_im_time, do_kpoints
194 REAL(kind=
dp),
INTENT(IN) :: mp2_eps_pgf_orb_s
195 TYPE(
qs_kind_type),
DIMENSION(:),
POINTER :: qs_kind_set
197 POINTER :: sab_orb_sub
198 LOGICAL,
INTENT(IN) :: calc_forces
199 INTEGER,
INTENT(IN) :: unit_nr
201 CHARACTER(LEN=*),
PARAMETER :: routinen =
'get_2c_integrals'
203 INTEGER :: handle, i_size, num_small_eigen
204 REAL(kind=
dp) :: cond_num, eps_pgf_orb_old
205 TYPE(
cp_cfm_type),
ALLOCATABLE,
DIMENSION(:) :: cfm_matrix_m_kpoints
206 TYPE(
cp_fm_type) :: fm_matrix_l_work, fm_matrix_m_inv_work, &
209 TYPE(libint_potential_type) :: trunc_coulomb
212 CALL timeset(routinen, handle)
215 CALL compute_2c_integrals(qs_env, eri_method, eri_param, para_env, para_env_sub, para_env_l, mp2_memory, &
216 fm_matrix_l_work, ngroup, color_sub, dimen_ri, &
217 my_group_l_size, my_group_l_start, my_group_l_end, &
218 gd_array, calc_pq_cond_num, cond_num, &
219 num_small_eigen, potential, sab_orb_sub, do_im_time=do_im_time)
221 IF (do_im_time .AND. calc_forces)
THEN
223 CALL cp_fm_create(fm_matrix_pq, fm_matrix_l_work%matrix_struct)
227 dimen_ri_red = dimen_ri
230 CALL decomp_mat_l(fm_matrix_l_work, do_svd, eps_svd, num_small_eigen, cond_num, .true., gd_array, ngroup, &
231 dimen_ri, dimen_ri_red, para_env)
236 CALL get_qs_env(qs_env, dft_control=dft_control)
239 eps_pgf_orb_old = dft_control%qs_control%eps_pgf_orb
240 dft_control%qs_control%eps_pgf_orb = mp2_eps_pgf_orb_s
245 ri_metric, kpoints, put_mat_ks_env=.true., &
246 regularization_ri=qs_env%mp2_env%ri_rpa_im_time%regularization_RI)
248 CALL ri_2c_integral_mat(qs_env, fm_matrix_minv_l_gamma, fm_matrix_l_work%matrix_struct, dimen_ri, &
249 ri_metric, put_mat_ks_env=.true., &
250 regularization_ri=qs_env%mp2_env%ri_rpa_im_time%regularization_RI)
254 dft_control%qs_control%eps_pgf_orb = eps_pgf_orb_old
263 ALLOCATE (fm_matrix_minv_l_gamma(1, 1))
266 CALL compute_2c_integrals(qs_env, eri_method, eri_param, para_env, para_env_sub, para_env_l, mp2_memory, &
267 fm_matrix_minv_l_gamma(1, 1), ngroup, color_sub, dimen_ri, &
268 my_group_l_size, my_group_l_start, my_group_l_end, &
269 gd_array, calc_pq_cond_num, cond_num, &
270 num_small_eigen, ri_metric, sab_orb_sub, &
271 fm_matrix_l_struct=fm_matrix_l_work%matrix_struct)
278 CALL compute_v_by_lattice_sum(qs_env, cfm_matrix_l_kpoints, fm_matrix_l_work%matrix_struct, kpoints)
281 cfm_matrix_minv_l_kpoints, dimen_ri, kpoints, &
282 qs_env%mp2_env%ri_rpa_im_time%eps_eigval_S)
283 DO i_size = 1,
SIZE(cfm_matrix_m_kpoints)
286 DEALLOCATE (cfm_matrix_m_kpoints)
291 CALL ri_2c_integral_mat(qs_env, fm_matrix_minv_vtrunc_minv, fm_matrix_l_work%matrix_struct, dimen_ri, trunc_coulomb, &
292 put_mat_ks_env=.false., regularization_ri=0.0_dp)
295 CALL ri_2c_integral_mat(qs_env, fm_matrix_minv, fm_matrix_l_work%matrix_struct, dimen_ri, ri_metric, &
296 put_mat_ks_env=.false., regularization_ri=0.0_dp)
298 CALL gamma_only_inversion_of_m_and_mult_with_chol_dec_of_vtrunc(fm_matrix_minv_vtrunc_minv, &
299 fm_matrix_minv, qs_env)
301 IF (calc_forces .AND. (.NOT. do_im_time))
THEN
303 CALL cp_fm_create(fm_matrix_v, fm_matrix_l_work%matrix_struct)
306 CALL decomp_mat_l(fm_matrix_v, do_svd, eps_svd, num_small_eigen, cond_num, .true., gd_array, ngroup, &
307 dimen_ri, dimen_ri_red, para_env)
310 CALL decomp_mat_l(fm_matrix_l_work, do_svd, eps_svd, num_small_eigen, cond_num, .false., gd_array, ngroup, &
311 dimen_ri, dimen_ri_red, para_env)
313 CALL decomp_mat_l(fm_matrix_minv_l_gamma(1, 1), .false., 0.0_dp, num_small_eigen, cond_num, .true., &
314 gd_array, ngroup, dimen_ri, dimen_ri_red, para_env)
316 CALL cp_fm_create(fm_matrix_m_inv_work, fm_matrix_minv_l_gamma(1, 1)%matrix_struct)
319 CALL parallel_gemm(
'N',
'T', dimen_ri, dimen_ri, dimen_ri, 1.0_dp, fm_matrix_minv_l_gamma(1, 1), &
320 fm_matrix_minv_l_gamma(1, 1), 0.0_dp, fm_matrix_m_inv_work)
324 CALL reset_size_matrix(fm_matrix_minv_l_gamma(1, 1), dimen_ri_red, fm_matrix_l_work%matrix_struct)
327 CALL parallel_gemm(
'T',
'N', dimen_ri, dimen_ri_red, dimen_ri, 1.0_dp, fm_matrix_m_inv_work, &
328 fm_matrix_l_work, 0.0_dp, fm_matrix_minv_l_gamma(1, 1))
331 CALL parallel_gemm(
'T',
'T', dimen_ri, dimen_ri, dimen_ri, 1.0_dp, fm_matrix_m_inv_work, &
332 fm_matrix_l_work, 0.0_dp, fm_matrix_minv_l_gamma(1, 1))
340 IF (.NOT. do_im_time)
THEN
342 CALL cp_cfm_to_fm(cfm_matrix_minv_l_kpoints(1), mtargetr=fm_matrix_l_work)
344 CALL cp_fm_to_fm(fm_matrix_minv_l_gamma(1, 1), fm_matrix_l_work)
353 CALL get_group_dist(gd_array, color_sub, my_group_l_start, my_group_l_end, my_group_l_size)
355 IF (.NOT. do_im_time)
THEN
356 IF (unit_nr > 0)
THEN
357 WRITE (unit=unit_nr, fmt=
"(T3,A,T75,i6)")
"RI_INFO| Cholesky decomposition group size:", para_env_l%num_pe
358 WRITE (unit=unit_nr, fmt=
"(T3,A,T75,i6)")
"RI_INFO| Number of groups for auxiliary basis functions", ngroup
359 IF (calc_pq_cond_num .OR. do_svd)
THEN
360 WRITE (unit=unit_nr, fmt=
"(T3,A,T67,ES14.5)") &
361 "RI_INFO| Condition number of the (P|Q):", cond_num
362 WRITE (unit=unit_nr, fmt=
"(T3,A,T75,i6)") &
363 "RI_INFO| Number of non-positive Eigenvalues of (P|Q):", num_small_eigen
369 CALL grep_lcols(fm_matrix_l_work, my_group_l_start, my_group_l_end, my_group_l_size, my_lrows)
371 qs_env%mp2_env%potential_parameter))
THEN
372 CALL grep_lcols(fm_matrix_v, my_group_l_start, my_group_l_end, my_group_l_size, my_vrows)
377 qs_env%mp2_env%potential_parameter)))
CALL cp_fm_release(fm_matrix_v)
380 CALL timestop(handle)
398 SUBROUTINE decomp_mat_l(fm_matrix_L, do_svd, eps_svd, num_small_eigen, cond_num, do_inversion, gd_array, ngroup, &
399 dimen_RI, dimen_RI_red, para_env)
401 TYPE(
cp_fm_type),
INTENT(INOUT) :: fm_matrix_l
402 LOGICAL,
INTENT(IN) :: do_svd
403 REAL(kind=
dp),
INTENT(IN) :: eps_svd
404 INTEGER,
INTENT(INOUT) :: num_small_eigen
405 REAL(kind=
dp),
INTENT(INOUT) :: cond_num
406 LOGICAL,
INTENT(IN) :: do_inversion
408 INTEGER,
INTENT(IN) :: ngroup, dimen_ri
409 INTEGER,
INTENT(INOUT) :: dimen_ri_red
413 CALL matrix_root_with_svd(fm_matrix_l, num_small_eigen, cond_num, eps_svd, do_inversion, para_env)
415 dimen_ri_red = dimen_ri - num_small_eigen
425 CALL cholesky_decomp(fm_matrix_l, dimen_ri, do_inversion=do_inversion)
427 IF (do_inversion)
CALL invert_mat(fm_matrix_l)
430 END SUBROUTINE decomp_mat_l
439 SUBROUTINE compute_v_by_lattice_sum(qs_env, cfm_matrix_L_kpoints, fm_matrix_L_struct, kpoints)
441 TYPE(
cp_cfm_type),
ALLOCATABLE,
DIMENSION(:) :: cfm_matrix_l_kpoints
445 CHARACTER(LEN=*),
PARAMETER :: routinen =
'compute_V_by_lattice_sum'
447 INTEGER :: handle, i_dim, ikp, nkp, nkp_extra, &
449 INTEGER,
DIMENSION(3) :: nkp_grid_orig, periodic
453 TYPE(
dbcsr_p_type),
DIMENSION(:, :),
POINTER :: matrix_s_ri_aux_transl, matrix_v_ri_kp
455 TYPE(
qs_kind_type),
DIMENSION(:),
POINTER :: qs_kind_set
457 CALL timeset(routinen, handle)
459 NULLIFY (matrix_s_ri_aux_transl, particle_set, cell, qs_kind_set)
462 matrix_s_ri_aux_kp=matrix_s_ri_aux_transl, &
463 particle_set=particle_set, &
465 qs_kind_set=qs_kind_set, &
466 atomic_kind_set=atomic_kind_set)
469 CALL get_cell(cell=cell, periodic=periodic)
471 IF (periodic(i_dim) == 1)
THEN
472 cpassert(
modulo(kpoints%nkp_grid(i_dim), 2) == 0)
478 ALLOCATE (cfm_matrix_l_kpoints(nkp))
480 CALL cp_cfm_create(cfm_matrix_l_kpoints(ikp), fm_matrix_l_struct)
484 CALL allocate_matrix_v_ri_kp(matrix_v_ri_kp, matrix_s_ri_aux_transl, nkp)
486 IF (qs_env%mp2_env%ri_rpa_im_time%do_extrapolate_kpoints)
THEN
488 nkp_orig = qs_env%mp2_env%ri_rpa_im_time%nkp_orig
489 nkp_extra = qs_env%mp2_env%ri_rpa_im_time%nkp_extra
492 cell=cell, particle_set=particle_set, qs_kind_set=qs_kind_set, &
493 atomic_kind_set=atomic_kind_set, &
494 size_lattice_sum=qs_env%mp2_env%mp2_gpw%size_lattice_sum, &
497 nkp_grid_orig = kpoints%nkp_grid
498 kpoints%nkp_grid(1:3) = qs_env%mp2_env%ri_rpa_im_time%kp_grid_extra(1:3)
501 cell=cell, particle_set=particle_set, qs_kind_set=qs_kind_set, &
502 atomic_kind_set=atomic_kind_set, &
503 size_lattice_sum=qs_env%mp2_env%mp2_gpw%size_lattice_sum, &
506 kpoints%nkp_grid = nkp_grid_orig
511 cell=cell, particle_set=particle_set, qs_kind_set=qs_kind_set, &
512 atomic_kind_set=atomic_kind_set, &
513 size_lattice_sum=qs_env%mp2_env%mp2_gpw%size_lattice_sum, &
519 CALL copy_dbcsr_pair_to_cfm(matrix_v_ri_kp(ikp, 1)%matrix, matrix_v_ri_kp(ikp, 2)%matrix, &
520 fm_matrix_l_work, cfm_matrix_l_kpoints(ikp))
526 CALL timestop(handle)
528 END SUBROUTINE compute_v_by_lattice_sum
536 SUBROUTINE allocate_matrix_v_ri_kp(matrix_v_RI_kp, matrix_s_RI_aux_transl, nkp)
538 TYPE(
dbcsr_p_type),
DIMENSION(:, :),
POINTER :: matrix_v_ri_kp, matrix_s_ri_aux_transl
543 NULLIFY (matrix_v_ri_kp)
548 ALLOCATE (matrix_v_ri_kp(ikp, 1)%matrix)
549 CALL dbcsr_create(matrix_v_ri_kp(ikp, 1)%matrix, template=matrix_s_ri_aux_transl(1, 1)%matrix, &
550 matrix_type=dbcsr_type_no_symmetry)
552 CALL dbcsr_set(matrix_v_ri_kp(ikp, 1)%matrix, 0.0_dp)
554 ALLOCATE (matrix_v_ri_kp(ikp, 2)%matrix)
555 CALL dbcsr_create(matrix_v_ri_kp(ikp, 2)%matrix, template=matrix_s_ri_aux_transl(1, 1)%matrix, &
556 matrix_type=dbcsr_type_no_symmetry)
558 CALL dbcsr_set(matrix_v_ri_kp(ikp, 2)%matrix, 0.0_dp)
562 END SUBROUTINE allocate_matrix_v_ri_kp
574 SUBROUTINE ri_2c_integral_mat(qs_env, fm_matrix_Minv_L_gamma, fm_matrix_L_struct, dimen_RI, ri_metric, &
575 put_mat_KS_env, regularization_RI)
578 TYPE(
cp_fm_type),
ALLOCATABLE,
DIMENSION(:, :) :: fm_matrix_minv_l_gamma
580 INTEGER,
INTENT(IN) :: dimen_ri
581 TYPE(libint_potential_type) :: ri_metric
582 LOGICAL,
OPTIONAL :: put_mat_ks_env
583 REAL(kind=
dp),
OPTIONAL :: regularization_ri
585 CALL ri_2c_integral_mat_core(qs_env, fm_matrix_minv_l_gamma=fm_matrix_minv_l_gamma, &
586 fm_matrix_l_struct=fm_matrix_l_struct, dimen_ri=dimen_ri, ri_metric=ri_metric, &
587 do_kpoints=.false., put_mat_ks_env=put_mat_ks_env, &
588 regularization_ri=regularization_ri)
606 kpoints, put_mat_KS_env, regularization_RI, ikp_ext, do_build_cell_index)
609 TYPE(
cp_cfm_type),
ALLOCATABLE,
DIMENSION(:) :: cfm_matrix_m_kpoints
611 INTEGER,
INTENT(IN) :: dimen_ri
612 TYPE(libint_potential_type) :: ri_metric
614 LOGICAL,
OPTIONAL :: put_mat_ks_env
615 REAL(kind=
dp),
OPTIONAL :: regularization_ri
616 INTEGER,
OPTIONAL :: ikp_ext
617 LOGICAL,
OPTIONAL :: do_build_cell_index
619 CALL ri_2c_integral_mat_core(qs_env, cfm_matrix_m_kpoints=cfm_matrix_m_kpoints, &
620 fm_matrix_l_struct=fm_matrix_struct, dimen_ri=dimen_ri, ri_metric=ri_metric, &
621 do_kpoints=.true., kpoints=kpoints, put_mat_ks_env=put_mat_ks_env, &
622 regularization_ri=regularization_ri, ikp_ext=ikp_ext, &
623 do_build_cell_index=do_build_cell_index)
642 SUBROUTINE ri_2c_integral_mat_core(qs_env, fm_matrix_Minv_L_gamma, cfm_matrix_M_kpoints, &
643 fm_matrix_L_struct, dimen_RI, ri_metric, do_kpoints, kpoints, &
644 put_mat_KS_env, regularization_RI, ikp_ext, do_build_cell_index)
647 TYPE(
cp_fm_type),
ALLOCATABLE,
DIMENSION(:, :), &
648 INTENT(OUT),
OPTIONAL :: fm_matrix_minv_l_gamma
650 INTENT(OUT),
OPTIONAL :: cfm_matrix_m_kpoints
652 INTEGER,
INTENT(IN) :: dimen_ri
653 TYPE(libint_potential_type) :: ri_metric
654 LOGICAL,
INTENT(IN) :: do_kpoints
656 LOGICAL,
OPTIONAL :: put_mat_ks_env
657 REAL(kind=
dp),
OPTIONAL :: regularization_ri
658 INTEGER,
OPTIONAL :: ikp_ext
659 LOGICAL,
OPTIONAL :: do_build_cell_index
661 CHARACTER(LEN=*),
PARAMETER :: routinen =
'RI_2c_integral_mat_core'
663 INTEGER :: handle, ikp, ikp_for_xkp, img, natom, &
665 INTEGER,
ALLOCATABLE,
DIMENSION(:) :: sizes_ri
666 INTEGER,
DIMENSION(:),
POINTER :: col_bsize, row_bsize
667 INTEGER,
DIMENSION(:, :, :),
POINTER :: cell_to_index
668 LOGICAL :: my_do_build_cell_index, my_put_mat_ks_env
669 REAL(kind=
dp) :: my_regularization_ri
670 REAL(kind=
dp),
DIMENSION(:, :),
POINTER :: xkp
675 TYPE(
cp_fm_type),
ALLOCATABLE,
DIMENSION(:, :) :: fm_matrix_m_kpoints
677 TYPE(
dbcsr_p_type),
DIMENSION(:, :),
POINTER :: matrix_s_ri_aux_transl
678 TYPE(
dbcsr_type),
ALLOCATABLE,
DIMENSION(:) :: mat_2c
679 TYPE(
dbcsr_type),
POINTER :: cmatrix, matrix_s_ri_aux_desymm, &
688 TYPE(
qs_kind_type),
DIMENSION(:),
POINTER :: qs_kind_set
690 CALL timeset(routinen, handle)
693 cpassert(
PRESENT(cfm_matrix_m_kpoints))
695 cpassert(
PRESENT(fm_matrix_minv_l_gamma))
698 NULLIFY (sab_ri, matrix_s_ri_aux_transl, dist_2d)
700 IF (
PRESENT(regularization_ri))
THEN
701 my_regularization_ri = regularization_ri
703 my_regularization_ri = 0.0_dp
706 IF (
PRESENT(put_mat_ks_env))
THEN
707 my_put_mat_ks_env = put_mat_ks_env
709 my_put_mat_ks_env = .false.
712 IF (
PRESENT(do_build_cell_index))
THEN
713 my_do_build_cell_index = do_build_cell_index
715 my_do_build_cell_index = .false.
720 blacs_env=blacs_env, &
722 distribution_2d=dist_2d, &
723 qs_kind_set=qs_kind_set, &
724 particle_set=particle_set, &
725 dft_control=dft_control, &
728 ALLOCATE (sizes_ri(natom))
729 ALLOCATE (basis_set_ri(nkind))
732 CALL get_particle_set(particle_set, qs_kind_set, nsgf=sizes_ri, basis=basis_set_ri)
735 sym_ij=.true., dist_2d=dist_2d)
738 ALLOCATE (row_bsize(
SIZE(sizes_ri)))
739 ALLOCATE (col_bsize(
SIZE(sizes_ri)))
740 row_bsize(:) = sizes_ri
741 col_bsize(:) = sizes_ri
744 cpassert(
PRESENT(kpoints))
745 IF (my_do_build_cell_index)
THEN
749 cell_to_index=cell_to_index)
750 nimg = dft_control%nimages
756 ALLOCATE (mat_2c(nimg))
757 CALL dbcsr_create(mat_2c(1),
"(RI|RI)", dbcsr_dist, dbcsr_type_symmetric, &
758 row_bsize, col_bsize)
759 DEALLOCATE (row_bsize, col_bsize)
766 ri_metric, do_kpoints=do_kpoints, ext_kpoints=kpoints, &
767 regularization_ri=my_regularization_ri)
770 DEALLOCATE (basis_set_ri)
772 IF (my_put_mat_ks_env)
THEN
773 CALL get_ks_env(qs_env%ks_env, matrix_s_ri_aux_kp=matrix_s_ri_aux_transl)
778 ALLOCATE (matrix_s_ri_aux_transl(1, img)%matrix)
779 CALL dbcsr_copy(matrix_s_ri_aux_transl(1, img)%matrix, mat_2c(img))
783 IF (my_put_mat_ks_env)
THEN
784 CALL set_ks_env(qs_env%ks_env, matrix_s_ri_aux_kp=matrix_s_ri_aux_transl)
787 IF (
PRESENT(ikp_ext)) nkp = 1
790 ALLOCATE (cfm_matrix_m_kpoints(nkp))
792 CALL cp_cfm_create(cfm_matrix_m_kpoints(ikp), fm_matrix_l_struct)
795 ALLOCATE (fm_matrix_m_kpoints(1, 1))
796 CALL cp_fm_create(fm_matrix_m_kpoints(1, 1), fm_matrix_l_struct)
802 ncol_global=dimen_ri, para_env=para_env)
806 IF (do_kpoints)
CALL cp_cfm_create(cfm_matrix_s_global, fm_struct, set_zero=.true.)
810 ALLOCATE (rmatrix, cmatrix, tmpmat)
811 CALL dbcsr_create(rmatrix, template=matrix_s_ri_aux_transl(1, 1)%matrix, &
812 matrix_type=dbcsr_type_symmetric)
813 CALL dbcsr_create(cmatrix, template=matrix_s_ri_aux_transl(1, 1)%matrix, &
814 matrix_type=dbcsr_type_antisymmetric)
815 CALL dbcsr_create(tmpmat, template=matrix_s_ri_aux_transl(1, 1)%matrix, &
816 matrix_type=dbcsr_type_no_symmetry)
826 IF (
PRESENT(ikp_ext))
THEN
827 ikp_for_xkp = ikp_ext
832 CALL rskp_transform(rmatrix=rmatrix, cmatrix=cmatrix, rsmat=matrix_s_ri_aux_transl, ispin=1, &
833 xkp=xkp(1:3, ikp_for_xkp), cell_to_index=cell_to_index, sab_nl=sab_ri)
840 CALL cp_fm_to_cfm(msourcer=fm_matrix_s_global, mtarget=cfm_matrix_s_global)
858 NULLIFY (matrix_s_ri_aux_desymm)
859 ALLOCATE (matrix_s_ri_aux_desymm)
860 CALL dbcsr_create(matrix_s_ri_aux_desymm, template=matrix_s_ri_aux_transl(1, 1)%matrix, &
861 name=
'S_RI non_symm', matrix_type=dbcsr_type_no_symmetry)
882 cpassert(
PRESENT(fm_matrix_minv_l_gamma))
883 CALL move_alloc(fm_matrix_m_kpoints, fm_matrix_minv_l_gamma)
886 IF (.NOT. my_put_mat_ks_env)
THEN
890 CALL timestop(handle)
892 END SUBROUTINE ri_2c_integral_mat_core
901 SUBROUTINE copy_dbcsr_pair_to_cfm(matrix_re, matrix_im, fm_work, cfm_matrix)
902 TYPE(
dbcsr_type),
POINTER :: matrix_re, matrix_im
913 END SUBROUTINE copy_dbcsr_pair_to_cfm
940 SUBROUTINE compute_2c_integrals(qs_env, eri_method, eri_param, para_env, para_env_sub, para_env_L, mp2_memory, &
941 fm_matrix_L, ngroup, color_sub, dimen_RI, &
942 my_group_L_size, my_group_L_start, my_group_L_end, &
943 gd_array, calc_PQ_cond_num, cond_num, num_small_eigen, potential, &
944 sab_orb_sub, do_im_time, fm_matrix_L_struct)
947 INTEGER,
INTENT(IN) :: eri_method
952 REAL(kind=
dp),
INTENT(IN) :: mp2_memory
954 INTEGER,
INTENT(IN) :: ngroup, color_sub
955 INTEGER,
INTENT(OUT) :: dimen_ri, my_group_l_size, &
956 my_group_l_start, my_group_l_end
958 LOGICAL,
INTENT(IN) :: calc_pq_cond_num
959 REAL(kind=
dp),
INTENT(OUT) :: cond_num
960 INTEGER,
INTENT(OUT) :: num_small_eigen
961 TYPE(libint_potential_type),
INTENT(IN) :: potential
963 POINTER :: sab_orb_sub
964 LOGICAL,
INTENT(IN),
OPTIONAL :: do_im_time
967 CHARACTER(LEN=*),
PARAMETER :: routinen =
'compute_2c_integrals'
969 INTEGER :: best_group_size, color_l, group_size, handle, handle2, i_global, iatom, iib, &
970 ikind, iproc, j_global, jjb, natom, ncol_local, nkind, nrow_local, nsgf, potential_type, &
971 proc_receive, proc_receive_static, proc_send_static, proc_shift, rec_l_end, rec_l_size, &
972 rec_l_start, strat_group_size
973 INTEGER,
ALLOCATABLE,
DIMENSION(:) :: kind_of
974 INTEGER,
DIMENSION(:),
POINTER :: col_indices, row_indices
975 LOGICAL :: my_do_im_time
976 REAL(kind=
dp) :: min_mem_for_qk
977 REAL(kind=
dp),
ALLOCATABLE,
DIMENSION(:) :: egen_l
978 REAL(kind=
dp),
ALLOCATABLE,
DIMENSION(:, :) :: l_external_col, l_local_col
985 TYPE(
qs_kind_type),
DIMENSION(:),
POINTER :: qs_kind_set
987 CALL timeset(routinen, handle)
989 my_do_im_time = .false.
990 IF (
PRESENT(do_im_time))
THEN
991 my_do_im_time = do_im_time
995 CALL get_qs_env(qs_env, atomic_kind_set=atomic_kind_set, qs_kind_set=qs_kind_set, &
996 particle_set=particle_set)
998 nkind =
SIZE(qs_kind_set)
999 natom =
SIZE(particle_set)
1004 CALL get_qs_kind(qs_kind=qs_kind_set(ikind), basis_set=basis_set_a, basis_type=
"RI_AUX")
1005 cpassert(
ASSOCIATED(basis_set_a))
1010 ikind = kind_of(iatom)
1011 CALL get_qs_kind(qs_kind=qs_kind_set(ikind), nsgf=nsgf, basis_type=
"RI_AUX")
1012 dimen_ri = dimen_ri + nsgf
1016 IF (dimen_ri < ngroup)
THEN
1017 CALL cp_abort(__location__,
"Product of block size and number "// &
1018 "of RI functions should not exceed total number of processes")
1023 CALL get_group_dist(gd_array, color_sub, my_group_l_start, my_group_l_end, my_group_l_size)
1025 CALL timeset(routinen//
"_loop_lm", handle2)
1027 ALLOCATE (l_local_col(dimen_ri, my_group_l_size))
1028 l_local_col = 0.0_dp
1030 potential_type = potential%potential_type
1037 basis_type_a=
"RI_AUX", basis_type_b=
"RI_AUX", &
1038 hab=l_local_col, first_b=my_group_l_start, last_b=my_group_l_end, &
1039 eri_method=eri_method)
1046 natom, potential, sab_orb_sub, l_local_col, kind_of)
1049 cpabort(
"unknown ERI method")
1052 CALL timestop(handle2)
1056 best_group_size = para_env%num_pe
1058 strat_group_size = max(1, para_env%num_pe/10)
1060 min_mem_for_qk = real(dimen_ri, kind=
dp)*dimen_ri*3.0_dp*8.0_dp/1024_dp/1024_dp
1062 group_size = strat_group_size - 1
1063 DO iproc = strat_group_size, para_env%num_pe
1064 group_size = group_size + 1
1067 IF (mod(para_env%num_pe, group_size) /= 0 .OR. mod(group_size, para_env_sub%num_pe) /= 0) cycle
1070 IF (real(group_size, kind=
dp)*mp2_memory < min_mem_for_qk) cycle
1072 best_group_size = group_size
1076 IF (my_do_im_time)
THEN
1078 best_group_size = para_env%num_pe
1082 color_l = para_env%mepos/best_group_size
1083 ALLOCATE (para_env_l)
1084 CALL para_env_l%from_split(para_env, color_l)
1087 NULLIFY (blacs_env_l)
1091 CALL create_matrix_l(fm_matrix_l, blacs_env_l, dimen_ri, para_env_l,
"fm_matrix_L", fm_matrix_l_struct)
1093 IF (my_do_im_time .AND. para_env%num_pe > 1)
THEN
1096 my_group_l_start, my_group_l_end, &
1103 CALL comm_exchange%from_split(para_env_l, para_env_sub%mepos)
1106 my_group_l_end, my_group_l_size, comm_exchange)
1109 nrow_local=nrow_local, &
1110 ncol_local=ncol_local, &
1111 row_indices=row_indices, &
1112 col_indices=col_indices)
1114 DO jjb = 1, ncol_local
1115 j_global = col_indices(jjb)
1116 IF (j_global >= my_group_l_start .AND. j_global <= my_group_l_end)
THEN
1117 DO iib = 1, nrow_local
1118 i_global = row_indices(iib)
1119 fm_matrix_l%local_data(iib, jjb) = l_local_col(i_global, j_global - my_group_l_start + 1)
1124 proc_send_static =
modulo(comm_exchange%mepos + 1, comm_exchange%num_pe)
1125 proc_receive_static =
modulo(comm_exchange%mepos - 1, comm_exchange%num_pe)
1127 DO proc_shift = 1, comm_exchange%num_pe - 1
1128 proc_receive =
modulo(comm_exchange%mepos - proc_shift, comm_exchange%num_pe)
1130 CALL get_group_dist(gd_sub_array, proc_receive, rec_l_start, rec_l_end, rec_l_size)
1132 ALLOCATE (l_external_col(dimen_ri, rec_l_size))
1133 l_external_col = 0.0_dp
1135 CALL comm_exchange%sendrecv(l_local_col, proc_send_static, l_external_col, proc_receive_static)
1137 DO jjb = 1, ncol_local
1138 j_global = col_indices(jjb)
1139 IF (j_global >= rec_l_start .AND. j_global <= rec_l_end)
THEN
1140 DO iib = 1, nrow_local
1141 i_global = row_indices(iib)
1142 fm_matrix_l%local_data(iib, jjb) = l_external_col(i_global, j_global - rec_l_start + 1)
1147 CALL move_alloc(l_external_col, l_local_col)
1151 CALL comm_exchange%free()
1155 DEALLOCATE (l_local_col)
1160 comm_exchange = fm_matrix_l%matrix_struct%context%interconnect(para_env)
1161 CALL comm_exchange%sum(fm_matrix_l%local_data)
1162 CALL comm_exchange%free()
1167 IF (calc_pq_cond_num)
THEN
1171 CALL create_matrix_l(fm_matrix_l_diag, blacs_env_l, dimen_ri, para_env_l,
"fm_matrix_L_diag", fm_matrix_l_struct)
1173 CALL cp_fm_to_fm(source=fm_matrix_l, destination=fm_matrix_l_diag)
1175 ALLOCATE (egen_l(dimen_ri))
1178 CALL cp_fm_syevx(matrix=fm_matrix_l_diag, eigenvalues=egen_l)
1181 DO iib = 1, dimen_ri
1182 IF (abs(egen_l(iib)) < 0.001_dp) num_small_eigen = num_small_eigen + 1
1185 cond_num = maxval(abs(egen_l))/minval(abs(egen_l))
1187 CALL cp_fm_release(fm_matrix_l_diag)
1193 CALL cp_blacs_env_release(blacs_env_l)
1195 CALL timestop(handle)
1197 END SUBROUTINE compute_2c_integrals
1208 SUBROUTINE matrix_root_with_svd(matrix, num_small_evals, cond_num, eps_svd, do_inversion, para_env)
1209 TYPE(cp_fm_type),
INTENT(INOUT) :: matrix
1210 INTEGER,
INTENT(OUT) :: num_small_evals
1211 REAL(kind=dp),
INTENT(OUT) :: cond_num
1212 REAL(kind=dp),
INTENT(IN) :: eps_svd
1213 LOGICAL,
INTENT(IN) :: do_inversion
1214 TYPE(mp_para_env_type),
INTENT(IN) :: para_env
1216 CHARACTER(LEN=*),
PARAMETER :: routinen =
'matrix_root_with_svd'
1218 INTEGER :: group_size_l, handle, ii, needed_evals, &
1220 INTEGER,
ALLOCATABLE,
DIMENSION(:) :: num_eval
1221 REAL(kind=dp),
ALLOCATABLE,
DIMENSION(:) :: evals
1222 TYPE(cp_fm_type) :: evecs
1223 TYPE(mp_comm_type) :: comm_exchange
1225 CALL timeset(routinen, handle)
1228 CALL cp_fm_get_info(matrix=matrix, nrow_global=nrow)
1230 ALLOCATE (evals(nrow))
1233 CALL cp_fm_create(evecs, matrix%matrix_struct)
1236 CALL choose_eigv_solver(matrix, evecs, evals)
1241 IF (evals(ii) > eps_svd)
THEN
1242 num_small_evals = ii - 1
1246 needed_evals = nrow - num_small_evals
1249 cond_num = evals(nrow)/evals(num_small_evals + 1)
1252 evals(1:num_small_evals) = 0.0_dp
1253 IF (do_inversion)
THEN
1254 evals(num_small_evals + 1:nrow) = 1.0_dp/sqrt(evals(num_small_evals + 1:nrow))
1256 evals(num_small_evals + 1:nrow) = sqrt(evals(num_small_evals + 1:nrow))
1259 CALL cp_fm_column_scale(evecs, evals)
1265 group_size_l = para_env%num_pe/matrix%matrix_struct%para_env%num_pe
1266 comm_exchange = matrix%matrix_struct%context%interconnect(para_env)
1268 ALLOCATE (num_eval(0:group_size_l - 1))
1269 CALL comm_exchange%allgather(num_small_evals, num_eval)
1271 num_small_evals = minval(num_eval)
1273 IF (num_small_evals /= maxval(num_eval))
THEN
1275 pos_max = maxloc(num_eval)
1276 num_small_evals = num_eval(pos_max(1))
1277 needed_evals = nrow - num_small_evals
1280 CALL comm_exchange%bcast(evecs%local_data, pos_max(1))
1281 CALL comm_exchange%bcast(cond_num, pos_max(1))
1284 DEALLOCATE (num_eval)
1286 CALL comm_exchange%free()
1288 CALL reset_size_matrix(matrix, needed_evals, matrix%matrix_struct)
1291 CALL cp_fm_to_fm(evecs, matrix, needed_evals, num_small_evals + 1)
1293 CALL cp_fm_release(evecs)
1295 CALL timestop(handle)
1297 END SUBROUTINE matrix_root_with_svd
1305 SUBROUTINE reset_size_matrix(matrix, new_size, fm_struct_template)
1306 TYPE(cp_fm_type),
INTENT(INOUT) :: matrix
1307 INTEGER,
INTENT(IN) :: new_size
1308 TYPE(cp_fm_struct_type),
POINTER :: fm_struct_template
1310 CHARACTER(LEN=*),
PARAMETER :: routinen =
'reset_size_matrix'
1313 TYPE(cp_fm_struct_type),
POINTER :: fm_struct
1315 CALL timeset(routinen, handle)
1319 CALL cp_fm_struct_create(fm_struct, ncol_global=new_size, template_fmstruct=fm_struct_template, force_block=.true.)
1321 CALL cp_fm_release(matrix)
1323 CALL cp_fm_create(matrix, fm_struct)
1324 CALL cp_fm_set_all(matrix, 0.0_dp)
1326 CALL cp_fm_struct_release(fm_struct)
1328 CALL timestop(handle)
1330 END SUBROUTINE reset_size_matrix
1338 SUBROUTINE cholesky_decomp(fm_matrix_L, dimen_RI, do_inversion)
1340 TYPE(cp_fm_type),
INTENT(IN) :: fm_matrix_l
1341 INTEGER,
INTENT(IN) :: dimen_ri
1342 LOGICAL,
INTENT(IN) :: do_inversion
1344 CHARACTER(LEN=*),
PARAMETER :: routinen =
'cholesky_decomp'
1346 INTEGER :: handle, i_global, iib, info_chol, &
1347 j_global, jjb, ncol_local, nrow_local
1348 INTEGER,
DIMENSION(:),
POINTER :: col_indices, row_indices
1350 CALL timeset(routinen, handle)
1353 CALL cp_fm_cholesky_decompose(matrix=fm_matrix_l, n=dimen_ri, info_out=info_chol)
1354 cpassert(info_chol == 0)
1356 IF (.NOT. do_inversion)
THEN
1358 CALL cp_fm_get_info(matrix=fm_matrix_l, &
1359 nrow_local=nrow_local, &
1360 ncol_local=ncol_local, &
1361 row_indices=row_indices, &
1362 col_indices=col_indices)
1363 DO jjb = 1, ncol_local
1364 j_global = col_indices(jjb)
1365 DO iib = 1, nrow_local
1366 i_global = row_indices(iib)
1367 IF (j_global < i_global) fm_matrix_l%local_data(iib, jjb) = 0.0_dp
1373 CALL timestop(handle)
1375 END SUBROUTINE cholesky_decomp
1387 cfm_matrix_Minv_L_kpoints, dimen_RI, kpoints, eps_eigval_S)
1389 TYPE(cp_cfm_type),
DIMENSION(:),
INTENT(IN) :: cfm_matrix_m_kpoints
1390 TYPE(cp_cfm_type),
DIMENSION(:),
INTENT(INOUT) :: cfm_matrix_l_kpoints
1391 TYPE(cp_cfm_type),
ALLOCATABLE,
DIMENSION(:), &
1392 INTENT(INOUT) :: cfm_matrix_minv_l_kpoints
1393 INTEGER,
INTENT(IN) :: dimen_ri
1394 TYPE(kpoint_type),
POINTER :: kpoints
1395 REAL(kind=dp),
INTENT(IN) :: eps_eigval_s
1397 CHARACTER(LEN=*),
PARAMETER :: routinen =
'inversion_of_M_and_mult_with_chol_dec_of_V'
1399 INTEGER :: handle, ikp, nkp
1400 TYPE(cp_cfm_type) :: cfm_matrix_m_tmp
1401 TYPE(cp_fm_struct_type),
POINTER :: matrix_struct
1403 CALL timeset(routinen, handle)
1405 matrix_struct => cfm_matrix_m_kpoints(1)%matrix_struct
1407 CALL cp_cfm_create(cfm_matrix_m_tmp, matrix_struct)
1409 CALL get_kpoint_info(kpoints, nkp=nkp)
1410 ALLOCATE (cfm_matrix_minv_l_kpoints(nkp))
1414 CALL cp_cfm_to_cfm(cfm_matrix_m_kpoints(ikp), cfm_matrix_m_tmp)
1416 CALL cp_cfm_power(cfm_matrix_m_tmp, threshold=eps_eigval_s, exponent=-1.0_dp)
1419 CALL cp_cfm_power(cfm_matrix_l_kpoints(ikp), threshold=0.0_dp, exponent=0.5_dp)
1422 CALL cp_cfm_create(cfm_matrix_minv_l_kpoints(ikp), matrix_struct)
1423 CALL parallel_gemm(
"N",
"C", dimen_ri, dimen_ri, dimen_ri, z_one, cfm_matrix_m_tmp, &
1424 cfm_matrix_l_kpoints(ikp), &
1425 z_zero, cfm_matrix_minv_l_kpoints(ikp))
1429 CALL cp_cfm_release(cfm_matrix_m_tmp)
1431 CALL timestop(handle)
1441 SUBROUTINE gamma_only_inversion_of_m_and_mult_with_chol_dec_of_vtrunc(fm_matrix_Minv_Vtrunc_Minv, &
1442 fm_matrix_Minv, qs_env)
1444 TYPE(cp_fm_type),
DIMENSION(:, :) :: fm_matrix_minv_vtrunc_minv, &
1446 TYPE(qs_environment_type),
POINTER :: qs_env
1448 CHARACTER(LEN=*),
PARAMETER :: &
1449 routinen =
'Gamma_only_inversion_of_M_and_mult_with_chol_dec_of_Vtrunc'
1450 REAL(kind=dp),
PARAMETER :: eps_eigval_s_gamma_thre = 1.0e-18_dp
1452 INTEGER :: dimen_ri, handle, ndep
1453 REAL(kind=dp) :: eps_eigval_s_gamma
1454 TYPE(cp_fm_type) :: fm_matrix_ri_metric_inv_work, fm_work
1456 CALL timeset(routinen, handle)
1458 CALL cp_fm_create(fm_work, fm_matrix_minv(1, 1)%matrix_struct)
1459 CALL cp_fm_set_all(fm_work, 0.0_dp)
1461 CALL cp_fm_create(fm_matrix_ri_metric_inv_work, fm_matrix_minv(1, 1)%matrix_struct)
1462 CALL cp_fm_set_all(fm_matrix_ri_metric_inv_work, 0.0_dp)
1464 CALL cp_fm_get_info(matrix=fm_matrix_minv(1, 1), nrow_global=dimen_ri)
1466 eps_eigval_s_gamma = qs_env%mp2_env%ri_rpa_im_time%eps_eigval_S_Gamma
1468 IF (eps_eigval_s_gamma > eps_eigval_s_gamma_thre)
THEN
1471 CALL cp_fm_power(fm_matrix_minv(1, 1), fm_matrix_ri_metric_inv_work, -0.5_dp, &
1472 eps_eigval_s_gamma, ndep)
1476 CALL cholesky_decomp(fm_matrix_minv(1, 1), dimen_ri, do_inversion=.true.)
1478 CALL invert_mat(fm_matrix_minv(1, 1))
1482 CALL parallel_gemm(
'N',
'T', dimen_ri, dimen_ri, dimen_ri, 1.0_dp, fm_matrix_minv(1, 1), &
1483 fm_matrix_minv(1, 1), 0.0_dp, fm_matrix_ri_metric_inv_work)
1485 CALL cp_fm_to_fm(fm_matrix_ri_metric_inv_work, fm_matrix_minv(1, 1))
1487 CALL parallel_gemm(
'N',
'N', dimen_ri, dimen_ri, dimen_ri, 1.0_dp, fm_matrix_ri_metric_inv_work, &
1488 fm_matrix_minv_vtrunc_minv(1, 1), 0.0_dp, fm_work)
1490 CALL parallel_gemm(
'N',
'N', dimen_ri, dimen_ri, dimen_ri, 1.0_dp, fm_work, &
1491 fm_matrix_ri_metric_inv_work, 0.0_dp, fm_matrix_minv_vtrunc_minv(1, 1))
1493 CALL cp_fm_release(fm_work)
1494 CALL cp_fm_release(fm_matrix_ri_metric_inv_work)
1496 CALL timestop(handle)
1498 END SUBROUTINE gamma_only_inversion_of_m_and_mult_with_chol_dec_of_vtrunc
1509 cell_grid, do_BvK_cell)
1510 TYPE(qs_environment_type),
POINTER :: qs_env
1511 TYPE(libint_potential_type),
OPTIONAL :: trunc_coulomb
1512 REAL(kind=dp),
OPTIONAL :: rel_cutoff_trunc_coulomb_ri_x
1513 INTEGER,
DIMENSION(3),
OPTIONAL :: cell_grid
1514 LOGICAL,
OPTIONAL :: do_bvk_cell
1516 CHARACTER(LEN=*),
PARAMETER :: routinen =
'trunc_coulomb_for_exchange'
1518 INTEGER :: handle, i_dim
1519 INTEGER,
DIMENSION(3) :: periodic
1520 LOGICAL :: my_do_bvk_cell
1521 REAL(kind=dp) :: kp_fac, kp_fac_idim, my_rel_cutoff_trunc_coulomb_ri_x, &
1522 shortest_dist_cell_planes
1523 TYPE(cell_type),
POINTER :: cell
1524 TYPE(kpoint_type),
POINTER :: kpoints_scf
1526 CALL timeset(routinen, handle)
1529 CALL get_qs_env(qs_env, cell=cell, kpoints=kpoints_scf)
1530 CALL get_cell(cell=cell, periodic=periodic)
1532 my_do_bvk_cell = .false.
1533 IF (
PRESENT(do_bvk_cell)) my_do_bvk_cell = do_bvk_cell
1534 IF (my_do_bvk_cell)
THEN
1538 IF (periodic(i_dim) == 1)
THEN
1539 IF (
PRESENT(cell_grid))
THEN
1540 kp_fac_idim = real(cell_grid(i_dim), kind=dp)
1542 kp_fac_idim = real(kpoints_scf%nkp_grid(i_dim), kind=dp)
1544 IF (kp_fac > kp_fac_idim) kp_fac = kp_fac_idim
1551 shortest_dist_cell_planes = 1.0e4_dp
1552 IF (periodic(1) == 1)
THEN
1553 IF (shortest_dist_cell_planes > plane_distance(1, 0, 0, cell))
THEN
1554 shortest_dist_cell_planes = plane_distance(1, 0, 0, cell)
1557 IF (periodic(2) == 1)
THEN
1558 IF (shortest_dist_cell_planes > plane_distance(0, 1, 0, cell))
THEN
1559 shortest_dist_cell_planes = plane_distance(0, 1, 0, cell)
1562 IF (periodic(3) == 1)
THEN
1563 IF (shortest_dist_cell_planes > plane_distance(0, 0, 1, cell))
THEN
1564 shortest_dist_cell_planes = plane_distance(0, 0, 1, cell)
1568 IF (
PRESENT(rel_cutoff_trunc_coulomb_ri_x))
THEN
1569 my_rel_cutoff_trunc_coulomb_ri_x = rel_cutoff_trunc_coulomb_ri_x
1571 my_rel_cutoff_trunc_coulomb_ri_x = qs_env%mp2_env%ri_rpa_im_time%rel_cutoff_trunc_coulomb_ri_x
1574 IF (
PRESENT(trunc_coulomb))
THEN
1575 trunc_coulomb%potential_type = do_potential_truncated
1576 trunc_coulomb%cutoff_radius = shortest_dist_cell_planes* &
1577 my_rel_cutoff_trunc_coulomb_ri_x* &
1579 trunc_coulomb%filename =
"t_c_g.dat"
1581 trunc_coulomb%omega = 0.0_dp
1584 CALL timestop(handle)
1592 SUBROUTINE invert_mat(fm_matrix_L)
1594 TYPE(cp_fm_type),
INTENT(IN) :: fm_matrix_l
1596 CHARACTER(LEN=*),
PARAMETER :: routinen =
'invert_mat'
1598 INTEGER :: handle, i_global, iib, j_global, jjb, &
1599 ncol_local, nrow_local
1600 INTEGER,
DIMENSION(:),
POINTER :: col_indices, row_indices
1602 CALL timeset(routinen, handle)
1604 CALL cp_fm_triangular_invert(matrix_a=fm_matrix_l, uplo_tr=
'U')
1607 CALL cp_fm_get_info(matrix=fm_matrix_l, &
1608 nrow_local=nrow_local, &
1609 ncol_local=ncol_local, &
1610 row_indices=row_indices, &
1611 col_indices=col_indices)
1613 DO jjb = 1, ncol_local
1614 j_global = col_indices(jjb)
1615 DO iib = 1, nrow_local
1616 i_global = row_indices(iib)
1617 IF (j_global < i_global) fm_matrix_l%local_data(iib, jjb) = 0.0_dp
1621 CALL timestop(handle)
1623 END SUBROUTINE invert_mat
1634 SUBROUTINE create_matrix_l(fm_matrix_L, blacs_env_L, dimen_RI, para_env_L, name, fm_matrix_L_struct)
1635 TYPE(cp_fm_type),
INTENT(OUT) :: fm_matrix_l
1636 TYPE(cp_blacs_env_type),
POINTER :: blacs_env_l
1637 INTEGER,
INTENT(IN) :: dimen_ri
1638 TYPE(mp_para_env_type),
POINTER :: para_env_l
1639 CHARACTER(LEN=*),
INTENT(IN) :: name
1640 TYPE(cp_fm_struct_type),
OPTIONAL,
POINTER :: fm_matrix_l_struct
1642 CHARACTER(LEN=*),
PARAMETER :: routinen =
'create_matrix_L'
1645 TYPE(cp_fm_struct_type),
POINTER :: fm_struct
1647 CALL timeset(routinen, handle)
1650 IF (
PRESENT(fm_matrix_l_struct))
THEN
1651 CALL cp_fm_create(fm_matrix_l, fm_matrix_l_struct, name=name)
1654 CALL cp_fm_struct_create(fm_struct, context=blacs_env_l, nrow_global=dimen_ri, &
1655 ncol_global=dimen_ri, para_env=para_env_l)
1657 CALL cp_fm_create(fm_matrix_l, fm_struct, name=name)
1659 CALL cp_fm_struct_release(fm_struct)
1662 CALL cp_fm_set_all(matrix=fm_matrix_l, alpha=0.0_dp)
1664 CALL timestop(handle)
1666 END SUBROUTINE create_matrix_l
1676 SUBROUTINE grep_lcols(fm_matrix_L, &
1677 my_group_L_start, my_group_L_end, my_group_L_size, my_Lrows)
1678 TYPE(cp_fm_type),
INTENT(IN) :: fm_matrix_l
1679 INTEGER,
INTENT(IN) :: my_group_l_start, my_group_l_end, &
1681 REAL(kind=dp),
ALLOCATABLE,
DIMENSION(:, :), &
1682 INTENT(OUT) :: my_lrows
1684 CHARACTER(LEN=*),
PARAMETER :: routinen =
'grep_Lcols'
1686 INTEGER :: dimen_ri, handle, handle2, i_global, iib, j_global, jjb, max_row_col_local, &
1687 ncol_local, ncol_rec, nrow_local, nrow_rec, proc_receive_static, proc_send_static, &
1689 INTEGER,
ALLOCATABLE,
DIMENSION(:, :) :: local_col_row_info, rec_col_row_info
1690 INTEGER,
DIMENSION(:),
POINTER :: col_indices, col_indices_rec, &
1691 row_indices, row_indices_rec
1692 REAL(kind=dp),
ALLOCATABLE,
DIMENSION(:, :) :: local_l, rec_l
1693 REAL(kind=dp),
CONTIGUOUS,
DIMENSION(:, :), &
1694 POINTER :: local_l_internal
1695 TYPE(mp_para_env_type),
POINTER :: para_env
1697 CALL timeset(routinen, handle)
1699 CALL cp_fm_get_info(matrix=fm_matrix_l, &
1700 nrow_local=nrow_local, &
1701 ncol_local=ncol_local, &
1702 row_indices=row_indices, &
1703 col_indices=col_indices, &
1704 nrow_global=dimen_ri, &
1705 local_data=local_l_internal, &
1708 ALLOCATE (my_lrows(dimen_ri, my_group_l_size))
1711 ALLOCATE (local_l(nrow_local, ncol_local))
1712 local_l(:, :) = local_l_internal(1:nrow_local, 1:ncol_local)
1714 max_row_col_local = max(nrow_local, ncol_local)
1715 CALL para_env%max(max_row_col_local)
1717 ALLOCATE (local_col_row_info(0:max_row_col_local, 2))
1718 local_col_row_info = 0
1720 local_col_row_info(0, 1) = nrow_local
1721 local_col_row_info(1:nrow_local, 1) = row_indices(1:nrow_local)
1723 local_col_row_info(0, 2) = ncol_local
1724 local_col_row_info(1:ncol_local, 2) = col_indices(1:ncol_local)
1726 ALLOCATE (rec_col_row_info(0:max_row_col_local, 2))
1729 DO jjb = 1, ncol_local
1730 j_global = col_indices(jjb)
1731 IF (j_global >= my_group_l_start .AND. j_global <= my_group_l_end)
THEN
1732 DO iib = 1, nrow_local
1733 i_global = row_indices(iib)
1734 my_lrows(i_global, j_global - my_group_l_start + 1) = local_l(iib, jjb)
1739 proc_send_static =
modulo(para_env%mepos + 1, para_env%num_pe)
1740 proc_receive_static =
modulo(para_env%mepos - 1, para_env%num_pe)
1742 CALL timeset(routinen//
"_comm", handle2)
1744 DO proc_shift = 1, para_env%num_pe - 1
1746 rec_col_row_info = 0
1747 CALL para_env%sendrecv(local_col_row_info, proc_send_static, rec_col_row_info, proc_receive_static)
1748 nrow_rec = rec_col_row_info(0, 1)
1749 ncol_rec = rec_col_row_info(0, 2)
1751 ALLOCATE (row_indices_rec(nrow_rec))
1752 row_indices_rec = rec_col_row_info(1:nrow_rec, 1)
1754 ALLOCATE (col_indices_rec(ncol_rec))
1755 col_indices_rec = rec_col_row_info(1:ncol_rec, 2)
1757 ALLOCATE (rec_l(nrow_rec, ncol_rec))
1761 CALL para_env%sendrecv(local_l, proc_send_static, rec_l, proc_receive_static)
1764 DO jjb = 1, ncol_rec
1765 j_global = col_indices_rec(jjb)
1766 IF (j_global >= my_group_l_start .AND. j_global <= my_group_l_end)
THEN
1767 DO iib = 1, nrow_rec
1768 i_global = row_indices_rec(iib)
1769 my_lrows(i_global, j_global - my_group_l_start + 1) = rec_l(iib, jjb)
1774 local_col_row_info(:, :) = rec_col_row_info
1775 CALL move_alloc(rec_l, local_l)
1777 DEALLOCATE (col_indices_rec)
1778 DEALLOCATE (row_indices_rec)
1780 CALL timestop(handle2)
1782 DEALLOCATE (local_col_row_info)
1783 DEALLOCATE (rec_col_row_info)
1784 DEALLOCATE (local_l)
1786 CALL timestop(handle)
1788 END SUBROUTINE grep_lcols
static GRID_HOST_DEVICE int modulo(int a, int m)
Equivalent of Fortran's MODULO, which always return a positive number. https://gcc....
Define the atomic kind types and their sub types.
subroutine, public get_atomic_kind_set(atomic_kind_set, atom_of_kind, kind_of, natom_of_kind, maxatom, natom, nshell, fist_potential_present, shell_present, shell_adiabatic, shell_check_distance, damping_present)
Get attributes of an atomic kind set.
Handles all functions related to the CELL.
subroutine, public get_cell(cell, alpha, beta, gamma, deth, orthorhombic, abc, periodic, h, h_inv, symmetry_id, tag)
Get informations about a simulation cell.
real(kind=dp) function, public plane_distance(h, k, l, cell)
Calculate the distance between two lattice planes as defined by a triple of Miller indices (hkl).
constants for the different operators of the 2c-integrals
integer, parameter, public operator_coulomb
methods related to the blacs parallel environment
subroutine, public cp_blacs_env_release(blacs_env)
releases the given blacs_env
subroutine, public cp_blacs_env_create(blacs_env, para_env, blacs_grid_layout, blacs_repeatable, row_major, grid_2d)
allocates and initializes a type that represent a blacs context
Basic linear algebra operations for complex full matrices.
subroutine, public cp_cfm_scale_and_add_fm(alpha, matrix_a, beta, matrix_b)
Scale and add two BLACS matrices (a = alpha*a + beta*b). where b is a real matrix (adapted from cp_cf...
used for collecting diagonalization schemes available for cp_cfm_type
subroutine, public cp_cfm_power(matrix, work, exponent, threshold, n_dependent, verbose, eigvals)
Raise the positive spectral part of a Hermitian matrix to a real power. Eigenmodes with eigenvalues b...
Represents a complex full matrix distributed on many processors.
subroutine, public cp_cfm_copy_general(source, destination, para_env)
General copy of a cfm matrix to another cfm matrix. Uses non-blocking MPI rather than ScaLAPACK.
subroutine, public cp_cfm_release(matrix)
Releases a full matrix.
subroutine, public cp_fm_to_cfm(msourcer, msourcei, mtarget)
Construct a complex full matrix by taking its real and imaginary parts from two separate real-value f...
subroutine, public cp_cfm_create(matrix, matrix_struct, name, nrow, ncol, set_zero)
Creates a new full matrix with the given structure.
subroutine, public cp_cfm_to_fm(msource, mtargetr, mtargeti)
Copy real and imaginary parts of a complex full matrix into separate real-value full matrices.
Defines control structures, which contain the parameters and the settings for the DFT-based calculati...
subroutine, public dbcsr_distribution_release(dist)
...
subroutine, public dbcsr_deallocate_matrix(matrix)
...
subroutine, public dbcsr_desymmetrize(matrix_a, matrix_b)
...
subroutine, public dbcsr_copy(matrix_b, matrix_a, name, keep_sparsity, keep_imaginary)
...
subroutine, public dbcsr_set(matrix, alpha)
...
subroutine, public dbcsr_release(matrix)
...
subroutine, public dbcsr_reserve_all_blocks(matrix)
Reserves all blocks.
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.
subroutine, public copy_dbcsr_to_fm(matrix, fm, plan, check_plan)
Copy a DBCSR matrix to a BLACS matrix.
subroutine, public cp_dbcsr_dist2d_to_dist(dist2d, dist)
Creates a DBCSR distribution from a distribution_2d.
Interface to Minimax-Ewald method for periodic ERI's to be used in CP2K.
Basic linear algebra operations for full matrices.
subroutine, public cp_fm_column_scale(matrixa, scaling)
scales column i of matrix a with scaling(i)
subroutine, public cp_fm_triangular_invert(matrix_a, uplo_tr)
inverts a triangular matrix
various cholesky decomposition related routines
subroutine, public cp_fm_cholesky_decompose(matrix, n, info_out)
used to replace a symmetric positive def. matrix M with its cholesky decomposition U: M = U^T * U,...
used for collecting some of the diagonalization schemes available for cp_fm_type. cp_fm_power also mo...
subroutine, public cp_fm_power(matrix, work, exponent, threshold, n_dependent, verbose, eigvals)
...
subroutine, public choose_eigv_solver(matrix, eigenvectors, eigenvalues, info)
Choose the Eigensolver depending on which library is available ELPA seems to be unstable for small sy...
subroutine, public cp_fm_syevx(matrix, eigenvectors, eigenvalues, neig, work_syevx)
compute eigenvalues and optionally eigenvectors of a real symmetric matrix using scalapack....
Redistribution of full matrices and distributed arrays.
subroutine, public cp_array_columns_to_fm(matrix, array, para_env, first_col, last_col, nrows)
Redistribute a column-distributed array into an existing full matrix.
represent the structure of a full matrix
subroutine, public cp_fm_struct_create(fmstruct, para_env, context, nrow_global, ncol_global, nrow_block, ncol_block, descriptor, first_p_pos, local_leading_dimension, template_fmstruct, square_blocks, force_block)
allocates and initializes a full matrix structure
subroutine, public cp_fm_struct_release(fmstruct)
releases a full matrix structure
represent a full matrix distributed on many processors
subroutine, public cp_fm_copy_general(source, destination, para_env)
General copy of a fm matrix to another fm matrix. Uses non-blocking MPI rather than ScaLAPACK.
subroutine, public cp_fm_get_info(matrix, name, nrow_global, ncol_global, nrow_block, ncol_block, nrow_local, ncol_local, row_indices, col_indices, local_data, context, nrow_locals, ncol_locals, matrix_struct, para_env)
returns all kind of information about the full matrix
subroutine, public cp_fm_set_all(matrix, alpha, beta)
set all elements of a matrix to the same value, and optionally the diagonal to a different one
subroutine, public cp_fm_create(matrix, matrix_struct, name, nrow, ncol, set_zero)
creates a new full matrix with the given structure
stores a mapping of 2D info (e.g. matrix) on a 2D processor distribution (i.e. blacs grid) where cpus...
Types to describe group distributions.
Defines the basic variable types.
integer, parameter, public dp
Routines to compute the Coulomb integral V_(alpha beta)(k) for a k-point k using lattice summation in...
subroutine, public build_2c_coulomb_matrix_kp(matrix_v_kp, kpoints, basis_type, cell, particle_set, qs_kind_set, atomic_kind_set, size_lattice_sum, operator_type, ikp_start, ikp_end)
...
Routines needed for kpoint calculation.
subroutine, public rskp_transform(rmatrix, cmatrix, rsmat, ispin, xkp, cell_to_index, sab_nl, is_complex, rs_sign)
Transformation of real space matrices to a kpoint.
subroutine, public kpoint_init_cell_index(kpoint, sab_nl, para_env, nimages)
Generates the mapping of cell indices and linear RS index CELL (0,0,0) is always mapped to index 1.
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.
2- and 3-center electron repulsion integral routines based on libint2 Currently available operators: ...
pure logical function, public compare_potential_types(potential1, potential2)
Helper function to compare Coulomb operator types.
Machine interface based on Fortran 2003 and POSIX.
subroutine, public m_flush(lunit)
flushes units if the &GLOBAL flag is set accordingly
Definition of mathematical constants and functions.
complex(kind=dp), parameter, public z_one
complex(kind=dp), parameter, public gaussi
complex(kind=dp), parameter, public z_zero
Interface to the message passing library MPI.
subroutine, public mp_para_env_release(para_env)
releases the para object (to be called when you don't want anymore the shared copy of this object)
Routines to calculate 2c- and 3c-integrals for RI with GPW.
subroutine, public mp2_eri_2c_integrate_gpw(qs_env, para_env_sub, my_group_l_start, my_group_l_end, natom, potential_parameter, sab_orb_sub, l_local_col, kind_of)
Integrates the potential of an RI function.
Interface to direct methods for electron repulsion integrals for MP2.
subroutine, public mp2_eri_2c_integrate(param, potential_parameter, para_env, qs_env, basis_type_a, basis_type_b, hab, first_b, last_b, eri_method, pab, force_a, force_b, hdab, hadb, reflection_z_a, reflection_z_b, do_reflection_a, do_reflection_b)
high-level integration routine for 2c integrals over CP2K basis sets. Contiguous column-wise distribu...
Framework for 2c-integrals for RI.
subroutine, public ri_2c_integral_mat(qs_env, fm_matrix_minv_l_gamma, fm_matrix_l_struct, dimen_ri, ri_metric, put_mat_ks_env, regularization_ri)
...
subroutine, public get_2c_integrals(qs_env, eri_method, eri_param, para_env, para_env_sub, mp2_memory, my_lrows, my_vrows, fm_matrix_pq, ngroup, color_sub, dimen_ri, dimen_ri_red, kpoints, my_group_l_size, my_group_l_start, my_group_l_end, gd_array, calc_pq_cond_num, do_svd, eps_svd, potential, ri_metric, cfm_matrix_l_kpoints, cfm_matrix_minv_l_kpoints, fm_matrix_minv_l_gamma, fm_matrix_minv, fm_matrix_minv_vtrunc_minv, do_im_time, do_kpoints, mp2_eps_pgf_orb_s, qs_kind_set, sab_orb_sub, calc_forces, unit_nr)
...
subroutine, public trunc_coulomb_for_exchange(qs_env, trunc_coulomb, rel_cutoff_trunc_coulomb_ri_x, cell_grid, do_bvk_cell)
...
subroutine, public ri_2c_integral_mat_kp(qs_env, cfm_matrix_m_kpoints, fm_matrix_struct, dimen_ri, ri_metric, kpoints, put_mat_ks_env, regularization_ri, ikp_ext, do_build_cell_index)
Computes the complex k-point RI metric as native CFM matrices.
subroutine, public inversion_of_m_and_mult_with_chol_dec_of_v(cfm_matrix_m_kpoints, cfm_matrix_l_kpoints, cfm_matrix_minv_l_kpoints, dimen_ri, kpoints, eps_eigval_s)
...
basic linear algebra operations for full matrixes
Define methods related to particle_type.
subroutine, public get_particle_set(particle_set, qs_kind_set, first_sgf, last_sgf, nsgf, nmao, basis, ncgf)
Get the components of a particle set.
Define the data structure for the particle information.
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.
Some utility functions for the calculation of integrals.
subroutine, public basis_set_list_setup(basis_set_list, basis_type, qs_kind_set)
Set up an easy accessible list of the basis sets for all kinds.
Calculate the interaction radii for the operator matrix calculation.
subroutine, public init_interaction_radii(qs_control, qs_kind_set)
Initialize all the atomic kind radii for a given threshold value.
Define the quickstep kind type and their sub types.
subroutine, public get_qs_kind(qs_kind, basis_set, basis_type, ncgf, nsgf, all_potential, tnadd_potential, gth_potential, sgp_potential, upf_potential, cneo_potential, se_parameter, dftb_parameter, xtb_parameter, dftb3_param, zatom, zeff, elec_conf, mao, lmax_dftb, alpha_core_charge, ccore_charge, core_charge, core_charge_radius, paw_proj_set, paw_atom, hard_radius, hard0_radius, max_rad_local, covalent_radius, vdw_radius, gpw_type_forced, harmonics, max_iso_not0, max_s_harm, grid_atom, ngrid_ang, ngrid_rad, lmax_rho0, dft_plus_u_atom, l_of_dft_plus_u, n_of_dft_plus_u, u_minus_j, hund_j, u_of_dft_plus_u, j_of_dft_plus_u, alpha_of_dft_plus_u, beta_of_dft_plus_u, j0_of_dft_plus_u, occupation_of_dft_plus_u, dispersion, bs_occupation, magnetization, no_optimize, addel, laddel, naddel, orbitals, max_scf, eps_scf, smear, u_ramping, u_minus_j_target, eps_u_ramping, proj_shell_charge, lr_atom, do_mtlr, u_j_loop, ao_coef, init_u_ramping_each_scf, reltmat, ghost, monovalent, floating, name, element_symbol, pao_basis_size, pao_model_file, pao_potentials, pao_descriptors, nelec)
Get attributes of an atomic kind.
subroutine, public set_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, vppl, xcint_weights, rho_core, rho_nlcc, rho_nlcc_g, vee, neighbor_list_id, kpoints, 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, subsys, dft_control, dbcsr_dist, distribution_2d, pw_env, para_env, blacs_env)
...
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 release_neighbor_list_sets(nlists)
releases an array of neighbor_list_sets
Utility methods to build 3-center integral tensors of various types.
subroutine, public build_2c_integrals(t2c, filter_eps, qs_env, nl_2c, basis_i, basis_j, potential_parameter, do_kpoints, do_hfx_kpoints, ext_kpoints, regularization_ri)
...
subroutine, public build_2c_neighbor_lists(ij_list, basis_i, basis_j, potential_parameter, name, qs_env, sym_ij, molecular, dist_2d, pot_to_rad)
Build 2-center neighborlists adapted to different operators This mainly wraps build_neighbor_lists fo...
Provides all information about an atomic kind.
Type defining parameters related to the simulation cell.
represent a blacs multidimensional parallel environment (for the mpi corrispective see cp_paratypes/m...
Represent a complex full matrix.
keeps the information about the structure of a full matrix
distributes pairs on a 2d grid of processors
Contains information about kpoints.
stores all the informations relevant to an mpi environment
Provides all information about a quickstep kind.