94#include "./base/base_uses.f90"
100 CHARACTER(len=*),
PARAMETER,
PRIVATE :: moduleN =
'mp2_gpw'
125 SUBROUTINE mp2_gpw_main(qs_env, mp2_env, Emp2, Emp2_Cou, Emp2_EX, Emp2_S, Emp2_T, &
126 mos_mp2, para_env, unit_nr, calc_forces, calc_ex, do_ri_mp2, do_ri_rpa, &
127 do_ri_sos_laplace_mp2)
130 REAL(kind=
dp),
INTENT(OUT) :: emp2, emp2_cou, emp2_ex, emp2_s, emp2_t
131 TYPE(
mo_set_type),
DIMENSION(:),
INTENT(IN) :: mos_mp2
133 INTEGER,
INTENT(IN) :: unit_nr
134 LOGICAL,
INTENT(IN) :: calc_forces, calc_ex
135 LOGICAL,
INTENT(IN),
OPTIONAL :: do_ri_mp2, do_ri_rpa, &
136 do_ri_sos_laplace_mp2
138 CHARACTER(LEN=*),
PARAMETER :: routinen =
'mp2_gpw_main'
140 INTEGER :: blacs_grid_layout, color_sub, dimen_ri, dimen_ri_red, eri_method, handle, ispin, &
141 local_unit_nr, my_group_l_end, my_group_l_size, my_group_l_start, nmo, nspins, &
142 potential_type, ri_metric_type
143 INTEGER,
ALLOCATABLE,
DIMENSION(:) :: bse_lev_virt, ends_array_mc, ends_array_mc_block, &
144 gw_corr_lev_occ, gw_corr_lev_virt, homo, starts_array_mc, starts_array_mc_block
145 INTEGER,
DIMENSION(3) :: periodic
146 LOGICAL :: blacs_repeatable, do_bse, do_im_time, do_kpoints_cubic_rpa, my_do_gw, &
147 my_do_ri_mp2, my_do_ri_rpa, my_do_ri_sos_laplace_mp2
148 REAL(kind=
dp) :: emp2_ab, emp2_bb, emp2_cou_bb, &
149 emp2_ex_bb, eps_gvg_rspace_old, &
150 eps_pgf_orb_old, eps_rho_rspace_old
151 REAL(kind=
dp),
ALLOCATABLE,
DIMENSION(:, :) :: eigenval
152 REAL(kind=
dp),
DIMENSION(:),
POINTER :: mo_eigenvalues
155 DIMENSION(:, :, :) :: t_3c_o_ind
159 TYPE(
cp_fm_type),
ALLOCATABLE,
DIMENSION(:) :: mo_coeff
160 TYPE(
cp_fm_type),
ALLOCATABLE,
DIMENSION(:, :) :: fm_matrix_l_kpoints, fm_matrix_minv, &
161 fm_matrix_minv_l_kpoints, &
162 fm_matrix_minv_vtrunc_minv
166 TYPE(
dbcsr_p_type),
ALLOCATABLE,
DIMENSION(:) :: mo_coeff_all, mo_coeff_gw, mo_coeff_o, &
167 mo_coeff_o_bse, mo_coeff_v, &
170 TYPE(
dbcsr_p_type),
DIMENSION(:, :),
POINTER :: matrix_s_kp
171 TYPE(dbt_type) :: t_3c_m
172 TYPE(dbt_type),
ALLOCATABLE,
DIMENSION(:, :) :: t_3c_o
176 DIMENSION(:) :: gd_b_occ_bse, gd_b_virt_bse, gd_b_virtual
178 DIMENSION(:, :, :) :: t_3c_o_compressed
179 TYPE(
kpoint_type),
POINTER :: kpoints, kpoints_from_dft
183 POINTER :: sab_orb_sub
185 TYPE(
qs_kind_type),
DIMENSION(:),
POINTER :: qs_kind_set
188 DIMENSION(:) :: bib_c, bib_c_bse_ab, bib_c_bse_ij, &
191 CALL timeset(routinen, handle)
194 my_do_ri_mp2 = .false.
195 IF (
PRESENT(do_ri_mp2)) my_do_ri_mp2 = do_ri_mp2
198 my_do_ri_rpa = .false.
199 IF (
PRESENT(do_ri_rpa)) my_do_ri_rpa = do_ri_rpa
202 my_do_ri_sos_laplace_mp2 = .false.
203 IF (
PRESENT(do_ri_sos_laplace_mp2)) my_do_ri_sos_laplace_mp2 = do_ri_sos_laplace_mp2
206 IF (my_do_ri_sos_laplace_mp2)
THEN
207 cpassert(.NOT. mp2_env%ri_rpa%do_ri_g0w0)
211 do_im_time = mp2_env%do_im_time
212 do_bse = qs_env%mp2_env%bse%do_bse
213 do_kpoints_cubic_rpa = qs_env%mp2_env%ri_rpa_im_time%do_im_time_kpoints
215 IF (do_kpoints_cubic_rpa .AND. mp2_env%ri_rpa%do_ri_g0w0)
THEN
216 cpabort(
"Full RPA k-points (DO_KPOINTS in LOW_SCALING section) not implemented with GW")
220 nspins =
SIZE(mos_mp2)
223 IF (do_kpoints_cubic_rpa)
THEN
224 CALL get_qs_env(qs_env=qs_env, dft_control=dft_control, kpoints=kpoints_from_dft)
225 mos(1:nspins) => kpoints_from_dft%kp_env(1)%kpoint_env%mos(1:nspins, 1)
227 CALL get_qs_env(qs_env=qs_env, dft_control=dft_control, mos=mos)
230 ALLOCATE (homo(nspins), eigenval(nmo, nspins), mo_coeff(nspins))
233 eigenvalues=mo_eigenvalues, homo=homo(ispin), &
234 mo_coeff=mo_coeff_ptr)
235 mo_coeff(ispin) = mo_coeff_ptr
236 eigenval(:, ispin) = mo_eigenvalues(1:nmo)
240 color_sub = para_env%mepos/mp2_env%mp2_num_proc
241 ALLOCATE (para_env_sub)
242 CALL para_env_sub%from_split(para_env, color_sub)
246 IF (para_env%is_source())
THEN
255 qs_kind_set=qs_kind_set, &
257 particle_set=particle_set, &
258 atomic_kind_set=atomic_kind_set, &
259 dft_control=dft_control, &
260 matrix_s_kp=matrix_s_kp)
262 CALL get_cell(cell=cell, periodic=periodic)
265 IF (mp2_env%ri_metric%potential_type ==
ri_default)
THEN
266 IF (sum(periodic) == 1 .OR. sum(periodic) == 3)
THEN
275 IF (mp2_env%ri_metric%potential_type ==
ri_default)
THEN
280 IF (sum(periodic) > 0) mp2_env%eri_method =
do_eri_gpw
281 IF (sum(periodic) == 0) mp2_env%eri_method =
do_eri_os
282 IF (sum(mp2_env%ri_rpa_im_time%kp_grid) > 0) mp2_env%eri_method =
do_eri_os
285 IF (mp2_env%ri_rpa_im_time%do_im_time_kpoints) mp2_env%eri_method =
do_eri_os
288 eri_method = mp2_env%eri_method
290 IF (unit_nr > 0 .AND. mp2_env%eri_method ==
do_eri_gpw)
THEN
291 WRITE (unit=unit_nr, fmt=
"(T3,A,T71,F10.1)") &
292 "GPW_INFO| Density cutoff [a.u.]:", mp2_env%mp2_gpw%cutoff*0.5_dp
293 WRITE (unit=unit_nr, fmt=
"(T3,A,T71,F10.1)") &
294 "GPW_INFO| Relative density cutoff [a.u.]:", mp2_env%mp2_gpw%relative_cutoff*0.5_dp
299 IF (.NOT. (mp2_env%ri_g0w0%print_local_bandgap .OR. mp2_env%bse%do_nto_analysis))
THEN
303 default_global_unit_nr=local_unit_nr, &
304 close_global_unit_on_dealloc=.false.)
305 CALL cp_logger_set(logger_sub, local_filename=
"MP2_localLog")
307 logger_sub%iter_info%print_level = mp2_env%mp2_gpw%print_level
313 blacs_repeatable = .true.
314 NULLIFY (blacs_env_sub)
319 blacs_env_sub_mat_munu => blacs_env_sub
321 matrix_s(1:1) => matrix_s_kp(1:1, 1)
323 CALL get_eps_old(dft_control, eps_pgf_orb_old, eps_rho_rspace_old, eps_gvg_rspace_old)
326 blacs_env_sub_mat_munu, do_alloc_blocks_from_nbl=.NOT. do_im_time, sab_orb_sub=sab_orb_sub, &
327 do_kpoints=mp2_env%ri_rpa_im_time%do_im_time_kpoints, &
328 dbcsr_sym_type=dbcsr_type_symmetric)
331 ri_metric_type = mp2_env%ri_metric%potential_type
334 potential_type = mp2_env%potential_parameter%potential_type
337 my_do_gw = mp2_env%ri_rpa%do_ri_g0w0
338 ALLOCATE (gw_corr_lev_occ(nspins), gw_corr_lev_virt(nspins), bse_lev_virt(nspins))
339 gw_corr_lev_occ(1) = mp2_env%ri_g0w0%corr_mos_occ
340 gw_corr_lev_virt(1) = mp2_env%ri_g0w0%corr_mos_virt
341 IF (nspins == 2)
THEN
342 gw_corr_lev_occ(2) = mp2_env%ri_g0w0%corr_mos_occ_beta
343 gw_corr_lev_virt(2) = mp2_env%ri_g0w0%corr_mos_virt_beta
351 bse_lev_virt(:) = gw_corr_lev_virt(:)
355 ALLOCATE (mo_coeff_o(nspins), mo_coeff_v(nspins), mo_coeff_all(nspins), mo_coeff_gw(nspins))
358 ALLOCATE (mo_coeff_o_bse(nspins), mo_coeff_v_bse(nspins))
361 IF (.NOT. do_im_time)
THEN
368 CALL replicate_mat_to_subgroup(para_env, para_env_sub, mo_coeff(ispin), homo(ispin), mat_munu%matrix, &
369 mo_coeff_o(ispin)%matrix, mo_coeff_v(ispin)%matrix, &
370 mo_coeff_all(ispin)%matrix, mo_coeff_gw(ispin)%matrix, &
371 my_do_gw, gw_corr_lev_occ(ispin), gw_corr_lev_virt(ispin), do_bse, &
372 bse_lev_virt(ispin), mo_coeff_o_bse(ispin)%matrix, mo_coeff_v_bse(ispin)%matrix, &
373 mp2_env%mp2_gpw%eps_filter)
382 IF (my_do_ri_mp2 .OR. my_do_ri_rpa .OR. my_do_ri_sos_laplace_mp2)
THEN
384 IF (nspins == 2)
THEN
387 bib_c, bib_c_gw, bib_c_bse_ij, bib_c_bse_ab, gd_array, gd_b_virtual, dimen_ri, dimen_ri_red, qs_env, &
388 para_env, para_env_sub, color_sub, cell, particle_set, &
389 atomic_kind_set, qs_kind_set, fm_matrix_pq, fm_matrix_l_kpoints, fm_matrix_minv_l_kpoints, &
390 fm_matrix_minv, fm_matrix_minv_vtrunc_minv, nmo, homo, mat_munu, sab_orb_sub, &
391 mo_coeff_o, mo_coeff_v, mo_coeff_all, mo_coeff_gw, mo_coeff_o_bse, mo_coeff_v_bse, &
392 mp2_env%mp2_gpw%eps_filter, unit_nr, &
393 mp2_env%mp2_memory, mp2_env%calc_PQ_cond_num, calc_forces, blacs_env_sub, my_do_gw .AND. .NOT. do_im_time, &
394 do_bse, gd_b_all, starts_array_mc, ends_array_mc, starts_array_mc_block, ends_array_mc_block, &
395 gw_corr_lev_occ(1), gw_corr_lev_virt(1), &
397 do_im_time, do_kpoints_cubic_rpa, kpoints, &
398 t_3c_m, t_3c_o, t_3c_o_compressed, t_3c_o_ind, &
400 gd_b_occ_bse, gd_b_virt_bse)
404 dimen_ri, dimen_ri_red, qs_env, para_env, para_env_sub, &
405 color_sub, cell, particle_set, &
406 atomic_kind_set, qs_kind_set, fm_matrix_pq, &
407 fm_matrix_l_kpoints, fm_matrix_minv_l_kpoints, &
408 fm_matrix_minv, fm_matrix_minv_vtrunc_minv, nmo, homo, &
409 mat_munu, sab_orb_sub, &
410 mo_coeff_o, mo_coeff_v, mo_coeff_all, mo_coeff_gw, mo_coeff_o_bse, mo_coeff_v_bse, &
411 mp2_env%mp2_gpw%eps_filter, unit_nr, &
412 mp2_env%mp2_memory, mp2_env%calc_PQ_cond_num, calc_forces, &
413 blacs_env_sub, my_do_gw .AND. .NOT. do_im_time, do_bse, gd_b_all, &
414 starts_array_mc, ends_array_mc, &
415 starts_array_mc_block, ends_array_mc_block, &
416 gw_corr_lev_occ(1), gw_corr_lev_virt(1), &
418 do_im_time, do_kpoints_cubic_rpa, kpoints, &
419 t_3c_m, t_3c_o, t_3c_o_compressed, t_3c_o_ind, &
420 mp2_env%ri_metric, gd_b_occ_bse, gd_b_virt_bse)
425 IF (nspins == 2)
THEN
427 IF (unit_nr > 0)
WRITE (unit_nr, *)
428 IF (unit_nr > 0)
WRITE (unit_nr,
'(T3,A)')
'Alpha (ia|'
430 emp2, emp2_cou, emp2_ex, qs_env, para_env, para_env_sub, color_sub, &
431 cell, particle_set, &
432 atomic_kind_set, qs_kind_set, eigenval, nmo, homo, mat_munu, &
433 sab_orb_sub, mo_coeff_o, mo_coeff_v, mp2_env%mp2_gpw%eps_filter, unit_nr, &
434 mp2_env%mp2_memory, calc_ex, blacs_env_sub, emp2_ab)
437 IF (unit_nr > 0)
WRITE (unit_nr, *)
438 IF (unit_nr > 0)
WRITE (unit_nr,
'(T3,A)')
'Beta (ia|'
440 emp2_bb, emp2_cou_bb, emp2_ex_bb, qs_env, para_env, para_env_sub, color_sub, cell, particle_set, &
441 atomic_kind_set, qs_kind_set, eigenval(:, 2:2), nmo, homo(2:2), mat_munu, &
442 sab_orb_sub, mo_coeff_o(2:2), mo_coeff_v(2:2), mp2_env%mp2_gpw%eps_filter, unit_nr, &
443 mp2_env%mp2_memory, calc_ex, blacs_env_sub)
446 emp2_cou = emp2_cou*0.25_dp
447 emp2_ex = emp2_ex*0.5_dp
449 emp2_cou_bb = emp2_cou_bb*0.25_dp
450 emp2_ex_bb = emp2_ex_bb*0.5_dp
453 emp2_t = emp2_cou + emp2_cou_bb + emp2_ex + emp2_ex_bb
455 emp2_cou = emp2_cou + emp2_cou_bb + emp2_ab
456 emp2_ex = emp2_ex + emp2_ex_bb
457 emp2 = emp2_ex + emp2_cou
462 emp2, emp2_cou, emp2_ex, qs_env, para_env, para_env_sub, color_sub, cell, particle_set, &
463 atomic_kind_set, qs_kind_set, eigenval(:, 1:1), nmo, homo(1:1), mat_munu, &
464 sab_orb_sub, mo_coeff_o(1:1), mo_coeff_v(1:1), mp2_env%mp2_gpw%eps_filter, unit_nr, &
465 mp2_env%mp2_memory, calc_ex, blacs_env_sub)
471 CALL dbcsr_clear_mempools()
473 IF (calc_forces .AND. .NOT. do_im_time)
THEN
475 ALLOCATE (mp2_env%ri_grad%mo_coeff_o(nspins), mp2_env%ri_grad%mo_coeff_v(nspins))
477 NULLIFY (mp2_env%ri_grad%mo_coeff_o(ispin)%matrix)
478 CALL dbcsr_init_p(mp2_env%ri_grad%mo_coeff_o(ispin)%matrix)
479 CALL dbcsr_copy(mp2_env%ri_grad%mo_coeff_o(ispin)%matrix, mo_coeff_o(ispin)%matrix, &
481 NULLIFY (mp2_env%ri_grad%mo_coeff_v(ispin)%matrix)
482 CALL dbcsr_init_p(mp2_env%ri_grad%mo_coeff_v(ispin)%matrix)
483 CALL dbcsr_copy(mp2_env%ri_grad%mo_coeff_v(ispin)%matrix, mo_coeff_v(ispin)%matrix, &
486 CALL get_group_dist(gd_array, color_sub, my_group_l_start, my_group_l_end, my_group_l_size)
490 ALLOCATE (mp2_env%ri_rpa%mo_coeff_o(nspins), mp2_env%ri_rpa%mo_coeff_v(nspins))
492 CALL dbcsr_copy(mp2_env%ri_rpa%mo_coeff_o(ispin), mo_coeff_o(ispin)%matrix, name=
"mo_coeff_o")
493 CALL dbcsr_copy(mp2_env%ri_rpa%mo_coeff_v(ispin), mo_coeff_v(ispin)%matrix, name=
"mo_coeff_v")
497 IF (.NOT. do_im_time)
THEN
501 DEALLOCATE (mo_coeff_o(ispin)%matrix)
503 DEALLOCATE (mo_coeff_v(ispin)%matrix)
506 DEALLOCATE (mo_coeff_all(ispin)%matrix)
509 DEALLOCATE (mo_coeff_o, mo_coeff_v)
510 IF (my_do_gw)
DEALLOCATE (mo_coeff_all)
517 DEALLOCATE (mo_coeff_o_bse(ispin)%matrix)
518 DEALLOCATE (mo_coeff_v_bse(ispin)%matrix)
521 DEALLOCATE (mo_coeff_o_bse, mo_coeff_v_bse)
524 IF (calc_forces .AND. do_im_time .OR. &
525 (.NOT. calc_forces .AND. mp2_env%ri_rpa%exchange_correction ==
rpa_exchange_none))
THEN
528 DEALLOCATE (mat_munu%matrix)
535 IF (my_do_ri_rpa .OR. my_do_ri_sos_laplace_mp2)
THEN
537 IF (do_im_time)
CALL create_matrix_p(mat_p_global, qs_env, mp2_env, para_env)
539 IF (.NOT.
ALLOCATED(bib_c))
ALLOCATE (bib_c(nspins))
540 IF (.NOT.
ALLOCATED(bib_c_gw))
ALLOCATE (bib_c_gw(nspins))
541 IF (.NOT.
ALLOCATED(gd_b_virtual))
ALLOCATE (gd_b_virtual(nspins))
544 CALL rpa_ri_compute_en(qs_env, emp2, mp2_env, bib_c, bib_c_gw, bib_c_bse_ij, bib_c_bse_ab, &
545 para_env, para_env_sub, color_sub, &
546 gd_array, gd_b_virtual, gd_b_all, gd_b_occ_bse, gd_b_virt_bse, &
547 mo_coeff, fm_matrix_pq, fm_matrix_l_kpoints, fm_matrix_minv_l_kpoints, &
548 fm_matrix_minv, fm_matrix_minv_vtrunc_minv, kpoints, &
549 eigenval, nmo, homo, dimen_ri, dimen_ri_red, gw_corr_lev_occ, gw_corr_lev_virt, &
551 unit_nr, my_do_ri_sos_laplace_mp2, my_do_gw, do_im_time, do_bse, matrix_s, &
552 mat_munu, mat_p_global, t_3c_m, t_3c_o, t_3c_o_compressed, t_3c_o_ind, &
553 starts_array_mc, ends_array_mc, &
554 starts_array_mc_block, ends_array_mc_block, calc_forces)
556 IF (mp2_env%ri_rpa%do_rse)
THEN
557 CALL rse_energy(qs_env, mp2_env, para_env, dft_control, mo_coeff, homo, eigenval)
561 IF (
ASSOCIATED(mat_p_global%matrix))
THEN
563 DEALLOCATE (mat_p_global%matrix)
573 DEALLOCATE (mat_munu%matrix)
580 IF (my_do_ri_mp2)
THEN
587 emp2_cou, emp2_ex, emp2_s, emp2_t, bib_c, mp2_env, para_env, para_env_sub, color_sub, &
588 gd_array, gd_b_virtual, &
589 eigenval, nmo, homo, dimen_ri_red, unit_nr, calc_forces, calc_ex)
596 IF (calc_forces .AND. .NOT. do_im_time)
THEN
599 particle_set, atomic_kind_set, qs_kind_set, &
600 mo_coeff, dimen_ri, eigenval, &
601 my_group_l_start, my_group_l_end, my_group_l_size, &
602 sab_orb_sub, mat_munu, blacs_env_sub)
606 DEALLOCATE (mp2_env%ri_grad%mo_coeff_o(ispin)%matrix)
609 DEALLOCATE (mp2_env%ri_grad%mo_coeff_v(ispin)%matrix)
611 DEALLOCATE (mp2_env%ri_grad%mo_coeff_o, mp2_env%ri_grad%mo_coeff_v)
614 DEALLOCATE (mat_munu%matrix)
622 IF (my_do_gw .AND. .NOT. do_im_time)
THEN
625 DEALLOCATE (mo_coeff_gw(ispin)%matrix)
627 DEALLOCATE (mo_coeff_gw)
631 dft_control%qs_control%eps_pgf_orb = eps_pgf_orb_old
632 dft_control%qs_control%eps_rho_rspace = eps_rho_rspace_old
633 dft_control%qs_control%eps_gvg_rspace = eps_gvg_rspace_old
638 IF (.NOT. (mp2_env%ri_g0w0%print_local_bandgap .OR. mp2_env%bse%do_nto_analysis))
THEN
646 IF (calc_forces .AND. .NOT. do_im_time)
THEN
648 mo_coeff, homo, eigenval, unit_nr)
651 DEALLOCATE (eigenval, mo_coeff)
653 CALL timestop(handle)
677 SUBROUTINE replicate_mat_to_subgroup(para_env, para_env_sub, mo_coeff, homo, mat_munu, &
678 mo_coeff_o, mo_coeff_v, mo_coeff_all, mo_coeff_gw, my_do_gw, &
679 gw_corr_lev_occ, gw_corr_lev_virt, my_do_bse, &
680 bse_lev_virt, mo_coeff_o_bse, mo_coeff_v_bse, eps_filter)
683 INTEGER,
INTENT(IN) :: homo
685 TYPE(
dbcsr_type),
POINTER :: mo_coeff_o, mo_coeff_v, mo_coeff_all, &
687 LOGICAL,
INTENT(IN) :: my_do_gw
688 INTEGER,
INTENT(IN) :: gw_corr_lev_occ, gw_corr_lev_virt
689 LOGICAL,
INTENT(IN) :: my_do_bse
690 INTEGER,
INTENT(IN) :: bse_lev_virt
691 TYPE(
dbcsr_type),
POINTER :: mo_coeff_o_bse, mo_coeff_v_bse
692 REAL(kind=
dp),
INTENT(IN) :: eps_filter
694 CHARACTER(LEN=*),
PARAMETER :: routinen =
'replicate_mat_to_subgroup'
697 REAL(kind=
dp),
ALLOCATABLE,
DIMENSION(:, :) :: c
700 CALL timeset(routinen, handle)
705 ALLOCATE (mo_coeff_o)
707 mat_munu, gd_array, eps_filter)
709 ALLOCATE (mo_coeff_v)
711 mat_munu, gd_array, eps_filter)
714 ALLOCATE (mo_coeff_gw)
715 CALL build_dbcsr_from_rows(para_env_sub, mo_coeff_gw, c(:, homo - gw_corr_lev_occ + 1:homo + gw_corr_lev_virt), &
716 mat_munu, gd_array, eps_filter)
719 ALLOCATE (mo_coeff_all)
721 mat_munu, gd_array, eps_filter)
727 ALLOCATE (mo_coeff_o_bse)
729 mat_munu, gd_array, eps_filter)
731 ALLOCATE (mo_coeff_v_bse)
733 mat_munu, gd_array, eps_filter)
739 CALL timestop(handle)
741 END SUBROUTINE replicate_mat_to_subgroup
755 REAL(kind=
dp),
ALLOCATABLE,
DIMENSION(:, :), &
758 CHARACTER(LEN=*),
PARAMETER :: routinen =
'grep_rows_in_subgroups'
760 INTEGER :: handle, i_global, iib, j_global, jjb, max_row_col_local, my_mu_end, my_mu_size, &
761 my_mu_start, ncol_global, ncol_local, ncol_rec, nrow_global, nrow_local, nrow_rec, &
762 proc_receive_static, proc_send_static, proc_shift
763 INTEGER,
ALLOCATABLE,
DIMENSION(:, :) :: local_col_row_info, rec_col_row_info
764 INTEGER,
DIMENSION(:),
POINTER :: col_indices, col_indices_rec, &
765 row_indices, row_indices_rec
766 REAL(kind=
dp),
ALLOCATABLE,
DIMENSION(:, :) :: local_c, rec_c
767 REAL(kind=
dp),
CONTIGUOUS,
DIMENSION(:, :), &
768 POINTER :: local_c_internal
770 CALL timeset(routinen, handle)
773 ncol_global=ncol_global, &
774 nrow_global=nrow_global, &
775 nrow_local=nrow_local, &
776 ncol_local=ncol_local, &
777 row_indices=row_indices, &
778 col_indices=col_indices, &
779 local_data=local_c_internal)
782 CALL get_group_dist(gd_array, para_env_sub%mepos, my_mu_start, my_mu_end, my_mu_size)
785 ALLOCATE (c(my_mu_size, ncol_global))
788 ALLOCATE (local_c(nrow_local, ncol_local))
789 local_c(:, :) = local_c_internal(1:nrow_local, 1:ncol_local)
790 NULLIFY (local_c_internal)
792 max_row_col_local = max(nrow_local, ncol_local)
793 CALL para_env%max(max_row_col_local)
795 ALLOCATE (local_col_row_info(0:max_row_col_local, 2))
796 local_col_row_info = 0
798 local_col_row_info(0, 1) = nrow_local
799 local_col_row_info(1:nrow_local, 1) = row_indices(1:nrow_local)
801 local_col_row_info(0, 2) = ncol_local
802 local_col_row_info(1:ncol_local, 2) = col_indices(1:ncol_local)
804 ALLOCATE (rec_col_row_info(0:max_row_col_local, 2))
807 DO iib = 1, nrow_local
808 i_global = row_indices(iib)
809 IF (i_global >= my_mu_start .AND. i_global <= my_mu_end)
THEN
810 DO jjb = 1, ncol_local
811 j_global = col_indices(jjb)
812 c(i_global - my_mu_start + 1, j_global) = local_c(iib, jjb)
818 proc_send_static =
modulo(para_env%mepos + 1, para_env%num_pe)
819 proc_receive_static =
modulo(para_env%mepos - 1, para_env%num_pe)
820 DO proc_shift = 1, para_env%num_pe - 1
823 CALL para_env%sendrecv(local_col_row_info, proc_send_static, rec_col_row_info, proc_receive_static)
824 nrow_rec = rec_col_row_info(0, 1)
825 ncol_rec = rec_col_row_info(0, 2)
827 ALLOCATE (row_indices_rec(nrow_rec))
828 row_indices_rec = rec_col_row_info(1:nrow_rec, 1)
830 ALLOCATE (col_indices_rec(ncol_rec))
831 col_indices_rec = rec_col_row_info(1:ncol_rec, 2)
833 ALLOCATE (rec_c(nrow_rec, ncol_rec))
837 CALL para_env%sendrecv(local_c, proc_send_static, rec_c, proc_receive_static)
841 i_global = row_indices_rec(iib)
842 IF (i_global >= my_mu_start .AND. i_global <= my_mu_end)
THEN
844 j_global = col_indices_rec(jjb)
845 c(i_global - my_mu_start + 1, j_global) = rec_c(iib, jjb)
850 local_col_row_info(:, :) = rec_col_row_info
852 ALLOCATE (local_c(nrow_rec, ncol_rec))
853 local_c(:, :) = rec_c
855 DEALLOCATE (col_indices_rec)
856 DEALLOCATE (row_indices_rec)
861 DEALLOCATE (local_col_row_info)
862 DEALLOCATE (rec_col_row_info)
864 CALL timestop(handle)
879 mat_munu, gd_array, eps_filter)
882 REAL(kind=
dp),
DIMENSION(:, :),
INTENT(IN) :: cread
885 REAL(kind=
dp),
INTENT(IN) :: eps_filter
887 CHARACTER(LEN=*),
PARAMETER :: routinen =
'build_dbcsr_from_rows'
889 INTEGER :: col, col_offset, col_size, handle, i, i_global, j, j_global, my_mu_end, &
890 my_mu_start, ncol_global, proc_receive, proc_send, proc_shift, rec_mu_end, rec_mu_size, &
891 rec_mu_start, row, row_offset, row_size
892 REAL(kind=
dp),
ALLOCATABLE,
DIMENSION(:, :) :: rec_c
893 REAL(kind=
dp),
DIMENSION(:, :),
POINTER :: data_block
896 CALL timeset(routinen, handle)
898 ncol_global =
SIZE(cread, 2)
900 CALL get_group_dist(gd_array, para_env_sub%mepos, my_mu_start, my_mu_end)
903 sym=dbcsr_type_no_symmetry)
910 row_size=row_size, col_size=col_size, &
911 row_offset=row_offset, col_offset=col_offset)
913 i_global = row_offset + i - 1
914 IF (i_global >= my_mu_start .AND. i_global <= my_mu_end)
THEN
916 j_global = col_offset + j - 1
917 data_block(i, j) = cread(i_global - my_mu_start + 1, col_offset + j - 1)
926 DO proc_shift = 1, para_env_sub%num_pe - 1
927 proc_send =
modulo(para_env_sub%mepos + proc_shift, para_env_sub%num_pe)
928 proc_receive =
modulo(para_env_sub%mepos - proc_shift, para_env_sub%num_pe)
930 CALL get_group_dist(gd_array, proc_receive, rec_mu_start, rec_mu_end, rec_mu_size)
932 ALLOCATE (rec_c(rec_mu_size, ncol_global))
936 CALL para_env_sub%sendrecv(cread, proc_send, rec_c, proc_receive)
942 row_size=row_size, col_size=col_size, &
943 row_offset=row_offset, col_offset=col_offset)
945 i_global = row_offset + i - 1
946 IF (i_global >= rec_mu_start .AND. i_global <= rec_mu_end)
THEN
948 j_global = col_offset + j - 1
949 data_block(i, j) = rec_c(i_global - rec_mu_start + 1, col_offset + j - 1)
961 CALL timestop(handle)
982 do_ri_aux_basis, do_mixed_basis, group_size_prim, &
983 do_alloc_blocks_from_nbl, do_kpoints, sab_orb_sub, dbcsr_sym_type, &
984 custom_row_blk_sizes)
988 REAL(kind=
dp) :: eps_grid
990 LOGICAL,
INTENT(IN),
OPTIONAL :: do_ri_aux_basis, do_mixed_basis
991 INTEGER,
INTENT(IN),
OPTIONAL :: group_size_prim
992 LOGICAL,
INTENT(IN),
OPTIONAL :: do_alloc_blocks_from_nbl, do_kpoints
994 OPTIONAL,
POINTER :: sab_orb_sub
995 CHARACTER,
OPTIONAL :: dbcsr_sym_type
996 INTEGER,
DIMENSION(:),
INTENT(IN),
OPTIONAL :: custom_row_blk_sizes
998 CHARACTER(LEN=*),
PARAMETER :: routinen =
'create_mat_munu'
1000 CHARACTER :: my_dbcsr_sym_type
1001 INTEGER :: handle, ikind, natom, nkind
1002 INTEGER,
DIMENSION(:),
POINTER :: col_blk_sizes, row_blk_sizes
1003 LOGICAL :: my_do_alloc_blocks_from_nbl, &
1004 my_do_kpoints, my_do_mixed_basis, &
1006 LOGICAL,
ALLOCATABLE,
DIMENSION(:) :: orb_present
1007 REAL(
dp),
ALLOCATABLE,
DIMENSION(:) :: orb_radius
1008 REAL(
dp),
ALLOCATABLE,
DIMENSION(:, :) :: pair_radius
1009 REAL(kind=
dp) :: subcells
1022 POINTER :: my_sab_orb_sub
1024 TYPE(
qs_kind_type),
DIMENSION(:),
POINTER :: qs_kind_set
1026 CALL timeset(routinen, handle)
1028 NULLIFY (basis_set_ri_aux)
1030 my_do_ri_aux_basis = .false.
1031 IF (
PRESENT(do_ri_aux_basis))
THEN
1032 my_do_ri_aux_basis = do_ri_aux_basis
1035 my_do_mixed_basis = .false.
1036 IF (
PRESENT(do_mixed_basis))
THEN
1037 my_do_mixed_basis = do_mixed_basis
1040 my_do_alloc_blocks_from_nbl = .false.
1041 IF (
PRESENT(do_alloc_blocks_from_nbl))
THEN
1042 my_do_alloc_blocks_from_nbl = do_alloc_blocks_from_nbl
1045 my_do_kpoints = .false.
1046 IF (
PRESENT(do_kpoints))
THEN
1047 my_do_kpoints = do_kpoints
1050 my_dbcsr_sym_type = dbcsr_type_no_symmetry
1051 IF (
PRESENT(dbcsr_sym_type))
THEN
1052 my_dbcsr_sym_type = dbcsr_sym_type
1056 qs_kind_set=qs_kind_set, &
1058 particle_set=particle_set, &
1059 atomic_kind_set=atomic_kind_set, &
1060 molecule_set=molecule_set, &
1061 molecule_kind_set=molecule_kind_set, &
1062 dft_control=dft_control)
1064 IF (my_do_kpoints)
THEN
1066 IF (eps_grid < dft_control%qs_control%eps_pgf_orb)
THEN
1067 eps_grid = dft_control%qs_control%eps_pgf_orb
1068 cpwarn(
"WFC_GPW%EPS_GRID has been set to QS%EPS_PGF_ORB")
1073 dft_control%qs_control%eps_pgf_orb = eps_grid
1074 dft_control%qs_control%eps_rho_rspace = eps_grid
1075 dft_control%qs_control%eps_gvg_rspace = eps_grid
1079 NULLIFY (local_particles_sub, local_molecules_sub)
1081 particle_set=particle_set, &
1082 local_particles=local_particles_sub, &
1083 molecule_kind_set=molecule_kind_set, &
1084 molecule_set=molecule_set, &
1085 local_molecules=local_molecules_sub, &
1086 force_env_section=qs_env%input)
1089 NULLIFY (distribution_2d_sub)
1091 atomic_kind_set=atomic_kind_set, &
1092 qs_kind_set=qs_kind_set, &
1093 particle_set=particle_set, &
1094 molecule_kind_set=molecule_kind_set, &
1095 molecule_set=molecule_set, &
1096 distribution_2d=distribution_2d_sub, &
1097 blacs_env=blacs_env_sub, &
1098 force_env_section=qs_env%input)
1102 nkind =
SIZE(atomic_kind_set)
1103 ALLOCATE (atom2d(nkind))
1105 CALL atom2d_build(atom2d, local_particles_sub, distribution_2d_sub, atomic_kind_set, &
1106 molecule_set, molecule_only=.false., particle_set=particle_set)
1108 ALLOCATE (orb_present(nkind))
1109 ALLOCATE (orb_radius(nkind))
1110 ALLOCATE (pair_radius(nkind, nkind))
1113 CALL get_qs_kind(qs_kind_set(ikind), basis_set=orb_basis_set)
1114 IF (
ASSOCIATED(orb_basis_set))
THEN
1115 orb_present(ikind) = .true.
1116 CALL get_gto_basis_set(gto_basis_set=orb_basis_set, kind_radius=orb_radius(ikind))
1118 orb_present(ikind) = .false.
1119 orb_radius(ikind) = 0.0_dp
1123 CALL pair_radius_setup(orb_present, orb_present, orb_radius, orb_radius, pair_radius)
1125 IF (
PRESENT(sab_orb_sub))
THEN
1126 NULLIFY (sab_orb_sub)
1128 IF (my_do_kpoints)
THEN
1130 mic=.false., subcells=subcells, molecular=.false., nlname=
"sab_orb_sub", &
1134 mic=.false., subcells=subcells, molecular=.false., nlname=
"sab_orb_sub")
1137 NULLIFY (my_sab_orb_sub)
1139 IF (my_do_kpoints)
THEN
1141 mic=.false., subcells=subcells, molecular=.false., nlname=
"sab_orb_sub", &
1145 mic=.false., subcells=subcells, molecular=.false., nlname=
"sab_orb_sub")
1150 DEALLOCATE (orb_present, orb_radius, pair_radius)
1153 ALLOCATE (dbcsr_dist_sub)
1157 natom =
SIZE(particle_set)
1158 ALLOCATE (row_blk_sizes(natom))
1159 IF (my_do_ri_aux_basis)
THEN
1160 IF (
PRESENT(custom_row_blk_sizes))
THEN
1161 cpassert(
SIZE(custom_row_blk_sizes) == natom)
1162 row_blk_sizes(:) = custom_row_blk_sizes
1164 ALLOCATE (basis_set_ri_aux(nkind))
1166 CALL get_particle_set(particle_set, qs_kind_set, nsgf=row_blk_sizes, basis=basis_set_ri_aux)
1167 DEALLOCATE (basis_set_ri_aux)
1170 ELSE IF (my_do_mixed_basis)
THEN
1172 ALLOCATE (basis_set_ri_aux(nkind))
1174 CALL get_particle_set(particle_set, qs_kind_set, nsgf=row_blk_sizes, basis=basis_set_ri_aux)
1175 DEALLOCATE (basis_set_ri_aux)
1177 ALLOCATE (col_blk_sizes(natom))
1180 col_blk_sizes = col_blk_sizes*group_size_prim
1186 NULLIFY (mat_munu%matrix)
1187 ALLOCATE (mat_munu%matrix)
1189 IF (my_do_ri_aux_basis)
THEN
1193 dist=dbcsr_dist_sub, matrix_type=my_dbcsr_sym_type, &
1194 row_blk_size=row_blk_sizes, col_blk_size=row_blk_sizes)
1196 ELSE IF (my_do_mixed_basis)
THEN
1200 dist=dbcsr_dist_sub, matrix_type=my_dbcsr_sym_type, &
1201 row_blk_size=row_blk_sizes, col_blk_size=col_blk_sizes)
1207 dist=dbcsr_dist_sub, matrix_type=my_dbcsr_sym_type, &
1208 row_blk_size=row_blk_sizes, col_blk_size=row_blk_sizes)
1210 IF (my_do_alloc_blocks_from_nbl)
THEN
1212 IF (
PRESENT(sab_orb_sub))
THEN
1222 DEALLOCATE (row_blk_sizes)
1224 IF (my_do_mixed_basis)
THEN
1225 DEALLOCATE (col_blk_sizes)
1229 DEALLOCATE (dbcsr_dist_sub)
1236 IF (.NOT.
PRESENT(sab_orb_sub))
THEN
1240 CALL timestop(handle)
1251 SUBROUTINE create_matrix_p(mat_P_global, qs_env, mp2_env, para_env)
1258 CHARACTER(LEN=*),
PARAMETER :: routinen =
'create_matrix_P'
1260 INTEGER :: blacs_grid_layout, handle
1261 LOGICAL :: blacs_repeatable
1264 CALL timeset(routinen, handle)
1267 blacs_repeatable = .true.
1268 NULLIFY (blacs_env_global)
1270 blacs_grid_layout, &
1273 CALL create_mat_munu(mat_p_global, qs_env, mp2_env%mp2_gpw%eps_grid, &
1274 blacs_env_global, do_ri_aux_basis=.true., &
1275 do_kpoints=mp2_env%ri_rpa_im_time%do_im_time_kpoints)
1280 CALL timestop(handle)
1282 END SUBROUTINE create_matrix_p
1291 PURE SUBROUTINE get_eps_old(dft_control, eps_pgf_orb_old, eps_rho_rspace_old, eps_gvg_rspace_old)
1294 REAL(kind=
dp),
INTENT(OUT) :: eps_pgf_orb_old, eps_rho_rspace_old, &
1298 eps_pgf_orb_old = dft_control%qs_control%eps_pgf_orb
1299 eps_rho_rspace_old = dft_control%qs_control%eps_rho_rspace
1300 eps_gvg_rspace_old = dft_control%qs_control%eps_gvg_rspace
1302 END SUBROUTINE get_eps_old
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_gto_basis_set(gto_basis_set, name, aliases, norm_type, kind_radius, ncgf, nset, nsgf, cgf_symbol, sgf_symbol, norm_cgf, set_radius, lmax, lmin, lx, ly, lz, m, ncgf_set, npgf, nsgf_set, nshell, cphi, pgf_radius, sphi, scon, zet, first_cgf, first_sgf, l, last_cgf, last_sgf, n, gcc, maxco, maxl, maxpgf, maxsgf_set, maxshell, maxso, nco_sum, npgf_sum, nshell_sum, maxder, short_kind_radius, npgf_seg_sum, ccon)
...
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.
methods related to the blacs parallel environment
integer, parameter, public blacs_grid_square
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
Defines control structures, which contain the parameters and the settings for the DFT-based calculati...
subroutine, public dbcsr_distribution_release(dist)
...
logical function, public dbcsr_iterator_blocks_left(iterator)
...
subroutine, public dbcsr_iterator_stop(iterator)
...
subroutine, public dbcsr_copy(matrix_b, matrix_a, name, keep_sparsity, keep_imaginary)
...
subroutine, public dbcsr_init_p(matrix)
...
subroutine, public dbcsr_iterator_next_block(iterator, row, column, block, block_number_argument_has_been_removed, row_size, col_size, row_offset, col_offset, transposed)
...
subroutine, public dbcsr_filter(matrix, eps)
...
subroutine, public dbcsr_iterator_start(iterator, matrix, shared, dynamic, dynamic_byrows)
...
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 cp_dbcsr_dist2d_to_dist(dist2d, dist)
Creates a DBCSR distribution from a distribution_2d.
subroutine, public cp_dbcsr_m_by_n_from_row_template(matrix, template, n, sym)
Utility function to create dbcsr matrix, m x n matrix (n arbitrary) with the same processor grid and ...
represent a full matrix distributed on many processors
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
various routines to log and control the output. The idea is that decisions about where to log should ...
recursive integer function, public cp_logger_get_default_unit_nr(logger, local, skip_not_ionode)
asks the default unit number of the given logger. try to use cp_logger_get_unit_nr
subroutine, public cp_logger_set(logger, local_filename, global_filename)
sets various attributes of the given logger
subroutine, public cp_rm_default_logger()
the cousin of cp_add_default_logger, decrements the stack, so that the default logger is what it has ...
subroutine, public cp_logger_release(logger)
releases this logger
subroutine, public cp_logger_create(logger, para_env, print_level, default_global_unit_nr, default_local_unit_nr, global_filename, local_filename, close_global_unit_on_dealloc, iter_info, close_local_unit_on_dealloc, suffix, template_logger)
initializes a logger
subroutine, public cp_add_default_logger(logger)
adds a default logger. MUST be called before logging occours
type(cp_logger_type) function, pointer, public cp_get_default_logger()
returns the default logger
This is the start of a dbt_api, all publically needed functions are exported here....
stores a lists of integer that are local to a processor. The idea is that these integers represent ob...
subroutine, public distribution_1d_release(distribution_1d)
releases the given distribution_1d
stores a mapping of 2D info (e.g. matrix) on a 2D processor distribution (i.e. blacs grid) where cpus...
subroutine, public distribution_2d_release(distribution_2d)
...
Distribution methods for atoms, particles, or molecules.
subroutine, public distribute_molecules_1d(atomic_kind_set, particle_set, local_particles, molecule_kind_set, molecule_set, local_molecules, force_env_section, prev_molecule_kind_set, prev_local_molecules)
Distribute molecules and particles.
subroutine, public distribute_molecules_2d(cell, atomic_kind_set, particle_set, qs_kind_set, molecule_kind_set, molecule_set, distribution_2d, blacs_env, force_env_section)
Distributes the particle pairs creating a 2d distribution optimally suited for quickstep.
Types to describe group distributions.
Types and set/get functions for HFX.
Defines the basic variable types.
integer, parameter, public dp
Types and basic routines needed for a kpoint calculation.
Machine interface based on Fortran 2003 and POSIX.
integer, parameter, public default_output_unit
subroutine, public m_flush(lunit)
flushes units if the &GLOBAL flag is set accordingly
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)
Define the molecule kind structure types and the corresponding functionality.
Define the data structure for the molecule information.
Routines to calculate CPHF like update and solve Z-vector equation for MP2 gradients (only GPW).
subroutine, public solve_z_vector_eq(qs_env, mp2_env, para_env, dft_control, mo_coeff, homo, eigenval, unit_nr)
Solve Z-vector equations necessary for the calculation of the MP2 gradients, in order to be consisten...
Routines to calculate MP2 energy using GPW method.
subroutine, public mp2_gpw_compute(emp2, emp2_cou, emp2_ex, qs_env, para_env, para_env_sub, color_sub, cell, particle_set, atomic_kind_set, qs_kind_set, eigenval, nmo, homo, mat_munu, sab_orb_sub, mo_coeff_o, mo_coeff_v, eps_filter, unit_nr, mp2_memory, calc_ex, blacs_env_sub, emp2_ab)
...
Calls routines to get RI integrals and calculate total energies.
subroutine, public mp2_gpw_main(qs_env, mp2_env, emp2, emp2_cou, emp2_ex, emp2_s, emp2_t, mos_mp2, para_env, unit_nr, calc_forces, calc_ex, do_ri_mp2, do_ri_rpa, do_ri_sos_laplace_mp2)
with a big bang to mp2
subroutine, public grep_rows_in_subgroups(para_env, para_env_sub, mo_coeff, gd_array, c)
...
subroutine, public build_dbcsr_from_rows(para_env_sub, mo_coeff_to_build, cread, mat_munu, gd_array, eps_filter)
Encapsulate the building of dbcsr_matrices mo_coeff_(v,o,all).
subroutine, public create_mat_munu(mat_munu, qs_env, eps_grid, blacs_env_sub, do_ri_aux_basis, do_mixed_basis, group_size_prim, do_alloc_blocks_from_nbl, do_kpoints, sab_orb_sub, dbcsr_sym_type, custom_row_blk_sizes)
Encapsulate the building of dbcsr_matrix mat_munu.
Routines to calculate and distribute 2c- and 3c- integrals for RI.
subroutine, public mp2_ri_gpw_compute_in(bib_c, bib_c_gw, bib_c_bse_ij, bib_c_bse_ab, gd_array, gd_b_virtual, dimen_ri, dimen_ri_red, qs_env, para_env, para_env_sub, color_sub, cell, particle_set, atomic_kind_set, qs_kind_set, fm_matrix_pq, fm_matrix_l_kpoints, fm_matrix_minv_l_kpoints, fm_matrix_minv, fm_matrix_minv_vtrunc_minv, nmo, homo, mat_munu, sab_orb_sub, mo_coeff_o, mo_coeff_v, mo_coeff_all, mo_coeff_gw, mo_coeff_o_bse, mo_coeff_v_bse, eps_filter, unit_nr, mp2_memory, calc_pq_cond_num, calc_forces, blacs_env_sub, my_do_gw, do_bse, gd_b_all, starts_array_mc, ends_array_mc, starts_array_mc_block, ends_array_mc_block, gw_corr_lev_occ, gw_corr_lev_virt, bse_lev_virt, do_im_time, do_kpoints_cubic_rpa, kpoints, t_3c_m, t_3c_o, t_3c_o_compressed, t_3c_o_ind, ri_metric, gd_b_occ_bse, gd_b_virt_bse)
with ri mp2 gpw
Routines to calculate RI-GPW-MP2 energy using pw.
subroutine, public mp2_ri_gpw_compute_en(emp2_cou, emp2_ex, emp2_s, emp2_t, bib_c, mp2_env, para_env, para_env_sub, color_sub, gd_array, gd_b_virtual, eigenval, nmo, homo, dimen_ri, unit_nr, calc_forces, calc_ex)
...
Routines to calculate gradients of RI-GPW-MP2 energy using pw.
subroutine, public calc_ri_mp2_nonsep(qs_env, mp2_env, para_env, para_env_sub, cell, particle_set, atomic_kind_set, qs_kind_set, mo_coeff, dimen_ri, eigenval, my_group_l_start, my_group_l_end, my_group_l_size, sab_orb_sub, mat_munu, blacs_env_sub)
Calculate the non-separable part of the gradients and update the Lagrangian.
Types needed for MP2 calculations.
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.
Definition and initialisation of the mo data type.
subroutine, public get_mo_set(mo_set, maxocc, homo, lfomo, nao, nelectron, n_el_f, nmo, eigenvalues, occupation_numbers, mo_coeff, mo_coeff_b, uniform_occupation, kts, mu, flexible_electron_count)
Get the components of a MO set data structure.
Define the neighbor list data types and the corresponding functionality.
subroutine, public release_neighbor_list_sets(nlists)
releases an array of neighbor_list_sets
Generate the atomic neighbor lists.
subroutine, public atom2d_cleanup(atom2d)
free the internals of atom2d
subroutine, public pair_radius_setup(present_a, present_b, radius_a, radius_b, pair_radius, prmin)
...
subroutine, public build_neighbor_lists(ab_list, particle_set, atom, cell, pair_radius, subcells, mic, symmetric, molecular, subset_of_mol, current_subset, operator_type, nlname, atomb_to_keep, stable_images)
Build simple pair neighbor lists.
subroutine, public atom2d_build(atom2d, distribution_1d, distribution_2d, atomic_kind_set, molecule_set, molecule_only, particle_set)
Build some distribution structure of atoms, refactored from build_qs_neighbor_lists.
Routines to calculate RI-RPA energy.
subroutine, public rpa_ri_compute_en(qs_env, erpa, mp2_env, bib_c, bib_c_gw, bib_c_bse_ij, bib_c_bse_ab, para_env, para_env_sub, color_sub, gd_array, gd_b_virtual, gd_b_all, gd_b_occ_bse, gd_b_virt_bse, mo_coeff, fm_matrix_pq, fm_matrix_l_kpoints, fm_matrix_minv_l_kpoints, fm_matrix_minv, fm_matrix_minv_vtrunc_minv, kpoints, eigenval, nmo, homo, dimen_ri, dimen_ri_red, gw_corr_lev_occ, gw_corr_lev_virt, bse_lev_virt, unit_nr, do_ri_sos_laplace_mp2, my_do_gw, do_im_time, do_bse, matrix_s, mat_munu, mat_p_global, t_3c_m, t_3c_o, t_3c_o_compressed, t_3c_o_ind, starts_array_mc, ends_array_mc, starts_array_mc_block, ends_array_mc_block, calc_forces)
...
Routines to compute singles correction to RPA (RSE).
subroutine, public rse_energy(qs_env, mp2_env, para_env, dft_control, mo_coeff, homo, eigenval)
Single excitations energy corrections for RPA.
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...
type of a logger, at the moment it contains just a print level starting at which level it should be l...
structure to store local (to a processor) ordered lists of integers.
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.
calculation environment to calculate the ks matrix, holds all the needed vars. assumes that the core ...