51 USE dbcsr_api,
ONLY: &
52 dbcsr_copy, dbcsr_get_block_p, dbcsr_get_info, dbcsr_init_p, dbcsr_iterator_blocks_left, &
53 dbcsr_iterator_next_block, dbcsr_iterator_start, dbcsr_iterator_stop, dbcsr_iterator_type, &
54 dbcsr_p_type, dbcsr_set, dbcsr_type
104 #include "./base/base_uses.f90"
110 CHARACTER(len=*),
PARAMETER,
PRIVATE :: moduleN =
'qs_tddfpt2_properties'
113 INTEGER,
PARAMETER,
PRIVATE :: nderivs = 3
114 INTEGER,
PARAMETER,
PRIVATE :: maxspins = 2
147 TYPE(cp_fm_type),
ALLOCATABLE,
DIMENSION(:, :), &
148 INTENT(inout) :: dipole_op_mos_occ
149 TYPE(tddfpt2_control_type),
POINTER :: tddfpt_control
150 TYPE(tddfpt_ground_state_mos),
DIMENSION(:), &
152 TYPE(qs_environment_type),
POINTER :: qs_env
154 CHARACTER(LEN=*),
PARAMETER :: routinen =
'tddfpt_dipole_operator'
156 INTEGER :: handle, i_cos_sin, icol, ideriv, irow, &
157 ispin, jderiv, nao, ncols_local, &
158 ndim_periodic, nrows_local, nspins
159 INTEGER,
DIMENSION(:),
POINTER :: col_indices, row_indices
160 INTEGER,
DIMENSION(maxspins) :: nmo_occ, nmo_virt
161 REAL(kind=
dp) :: eval_occ
162 REAL(kind=
dp),
CONTIGUOUS,
DIMENSION(:, :), &
163 POINTER :: local_data_ediff, local_data_wfm
164 REAL(kind=
dp),
DIMENSION(3) :: kvec, reference_point
165 TYPE(cell_type),
POINTER :: cell
166 TYPE(cp_blacs_env_type),
POINTER :: blacs_env
167 TYPE(cp_cfm_type),
ALLOCATABLE,
DIMENSION(:) :: gamma_00, gamma_inv_00
168 TYPE(cp_fm_struct_type),
POINTER :: fm_struct
169 TYPE(cp_fm_type) :: ediff_inv, rrc_mos_occ, wfm_ao_ao, &
171 TYPE(cp_fm_type),
ALLOCATABLE,
DIMENSION(:) :: s_mos_virt
172 TYPE(cp_fm_type),
ALLOCATABLE,
DIMENSION(:, :) :: dberry_mos_occ, gamma_real_imag, opvec
173 TYPE(dbcsr_p_type),
DIMENSION(:),
POINTER :: berry_cossin_xyz, matrix_s, rrc_xyz, scrm
174 TYPE(dft_control_type),
POINTER :: dft_control
175 TYPE(neighbor_list_set_p_type),
DIMENSION(:), &
177 TYPE(pw_env_type),
POINTER :: pw_env
178 TYPE(pw_poisson_type),
POINTER :: poisson_env
179 TYPE(qs_ks_env_type),
POINTER :: ks_env
181 CALL timeset(routinen, handle)
183 NULLIFY (blacs_env, cell, matrix_s, pw_env)
184 CALL get_qs_env(qs_env, blacs_env=blacs_env, cell=cell, matrix_s=matrix_s, pw_env=pw_env)
186 nspins =
SIZE(gs_mos)
187 CALL dbcsr_get_info(matrix_s(1)%matrix, nfullrows_total=nao)
189 nmo_occ(ispin) =
SIZE(gs_mos(ispin)%evals_occ)
190 nmo_virt(ispin) =
SIZE(gs_mos(ispin)%evals_virt)
194 ALLOCATE (dipole_op_mos_occ(nderivs, nspins))
196 CALL cp_fm_get_info(gs_mos(ispin)%mos_occ, matrix_struct=fm_struct)
198 DO ideriv = 1, nderivs
199 CALL cp_fm_create(dipole_op_mos_occ(ideriv, ispin), fm_struct)
204 ALLOCATE (s_mos_virt(nspins))
206 CALL cp_fm_get_info(gs_mos(ispin)%mos_virt, matrix_struct=fm_struct)
209 gs_mos(ispin)%mos_virt, &
211 ncol=nmo_virt(ispin), alpha=1.0_dp, beta=0.0_dp)
215 CALL pw_env_get(pw_env, poisson_env=poisson_env)
216 ndim_periodic = count(poisson_env%parameters%periodic == 1)
219 IF (tddfpt_control%dipole_form == 0)
THEN
220 CALL get_qs_env(qs_env, dft_control=dft_control)
221 IF (dft_control%qs_control%xtb)
THEN
222 IF (ndim_periodic == 0)
THEN
232 SELECT CASE (tddfpt_control%dipole_form)
234 IF (ndim_periodic /= 3)
THEN
235 CALL cp_warn(__location__, &
236 "Fully periodic Poisson solver (PERIODIC xyz) is needed "// &
237 "for oscillator strengths based on the Berry phase formula")
240 NULLIFY (berry_cossin_xyz)
247 CALL dbcsr_init_p(berry_cossin_xyz(i_cos_sin)%matrix)
248 CALL dbcsr_copy(berry_cossin_xyz(i_cos_sin)%matrix, matrix_s(1)%matrix)
252 ALLOCATE (gamma_00(nspins), gamma_inv_00(nspins), gamma_real_imag(2, nspins), opvec(2, nspins))
253 ALLOCATE (dberry_mos_occ(nderivs, nspins))
257 ncol_global=nmo_occ(ispin), context=blacs_env)
263 CALL cp_fm_create(gamma_real_imag(i_cos_sin, ispin), fm_struct)
268 CALL cp_fm_get_info(gs_mos(ispin)%mos_occ, matrix_struct=fm_struct)
274 DO ideriv = 1, nderivs
275 CALL cp_fm_create(dberry_mos_occ(ideriv, ispin), fm_struct)
280 DO ideriv = 1, nderivs
281 kvec(:) =
twopi*cell%h_inv(ideriv, :)
283 CALL dbcsr_set(berry_cossin_xyz(i_cos_sin)%matrix, 0.0_dp)
286 berry_cossin_xyz(2)%matrix, kvec)
293 gs_mos(ispin)%mos_occ, &
294 opvec(i_cos_sin, ispin), &
295 ncol=nmo_occ(ispin), alpha=1.0_dp, beta=0.0_dp)
298 CALL parallel_gemm(
'T',
'N', nmo_occ(ispin), nmo_occ(ispin), nao, &
299 1.0_dp, gs_mos(ispin)%mos_occ, opvec(1, ispin), &
300 0.0_dp, gamma_real_imag(1, ispin))
302 CALL parallel_gemm(
'T',
'N', nmo_occ(ispin), nmo_occ(ispin), nao, &
303 -1.0_dp, gs_mos(ispin)%mos_occ, opvec(2, ispin), &
304 0.0_dp, gamma_real_imag(2, ispin))
307 msourcei=gamma_real_imag(2, ispin), &
308 mtarget=gamma_00(ispin))
315 mtargetr=gamma_real_imag(1, ispin), &
316 mtargeti=gamma_real_imag(2, ispin))
319 CALL parallel_gemm(
"N",
"N", nao, nmo_occ(ispin), nmo_occ(ispin), &
320 1.0_dp, opvec(1, ispin), gamma_real_imag(2, ispin), &
321 0.0_dp, dipole_op_mos_occ(1, ispin))
322 CALL parallel_gemm(
"N",
"N", nao, nmo_occ(ispin), nmo_occ(ispin), &
323 -1.0_dp, opvec(2, ispin), gamma_real_imag(1, ispin), &
324 1.0_dp, dipole_op_mos_occ(1, ispin))
326 DO jderiv = 1, nderivs
328 cell%hmat(jderiv, ideriv), dipole_op_mos_occ(1, ispin))
334 CALL cp_fm_release(opvec)
335 CALL cp_fm_release(gamma_real_imag)
336 DO ispin = nspins, 1, -1
340 DEALLOCATE (gamma_00, gamma_inv_00)
358 CALL parallel_gemm(
'N',
'T', nao, nao, nmo_virt(ispin), &
359 1.0_dp/
twopi, s_mos_virt(ispin), gs_mos(ispin)%mos_virt, &
362 DO ideriv = 1, nderivs
363 CALL parallel_gemm(
'N',
'N', nao, nmo_occ(ispin), nao, &
364 1.0_dp, wfm_ao_ao, dberry_mos_occ(ideriv, ispin), &
365 0.0_dp, dipole_op_mos_occ(ideriv, ispin))
369 CALL cp_fm_release(wfm_ao_ao)
370 CALL cp_fm_release(dberry_mos_occ)
373 IF (ndim_periodic /= 0)
THEN
374 CALL cp_warn(__location__, &
375 "Non-periodic Poisson solver (PERIODIC none) is needed "// &
376 "for oscillator strengths based on the length operator")
383 DO ideriv = 1, nderivs
384 CALL dbcsr_init_p(rrc_xyz(ideriv)%matrix)
385 CALL dbcsr_copy(rrc_xyz(ideriv)%matrix, matrix_s(1)%matrix)
389 reference=tddfpt_control%dipole_reference, &
390 ref_point=tddfpt_control%dipole_ref_point)
392 CALL rrc_xyz_ao(op=rrc_xyz, qs_env=qs_env, rc=reference_point, order=1, &
393 minimum_image=.false., soft=.false.)
401 CALL cp_fm_get_info(gs_mos(ispin)%mos_occ, matrix_struct=fm_struct)
405 CALL parallel_gemm(
'N',
'T', nao, nao, nmo_virt(ispin), &
406 1.0_dp, s_mos_virt(ispin), gs_mos(ispin)%mos_virt, &
409 DO ideriv = 1, nderivs
411 gs_mos(ispin)%mos_occ, &
413 ncol=nmo_occ(ispin), alpha=1.0_dp, beta=0.0_dp)
415 CALL parallel_gemm(
'N',
'N', nao, nmo_occ(ispin), nao, &
416 1.0_dp, wfm_ao_ao, rrc_mos_occ, &
417 0.0_dp, dipole_op_mos_occ(ideriv, ispin))
420 CALL cp_fm_release(rrc_mos_occ)
423 CALL cp_fm_release(wfm_ao_ao)
428 CALL get_qs_env(qs_env, ks_env=ks_env, sab_orb=sab_orb)
431 basis_type_a=
"ORB", basis_type_b=
"ORB", &
437 ncol_global=nmo_occ(ispin), context=blacs_env)
442 CALL cp_fm_get_info(ediff_inv, nrow_local=nrows_local, ncol_local=ncols_local, &
443 row_indices=row_indices, col_indices=col_indices, local_data=local_data_ediff)
444 CALL cp_fm_get_info(wfm_mo_virt_mo_occ, local_data=local_data_wfm)
449 DO icol = 1, ncols_local
451 eval_occ = gs_mos(ispin)%evals_occ(col_indices(icol))
453 DO irow = 1, nrows_local
456 local_data_ediff(irow, icol) = 1.0_dp/(gs_mos(ispin)%evals_virt(row_indices(irow)) - eval_occ)
461 DO ideriv = 1, nderivs
463 gs_mos(ispin)%mos_occ, &
464 dipole_op_mos_occ(ideriv, ispin), &
465 ncol=nmo_occ(ispin), alpha=1.0_dp, beta=0.0_dp)
467 CALL parallel_gemm(
'T',
'N', nmo_virt(ispin), nmo_occ(ispin), nao, &
468 1.0_dp, gs_mos(ispin)%mos_virt, dipole_op_mos_occ(ideriv, ispin), &
469 0.0_dp, wfm_mo_virt_mo_occ)
478 DO icol = 1, ncols_local
479 DO irow = 1, nrows_local
480 local_data_wfm(irow, icol) = local_data_wfm(irow, icol)*local_data_ediff(irow, icol)
485 CALL parallel_gemm(
'N',
'N', nao, nmo_occ(ispin), nmo_virt(ispin), &
486 1.0_dp, s_mos_virt(ispin), wfm_mo_virt_mo_occ, &
487 0.0_dp, dipole_op_mos_occ(ideriv, ispin))
490 CALL cp_fm_release(wfm_mo_virt_mo_occ)
491 CALL cp_fm_release(ediff_inv)
496 cpabort(
"Unimplemented form of the dipole operator")
500 CALL cp_fm_release(s_mos_virt)
502 CALL timestop(handle)
530 dipole_op_mos_occ, dipole_form)
531 INTEGER,
INTENT(in) :: log_unit
532 TYPE(cp_fm_type),
DIMENSION(:, :),
INTENT(in) :: evects
533 REAL(kind=
dp),
DIMENSION(:),
INTENT(in) :: evals
534 REAL(kind=
dp),
DIMENSION(:),
INTENT(inout) :: ostrength
535 INTEGER,
INTENT(in) :: mult
536 TYPE(cp_fm_type),
DIMENSION(:, :),
INTENT(in) :: dipole_op_mos_occ
537 INTEGER,
INTENT(in) :: dipole_form
539 CHARACTER(LEN=*),
PARAMETER :: routinen =
'tddfpt_print_summary'
541 CHARACTER(len=1) :: lsd_str
542 CHARACTER(len=20) :: mult_str
543 INTEGER :: handle, ideriv, ispin, istate, nspins, &
545 REAL(kind=
dp) :: osc_strength
546 REAL(kind=
dp),
ALLOCATABLE,
DIMENSION(:, :, :) :: trans_dipoles
548 CALL timeset(routinen, handle)
550 nspins =
SIZE(evects, 1)
551 nstates =
SIZE(evects, 2)
560 IF (log_unit > 0)
THEN
562 WRITE (log_unit,
'(/,1X,A1,A,1X,A)') lsd_str,
"-TDDFPT states of multiplicity", trim(mult_str)
563 SELECT CASE (dipole_form)
565 WRITE (log_unit,
'(1X,A,/)')
"Transition dipoles calculated using Berry operator formulation"
567 WRITE (log_unit,
'(1X,A,/)')
"Transition dipoles calculated using length formulation"
569 WRITE (log_unit,
'(1X,A,/)')
"Transition dipoles calculated using velocity formulation"
571 cpabort(
"Unimplemented form of the dipole operator")
574 WRITE (log_unit,
'(T10,A,T19,A,T37,A,T69,A)')
"State",
"Excitation", &
575 "Transition dipole (a.u.)",
"Oscillator"
576 WRITE (log_unit,
'(T10,A,T19,A,T37,A,T49,A,T61,A,T67,A)')
"number",
"energy (eV)", &
577 "x",
"y",
"z",
"strength (a.u.)"
578 WRITE (log_unit,
'(T10,72("-"))')
582 ALLOCATE (trans_dipoles(nstates, nderivs, nspins))
583 trans_dipoles(:, :, :) = 0.0_dp
586 IF (nspins > 1 .OR. mult == 1)
THEN
588 DO ideriv = 1, nderivs
589 CALL cp_fm_trace(evects(ispin, :), dipole_op_mos_occ(ideriv, ispin), &
590 trans_dipoles(:, ideriv, ispin))
594 IF (nspins == 1)
THEN
595 trans_dipoles(:, :, 1) = sqrt(2.0_dp)*trans_dipoles(:, :, 1)
597 trans_dipoles(:, :, 1) = sqrt(trans_dipoles(:, :, 1)**2 + trans_dipoles(:, :, 2)**2)
602 DO istate = 1, nstates
603 osc_strength = 2.0_dp/3.0_dp*evals(istate)* &
604 accurate_dot_product(trans_dipoles(istate, :, 1), trans_dipoles(istate, :, 1))
605 ostrength(istate) = osc_strength
606 IF (log_unit > 0)
THEN
607 WRITE (log_unit,
'(1X,A,T9,I7,T19,F11.5,T31,3(1X,ES11.4E2),T69,ES12.5E2)') &
608 "TDDFPT|", istate, evals(istate)*
evolt, trans_dipoles(istate, 1:nderivs, 1), osc_strength
613 IF (log_unit > 0)
THEN
614 WRITE (log_unit,
'(/,T2,A,E14.6)')
'TDDFPT : CheckSum =', sqrt(sum(evals**2))
617 DEALLOCATE (trans_dipoles)
619 CALL timestop(handle)
636 INTEGER,
INTENT(in) :: log_unit
637 TYPE(cp_fm_type),
DIMENSION(:, :),
INTENT(in) :: evects
638 REAL(kind=
dp),
DIMENSION(:),
INTENT(in) :: evals
639 TYPE(tddfpt_ground_state_mos),
DIMENSION(:), &
641 TYPE(dbcsr_type),
POINTER :: matrix_s
642 REAL(kind=
dp),
INTENT(in) :: min_amplitude
644 CHARACTER(LEN=*),
PARAMETER :: routinen =
'tddfpt_print_excitation_analysis'
646 CHARACTER(len=5) :: spin_label
647 INTEGER :: handle, icol, iproc, irow, ispin, &
648 istate, nao, ncols_local, nrows_local, &
649 nspins, nstates, state_spin
650 INTEGER(kind=int_8) :: iexc, imo_occ, imo_virt, ind, nexcs, &
651 nexcs_local, nexcs_max_local, &
652 nmo_virt_occ, nmo_virt_occ_alpha
653 INTEGER(kind=int_8),
ALLOCATABLE,
DIMENSION(:) :: inds_local, inds_recv, nexcs_recv
654 INTEGER(kind=int_8),
DIMENSION(1) :: nexcs_send
655 INTEGER(kind=int_8),
DIMENSION(maxspins) :: nmo_occ8, nmo_virt8
656 INTEGER,
ALLOCATABLE,
DIMENSION(:) :: inds
657 INTEGER,
DIMENSION(:),
POINTER :: col_indices, row_indices
658 INTEGER,
DIMENSION(maxspins) :: nmo_occ, nmo_virt
659 LOGICAL :: do_exc_analysis
660 REAL(kind=
dp),
ALLOCATABLE,
DIMENSION(:) :: weights_local, weights_neg_abs_recv, &
662 REAL(kind=
dp),
CONTIGUOUS,
DIMENSION(:, :), &
663 POINTER :: local_data
664 TYPE(cp_blacs_env_type),
POINTER :: blacs_env
665 TYPE(cp_fm_struct_type),
POINTER :: fm_struct
666 TYPE(cp_fm_type),
ALLOCATABLE,
DIMENSION(:) :: s_mos_virt, weights_fm
667 TYPE(mp_para_env_type),
POINTER :: para_env
668 TYPE(mp_request_type) :: send_handler, send_handler2
669 TYPE(mp_request_type),
ALLOCATABLE,
DIMENSION(:) :: recv_handlers, recv_handlers2
671 CALL timeset(routinen, handle)
673 nspins =
SIZE(evects, 1)
674 nstates =
SIZE(evects, 2)
675 do_exc_analysis = min_amplitude < 1.0_dp
677 CALL cp_fm_get_info(gs_mos(1)%mos_occ, context=blacs_env, para_env=para_env)
678 CALL dbcsr_get_info(matrix_s, nfullrows_total=nao)
681 nmo_occ(ispin) =
SIZE(gs_mos(ispin)%evals_occ)
682 nmo_virt(ispin) =
SIZE(gs_mos(ispin)%evals_virt)
683 nmo_occ8(ispin) =
SIZE(gs_mos(ispin)%evals_occ, kind=
int_8)
684 nmo_virt8(ispin) =
SIZE(gs_mos(ispin)%evals_virt, kind=
int_8)
688 IF (do_exc_analysis)
THEN
689 cpassert(log_unit <= 0 .OR. para_env%is_source())
690 nmo_virt_occ_alpha = int(nmo_virt(1),
int_8)*int(nmo_occ(1),
int_8)
692 IF (log_unit > 0)
THEN
693 WRITE (log_unit,
"(1X,A)")
"", &
694 "-------------------------------------------------------------------------------", &
695 "- Excitation analysis -", &
696 "-------------------------------------------------------------------------------"
697 WRITE (log_unit,
'(8X,A,T27,A,T49,A,T69,A)')
"State",
"Occupied",
"Virtual",
"Excitation"
698 WRITE (log_unit,
'(8X,A,T28,A,T49,A,T69,A)')
"number",
"orbital",
"orbital",
"amplitude"
699 WRITE (log_unit,
'(1X,79("-"))')
701 IF (nspins == 1)
THEN
707 ALLOCATE (s_mos_virt(nspins), weights_fm(nspins))
709 CALL cp_fm_get_info(gs_mos(ispin)%mos_virt, matrix_struct=fm_struct)
712 gs_mos(ispin)%mos_virt, &
714 ncol=nmo_virt(ispin), alpha=1.0_dp, beta=0.0_dp)
717 CALL cp_fm_struct_create(fm_struct, nrow_global=nmo_virt(ispin), ncol_global=nmo_occ(ispin), &
725 CALL cp_fm_get_info(weights_fm(ispin), nrow_local=nrows_local, ncol_local=ncols_local)
726 nexcs_max_local = nexcs_max_local + int(nrows_local,
int_8)*int(ncols_local,
int_8)
729 ALLOCATE (weights_local(nexcs_max_local), inds_local(nexcs_max_local))
731 DO istate = 1, nstates
739 CALL parallel_gemm(
'T',
'N', nmo_virt(ispin), nmo_occ(ispin), nao, 1.0_dp, s_mos_virt(ispin), &
740 evects(ispin, istate), 0.0_dp, weights_fm(ispin))
742 CALL cp_fm_get_info(weights_fm(ispin), nrow_local=nrows_local, ncol_local=ncols_local, &
743 row_indices=row_indices, col_indices=col_indices, local_data=local_data)
746 DO icol = 1, ncols_local
747 DO irow = 1, nrows_local
748 IF (abs(local_data(irow, icol)) >= min_amplitude)
THEN
750 nexcs_local = nexcs_local + 1
752 weights_local(nexcs_local) = local_data(irow, icol)
754 inds_local(nexcs_local) = nmo_virt_occ + int(row_indices(irow),
int_8) + &
755 int(col_indices(icol) - 1,
int_8)*nmo_virt8(ispin)
760 nmo_virt_occ = nmo_virt_occ + nmo_virt8(ispin)*nmo_occ8(ispin)
763 IF (para_env%is_source())
THEN
765 ALLOCATE (nexcs_recv(para_env%num_pe), recv_handlers(para_env%num_pe), recv_handlers2(para_env%num_pe))
768 DO iproc = 1, para_env%num_pe
769 IF (iproc - 1 /= para_env%mepos)
THEN
770 CALL para_env%irecv(nexcs_recv(iproc:iproc), iproc - 1, recv_handlers(iproc), 0)
772 nexcs_recv(iproc) = nexcs_local
776 DO iproc = 1, para_env%num_pe
777 IF (iproc - 1 /= para_env%mepos) &
778 CALL recv_handlers(iproc)%wait()
783 DO iproc = 1, para_env%num_pe
784 nexcs = nexcs + nexcs_recv(iproc)
788 ALLOCATE (weights_recv(nexcs), weights_neg_abs_recv(nexcs))
789 ALLOCATE (inds_recv(nexcs), inds(nexcs))
792 DO iproc = 1, para_env%num_pe
793 IF (nexcs_recv(iproc) > 0)
THEN
794 IF (iproc - 1 /= para_env%mepos)
THEN
796 CALL para_env%irecv(weights_recv(nmo_virt_occ + 1:nmo_virt_occ + nexcs_recv(iproc)), &
797 iproc - 1, recv_handlers(iproc), 1)
799 CALL para_env%irecv(inds_recv(nmo_virt_occ + 1:nmo_virt_occ + nexcs_recv(iproc)), &
800 iproc - 1, recv_handlers2(iproc), 2)
803 weights_recv(nmo_virt_occ + 1:nmo_virt_occ + nexcs_recv(iproc)) = weights_local(1:nexcs_recv(iproc))
804 inds_recv(nmo_virt_occ + 1:nmo_virt_occ + nexcs_recv(iproc)) = inds_local(1:nexcs_recv(iproc))
807 nmo_virt_occ = nmo_virt_occ + nexcs_recv(iproc)
811 DO iproc = 1, para_env%num_pe
812 IF (iproc - 1 /= para_env%mepos .AND. nexcs_recv(iproc) > 0)
THEN
813 CALL recv_handlers(iproc)%wait()
814 CALL recv_handlers2(iproc)%wait()
818 DEALLOCATE (nexcs_recv, recv_handlers, recv_handlers2)
821 nexcs_send(1) = nexcs_local
822 CALL para_env%isend(nexcs_send, para_env%source, send_handler, 0)
823 CALL send_handler%wait()
825 IF (nexcs_local > 0)
THEN
827 CALL para_env%isend(weights_local(1:nexcs_local), para_env%source, send_handler, 1)
829 CALL para_env%isend(inds_local(1:nexcs_local), para_env%source, send_handler2, 2)
831 CALL send_handler%wait()
832 CALL send_handler2%wait()
838 IF (para_env%is_source() .AND. log_unit > 0)
THEN
839 weights_neg_abs_recv(:) = -abs(weights_recv)
840 CALL sort(weights_neg_abs_recv, int(nexcs), inds)
842 WRITE (log_unit,
'(T7,I8,F10.5,A)') istate, evals(istate)*
evolt,
" eV"
845 ind = inds_recv(inds(iexc)) - 1
847 IF (ind < nmo_virt_occ_alpha)
THEN
852 ind = ind - nmo_virt_occ_alpha
857 imo_occ = ind/nmo_virt8(state_spin) + 1
858 imo_virt = mod(ind, nmo_virt8(state_spin)) + 1
860 WRITE (log_unit,
'(T27,I8,1X,A5,T48,I8,1X,A5,T70,F9.6)') imo_occ, spin_label, &
861 nmo_occ8(state_spin) + imo_virt, spin_label, weights_recv(inds(iexc))
866 IF (para_env%is_source()) &
867 DEALLOCATE (weights_recv, weights_neg_abs_recv, inds_recv, inds)
870 DEALLOCATE (weights_local, inds_local)
871 IF (log_unit > 0)
THEN
872 WRITE (log_unit,
"(1X,A)") &
873 "-------------------------------------------------------------------------------"
877 CALL cp_fm_release(weights_fm)
878 CALL cp_fm_release(s_mos_virt)
880 CALL timestop(handle)
898 TYPE(qs_environment_type),
POINTER :: qs_env
899 TYPE(cp_fm_type),
DIMENSION(:, :),
INTENT(in) :: evects
900 REAL(kind=
dp),
DIMENSION(:),
INTENT(in) :: evals, ostrength
901 TYPE(tddfpt_ground_state_mos),
DIMENSION(:), &
903 TYPE(dbcsr_type),
POINTER :: matrix_s
904 TYPE(section_vals_type),
POINTER :: print_section
906 CHARACTER(LEN=*),
PARAMETER :: routinen =
'tddfpt_print_nto_analysis'
907 INTEGER,
PARAMETER :: ntomax = 10
909 CHARACTER(LEN=20),
DIMENSION(2) :: nto_name
910 INTEGER :: handle, i, ia, icg, iounit, ispin, &
911 istate, j, nao, nlist, nmax, nmo, &
912 nnto, nspins, nstates
913 INTEGER,
DIMENSION(2) :: iv
914 INTEGER,
DIMENSION(2, ntomax) :: ia_index
915 INTEGER,
DIMENSION(:),
POINTER :: slist, stride
916 LOGICAL :: append_cube, cube_file, explicit
917 REAL(kind=
dp) :: os_threshold, sume, threshold
918 REAL(kind=
dp),
ALLOCATABLE,
DIMENSION(:) :: eigvals
919 REAL(kind=
dp),
ALLOCATABLE,
DIMENSION(:, :) :: eigenvalues
920 REAL(kind=
dp),
DIMENSION(ntomax) :: ia_eval
921 TYPE(cp_fm_struct_type),
POINTER :: fm_mo_struct, fm_struct
922 TYPE(cp_fm_type) :: sev, smat, tmat, wmat, work, wvec
923 TYPE(cp_fm_type),
ALLOCATABLE,
DIMENSION(:) :: teig
924 TYPE(cp_logger_type),
POINTER :: logger
925 TYPE(mo_set_type),
ALLOCATABLE,
DIMENSION(:) :: nto_set
926 TYPE(particle_type),
DIMENSION(:),
POINTER :: particle_set
927 TYPE(qs_kind_type),
DIMENSION(:),
POINTER :: qs_kind_set
928 TYPE(section_vals_type),
POINTER :: molden_section, nto_section
930 CALL timeset(routinen, handle)
941 CALL section_vals_val_get(print_section,
"NTO_ANALYSIS%INTENSITY_THRESHOLD", r_val=os_threshold)
952 WRITE (iounit,
"(1X,A)")
"", &
953 "-------------------------------------------------------------------------------", &
954 "- Natural Orbital analysis -", &
955 "-------------------------------------------------------------------------------"
958 nspins =
SIZE(evects, 1)
959 nstates =
SIZE(evects, 2)
960 CALL dbcsr_get_info(matrix_s, nfullrows_total=nao)
962 DO istate = 1, nstates
963 IF (os_threshold > ostrength(istate))
THEN
965 WRITE (iounit,
"(1X,A,I6)")
" Skipping state ", istate
970 IF (.NOT. any(slist == istate))
THEN
972 WRITE (iounit,
"(1X,A,I6)")
" Skipping state ", istate
978 WRITE (iounit,
"(1X,A,I6,T30,F10.5,A)")
" STATE NR. ", istate, evals(istate)*
evolt,
" eV"
982 CALL cp_fm_get_info(evects(ispin, istate), matrix_struct=fm_struct, ncol_global=nmo)
983 nmax = max(nmax, nmo)
985 ALLOCATE (eigenvalues(nmax, nspins))
989 nto_name(1) =
'Hole_states'
990 nto_name(2) =
'Particle_states'
991 ALLOCATE (nto_set(2))
993 CALL allocate_mo_set(nto_set(i), nao, ntomax, 0, 0.0_dp, 1.0_dp, 0.0_dp)
998 CALL init_mo_set(nto_set(i), fm_ref=tmat, name=nto_name(i))
999 CALL cp_fm_release(tmat)
1003 ALLOCATE (teig(nspins))
1006 DO ispin = 1, nspins
1007 associate(ev => evects(ispin, istate))
1008 CALL cp_fm_get_info(ev, matrix_struct=fm_struct, ncol_global=nmo)
1011 nrow_global=nmo, ncol_global=nmo)
1015 CALL parallel_gemm(
'T',
'N', nmo, nmo, nao, 1.0_dp, ev, sev, 0.0_dp, tmat)
1021 CALL cp_fm_release(tmat)
1022 CALL cp_fm_release(sev)
1029 iv = maxloc(eigenvalues)
1030 ia_eval(i) = eigenvalues(iv(1), iv(2))
1031 ia_index(1:2, i) = iv(1:2)
1032 sume = sume + ia_eval(i)
1033 eigenvalues(iv(1), iv(2)) = 0.0_dp
1035 IF (sume > threshold)
EXIT
1041 ispin = ia_index(2, i)
1045 nrow_global=nmo, ncol_global=1)
1053 CALL cp_fm_to_fm(teig(ispin), tmat, 1, ia, 1)
1054 CALL parallel_gemm(
'N',
'N', nao, 1, nmo, 1.0_dp, gs_mos(ispin)%mos_occ, &
1056 CALL cp_fm_to_fm(wvec, nto_set(1)%mo_coeff, 1, 1, i)
1057 CALL cp_fm_release(wvec)
1058 CALL cp_fm_release(tmat)
1063 DO ispin = 1, nspins
1064 associate(ev => evects(ispin, istate))
1065 CALL cp_fm_get_info(ev, matrix_struct=fm_struct, nrow_global=nao, ncol_global=nmo)
1066 ALLOCATE (eigvals(nao))
1071 CALL cp_fm_struct_create(fmstruct=fm_mo_struct, template_fmstruct=fm_struct, &
1072 nrow_global=nao, ncol_global=nao)
1073 CALL cp_fm_create(tmat, fm_mo_struct)
1074 CALL cp_fm_create(smat, fm_mo_struct)
1075 CALL cp_fm_create(wmat, fm_mo_struct)
1076 CALL cp_fm_create(work, fm_mo_struct)
1077 CALL cp_fm_struct_release(fm_mo_struct)
1078 CALL copy_dbcsr_to_fm(matrix_s, smat)
1079 CALL parallel_gemm(
'N',
'T', nao, nao, nmo, 1.0_dp, sev, sev, 0.0_dp, tmat)
1080 CALL cp_fm_geeig(tmat, smat, wmat, eigvals, work)
1082 IF (ispin == ia_index(2, i))
THEN
1085 IF (abs(eigvals(j) - ia_eval(i)) < 1.e-6_dp)
THEN
1091 CALL cp_warn(__location__, &
1092 "Could not locate particle state associated with hole state.")
1094 CALL cp_fm_to_fm(wmat, nto_set(2)%mo_coeff, 1, icg, i)
1098 DEALLOCATE (eigvals)
1099 CALL cp_fm_release(sev)
1100 CALL cp_fm_release(tmat)
1101 CALL cp_fm_release(smat)
1102 CALL cp_fm_release(wmat)
1103 CALL cp_fm_release(work)
1106 IF (iounit > 0)
THEN
1109 sume = sume + ia_eval(i)
1110 WRITE (iounit,
"(T6,A,i2,T30,A,i1,T42,A,F8.5,T63,A,F8.5)") &
1111 "Particle-Hole state:", i,
" Spin:", ia_index(2, i), &
1112 "Eigenvalue:", ia_eval(i),
" Sum Eigv:", sume
1116 nto_section => section_vals_get_subs_vals(print_section,
"NTO_ANALYSIS")
1117 CALL section_vals_val_get(nto_section,
"CUBE_FILES", l_val=cube_file)
1118 CALL section_vals_val_get(nto_section,
"STRIDE", i_vals=stride)
1119 CALL section_vals_val_get(nto_section,
"APPEND", l_val=append_cube)
1121 CALL print_nto_cubes(qs_env, nto_set, istate, stride, append_cube, nto_section)
1123 CALL get_qs_env(qs_env, qs_kind_set=qs_kind_set, particle_set=particle_set)
1124 molden_section => section_vals_get_subs_vals(print_section,
"MOS_MOLDEN")
1125 CALL write_mos_molden(nto_set, qs_kind_set, particle_set, molden_section)
1127 DEALLOCATE (eigenvalues)
1128 CALL cp_fm_release(teig)
1131 CALL deallocate_mo_set(nto_set(i))
1133 DEALLOCATE (nto_set)
1136 IF (iounit > 0)
THEN
1137 WRITE (iounit,
"(1X,A)") &
1138 "-------------------------------------------------------------------------------"
1143 CALL timestop(handle)
1154 SUBROUTINE project_vector(vin, vout, mos_occ, matrix_s)
1155 TYPE(dbcsr_type) :: vin, vout
1156 TYPE(cp_fm_type),
INTENT(IN) :: mos_occ
1157 TYPE(dbcsr_type),
POINTER :: matrix_s
1159 CHARACTER(LEN=*),
PARAMETER :: routinen =
'project_vector'
1161 INTEGER :: handle, nao, nmo
1162 REAL(kind=dp) :: norm(1)
1163 TYPE(cp_fm_struct_type),
POINTER :: fm_struct, fm_vec_struct
1164 TYPE(cp_fm_type) :: csvec, svec, vec
1166 CALL timeset(routinen, handle)
1168 CALL cp_fm_get_info(mos_occ, matrix_struct=fm_struct, nrow_global=nao, ncol_global=nmo)
1169 CALL cp_fm_struct_create(fmstruct=fm_vec_struct, template_fmstruct=fm_struct, &
1170 nrow_global=nao, ncol_global=1)
1171 CALL cp_fm_create(vec, fm_vec_struct)
1172 CALL cp_fm_create(svec, fm_vec_struct)
1173 CALL cp_fm_struct_release(fm_vec_struct)
1174 CALL cp_fm_struct_create(fmstruct=fm_vec_struct, template_fmstruct=fm_struct, &
1175 nrow_global=nmo, ncol_global=1)
1176 CALL cp_fm_create(csvec, fm_vec_struct)
1177 CALL cp_fm_struct_release(fm_vec_struct)
1179 CALL copy_dbcsr_to_fm(vin, vec)
1180 CALL cp_dbcsr_sm_fm_multiply(matrix_s, vec, svec, ncol=1, alpha=1.0_dp, beta=0.0_dp)
1181 CALL parallel_gemm(
'T',
'N', nmo, 1, nao, 1.0_dp, mos_occ, svec, 0.0_dp, csvec)
1182 CALL parallel_gemm(
'N',
'N', nao, 1, nmo, -1.0_dp, mos_occ, csvec, 1.0_dp, vec)
1183 CALL cp_fm_vectorsnorm(vec, norm)
1184 cpassert(norm(1) > 1.e-14_dp)
1185 norm(1) = sqrt(1._dp/norm(1))
1186 CALL cp_fm_scale(norm(1), vec)
1187 CALL copy_fm_to_dbcsr(vec, vout, keep_sparsity=.false.)
1189 CALL cp_fm_release(csvec)
1190 CALL cp_fm_release(svec)
1191 CALL cp_fm_release(vec)
1193 CALL timestop(handle)
1195 END SUBROUTINE project_vector
1203 SUBROUTINE vec_product(va, vb, res)
1204 TYPE(dbcsr_type) :: va, vb
1205 REAL(kind=dp),
INTENT(OUT) :: res
1207 CHARACTER(LEN=*),
PARAMETER :: routinen =
'vec_product'
1209 INTEGER :: blk, group_handle, handle, icol, irow
1211 REAL(kind=dp),
DIMENSION(:, :),
POINTER :: vba, vbb
1212 TYPE(dbcsr_iterator_type) :: iter
1213 TYPE(mp_comm_type) :: group
1215 CALL timeset(routinen, handle)
1219 CALL dbcsr_get_info(va, group=group_handle)
1220 CALL group%set_handle(group_handle)
1221 CALL dbcsr_iterator_start(iter, va)
1222 DO WHILE (dbcsr_iterator_blocks_left(iter))
1223 CALL dbcsr_iterator_next_block(iter, irow, icol, vba, blk)
1224 CALL dbcsr_get_block_p(vb, row=irow, col=icol, block=vbb, found=found)
1225 res = res + sum(vba*vbb)
1228 CALL dbcsr_iterator_stop(iter)
1231 CALL timestop(handle)
1233 END SUBROUTINE vec_product
1244 SUBROUTINE print_nto_cubes(qs_env, mos, istate, stride, append_cube, print_section)
1246 TYPE(qs_environment_type),
POINTER :: qs_env
1247 TYPE(mo_set_type),
DIMENSION(:),
INTENT(IN) :: mos
1248 INTEGER,
INTENT(IN) :: istate
1249 INTEGER,
DIMENSION(:),
POINTER :: stride
1250 LOGICAL,
INTENT(IN) :: append_cube
1251 TYPE(section_vals_type),
POINTER :: print_section
1253 CHARACTER(LEN=default_path_length) :: filename, my_pos_cube, title
1254 INTEGER :: i, iset, nmo, unit_nr
1256 TYPE(atomic_kind_type),
DIMENSION(:),
POINTER :: atomic_kind_set
1257 TYPE(cell_type),
POINTER :: cell
1258 TYPE(cp_fm_type),
POINTER :: mo_coeff
1259 TYPE(cp_logger_type),
POINTER :: logger
1260 TYPE(dft_control_type),
POINTER :: dft_control
1261 TYPE(particle_list_type),
POINTER :: particles
1262 TYPE(particle_type),
DIMENSION(:),
POINTER :: particle_set
1263 TYPE(pw_c1d_gs_type) :: wf_g
1264 TYPE(pw_env_type),
POINTER :: pw_env
1265 TYPE(pw_pool_p_type),
DIMENSION(:),
POINTER :: pw_pools
1266 TYPE(pw_pool_type),
POINTER :: auxbas_pw_pool
1267 TYPE(pw_r3d_rs_type) :: wf_r
1268 TYPE(qs_kind_type),
DIMENSION(:),
POINTER :: qs_kind_set
1269 TYPE(qs_subsys_type),
POINTER :: subsys
1271 logger => cp_get_default_logger()
1273 CALL get_qs_env(qs_env=qs_env, dft_control=dft_control, pw_env=pw_env)
1274 CALL pw_env_get(pw_env, auxbas_pw_pool=auxbas_pw_pool, pw_pools=pw_pools)
1275 CALL auxbas_pw_pool%create_pw(wf_r)
1276 CALL auxbas_pw_pool%create_pw(wf_g)
1278 CALL get_qs_env(qs_env, subsys=subsys)
1279 CALL qs_subsys_get(subsys, particles=particles)
1281 my_pos_cube =
"REWIND"
1282 IF (append_cube)
THEN
1283 my_pos_cube =
"APPEND"
1286 CALL get_qs_env(qs_env=qs_env, &
1287 atomic_kind_set=atomic_kind_set, &
1288 qs_kind_set=qs_kind_set, &
1290 particle_set=particle_set)
1293 CALL get_mo_set(mo_set=mos(iset), mo_coeff=mo_coeff, nmo=nmo)
1295 CALL calculate_wavefunction(mo_coeff, i, wf_r, wf_g, atomic_kind_set, qs_kind_set, &
1296 cell, dft_control, particle_set, pw_env)
1298 WRITE (filename,
'(a4,I3.3,I2.2,a11)')
"NTO_STATE", istate, i,
"_Hole_State"
1299 ELSEIF (iset == 2)
THEN
1300 WRITE (filename,
'(a4,I3.3,I2.2,a15)')
"NTO_STATE", istate, i,
"_Particle_State"
1303 unit_nr = cp_print_key_unit_nr(logger, print_section,
'', extension=
".cube", &
1304 middle_name=trim(filename), file_position=my_pos_cube, &
1305 log_filename=.false., ignore_should_output=.true., mpi_io=mpi_io)
1307 WRITE (title, *)
"Natural Transition Orbital Hole State", i
1308 ELSEIF (iset == 2)
THEN
1309 WRITE (title, *)
"Natural Transition Orbital Particle State", i
1311 CALL cp_pw_to_cube(wf_r, unit_nr, title, particles=particles, stride=stride, mpi_io=mpi_io)
1312 CALL cp_print_key_finished_output(unit_nr, logger, print_section,
'', &
1313 ignore_should_output=.true., mpi_io=mpi_io)
1317 CALL auxbas_pw_pool%give_back_pw(wf_g)
1318 CALL auxbas_pw_pool%give_back_pw(wf_r)
1320 END SUBROUTINE print_nto_cubes
Define the atomic kind types and their sub types.
collects all references to literature in CP2K as new algorithms / method are included from literature...
integer, save, public martin2003
Handles all functions related to the CELL.
methods related to the blacs parallel environment
Basic linear algebra operations for complex full matrices.
subroutine, public cp_cfm_solve(matrix_a, general_a, determinant)
Solve the system of linear equations A*b=A_general using LU decomposition. Pay attention that both ma...
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...
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_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_scale(alpha, matrix_a)
scales a matrix matrix_a = alpha * matrix_b
used for collecting some of the diagonalization schemes available for cp_fm_type. cp_fm_power also mo...
subroutine, public cp_fm_geeig(amatrix, bmatrix, eigenvectors, eigenvalues, work)
General Eigenvalue Problem AX = BXE Single option version: Cholesky decomposition of B.
subroutine, public choose_eigv_solver(matrix, eigenvectors, eigenvalues, info)
Choose the Eigensolver depending on which library is available ELPA seems to be unstable for small sy...
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_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_vectorsnorm(matrix, norm_array)
find the inorm of each column norm_{j}= sqrt( \sum_{i} A_{ij}*A_{ij} )
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
various routines to log and control the output. The idea is that decisions about where to log should ...
integer function, public cp_logger_get_default_io_unit(logger)
returns the unit nr for the ionode (-1 on all other processors) skips as well checks if the procs cal...
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)
...
subroutine, public cp_print_key_finished_output(unit_nr, logger, basis_section, print_key_path, local, ignore_should_output, on_file, mpi_io)
should be called after you finish working with a unit obtained with cp_print_key_unit_nr,...
integer, parameter, public cp_p_file
integer function, public cp_print_key_should_output(iteration_info, basis_section, print_key_path, used_print_key, first_time)
returns what should be done with the given property if btest(res,cp_p_store) then the property should...
A wrapper around pw_to_cube() which accepts particle_list_type.
subroutine, public cp_pw_to_cube(pw, unit_nr, title, particles, stride, zero_tails, silent, mpi_io)
...
sums arrays of real/complex numbers with much reduced round-off as compared to a naive implementation...
Defines the basic variable types.
integer, parameter, public int_8
integer, parameter, public dp
integer, parameter, public default_path_length
Definition of mathematical constants and functions.
complex(kind=dp), parameter, public z_one
real(kind=dp), parameter, public twopi
complex(kind=dp), parameter, public z_zero
Interface to the message passing library MPI.
Functions handling the MOLDEN format. Split from mode_selective.
subroutine, public write_mos_molden(mos, qs_kind_set, particle_set, print_section)
Write out the MOs in molden format for visualisation.
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
represent a simple array based list of the given type
Define the data structure for the particle information.
Definition of physical constants:
real(kind=dp), parameter, public evolt
container for various plainwaves related things
subroutine, public pw_env_get(pw_env, pw_pools, cube_info, gridlevel_info, auxbas_pw_pool, auxbas_grid, auxbas_rs_desc, auxbas_rs_grid, rs_descs, rs_grids, xc_pw_pool, vdw_pw_pool, poisson_env, interp_section)
returns the various attributes of the pw env
functions related to the poisson solver on regular grids
Manages a pool of grids (to be used for example as tmp objects), but can also be used to instantiate ...
Calculate the plane wave density by collocating the primitive Gaussian functions (pgf).
subroutine, public calculate_wavefunction(mo_vectors, ivector, rho, rho_gspace, atomic_kind_set, qs_kind_set, cell, dft_control, particle_set, pw_env, basis_type, external_vector)
maps a given wavefunction on the grid
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.
Define the quickstep kind type and their sub types.
Definition and initialisation of the mo data type.
subroutine, public set_mo_set(mo_set, maxocc, homo, lfomo, nao, nelectron, n_el_f, nmo, eigenvalues, occupation_numbers, uniform_occupation, kTS, mu, flexible_electron_count)
Set the components of a MO set data structure.
subroutine, public allocate_mo_set(mo_set, nao, nmo, nelectron, n_el_f, maxocc, flexible_electron_count)
Allocates a mo set and partially initializes it (nao,nmo,nelectron, and flexible_electron_count are v...
subroutine, public deallocate_mo_set(mo_set)
Deallocate a wavefunction data structure.
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 init_mo_set(mo_set, fm_pool, fm_ref, fm_struct, name)
initializes an allocated mo_set. eigenvalues, mo_coeff, occupation_numbers are valid only after this ...
Calculates the moment integrals <a|r^m|b> and <a|r x d/dr|b>
subroutine, public build_berry_moment_matrix(qs_env, cosmat, sinmat, kvec, sab_orb_external, basis_type)
...
Define the neighbor list data types and the corresponding functionality.
subroutine, public rrc_xyz_ao(op, qs_env, rc, order, minimum_image, soft)
Calculation of the components of the dipole operator in the length form by taking the relative positi...
Calculation of overlap matrix, its derivatives and forces.
subroutine, public build_overlap_matrix(ks_env, matrix_s, matrixkp_s, matrix_name, nderivative, basis_type_a, basis_type_b, sab_nl, calculate_forces, matrix_p, matrixkp_p)
Calculation of the overlap matrix over Cartesian Gaussian functions.
types that represent a quickstep subsys
subroutine, public qs_subsys_get(subsys, atomic_kinds, atomic_kind_set, particles, particle_set, local_particles, molecules, molecule_set, molecule_kinds, molecule_kind_set, local_molecules, para_env, colvar_p, shell_particles, core_particles, gci, multipoles, natom, nparticle, ncore, nshell, nkind, atprop, virial, results, cell, cell_ref, use_ref_cell, energy, force, qs_kind_set, cp_subsys, nelectron_total, nelectron_spin)
...
subroutine, public tddfpt_print_excitation_analysis(log_unit, evects, evals, gs_mos, matrix_s, min_amplitude)
Print excitation analysis.
subroutine, public tddfpt_dipole_operator(dipole_op_mos_occ, tddfpt_control, gs_mos, qs_env)
Compute the action of the dipole operator on the ground state wave function.
subroutine, public tddfpt_print_nto_analysis(qs_env, evects, evals, ostrength, gs_mos, matrix_s, print_section)
Print natural transition orbital analysis.
subroutine, public tddfpt_print_summary(log_unit, evects, evals, ostrength, mult, dipole_op_mos_occ, dipole_form)
Print final TDDFPT excitation energies and oscillator strengths.
Utilities for string manipulations.
subroutine, public integer_to_string(inumber, string)
Converts an integer number to a string. The WRITE statement will return an error message,...
All kind of helpful little routines.