Skip to content

Commit

Permalink
Enable GW within DBCSR tensor implementation of low-scaling RPA (#651)
Browse files Browse the repository at this point in the history
* all features of cubic scaling RPA/GW are now supported in the DBCSR tensor based implementation, except for MAOs
* DBCSR update for better load balancing in case of a small tensor dimension
  • Loading branch information
Patrick Seewald committed Dec 10, 2019
1 parent abc627f commit 2824b54
Show file tree
Hide file tree
Showing 15 changed files with 949 additions and 170 deletions.
2 changes: 1 addition & 1 deletion exts/dbcsr
Submodule dbcsr updated 195 files
2 changes: 1 addition & 1 deletion src/input_cp2k_mp2.F
Original file line number Diff line number Diff line change
Expand Up @@ -1340,7 +1340,7 @@ SUBROUTINE create_ri_im_time(section)
CALL keyword_create( &
keyword, __LOCATION__, &
name="DO_DBCSR_T", &
description="Uses DBCSR tensors for cubic scaling RPA/L-SOS-MP2", &
description="Uses DBCSR tensors for cubic scaling RPA/L-SOS-MP2/GW", &
usage="DO_DBCSR_T", &
default_l_val=.TRUE., &
lone_keyword_l_val=.TRUE.)
Expand Down
10 changes: 5 additions & 5 deletions src/mp2_gpw.F
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,7 @@ SUBROUTINE mp2_gpw_main(qs_env, mp2_env, Emp2, Emp2_Cou, Emp2_EX, Emp2_S, Emp2_T
mat_3c_overl_int_mao_for_occ, &
mat_3c_overl_int_mao_for_virt
TYPE(dbcsr_t_type) :: t_3c_M
TYPE(dbcsr_t_type), ALLOCATABLE, DIMENSION(:, :) :: t_3c_O
TYPE(dbcsr_t_type), ALLOCATABLE, DIMENSION(:, :) :: t_3c_O, t_3c_overl_int
TYPE(dbcsr_type), POINTER :: mo_coeff_all, mo_coeff_all_beta, mo_coeff_gw, mo_coeff_gw_beta, &
mo_coeff_o, mo_coeff_o_beta, mo_coeff_v, mo_coeff_v_beta
TYPE(dft_control_type), POINTER :: dft_control
Expand Down Expand Up @@ -449,7 +449,7 @@ SUBROUTINE mp2_gpw_main(qs_env, mp2_env, Emp2, Emp2_Cou, Emp2_EX, Emp2_S, Emp2_T
mp2_env%mp2_memory, mp2_env%calc_PQ_cond_num, calc_forces, blacs_env_sub, my_do_gw .AND. .NOT. do_im_time, &
do_bse, gd_B_all, starts_array_mc_t, ends_array_mc_t, gw_corr_lev_occ, gw_corr_lev_virt, &
do_im_time, do_mao, do_kpoints_cubic_RPA, kpoints, &
mat_3c_overl_int, do_dbcsr_t, t_3c_M, t_3c_O, &
mat_3c_overl_int, do_dbcsr_t, t_3c_overl_int, t_3c_M, t_3c_O, &
mat_3c_overl_int_mao_for_occ, mat_3c_overl_int_mao_for_virt, &
mao_coeff_occ, mao_coeff_virt, ri_metric, &
gd_B_occ_bse, gd_B_virt_bse, &
Expand All @@ -469,7 +469,7 @@ SUBROUTINE mp2_gpw_main(qs_env, mp2_env, Emp2, Emp2_Cou, Emp2_EX, Emp2_S, Emp2_T
starts_array_mc_t, ends_array_mc_t, &
gw_corr_lev_occ, gw_corr_lev_virt, &
do_im_time, do_mao, do_kpoints_cubic_RPA, kpoints, &
mat_3c_overl_int, do_dbcsr_t, t_3c_M, t_3c_O, mat_3c_overl_int_mao_for_occ, &
mat_3c_overl_int, do_dbcsr_t, t_3c_overl_int, t_3c_M, t_3c_O, mat_3c_overl_int_mao_for_occ, &
mat_3c_overl_int_mao_for_virt, mao_coeff_occ, mao_coeff_virt, &
ri_metric, gd_B_occ_bse, gd_B_virt_bse)
Expand Down Expand Up @@ -634,7 +634,7 @@ SUBROUTINE mp2_gpw_main(qs_env, mp2_env, Emp2, Emp2_Cou, Emp2_EX, Emp2_S, Emp2_T
mao_coeff_occ, mao_coeff_virt, mao_coeff_occ_A, mao_coeff_virt_A, &
mat_munu, mat_dm_occ_local, mat_dm_virt_local, &
mat_P_local, mat_P_global, mat_M, &
mat_3c_overl_int, do_dbcsr_t, t_3c_M, t_3c_O, starts_array_mc_t, &
mat_3c_overl_int, do_dbcsr_t, t_3c_overl_int, t_3c_M, t_3c_O, starts_array_mc_t, &
ends_array_mc_t, &
mat_3c_overl_int_mao_for_occ, mat_3c_overl_int_mao_for_virt, &
mp2_env%mp2_gpw%eps_filter, BIb_C_beta, homo_beta, Eigenval_beta, &
Expand All @@ -655,7 +655,7 @@ SUBROUTINE mp2_gpw_main(qs_env, mp2_env, Emp2, Emp2_Cou, Emp2_EX, Emp2_S, Emp2_T
mao_coeff_occ, mao_coeff_virt, mao_coeff_occ_A, mao_coeff_virt_A, &
mat_munu, mat_dm_occ_local, mat_dm_virt_local, &
mat_P_local, mat_P_global, mat_M, &
mat_3c_overl_int, do_dbcsr_t, t_3c_M, t_3c_O, &
mat_3c_overl_int, do_dbcsr_t, t_3c_overl_int, t_3c_M, t_3c_O, &
starts_array_mc_t, ends_array_mc_t, &
mat_3c_overl_int_mao_for_occ, mat_3c_overl_int_mao_for_virt, &
mp2_env%mp2_gpw%eps_filter)
Expand Down
8 changes: 4 additions & 4 deletions src/mp2_integrals.F
Original file line number Diff line number Diff line change
Expand Up @@ -179,6 +179,7 @@ MODULE mp2_integrals
!> \param kpoints ...
!> \param mat_3c_overl_int ...
!> \param do_dbcsr_t ...
!> \param t_3c_overl_int ...
!> \param t_3c_M ...
!> \param t_3c_O ...
!> \param mat_3c_overl_int_mao_for_occ ...
Expand Down Expand Up @@ -209,7 +210,7 @@ SUBROUTINE mp2_ri_gpw_compute_in(BIb_C, BIb_C_gw, BIb_C_bse_ij, BIb_C_bse_ab, gd
gd_B_all, starts_array_mc_t, ends_array_mc_t, &
gw_corr_lev_occ, gw_corr_lev_virt, &
do_im_time, do_mao, do_kpoints_cubic_RPA, kpoints, &
mat_3c_overl_int, do_dbcsr_t, t_3c_M, t_3c_O, mat_3c_overl_int_mao_for_occ, &
mat_3c_overl_int, do_dbcsr_t, t_3c_overl_int, t_3c_M, t_3c_O, mat_3c_overl_int_mao_for_occ, &
mat_3c_overl_int_mao_for_virt, mao_coeff_occ, mao_coeff_virt, &
ri_metric, gd_B_occ_bse, gd_B_virt_bse, BIb_C_beta, BIb_C_gw_beta, &
gd_B_virtual_beta, homo_beta, mo_coeff_o_beta, mo_coeff_v_beta, &
Expand Down Expand Up @@ -249,6 +250,7 @@ SUBROUTINE mp2_ri_gpw_compute_in(BIb_C, BIb_C_gw, BIb_C_bse_ij, BIb_C_bse_ab, gd
TYPE(kpoint_type), POINTER :: kpoints
TYPE(dbcsr_p_type), DIMENSION(:, :, :), POINTER :: mat_3c_overl_int
LOGICAL, INTENT(IN) :: do_dbcsr_t
TYPE(dbcsr_t_type), ALLOCATABLE, DIMENSION(:, :) :: t_3c_overl_int
TYPE(dbcsr_t_type), INTENT(OUT) :: t_3c_M
TYPE(dbcsr_t_type), ALLOCATABLE, DIMENSION(:, :), &
INTENT(OUT) :: t_3c_O
Expand Down Expand Up @@ -298,7 +300,6 @@ SUBROUTINE mp2_ri_gpw_compute_in(BIb_C, BIb_C_gw, BIb_C_bse_ij, BIb_C_bse_ab, gd
TYPE(dbcsr_p_type), DIMENSION(:), POINTER :: mat_munu_local_L
TYPE(dbcsr_t_pgrid_type) :: pgrid_t3c_M, pgrid_t3c_overl
TYPE(dbcsr_t_type) :: t_3c_overl_int_template
TYPE(dbcsr_t_type), ALLOCATABLE, DIMENSION(:, :) :: t_3c_overl_int
TYPE(dbcsr_type) :: matrix_bse_ab, matrix_bse_anu, matrix_bse_ij, matrix_bse_inu, &
matrix_ia_jb, matrix_ia_jb_beta, matrix_ia_jnu, matrix_ia_jnu_beta, matrix_in_jm, &
matrix_in_jm_beta, matrix_in_jnu, matrix_in_jnu_beta
Expand Down Expand Up @@ -872,9 +873,8 @@ SUBROUTINE mp2_ri_gpw_compute_in(BIb_C, BIb_C_gw, BIb_C_bse_ij, BIb_C_bse_ab, gd
DO i = 1, SIZE(t_3c_overl_int, 1)
DO j = 1, SIZE(t_3c_overl_int, 2)
CALL dbcsr_t_copy(t_3c_overl_int(i, j), t_3c_O(i, j), order=[1, 3, 2], move_data=.TRUE.)
CALL dbcsr_t_copy(t_3c_overl_int(i, j), t_3c_O(i, j), order=[1, 3, 2], move_data=.FALSE.)
CALL dbcsr_t_filter(t_3c_O(i, j), qs_env%mp2_env%mp2_gpw%eps_filter)
CALL dbcsr_t_destroy(t_3c_overl_int(i, j))
ENDDO
ENDDO
CALL timestop(handle4)
Expand Down

0 comments on commit 2824b54

Please sign in to comment.