53#include "./base/base_uses.f90"
58 PUBLIC :: prepare_per_atom_vcd
59 PUBLIC :: vcd_build_op_dv
60 PUBLIC :: vcd_response_dv
64 CHARACTER(len=*),
PARAMETER,
PRIVATE :: moduleN =
'qs_vcd'
66 REAL(dp),
DIMENSION(3, 3, 3),
PARAMETER :: Levi_Civita = reshape([ &
67 0.0_dp, 0.0_dp, 0.0_dp, 0.0_dp, 0.0_dp, -1.0_dp, 0.0_dp, 1.0_dp, 0.0_dp, &
68 0.0_dp, 0.0_dp, 1.0_dp, 0.0_dp, 0.0_dp, 0.0_dp, -1.0_dp, 0.0_dp, 0.0_dp, &
69 0.0_dp, -1.0_dp, 0.0_dp, 1.0_dp, 0.0_dp, 0.0_dp, 0.0_dp, 0.0_dp, 0.0_dp], &
71 INTEGER,
DIMENSION(3, 3),
PARAMETER :: multipole_2d_to_1d = reshape([4, 5, 6, 5, 7, 8, 6, 8, 9], [3, 3])
81 SUBROUTINE aat_dv(vcd_env, qs_env)
82 TYPE(vcd_env_type) :: vcd_env
83 TYPE(qs_environment_type),
POINTER :: qs_env
85 CHARACTER(LEN=*),
PARAMETER :: routineN =
'aat_dV'
86 INTEGER,
PARAMETER :: ispin = 1
88 INTEGER :: alpha, delta, gamma, handle, ikind, &
89 my_index, nao, nmo, nspins
91 REAL(dp) :: aat_prefactor, aat_tmp, charge, lc_tmp, &
93 REAL(dp),
DIMENSION(3, 3) :: aat_tmp_33
94 TYPE(cp_fm_type) :: tmp_aomo
95 TYPE(dft_control_type),
POINTER :: dft_control
96 TYPE(neighbor_list_set_p_type),
DIMENSION(:), &
97 POINTER :: sab_all, sab_orb, sap_ppnl
98 TYPE(particle_type),
DIMENSION(:),
POINTER :: particle_set
99 TYPE(qs_kind_type),
DIMENSION(:),
POINTER :: qs_kind_set
101 CALL timeset(routinen, handle)
104 dft_control=dft_control, &
108 particle_set=particle_set, &
109 qs_kind_set=qs_kind_set)
111 CALL cp_fm_create(tmp_aomo, vcd_env%dcdr_env%likemos_fm_struct(ispin)%struct)
113 nspins = dft_control%nspins
114 nmo = vcd_env%dcdr_env%nmo(ispin)
115 nao = vcd_env%dcdr_env%nao
116 associate(mo_coeff => vcd_env%dcdr_env%mo_coeff(ispin), aat_atom => vcd_env%aat_atom_nvpt)
119 aat_prefactor = 1.0_dp
120 IF (nspins == 1) aat_prefactor = aat_prefactor*2.0_dp
140 my_index = multipole_2d_to_1d(vcd_env%dcdr_env%beta,
gamma)
144 CALL dbcsr_copy(vcd_env%dcdr_env%matrix_nosym_temp(1)%matrix, &
145 vcd_env%moments_der_right(my_index, delta)%matrix)
146 CALL dbcsr_add(vcd_env%dcdr_env%matrix_nosym_temp(1)%matrix, &
147 vcd_env%moments_der_left(my_index, delta)%matrix, &
161 lc_tmp = levi_civita(alpha,
gamma, delta)
162 IF (lc_tmp == 0._dp) cycle
167 aat_tmp = aat_tmp + lc_tmp*aat_prefactor*aat_tmp_33(
gamma, delta)
171 aat_atom(vcd_env%dcdr_env%beta, alpha, vcd_env%dcdr_env%lambda) &
172 = aat_atom(vcd_env%dcdr_env%beta, alpha, vcd_env%dcdr_env%lambda) + aat_tmp
182 lc_tmp = levi_civita(alpha,
gamma, vcd_env%dcdr_env%beta)
183 IF (lc_tmp == 0._dp) cycle
187 vcd_env%dcdr_env%matrix_nosym_temp(1)%matrix)
188 CALL hr_mult_by_delta_1d(vcd_env%dcdr_env%matrix_nosym_temp(1)%matrix, qs_kind_set,
"ORB", &
189 sab_all, direction_or=.true., lambda=vcd_env%dcdr_env%lambda)
193 aat_tmp = aat_tmp - lc_tmp*aat_prefactor*tmp_trace
196 aat_atom(vcd_env%dcdr_env%beta, alpha, vcd_env%dcdr_env%lambda) &
197 = aat_atom(vcd_env%dcdr_env%beta, alpha, vcd_env%dcdr_env%lambda) + aat_tmp
206 lc_tmp = levi_civita(alpha,
gamma, delta)
207 IF (lc_tmp == 0._dp) cycle
210 CALL cp_fm_trace(tmp_aomo, vcd_env%dCV_prime(ispin), tmp_trace)
215 aat_tmp = aat_tmp - 2._dp*aat_prefactor*tmp_trace*lc_tmp
219 aat_atom(vcd_env%dcdr_env%beta, alpha, vcd_env%dcdr_env%lambda) &
220 = aat_atom(vcd_env%dcdr_env%beta, alpha, vcd_env%dcdr_env%lambda) + aat_tmp
232 CALL dbcsr_copy(vcd_env%dcdr_env%matrix_nosym_temp(1)%matrix, &
233 vcd_env%matrix_r_rxvr(alpha, vcd_env%dcdr_env%beta)%matrix)
234 CALL hr_mult_by_delta_1d(vcd_env%dcdr_env%matrix_nosym_temp(1)%matrix, qs_kind_set,
"ORB", &
235 sab_all, direction_or=.false., lambda=vcd_env%dcdr_env%lambda)
239 aat_tmp = -aat_prefactor*aat_tmp
241 aat_atom(vcd_env%dcdr_env%beta, alpha, vcd_env%dcdr_env%lambda) &
242 = aat_atom(vcd_env%dcdr_env%beta, alpha, vcd_env%dcdr_env%lambda) + aat_tmp
248 CALL dbcsr_copy(vcd_env%dcdr_env%matrix_nosym_temp(1)%matrix, vcd_env%matrix_rxvr_r(alpha, vcd_env%dcdr_env%beta)%matrix)
249 CALL hr_mult_by_delta_1d(vcd_env%dcdr_env%matrix_nosym_temp(1)%matrix, qs_kind_set,
"ORB", &
250 sab_all, direction_or=.true., lambda=vcd_env%dcdr_env%lambda)
254 aat_tmp = aat_prefactor*aat_tmp
256 aat_atom(vcd_env%dcdr_env%beta, alpha, vcd_env%dcdr_env%lambda) &
257 = aat_atom(vcd_env%dcdr_env%beta, alpha, vcd_env%dcdr_env%lambda) + aat_tmp
265 mo_coeff, tmp_aomo, ncol=nmo)
267 aat_tmp = -aat_prefactor*aat_tmp
269 aat_atom(vcd_env%dcdr_env%beta, alpha, vcd_env%dcdr_env%lambda) &
270 = aat_atom(vcd_env%dcdr_env%beta, alpha, vcd_env%dcdr_env%lambda) + aat_tmp
276 CALL cp_fm_trace(tmp_aomo, vcd_env%dCV_prime(ispin), aat_tmp)
279 aat_tmp = 2._dp*aat_prefactor*aat_tmp
281 aat_atom(vcd_env%dcdr_env%beta, alpha, vcd_env%dcdr_env%lambda) &
282 = aat_atom(vcd_env%dcdr_env%beta, alpha, vcd_env%dcdr_env%lambda) &
293 lc_tmp = levi_civita(alpha,
gamma, delta)
294 IF (lc_tmp == 0._dp) cycle
297 CALL cp_fm_trace(tmp_aomo, vcd_env%dCV_prime(ispin), tmp_trace)
301 aat_tmp = aat_tmp + 2._dp*aat_prefactor*tmp_trace*lc_tmp*(-vcd_env%magnetic_origin_atom(
gamma))
305 aat_atom(vcd_env%dcdr_env%beta, alpha, vcd_env%dcdr_env%lambda) &
306 = aat_atom(vcd_env%dcdr_env%beta, alpha, vcd_env%dcdr_env%lambda) + aat_tmp
314 lc_tmp = levi_civita(alpha,
gamma, delta)
315 IF (lc_tmp == 0._dp) cycle
319 CALL cp_fm_trace(tmp_aomo, vcd_env%dCV_prime(ispin), tmp_trace)
322 aat_tmp = aat_tmp + 2._dp*aat_prefactor*tmp_trace*lc_tmp*(-vcd_env%magnetic_origin_atom(
gamma))
326 aat_atom(vcd_env%dcdr_env%beta, alpha, vcd_env%dcdr_env%lambda) &
327 = aat_atom(vcd_env%dcdr_env%beta, alpha, vcd_env%dcdr_env%lambda) + aat_tmp
340 lc_tmp = levi_civita(alpha,
gamma, delta)
341 IF (lc_tmp == 0._dp) cycle
351 aat_tmp = aat_tmp - lc_tmp*aat_prefactor*tmp_trace*(-vcd_env%magnetic_origin_atom(
gamma))
362 aat_tmp = aat_tmp - lc_tmp*aat_prefactor*tmp_trace*(-vcd_env%spatial_origin_atom(vcd_env%dcdr_env%beta))
367 CALL dbcsr_desymmetrize(vcd_env%dipvel_ao(delta)%matrix, vcd_env%dcdr_env%matrix_nosym_temp(1)%matrix)
368 CALL dbcsr_desymmetrize(vcd_env%dipvel_ao(delta)%matrix, vcd_env%dcdr_env%matrix_nosym_temp(2)%matrix)
369 CALL hr_mult_by_delta_1d(vcd_env%dcdr_env%matrix_nosym_temp(1)%matrix, qs_kind_set,
"ORB", &
370 sab_all, direction_or=.false., lambda=vcd_env%dcdr_env%lambda)
371 CALL hr_mult_by_delta_1d(vcd_env%dcdr_env%matrix_nosym_temp(2)%matrix, qs_kind_set,
"ORB", &
372 sab_all, direction_or=.true., lambda=vcd_env%dcdr_env%lambda)
373 CALL dbcsr_add(vcd_env%dcdr_env%matrix_nosym_temp(1)%matrix, vcd_env%dcdr_env%matrix_nosym_temp(2)%matrix, &
378 aat_tmp = aat_tmp + lc_tmp*aat_prefactor*tmp_trace* &
379 (vcd_env%spatial_origin_atom(vcd_env%dcdr_env%beta)*vcd_env%magnetic_origin_atom(
gamma))
384 aat_atom(vcd_env%dcdr_env%beta, alpha, vcd_env%dcdr_env%lambda) &
385 = aat_atom(vcd_env%dcdr_env%beta, alpha, vcd_env%dcdr_env%lambda) + aat_tmp
393 lc_tmp = levi_civita(alpha,
gamma, vcd_env%dcdr_env%beta)
394 IF (lc_tmp == 0._dp) cycle
395 CALL dbcsr_set(vcd_env%dcdr_env%matrix_nosym_temp(vcd_env%dcdr_env%beta)%matrix, 0.0_dp)
396 CALL dbcsr_desymmetrize(vcd_env%dcdr_env%matrix_s1(1)%matrix, vcd_env%dcdr_env%matrix_nosym_temp(1)%matrix)
397 CALL hr_mult_by_delta_1d(vcd_env%dcdr_env%matrix_nosym_temp(1)%matrix, qs_kind_set,
"ORB", sab_all, &
398 vcd_env%dcdr_env%lambda, direction_or=.true.)
405 aat_tmp = aat_tmp + lc_tmp*aat_prefactor*tmp_trace*vcd_env%magnetic_origin_atom(
gamma)
408 aat_atom(vcd_env%dcdr_env%beta, alpha, vcd_env%dcdr_env%lambda) &
409 = aat_atom(vcd_env%dcdr_env%beta, alpha, vcd_env%dcdr_env%lambda) + aat_tmp
420 CALL dbcsr_set(vcd_env%dcdr_env%matrix_nosym_temp(1)%matrix, 0._dp)
424 lc_tmp = levi_civita(alpha,
gamma, delta)
425 IF (lc_tmp == 0._dp) cycle
434 CALL dbcsr_copy(vcd_env%dcdr_env%matrix_nosym_temp(1)%matrix, &
435 vcd_env%matrix_rrcom(delta, vcd_env%dcdr_env%beta)%matrix)
436 CALL hr_mult_by_delta_1d(vcd_env%dcdr_env%matrix_nosym_temp(1)%matrix, qs_kind_set,
"ORB", &
437 sab_all, direction_or=.false., lambda=vcd_env%dcdr_env%lambda)
441 aat_tmp = aat_tmp + aat_prefactor*tmp_trace*lc_tmp*vcd_env%magnetic_origin_atom(
gamma)
449 CALL dbcsr_copy(vcd_env%dcdr_env%matrix_nosym_temp(1)%matrix, vcd_env%matrix_rrcom(delta,
gamma)%matrix)
450 CALL hr_mult_by_delta_1d(vcd_env%dcdr_env%matrix_nosym_temp(1)%matrix, qs_kind_set,
"ORB", &
451 sab_all, direction_or=.false., lambda=vcd_env%dcdr_env%lambda)
454 aat_tmp = aat_tmp + aat_prefactor*tmp_trace*lc_tmp*vcd_env%spatial_origin_atom(vcd_env%dcdr_env%beta)
459 CALL dbcsr_desymmetrize(vcd_env%hcom(delta)%matrix, vcd_env%dcdr_env%matrix_nosym_temp(1)%matrix)
460 CALL hr_mult_by_delta_1d(vcd_env%dcdr_env%matrix_nosym_temp(1)%matrix, qs_kind_set,
"ORB", &
461 sab_all, direction_or=.false., lambda=vcd_env%dcdr_env%lambda)
465 aat_tmp = aat_tmp + &
466 aat_prefactor*tmp_trace*lc_tmp &
467 *(vcd_env%spatial_origin_atom(vcd_env%dcdr_env%beta)*vcd_env%magnetic_origin_atom(
gamma))
471 aat_atom(vcd_env%dcdr_env%beta, alpha, vcd_env%dcdr_env%lambda) &
472 = aat_atom(vcd_env%dcdr_env%beta, alpha, vcd_env%dcdr_env%lambda) + aat_tmp
482 CALL dbcsr_set(vcd_env%dcdr_env%matrix_nosym_temp(1)%matrix, 0._dp)
486 lc_tmp = levi_civita(alpha,
gamma, delta)
487 IF (lc_tmp == 0._dp) cycle
496 CALL dbcsr_copy(vcd_env%dcdr_env%matrix_nosym_temp(1)%matrix, &
497 vcd_env%matrix_rcomr(delta, vcd_env%dcdr_env%beta)%matrix)
498 CALL hr_mult_by_delta_1d(vcd_env%dcdr_env%matrix_nosym_temp(1)%matrix, qs_kind_set,
"ORB", &
499 sab_all, direction_or=.true., lambda=vcd_env%dcdr_env%lambda)
503 aat_tmp = aat_tmp + aat_prefactor*tmp_trace*lc_tmp*(-vcd_env%magnetic_origin_atom(
gamma))
510 CALL dbcsr_copy(vcd_env%dcdr_env%matrix_nosym_temp(1)%matrix, vcd_env%matrix_rrcom(delta,
gamma)%matrix)
511 CALL hr_mult_by_delta_1d(vcd_env%dcdr_env%matrix_nosym_temp(1)%matrix, qs_kind_set,
"ORB", &
512 sab_all, direction_or=.true., lambda=vcd_env%dcdr_env%lambda)
516 aat_tmp = aat_tmp + aat_prefactor*tmp_trace*lc_tmp*(-vcd_env%spatial_origin_atom(vcd_env%dcdr_env%beta))
520 CALL dbcsr_desymmetrize(vcd_env%hcom(delta)%matrix, vcd_env%dcdr_env%matrix_nosym_temp(1)%matrix)
521 CALL hr_mult_by_delta_1d(vcd_env%dcdr_env%matrix_nosym_temp(1)%matrix, qs_kind_set,
"ORB", &
522 sab_all, direction_or=.true., lambda=vcd_env%dcdr_env%lambda)
527 aat_tmp = aat_tmp - &
528 aat_prefactor*tmp_trace*lc_tmp* &
529 (vcd_env%spatial_origin_atom(vcd_env%dcdr_env%beta)*vcd_env%magnetic_origin_atom(
gamma))
533 aat_atom(vcd_env%dcdr_env%beta, alpha, vcd_env%dcdr_env%lambda) &
534 = aat_atom(vcd_env%dcdr_env%beta, alpha, vcd_env%dcdr_env%lambda) + aat_tmp
544 lc_tmp = levi_civita(alpha,
gamma, delta)
545 IF (lc_tmp == 0._dp) cycle
549 mo_coeff, tmp_aomo, ncol=nmo)
552 aat_tmp = aat_tmp + aat_prefactor*tmp_trace*lc_tmp*(-vcd_env%magnetic_origin_atom(
gamma))
556 aat_atom(vcd_env%dcdr_env%beta, alpha, vcd_env%dcdr_env%lambda) &
557 = aat_atom(vcd_env%dcdr_env%beta, alpha, vcd_env%dcdr_env%lambda) + aat_tmp
561 CALL get_atomic_kind(particle_set(vcd_env%dcdr_env%lambda)%atomic_kind, kind_number=ikind)
562 CALL get_qs_kind(qs_kind_set(ikind), core_charge=charge, ghost=ghost)
563 IF (.NOT. ghost)
THEN
567 IF (levi_civita(alpha,
gamma, vcd_env%dcdr_env%beta) == 0._dp) cycle
568 aat_tmp = aat_tmp + charge &
569 *levi_civita(alpha,
gamma, vcd_env%dcdr_env%beta) &
570 *(particle_set(vcd_env%dcdr_env%lambda)%r(
gamma) - vcd_env%magnetic_origin_atom(
gamma))
572 aat_atom(vcd_env%dcdr_env%beta, alpha, vcd_env%dcdr_env%lambda) &
573 = aat_atom(vcd_env%dcdr_env%beta, alpha, vcd_env%dcdr_env%lambda) + aat_tmp
580 CALL timestop(handle)
581 END SUBROUTINE aat_dv
590 SUBROUTINE apt_dv(vcd_env, qs_env)
591 TYPE(vcd_env_type) :: vcd_env
592 TYPE(qs_environment_type),
POINTER :: qs_env
594 CHARACTER(LEN=*),
PARAMETER :: routineN =
'apt_dV'
595 INTEGER,
PARAMETER :: ispin = 1
596 REAL(dp),
PARAMETER :: f_spin = 2._dp
598 INTEGER :: alpha, handle, ikind, nao, nmo
601 REAL(KIND=dp) :: apt_dcom, apt_difdip, apt_dipvel, &
603 TYPE(cp_fm_type) :: buf, matrix_dSdV_mo
604 TYPE(neighbor_list_set_p_type),
DIMENSION(:), &
606 TYPE(particle_type),
DIMENSION(:),
POINTER :: particle_set
607 TYPE(qs_kind_type),
DIMENSION(:),
POINTER :: qs_kind_set
609 CALL timeset(routinen, handle)
611 CALL get_qs_env(qs_env=qs_env, &
613 particle_set=particle_set, &
614 qs_kind_set=qs_kind_set)
616 nmo = vcd_env%dcdr_env%nmo(ispin)
617 nao = vcd_env%dcdr_env%nao
619 associate(apt_el => vcd_env%apt_el_nvpt, &
620 apt_nuc => vcd_env%apt_nuc_nvpt, &
621 apt_total => vcd_env%apt_total_nvpt, &
622 mo_coeff => vcd_env%dcdr_env%mo_coeff(ispin), &
623 deltar => vcd_env%dcdr_env%deltaR)
626 CALL cp_fm_create(buf, vcd_env%dcdr_env%likemos_fm_struct(ispin)%struct, set_zero=.true.)
627 CALL cp_fm_create(matrix_dsdv_mo, vcd_env%dcdr_env%momo_fm_struct(ispin)%struct)
633 CALL cp_fm_scale_and_add(0._dp, vcd_env%dCV_prime(ispin), -1._dp, vcd_env%dCV(ispin))
636 CALL cp_dbcsr_sm_fm_multiply(vcd_env%matrix_dSdV(vcd_env%dcdr_env%beta)%matrix, mo_coeff, &
638 CALL parallel_gemm(
"T",
"N", nmo, nmo, nao, &
639 1.0_dp, mo_coeff, buf, &
640 0.0_dp, matrix_dsdv_mo)
642 CALL parallel_gemm(
"N",
"N", nao, nmo, nmo, &
643 -0.5_dp, mo_coeff, matrix_dsdv_mo, &
644 1.0_dp, vcd_env%dCV_prime(ispin))
648 CALL cp_fm_set_all(buf, 0.0_dp)
651 CALL cp_dbcsr_sm_fm_multiply(vcd_env%dipvel_ao(alpha)%matrix, mo_coeff, buf, ncol=nmo)
652 CALL cp_fm_trace(buf, vcd_env%dCV_prime(ispin), apt_dipvel)
655 apt_dipvel = 2._dp*apt_dipvel
656 apt_el(vcd_env%dcdr_env%beta, alpha, vcd_env%dcdr_env%lambda) &
657 = apt_el(vcd_env%dcdr_env%beta, alpha, vcd_env%dcdr_env%lambda) + f_spin*apt_dipvel
661 CALL cp_fm_set_all(buf, 0.0_dp)
663 CALL cp_dbcsr_sm_fm_multiply(vcd_env%hcom(alpha)%matrix, mo_coeff, buf, ncol=nmo)
664 CALL cp_fm_trace(buf, vcd_env%dCV_prime(ispin), apt_hcom)
668 apt_hcom = +2._dp*apt_hcom
670 apt_el(vcd_env%dcdr_env%beta, alpha, vcd_env%dcdr_env%lambda) &
671 = apt_el(vcd_env%dcdr_env%beta, alpha, vcd_env%dcdr_env%lambda) + f_spin*apt_hcom
676 CALL dbcsr_set(vcd_env%dcdr_env%matrix_nosym_temp(vcd_env%dcdr_env%beta)%matrix, 0.0_dp)
677 CALL dbcsr_desymmetrize(vcd_env%dcdr_env%matrix_s1(1)%matrix, &
678 vcd_env%dcdr_env%matrix_nosym_temp(vcd_env%dcdr_env%beta)%matrix)
679 CALL hr_mult_by_delta_1d(vcd_env%dcdr_env%matrix_nosym_temp(vcd_env%dcdr_env%beta)%matrix, qs_kind_set,
"ORB", sab_all, &
680 vcd_env%dcdr_env%lambda, direction_or=.true.)
682 CALL cp_dbcsr_sm_fm_multiply(vcd_env%dcdr_env%matrix_nosym_temp(vcd_env%dcdr_env%beta)%matrix, mo_coeff, &
683 buf, ncol=nmo, alpha=1._dp, beta=0._dp)
684 CALL cp_fm_trace(mo_coeff, buf, apt_difdip)
686 apt_difdip = -f_spin*apt_difdip
687 apt_el(vcd_env%dcdr_env%beta, vcd_env%dcdr_env%beta, vcd_env%dcdr_env%lambda) &
688 = apt_el(vcd_env%dcdr_env%beta, vcd_env%dcdr_env%beta, vcd_env%dcdr_env%lambda) + apt_difdip
694 CALL cp_dbcsr_sm_fm_multiply(vcd_env%matrix_difdip2(vcd_env%dcdr_env%beta, alpha)%matrix, mo_coeff, &
695 buf, ncol=nmo, alpha=1._dp, beta=0._dp)
697 CALL cp_fm_trace(mo_coeff, buf, apt_difdip)
698 apt_difdip = -f_spin*apt_difdip
699 apt_el(vcd_env%dcdr_env%beta, alpha, vcd_env%dcdr_env%lambda) &
700 = apt_el(vcd_env%dcdr_env%beta, alpha, vcd_env%dcdr_env%lambda) + apt_difdip
708 CALL dbcsr_copy(vcd_env%dcdr_env%matrix_nosym_temp(1)%matrix, vcd_env%matrix_rcomr(alpha, vcd_env%dcdr_env%beta)%matrix)
709 CALL dbcsr_copy(vcd_env%dcdr_env%matrix_nosym_temp(2)%matrix, vcd_env%matrix_rrcom(alpha, vcd_env%dcdr_env%beta)%matrix)
711 CALL hr_mult_by_delta_1d(vcd_env%dcdr_env%matrix_nosym_temp(1)%matrix, qs_kind_set,
"ORB", &
712 sab_all, direction_or=.true., lambda=vcd_env%dcdr_env%lambda)
713 CALL hr_mult_by_delta_1d(vcd_env%dcdr_env%matrix_nosym_temp(2)%matrix, qs_kind_set,
"ORB", &
714 sab_all, direction_or=.false., lambda=vcd_env%dcdr_env%lambda)
716 CALL dbcsr_add(vcd_env%dcdr_env%matrix_nosym_temp(1)%matrix, vcd_env%dcdr_env%matrix_nosym_temp(2)%matrix, &
719 CALL cp_fm_set_all(buf, 0.0_dp)
720 CALL cp_dbcsr_sm_fm_multiply(vcd_env%dcdr_env%matrix_nosym_temp(1)%matrix, mo_coeff, buf, ncol=nmo)
721 CALL cp_fm_trace(mo_coeff, buf, apt_rcom)
723 apt_el(vcd_env%dcdr_env%beta, alpha, vcd_env%dcdr_env%lambda) &
724 = apt_el(vcd_env%dcdr_env%beta, alpha, vcd_env%dcdr_env%lambda) + f_spin*apt_rcom
730 CALL cp_fm_set_all(buf, 0.0_dp)
731 CALL cp_dbcsr_sm_fm_multiply(vcd_env%matrix_dcom(alpha, vcd_env%dcdr_env%beta)%matrix, mo_coeff, buf, ncol=nmo)
732 CALL cp_fm_trace(mo_coeff, buf, apt_dcom)
733 apt_el(vcd_env%dcdr_env%beta, alpha, vcd_env%dcdr_env%lambda) &
734 = apt_el(vcd_env%dcdr_env%beta, alpha, vcd_env%dcdr_env%lambda) + f_spin*apt_dcom
742 CALL dbcsr_set(vcd_env%dcdr_env%matrix_nosym_temp(alpha)%matrix, 0._dp)
743 CALL dbcsr_set(vcd_env%dcdr_env%matrix_nosym_temp2(alpha)%matrix, 0._dp)
744 CALL dbcsr_desymmetrize(vcd_env%dcdr_env%matrix_s(alpha + 1)%matrix, vcd_env%dcdr_env%matrix_nosym_temp(alpha)%matrix)
745 CALL dbcsr_copy(vcd_env%dcdr_env%matrix_nosym_temp2(alpha)%matrix, vcd_env%dcdr_env%matrix_nosym_temp(alpha)%matrix)
748 CALL hr_mult_by_delta_1d(vcd_env%dcdr_env%matrix_nosym_temp(alpha)%matrix, qs_kind_set,
"ORB", sab_all, &
749 vcd_env%dcdr_env%lambda, direction_or=.true.)
751 CALL hr_mult_by_delta_1d(vcd_env%dcdr_env%matrix_nosym_temp2(alpha)%matrix, qs_kind_set,
"ORB", sab_all, &
752 vcd_env%dcdr_env%lambda, direction_or=.false.)
755 CALL dbcsr_add(vcd_env%dcdr_env%matrix_nosym_temp2(alpha)%matrix, vcd_env%dcdr_env%matrix_nosym_temp(alpha)%matrix, &
758 CALL cp_fm_set_all(buf, 0.0_dp)
759 CALL cp_dbcsr_sm_fm_multiply(vcd_env%dcdr_env%matrix_nosym_temp2(alpha)%matrix, mo_coeff, buf, ncol=nmo)
760 CALL cp_fm_trace(mo_coeff, buf, apt_difdip)
764 apt_difdip = -apt_difdip*vcd_env%spatial_origin_atom(vcd_env%dcdr_env%beta)
766 apt_el(vcd_env%dcdr_env%beta, alpha, vcd_env%dcdr_env%lambda) &
767 = apt_el(vcd_env%dcdr_env%beta, alpha, vcd_env%dcdr_env%lambda) + f_spin*apt_difdip
778 CALL dbcsr_set(vcd_env%dcdr_env%matrix_nosym_temp(alpha)%matrix, 0._dp)
779 CALL dbcsr_desymmetrize(vcd_env%hcom(alpha)%matrix, vcd_env%dcdr_env%matrix_nosym_temp(alpha)%matrix)
780 CALL dbcsr_copy(vcd_env%dcdr_env%matrix_nosym_temp2(alpha)%matrix, vcd_env%dcdr_env%matrix_nosym_temp(alpha)%matrix)
783 CALL hr_mult_by_delta_1d(vcd_env%dcdr_env%matrix_nosym_temp(alpha)%matrix, qs_kind_set,
"ORB", sab_all, &
784 vcd_env%dcdr_env%lambda, direction_or=.true.)
786 CALL hr_mult_by_delta_1d(vcd_env%dcdr_env%matrix_nosym_temp2(alpha)%matrix, qs_kind_set,
"ORB", sab_all, &
787 vcd_env%dcdr_env%lambda, direction_or=.false.)
789 CALL dbcsr_add(vcd_env%dcdr_env%matrix_nosym_temp(alpha)%matrix, &
790 vcd_env%dcdr_env%matrix_nosym_temp2(alpha)%matrix, -1._dp, +1._dp)
792 CALL cp_fm_set_all(buf, 0.0_dp)
793 CALL cp_dbcsr_sm_fm_multiply(vcd_env%dcdr_env%matrix_nosym_temp(alpha)%matrix, mo_coeff, buf, ncol=nmo)
794 CALL cp_fm_trace(mo_coeff, buf, apt_rcom)
795 apt_rcom = -vcd_env%spatial_origin_atom(vcd_env%dcdr_env%beta)*apt_rcom
797 apt_el(vcd_env%dcdr_env%beta, alpha, vcd_env%dcdr_env%lambda) &
798 = apt_el(vcd_env%dcdr_env%beta, alpha, vcd_env%dcdr_env%lambda) + f_spin*apt_rcom
802 associate(atomic_kind => particle_set(vcd_env%dcdr_env%lambda)%atomic_kind)
803 CALL get_atomic_kind(atomic_kind, kind_number=ikind)
804 CALL get_qs_kind(qs_kind_set(ikind), core_charge=charge, ghost=ghost)
805 IF (.NOT. ghost)
THEN
806 apt_nuc(vcd_env%dcdr_env%beta, vcd_env%dcdr_env%beta, vcd_env%dcdr_env%lambda) = &
807 apt_nuc(vcd_env%dcdr_env%beta, vcd_env%dcdr_env%beta, vcd_env%dcdr_env%lambda) + charge
812 CALL cp_fm_release(buf)
813 CALL cp_fm_release(matrix_dsdv_mo)
817 CALL timestop(handle)
818 END SUBROUTINE apt_dv
826 SUBROUTINE prepare_per_atom_vcd(vcd_env, qs_env)
827 TYPE(vcd_env_type) :: vcd_env
828 TYPE(qs_environment_type),
POINTER :: qs_env
830 CHARACTER(LEN=*),
PARAMETER :: routineN =
'prepare_per_atom_vcd'
832 INTEGER :: handle, i, ispin, j
833 TYPE(cell_type),
POINTER :: cell
834 TYPE(dft_control_type),
POINTER :: dft_control
835 TYPE(neighbor_list_set_p_type),
DIMENSION(:), &
836 POINTER :: sab_all, sab_orb, sap_ppnl
837 TYPE(particle_type),
DIMENSION(:),
POINTER :: particle_set
838 TYPE(qs_kind_type),
DIMENSION(:),
POINTER :: qs_kind_set
840 CALL timeset(routinen, handle)
842 CALL get_qs_env(qs_env=qs_env, dft_control=dft_control, &
843 sab_orb=sab_orb, sab_all=sab_all, sap_ppnl=sap_ppnl, &
844 qs_kind_set=qs_kind_set, particle_set=particle_set, cell=cell)
846 IF (vcd_env%distributed_origin)
THEN
847 vcd_env%magnetic_origin_atom(:) = particle_set(vcd_env%dcdr_env%lambda)%r(:) - vcd_env%magnetic_origin(:)
848 vcd_env%spatial_origin_atom = particle_set(vcd_env%dcdr_env%lambda)%r(:) - vcd_env%spatial_origin(:)
852 DO ispin = 1, dft_control%nspins
854 CALL dbcsr_set(vcd_env%matrix_dSdV(j)%matrix, 0._dp)
855 CALL dbcsr_set(vcd_env%matrix_drpnl(j)%matrix, 0._dp)
858 CALL dbcsr_set(vcd_env%matrix_dcom(i, j)%matrix, 0.0_dp)
859 CALL dbcsr_set(vcd_env%matrix_difdip2(i, j)%matrix, 0._dp)
862 CALL cp_fm_set_all(vcd_env%op_dV(ispin), 0._dp)
863 CALL dbcsr_set(vcd_env%matrix_hxc_dsdv(ispin)%matrix, 0._dp)
868 CALL build_dcom_rpnl(vcd_env%matrix_dcom, qs_kind_set, sab_orb, sap_ppnl, &
869 dft_control%qs_control%eps_ppnl, particle_set, vcd_env%dcdr_env%lambda)
873 CALL build_com_mom_nl(qs_kind_set, sab_all, sap_ppnl, dft_control%qs_control%eps_ppnl, &
874 particle_set, cell=cell, matrix_rv=vcd_env%matrix_drpnl, &
875 pseudoatom=vcd_env%dcdr_env%lambda)
877 CALL dbcsr_scale(vcd_env%matrix_drpnl(j)%matrix, alpha_scalar=-1._dp)
881 CALL dbcsr_set(vcd_env%dipvel_ao_delta(i)%matrix, 0._dp)
882 CALL dbcsr_copy(vcd_env%dipvel_ao_delta(i)%matrix, vcd_env%dipvel_ao(i)%matrix)
885 CALL hr_mult_by_delta_3d(vcd_env%dipvel_ao_delta, qs_kind_set,
"ORB", &
886 sab_all, vcd_env%dcdr_env%delta_basis_function, direction_or=.true.)
889 CALL build_dsdv_matrix(qs_env, vcd_env%matrix_dSdV, &
890 deltar=vcd_env%dcdr_env%delta_basis_function, &
891 rcc=vcd_env%spatial_origin_atom)
893 CALL build_local_moments_der_matrix(qs_env, vcd_env%matrix_difdip2, 1, 0, &
894 ref_point=[0._dp, 0._dp, 0._dp], basis_type=
"ORB", &
895 ordered=.true., lambda=vcd_env%dcdr_env%lambda)
904 CALL dbcsr_set(vcd_env%moments_der_right(i, j)%matrix, 0.0_dp)
905 CALL dbcsr_set(vcd_env%moments_der_left(i, j)%matrix, 0.0_dp)
911 CALL dbcsr_desymmetrize(vcd_env%moments_der(i, j)%matrix, vcd_env%moments_der_right(i, j)%matrix)
912 CALL dbcsr_desymmetrize(vcd_env%moments_der(i, j)%matrix, vcd_env%moments_der_left(i, j)%matrix)
915 CALL hr_mult_by_delta_1d(vcd_env%moments_der_right(i, j)%matrix, qs_kind_set,
"ORB", &
916 sab_all, direction_or=.true., lambda=vcd_env%dcdr_env%lambda)
917 CALL hr_mult_by_delta_1d(vcd_env%moments_der_left(i, j)%matrix, qs_kind_set,
"ORB", &
918 sab_all, direction_or=.false., lambda=vcd_env%dcdr_env%lambda)
924 CALL dbcsr_set(vcd_env%matrix_r_doublecom(i, j)%matrix, 0._dp)
928 CALL build_com_mom_nl(qs_kind_set, sab_all, sap_ppnl, dft_control%qs_control%eps_ppnl, &
929 particle_set, ref_point=[0._dp, 0._dp, 0._dp], cell=cell, &
930 matrix_r_doublecom=vcd_env%matrix_r_doublecom, &
931 pseudoatom=vcd_env%dcdr_env%lambda)
933 CALL timestop(handle)
935 END SUBROUTINE prepare_per_atom_vcd
957 SUBROUTINE vcd_build_op_dv(vcd_env, qs_env)
958 TYPE(vcd_env_type) :: vcd_env
959 TYPE(qs_environment_type),
POINTER :: qs_env
961 CHARACTER(LEN=*),
PARAMETER :: routineN =
'vcd_build_op_dV'
962 INTEGER,
PARAMETER :: ispin = 1
964 INTEGER :: handle, nao, nmo
965 TYPE(cp_fm_type) :: buf
966 TYPE(neighbor_list_set_p_type),
DIMENSION(:), &
968 TYPE(qs_kind_type),
DIMENSION(:),
POINTER :: qs_kind_set
970 CALL timeset(routinen, handle)
972 CALL get_qs_env(qs_env=qs_env, &
974 qs_kind_set=qs_kind_set)
976 nmo = vcd_env%dcdr_env%nmo(1)
977 nao = vcd_env%dcdr_env%nao
979 CALL build_matrix_hr_rh(vcd_env, qs_env, vcd_env%spatial_origin_atom)
982 CALL dbcsr_copy(vcd_env%dcdr_env%matrix_nosym_temp(1)%matrix, vcd_env%matrix_hr(ispin, vcd_env%dcdr_env%beta)%matrix)
983 CALL dbcsr_copy(vcd_env%dcdr_env%matrix_nosym_temp(2)%matrix, vcd_env%matrix_rh(ispin, vcd_env%dcdr_env%beta)%matrix)
985 CALL hr_mult_by_delta_1d(vcd_env%dcdr_env%matrix_nosym_temp(1)%matrix, qs_kind_set,
"ORB", &
986 sab_all, vcd_env%dcdr_env%lambda, direction_or=.true.)
987 CALL hr_mult_by_delta_1d(vcd_env%dcdr_env%matrix_nosym_temp(2)%matrix, qs_kind_set,
"ORB", &
988 sab_all, vcd_env%dcdr_env%lambda, direction_or=.false.)
989 CALL dbcsr_add(vcd_env%dcdr_env%matrix_nosym_temp(1)%matrix, &
990 vcd_env%dcdr_env%matrix_nosym_temp(2)%matrix, &
993 associate(mo_coeff => vcd_env%dcdr_env%mo_coeff(ispin))
994 CALL cp_dbcsr_sm_fm_multiply(vcd_env%dcdr_env%matrix_nosym_temp(1)%matrix, mo_coeff, &
995 vcd_env%op_dV(ispin), ncol=nmo, alpha=1.0_dp, beta=0.0_dp)
998 CALL cp_dbcsr_sm_fm_multiply(vcd_env%dipvel_ao_delta(vcd_env%dcdr_env%beta)%matrix, mo_coeff, &
999 vcd_env%op_dV(ispin), &
1000 ncol=nmo, alpha=1.0_dp, beta=1.0_dp)
1005 CALL cp_dbcsr_sm_fm_multiply(vcd_env%matrix_drpnl(vcd_env%dcdr_env%beta)%matrix, mo_coeff, &
1006 vcd_env%op_dV(ispin), &
1007 ncol=nmo, alpha=-1.0_dp, beta=1.0_dp)
1010 CALL cp_fm_create(buf, vcd_env%dcdr_env%likemos_fm_struct(ispin)%struct)
1011 CALL cp_dbcsr_sm_fm_multiply(vcd_env%dcdr_env%matrix_s1(1)%matrix, vcd_env%dcdr_env%dCR_prime(ispin), &
1012 vcd_env%op_dV(1), ncol=nmo, alpha=-1.0_dp, beta=1.0_dp)
1015 CALL cp_dbcsr_sm_fm_multiply(vcd_env%matrix_dSdV(vcd_env%dcdr_env%beta)%matrix, mo_coeff, &
1016 buf, nmo, alpha=1.0_dp, beta=0.0_dp)
1017 CALL parallel_gemm(
'N',
'N', nao, nmo, nmo, &
1018 -1.0_dp, buf, vcd_env%dcdr_env%chc(ispin), &
1019 1.0_dp, vcd_env%op_dV(ispin))
1021 CALL cp_fm_release(buf)
1025 CALL cp_fm_scale(-1.0_dp, vcd_env%op_dV(1))
1028 CALL build_matrix_hr_rh(vcd_env, qs_env, [0._dp, 0._dp, 0._dp])
1030 CALL timestop(handle)
1031 END SUBROUTINE vcd_build_op_dv
1040 SUBROUTINE vcd_response_dv(vcd_env, p_env, qs_env)
1042 TYPE(vcd_env_type) :: vcd_env
1043 TYPE(qs_p_env_type) :: p_env
1044 TYPE(qs_environment_type),
POINTER :: qs_env
1046 CHARACTER(LEN=*),
PARAMETER :: routineN =
'vcd_response_dV'
1047 INTEGER,
PARAMETER :: ispin = 1
1049 INTEGER :: handle, output_unit
1050 LOGICAL :: failure, should_stop
1051 TYPE(cp_fm_type),
DIMENSION(1) :: h1_psi0, psi1
1052 TYPE(cp_logger_type),
POINTER :: logger
1053 TYPE(linres_control_type),
POINTER :: linres_control
1054 TYPE(mo_set_type),
DIMENSION(:),
POINTER :: mos
1055 TYPE(section_vals_type),
POINTER :: lr_section, vcd_section
1057 CALL timeset(routinen, handle)
1060 NULLIFY (linres_control, lr_section, logger)
1062 CALL get_qs_env(qs_env=qs_env, &
1063 linres_control=linres_control, &
1066 logger => cp_get_default_logger()
1067 lr_section => section_vals_get_subs_vals(qs_env%input,
"PROPERTIES%LINRES")
1068 vcd_section => section_vals_get_subs_vals(qs_env%input, &
1069 "PROPERTIES%LINRES%vcd")
1071 output_unit = cp_print_key_unit_nr(logger, lr_section,
"PRINT%PROGRAM_RUN_INFO", &
1072 extension=
".linresLog")
1073 IF (output_unit > 0)
THEN
1074 WRITE (unit=output_unit, fmt=
"(T10,A,/)") &
1075 "*** Self consistent optimization of the response wavefunction ***"
1078 associate(psi0_order => vcd_env%dcdr_env%mo_coeff)
1079 CALL cp_fm_create(psi1(ispin), vcd_env%dcdr_env%likemos_fm_struct(ispin)%struct, set_zero=.true.)
1080 CALL cp_fm_create(h1_psi0(ispin), vcd_env%dcdr_env%likemos_fm_struct(ispin)%struct)
1083 IF (linres_control%linres_restart)
THEN
1084 CALL vcd_read_restart(qs_env, lr_section, psi1, vcd_env%dcdr_env%lambda, vcd_env%dcdr_env%beta,
"dCdV")
1086 CALL cp_fm_set_all(psi1(ispin), 0.0_dp)
1089 IF (output_unit > 0)
THEN
1090 WRITE (output_unit, *) &
1091 "Response to the perturbation operator referring to the velocity of atom ", &
1092 vcd_env%dcdr_env%lambda,
" in "//achar(vcd_env%dcdr_env%beta + 119)
1101 CALL cp_fm_set_all(vcd_env%dCV(ispin), 0.0_dp)
1102 CALL cp_fm_set_all(h1_psi0(ispin), 0.0_dp)
1103 CALL cp_fm_to_fm(vcd_env%op_dV(ispin), h1_psi0(ispin))
1105 linres_control%lr_triplet = .false.
1106 linres_control%do_kernel = .false.
1107 linres_control%converged = .false.
1108 CALL linres_solver(p_env, qs_env, psi1, h1_psi0, psi0_order, &
1109 output_unit, should_stop)
1110 CALL cp_fm_to_fm(psi1(ispin), vcd_env%dCV(ispin))
1113 IF (linres_control%linres_restart)
THEN
1114 CALL vcd_write_restart(qs_env, lr_section, psi1, vcd_env%dcdr_env%lambda, vcd_env%dcdr_env%beta,
"dCdV")
1120 CALL cp_fm_release(psi1(ispin))
1121 CALL cp_fm_release(h1_psi0(ispin))
1123 CALL cp_print_key_finished_output(output_unit, logger, lr_section, &
1124 "PRINT%PROGRAM_RUN_INFO")
1126 CALL timestop(handle)
1127 END SUBROUTINE vcd_response_dv
Define the atomic kind types and their sub types.
subroutine, public get_atomic_kind(atomic_kind, fist_potential, element_symbol, name, mass, kind_number, natom, atom_list, rcov, rvdw, z, qeff, apol, cpol, mm_radius, shell, shell_active, damping)
Get attributes of an atomic kind.
Handles all functions related to the CELL.
Calculation of the non-local pseudopotential contribution to the core Hamiltonian <a|V(non-local)|b> ...
subroutine, public build_com_mom_nl(qs_kind_set, sab_all, sap_ppnl, eps_ppnl, particle_set, cell, matrix_rv, matrix_rxrv, matrix_rrv, matrix_rvr, matrix_rrv_vrr, matrix_r_rxvr, matrix_rxvr_r, matrix_r_doublecom, pseudoatom, ref_point)
Calculate [r,Vnl] (matrix_rv), r x [r,Vnl] (matrix_rxrv) or [rr,Vnl] (matrix_rrv) in AO basis....
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_desymmetrize(matrix_a, matrix_b)
...
subroutine, public dbcsr_copy(matrix_b, matrix_a, name, keep_sparsity, keep_imaginary)
...
subroutine, public dbcsr_set(matrix, alpha)
...
subroutine, public dbcsr_add(matrix_a, matrix_b, alpha_scalar, beta_scalar)
...
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
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
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, nrow, ncol, set_zero)
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 ...
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,...
Calculation of the incomplete Gamma function F_n(t) for multi-center integrals over Cartesian Gaussia...
Defines the basic variable types.
integer, parameter, public dp
basic linear algebra operations for full matrixes
Define the data structure for the particle information.
Calculate the derivatives of the MO coefficients wrt nuclear coordinates.
subroutine, public hr_mult_by_delta_1d(matrix, qs_kind_set, basis_type, sab_nl, lambda, direction_or)
Enforce that one of the basis functions in < a | O | b > is centered on atom lambda.
subroutine, public get_qs_env(qs_env, atomic_kind_set, qs_kind_set, cell, super_cell, cell_ref, use_ref_cell, kpoints, dft_control, mos, sab_orb, sab_all, qmmm, qmmm_periodic, mimic, sac_ae, sac_ppl, sac_lri, sap_ppnl, sab_vdw, sab_scp, sap_oce, sab_lrc, sab_se, sab_xtbe, sab_tbe, sab_core, sab_xb, sab_xtb_pp, sab_xtb_nonbond, sab_almo, sab_kp, sab_kp_nosym, sab_cneo, particle_set, energy, force, matrix_h, matrix_h_im, matrix_ks, matrix_ks_im, matrix_vxc, run_rtp, rtp, matrix_h_kp, matrix_h_im_kp, matrix_ks_kp, matrix_ks_im_kp, matrix_vxc_kp, kinetic_kp, matrix_s_kp, matrix_w_kp, matrix_s_ri_aux_kp, matrix_s, matrix_s_ri_aux, matrix_w, matrix_p_mp2, matrix_p_mp2_admm, matrix_vhxc, rho, rho_xc, pw_env, ewald_env, ewald_pw, active_space, mpools, input, para_env, blacs_env, scf_control, rel_control, kinetic, qs_charges, vppl, xcint_weights, rho_core, rho_nlcc, rho_nlcc_g, ks_env, ks_qmmm_env, wf_history, scf_env, local_particles, local_molecules, distribution_2d, dbcsr_dist, molecule_kind_set, molecule_set, subsys, cp_subsys, oce, local_rho_set, rho_atom_set, task_list, task_list_soft, rho0_atom_set, rho0_mpole, rhoz_set, rhoz_cneo_set, ecoul_1c, rho0_s_rs, rho0_s_gs, rhoz_cneo_s_rs, rhoz_cneo_s_gs, do_kpoints, has_unit_metric, requires_mo_derivs, mo_derivs, mo_loc_history, nkind, natom, nelectron_total, nelectron_spin, efield, neighbor_list_id, linres_control, xas_env, virial, cp_ddapc_env, cp_ddapc_ewald, outer_scf_history, outer_scf_ihistory, x_data, et_coupling, dftb_potential, results, se_taper, se_store_int_env, se_nddo_mpole, se_nonbond_env, admm_env, lri_env, lri_density, exstate_env, ec_env, harris_env, dispersion_env, gcp_env, vee, rho_external, external_vxc, mask, mp2_env, bs_env, kg_env, wanniercentres, atprop, ls_scf_env, do_transport, transport_env, v_hartree_rspace, s_mstruct_changed, rho_changed, potential_changed, forces_up_to_date, mscfg_env, almo_scf_env, gradient_history, variable_history, embed_pot, spin_embed_pot, polar_env, mos_last_converged, eeq, rhs, do_rixs, tb_tblite)
Get the QUICKSTEP environment.
Define the quickstep kind type and their sub types.
subroutine, public get_qs_kind(qs_kind, basis_set, basis_type, ncgf, nsgf, all_potential, tnadd_potential, gth_potential, sgp_potential, upf_potential, cneo_potential, se_parameter, dftb_parameter, xtb_parameter, dftb3_param, zatom, zeff, elec_conf, mao, lmax_dftb, alpha_core_charge, ccore_charge, core_charge, core_charge_radius, paw_proj_set, paw_atom, hard_radius, hard0_radius, max_rad_local, covalent_radius, vdw_radius, gpw_type_forced, harmonics, max_iso_not0, max_s_harm, grid_atom, ngrid_ang, ngrid_rad, lmax_rho0, dft_plus_u_atom, l_of_dft_plus_u, n_of_dft_plus_u, u_minus_j, hund_j, u_of_dft_plus_u, j_of_dft_plus_u, alpha_of_dft_plus_u, beta_of_dft_plus_u, j0_of_dft_plus_u, occupation_of_dft_plus_u, dispersion, bs_occupation, magnetization, no_optimize, addel, laddel, naddel, orbitals, max_scf, eps_scf, smear, u_ramping, u_minus_j_target, eps_u_ramping, proj_shell_charge, lr_atom, do_mtlr, u_j_loop, ao_coef, init_u_ramping_each_scf, reltmat, ghost, monovalent, floating, name, element_symbol, pao_basis_size, pao_model_file, pao_potentials, pao_descriptors, nelec)
Get attributes of an atomic kind.
localize wavefunctions linear response scf
subroutine, public linres_solver(p_env, qs_env, psi1, h1_psi0, psi0_order, iounit, should_stop, silent)
scf loop to optimize the first order wavefunctions (psi1) given a perturbation as an operator applied...
Type definitiona for linear response calculations.
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_moments_der_matrix(qs_env, moments_der, nmoments_der, nmoments, ref_point, moments, basis_type, minimum_image, ordered, lambda, deltar, neighbor_image)
Calculate right-hand sided derivatives of multipole moments, e. g. < a | xy d/dz | b > Optionally sto...
Define the neighbor list data types and the corresponding functionality.
basis types for the calculation of the perturbation of density theory.
subroutine, public build_dcom_rpnl(matrix_rv, qs_kind_set, sab_orb, sap_ppnl, eps_ppnl, particle_set, pseudoatom)
Calculate the double commutator [[Vnl, r], r].
subroutine, public hr_mult_by_delta_3d(matrix_hr, qs_kind_set, basis_type, sab_nl, deltar, direction_or)
Apply the operator \delta_\mu^\lambda to zero out all elements of the matrix which don't fulfill the ...
subroutine, public build_dsdv_matrix(qs_env, matrix_dsdv, deltar, rcc)
Builds the overlap derivative wrt nuclear velocities dS/dV = < mu | r | nu > * (nu - mu).
subroutine, public build_matrix_hr_rh(vcd_env, qs_env, rc)
Build the matrix Hr*delta_nu^\lambda - rH*delta_mu^\lambda.
subroutine, public vcd_write_restart(qs_env, linres_section, vec, lambda, beta, tag)
Copied from linres_write_restart.
subroutine, public vcd_read_restart(qs_env, linres_section, vec, lambda, beta, tag)
Copied from linres_read_restart.
Type defining parameters related to the simulation cell.
type of a logger, at the moment it contains just a print level starting at which level it should be l...
Provides all information about a quickstep kind.
General settings for linear response calculations.
Represent a qs system that is perturbed. Can calculate the linear operator and the rhs of the system ...