37 USE dbcsr_api,
ONLY: &
38 dbcsr_copy, dbcsr_create, dbcsr_distribution_get, dbcsr_distribution_new, &
39 dbcsr_distribution_release, dbcsr_distribution_type, dbcsr_get_info, dbcsr_multiply, &
40 dbcsr_p_type, dbcsr_print, dbcsr_release, dbcsr_reserve_all_blocks, dbcsr_scale, &
41 dbcsr_type, dbcsr_type_no_symmetry
94#include "./base/base_uses.f90"
100 CHARACTER(len=*),
PARAMETER,
PRIVATE :: moduleN =
'qs_tddfpt2_soc'
102 LOGICAL,
PARAMETER,
PRIVATE :: debug_this_module = .false.
104 INTEGER,
PARAMETER,
PRIVATE :: nderivs = 3
105 INTEGER,
PARAMETER,
PRIVATE :: maxspins = 2
108 TYPE dbcsr_soc_package_type
109 TYPE(dbcsr_type),
POINTER :: dbcsr_sg => null()
110 TYPE(dbcsr_type),
POINTER :: dbcsr_tp => null()
111 TYPE(dbcsr_type),
POINTER :: dbcsr_sc => null()
112 TYPE(dbcsr_type),
POINTER :: dbcsr_sf => null()
113 TYPE(dbcsr_type),
POINTER :: dbcsr_prod => null()
114 TYPE(dbcsr_type),
POINTER :: dbcsr_ovlp => null()
115 TYPE(dbcsr_type),
POINTER :: dbcsr_tmp => null()
116 TYPE(dbcsr_type),
POINTER :: dbcsr_work => null()
117 END TYPE dbcsr_soc_package_type
139 SUBROUTINE tddfpt_soc(qs_env, evals_a, evals_b, evects_a, evects_b, gs_mos)
142 REAL(kind=
dp),
DIMENSION(:),
INTENT(IN) :: evals_a, evals_b
143 TYPE(
cp_fm_type),
DIMENSION(:, :),
INTENT(IN) :: evects_a, evects_b
147 CHARACTER(LEN=*),
PARAMETER :: routinen =
'tddfpt_soc'
149 INTEGER :: handle, istate, log_unit
154 CALL timeset(routinen, handle)
157 IF (logger%para_env%is_source())
THEN
163 IF (log_unit > 0)
THEN
164 WRITE (log_unit,
"(1X,A)")
"", &
165 "-------------------------------------------------------------------------------", &
166 "- START SOC CALCULATIONS -", &
167 "-------------------------------------------------------------------------------"
170 NULLIFY (dft_control)
171 CALL get_qs_env(qs_env, dft_control=dft_control)
172 do_os = dft_control%uks .OR. dft_control%roks
173 IF (do_os) cpabort(
"SOC only implemented for closed shell.")
175 IF (log_unit > 0)
THEN
176 WRITE (log_unit,
'(A)')
"Starting from TDDFPT Excited States:"
177 WRITE (log_unit,
'(A)')
" STATE SINGLET/eV TRIPLET/eV"
178 DO istate = 1,
SIZE(evals_a)
179 WRITE (log_unit,
'(6X,I3,11X,F10.5,6X,F10.5)') istate, evals_a(istate)*
evolt, evals_b(istate)*
evolt
183 IF (log_unit > 0)
WRITE (log_unit,
'(A)')
"Starting restricted closed shell:"
184 CALL tddfpt_soc_rcs(qs_env, evals_a, evals_b, evects_a, evects_b, log_unit, gs_mos)
186 IF (log_unit > 0)
THEN
187 WRITE (log_unit,
'(A,/,A)')
"SOC Calculation terminated", &
188 "Returning to TDDFPT for Force calculation and deallocations"
191 CALL timestop(handle)
208 SUBROUTINE tddfpt_soc_rcs(qs_env, evals_sing, evals_trip, evects_sing, evects_trip, log_unit, gs_mos)
211 REAL(kind=
dp),
DIMENSION(:),
INTENT(IN),
TARGET :: evals_sing, evals_trip
212 TYPE(
cp_fm_type),
DIMENSION(:, :),
INTENT(IN) :: evects_sing, evects_trip
217 CHARACTER(LEN=*),
PARAMETER :: routinen =
'tddfpt_soc_rcs'
219 CHARACTER(len=3) :: mult
220 INTEGER :: dipole_form, group, handle, iex, ii, &
221 isg, istate, itp, jj, nactive, nao, &
222 nex, npcols, nprows, nsg, ntot, ntp
223 INTEGER,
ALLOCATABLE,
DIMENSION(:) :: evects_sort
224 INTEGER,
DIMENSION(:),
POINTER :: col_blk_size, col_dist, row_blk_size, &
225 row_dist, row_dist_new
226 INTEGER,
DIMENSION(:, :),
POINTER :: pgrid
227 LOGICAL :: print_ev, print_some, print_splitting, &
229 REAL(
dp) :: eps_filter, soc_gst, sqrt2, unit_scale
230 REAL(
dp),
ALLOCATABLE,
DIMENSION(:) ::
diag, tmp_evals
231 REAL(
dp),
ALLOCATABLE,
DIMENSION(:, :) :: img_tmp, real_tmp
232 REAL(kind=
dp),
ALLOCATABLE,
DIMENSION(:, :) :: gstp_block, mo_soc_x, mo_soc_y, mo_soc_z
236 vec_struct, work_struct
237 TYPE(
cp_fm_type) :: gstp_fm, img_fm, prod_fm, real_fm, &
238 tmp_fm, vec_soc_x, vec_soc_y, &
240 TYPE(
cp_fm_type),
POINTER :: gs_coeffs, tp_coeffs
242 TYPE(dbcsr_distribution_type),
POINTER :: coeffs_dist, dbcsr_dist, prod_dist
243 TYPE(dbcsr_p_type),
DIMENSION(:),
POINTER :: matrix_s
244 TYPE(dbcsr_soc_package_type) :: dbcsr_soc_package
245 TYPE(dbcsr_type),
POINTER :: dbcsr_dummy, dbcsr_ovlp, dbcsr_prod, &
246 dbcsr_sg, dbcsr_tmp, dbcsr_tp, &
247 dbcsr_work, orb_soc_x, orb_soc_y, &
256 CALL timeset(routinen, handle)
258 NULLIFY (logger, pgrid, row_dist, row_dist_new)
259 NULLIFY (col_dist, col_blk_size, row_blk_size, matrix_s)
260 NULLIFY (gstp_struct, tddfpt_print_section, soc_print_section, soc_section)
269 nsg =
SIZE(evals_sing)
270 ntp =
SIZE(evals_trip)
272 ntot = 1 + nsg + 3*ntp
275 CALL inititialize_soc(qs_env, soc_atom_env, soc_env, &
276 evects_sing, evects_trip, dipole_form, gs_mos)
279 CALL get_qs_env(qs_env, mos=mos, para_env=para_env, blacs_env=blacs_env)
280 CALL get_mo_set(mos(1), nao=nao, homo=nactive)
287 NULLIFY (tp_coeffs, orb_soc_x, orb_soc_y, orb_soc_z)
288 tp_coeffs => soc_env%b_coeff
289 soc_env%evals_a => evals_sing
290 soc_env%evals_b => evals_trip
291 orb_soc_x => soc_env%orb_soc(1)%matrix
292 orb_soc_y => soc_env%orb_soc(2)%matrix
293 orb_soc_z => soc_env%orb_soc(3)%matrix
296 NULLIFY (full_struct)
297 CALL cp_fm_struct_create(full_struct, context=blacs_env, para_env=para_env, nrow_global=ntot, ncol_global=ntot)
310 CALL cp_fm_set_element(real_fm, 1 + itp + ntp + nsg, 1 + itp + ntp + nsg, evals_trip(itp))
311 CALL cp_fm_set_element(real_fm, 1 + itp + 2*ntp + nsg, 1 + itp + 2*ntp + nsg, evals_trip(itp))
315 CALL get_qs_env(qs_env, dbcsr_dist=dbcsr_dist)
316 CALL dbcsr_distribution_get(dbcsr_dist, group=group, row_dist=row_dist, pgrid=pgrid, &
317 npcols=npcols, nprows=nprows)
318 ALLOCATE (col_dist(nex), row_dist_new(nex))
320 col_dist(iex) =
modulo(npcols - iex, npcols)
321 row_dist_new(iex) =
modulo(nprows - iex, nprows)
323 ALLOCATE (coeffs_dist, prod_dist)
324 CALL dbcsr_distribution_new(coeffs_dist, group=group, pgrid=pgrid, row_dist=row_dist, &
326 CALL dbcsr_distribution_new(prod_dist, group=group, pgrid=pgrid, row_dist=row_dist_new, &
330 ALLOCATE (col_blk_size(nex))
331 col_blk_size = nactive
334 CALL dbcsr_get_info(matrix_s(1)%matrix, row_blk_size=row_blk_size)
337 ALLOCATE (dbcsr_sg, dbcsr_tp, dbcsr_work, dbcsr_ovlp, dbcsr_tmp, dbcsr_prod)
338 CALL dbcsr_create(matrix=dbcsr_sg, name=
"SINGLETS", matrix_type=dbcsr_type_no_symmetry, &
339 dist=coeffs_dist, row_blk_size=row_blk_size, col_blk_size=col_blk_size)
340 CALL dbcsr_create(matrix=dbcsr_tp, name=
"TRIPLETS", matrix_type=dbcsr_type_no_symmetry, &
341 dist=coeffs_dist, row_blk_size=row_blk_size, col_blk_size=col_blk_size)
342 CALL dbcsr_create(matrix=dbcsr_work, name=
"WORK", matrix_type=dbcsr_type_no_symmetry, &
343 dist=coeffs_dist, row_blk_size=row_blk_size, col_blk_size=col_blk_size)
344 CALL dbcsr_create(matrix=dbcsr_prod, name=
"PROD", matrix_type=dbcsr_type_no_symmetry, &
345 dist=prod_dist, row_blk_size=col_blk_size, col_blk_size=col_blk_size)
346 CALL dbcsr_create(matrix=dbcsr_ovlp, name=
"OVLP", matrix_type=dbcsr_type_no_symmetry, &
347 dist=prod_dist, row_blk_size=col_blk_size, col_blk_size=col_blk_size)
350 CALL dbcsr_create(matrix=dbcsr_tmp, name=
"TMP", matrix_type=dbcsr_type_no_symmetry, &
351 dist=prod_dist, row_blk_size=col_blk_size, col_blk_size=col_blk_size)
352 CALL dbcsr_reserve_all_blocks(dbcsr_tmp)
354 IF (debug_this_module)
THEN
355 ALLOCATE (dbcsr_dummy)
356 CALL dbcsr_create(matrix=dbcsr_dummy, name=
"DUMMY", matrix_type=dbcsr_type_no_symmetry, &
357 dist=prod_dist, row_blk_size=col_blk_size, col_blk_size=col_blk_size)
358 CALL dbcsr_reserve_all_blocks(dbcsr_dummy)
362 dbcsr_soc_package%dbcsr_sg => dbcsr_sg
363 dbcsr_soc_package%dbcsr_tp => dbcsr_tp
364 dbcsr_soc_package%dbcsr_work => dbcsr_work
365 dbcsr_soc_package%dbcsr_ovlp => dbcsr_ovlp
366 dbcsr_soc_package%dbcsr_prod => dbcsr_prod
367 dbcsr_soc_package%dbcsr_tmp => dbcsr_tmp
375 gs_coeffs => gs_mos(1)%mos_occ
382 nrow_global=nactive, ncol_global=nactive)
386 nrow_global=nex, ncol_global=nex)
390 IF (log_unit > 0 .AND. debug_this_module)
THEN
391 WRITE (log_unit,
'(A)')
"Starting Precomputations"
402 ALLOCATE (
diag(nactive))
403 ALLOCATE (mo_soc_x(nactive, nactive), mo_soc_y(nactive, nactive), mo_soc_z(nactive, nactive))
408 nactive, nao, 1.0_dp, &
409 gs_coeffs, vec_soc_x, &
415 nactive, nao, 1.0_dp, &
416 gs_coeffs, vec_soc_y, &
422 nactive, nao, 1.0_dp, &
423 gs_coeffs, vec_soc_z, &
430 IF (log_unit > 0 .AND. debug_this_module)
THEN
431 WRITE (log_unit,
'(A)')
"Starting Ground-State contributions..."
437 nrow_global=ntp*nactive, ncol_global=nactive)
439 ALLOCATE (gstp_block(nactive, nactive))
445 nactive, nao, -1.0_dp, &
446 tp_coeffs, vec_soc_x, &
452 start_row=(itp - 1)*nactive + 1, start_col=1, &
453 n_rows=nactive, n_cols=nactive)
462 IF (debug_this_module .AND. (log_unit > 0))
THEN
463 WRITE (log_unit,
"(A,2F18.6)")
"<0|H_x|T^-1> in Hartree / cm^-1", soc_gst, soc_gst*
wavenumbers
464 WRITE (log_unit,
"(A,2F18.6)")
"<0|H_x|T^+1> in Hartree / cm^-1", soc_gst, soc_gst*
wavenumbers
470 nactive, nao, -1.0_dp, &
471 tp_coeffs, vec_soc_y, &
475 CALL cp_fm_get_submatrix(fm=gstp_fm, target_m=gstp_block, start_row=(itp - 1)*nactive + 1, &
476 start_col=1, n_rows=nactive, n_cols=nactive)
485 IF (debug_this_module .AND. (log_unit > 0))
THEN
486 WRITE (log_unit,
"(A,2F18.6)")
"<0|H_y|T^-1> in Hartree / cm^-1", soc_gst, soc_gst*
wavenumbers
487 WRITE (log_unit,
"(A,2F18.6)")
"<0|H_y|T^+1> in Hartree / cm^-1", soc_gst, soc_gst*
wavenumbers
493 nactive, nao, -1.0_dp, &
494 tp_coeffs, vec_soc_z, &
499 target_m=gstp_block, &
500 start_row=(itp - 1)*nactive + 1, &
505 soc_gst = sqrt2*sum(
diag)
509 IF (debug_this_module .AND. (log_unit > 0))
THEN
510 WRITE (log_unit,
"(A,2F18.6)")
"<0|H_z|T> in Hartree / cm^-1", soc_gst, soc_gst*
wavenumbers
526 DEALLOCATE (gstp_block)
528 IF (log_unit > 0 .AND. debug_this_module)
THEN
529 WRITE (log_unit,
'(A)')
"Starting Singlet-Triplet contributions..."
535 CALL dbcsr_multiply(
'N',
'N', 1.0_dp, &
536 matrix_s(1)%matrix, &
539 filter_eps=eps_filter)
540 CALL dbcsr_multiply(
'T',
'N', 1.0_dp, &
543 0.0_dp, dbcsr_ovlp, &
544 filter_eps=eps_filter)
548 CALL dbcsr_multiply(
'N',
'N', 1.0_dp, &
552 filter_eps=eps_filter)
553 CALL dbcsr_multiply(
'T',
'N', 1.0_dp, &
555 dbcsr_work, 0.0_dp, &
557 filter_eps=eps_filter)
565 pref_trace=-1.0_dp, &
566 pref_overall=-0.5_dp*sqrt2)
578 t_firstcol=1 + nsg + 1)
580 IF (debug_this_module)
THEN
581 WRITE (log_unit,
"(/,A)")
"<S|H_x|T^-1> in Hartree / cm^-1"
582 CALL dbcsr_copy(dbcsr_dummy, dbcsr_tmp)
584 CALL dbcsr_print(dbcsr_dummy, unit_nr=log_unit)
596 t_firstcol=1 + nsg + 2*ntp + 1)
598 IF (debug_this_module)
THEN
599 WRITE (log_unit,
"(/,A)")
"<S|H_x|T^+1> in Hartree / cm^-1"
600 CALL dbcsr_copy(dbcsr_dummy, dbcsr_tmp)
602 CALL dbcsr_print(dbcsr_dummy, unit_nr=log_unit)
607 CALL dbcsr_multiply(
'N',
'N', 1.0_dp, &
608 orb_soc_y, dbcsr_tp, &
609 0.0_dp, dbcsr_work, &
610 filter_eps=eps_filter)
611 CALL dbcsr_multiply(
'T',
'N', 1.0_dp, &
612 dbcsr_sg, dbcsr_work, &
613 0.0_dp, dbcsr_prod, &
614 filter_eps=eps_filter)
621 pref_trace=-1.0_dp, &
622 pref_overall=-0.5_dp*sqrt2)
633 t_firstcol=1 + nsg + 1)
635 IF (debug_this_module)
THEN
636 WRITE (log_unit,
"(/,A)")
"<S|H_y|T^-1> in Hartree / cm^-1"
637 CALL dbcsr_copy(dbcsr_dummy, dbcsr_tmp)
639 CALL dbcsr_print(dbcsr_tmp, unit_nr=log_unit)
650 t_firstcol=1 + nsg + 2*ntp + 1)
652 IF (debug_this_module)
THEN
653 WRITE (log_unit,
"(/,A)")
"<S|H_y|T^+1> in Hartree / cm^-1"
654 CALL dbcsr_copy(dbcsr_dummy, dbcsr_tmp)
656 CALL dbcsr_print(dbcsr_dummy, unit_nr=log_unit)
660 CALL dbcsr_multiply(
'N',
'N', 1.0_dp, &
661 orb_soc_z, dbcsr_tp, &
662 0.0_dp, dbcsr_work, &
663 filter_eps=eps_filter)
664 CALL dbcsr_multiply(
'T',
'N', 1.0_dp, &
665 dbcsr_sg, dbcsr_work, &
666 0.0_dp, dbcsr_prod, &
667 filter_eps=eps_filter)
673 pref_trace=-1.0_dp, &
685 t_firstcol=1 + nsg + ntp + 1)
687 IF (debug_this_module)
THEN
688 WRITE (log_unit,
"(/,A)")
"<S|H_z|T^0> in Hartree / cm^-1"
689 CALL dbcsr_copy(dbcsr_dummy, dbcsr_tmp)
691 CALL dbcsr_print(dbcsr_dummy, unit_nr=log_unit)
694 IF (log_unit > 0 .AND. debug_this_module)
THEN
695 WRITE (log_unit,
'(A)')
"Starting Triplet-Triplet contributions..."
700 CALL dbcsr_multiply(
'N',
'N', 1.0_dp, &
701 matrix_s(1)%matrix, &
704 filter_eps=eps_filter)
705 CALL dbcsr_multiply(
'T',
'N', 1.0_dp, &
706 dbcsr_tp, dbcsr_work, &
707 0.0_dp, dbcsr_ovlp, &
708 filter_eps=eps_filter)
711 CALL dbcsr_multiply(
'N',
'N', 1.0_dp, &
712 orb_soc_x, dbcsr_tp, &
713 0.0_dp, dbcsr_work, &
714 filter_eps=eps_filter)
715 CALL dbcsr_multiply(
'T',
'N', 1.0_dp, &
716 dbcsr_tp, dbcsr_work, &
717 0.0_dp, dbcsr_prod, &
718 filter_eps=eps_filter)
725 pref_overall=-0.5_dp*sqrt2)
735 t_firstrow=1 + nsg + ntp + 1, &
736 t_firstcol=1 + nsg + 2*ntp + 1)
738 IF (debug_this_module)
THEN
739 WRITE (log_unit,
"(/,A)")
"<T^0|H_x|T^+1> in Hartree / cm^-1"
740 CALL dbcsr_copy(dbcsr_dummy, dbcsr_tmp)
742 CALL dbcsr_print(dbcsr_dummy, unit_nr=log_unit)
754 t_firstrow=1 + nsg + 1, &
755 t_firstcol=1 + nsg + ntp + 1)
757 IF (debug_this_module)
THEN
758 WRITE (log_unit,
"(/,A)")
"<T^-1|H_x|T^0> in Hartree / cm^-1"
759 CALL dbcsr_copy(dbcsr_dummy, dbcsr_tmp)
761 CALL dbcsr_print(dbcsr_dummy, unit_nr=log_unit)
765 CALL dbcsr_multiply(
'N',
'N', 1.0_dp, &
766 orb_soc_y, dbcsr_tp, &
767 0.0_dp, dbcsr_work, &
768 filter_eps=eps_filter)
769 CALL dbcsr_multiply(
'T',
'N', 1.0_dp, &
770 dbcsr_tp, dbcsr_work, &
771 0.0_dp, dbcsr_prod, &
772 filter_eps=eps_filter)
779 pref_overall=0.5_dp*sqrt2)
788 s_firstcol=1, t_firstrow=1 + nsg + ntp + 1, &
789 t_firstcol=1 + nsg + 2*ntp + 1)
791 IF (debug_this_module)
THEN
792 WRITE (log_unit,
"(/,A)")
"<T^0|H_y|T^+1> in Hartree / cm^-1"
793 CALL dbcsr_copy(dbcsr_dummy, dbcsr_tmp)
795 CALL dbcsr_print(dbcsr_dummy, unit_nr=log_unit)
806 s_firstcol=1, t_firstrow=1 + nsg + 1, &
807 t_firstcol=1 + nsg + ntp + 1)
809 IF (debug_this_module)
THEN
810 WRITE (log_unit,
"(/,A)")
"<T^0|H_y|T^+1> in Hartree / cm^-1"
811 CALL dbcsr_copy(dbcsr_dummy, dbcsr_tmp)
813 CALL dbcsr_print(dbcsr_dummy, unit_nr=log_unit)
817 CALL dbcsr_multiply(
'N',
'N', 1.0_dp, &
818 orb_soc_z, dbcsr_tp, &
819 0.0_dp, dbcsr_work, &
820 filter_eps=eps_filter)
821 CALL dbcsr_multiply(
'T',
'N', 1.0_dp, &
822 dbcsr_tp, dbcsr_work, &
823 0.0_dp, dbcsr_prod, &
824 filter_eps=eps_filter)
841 t_firstrow=1 + nsg + 2*ntp + 1, &
842 t_firstcol=1 + nsg + 2*ntp + 1)
844 IF (debug_this_module)
THEN
845 WRITE (log_unit,
"(/,A)")
"<T^+1|H_z|T^+1> in Hartree / cm^-1"
846 CALL dbcsr_copy(dbcsr_dummy, dbcsr_tmp)
848 CALL dbcsr_print(dbcsr_dummy, unit_nr=log_unit)
859 t_firstrow=1 + nsg + 1, &
860 t_firstcol=1 + nsg + 1)
862 IF (debug_this_module)
THEN
863 WRITE (log_unit,
"(/,A)")
"<T^-1|H_z|T^-1> in Hartree / cm^-1"
864 CALL dbcsr_copy(dbcsr_dummy, dbcsr_tmp)
866 CALL dbcsr_print(dbcsr_dummy, unit_nr=log_unit)
873 DEALLOCATE (
diag, mo_soc_x, mo_soc_y, mo_soc_z)
875 IF (log_unit > 0)
THEN
876 WRITE (log_unit,
'(A)')
"Diagonlzing SOC-Matrix"
884 IF (logger%para_env%is_source())
THEN
886 tddfpt_print_section, &
888 extension=
".socme", &
889 file_form=
"FORMATTED", &
890 file_action=
"WRITE", &
891 file_status=
"UNKNOWN")
906 ELSE IF (print_ev)
THEN
909 cpwarn(
"No output unit was selected, printout will be in Hartree!")
916 IF (log_unit > 0)
THEN
917 WRITE (log_unit,
'(A)')
"____________________________________________________"
918 WRITE (log_unit,
'(A)')
" FULL SOC-Matrix "
920 WRITE (log_unit,
'(A)')
"STATE STATE REAL-PART[eV] IMG-PART[eV] "
921 ELSE IF (print_wn)
THEN
922 WRITE (log_unit,
'(A)')
"STATE STATE REAL-PART[cm-1] IMG-PART[cm-1]"
924 WRITE (log_unit,
'(A)')
"STATE STATE REAL-PART[Hartree] IMG-PART[Hartree]"
926 WRITE (log_unit,
'(A)')
"____________________________________________________"
928 ALLOCATE (real_tmp(ntot, ntot), img_tmp(ntot, ntot))
935 IF (log_unit > 0)
THEN
938 WRITE (unit=log_unit, fmt=
"(I3,5X,I3,5X,f16.8,5X,f16.8)") ii, jj, &
939 real_tmp(ii, jj)*unit_scale, &
940 img_tmp(ii, jj)*unit_scale
943 WRITE (log_unit,
'(A)')
" END SOC-MATRIX "
944 WRITE (log_unit,
'(A)')
"____________________________________________________"
945 WRITE (log_unit,
'(A)')
"____________________________________________________"
947 DEALLOCATE (real_tmp, img_tmp)
954 ALLOCATE (tmp_evals(ntot))
959 ALLOCATE (soc_env%soc_evals(ntot - 1))
960 soc_env%soc_evals(:) = tmp_evals(2:ntot) - tmp_evals(1)
963 IF (logger%para_env%is_source())
THEN
969 IF (log_unit > 0)
THEN
970 WRITE (log_unit,
'(A27,6X,F18.10)')
"Ground state stabilisation:", (soc_env%soc_evals(1)*unit_scale)
971 IF (debug_this_module)
THEN
972 WRITE (log_unit,
'(A)')
"Calculation Dipole Moments"
977 soc_env%evals_a => evals_sing
978 soc_env%evals_b => evals_trip
979 CALL soc_dipol(qs_env, dbcsr_soc_package, soc_env, &
980 evecs_cfm, eps_filter, dipole_form, gs_mos, &
981 evects_sing, evects_trip)
985 IF (logger%para_env%is_source())
THEN
991 IF (log_unit > 0)
THEN
992 WRITE (log_unit,
'(A)')
"------------------------------------------------------------------------------"
993 WRITE (log_unit,
'(A)')
"- SOC CORRECTED SPECTRUM -"
994 WRITE (log_unit,
'(A)')
"------------------------------------------------------------------------------"
996 WRITE (log_unit,
'(A)')
"- STATE SOC-corrected exc. energies [eV] Oscillator strengths [a.u.] -"
997 ELSE IF (print_wn)
THEN
998 WRITE (log_unit,
'(A)')
"- STATE SOC-corrected exc. energies [cm-1] Oscillator strengths [a.u.]-"
1000 WRITE (log_unit,
'(A)')
"- STATE SOC-corrected exc.energies [Hartree] Oscillator strengths [a.u.]-"
1002 WRITE (log_unit,
'(A)')
"------------------------------------------------------------------------------"
1003 DO istate = 1,
SIZE(soc_env%soc_evals)
1004 WRITE (log_unit,
'(6X,I5,11X,2F16.5)') istate, soc_env%soc_evals(istate)*unit_scale, &
1005 soc_env%soc_osc(istate)
1008 WRITE (log_unit,
'(A,F18.8)')
"TDDFT+SOC : CheckSum (eV) ", sum(soc_env%soc_evals)*
evolt
1014 IF (print_splitting .OR. debug_this_module)
THEN
1016 IF (log_unit > 0)
THEN
1017 WRITE (log_unit,
'(A)')
"-----------------------------------------------------------------------------"
1018 WRITE (log_unit,
'(A)')
"- Splittings -"
1019 WRITE (log_unit,
'(A)')
"-----------------------------------------------------------------------------"
1021 WRITE (log_unit,
'(A)')
"- STATE exc.energies[eV] splittings[eV] -"
1022 ELSE IF (print_wn)
THEN
1023 WRITE (log_unit,
'(A)')
"- STATE exc.energies[cm-1] splittings[cm-1] -"
1025 WRITE (log_unit,
'(A)')
"- STATE exc.energies[Hartree] splittings[Hartree] -"
1027 WRITE (log_unit,
'(A)')
"-----------------------------------------------------------------------------"
1029 DO iex = 1,
SIZE(soc_env%soc_evals)
1030 IF (evects_sort(iex + 1) .GT. nsg + ntp*2 + 1)
THEN
1032 ELSE IF (evects_sort(iex + 1) .GT. nsg + ntp + 1)
THEN
1034 ELSE IF (evects_sort(iex + 1) .GT. nsg + 1)
THEN
1039 IF (mult ==
"T-1")
THEN
1040 WRITE (log_unit,
"(5X,A,I5,6X,F18.10,6X,F18.10)") mult, &
1041 evects_sort(iex + 1) - (1 + nsg), soc_env%soc_evals(iex)*unit_scale, &
1042 (soc_env%soc_evals(iex) - evals_trip(evects_sort(iex + 1) - (1 + nsg)))*unit_scale
1043 ELSE IF (mult ==
"T0")
THEN
1044 WRITE (log_unit,
"(5X,A,I5,6X,F18.10,6X,F18.10)") mult, &
1045 evects_sort(iex + 1) - (1 + nsg + ntp), soc_env%soc_evals(iex)*unit_scale, &
1046 (soc_env%soc_evals(iex) - evals_trip(evects_sort(iex + 1) - (1 + nsg + ntp)))*unit_scale
1047 ELSE IF (mult ==
"T+1")
THEN
1048 WRITE (log_unit,
"(5X,A,I5,6X,F18.10,6X,F18.10)") mult, &
1049 evects_sort(iex + 1) - (1 + nsg + ntp*2), soc_env%soc_evals(iex)*unit_scale, &
1050 (soc_env%soc_evals(iex) - evals_trip(evects_sort(iex + 1) - (1 + nsg + ntp*2)))*unit_scale
1051 ELSE IF (mult ==
"S ")
THEN
1052 WRITE (log_unit,
"(5X,A,I5,6X,F18.10,6X,F18.10)") mult, &
1053 evects_sort(iex + 1), soc_env%soc_evals(iex)*unit_scale, &
1054 (soc_env%soc_evals(iex) - evals_sing(evects_sort(iex + 1) - 1))*unit_scale
1057 WRITE (log_unit,
'(A)')
"----------------------------------------------------------------------------"
1058 DEALLOCATE (evects_sort)
1067 CALL dbcsr_distribution_release(coeffs_dist)
1068 CALL dbcsr_distribution_release(prod_dist)
1069 CALL dbcsr_release(dbcsr_sg)
1070 CALL dbcsr_release(dbcsr_tp)
1071 CALL dbcsr_release(dbcsr_prod)
1072 CALL dbcsr_release(dbcsr_ovlp)
1073 CALL dbcsr_release(dbcsr_tmp)
1074 CALL dbcsr_release(dbcsr_work)
1075 IF (debug_this_module)
THEN
1076 CALL dbcsr_release(dbcsr_dummy)
1077 DEALLOCATE (dbcsr_dummy)
1080 DEALLOCATE (dbcsr_work, dbcsr_prod, dbcsr_ovlp, dbcsr_tmp)
1081 DEALLOCATE (coeffs_dist, prod_dist, col_dist, col_blk_size, row_dist_new)
1082 DEALLOCATE (dbcsr_sg, dbcsr_tp, tmp_evals)
1084 CALL timestop(handle)
1086 END SUBROUTINE tddfpt_soc_rcs
1098 SUBROUTINE inititialize_soc(qs_env, soc_atom_env, soc_env, &
1099 evects_a, evects_b, &
1100 dipole_form, gs_mos)
1105 TYPE(
cp_fm_type),
DIMENSION(:, :),
INTENT(IN) :: evects_a, evects_b
1106 INTEGER :: dipole_form
1108 INTENT(in) :: gs_mos
1110 CHARACTER(LEN=*),
PARAMETER :: routinen =
'inititialize_soc'
1112 CHARACTER(len=default_string_length), &
1113 ALLOCATABLE,
DIMENSION(:, :) :: grid_info
1114 CHARACTER(len=default_string_length), &
1115 DIMENSION(:),
POINTER :: k_list
1116 INTEGER :: handle, i, ikind, irep, ispin, nactive, &
1117 nao, natom, nkind, nrep, nspins, &
1119 LOGICAL :: all_potential_present, do_os
1122 TYPE(
cp_fm_type),
POINTER :: a_coeff, b_coeff
1123 TYPE(dbcsr_p_type),
DIMENSION(:),
POINTER :: matrix_s
1128 TYPE(
qs_kind_type),
DIMENSION(:),
POINTER :: qs_kind_set
1132 CALL timeset(routinen, handle)
1134 NULLIFY (qs_kind_set, particle_set, blacs_env, para_env, &
1135 a_coeff, b_coeff, tddfpt_control, soc_section)
1142 CALL get_qs_env(qs_env, qs_kind_set=qs_kind_set, &
1143 mos=mos, natom=natom, &
1144 particle_set=particle_set, blacs_env=blacs_env, &
1145 para_env=para_env, matrix_s=matrix_s, &
1146 dft_control=dft_control)
1149 tddfpt_control => dft_control%tddfpt2_control
1150 dipole_form = tddfpt_control%dipole_form
1156 ALLOCATE (grid_info(nrep, 3))
1162 grid_info(irep, :) = k_list
1167 nspins =
SIZE(evects_a, 1)
1168 DO ispin = 1, nspins
1169 CALL cp_fm_get_info(evects_a(ispin, 1), nrow_global=nao, ncol_global=nactive)
1174 nstates =
SIZE(evects_a, 2)
1176 a_coeff => soc_env%a_coeff
1177 b_coeff => soc_env%b_coeff
1181 nrow_global=nao, ncol_global=nspins*nactive*nstates)
1189 ALLOCATE (soc_env%orb_soc(3))
1191 ALLOCATE (soc_env%orb_soc(i)%matrix)
1198 soc_atom_env%nspins = 2
1200 soc_atom_env%nspins = 1
1203 nkind =
SIZE(qs_kind_set)
1204 ALLOCATE (soc_atom_env%grid_atom_set(nkind))
1205 ALLOCATE (soc_atom_env%harmonics_atom_set(nkind))
1206 ALLOCATE (soc_atom_env%orb_sphi_so(nkind))
1208 CALL get_qs_kind_set(qs_kind_set, all_potential_present=all_potential_present)
1209 IF (.NOT. all_potential_present)
THEN
1215 CALL init_atom_grid(soc_atom_env, grid_info, qs_env)
1218 NULLIFY (soc_atom_env%orb_sphi_so(ikind)%array)
1219 CALL compute_sphi_so(ikind,
"ORB", soc_atom_env%orb_sphi_so(ikind)%array, qs_env)
1222 DEALLOCATE (grid_info)
1224 CALL timestop(handle)
1226 END SUBROUTINE inititialize_soc
1235 SUBROUTINE init_atom_grid(soc_atom_env, grid_info, qs_env)
1238 CHARACTER(len=default_string_length), &
1239 ALLOCATABLE,
DIMENSION(:, :) :: grid_info
1242 CHARACTER(LEN=*),
PARAMETER :: routinen =
'init_atom_grid'
1244 CHARACTER(LEN=default_string_length) :: kind_name
1245 INTEGER :: handle, igrid, ikind, il, iso, iso1, iso2, l1, l1l2, l2, la, lc1, lc2, lcleb, ll, &
1246 llmax, lp, m1, m2, max_s_harm, max_s_set, maxl, maxlgto, maxs, mm, mp, na, nr, &
1248 REAL(
dp) :: kind_radius
1249 REAL(
dp),
ALLOCATABLE,
DIMENSION(:, :) :: rga
1250 REAL(
dp),
DIMENSION(:, :, :),
POINTER :: my_cg
1256 TYPE(
qs_kind_type),
DIMENSION(:),
POINTER :: qs_kind_set
1258 CALL timeset(routinen, handle)
1260 NULLIFY (my_cg, qs_kind_set, dft_control, qs_control)
1261 NULLIFY (grid_atom, harmonics, tmp_basis)
1265 qs_kind_set=qs_kind_set, &
1266 dft_control=dft_control)
1269 qs_control => dft_control%qs_control
1272 IF (maxlgto < 0)
THEN
1273 cpabort(
"tmp_basis is not Present!")
1278 max_s_harm =
nsoset(llmax)
1279 max_s_set =
nsoset(maxlgto)
1284 CALL reallocate(my_cg, 1, max_s_set, 1, max_s_set, 1, max_s_harm)
1286 ALLOCATE (rga(lcleb, 2))
1296 IF (l1 + l2 > llmax)
THEN
1303 IF (m1*m2 < 0 .OR. (m1*m2 == 0 .AND. (m1 < 0 .OR. m2 < 0)))
THEN
1310 DO lp = mod(l1 + l2, 2), l1l2, 2
1312 IF (abs(mp) <= lp)
THEN
1314 iso =
nsoset(lp - 1) + lp + 1 + mp
1316 iso =
nsoset(lp - 1) + lp + 1 - abs(mp)
1318 my_cg(iso1, iso2, iso) = rga(il, 1)
1320 IF (mp /= mm .AND. abs(mm) <= lp)
THEN
1322 iso =
nsoset(lp - 1) + lp + 1 + mm
1324 iso =
nsoset(lp - 1) + lp + 1 - abs(mm)
1326 my_cg(iso1, iso2, iso) = rga(il, 2)
1338 quadrature = qs_control%gapw_control%quadrature
1340 DO ikind = 1,
SIZE(soc_atom_env%grid_atom_set)
1343 NULLIFY (soc_atom_env%grid_atom_set(ikind)%grid_atom)
1344 NULLIFY (soc_atom_env%harmonics_atom_set(ikind)%harmonics_atom)
1347 soc_atom_env%harmonics_atom_set(ikind)%harmonics_atom)
1349 NULLIFY (grid_atom, harmonics)
1350 grid_atom => soc_atom_env%grid_atom_set(ikind)%grid_atom
1351 harmonics => soc_atom_env%harmonics_atom_set(ikind)%harmonics_atom
1360 DO igrid = 1,
SIZE(grid_info, 1)
1361 IF (grid_info(igrid, 1) == kind_name)
THEN
1362 READ (grid_info(igrid, 2), *, iostat=stat) na
1363 IF (stat .NE. 0) cpabort(
"The 'na' value for the GRID keyword must be an integer")
1364 READ (grid_info(igrid, 3), *, iostat=stat) nr
1365 IF (stat .NE. 0) cpabort(
"The 'nr' value for the GRID keyword must be an integer")
1373 grid_atom%ng_sphere = na
1378 basis_set=tmp_basis, &
1382 kind_radius=kind_radius)
1395 CALL get_maxl_cg(harmonics, tmp_basis, llmax, max_s_harm)
1401 CALL timestop(handle)
1403 END SUBROUTINE init_atom_grid
1417 SUBROUTINE soc_dipol(qs_env, dbcsr_soc_package, soc_env, &
1418 soc_evecs_cfm, eps_filter, dipole_form, gs_mos, &
1419 evects_sing, evects_trip)
1421 TYPE(dbcsr_soc_package_type) :: dbcsr_soc_package
1424 REAL(
dp),
INTENT(IN) :: eps_filter
1425 INTEGER :: dipole_form
1428 TYPE(
cp_fm_type),
DIMENSION(:, :),
INTENT(IN) :: evects_sing, evects_trip
1430 CHARACTER(len=*),
PARAMETER :: routinen =
'soc_dipol'
1432 COMPLEX(dp),
ALLOCATABLE,
DIMENSION(:, :) :: transdip
1433 INTEGER :: handle, i, nosc, ntot
1434 REAL(
dp),
DIMENSION(:),
POINTER :: osc_str, soc_evals
1436 TYPE(
cp_cfm_type) :: dip_cfm, work1_cfm, work2_cfm
1438 TYPE(
cp_fm_type),
ALLOCATABLE,
DIMENSION(:) :: amew_dip
1441 CALL timeset(routinen, handle)
1443 NULLIFY (para_env, blacs_env, dip_struct, full_struct, osc_str)
1446 CALL get_qs_env(qs_env, para_env=para_env, blacs_env=blacs_env)
1448 soc_evals => soc_env%soc_evals
1449 nosc =
SIZE(soc_evals)
1451 ALLOCATE (soc_env%soc_osc(nosc))
1452 osc_str => soc_env%soc_osc
1457 context=blacs_env, para_env=para_env, &
1458 nrow_global=ntot, ncol_global=1)
1465 ALLOCATE (transdip(ntot, 1))
1467 CALL get_rcs_amew_op(amew_dip, soc_env, dbcsr_soc_package, &
1468 eps_filter, qs_env, gs_mos, &
1469 evects_sing, evects_trip)
1474 CALL cp_fm_to_cfm(msourcer=amew_dip(i), mtarget=work1_cfm)
1495 osc_str(:) = osc_str(:) + real(transdip(2:ntot, 1))**2 + aimag(transdip(2:ntot, 1))**2
1501 osc_str(:) = 2.0_dp/3.0_dp*soc_evals(:)*osc_str(:)
1503 osc_str(:) = 2.0_dp/3.0_dp*soc_evals(:)*osc_str(:)
1514 DEALLOCATE (amew_dip, transdip)
1516 CALL timestop(handle)
1518 END SUBROUTINE soc_dipol
1531 SUBROUTINE get_rcs_amew_op(amew_op, soc_env, dbcsr_soc_package, eps_filter, qs_env, gs_mos, &
1532 evects_sing, evects_trip)
1534 TYPE(
cp_fm_type),
ALLOCATABLE,
DIMENSION(:), &
1535 INTENT(OUT) :: amew_op
1537 TYPE(dbcsr_soc_package_type) :: dbcsr_soc_package
1538 REAL(
dp),
INTENT(IN) :: eps_filter
1542 TYPE(
cp_fm_type),
DIMENSION(:, :),
INTENT(IN) :: evects_sing, evects_trip
1544 CHARACTER(len=*),
PARAMETER :: routinen =
'get_rcs_amew_op'
1546 INTEGER :: dim_op, handle, i, isg, nactive, nao, &
1549 REAL(
dp) :: op, sqrt2
1550 REAL(
dp),
ALLOCATABLE,
DIMENSION(:) ::
diag, gs_diag, gsgs_op
1551 REAL(
dp),
ALLOCATABLE,
DIMENSION(:, :) :: mo_op, sggs_block
1554 std_struct, tmp_struct
1555 TYPE(
cp_fm_type) :: gs_fm, sggs_fm, tmp_fm, vec_op, work_fm
1557 TYPE(dbcsr_p_type),
DIMENSION(:),
POINTER :: ao_op, matrix_s
1558 TYPE(dbcsr_type),
POINTER :: ao_op_i, dbcsr_ovlp, dbcsr_prod, &
1559 dbcsr_sg, dbcsr_tmp, dbcsr_tp, &
1564 CALL timeset(routinen, handle)
1566 NULLIFY (mos, gs_coeffs)
1568 NULLIFY (para_env, blacs_env)
1569 NULLIFY (full_struct, gsgs_struct, std_struct, tmp_struct, sggs_struct)
1570 NULLIFY (ao_op_i, ao_op)
1571 NULLIFY (dbcsr_tp, dbcsr_sg, dbcsr_ovlp, dbcsr_work, dbcsr_tmp, dbcsr_prod)
1575 IF (
ASSOCIATED(soc_env%dipmat))
THEN
1576 ao_op => soc_env%dipmat
1579 ao_op => soc_env%dipmat_ao
1582 nsg =
SIZE(soc_env%evals_a)
1583 ntp = nsg; nex = nsg
1584 ntot = 1 + nsg + 3*ntp
1586 CALL get_qs_env(qs_env, matrix_s=matrix_s, mos=mos, para_env=para_env, blacs_env=blacs_env)
1587 sqrt2 = sqrt(2.0_dp)
1588 dim_op =
SIZE(ao_op)
1590 dbcsr_sg => dbcsr_soc_package%dbcsr_sg
1591 dbcsr_tp => dbcsr_soc_package%dbcsr_tp
1592 dbcsr_work => dbcsr_soc_package%dbcsr_work
1593 dbcsr_prod => dbcsr_soc_package%dbcsr_prod
1594 dbcsr_ovlp => dbcsr_soc_package%dbcsr_ovlp
1595 dbcsr_tmp => dbcsr_soc_package%dbcsr_tmp
1599 context=blacs_env, para_env=para_env, &
1600 nrow_global=ntot, ncol_global=ntot)
1601 ALLOCATE (amew_op(dim_op))
1607 CALL get_mo_set(mos(1), nao=nao, homo=nactive)
1608 gs_coeffs => gs_mos(1)%mos_occ
1612 context=blacs_env, para_env=para_env, &
1613 nrow_global=nactive, ncol_global=nactive)
1618 ALLOCATE (gsgs_op(dim_op))
1619 ALLOCATE (gs_diag(nactive))
1623 ao_op_i => ao_op(i)%matrix
1626 1.0_dp, gs_coeffs, work_fm, 0.0_dp, gs_fm)
1628 gsgs_op(i) = 2.0_dp*sum(gs_diag)
1631 DEALLOCATE (gs_diag)
1640 context=blacs_env, para_env=para_env, &
1641 nrow_global=nex, ncol_global=nex)
1643 context=blacs_env, para_env=para_env, &
1644 nrow_global=nactive*nsg, ncol_global=nactive)
1650 ALLOCATE (
diag(nactive))
1651 ALLOCATE (mo_op(nactive, nactive))
1652 ALLOCATE (sggs_block(nactive, nactive))
1658 ao_op_i => ao_op(i)%matrix
1669 CALL dip_vel_op(soc_env, qs_env, evects_sing, dbcsr_prod, i, .false., &
1673 1.0_dp, soc_env%a_coeff, vec_op, 0.0_dp, sggs_fm)
1678 target_m=sggs_block, &
1679 start_row=(isg - 1)*nactive + 1, &
1684 op = sqrt2*sum(
diag)
1690 CALL dbcsr_multiply(
'N',
'N', 1.0_dp, &
1691 matrix_s(1)%matrix, dbcsr_sg, &
1692 0.0_dp, dbcsr_work, &
1693 filter_eps=eps_filter)
1694 CALL dbcsr_multiply(
'T',
'N', 1.0_dp, &
1695 dbcsr_sg, dbcsr_work, &
1696 0.0_dp, dbcsr_ovlp, &
1697 filter_eps=eps_filter)
1700 CALL dip_vel_op(soc_env, qs_env, evects_sing, dbcsr_prod, i, .false.)
1703 CALL dbcsr_multiply(
'N',
'N', 1.0_dp, &
1704 ao_op_i, dbcsr_sg, &
1705 0.0_dp, dbcsr_work, &
1706 filter_eps=eps_filter)
1707 CALL dbcsr_multiply(
'T',
'N', 1.0_dp, &
1708 dbcsr_sg, dbcsr_work, &
1709 0.0_dp, dbcsr_prod, &
1710 filter_eps=eps_filter)
1718 pref_trace=-1.0_dp, &
1719 pref_overall=1.0_dp, &
1720 pref_diags=gsgs_op(i), &
1725 mtarget=amew_op(i), &
1735 CALL dbcsr_multiply(
'N',
'N', 1.0_dp, &
1736 matrix_s(1)%matrix, &
1739 filter_eps=eps_filter)
1740 CALL dbcsr_multiply(
'T',
'N', 1.0_dp, &
1741 dbcsr_tp, dbcsr_work, &
1742 0.0_dp, dbcsr_ovlp, &
1743 filter_eps=eps_filter)
1747 CALL dip_vel_op(soc_env, qs_env, evects_trip, dbcsr_prod, i, .true.)
1749 CALL dbcsr_multiply(
'N',
'N', 1.0_dp, &
1750 ao_op_i, dbcsr_tp, &
1751 0.0_dp, dbcsr_work, &
1752 filter_eps=eps_filter)
1753 CALL dbcsr_multiply(
'T',
'N', 1.0_dp, &
1754 dbcsr_tp, dbcsr_work, &
1755 0.0_dp, dbcsr_prod, &
1756 filter_eps=eps_filter)
1763 pref_trace=-1.0_dp, &
1764 pref_overall=1.0_dp, &
1765 pref_diags=gsgs_op(i), &
1771 mtarget=amew_op(i), &
1776 t_firstrow=1 + nsg + 1, &
1777 t_firstcol=1 + nsg + 1)
1781 mtarget=amew_op(i), &
1786 t_firstrow=1 + nsg + ntp + 1, &
1787 t_firstcol=1 + nsg + ntp + 1)
1790 mtarget=amew_op(i), &
1795 t_firstrow=1 + nsg + 2*ntp + 1, &
1796 t_firstcol=1 + nsg + 2*ntp + 1)
1813 DEALLOCATE (sggs_block)
1814 DEALLOCATE (
diag, gsgs_op, mo_op)
1815 CALL timestop(handle)
1817 END SUBROUTINE get_rcs_amew_op
static GRID_HOST_DEVICE int modulo(int a, int m)
Equivalent of Fortran's MODULO, which always return a positive number. https://gcc....
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)
...
methods related to the blacs parallel environment
used for collecting diagonalization schemes available for cp_cfm_type
subroutine, public cp_cfm_heevd(matrix, eigenvectors, eigenvalues)
Perform a diagonalisation of a complex matrix.
Represents a complex full matrix distributed on many processors.
subroutine, public cp_cfm_get_submatrix(fm, target_m, start_row, start_col, n_rows, n_cols, transpose)
Extract a sub-matrix from the full matrix: op(target_m)(1:n_rows,1:n_cols) = fm(start_row:start_row+n...
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_get_info(matrix, name, nrow_global, ncol_global, nrow_block, ncol_block, nrow_local, ncol_local, row_indices, col_indices, local_data, context, matrix_struct, para_env)
Returns information about a full matrix.
Defines control structures, which contain the parameters and the settings for the DFT-based calculati...
DBCSR operations in CP2K.
subroutine, public cp_dbcsr_sm_fm_multiply(matrix, fm_in, fm_out, ncol, alpha, beta)
multiply a dbcsr with a fm matrix
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_transpose(matrix, matrixt)
transposes a matrix matrixt = matrix ^ T
subroutine, public cp_fm_upper_to_full(matrix, work)
given an upper triangular matrix computes the corresponding full matrix
subroutine, public cp_fm_scale(alpha, matrix_a)
scales a matrix matrix_a = alpha * matrix_b
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_get_diag(matrix, diag)
returns the diagonal elements of a fm
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_to_fm_submat(msource, mtarget, nrow, ncol, s_firstrow, s_firstcol, t_firstrow, t_firstcol)
copy just a part ot the 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_get_submatrix(fm, target_m, start_row, start_col, n_rows, n_cols, transpose)
gets a submatrix of a full matrix op(target_m)(1:n_rows,1:n_cols) =fm(start_row:start_row+n_rows,...
subroutine, public cp_fm_set_element(matrix, irow_global, icol_global, alpha)
sets an element of a matrix
subroutine, public cp_fm_create(matrix, matrix_struct, name, use_sp)
creates a new full matrix with the given structure
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
type(cp_logger_type) function, pointer, public cp_get_default_logger()
returns the default logger
routines to handle the output, The idea is to remove the decision of wheter to output and what to out...
integer function, public cp_print_key_unit_nr(logger, basis_section, print_key_path, extension, middle_name, local, log_filename, ignore_should_output, file_form, file_position, file_action, file_status, do_backup, on_file, is_new_file, mpi_io, fout)
...
Defines the basic variable types.
integer, parameter, public dp
integer, parameter, public default_string_length
Generation of the spherical Lebedev grids. All Lebedev grids were generated with a precision of at le...
subroutine, public deallocate_lebedev_grids()
...
type(oh_grid), dimension(nlg), target, public lebedev_grid
integer function, public get_number_of_lebedev_grid(l, n)
Get the number of the Lebedev grid, which has the requested angular momentum quantnum number l or siz...
subroutine, public init_lebedev_grids()
Load the coordinates and weights of the nonredundant Lebedev grid points.
Collection of simple mathematical functions and subroutines.
pure real(kind=dp) function, dimension(min(size(a, 1), size(a, 2))), public get_diag(a)
Return the diagonal elements of matrix a as a vector.
subroutine, public diag(n, a, d, v)
Diagonalize matrix a. The eigenvalues are returned in vector d and the eigenvectors are returned in m...
Utility routines for the memory handling.
Interface to the message passing library MPI.
Provides Cartesian and spherical orbital pointers and indices.
integer, dimension(:), allocatable, public nsoset
integer, dimension(:, :), allocatable, public indso
basic linear algebra operations for full matrixes
Define the data structure for the particle information.
Definition of physical constants:
real(kind=dp), parameter, public evolt
real(kind=dp), parameter, public wavenumbers
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_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, 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, rhs)
Get the QUICKSTEP environment.
subroutine, public allocate_grid_atom(grid_atom)
Initialize components of the grid_atom_type structure.
subroutine, public create_grid_atom(grid_atom, nr, na, llmax, ll, quadrature)
...
subroutine, public allocate_harmonics_atom(harmonics)
Allocate a spherical harmonics set for the atom grid.
subroutine, public get_maxl_cg(harmonics, orb_basis, llmax, max_s_harm)
...
subroutine, public create_harmonics_atom(harmonics, my_cg, na, llmax, maxs, max_s_harm, ll, wa, azi, pol)
...
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, se_parameter, dftb_parameter, xtb_parameter, dftb3_param, 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_r3d_rs_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, 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, init_u_ramping_each_scf, reltmat, ghost, floating, name, element_symbol, pao_basis_size, pao_potentials, pao_descriptors, nelec)
Get attributes of an atomic kind.
subroutine, public get_qs_kind_set(qs_kind_set, all_potential_present, tnadd_potential_present, gth_potential_present, sgp_potential_present, paw_atom_present, dft_plus_u_atom_present, maxcgf, maxsgf, maxco, maxco_proj, maxgtops, maxlgto, maxlprj, maxnset, maxsgf_set, ncgf, npgf, nset, nsgf, nshell, maxpol, maxlppl, maxlppnl, maxppnl, nelectron, maxder, max_ngrid_rad, max_sph_harm, maxg_iso_not0, lmax_rho0, basis_rcut, basis_type, total_zeff_corr)
Get attributes of an atomic kind set.
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.
subroutine, public soc_env_create(soc_env)
...
subroutine, public soc_atom_release(soc_atom_env)
...
subroutine, public soc_atom_create(soc_atom_env)
...
subroutine, public soc_env_release(soc_env)
...
Utilities absorption spectroscopy using TDDFPT with SOC.
subroutine, public soc_dipole_operator(soc_env, tddfpt_control, qs_env, gs_mos)
Build the atomic dipole operator.
subroutine, public resort_evects(evects_cfm, sort)
Used to find out, which state has which spin-multiplicity.
subroutine, public soc_contract_evect(fm_start, fm_res)
...
subroutine, public dip_vel_op(soc_env, qs_env, evec_fm, op, ideriv, tp, gs_coeffs, sggs_fm)
This routine will construct the dipol operator within velocity representation.
subroutine, public tddfpt_soc(qs_env, evals_a, evals_b, evects_a, evects_b, gs_mos)
Perform TDDFPT-SOC calculation.
subroutine, public v_soc_xyz_from_pseudopotential(qs_env, mat_v_soc_xyz)
Compute V^SOC_µν^(α) = ħ/2 < ϕ_µ | sum_ℓ ΔV_ℓ^SO(r,r') L^(α) | ϕ_ν >, α = x, y, z,...
Calculate spherical harmonics.
subroutine, public clebsch_gordon_init(l)
...
subroutine, public clebsch_gordon_deallocate()
...
This module deals with all the integrals done on local atomic grids in xas_tdp. This is mostly used t...
subroutine, public compute_sphi_so(ikind, basis_type, sphi_so, qs_env)
Computes the contraction coefficients to go from spherical orbitals to sgf for a given atomic kind an...
subroutine, public integrate_soc_atoms(matrix_soc, xas_atom_env, qs_env, soc_atom_env)
Computes the SOC matrix elements with respect to the ORB basis set for each atomic kind and put them ...
subroutine, public truncate_radial_grid(grid_atom, max_radius)
Reduces the radial extension of an atomic grid such that it only covers a given radius.
Utilities for X-ray absorption spectroscopy using TDDFPT.
subroutine, public rcs_amew_soc_elements(amew_soc, lr_soc, lr_overlap, domo_soc, pref_trace, pref_overall, pref_diags, symmetric)
Computes the rcs SOC matrix elements between excited states AMEWs based on the LR orbitals.
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
type of a logger, at the moment it contains just a print level starting at which level it should be l...
stores all the informations relevant to an mpi environment
Provides all information about a quickstep kind.
Ground state molecular orbitals.