25 USE dbcsr_api,
ONLY: dbcsr_add,&
53 #include "./base/base_uses.f90"
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])
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 .EQ. 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, &
151 CALL cp_fm_trace(mo_coeff, tmp_aomo, aat_tmp_33(
gamma, delta))
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
186 CALL dbcsr_desymmetrize(vcd_env%dcdr_env%moments(
gamma)%matrix, &
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)
192 CALL cp_fm_trace(mo_coeff, tmp_aomo, tmp_trace)
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)
238 CALL cp_fm_trace(mo_coeff, tmp_aomo, aat_tmp)
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)
253 CALL cp_fm_trace(mo_coeff, tmp_aomo, aat_tmp)
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)
266 CALL cp_fm_trace(mo_coeff, tmp_aomo, aat_tmp)
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
338 lc_tmp = levi_civita(alpha,
gamma, delta)
339 IF (lc_tmp == 0._dp) cycle
347 CALL cp_fm_trace(mo_coeff, tmp_aomo, tmp_trace)
351 aat_tmp = aat_tmp - lc_tmp*aat_prefactor*tmp_trace*(-vcd_env%magnetic_origin_atom(
gamma))
360 CALL cp_fm_trace(mo_coeff, tmp_aomo, tmp_trace)
364 aat_tmp = aat_tmp - lc_tmp*aat_prefactor*tmp_trace*(-vcd_env%spatial_origin_atom(vcd_env%dcdr_env%beta))
369 CALL dbcsr_desymmetrize(vcd_env%dipvel_ao(delta)%matrix, vcd_env%dcdr_env%matrix_nosym_temp(1)%matrix)
370 CALL dbcsr_desymmetrize(vcd_env%dipvel_ao(delta)%matrix, vcd_env%dcdr_env%matrix_nosym_temp(2)%matrix)
371 CALL hr_mult_by_delta_1d(vcd_env%dcdr_env%matrix_nosym_temp(1)%matrix, qs_kind_set,
"ORB", &
372 sab_all, direction_or=.false., lambda=vcd_env%dcdr_env%lambda)
373 CALL hr_mult_by_delta_1d(vcd_env%dcdr_env%matrix_nosym_temp(2)%matrix, qs_kind_set,
"ORB", &
374 sab_all, direction_or=.true., lambda=vcd_env%dcdr_env%lambda)
375 CALL dbcsr_add(vcd_env%dcdr_env%matrix_nosym_temp(1)%matrix, vcd_env%dcdr_env%matrix_nosym_temp(2)%matrix, &
379 CALL cp_fm_trace(mo_coeff, tmp_aomo, tmp_trace)
380 aat_tmp = aat_tmp + lc_tmp*aat_prefactor*tmp_trace* &
381 (vcd_env%spatial_origin_atom(vcd_env%dcdr_env%beta)*vcd_env%magnetic_origin_atom(
gamma))
386 aat_atom(vcd_env%dcdr_env%beta, alpha, vcd_env%dcdr_env%lambda) &
387 = aat_atom(vcd_env%dcdr_env%beta, alpha, vcd_env%dcdr_env%lambda) + aat_tmp
395 lc_tmp = levi_civita(alpha,
gamma, vcd_env%dcdr_env%beta)
396 IF (lc_tmp == 0._dp) cycle
397 CALL dbcsr_set(vcd_env%dcdr_env%matrix_nosym_temp(vcd_env%dcdr_env%beta)%matrix, 0.0_dp)
398 CALL dbcsr_desymmetrize(vcd_env%dcdr_env%matrix_s1(1)%matrix, vcd_env%dcdr_env%matrix_nosym_temp(1)%matrix)
399 CALL hr_mult_by_delta_1d(vcd_env%dcdr_env%matrix_nosym_temp(1)%matrix, qs_kind_set,
"ORB", sab_all, &
400 vcd_env%dcdr_env%lambda, direction_or=.true.)
402 CALL cp_fm_trace(mo_coeff, tmp_aomo, tmp_trace)
407 aat_tmp = aat_tmp + lc_tmp*aat_prefactor*tmp_trace*vcd_env%magnetic_origin_atom(
gamma)
410 aat_atom(vcd_env%dcdr_env%beta, alpha, vcd_env%dcdr_env%lambda) &
411 = aat_atom(vcd_env%dcdr_env%beta, alpha, vcd_env%dcdr_env%lambda) + aat_tmp
422 CALL dbcsr_set(vcd_env%dcdr_env%matrix_nosym_temp(1)%matrix, 0._dp)
426 lc_tmp = levi_civita(alpha,
gamma, delta)
427 IF (lc_tmp == 0._dp) cycle
436 CALL dbcsr_copy(vcd_env%dcdr_env%matrix_nosym_temp(1)%matrix, &
437 vcd_env%matrix_rrcom(delta, vcd_env%dcdr_env%beta)%matrix)
438 CALL hr_mult_by_delta_1d(vcd_env%dcdr_env%matrix_nosym_temp(1)%matrix, qs_kind_set,
"ORB", &
439 sab_all, direction_or=.false., lambda=vcd_env%dcdr_env%lambda)
441 CALL cp_fm_trace(mo_coeff, tmp_aomo, tmp_trace)
443 aat_tmp = aat_tmp + aat_prefactor*tmp_trace*lc_tmp*vcd_env%magnetic_origin_atom(
gamma)
451 CALL dbcsr_copy(vcd_env%dcdr_env%matrix_nosym_temp(1)%matrix, vcd_env%matrix_rrcom(delta,
gamma)%matrix)
452 CALL hr_mult_by_delta_1d(vcd_env%dcdr_env%matrix_nosym_temp(1)%matrix, qs_kind_set,
"ORB", &
453 sab_all, direction_or=.false., lambda=vcd_env%dcdr_env%lambda)
455 CALL cp_fm_trace(mo_coeff, tmp_aomo, tmp_trace)
456 aat_tmp = aat_tmp + aat_prefactor*tmp_trace*lc_tmp*vcd_env%spatial_origin_atom(vcd_env%dcdr_env%beta)
461 CALL dbcsr_desymmetrize(vcd_env%hcom(delta)%matrix, vcd_env%dcdr_env%matrix_nosym_temp(1)%matrix)
462 CALL hr_mult_by_delta_1d(vcd_env%dcdr_env%matrix_nosym_temp(1)%matrix, qs_kind_set,
"ORB", &
463 sab_all, direction_or=.false., lambda=vcd_env%dcdr_env%lambda)
465 CALL cp_fm_trace(mo_coeff, tmp_aomo, tmp_trace)
467 aat_tmp = aat_tmp + &
468 aat_prefactor*tmp_trace*lc_tmp &
469 *(vcd_env%spatial_origin_atom(vcd_env%dcdr_env%beta)*vcd_env%magnetic_origin_atom(
gamma))
473 aat_atom(vcd_env%dcdr_env%beta, alpha, vcd_env%dcdr_env%lambda) &
474 = aat_atom(vcd_env%dcdr_env%beta, alpha, vcd_env%dcdr_env%lambda) + aat_tmp
484 CALL dbcsr_set(vcd_env%dcdr_env%matrix_nosym_temp(1)%matrix, 0._dp)
488 lc_tmp = levi_civita(alpha,
gamma, delta)
489 IF (lc_tmp == 0._dp) cycle
498 CALL dbcsr_copy(vcd_env%dcdr_env%matrix_nosym_temp(1)%matrix, &
499 vcd_env%matrix_rcomr(delta, vcd_env%dcdr_env%beta)%matrix)
500 CALL hr_mult_by_delta_1d(vcd_env%dcdr_env%matrix_nosym_temp(1)%matrix, qs_kind_set,
"ORB", &
501 sab_all, direction_or=.true., lambda=vcd_env%dcdr_env%lambda)
504 CALL cp_fm_trace(mo_coeff, tmp_aomo, tmp_trace)
505 aat_tmp = aat_tmp + aat_prefactor*tmp_trace*lc_tmp*(-vcd_env%magnetic_origin_atom(
gamma))
512 CALL dbcsr_copy(vcd_env%dcdr_env%matrix_nosym_temp(1)%matrix, vcd_env%matrix_rrcom(delta,
gamma)%matrix)
513 CALL hr_mult_by_delta_1d(vcd_env%dcdr_env%matrix_nosym_temp(1)%matrix, qs_kind_set,
"ORB", &
514 sab_all, direction_or=.true., lambda=vcd_env%dcdr_env%lambda)
517 CALL cp_fm_trace(mo_coeff, tmp_aomo, tmp_trace)
518 aat_tmp = aat_tmp + aat_prefactor*tmp_trace*lc_tmp*(-vcd_env%spatial_origin_atom(vcd_env%dcdr_env%beta))
522 CALL dbcsr_desymmetrize(vcd_env%hcom(delta)%matrix, vcd_env%dcdr_env%matrix_nosym_temp(1)%matrix)
523 CALL hr_mult_by_delta_1d(vcd_env%dcdr_env%matrix_nosym_temp(1)%matrix, qs_kind_set,
"ORB", &
524 sab_all, direction_or=.true., lambda=vcd_env%dcdr_env%lambda)
527 CALL cp_fm_trace(mo_coeff, tmp_aomo, tmp_trace)
529 aat_tmp = aat_tmp - &
530 aat_prefactor*tmp_trace*lc_tmp* &
531 (vcd_env%spatial_origin_atom(vcd_env%dcdr_env%beta)*vcd_env%magnetic_origin_atom(
gamma))
535 aat_atom(vcd_env%dcdr_env%beta, alpha, vcd_env%dcdr_env%lambda) &
536 = aat_atom(vcd_env%dcdr_env%beta, alpha, vcd_env%dcdr_env%lambda) + aat_tmp
546 lc_tmp = levi_civita(alpha,
gamma, delta)
547 IF (lc_tmp == 0._dp) cycle
551 mo_coeff, tmp_aomo, ncol=nmo)
552 CALL cp_fm_trace(mo_coeff, tmp_aomo, tmp_trace)
554 aat_tmp = aat_tmp + aat_prefactor*tmp_trace*lc_tmp*(-vcd_env%magnetic_origin_atom(
gamma))
558 aat_atom(vcd_env%dcdr_env%beta, alpha, vcd_env%dcdr_env%lambda) &
559 = aat_atom(vcd_env%dcdr_env%beta, alpha, vcd_env%dcdr_env%lambda) + aat_tmp
563 CALL get_atomic_kind(particle_set(vcd_env%dcdr_env%lambda)%atomic_kind, kind_number=ikind)
564 CALL get_qs_kind(qs_kind_set(ikind), core_charge=charge, ghost=ghost)
565 IF (.NOT. ghost)
THEN
569 IF (levi_civita(alpha,
gamma, vcd_env%dcdr_env%beta) == 0._dp) cycle
570 aat_tmp = aat_tmp + charge &
571 *levi_civita(alpha,
gamma, vcd_env%dcdr_env%beta) &
572 *(particle_set(vcd_env%dcdr_env%lambda)%r(
gamma) - vcd_env%magnetic_origin_atom(
gamma))
574 aat_atom(vcd_env%dcdr_env%beta, alpha, vcd_env%dcdr_env%lambda) &
575 = aat_atom(vcd_env%dcdr_env%beta, alpha, vcd_env%dcdr_env%lambda) + aat_tmp
581 CALL cp_fm_release(tmp_aomo)
582 CALL timestop(handle)
593 TYPE(vcd_env_type) :: vcd_env
594 TYPE(qs_environment_type),
POINTER :: qs_env
596 CHARACTER(LEN=*),
PARAMETER :: routinen =
'apt_dV'
597 INTEGER,
PARAMETER :: ispin = 1
598 REAL(dp),
PARAMETER :: f_spin = 2._dp
600 INTEGER :: alpha, handle, ikind, nao, nmo
603 REAL(kind=dp) :: apt_dcom, apt_difdip, apt_dipvel, &
605 TYPE(cp_fm_type) :: buf, matrix_dsdv_mo
606 TYPE(neighbor_list_set_p_type),
DIMENSION(:), &
608 TYPE(particle_type),
DIMENSION(:),
POINTER :: particle_set
609 TYPE(qs_kind_type),
DIMENSION(:),
POINTER :: qs_kind_set
611 CALL timeset(routinen, handle)
613 CALL get_qs_env(qs_env=qs_env, &
615 particle_set=particle_set, &
616 qs_kind_set=qs_kind_set)
618 nmo = vcd_env%dcdr_env%nmo(ispin)
619 nao = vcd_env%dcdr_env%nao
621 associate(apt_el => vcd_env%apt_el_nvpt, &
622 apt_nuc => vcd_env%apt_nuc_nvpt, &
623 apt_total => vcd_env%apt_total_nvpt, &
624 mo_coeff => vcd_env%dcdr_env%mo_coeff(ispin), &
625 deltar => vcd_env%dcdr_env%deltaR)
628 CALL cp_fm_create(buf, vcd_env%dcdr_env%likemos_fm_struct(ispin)%struct)
629 CALL cp_fm_create(matrix_dsdv_mo, vcd_env%dcdr_env%momo_fm_struct(ispin)%struct)
635 CALL cp_fm_scale_and_add(0._dp, vcd_env%dCV_prime(ispin), -1._dp, vcd_env%dCV(ispin))
638 CALL cp_dbcsr_sm_fm_multiply(vcd_env%matrix_dSdV(vcd_env%dcdr_env%beta)%matrix, mo_coeff, &
640 CALL parallel_gemm(
"T",
"N", nmo, nmo, nao, &
641 1.0_dp, mo_coeff, buf, &
642 0.0_dp, matrix_dsdv_mo)
644 CALL parallel_gemm(
"N",
"N", nao, nmo, nmo, &
645 -0.5_dp, mo_coeff, matrix_dsdv_mo, &
646 1.0_dp, vcd_env%dCV_prime(ispin))
650 CALL cp_fm_set_all(buf, 0.0_dp)
653 CALL cp_dbcsr_sm_fm_multiply(vcd_env%dipvel_ao(alpha)%matrix, mo_coeff, buf, ncol=nmo)
654 CALL cp_fm_trace(buf, vcd_env%dCV_prime(ispin), apt_dipvel)
657 apt_dipvel = 2._dp*apt_dipvel
658 apt_el(vcd_env%dcdr_env%beta, alpha, vcd_env%dcdr_env%lambda) &
659 = apt_el(vcd_env%dcdr_env%beta, alpha, vcd_env%dcdr_env%lambda) + f_spin*apt_dipvel
663 CALL cp_fm_set_all(buf, 0.0_dp)
665 CALL cp_dbcsr_sm_fm_multiply(vcd_env%hcom(alpha)%matrix, mo_coeff, buf, ncol=nmo)
666 CALL cp_fm_trace(buf, vcd_env%dCV_prime(ispin), apt_hcom)
670 apt_hcom = +2._dp*apt_hcom
672 apt_el(vcd_env%dcdr_env%beta, alpha, vcd_env%dcdr_env%lambda) &
673 = apt_el(vcd_env%dcdr_env%beta, alpha, vcd_env%dcdr_env%lambda) + f_spin*apt_hcom
678 CALL dbcsr_set(vcd_env%dcdr_env%matrix_nosym_temp(vcd_env%dcdr_env%beta)%matrix, 0.0_dp)
679 CALL dbcsr_desymmetrize(vcd_env%dcdr_env%matrix_s1(1)%matrix, &
680 vcd_env%dcdr_env%matrix_nosym_temp(vcd_env%dcdr_env%beta)%matrix)
681 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, &
682 vcd_env%dcdr_env%lambda, direction_or=.true.)
684 CALL cp_dbcsr_sm_fm_multiply(vcd_env%dcdr_env%matrix_nosym_temp(vcd_env%dcdr_env%beta)%matrix, mo_coeff, &
685 buf, ncol=nmo, alpha=1._dp, beta=0._dp)
686 CALL cp_fm_trace(mo_coeff, buf, apt_difdip)
688 apt_difdip = -f_spin*apt_difdip
689 apt_el(vcd_env%dcdr_env%beta, vcd_env%dcdr_env%beta, vcd_env%dcdr_env%lambda) &
690 = apt_el(vcd_env%dcdr_env%beta, vcd_env%dcdr_env%beta, vcd_env%dcdr_env%lambda) + apt_difdip
695 CALL cp_dbcsr_sm_fm_multiply(vcd_env%matrix_difdip2(vcd_env%dcdr_env%beta, alpha)%matrix, mo_coeff, &
696 buf, ncol=nmo, alpha=1._dp, beta=0._dp)
698 CALL cp_fm_trace(mo_coeff, buf, apt_difdip)
701 apt_difdip = -f_spin*apt_difdip
702 apt_el(vcd_env%dcdr_env%beta, alpha, vcd_env%dcdr_env%lambda) &
703 = apt_el(vcd_env%dcdr_env%beta, alpha, vcd_env%dcdr_env%lambda) + apt_difdip
711 CALL dbcsr_copy(vcd_env%dcdr_env%matrix_nosym_temp(1)%matrix, vcd_env%matrix_rcomr(alpha, vcd_env%dcdr_env%beta)%matrix)
712 CALL dbcsr_copy(vcd_env%dcdr_env%matrix_nosym_temp(2)%matrix, vcd_env%matrix_rrcom(alpha, vcd_env%dcdr_env%beta)%matrix)
714 CALL hr_mult_by_delta_1d(vcd_env%dcdr_env%matrix_nosym_temp(1)%matrix, qs_kind_set,
"ORB", &
715 sab_all, direction_or=.true., lambda=vcd_env%dcdr_env%lambda)
716 CALL hr_mult_by_delta_1d(vcd_env%dcdr_env%matrix_nosym_temp(2)%matrix, qs_kind_set,
"ORB", &
717 sab_all, direction_or=.false., lambda=vcd_env%dcdr_env%lambda)
719 CALL dbcsr_add(vcd_env%dcdr_env%matrix_nosym_temp(1)%matrix, vcd_env%dcdr_env%matrix_nosym_temp(2)%matrix, &
722 CALL cp_fm_set_all(buf, 0.0_dp)
723 CALL cp_dbcsr_sm_fm_multiply(vcd_env%dcdr_env%matrix_nosym_temp(1)%matrix, mo_coeff, buf, ncol=nmo)
724 CALL cp_fm_trace(mo_coeff, buf, apt_rcom)
726 apt_el(vcd_env%dcdr_env%beta, alpha, vcd_env%dcdr_env%lambda) &
727 = apt_el(vcd_env%dcdr_env%beta, alpha, vcd_env%dcdr_env%lambda) + f_spin*apt_rcom
733 CALL cp_fm_set_all(buf, 0.0_dp)
734 CALL cp_dbcsr_sm_fm_multiply(vcd_env%matrix_dcom(alpha, vcd_env%dcdr_env%beta)%matrix, mo_coeff, buf, ncol=nmo)
735 CALL cp_fm_trace(mo_coeff, buf, apt_dcom)
736 apt_el(vcd_env%dcdr_env%beta, alpha, vcd_env%dcdr_env%lambda) &
737 = apt_el(vcd_env%dcdr_env%beta, alpha, vcd_env%dcdr_env%lambda) + f_spin*apt_dcom
745 CALL dbcsr_set(vcd_env%dcdr_env%matrix_nosym_temp(alpha)%matrix, 0._dp)
746 CALL dbcsr_set(vcd_env%dcdr_env%matrix_nosym_temp2(alpha)%matrix, 0._dp)
747 CALL dbcsr_desymmetrize(vcd_env%dcdr_env%matrix_s(alpha + 1)%matrix, vcd_env%dcdr_env%matrix_nosym_temp(alpha)%matrix)
748 CALL dbcsr_copy(vcd_env%dcdr_env%matrix_nosym_temp2(alpha)%matrix, vcd_env%dcdr_env%matrix_nosym_temp(alpha)%matrix)
751 CALL hr_mult_by_delta_1d(vcd_env%dcdr_env%matrix_nosym_temp(alpha)%matrix, qs_kind_set,
"ORB", sab_all, &
752 vcd_env%dcdr_env%lambda, direction_or=.true.)
754 CALL hr_mult_by_delta_1d(vcd_env%dcdr_env%matrix_nosym_temp2(alpha)%matrix, qs_kind_set,
"ORB", sab_all, &
755 vcd_env%dcdr_env%lambda, direction_or=.false.)
758 CALL dbcsr_add(vcd_env%dcdr_env%matrix_nosym_temp2(alpha)%matrix, vcd_env%dcdr_env%matrix_nosym_temp(alpha)%matrix, &
761 CALL cp_fm_set_all(buf, 0.0_dp)
762 CALL cp_dbcsr_sm_fm_multiply(vcd_env%dcdr_env%matrix_nosym_temp2(alpha)%matrix, mo_coeff, buf, ncol=nmo)
763 CALL cp_fm_trace(mo_coeff, buf, apt_difdip)
767 apt_difdip = -apt_difdip*vcd_env%spatial_origin_atom(vcd_env%dcdr_env%beta)
769 apt_el(vcd_env%dcdr_env%beta, alpha, vcd_env%dcdr_env%lambda) &
770 = apt_el(vcd_env%dcdr_env%beta, alpha, vcd_env%dcdr_env%lambda) + f_spin*apt_difdip
781 CALL dbcsr_set(vcd_env%dcdr_env%matrix_nosym_temp(alpha)%matrix, 0._dp)
782 CALL dbcsr_desymmetrize(vcd_env%hcom(alpha)%matrix, vcd_env%dcdr_env%matrix_nosym_temp(alpha)%matrix)
783 CALL dbcsr_copy(vcd_env%dcdr_env%matrix_nosym_temp2(alpha)%matrix, vcd_env%dcdr_env%matrix_nosym_temp(alpha)%matrix)
786 CALL hr_mult_by_delta_1d(vcd_env%dcdr_env%matrix_nosym_temp(alpha)%matrix, qs_kind_set,
"ORB", sab_all, &
787 vcd_env%dcdr_env%lambda, direction_or=.true.)
789 CALL hr_mult_by_delta_1d(vcd_env%dcdr_env%matrix_nosym_temp2(alpha)%matrix, qs_kind_set,
"ORB", sab_all, &
790 vcd_env%dcdr_env%lambda, direction_or=.false.)
792 CALL dbcsr_add(vcd_env%dcdr_env%matrix_nosym_temp(alpha)%matrix, &
793 vcd_env%dcdr_env%matrix_nosym_temp2(alpha)%matrix, -1._dp, +1._dp)
795 CALL cp_fm_set_all(buf, 0.0_dp)
796 CALL cp_dbcsr_sm_fm_multiply(vcd_env%dcdr_env%matrix_nosym_temp(alpha)%matrix, mo_coeff, buf, ncol=nmo)
797 CALL cp_fm_trace(mo_coeff, buf, apt_rcom)
798 apt_rcom = -vcd_env%spatial_origin_atom(vcd_env%dcdr_env%beta)*apt_rcom
800 apt_el(vcd_env%dcdr_env%beta, alpha, vcd_env%dcdr_env%lambda) &
801 = apt_el(vcd_env%dcdr_env%beta, alpha, vcd_env%dcdr_env%lambda) + f_spin*apt_rcom
805 associate(atomic_kind => particle_set(vcd_env%dcdr_env%lambda)%atomic_kind)
806 CALL get_atomic_kind(atomic_kind, kind_number=ikind)
807 CALL get_qs_kind(qs_kind_set(ikind), core_charge=charge, ghost=ghost)
808 IF (.NOT. ghost)
THEN
809 apt_nuc(vcd_env%dcdr_env%beta, vcd_env%dcdr_env%beta, vcd_env%dcdr_env%lambda) = &
810 apt_nuc(vcd_env%dcdr_env%beta, vcd_env%dcdr_env%beta, vcd_env%dcdr_env%lambda) + charge
815 CALL cp_fm_release(buf)
816 CALL cp_fm_release(matrix_dsdv_mo)
820 CALL timestop(handle)
830 TYPE(vcd_env_type) :: vcd_env
831 TYPE(qs_environment_type),
POINTER :: qs_env
833 CHARACTER(LEN=*),
PARAMETER :: routinen =
'prepare_per_atom_vcd'
835 INTEGER :: handle, i, ispin, j
836 TYPE(cell_type),
POINTER :: cell
837 TYPE(dft_control_type),
POINTER :: dft_control
838 TYPE(neighbor_list_set_p_type),
DIMENSION(:), &
839 POINTER :: sab_all, sab_orb, sap_ppnl
840 TYPE(particle_type),
DIMENSION(:),
POINTER :: particle_set
841 TYPE(qs_kind_type),
DIMENSION(:),
POINTER :: qs_kind_set
843 CALL timeset(routinen, handle)
845 CALL get_qs_env(qs_env=qs_env, dft_control=dft_control, &
846 sab_orb=sab_orb, sab_all=sab_all, sap_ppnl=sap_ppnl, &
847 qs_kind_set=qs_kind_set, particle_set=particle_set, cell=cell)
849 IF (vcd_env%distributed_origin)
THEN
850 vcd_env%magnetic_origin_atom(:) = particle_set(vcd_env%dcdr_env%lambda)%r(:) - vcd_env%magnetic_origin(:)
851 vcd_env%spatial_origin_atom = particle_set(vcd_env%dcdr_env%lambda)%r(:) - vcd_env%spatial_origin(:)
855 DO ispin = 1, dft_control%nspins
857 CALL dbcsr_set(vcd_env%matrix_dSdV(j)%matrix, 0._dp)
858 CALL dbcsr_set(vcd_env%matrix_drpnl(j)%matrix, 0._dp)
861 CALL dbcsr_set(vcd_env%matrix_dcom(i, j)%matrix, 0.0_dp)
862 CALL dbcsr_set(vcd_env%matrix_difdip2(i, j)%matrix, 0._dp)
865 CALL cp_fm_set_all(vcd_env%op_dV(ispin), 0._dp)
866 CALL dbcsr_set(vcd_env%matrix_hxc_dsdv(ispin)%matrix, 0._dp)
871 CALL build_dcom_rpnl(vcd_env%matrix_dcom, qs_kind_set, sab_orb, sap_ppnl, &
872 dft_control%qs_control%eps_ppnl, particle_set, vcd_env%dcdr_env%lambda)
875 CALL build_drpnl_matrix(vcd_env%matrix_drpnl, qs_kind_set, sab_all, sap_ppnl, &
876 dft_control%qs_control%eps_ppnl, particle_set, pseudoatom=vcd_env%dcdr_env%lambda)
879 CALL dbcsr_set(vcd_env%dipvel_ao_delta(i)%matrix, 0._dp)
880 CALL dbcsr_copy(vcd_env%dipvel_ao_delta(i)%matrix, vcd_env%dipvel_ao(i)%matrix)
883 CALL hr_mult_by_delta_3d(vcd_env%dipvel_ao_delta, qs_kind_set,
"ORB", &
884 sab_all, vcd_env%dcdr_env%delta_basis_function, direction_or=.true.)
887 CALL build_dsdv_matrix(qs_env, vcd_env%matrix_dSdV, &
888 deltar=vcd_env%dcdr_env%delta_basis_function, &
889 rcc=vcd_env%spatial_origin_atom)
891 CALL dipole_velocity_deriv(qs_env, vcd_env%matrix_difdip2, 1, lambda=vcd_env%dcdr_env%lambda, &
892 rc=[0._dp, 0._dp, 0._dp])
901 CALL dbcsr_set(vcd_env%moments_der_right(i, j)%matrix, 0.0_dp)
902 CALL dbcsr_set(vcd_env%moments_der_left(i, j)%matrix, 0.0_dp)
908 CALL dbcsr_desymmetrize(vcd_env%moments_der(i, j)%matrix, vcd_env%moments_der_right(i, j)%matrix)
909 CALL dbcsr_desymmetrize(vcd_env%moments_der(i, j)%matrix, vcd_env%moments_der_left(i, j)%matrix)
912 CALL hr_mult_by_delta_1d(vcd_env%moments_der_right(i, j)%matrix, qs_kind_set,
"ORB", &
913 sab_all, direction_or=.true., lambda=vcd_env%dcdr_env%lambda)
914 CALL hr_mult_by_delta_1d(vcd_env%moments_der_left(i, j)%matrix, qs_kind_set,
"ORB", &
915 sab_all, direction_or=.false., lambda=vcd_env%dcdr_env%lambda)
921 CALL dbcsr_set(vcd_env%matrix_r_doublecom(i, j)%matrix, 0._dp)
925 CALL build_com_mom_nl(qs_kind_set, sab_all, sap_ppnl, dft_control%qs_control%eps_ppnl, &
926 particle_set, ref_point=[0._dp, 0._dp, 0._dp], cell=cell, &
927 matrix_r_doublecom=vcd_env%matrix_r_doublecom, &
928 pseudoatom=vcd_env%dcdr_env%lambda)
930 CALL timestop(handle)
955 TYPE(vcd_env_type) :: vcd_env
956 TYPE(qs_environment_type),
POINTER :: qs_env
958 CHARACTER(LEN=*),
PARAMETER :: routinen =
'vcd_build_op_dV'
959 INTEGER,
PARAMETER :: ispin = 1
961 INTEGER :: handle, nao, nmo
962 TYPE(cp_fm_type) :: buf
963 TYPE(neighbor_list_set_p_type),
DIMENSION(:), &
965 TYPE(qs_kind_type),
DIMENSION(:),
POINTER :: qs_kind_set
967 CALL timeset(routinen, handle)
969 CALL get_qs_env(qs_env=qs_env, &
971 qs_kind_set=qs_kind_set)
973 nmo = vcd_env%dcdr_env%nmo(1)
974 nao = vcd_env%dcdr_env%nao
976 CALL build_matrix_hr_rh(vcd_env, qs_env, vcd_env%spatial_origin_atom)
979 CALL dbcsr_copy(vcd_env%dcdr_env%matrix_nosym_temp(1)%matrix, vcd_env%matrix_hr(ispin, vcd_env%dcdr_env%beta)%matrix)
980 CALL dbcsr_copy(vcd_env%dcdr_env%matrix_nosym_temp(2)%matrix, vcd_env%matrix_rh(ispin, vcd_env%dcdr_env%beta)%matrix)
982 CALL hr_mult_by_delta_1d(vcd_env%dcdr_env%matrix_nosym_temp(1)%matrix, qs_kind_set,
"ORB", &
983 sab_all, vcd_env%dcdr_env%lambda, direction_or=.true.)
984 CALL hr_mult_by_delta_1d(vcd_env%dcdr_env%matrix_nosym_temp(2)%matrix, qs_kind_set,
"ORB", &
985 sab_all, vcd_env%dcdr_env%lambda, direction_or=.false.)
986 CALL dbcsr_add(vcd_env%dcdr_env%matrix_nosym_temp(1)%matrix, &
987 vcd_env%dcdr_env%matrix_nosym_temp(2)%matrix, &
990 associate(mo_coeff => vcd_env%dcdr_env%mo_coeff(ispin))
991 CALL cp_dbcsr_sm_fm_multiply(vcd_env%dcdr_env%matrix_nosym_temp(1)%matrix, mo_coeff, &
992 vcd_env%op_dV(ispin), ncol=nmo, alpha=1.0_dp, beta=0.0_dp)
995 CALL cp_dbcsr_sm_fm_multiply(vcd_env%dipvel_ao_delta(vcd_env%dcdr_env%beta)%matrix, mo_coeff, &
996 vcd_env%op_dV(ispin), &
997 ncol=nmo, alpha=1.0_dp, beta=1.0_dp)
1002 CALL cp_dbcsr_sm_fm_multiply(vcd_env%matrix_drpnl(vcd_env%dcdr_env%beta)%matrix, mo_coeff, &
1003 vcd_env%op_dV(ispin), &
1004 ncol=nmo, alpha=-1.0_dp, beta=1.0_dp)
1007 CALL cp_fm_create(buf, vcd_env%dcdr_env%likemos_fm_struct(ispin)%struct)
1008 CALL cp_dbcsr_sm_fm_multiply(vcd_env%dcdr_env%matrix_s1(1)%matrix, vcd_env%dcdr_env%dCR_prime(ispin), &
1009 vcd_env%op_dV(1), ncol=nmo, alpha=-1.0_dp, beta=1.0_dp)
1012 CALL cp_dbcsr_sm_fm_multiply(vcd_env%matrix_dSdV(vcd_env%dcdr_env%beta)%matrix, mo_coeff, &
1013 buf, nmo, alpha=1.0_dp, beta=0.0_dp)
1014 CALL parallel_gemm(
'N',
'N', nao, nmo, nmo, &
1015 -1.0_dp, buf, vcd_env%dcdr_env%chc(ispin), &
1016 1.0_dp, vcd_env%op_dV(ispin))
1018 CALL cp_fm_release(buf)
1022 CALL cp_fm_scale(-1.0_dp, vcd_env%op_dV(1))
1025 CALL build_matrix_hr_rh(vcd_env, qs_env, [0._dp, 0._dp, 0._dp])
1027 CALL timestop(handle)
1039 TYPE(vcd_env_type) :: vcd_env
1040 TYPE(qs_p_env_type) :: p_env
1041 TYPE(qs_environment_type),
POINTER :: qs_env
1043 CHARACTER(LEN=*),
PARAMETER :: routinen =
'vcd_response_dV'
1044 INTEGER,
PARAMETER :: ispin = 1
1046 INTEGER :: handle, output_unit
1047 LOGICAL :: failure, should_stop
1048 TYPE(cp_fm_type),
DIMENSION(1) :: h1_psi0, psi1
1049 TYPE(cp_logger_type),
POINTER :: logger
1050 TYPE(linres_control_type),
POINTER :: linres_control
1051 TYPE(mo_set_type),
DIMENSION(:),
POINTER :: mos
1052 TYPE(section_vals_type),
POINTER :: lr_section, vcd_section
1054 CALL timeset(routinen, handle)
1057 NULLIFY (linres_control, lr_section, logger)
1059 CALL get_qs_env(qs_env=qs_env, &
1060 linres_control=linres_control, &
1063 logger => cp_get_default_logger()
1064 lr_section => section_vals_get_subs_vals(qs_env%input,
"PROPERTIES%LINRES")
1065 vcd_section => section_vals_get_subs_vals(qs_env%input, &
1066 "PROPERTIES%LINRES%vcd")
1068 output_unit = cp_print_key_unit_nr(logger, lr_section,
"PRINT%PROGRAM_RUN_INFO", &
1069 extension=
".linresLog")
1070 IF (output_unit > 0)
THEN
1071 WRITE (unit=output_unit, fmt=
"(T10,A,/)") &
1072 "*** Self consistent optimization of the response wavefunction ***"
1075 associate(psi0_order => vcd_env%dcdr_env%mo_coeff)
1076 CALL cp_fm_create(psi1(ispin), vcd_env%dcdr_env%likemos_fm_struct(ispin)%struct)
1077 CALL cp_fm_create(h1_psi0(ispin), vcd_env%dcdr_env%likemos_fm_struct(ispin)%struct)
1080 IF (linres_control%linres_restart)
THEN
1081 CALL vcd_read_restart(qs_env, lr_section, psi1, vcd_env%dcdr_env%lambda, vcd_env%dcdr_env%beta,
"dCdV")
1083 CALL cp_fm_set_all(psi1(ispin), 0.0_dp)
1086 IF (output_unit > 0)
THEN
1087 WRITE (output_unit, *) &
1088 "Response to the perturbation operator referring to the velocity of atom ", &
1089 vcd_env%dcdr_env%lambda,
" in "//achar(vcd_env%dcdr_env%beta + 119)
1098 CALL cp_fm_set_all(vcd_env%dCV(ispin), 0.0_dp)
1099 CALL cp_fm_set_all(h1_psi0(ispin), 0.0_dp)
1100 CALL cp_fm_to_fm(vcd_env%op_dV(ispin), h1_psi0(ispin))
1102 linres_control%lr_triplet = .false.
1103 linres_control%do_kernel = .false.
1104 linres_control%converged = .false.
1105 CALL linres_solver(p_env, qs_env, psi1, h1_psi0, psi0_order, &
1106 output_unit, should_stop)
1107 CALL cp_fm_to_fm(psi1(ispin), vcd_env%dCV(ispin))
1110 IF (linres_control%linres_restart)
THEN
1111 CALL vcd_write_restart(qs_env, lr_section, psi1, vcd_env%dcdr_env%lambda, vcd_env%dcdr_env%beta,
"dCdV")
1117 CALL cp_fm_release(psi1(ispin))
1118 CALL cp_fm_release(h1_psi0(ispin))
1120 CALL cp_print_key_finished_output(output_unit, logger, lr_section, &
1121 "PRINT%PROGRAM_RUN_INFO")
1123 CALL timestop(handle)
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...
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, 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 ...
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, 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.
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.
localize wavefunctions linear response scf
subroutine, public linres_solver(p_env, qs_env, psi1, h1_psi0, psi0_order, iounit, should_stop)
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 dipole_velocity_deriv(qs_env, difdip, order, lambda, rc)
This returns the derivative of the moment integrals [a|\mu|b], with respect to the basis function on ...
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_matrix_hr_rh(vcd_env, qs_env, rc)
Build the matrix Hr*delta_nu^\lambda - rH*delta_mu^\lambda.
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_drpnl_matrix(matrix_rv, qs_kind_set, sab_all, sap_ppnl, eps_ppnl, particle_set, pseudoatom)
dV_nl/dV. Adapted from build_com_rpnl.
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.
subroutine, public vcd_build_op_dv(vcd_env, qs_env)
What we are building here is the operator for the NVPT response: H0 * C1 - S0 * E0 * C1 = - op_dV lin...
subroutine, public vcd_response_dv(vcd_env, p_env, qs_env)
Get the dC/dV using the vcd_envop_dV.
subroutine, public aat_dv(vcd_env, qs_env)
Compute I_{alpha beta}^lambda = d/dV^lambda_beta <m_alpha> = d/dV^lambda_beta < r x.
subroutine, public apt_dv(vcd_env, qs_env)
Compute E_{alpha beta}^lambda = d/dV^lambda_beta <\mu_alpha> = d/dV^lambda_beta <.
subroutine, public prepare_per_atom_vcd(vcd_env, qs_env)
Initialize the matrices for the NVPT calculation.