50 dbt_mp_environ_pgrid, &
51 dbt_default_distvec, &
52 dbt_distribution_type, &
53 dbt_distribution_new, &
54 dbt_distribution_destroy, &
56 dbt_copy_matrix_to_tensor, &
99#include "../base/base_uses.f90"
105 CHARACTER(len=*),
PARAMETER,
PRIVATE :: moduleN =
"rt_bse"
119 TYPE series_real_type
120 REAL(kind=
dp),
DIMENSION(:),
POINTER :: series => null()
121 END TYPE series_real_type
122 TYPE series_complex_type
123 COMPLEX(kind=dp),
DIMENSION(:),
POINTER :: series => null()
124 END TYPE series_complex_type
182 INTEGER :: n_spin = 1, &
185 INTEGER,
DIMENSION(2) :: n_occ = -1
186 REAL(kind=
dp) :: spin_degeneracy = 2
187 REAL(kind=
dp),
DIMENSION(3) :: field = 0.0_dp
188 TYPE(
cp_fm_type),
DIMENSION(:),
POINTER :: moments => null(), &
189 moments_field => null()
190 INTEGER :: sim_step = 0, &
193 sim_start_orig = 0, &
195 REAL(kind=
dp) :: sim_time = 0.0_dp, &
197 etrs_threshold = 1.0e-7_dp, &
198 exp_accuracy = 1.0e-10_dp, &
199 ft_damping = 0.0_dp, &
202 INTEGER,
DIMENSION(:, :),
POINTER :: pol_elements => null()
209 field_section => null(), &
210 rho_section => null(), &
211 ft_section => null(), &
212 pol_section => null(), &
213 moments_section => null()
214 LOGICAL :: restart_extracted = .false.
217 TYPE(
cp_cfm_type),
DIMENSION(:),
POINTER :: ham_effective => null()
218 TYPE(
cp_cfm_type),
DIMENSION(:),
POINTER :: ham_reference => null()
219 TYPE(
cp_cfm_type),
DIMENSION(:),
POINTER :: ham_workspace => null()
221 TYPE(
cp_fm_type),
DIMENSION(:),
POINTER :: sigma_coh => null(), &
222 hartree_curr => null()
226 rho_new_last => null(), &
236 TYPE(
cp_cfm_type),
DIMENSION(:),
POINTER :: rho_workspace => null()
238 TYPE(
cp_fm_type),
DIMENSION(:),
POINTER :: real_workspace => null()
240 REAL(kind=
dp),
DIMENSION(:),
POINTER :: real_eigvals => null()
241 COMPLEX(kind=dp),
DIMENSION(:),
POINTER :: exp_eigvals => null()
243 TYPE(series_complex_type),
DIMENSION(3) :: moments_trace = series_complex_type()
244 TYPE(series_real_type) :: time_trace = series_real_type()
245 TYPE(series_real_type),
DIMENSION(3) :: field_trace = series_real_type()
249#if defined(FTN_NO_DEFAULT_INIT)
250 TYPE(dbt_type) :: screened_dbt, &
253 t_3c_work_ri_ao__ao, &
256 TYPE(dbt_type) :: screened_dbt = dbt_type(), &
257 greens_dbt = dbt_type(), &
258 t_3c_w = dbt_type(), &
259 t_3c_work_ri_ao__ao = dbt_type(), &
260 t_3c_work2_ri_ao__ao = dbt_type()
263 INTEGER :: etrs_max_iter = 10
264 INTEGER :: ham_reference_type = 2
265 INTEGER :: mat_exp_method = 4
266 INTEGER :: unit_nr = -1
267 REAL(kind=
dp),
DIMENSION(:, :, :),
POINTER :: int_3c_array => null()
269 REAL(kind=
dp) :: pade_e_min = 0.0_dp, &
270 pade_e_max = 100.0_dp, &
271 pade_e_step = 0.05_dp, &
272 pade_fit_e_min = 0.0_dp, &
273 pade_fit_e_max = -1.0_dp
274 INTEGER :: pade_npoints = 0
275 LOGICAL :: pade_requested = .false.
276 COMPLEX(kind=dp),
DIMENSION(:),
POINTER :: pade_x_eval => null()
297 INTEGER :: i, j, k, single_pol_index
299 INTEGER,
DIMENSION(:),
POINTER :: pol_tmp
300 LOGICAL :: pol_elements_explicit, &
301 pade_fit_lim_explicit, &
303 REAL(kind=
dp),
DIMENSION(3) :: pol_vector
314 dft_control=rtbse_env%dft_control, &
317 IF (.NOT.
ASSOCIATED(bs_env))
THEN
318 cpabort(
"Cannot run RT-BSE without running GW calculation (PROPERTIES) before")
321 rtbse_env%n_spin = bs_env%n_spin
323 rtbse_env%n_ao = bs_env%n_ao
325 rtbse_env%n_RI = bs_env%n_RI
327 rtbse_env%n_occ(:) = bs_env%n_occ(:)
329 rtbse_env%spin_degeneracy = bs_env%spin_degeneracy
331 rtbse_env%field(:) = 0.0_dp
333 rtbse_env%sim_step = 0
334 rtbse_env%sim_time = 0
340 rtbse_env%etrs_threshold = rtbse_env%dft_control%rtp_control%eps_ener
341 rtbse_env%exp_accuracy = rtbse_env%dft_control%rtp_control%eps_exp
344 i_val=rtbse_env%ham_reference_type)
346 i_val=rtbse_env%etrs_max_iter)
348 i_val=rtbse_env%mat_exp_method)
350 rtbse_env%unit_nr = bs_env%unit_nr
354 rtbse_env%sim_start_orig = rtbse_env%sim_start
358 r_val=rtbse_env%ft_damping)
360 r_val=rtbse_env%ft_start)
367 n_rep_val=k, explicit=pol_elements_explicit)
368 IF (pol_elements_explicit)
THEN
370 ALLOCATE (rtbse_env%pol_elements(k, 2), source=1)
373 i_vals=pol_tmp, i_rep_val=i)
374 IF (
SIZE(pol_tmp) < 2) cpabort(
"Less than two elements provided for polarizability")
375 rtbse_env%pol_elements(i, :) = pol_tmp(:)
380 IF (rtbse_env%pol_elements(j, i) > 3 .OR. rtbse_env%pol_elements(j, i) < 1) &
381 cpabort(
"Polarisation tensor element not 1,2 or 3 in at least one index")
386 pol_vector_known = .false.
387 IF (rtbse_env%dft_control%rtp_control%apply_delta_pulse)
THEN
389 pol_vector(:) = rtbse_env%dft_control%rtp_control%delta_pulse_direction(:)
390 pol_vector_known = .true.
391 ELSE IF (
SIZE(rtbse_env%dft_control%efield_fields) > 0)
THEN
394 pol_vector(:) = rtbse_env%dft_control%efield_fields(1)%efield%polarisation(:)
395 pol_vector_known = .true.
398 IF (dot_product(pol_vector, pol_vector) == 0.0_dp) pol_vector_known = .false.
399 IF (pol_vector_known)
THEN
401 single_pol_index = -1
403 IF (pol_vector(i) /= 0.0_dp .AND. &
404 pol_vector(
modulo(i, 3) + 1) == 0.0_dp .AND. &
405 pol_vector(
modulo(i + 1, 3) + 1) == 0.0_dp)
THEN
410 IF (single_pol_index > 0)
THEN
412 ALLOCATE (rtbse_env%pol_elements(3, 2), source=1)
414 rtbse_env%pol_elements(i, 1) = i
415 rtbse_env%pol_elements(i, 2) = single_pol_index
419 cpabort(
"RTBSE : Guess for polarizability elements failed - please specify")
423 cpabort(
"RTBSE : Guess for polarizability elements failed - please specify")
429 rtbse_env%restart_extracted = .false.
437 "CURRENT print section not yet implemented for RTBSE.")
439 "E_CONSTITUENTS print section not yet implemented for RTBSE.")
441 "PROGRAM_RUN_INFO print section not yet implemented for RTBSE.")
443 "PROJECTION_MO print section not yet implemented for RTBSE.")
445 "RESTART_HISTORY print section not yet implemented for RTBSE.")
447 rtbse_env%qs_env => qs_env
448 rtbse_env%bs_env => bs_env
451 explicit=rtbse_env%pade_requested)
453 r_val=rtbse_env%pade_e_min)
455 r_val=rtbse_env%pade_e_max)
457 r_val=rtbse_env%pade_e_step)
459 r_val=rtbse_env%pade_fit_e_min, explicit=pade_fit_lim_explicit)
461 IF (.NOT. pade_fit_lim_explicit)
THEN
462 rtbse_env%pade_fit_e_min = rtbse_env%pade_e_min
465 r_val=rtbse_env%pade_fit_e_max, explicit=pade_fit_lim_explicit)
466 IF (.NOT. pade_fit_lim_explicit)
THEN
467 rtbse_env%pade_fit_e_max = rtbse_env%pade_e_max
469 rtbse_env%pade_npoints = int((rtbse_env%pade_e_max - rtbse_env%pade_e_min)/rtbse_env%pade_e_step)
471 IF (rtbse_env%pade_requested)
THEN
473 NULLIFY (rtbse_env%pade_x_eval)
474 ALLOCATE (rtbse_env%pade_x_eval(rtbse_env%pade_npoints))
475 DO i = 1, rtbse_env%pade_npoints
476 rtbse_env%pade_x_eval(i) = cmplx(rtbse_env%pade_e_step*real(i - 1, kind=
dp), 0.0, kind=
dp)
479 cpabort(é
"Pad refinement of FT requires linking GreenX - recompile CP2K with GreenX.")
484 NULLIFY (rtbse_env%moments)
485 ALLOCATE (rtbse_env%moments(3))
486 NULLIFY (rtbse_env%moments_field)
487 ALLOCATE (rtbse_env%moments_field(3))
491 CALL cp_fm_create(rtbse_env%moments(k), bs_env%fm_s_Gamma%matrix_struct)
492 CALL cp_fm_create(rtbse_env%moments_field(k), bs_env%fm_s_Gamma%matrix_struct)
496 NULLIFY (rtbse_env%rho_workspace)
497 ALLOCATE (rtbse_env%rho_workspace(4))
498 DO i = 1,
SIZE(rtbse_env%rho_workspace)
499 CALL cp_cfm_create(rtbse_env%rho_workspace(i), bs_env%fm_ks_Gamma(1)%matrix_struct)
503 NULLIFY (rtbse_env%real_workspace)
504 SELECT CASE (rtbse_env%mat_exp_method)
506 ALLOCATE (rtbse_env%real_workspace(4))
508 ALLOCATE (rtbse_env%real_workspace(2))
510 cpabort(
"Only exact and BCH matrix propagation implemented in RT-BSE")
512 DO i = 1,
SIZE(rtbse_env%real_workspace)
513 CALL cp_fm_create(rtbse_env%real_workspace(i), bs_env%fm_ks_Gamma(1)%matrix_struct)
517 NULLIFY (rtbse_env%rho)
518 ALLOCATE (rtbse_env%rho(rtbse_env%n_spin))
519 DO i = 1, rtbse_env%n_spin
520 CALL cp_cfm_create(rtbse_env%rho(i), matrix_struct=bs_env%fm_s_Gamma%matrix_struct)
524 CALL cp_fm_create(rtbse_env%S_fm, bs_env%fm_s_Gamma%matrix_struct)
525 CALL cp_fm_create(rtbse_env%S_inv_fm, bs_env%fm_s_Gamma%matrix_struct)
526 CALL cp_cfm_create(rtbse_env%S_cfm, bs_env%fm_s_Gamma%matrix_struct)
530 NULLIFY (rtbse_env%ham_workspace)
531 ALLOCATE (rtbse_env%ham_workspace(rtbse_env%n_spin))
532 DO i = 1, rtbse_env%n_spin
533 CALL cp_cfm_create(rtbse_env%ham_workspace(i), bs_env%fm_ks_Gamma(1)%matrix_struct)
537 NULLIFY (rtbse_env%ham_reference)
538 ALLOCATE (rtbse_env%ham_reference(rtbse_env%n_spin))
539 DO i = 1, rtbse_env%n_spin
540 CALL cp_cfm_create(rtbse_env%ham_reference(i), bs_env%fm_ks_Gamma(i)%matrix_struct)
544 NULLIFY (rtbse_env%ham_effective)
545 NULLIFY (rtbse_env%rho_new)
546 NULLIFY (rtbse_env%rho_new_last)
547 NULLIFY (rtbse_env%rho_M)
548 NULLIFY (rtbse_env%rho_orig)
549 ALLOCATE (rtbse_env%ham_effective(rtbse_env%n_spin))
550 ALLOCATE (rtbse_env%rho_new(rtbse_env%n_spin))
551 ALLOCATE (rtbse_env%rho_new_last(rtbse_env%n_spin))
552 ALLOCATE (rtbse_env%rho_M(rtbse_env%n_spin))
553 ALLOCATE (rtbse_env%rho_orig(rtbse_env%n_spin))
554 DO i = 1, rtbse_env%n_spin
555 CALL cp_cfm_create(rtbse_env%ham_effective(i), bs_env%fm_ks_Gamma(1)%matrix_struct)
557 CALL cp_cfm_create(rtbse_env%rho_new(i), bs_env%fm_ks_Gamma(1)%matrix_struct)
559 CALL cp_cfm_create(rtbse_env%rho_new_last(i), bs_env%fm_ks_Gamma(1)%matrix_struct)
561 CALL cp_cfm_create(rtbse_env%rho_M(i), bs_env%fm_ks_Gamma(1)%matrix_struct)
563 CALL cp_cfm_create(rtbse_env%rho_orig(i), bs_env%fm_ks_Gamma(1)%matrix_struct)
567 NULLIFY (rtbse_env%real_eigvals)
568 ALLOCATE (rtbse_env%real_eigvals(rtbse_env%n_ao))
569 rtbse_env%real_eigvals(:) = 0.0_dp
570 NULLIFY (rtbse_env%exp_eigvals)
571 ALLOCATE (rtbse_env%exp_eigvals(rtbse_env%n_ao))
572 rtbse_env%exp_eigvals(:) = cmplx(0.0, 0.0, kind=
dp)
576 NULLIFY (rtbse_env%moments_trace(i)%series)
577 ALLOCATE (rtbse_env%moments_trace(i)%series(rtbse_env%sim_nsteps + 2), source=
z_zero)
578 NULLIFY (rtbse_env%field_trace(i)%series)
579 ALLOCATE (rtbse_env%field_trace(i)%series(rtbse_env%sim_nsteps + 2), source=0.0_dp)
581 NULLIFY (rtbse_env%time_trace%series)
582 ALLOCATE (rtbse_env%time_trace%series(rtbse_env%sim_nsteps + 2), source=0.0_dp)
585 NULLIFY (rtbse_env%hartree_curr)
586 NULLIFY (rtbse_env%sigma_SEX)
587 NULLIFY (rtbse_env%sigma_COH)
588 ALLOCATE (rtbse_env%hartree_curr(rtbse_env%n_spin))
589 ALLOCATE (rtbse_env%sigma_SEX(rtbse_env%n_spin))
590 ALLOCATE (rtbse_env%sigma_COH(rtbse_env%n_spin))
591 DO i = 1, rtbse_env%n_spin
592 CALL cp_fm_create(rtbse_env%sigma_COH(i), bs_env%fm_ks_Gamma(1)%matrix_struct)
593 CALL cp_cfm_create(rtbse_env%sigma_SEX(i), bs_env%fm_ks_Gamma(1)%matrix_struct)
594 CALL cp_fm_create(rtbse_env%hartree_curr(i), bs_env%fm_ks_Gamma(1)%matrix_struct)
601 CALL create_sigma_workspace(rtbse_env, qs_env)
604 CALL create_hartree_ri_workspace(rtbse_env, qs_env)
614 SUBROUTINE cp_cfm_release_pa1(matrices)
615 TYPE(
cp_cfm_type),
DIMENSION(:),
POINTER :: matrices
618 DO i = 1,
SIZE(matrices)
621 DEALLOCATE (matrices)
623 END SUBROUTINE cp_cfm_release_pa1
635 CALL cp_cfm_release_pa1(rtbse_env%ham_effective)
636 CALL cp_cfm_release_pa1(rtbse_env%ham_workspace)
638 CALL cp_cfm_release_pa1(rtbse_env%sigma_SEX)
640 CALL cp_cfm_release_pa1(rtbse_env%ham_reference)
641 CALL cp_cfm_release_pa1(rtbse_env%rho)
642 CALL cp_cfm_release_pa1(rtbse_env%rho_workspace)
643 CALL cp_cfm_release_pa1(rtbse_env%rho_new)
644 CALL cp_cfm_release_pa1(rtbse_env%rho_new_last)
645 CALL cp_cfm_release_pa1(rtbse_env%rho_M)
646 CALL cp_cfm_release_pa1(rtbse_env%rho_orig)
659 CALL release_sigma_workspace(rtbse_env)
661 CALL release_hartree_ri_workspace(rtbse_env)
663 DEALLOCATE (rtbse_env%real_eigvals)
664 DEALLOCATE (rtbse_env%exp_eigvals)
666 DEALLOCATE (rtbse_env%moments_trace(i)%series)
667 DEALLOCATE (rtbse_env%field_trace(i)%series)
669 DEALLOCATE (rtbse_env%time_trace%series)
671 DEALLOCATE (rtbse_env%pol_elements)
673 IF (rtbse_env%pade_requested)
DEALLOCATE (rtbse_env%pade_x_eval)
679 DEALLOCATE (rtbse_env)
692 SUBROUTINE create_hartree_ri_workspace(rtbse_env, qs_env)
699 CALL dbcsr_create(rtbse_env%rho_dbcsr, name=
"Sparse density", template=bs_env%mat_ao_ao%matrix)
700 CALL dbcsr_create(rtbse_env%v_ao_dbcsr, name=
"Sparse Hartree", template=bs_env%mat_ao_ao%matrix)
702 CALL create_hartree_ri_3c(rtbse_env%rho_dbcsr, rtbse_env%int_3c_array, rtbse_env%n_ao, rtbse_env%n_RI, &
703 bs_env%basis_set_AO, bs_env%basis_set_RI, bs_env%i_RI_start_from_atom, &
704 bs_env%ri_metric, qs_env, rtbse_env%unit_nr)
705 END SUBROUTINE create_hartree_ri_workspace
721 i_RI_start_from_atom, ri_metric, qs_env, unit_nr)
723 REAL(kind=
dp),
DIMENSION(:, :, :),
POINTER :: int_3c
724 INTEGER :: n_ao, n_ri
727 INTEGER,
DIMENSION(:) :: i_ri_start_from_atom
731 REAL(kind=
dp) :: size_mb
732 INTEGER :: nblkrows_local, &
744 INTEGER,
DIMENSION(:),
POINTER :: local_blk_rows, &
749 size_mb = real(n_ao, kind=
dp)*real(n_ao, kind=
dp)*real(n_ri, kind=
dp)* &
750 REAL(storage_size(size_mb), kind=
dp)/8.0_dp/1024.0_dp/1024.0_dp
751 IF (unit_nr > 0)
WRITE (unit_nr,
'(A44,E32.2E3,A4)') &
752 " RTBSE| Approximate size of the 3c integrals", size_mb,
" MiB"
755 CALL dbcsr_get_info(rho_dbcsr, nblkrows_local=nblkrows_local, nblkcols_local=nblkcols_local)
757 CALL dbcsr_get_info(rho_dbcsr, local_rows=local_blk_rows, local_cols=local_blk_cols)
759 CALL dbcsr_get_info(rho_dbcsr, row_blk_size=row_blk_size, col_blk_size=col_blk_size)
763 DO i_blk_local = 1, nblkrows_local
764 nrows_local = nrows_local + row_blk_size(local_blk_rows(i_blk_local))
767 DO j_blk_local = 1, nblkcols_local
768 ncols_local = ncols_local + col_blk_size(local_blk_cols(j_blk_local))
772 ALLOCATE (int_3c(nrows_local, ncols_local, n_ri))
776 DO i_blk_local = 1, nblkrows_local
778 DO j_blk_local = 1, nblkcols_local
779 start_row_index = row_local_offset
780 end_row_index = start_row_index + row_blk_size(local_blk_rows(i_blk_local)) - 1
781 start_col_index = col_local_offset
782 end_col_index = start_col_index + col_blk_size(local_blk_cols(j_blk_local)) - 1
784 start_col_index:end_col_index, &
786 qs_env, potential_parameter=ri_metric, &
787 basis_j=basis_set_ao, basis_k=basis_set_ao, &
788 basis_i=basis_set_ri, &
789 atom_j=local_blk_rows(i_blk_local), &
790 atom_k=local_blk_cols(j_blk_local), &
791 i_bf_start_from_atom=i_ri_start_from_atom)
792 col_local_offset = col_local_offset + col_blk_size(local_blk_cols(j_blk_local))
794 row_local_offset = row_local_offset + row_blk_size(local_blk_rows(i_blk_local))
803 SUBROUTINE release_hartree_ri_workspace(rtbse_env)
806 DEALLOCATE (rtbse_env%int_3c_array)
814 END SUBROUTINE release_hartree_ri_workspace
822 SUBROUTINE create_sigma_workspace(rtbse_env, qs_env)
827 rtbse_env%t_3c_w, rtbse_env%t_3c_work_RI_AO__AO, &
828 rtbse_env%t_3c_work2_RI_AO__AO, rtbse_env%greens_dbt)
829 END SUBROUTINE create_sigma_workspace
840 work_dbt_3c_1, work_dbt_3c_2, work_dbt_2c)
843 TYPE(dbt_type) :: screened_dbt, &
853 CALL dbt_create(bs_env%t_RI__AO_AO, int_3c_dbt)
857 CALL dbt_create(bs_env%t_RI_AO__AO, work_dbt_3c_1)
859 CALL dbt_create(bs_env%t_RI_AO__AO, work_dbt_3c_2)
862 CALL dbcsr_create(screened_dbcsr, name=
"W", template=bs_env%mat_RI_RI%matrix)
863 CALL dbt_create(screened_dbcsr, screened_dbt)
865 CALL dbt_create(bs_env%mat_ao_ao%matrix, work_dbt_2c)
873 SUBROUTINE release_sigma_workspace(rtbse_env)
876 CALL dbt_destroy(rtbse_env%t_3c_w)
877 CALL dbt_destroy(rtbse_env%t_3c_work_RI_AO__AO)
878 CALL dbt_destroy(rtbse_env%t_3c_work2_RI_AO__AO)
879 CALL dbt_destroy(rtbse_env%screened_dbt)
880 CALL dbt_destroy(rtbse_env%greens_dbt)
891 alpha, matrix_r, matrix_c, beta, res)
893 CHARACTER(len=1) :: trans_r, trans_c
894 INTEGER :: na, nb, nc
897 REAL(kind=
dp) :: alpha, beta
900 TYPE(
cp_fm_type) :: work_re, work_im, res_re, res_im
901 REAL(kind=
dp) :: i_unit
902 CHARACTER(len=1) :: trans_cr
909 SELECT CASE (trans_c)
922 alpha, matrix_r, work_re, beta, res_re)
924 i_unit*alpha, matrix_r, work_im, beta, res_im)
940 alpha, matrix_c, matrix_r, beta, res)
942 CHARACTER(len=1) :: trans_c, trans_r
943 INTEGER :: na, nb, nc
946 REAL(kind=
dp) :: alpha, beta
949 TYPE(
cp_fm_type) :: work_re, work_im, res_re, res_im
950 REAL(kind=
dp) :: i_unit
951 CHARACTER(len=1) :: trans_cr
958 SELECT CASE (trans_c)
971 alpha, work_re, matrix_r, beta, res_re)
973 i_unit*alpha, work_im, matrix_r, beta, res_im)
static GRID_HOST_DEVICE int modulo(int a, int m)
Equivalent of Fortran's MODULO, which always return a positive number. https://gcc....
Basic linear algebra operations for complex full matrices.
subroutine, public cp_cfm_column_scale(matrix_a, scaling)
Scales columns of the full matrix by corresponding factors.
Represents a complex full matrix distributed on many processors.
subroutine, public cp_cfm_create(matrix, matrix_struct, name)
Creates a new full matrix with the given structure.
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_set_all(matrix, alpha, beta)
Set all elements of the full matrix to alpha. Besides, set all diagonal matrix elements to beta (if g...
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_scale(matrix, alpha_scalar)
...
subroutine, public dbcsr_copy(matrix_b, matrix_a, name, keep_sparsity, keep_imaginary)
...
subroutine, public dbcsr_get_info(matrix, nblkrows_total, nblkcols_total, nfullrows_total, nfullcols_total, nblkrows_local, nblkcols_local, nfullrows_local, nfullcols_local, my_prow, my_pcol, local_rows, local_cols, proc_row_dist, proc_col_dist, row_blk_size, col_blk_size, row_blk_offset, col_blk_offset, distribution, name, matrix_type, group)
...
subroutine, public dbcsr_set(matrix, alpha)
...
subroutine, public dbcsr_release(matrix)
...
subroutine, public dbcsr_print(matrix, variable_name, unit_nr)
Prints given matrix in matlab format (only present blocks).
DBCSR operations in CP2K.
subroutine, public copy_dbcsr_to_fm(matrix, fm)
Copy a DBCSR matrix to a BLACS matrix.
subroutine, public copy_fm_to_dbcsr(fm, matrix, keep_sparsity)
Copy a BLACS matrix to a dbcsr matrix.
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_transpose(matrix, matrixt)
transposes a matrix matrixt = matrix ^ T
subroutine, public cp_fm_scale_and_add(alpha, matrix_a, beta, matrix_b)
calc A <- alpha*A + beta*B optimized for alpha == 1.0 (just add beta*B) and beta == 0....
subroutine, public cp_fm_invert(matrix_a, matrix_inverse, det_a, eps_svd, eigval)
Inverts a cp_fm_type matrix, optionally returning the determinant of the input matrix.
represent a full matrix distributed on many processors
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, use_sp)
creates a new full matrix with the given structure
subroutine, public cp_fm_write_formatted(fm, unit, header, value_format)
Write out a full matrix in plain text.
This is the start of a dbt_api, all publically needed functions are exported here....
Interface for the force calculations.
Utility method to build 3-center integrals for small cell GW.
subroutine, public build_3c_integral_block(int_3c, qs_env, potential_parameter, basis_j, basis_k, basis_i, cell_j, cell_k, cell_i, atom_j, atom_k, atom_i, j_bf_start_from_atom, k_bf_start_from_atom, i_bf_start_from_atom)
...
Routines from paper [Graml2024].
subroutine, public compute_3c_integrals(qs_env, bs_env, t_3c, atoms_ao_1, atoms_ao_2, atoms_ri)
...
Defines the basic variable types.
integer, parameter, public dp
2- and 3-center electron repulsion integral routines based on libint2 Currently available operators: ...
Interface to the Libint-Library or a c++ wrapper.
subroutine, public cp_libint_static_init()
Definition of mathematical constants and functions.
complex(kind=dp), parameter, public z_zero
Routines for calculating a complex matrix exponential.
subroutine, public get_nsquare_norder(norm, nsquare, norder, eps_exp, method, do_emd)
optimization function for pade/taylor order and number of squaring steps
Calculates the moment integrals <a|r^m|b>
subroutine, public get_reference_point(rpoint, drpoint, qs_env, fist_env, reference, ref_point, ifirst, ilast)
...
basic linear algebra operations for full matrixes
Definition of physical constants:
real(kind=dp), parameter, public angstrom
subroutine, public create_and_init_bs_env(qs_env, bs_env, post_scf_bandstructure_section)
...
subroutine, public get_qs_env(qs_env, atomic_kind_set, qs_kind_set, cell, super_cell, cell_ref, use_ref_cell, kpoints, dft_control, mos, sab_orb, sab_all, qmmm, qmmm_periodic, sac_ae, sac_ppl, sac_lri, sap_ppnl, sab_vdw, sab_scp, sap_oce, sab_lrc, sab_se, sab_xtbe, sab_tbe, sab_core, sab_xb, sab_xtb_pp, sab_xtb_nonbond, sab_almo, sab_kp, sab_kp_nosym, particle_set, energy, force, matrix_h, matrix_h_im, matrix_ks, matrix_ks_im, matrix_vxc, run_rtp, rtp, matrix_h_kp, matrix_h_im_kp, matrix_ks_kp, matrix_ks_im_kp, matrix_vxc_kp, kinetic_kp, matrix_s_kp, matrix_w_kp, matrix_s_ri_aux_kp, matrix_s, matrix_s_ri_aux, matrix_w, matrix_p_mp2, matrix_p_mp2_admm, rho, rho_xc, pw_env, ewald_env, ewald_pw, active_space, mpools, input, para_env, blacs_env, scf_control, rel_control, kinetic, qs_charges, vppl, rho_core, rho_nlcc, rho_nlcc_g, ks_env, ks_qmmm_env, wf_history, scf_env, local_particles, local_molecules, distribution_2d, dbcsr_dist, molecule_kind_set, molecule_set, subsys, cp_subsys, oce, local_rho_set, rho_atom_set, task_list, task_list_soft, rho0_atom_set, rho0_mpole, rhoz_set, ecoul_1c, rho0_s_rs, rho0_s_gs, do_kpoints, has_unit_metric, requires_mo_derivs, mo_derivs, mo_loc_history, nkind, natom, nelectron_total, nelectron_spin, efield, neighbor_list_id, linres_control, xas_env, virial, cp_ddapc_env, cp_ddapc_ewald, outer_scf_history, outer_scf_ihistory, x_data, et_coupling, dftb_potential, results, se_taper, se_store_int_env, se_nddo_mpole, se_nonbond_env, admm_env, lri_env, lri_density, exstate_env, ec_env, harris_env, dispersion_env, gcp_env, vee, rho_external, external_vxc, mask, mp2_env, bs_env, kg_env, wanniercentres, atprop, ls_scf_env, do_transport, transport_env, v_hartree_rspace, s_mstruct_changed, rho_changed, potential_changed, forces_up_to_date, mscfg_env, almo_scf_env, gradient_history, variable_history, embed_pot, spin_embed_pot, polar_env, mos_last_converged, eeq, rhs)
Get the QUICKSTEP environment.
Definition and initialisation of the mo data type.
Calculates the moment integrals <a|r^m|b> and <a|r x d/dr|b>
subroutine, public build_local_moment_matrix(qs_env, moments, nmoments, ref_point, ref_points, basis_type)
...
Utility methods to build 3-center integral tensors of various types.
subroutine, public neighbor_list_3c_destroy(ijk_list)
Destroy 3c neighborlist.
Data storage and other types for propagation via RT-BSE method.
subroutine, public release_rtbse_env(rtbse_env)
Releases the environment allocated structures.
subroutine, public create_hartree_ri_3c(rho_dbcsr, int_3c, n_ao, n_ri, basis_set_ao, basis_set_ri, i_ri_start_from_atom, ri_metric, qs_env, unit_nr)
Separated method for allocating the 3c integrals for RI Hartree.
subroutine, public multiply_cfm_fm(trans_c, trans_r, na, nb, nc, alpha, matrix_c, matrix_r, beta, res)
Multiplies complex matrix by a real matrix from the right.
subroutine, public create_sigma_workspace_qs_only(qs_env, screened_dbt, screened_dbcsr, int_3c_dbt, work_dbt_3c_1, work_dbt_3c_2, work_dbt_2c)
Allocates the workspaces for self-energy determination routine.
subroutine, public create_rtbse_env(rtbse_env, qs_env, force_env)
Allocates structures and prepares rtbse_env for run.
subroutine, public multiply_fm_cfm(trans_r, trans_c, na, nb, nc, alpha, matrix_r, matrix_c, beta, res)
Multiplies real matrix by a complex matrix from the right.
Routines for propagating the orbitals.
subroutine, public s_matrices_create(s_mat, rtp)
calculates the needed overlap-like matrices depending on the way the exponential is calculated,...
Types and set_get for real time propagation depending on runtype and diagonalization method different...
subroutine, public get_rtp(rtp, exp_h_old, exp_h_new, h_last_iter, rho_old, rho_next, rho_new, mos, mos_new, mos_old, mos_next, s_inv, s_half, s_minus_half, b_mat, c_mat, propagator_matrix, mixing, mixing_factor, s_der, dt, nsteps, sinvh, sinvh_imag, sinvb, admm_mos)
...
subroutine, public warn_section_unused(section, subsection_name, error_message)
Warn about unused sections of the print section - only implemented for some of the methods.
Routines for that prepare rtp and EMD.
subroutine, public rt_initialize_rho_from_mos(rtp, mos, mos_old)
Computes the density matrix from the mos Update: Initialized the density matrix from complex mos (for...
Just to build arrays of pointers to matrices.
Represent a complex full matrix.
just to build arrays of pointers to matrices
wrapper to abstract the force evaluation of the various methods