27 USE dbcsr_api,
ONLY: dbcsr_add,&
33 dbcsr_type_antisymmetric,&
38 sgp_potential_p_type,&
75 #include "./base/base_uses.f90"
81 CHARACTER(len=*),
PARAMETER,
PRIVATE :: moduleN =
'rt_propagation_velocity_gauge'
93 TYPE(qs_environment_type),
POINTER :: qs_env
94 LOGICAL,
INTENT(IN),
OPTIONAL :: subtract_nl_term
96 CHARACTER(len=*),
PARAMETER :: routinen =
'velocity_gauge_ks_matrix'
98 INTEGER :: handle, idir, image, nder, nimages
99 INTEGER,
DIMENSION(:, :, :),
POINTER :: cell_to_index
100 LOGICAL :: calculate_forces, my_subtract_nl_term, &
101 ppnl_present, use_virial
102 REAL(kind=
dp) :: eps_ppnl, factor
103 REAL(kind=
dp),
DIMENSION(3) :: vec_pot
104 TYPE(atomic_kind_type),
DIMENSION(:),
POINTER :: atomic_kind_set
105 TYPE(cell_type),
POINTER :: cell
106 TYPE(dbcsr_p_type),
DIMENSION(:),
POINTER :: momentum, nl_term
107 TYPE(dbcsr_p_type),
DIMENSION(:, :),
POINTER :: matrix_h, matrix_h_im, matrix_nl, &
109 TYPE(dft_control_type),
POINTER :: dft_control
110 TYPE(kpoint_type),
POINTER :: kpoints
111 TYPE(neighbor_list_set_p_type),
DIMENSION(:), &
112 POINTER :: sab_orb, sap_ppnl
113 TYPE(particle_type),
DIMENSION(:),
POINTER :: particle_set
114 TYPE(qs_force_type),
DIMENSION(:),
POINTER :: force
115 TYPE(qs_kind_type),
DIMENSION(:),
POINTER :: qs_kind_set
116 TYPE(qs_ks_env_type),
POINTER :: ks_env
117 TYPE(qs_rho_type),
POINTER :: rho
118 TYPE(section_vals_type),
POINTER :: input
119 TYPE(virial_type),
POINTER :: virial
121 CALL timeset(routinen, handle)
125 my_subtract_nl_term = .false.
126 IF (
PRESENT(subtract_nl_term)) my_subtract_nl_term = subtract_nl_term
128 NULLIFY (dft_control, matrix_s, sab_orb, matrix_h, cell, input, matrix_h_im, kpoints, cell_to_index, &
129 sap_ppnl, particle_set, qs_kind_set, atomic_kind_set, virial, force, matrix_p, rho, matrix_nl)
133 dft_control=dft_control, &
136 matrix_s_kp=matrix_s, &
137 matrix_h_kp=matrix_h, &
140 matrix_h_im_kp=matrix_h_im)
142 nimages = dft_control%nimages
143 ppnl_present =
ASSOCIATED(sap_ppnl)
145 IF (nimages > 1)
THEN
146 CALL get_ks_env(ks_env=ks_env, kpoints=kpoints)
150 IF (my_subtract_nl_term)
THEN
151 IF (ppnl_present)
THEN
153 qs_kind_set=qs_kind_set, &
154 particle_set=particle_set, &
155 atomic_kind_set=atomic_kind_set, &
161 calculate_forces = .false.
164 eps_ppnl = dft_control%qs_control%eps_ppnl
167 DO image = 1, nimages
168 ALLOCATE (matrix_nl(1, image)%matrix)
169 CALL dbcsr_create(matrix_nl(1, image)%matrix, template=matrix_s(1, 1)%matrix)
171 CALL dbcsr_set(matrix_nl(1, image)%matrix,
zero)
174 CALL build_core_ppnl(matrix_nl, matrix_p, force, virial, calculate_forces, use_virial, nder, &
175 qs_kind_set, atomic_kind_set, particle_set, sab_orb, sap_ppnl, eps_ppnl, &
176 nimages, cell_to_index,
"ORB")
178 DO image = 1, nimages
179 CALL dbcsr_add(matrix_h(1, image)%matrix, matrix_nl(1, image)%matrix,
one, -
one)
187 vec_pot = dft_control%rtp_control%vec_pot
193 CALL dbcsr_init_p(momentum(idir)%matrix)
194 CALL dbcsr_create(momentum(idir)%matrix, template=matrix_s(1, 1)%matrix, &
195 matrix_type=dbcsr_type_antisymmetric)
197 CALL dbcsr_set(momentum(idir)%matrix,
zero)
202 DO image = 1, nimages
203 CALL dbcsr_set(matrix_h_im(1, image)%matrix,
zero)
207 DO image = 1, nimages
209 CALL dbcsr_add(matrix_h_im(1, image)%matrix, momentum(idir)%matrix,
one, -vec_pot(idir))
218 factor = factor + vec_pot(idir)**2
221 DO image = 1, nimages
222 CALL dbcsr_add(matrix_h(1, image)%matrix, matrix_s(1, image)%matrix,
one, 0.5*factor)
226 IF (ppnl_present)
THEN
227 IF (dft_control%rtp_control%nl_gauge_transform)
THEN
231 CALL dbcsr_init_p(nl_term(1)%matrix)
232 CALL dbcsr_create(nl_term(1)%matrix, template=matrix_s(1, 1)%matrix, &
233 matrix_type=dbcsr_type_symmetric, name=
"nl gauge term real part")
235 CALL dbcsr_set(nl_term(1)%matrix,
zero)
237 CALL dbcsr_init_p(nl_term(2)%matrix)
238 CALL dbcsr_create(nl_term(2)%matrix, template=matrix_s(1, 1)%matrix, &
239 matrix_type=dbcsr_type_antisymmetric, name=
"nl gauge term imaginary part")
241 CALL dbcsr_set(nl_term(2)%matrix,
zero)
243 CALL velocity_gauge_nl_term(qs_env, nl_term, vec_pot)
245 DO image = 1, nimages
246 CALL dbcsr_add(matrix_h(1, image)%matrix, nl_term(1)%matrix,
one,
one)
247 CALL dbcsr_add(matrix_h_im(1, image)%matrix, nl_term(2)%matrix,
one,
one)
253 CALL timestop(handle)
264 TYPE(qs_environment_type),
INTENT(INOUT),
POINTER :: qs_env
265 TYPE(dft_control_type),
INTENT(INOUT),
POINTER :: dft_control
267 REAL(kind=
dp) :: field(3)
269 CALL make_field(dft_control, field, qs_env%sim_step, qs_env%sim_time)
270 dft_control%rtp_control%field = field
271 dft_control%rtp_control%vec_pot = dft_control%rtp_control%vec_pot - field*qs_env%rtp%dt
273 dft_control%efield_fields(1)%efield%vec_pot_initial = dft_control%rtp_control%vec_pot
283 SUBROUTINE velocity_gauge_nl_term(qs_env, nl_term, vec_pot)
284 TYPE(qs_environment_type),
POINTER :: qs_env
285 TYPE(dbcsr_p_type),
DIMENSION(:),
INTENT(INOUT), &
287 REAL(kind=
dp),
DIMENSION(3),
INTENT(in) :: vec_pot
289 CHARACTER(len=*),
PARAMETER :: routiunen =
"velocity_gauge_nl_term"
291 INTEGER :: handle, i, iac, iatom, ibc, icol, ikind, &
292 irow, jatom, jkind, kac, kbc, kkind, &
293 maxl, maxlgto, maxlppnl, na, natom, &
295 INTEGER,
DIMENSION(3) :: cell_b
298 REAL(kind=
dp),
DIMENSION(3) :: rab
299 REAL(kind=
dp),
DIMENSION(:, :),
POINTER :: imag_block, real_block
300 REAL(kind=
dp),
DIMENSION(:, :, :),
POINTER :: achint_cos, achint_sin, acint_cos, &
301 acint_sin, bchint_cos, bchint_sin, &
303 TYPE(alist_type),
POINTER :: alist_cos_ac, alist_cos_bc, &
304 alist_sin_ac, alist_sin_bc
305 TYPE(atomic_kind_type),
DIMENSION(:),
POINTER :: atomic_kind_set
306 TYPE(cell_type),
POINTER :: cell
307 TYPE(dft_control_type),
POINTER :: dft_control
308 TYPE(gto_basis_set_p_type),
ALLOCATABLE, &
309 DIMENSION(:) :: basis_set
310 TYPE(gto_basis_set_type),
POINTER :: orb_basis_set
311 TYPE(neighbor_list_set_p_type),
DIMENSION(:), &
312 POINTER :: sab_orb, sap_ppnl
313 TYPE(particle_type),
DIMENSION(:),
POINTER :: particle_set
314 TYPE(qs_kind_type),
DIMENSION(:),
POINTER :: qs_kind_set
315 TYPE(sap_int_type),
DIMENSION(:),
POINTER :: sap_int_cos, sap_int_sin
325 CALL timeset(routiunen, handle)
327 NULLIFY (sap_ppnl, sab_orb)
332 IF (
ASSOCIATED(sap_ppnl))
THEN
333 NULLIFY (qs_kind_set, particle_set, cell, dft_control)
335 dft_control=dft_control, &
336 qs_kind_set=qs_kind_set, &
337 particle_set=particle_set, &
339 atomic_kind_set=atomic_kind_set)
341 nkind =
SIZE(atomic_kind_set)
342 natom =
SIZE(particle_set)
343 eps_ppnl = dft_control%qs_control%eps_ppnl
349 maxl = max(maxlppnl, maxlgto)
353 NULLIFY (sap_int_cos, sap_int_sin)
354 ALLOCATE (sap_int_cos(nkind*nkind), sap_int_sin(nkind*nkind))
355 DO i = 1,
SIZE(sap_int_cos)
356 NULLIFY (sap_int_cos(i)%alist, sap_int_cos(i)%asort, sap_int_cos(i)%aindex)
357 sap_int_cos(i)%nalist = 0
358 NULLIFY (sap_int_sin(i)%alist, sap_int_sin(i)%asort, sap_int_sin(i)%aindex)
359 sap_int_sin(i)%nalist = 0
363 ALLOCATE (basis_set(nkind))
365 CALL get_qs_kind(qs_kind_set(ikind), basis_set=orb_basis_set)
366 IF (
ASSOCIATED(orb_basis_set))
THEN
367 basis_set(ikind)%gto_basis_set => orb_basis_set
369 NULLIFY (basis_set(ikind)%gto_basis_set)
374 CALL build_sap_exp_ints(sap_int_cos, sap_int_sin, sap_ppnl, qs_kind_set, particle_set, &
375 cell, kvec=vec_pot, basis_set=basis_set, nkind=nkind, &
400 NULLIFY (real_block, imag_block)
401 NULLIFY (acint_cos, bcint_cos, achint_cos, bchint_cos)
402 NULLIFY (acint_sin, bcint_sin, achint_sin, bchint_sin)
406 DO slot = 1, sab_orb(1)%nl_size
407 ikind = sab_orb(1)%nlist_task(slot)%ikind
408 jkind = sab_orb(1)%nlist_task(slot)%jkind
409 iatom = sab_orb(1)%nlist_task(slot)%iatom
410 jatom = sab_orb(1)%nlist_task(slot)%jatom
411 cell_b(:) = sab_orb(1)%nlist_task(slot)%cell
412 rab(1:3) = sab_orb(1)%nlist_task(slot)%r(1:3)
414 IF (.NOT.
ASSOCIATED(basis_set(ikind)%gto_basis_set)) cycle
415 IF (.NOT.
ASSOCIATED(basis_set(jkind)%gto_basis_set)) cycle
417 IF (iatom <= jatom)
THEN
425 CALL dbcsr_get_block_p(nl_term(1)%matrix, irow, icol, real_block, found)
426 CALL dbcsr_get_block_p(nl_term(2)%matrix, irow, icol, imag_block, found)
428 IF (
ASSOCIATED(real_block) .AND.
ASSOCIATED(imag_block))
THEN
431 iac = ikind + nkind*(kkind - 1)
432 ibc = jkind + nkind*(kkind - 1)
433 IF (.NOT.
ASSOCIATED(sap_int_cos(iac)%alist)) cycle
434 IF (.NOT.
ASSOCIATED(sap_int_cos(ibc)%alist)) cycle
435 IF (.NOT.
ASSOCIATED(sap_int_sin(iac)%alist)) cycle
436 IF (.NOT.
ASSOCIATED(sap_int_sin(ibc)%alist)) cycle
437 CALL get_alist(sap_int_cos(iac), alist_cos_ac, iatom)
438 CALL get_alist(sap_int_cos(ibc), alist_cos_bc, jatom)
439 CALL get_alist(sap_int_sin(iac), alist_sin_ac, iatom)
440 CALL get_alist(sap_int_sin(ibc), alist_sin_bc, jatom)
441 IF (.NOT.
ASSOCIATED(alist_cos_ac)) cycle
442 IF (.NOT.
ASSOCIATED(alist_cos_bc)) cycle
443 IF (.NOT.
ASSOCIATED(alist_sin_ac)) cycle
444 IF (.NOT.
ASSOCIATED(alist_sin_bc)) cycle
448 DO kac = 1, alist_cos_ac%nclist
449 DO kbc = 1, alist_cos_bc%nclist
451 IF (alist_cos_ac%clist(kac)%catom /= alist_cos_bc%clist(kbc)%catom) cycle
452 IF (all(cell_b + alist_cos_bc%clist(kbc)%cell - alist_cos_ac%clist(kac)%cell == 0))
THEN
454 IF (alist_cos_ac%clist(kac)%maxac*alist_cos_bc%clist(kbc)%maxach < eps_ppnl &
455 .AND. alist_cos_ac%clist(kac)%maxac*alist_sin_bc%clist(kbc)%maxach < eps_ppnl &
456 .AND. alist_sin_ac%clist(kac)%maxac*alist_cos_bc%clist(kbc)%maxach < eps_ppnl &
457 .AND. alist_sin_ac%clist(kac)%maxac*alist_sin_bc%clist(kbc)%maxach < eps_ppnl) cycle
459 acint_cos => alist_cos_ac%clist(kac)%acint
460 bcint_cos => alist_cos_bc%clist(kbc)%acint
461 achint_cos => alist_cos_ac%clist(kac)%achint
462 bchint_cos => alist_cos_bc%clist(kbc)%achint
463 acint_sin => alist_sin_ac%clist(kac)%acint
464 bcint_sin => alist_sin_bc%clist(kbc)%acint
465 achint_sin => alist_sin_ac%clist(kac)%achint
466 bchint_sin => alist_sin_bc%clist(kbc)%achint
468 na =
SIZE(acint_cos, 1)
469 np =
SIZE(acint_cos, 2)
470 nb =
SIZE(bcint_cos, 1)
474 IF (iatom <= jatom)
THEN
476 real_block(1:na, 1:nb) = real_block(1:na, 1:nb) + &
477 matmul(achint_cos(1:na, 1:np, 1), transpose(bcint_cos(1:nb, 1:np, 1))) + &
478 matmul(achint_sin(1:na, 1:np, 1), transpose(bcint_sin(1:nb, 1:np, 1)))
480 imag_block(1:na, 1:nb) = imag_block(1:na, 1:nb) - &
481 matmul(achint_sin(1:na, 1:np, 1), transpose(bcint_cos(1:nb, 1:np, 1))) + &
482 matmul(achint_cos(1:na, 1:np, 1), transpose(bcint_sin(1:nb, 1:np, 1)))
485 real_block(1:nb, 1:na) = real_block(1:nb, 1:na) + &
486 matmul(bchint_cos(1:nb, 1:np, 1), transpose(acint_cos(1:na, 1:np, 1))) + &
487 matmul(bchint_sin(1:nb, 1:np, 1), transpose(acint_sin(1:na, 1:np, 1)))
489 imag_block(1:nb, 1:na) = imag_block(1:nb, 1:na) - &
490 matmul(bchint_sin(1:nb, 1:np, 1), transpose(acint_cos(1:na, 1:np, 1))) + &
491 matmul(bchint_cos(1:nb, 1:np, 1), transpose(acint_sin(1:na, 1:np, 1)))
518 DEALLOCATE (basis_set)
521 CALL timestop(handle)
523 END SUBROUTINE velocity_gauge_nl_term
542 SUBROUTINE build_sap_exp_ints(sap_int_cos, sap_int_sin, sap_ppnl, qs_kind_set, particle_set, cell, &
543 kvec, basis_set, nkind, derivative)
544 TYPE(sap_int_type),
DIMENSION(:),
INTENT(INOUT), &
545 POINTER :: sap_int_cos, sap_int_sin
546 TYPE(neighbor_list_set_p_type),
DIMENSION(:), &
547 INTENT(IN),
POINTER :: sap_ppnl
548 TYPE(qs_kind_type),
DIMENSION(:),
INTENT(IN), &
549 POINTER :: qs_kind_set
550 TYPE(particle_type),
DIMENSION(:),
INTENT(IN), &
551 POINTER :: particle_set
552 TYPE(cell_type),
INTENT(IN),
POINTER :: cell
553 REAL(kind=
dp),
DIMENSION(3),
INTENT(in) :: kvec
554 TYPE(gto_basis_set_p_type),
DIMENSION(:), &
555 INTENT(IN) :: basis_set
556 INTEGER,
INTENT(IN) :: nkind
557 LOGICAL,
INTENT(IN) :: derivative
559 CHARACTER(len=*),
PARAMETER :: routiunen =
"build_sap_exp_ints"
561 INTEGER :: handle, i, iac, iatom, idir, ikind, ilist, iset, jneighbor, katom, kkind, l, &
562 lc_max, lc_min, ldai, ldints, lppnl, maxco, maxl, maxlgto, maxlppnl, maxppnl, maxsgf, na, &
563 nb, ncoa, ncoc, nlist, nneighbor, np, nppnl, nprjc, nseta, nsgfa, prjc, sgfa, slot
564 INTEGER,
DIMENSION(3) :: cell_c
565 INTEGER,
DIMENSION(:),
POINTER :: la_max, la_min, npgfa, nprj_ppnl, &
567 INTEGER,
DIMENSION(:, :),
POINTER :: first_sgfa
569 REAL(kind=
dp) :: dac, ppnl_radius
570 REAL(kind=
dp),
ALLOCATABLE,
DIMENSION(:, :) :: ai_work_cos, ai_work_sin, work_cos, &
572 REAL(kind=
dp),
ALLOCATABLE,
DIMENSION(:, :, :) :: ai_work_dcos, ai_work_dsin, work_dcos, &
574 REAL(kind=
dp),
DIMENSION(1) :: rprjc, zetc
575 REAL(kind=
dp),
DIMENSION(3) :: ra, rac, raf, rc, rcf
576 REAL(kind=
dp),
DIMENSION(:),
POINTER :: alpha_ppnl, set_radius_a
577 REAL(kind=
dp),
DIMENSION(:, :),
POINTER :: cprj, rpgfa, sphi_a, vprj_ppnl, zeta
578 TYPE(clist_type),
POINTER :: clist, clist_sin
579 TYPE(gth_potential_p_type),
DIMENSION(:),
POINTER :: gpotential
580 TYPE(gth_potential_type),
POINTER :: gth_potential
581 TYPE(sgp_potential_p_type),
DIMENSION(:),
POINTER :: spotential
582 TYPE(sgp_potential_type),
POINTER :: sgp_potential
584 CALL timeset(routiunen, handle)
594 maxl = max(maxlppnl, maxlgto)
595 ldints = max(maxco,
ncoset(maxlppnl), maxsgf, maxppnl)
599 NULLIFY (gpotential, spotential)
600 ALLOCATE (gpotential(nkind), spotential(nkind))
602 CALL get_qs_kind(qs_kind_set(ikind), gth_potential=gth_potential, sgp_potential=sgp_potential)
603 NULLIFY (gpotential(ikind)%gth_potential)
604 NULLIFY (spotential(ikind)%sgp_potential)
605 IF (
ASSOCIATED(gth_potential))
THEN
606 gpotential(ikind)%gth_potential => gth_potential
607 ELSE IF (
ASSOCIATED(sgp_potential))
THEN
608 spotential(ikind)%sgp_potential => sgp_potential
614 DO slot = 1, sap_ppnl(1)%nl_size
616 ikind = sap_ppnl(1)%nlist_task(slot)%ikind
617 kkind = sap_ppnl(1)%nlist_task(slot)%jkind
618 iatom = sap_ppnl(1)%nlist_task(slot)%iatom
619 katom = sap_ppnl(1)%nlist_task(slot)%jatom
620 nlist = sap_ppnl(1)%nlist_task(slot)%nlist
621 ilist = sap_ppnl(1)%nlist_task(slot)%ilist
622 nneighbor = sap_ppnl(1)%nlist_task(slot)%nnode
624 iac = ikind + nkind*(kkind - 1)
625 IF (.NOT.
ASSOCIATED(basis_set(ikind)%gto_basis_set)) cycle
626 IF (.NOT.
ASSOCIATED(gpotential(kkind)%gth_potential) .AND. &
627 .NOT.
ASSOCIATED(spotential(kkind)%sgp_potential)) cycle
628 IF (.NOT.
ASSOCIATED(sap_int_cos(iac)%alist))
THEN
629 sap_int_cos(iac)%a_kind = ikind
630 sap_int_cos(iac)%p_kind = kkind
631 sap_int_cos(iac)%nalist = nlist
632 ALLOCATE (sap_int_cos(iac)%alist(nlist))
634 NULLIFY (sap_int_cos(iac)%alist(i)%clist)
635 sap_int_cos(iac)%alist(i)%aatom = 0
636 sap_int_cos(iac)%alist(i)%nclist = 0
639 IF (.NOT.
ASSOCIATED(sap_int_cos(iac)%alist(ilist)%clist))
THEN
640 sap_int_cos(iac)%alist(ilist)%aatom = iatom
641 sap_int_cos(iac)%alist(ilist)%nclist = nneighbor
642 ALLOCATE (sap_int_cos(iac)%alist(ilist)%clist(nneighbor))
644 clist => sap_int_cos(iac)%alist(ilist)%clist(i)
646 NULLIFY (clist%acint)
647 NULLIFY (clist%achint)
648 NULLIFY (clist%sgf_list)
651 IF (.NOT.
ASSOCIATED(sap_int_sin(iac)%alist))
THEN
652 sap_int_sin(iac)%a_kind = ikind
653 sap_int_sin(iac)%p_kind = kkind
654 sap_int_sin(iac)%nalist = nlist
655 ALLOCATE (sap_int_sin(iac)%alist(nlist))
657 NULLIFY (sap_int_sin(iac)%alist(i)%clist)
658 sap_int_sin(iac)%alist(i)%aatom = 0
659 sap_int_sin(iac)%alist(i)%nclist = 0
662 IF (.NOT.
ASSOCIATED(sap_int_sin(iac)%alist(ilist)%clist))
THEN
663 sap_int_sin(iac)%alist(ilist)%aatom = iatom
664 sap_int_sin(iac)%alist(ilist)%nclist = nneighbor
665 ALLOCATE (sap_int_sin(iac)%alist(ilist)%clist(nneighbor))
667 clist => sap_int_sin(iac)%alist(ilist)%clist(i)
669 NULLIFY (clist%acint)
670 NULLIFY (clist%achint)
671 NULLIFY (clist%sgf_list)
690 ALLOCATE (work_cos(ldints, ldints), work_sin(ldints, ldints))
691 ALLOCATE (ai_work_cos(maxco, maxco), ai_work_sin(maxco, maxco))
693 ALLOCATE (work_dcos(ldints, ldints, 3), work_dsin(ldints, ldints, 3))
694 ALLOCATE (ai_work_dcos(maxco, maxco, 3), ai_work_dsin(maxco, maxco, 3))
701 ai_work_dcos = 0.0_dp
702 ai_work_dsin = 0.0_dp
706 NULLIFY (first_sgfa, la_max, la_min, npgfa, nsgf_seta, rpgfa, set_radius_a, sphi_a, zeta)
707 NULLIFY (alpha_ppnl, cprj, nprj_ppnl, vprj_ppnl)
708 NULLIFY (clist, clist_sin)
711 DO slot = 1, sap_ppnl(1)%nl_size
712 ikind = sap_ppnl(1)%nlist_task(slot)%ikind
713 kkind = sap_ppnl(1)%nlist_task(slot)%jkind
714 iatom = sap_ppnl(1)%nlist_task(slot)%iatom
715 katom = sap_ppnl(1)%nlist_task(slot)%jatom
716 nlist = sap_ppnl(1)%nlist_task(slot)%nlist
717 ilist = sap_ppnl(1)%nlist_task(slot)%ilist
718 nneighbor = sap_ppnl(1)%nlist_task(slot)%nnode
719 jneighbor = sap_ppnl(1)%nlist_task(slot)%inode
720 cell_c(:) = sap_ppnl(1)%nlist_task(slot)%cell(:)
721 rac(1:3) = sap_ppnl(1)%nlist_task(slot)%r(1:3)
724 iac = ikind + nkind*(kkind - 1)
725 IF (.NOT.
ASSOCIATED(basis_set(ikind)%gto_basis_set)) cycle
727 first_sgfa => basis_set(ikind)%gto_basis_set%first_sgf
728 la_max => basis_set(ikind)%gto_basis_set%lmax
729 la_min => basis_set(ikind)%gto_basis_set%lmin
730 npgfa => basis_set(ikind)%gto_basis_set%npgf
731 nseta = basis_set(ikind)%gto_basis_set%nset
732 nsgfa = basis_set(ikind)%gto_basis_set%nsgf
733 nsgf_seta => basis_set(ikind)%gto_basis_set%nsgf_set
734 rpgfa => basis_set(ikind)%gto_basis_set%pgf_radius
735 set_radius_a => basis_set(ikind)%gto_basis_set%set_radius
736 sphi_a => basis_set(ikind)%gto_basis_set%sphi
737 zeta => basis_set(ikind)%gto_basis_set%zet
739 IF (
ASSOCIATED(gpotential(kkind)%gth_potential))
THEN
742 alpha_ppnl => gpotential(kkind)%gth_potential%alpha_ppnl
743 cprj => gpotential(kkind)%gth_potential%cprj
744 lppnl = gpotential(kkind)%gth_potential%lppnl
745 nppnl = gpotential(kkind)%gth_potential%nppnl
746 nprj_ppnl => gpotential(kkind)%gth_potential%nprj_ppnl
747 ppnl_radius = gpotential(kkind)%gth_potential%ppnl_radius
748 vprj_ppnl => gpotential(kkind)%gth_potential%vprj_ppnl
753 clist => sap_int_cos(iac)%alist(ilist)%clist(jneighbor)
754 clist_sin => sap_int_sin(iac)%alist(ilist)%clist(jneighbor)
759 clist_sin%catom = katom
760 clist_sin%cell = cell_c
763 IF (.NOT. derivative)
THEN
764 ALLOCATE (clist%acint(nsgfa, nppnl, 1), clist%achint(nsgfa, nppnl, 1))
766 ALLOCATE (clist%acint(nsgfa, nppnl, 4), clist%achint(nsgfa, nppnl, 4))
769 clist%achint = 0.0_dp
772 IF (.NOT. derivative)
THEN
773 ALLOCATE (clist_sin%acint(nsgfa, nppnl, 1), clist_sin%achint(nsgfa, nppnl, 1))
775 ALLOCATE (clist_sin%acint(nsgfa, nppnl, 4), clist_sin%achint(nsgfa, nppnl, 4))
777 clist_sin%acint = 0.0_dp
778 clist_sin%achint = 0.0_dp
779 clist_sin%nsgf_cnt = 0
782 ra(:) =
pbc(particle_set(iatom)%r(:), cell)
790 ncoa = npgfa(iset)*
ncoset(la_max(iset))
791 sgfa = first_sgfa(1, iset)
797 nprjc = nprj_ppnl(l)*
nco(l)
798 IF (nprjc == 0) cycle
799 rprjc(1) = ppnl_radius
800 IF (set_radius_a(iset) + rprjc(1) < dac) cycle
801 lc_max = l + 2*(nprj_ppnl(l) - 1)
803 zetc(1) = alpha_ppnl(l)
806 IF (.NOT. derivative)
THEN
807 CALL cossin(la_max(iset), npgfa(iset), zeta(:, iset), rpgfa(:, iset), la_min(iset), &
808 lc_max, 1, zetc, rprjc, lc_min, raf, rcf, kvec, ai_work_cos, ai_work_sin)
810 CALL cossin(la_max(iset), npgfa(iset), zeta(:, iset), rpgfa(:, iset), la_min(iset), &
811 lc_max, 1, zetc, rprjc, lc_min, raf, rcf, kvec, ai_work_cos, ai_work_sin, &
812 dcosab=ai_work_dcos, dsinab=ai_work_dsin)
818 work_cos(1:na, prjc:prjc + nb - 1) = &
819 matmul(ai_work_cos(1:na, 1:np), cprj(1:np, prjc:prjc + nb - 1))
820 work_sin(1:na, prjc:prjc + nb - 1) = &
821 matmul(ai_work_sin(1:na, 1:np), cprj(1:np, prjc:prjc + nb - 1))
825 work_dcos(1:na, prjc:prjc + nb - 1, idir) = &
826 matmul(ai_work_dcos(1:na, 1:np, idir), cprj(1:np, prjc:prjc + nb - 1))
827 work_dsin(1:na, prjc:prjc + nb - 1, idir) = &
828 matmul(ai_work_dsin(1:na, 1:np, idir), cprj(1:np, prjc:prjc + nb - 1))
839 clist%acint(sgfa:sgfa + na - 1, 1:nb, 1) = &
840 matmul(transpose(sphi_a(1:np, sgfa:sgfa + na - 1)), work_cos(1:np, 1:nb))
841 clist_sin%acint(sgfa:sgfa + na - 1, 1:nb, 1) = &
842 matmul(transpose(sphi_a(1:np, sgfa:sgfa + na - 1)), work_sin(1:np, 1:nb))
845 clist%acint(sgfa:sgfa + na - 1, 1:nb, 1 + idir) = &
846 matmul(transpose(sphi_a(1:np, sgfa:sgfa + na - 1)), work_dcos(1:np, 1:nb, idir))
847 clist_sin%acint(sgfa:sgfa + na - 1, 1:nb, 1 + idir) = &
848 matmul(transpose(sphi_a(1:np, sgfa:sgfa + na - 1)), work_dsin(1:np, 1:nb, idir))
853 clist%achint(sgfa:sgfa + na - 1, 1:nb, 1) = &
854 matmul(clist%acint(sgfa:sgfa + na - 1, 1:nb, 1), vprj_ppnl(1:nb, 1:nb))
855 clist_sin%achint(sgfa:sgfa + na - 1, 1:nb, 1) = &
856 matmul(clist_sin%acint(sgfa:sgfa + na - 1, 1:nb, 1), vprj_ppnl(1:nb, 1:nb))
859 clist%achint(sgfa:sgfa + na - 1, 1:nb, 1 + idir) = &
860 matmul(clist%acint(sgfa:sgfa + na - 1, 1:nb, 1 + idir), vprj_ppnl(1:nb, 1:nb))
861 clist_sin%achint(sgfa:sgfa + na - 1, 1:nb, 1 + idir) = &
862 matmul(clist_sin%acint(sgfa:sgfa + na - 1, 1:nb, 1 + idir), vprj_ppnl(1:nb, 1:nb))
868 clist%maxac = maxval(abs(clist%acint(:, :, 1)))
869 clist%maxach = maxval(abs(clist%achint(:, :, 1)))
870 clist_sin%maxac = maxval(abs(clist_sin%acint(:, :, 1)))
871 clist_sin%maxach = maxval(abs(clist_sin%achint(:, :, 1)))
874 DEALLOCATE (work_cos, work_sin, ai_work_cos, ai_work_sin)
875 IF (derivative)
DEALLOCATE (work_dcos, work_dsin, ai_work_dcos, ai_work_dsin)
879 DEALLOCATE (gpotential, spotential)
881 CALL timestop(handle)
883 END SUBROUTINE build_sap_exp_ints
893 TYPE(qs_environment_type),
POINTER :: qs_env
894 TYPE(particle_type),
DIMENSION(:),
POINTER :: particle_set
896 CHARACTER(len=*),
PARAMETER :: routiunen =
"velocity_gauge_nl_force"
898 INTEGER :: handle, i, iac, iatom, ibc, icol, idir, ikind, irow, jatom, jkind, kac, katom, &
899 kbc, kkind, maxl, maxlgto, maxlppnl, na, natom, nb, nkind, np, slot
900 INTEGER,
ALLOCATABLE,
DIMENSION(:) :: atom_of_kind, kind_of
901 INTEGER,
DIMENSION(3) :: cell_b
902 LOGICAL :: found_imag, found_real
903 REAL(
dp) :: eps_ppnl, f0, sign_imag
904 REAL(kind=
dp),
DIMENSION(3) :: fa, fb, rab, vec_pot
905 TYPE(neighbor_list_set_p_type),
DIMENSION(:), &
906 POINTER :: sab_orb, sap_ppnl
907 TYPE(gto_basis_set_type),
POINTER :: orb_basis_set
908 TYPE(gto_basis_set_p_type),
ALLOCATABLE, &
909 DIMENSION(:) :: basis_set
910 TYPE(dft_control_type),
POINTER :: dft_control
911 TYPE(dbcsr_p_type),
DIMENSION(:),
POINTER :: rho_ao, rho_ao_im
912 TYPE(cell_type),
POINTER :: cell
913 TYPE(atomic_kind_type),
DIMENSION(:),
POINTER :: atomic_kind_set
914 TYPE(alist_type),
POINTER :: alist_cos_ac, alist_cos_bc, &
915 alist_sin_ac, alist_sin_bc
916 REAL(kind=
dp),
DIMENSION(:, :, :),
POINTER :: achint_cos, achint_sin, acint_cos, &
917 acint_sin, bchint_cos, bchint_sin, &
919 REAL(kind=
dp),
DIMENSION(:, :),
POINTER :: matrix_p_imag, matrix_p_real
920 REAL(kind=
dp),
DIMENSION(3, SIZE(particle_set)) :: force_thread
921 TYPE(qs_force_type),
DIMENSION(:),
POINTER :: force
922 TYPE(qs_kind_type),
DIMENSION(:),
POINTER :: qs_kind_set
923 TYPE(qs_rho_type),
POINTER :: rho
924 TYPE(sap_int_type),
DIMENSION(:),
POINTER :: sap_int_cos, sap_int_sin
926 CALL timeset(routiunen, handle)
933 IF (
ASSOCIATED(sap_ppnl))
THEN
934 NULLIFY (qs_kind_set, cell, dft_control, force, sab_orb, atomic_kind_set, &
935 sap_int_cos, sap_int_sin)
941 dft_control=dft_control, &
942 qs_kind_set=qs_kind_set, &
944 atomic_kind_set=atomic_kind_set, &
947 nkind =
SIZE(atomic_kind_set)
948 natom =
SIZE(particle_set)
949 eps_ppnl = dft_control%qs_control%eps_ppnl
955 maxl = max(maxlppnl, maxlgto)
959 ALLOCATE (sap_int_cos(nkind*nkind), sap_int_sin(nkind*nkind))
960 DO i = 1,
SIZE(sap_int_cos)
961 NULLIFY (sap_int_cos(i)%alist, sap_int_cos(i)%asort, sap_int_cos(i)%aindex)
962 sap_int_cos(i)%nalist = 0
963 NULLIFY (sap_int_sin(i)%alist, sap_int_sin(i)%asort, sap_int_sin(i)%aindex)
964 sap_int_sin(i)%nalist = 0
968 ALLOCATE (basis_set(nkind))
970 CALL get_qs_kind(qs_kind_set(ikind), basis_set=orb_basis_set)
971 IF (
ASSOCIATED(orb_basis_set))
THEN
972 basis_set(ikind)%gto_basis_set => orb_basis_set
974 NULLIFY (basis_set(ikind)%gto_basis_set)
979 vec_pot = dft_control%rtp_control%vec_pot
981 force_thread = 0.0_dp
983 CALL qs_rho_get(rho_struct=rho, rho_ao=rho_ao, rho_ao_im=rho_ao_im)
985 IF (
SIZE(rho_ao) == 2)
THEN
986 CALL dbcsr_add(rho_ao(1)%matrix, rho_ao(2)%matrix, &
987 alpha_scalar=1.0_dp, beta_scalar=1.0_dp)
988 CALL dbcsr_add(rho_ao_im(1)%matrix, rho_ao_im(2)%matrix, &
989 alpha_scalar=1.0_dp, beta_scalar=1.0_dp)
993 CALL build_sap_exp_ints(sap_int_cos, sap_int_sin, sap_ppnl, qs_kind_set, particle_set, &
994 cell, kvec=vec_pot, basis_set=basis_set, nkind=nkind, derivative=.true.)
1011 NULLIFY (acint_cos, bcint_cos, achint_cos, bchint_cos)
1012 NULLIFY (acint_sin, bcint_sin, achint_sin, bchint_sin)
1016 DO slot = 1, sab_orb(1)%nl_size
1017 ikind = sab_orb(1)%nlist_task(slot)%ikind
1018 jkind = sab_orb(1)%nlist_task(slot)%jkind
1019 iatom = sab_orb(1)%nlist_task(slot)%iatom
1020 jatom = sab_orb(1)%nlist_task(slot)%jatom
1021 cell_b(:) = sab_orb(1)%nlist_task(slot)%cell
1022 rab(1:3) = sab_orb(1)%nlist_task(slot)%r(1:3)
1024 IF (.NOT.
ASSOCIATED(basis_set(ikind)%gto_basis_set)) cycle
1025 IF (.NOT.
ASSOCIATED(basis_set(jkind)%gto_basis_set)) cycle
1028 IF (iatom == jatom)
THEN
1037 IF (iatom <= jatom)
THEN
1046 NULLIFY (matrix_p_real, matrix_p_imag)
1047 CALL dbcsr_get_block_p(rho_ao(1)%matrix, irow, icol, matrix_p_real, found_real)
1048 CALL dbcsr_get_block_p(rho_ao_im(1)%matrix, irow, icol, matrix_p_imag, found_imag)
1050 IF (found_real .OR. found_imag)
THEN
1053 iac = ikind + nkind*(kkind - 1)
1054 ibc = jkind + nkind*(kkind - 1)
1055 IF (.NOT.
ASSOCIATED(sap_int_cos(iac)%alist)) cycle
1056 IF (.NOT.
ASSOCIATED(sap_int_cos(ibc)%alist)) cycle
1057 IF (.NOT.
ASSOCIATED(sap_int_sin(iac)%alist)) cycle
1058 IF (.NOT.
ASSOCIATED(sap_int_sin(ibc)%alist)) cycle
1059 CALL get_alist(sap_int_cos(iac), alist_cos_ac, iatom)
1060 CALL get_alist(sap_int_cos(ibc), alist_cos_bc, jatom)
1061 CALL get_alist(sap_int_sin(iac), alist_sin_ac, iatom)
1062 CALL get_alist(sap_int_sin(ibc), alist_sin_bc, jatom)
1063 IF (.NOT.
ASSOCIATED(alist_cos_ac)) cycle
1064 IF (.NOT.
ASSOCIATED(alist_cos_bc)) cycle
1065 IF (.NOT.
ASSOCIATED(alist_sin_ac)) cycle
1066 IF (.NOT.
ASSOCIATED(alist_sin_bc)) cycle
1070 DO kac = 1, alist_cos_ac%nclist
1071 DO kbc = 1, alist_cos_bc%nclist
1073 IF (alist_cos_ac%clist(kac)%catom /= alist_cos_bc%clist(kbc)%catom) cycle
1074 IF (all(cell_b + alist_cos_bc%clist(kbc)%cell - alist_cos_ac%clist(kac)%cell == 0))
THEN
1076 IF (alist_cos_ac%clist(kac)%maxac*alist_cos_bc%clist(kbc)%maxach < eps_ppnl &
1077 .AND. alist_cos_ac%clist(kac)%maxac*alist_sin_bc%clist(kbc)%maxach < eps_ppnl &
1078 .AND. alist_sin_ac%clist(kac)%maxac*alist_cos_bc%clist(kbc)%maxach < eps_ppnl &
1079 .AND. alist_sin_ac%clist(kac)%maxac*alist_sin_bc%clist(kbc)%maxach < eps_ppnl) cycle
1081 acint_cos => alist_cos_ac%clist(kac)%acint
1082 bcint_cos => alist_cos_bc%clist(kbc)%acint
1083 achint_cos => alist_cos_ac%clist(kac)%achint
1084 bchint_cos => alist_cos_bc%clist(kbc)%achint
1085 acint_sin => alist_sin_ac%clist(kac)%acint
1086 bcint_sin => alist_sin_bc%clist(kbc)%acint
1087 achint_sin => alist_sin_ac%clist(kac)%achint
1088 bchint_sin => alist_sin_bc%clist(kbc)%achint
1090 na =
SIZE(acint_cos, 1)
1091 np =
SIZE(acint_cos, 2)
1092 nb =
SIZE(bcint_cos, 1)
1095 katom = alist_cos_ac%clist(kac)%catom
1097 IF (iatom <= jatom)
THEN
1100 fa(idir) = sum(matrix_p_real(1:na, 1:nb)* &
1101 (+matmul(acint_cos(1:na, 1:np, 1 + idir), transpose(bchint_cos(1:nb, 1:np, 1))) &
1102 + matmul(acint_sin(1:na, 1:np, 1 + idir), transpose(bchint_sin(1:nb, 1:np, 1)))))
1104 fa(idir) = fa(idir) - sign_imag*sum(matrix_p_imag(1:na, 1:nb)* &
1105 (+matmul(acint_sin(1:na, 1:np, 1 + idir), transpose(bchint_cos(1:nb, 1:np, 1))) &
1106 - matmul(acint_cos(1:na, 1:np, 1 + idir), transpose(bchint_sin(1:nb, 1:np, 1)))))
1109 fb(idir) = sum(matrix_p_real(1:na, 1:nb)* &
1110 (+matmul(achint_cos(1:na, 1:np, 1), transpose(bcint_cos(1:nb, 1:np, 1 + idir))) &
1111 + matmul(achint_sin(1:na, 1:np, 1), transpose(bcint_sin(1:nb, 1:np, 1 + idir)))))
1113 fb(idir) = fb(idir) - sign_imag*sum(matrix_p_imag(1:na, 1:nb)* &
1114 (-matmul(achint_cos(1:na, 1:np, 1), transpose(bcint_sin(1:nb, 1:np, 1 + idir))) &
1115 + matmul(achint_sin(1:na, 1:np, 1), transpose(bcint_cos(1:nb, 1:np, 1 + idir)))))
1119 fa(idir) = sum(matrix_p_real(1:nb, 1:na)* &
1120 (+matmul(bchint_cos(1:nb, 1:np, 1), transpose(acint_cos(1:na, 1:np, 1 + idir))) &
1121 + matmul(bchint_sin(1:nb, 1:np, 1), transpose(acint_sin(1:na, 1:np, 1 + idir)))))
1123 fa(idir) = fa(idir) - sign_imag*sum(matrix_p_imag(1:nb, 1:na)* &
1124 (+matmul(bchint_sin(1:nb, 1:np, 1), transpose(acint_cos(1:na, 1:np, 1 + idir))) &
1125 - matmul(bchint_cos(1:nb, 1:np, 1), transpose(acint_sin(1:na, 1:np, 1 + idir)))))
1128 fb(idir) = sum(matrix_p_real(1:nb, 1:na)* &
1129 (+matmul(bcint_cos(1:nb, 1:np, 1 + idir), transpose(achint_cos(1:na, 1:np, 1))) &
1130 + matmul(bcint_sin(1:nb, 1:np, 1 + idir), transpose(achint_sin(1:na, 1:np, 1)))))
1132 fb(idir) = fb(idir) - sign_imag*sum(matrix_p_imag(1:nb, 1:na)* &
1133 (-matmul(bcint_cos(1:nb, 1:np, 1 + idir), transpose(achint_sin(1:na, 1:np, 1))) &
1134 + matmul(bcint_sin(1:nb, 1:np, 1 + idir), transpose(achint_cos(1:na, 1:np, 1)))))
1136 force_thread(idir, iatom) = force_thread(idir, iatom) + f0*fa(idir)
1137 force_thread(idir, katom) = force_thread(idir, katom) - f0*fa(idir)
1138 force_thread(idir, jatom) = force_thread(idir, jatom) + f0*fb(idir)
1139 force_thread(idir, katom) = force_thread(idir, katom) - f0*fb(idir)
1156 i = atom_of_kind(iatom)
1157 ikind = kind_of(iatom)
1158 force(ikind)%gth_ppnl(:, i) = force(ikind)%gth_ppnl(:, i) + force_thread(:, iatom)
1163 IF (
SIZE(rho_ao) == 2)
THEN
1164 CALL dbcsr_add(rho_ao(1)%matrix, rho_ao(2)%matrix, &
1165 alpha_scalar=1.0_dp, beta_scalar=-1.0_dp)
1166 CALL dbcsr_add(rho_ao_im(1)%matrix, rho_ao_im(2)%matrix, &
1167 alpha_scalar=1.0_dp, beta_scalar=-1.0_dp)
1172 DEALLOCATE (basis_set, atom_of_kind, kind_of)
1176 CALL timestop(handle)
subroutine pbc(r, r_pbc, s, s_pbc, a, b, c, alpha, beta, gamma, debug, info, pbc0, h, hinv)
...
Calculation of the moment integrals over Cartesian Gaussian-type functions.
subroutine, public cossin(la_max_set, npgfa, zeta, rpgfa, la_min_set, lb_max, npgfb, zetb, rpgfb, lb_min, rac, rbc, kvec, cosab, sinab, dcosab, dsinab)
...
Define the atomic kind types and their sub types.
subroutine, public get_atomic_kind_set(atomic_kind_set, atom_of_kind, kind_of, natom_of_kind, maxatom, natom, nshell, fist_potential_present, shell_present, shell_adiabatic, shell_check_distance, damping_present)
Get attributes of an atomic kind set.
collects all references to literature in CP2K as new algorithms / method are included from literature...
integer, save, public mattiat2022
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_core_ppnl(matrix_h, matrix_p, force, virial, calculate_forces, use_virial, nder, qs_kind_set, atomic_kind_set, particle_set, sab_orb, sap_ppnl, eps_ppnl, nimages, cell_to_index, basis_type, deltaR, matrix_l)
...
Defines control structures, which contain the parameters and the settings for the DFT-based calculati...
Routines that link DBCSR and CP2K concepts together.
subroutine, public cp_dbcsr_alloc_block_from_nbl(matrix, sab_orb, desymmetrize)
allocate the blocks of a dbcsr based on the neighbor list
DBCSR operations in CP2K.
all routins needed for a nonperiodic electric field
subroutine, public make_field(dft_control, field, sim_step, sim_time)
computes the amplitude of the efield within a given envelop
Definition of the atomic potential types.
Defines the basic variable types.
integer, parameter, public int_8
integer, parameter, public dp
Types and basic routines needed for a kpoint calculation.
subroutine, public get_kpoint_info(kpoint, kp_scheme, nkp_grid, kp_shift, symmetry, verbose, full_grid, use_real_wfn, eps_geo, parallel_group_size, kp_range, nkp, xkp, wkp, para_env, blacs_env_all, para_env_kp, para_env_inter_kp, blacs_env, kp_env, kp_aux_env, mpools, iogrp, nkp_groups, kp_dist, cell_to_index, index_to_cell, sab_nl, sab_nl_nosym)
Retrieve information from a kpoint environment.
Definition of mathematical constants and functions.
real(kind=dp), parameter, public one
real(kind=dp), parameter, public zero
Provides Cartesian and spherical orbital pointers and indices.
subroutine, public init_orbital_pointers(maxl)
Initialize or update the orbital pointers.
integer, dimension(:), allocatable, public nco
integer, dimension(:), allocatable, public ncoset
Define the data structure for the particle information.
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.
subroutine, public get_qs_kind_set(qs_kind_set, all_potential_present, tnadd_potential_present, gth_potential_present, sgp_potential_present, paw_atom_present, dft_plus_u_atom_present, maxcgf, maxsgf, maxco, maxco_proj, maxgtops, maxlgto, maxlprj, maxnset, maxsgf_set, ncgf, npgf, nset, nsgf, nshell, maxpol, maxlppl, maxlppnl, maxppnl, nelectron, maxder, max_ngrid_rad, max_sph_harm, maxg_iso_not0, lmax_rho0, basis_rcut, basis_type, total_zeff_corr)
Get attributes of an atomic kind set.
subroutine, public get_ks_env(ks_env, v_hartree_rspace, s_mstruct_changed, rho_changed, potential_changed, forces_up_to_date, complex_ks, matrix_h, matrix_h_im, matrix_ks, matrix_ks_im, matrix_vxc, kinetic, matrix_s, matrix_s_RI_aux, matrix_w, matrix_p_mp2, matrix_p_mp2_admm, matrix_h_kp, matrix_h_im_kp, matrix_ks_kp, matrix_vxc_kp, kinetic_kp, matrix_s_kp, matrix_w_kp, matrix_s_RI_aux_kp, matrix_ks_im_kp, rho, rho_xc, vppl, rho_core, rho_nlcc, rho_nlcc_g, vee, neighbor_list_id, sab_orb, sab_all, sac_ae, sac_ppl, sac_lri, sap_ppnl, sap_oce, sab_lrc, sab_se, sab_xtbe, sab_tbe, sab_core, sab_xb, sab_xtb_nonbond, sab_vdw, sab_scp, sab_almo, sab_kp, sab_kp_nosym, task_list, task_list_soft, kpoints, do_kpoints, atomic_kind_set, qs_kind_set, cell, cell_ref, use_ref_cell, particle_set, energy, force, local_particles, local_molecules, molecule_kind_set, molecule_set, subsys, cp_subsys, virial, results, atprop, nkind, natom, dft_control, dbcsr_dist, distribution_2d, pw_env, para_env, blacs_env, nelectron_total, nelectron_spin)
...
Define the neighbor list data types and the corresponding functionality.
subroutine, public build_lin_mom_matrix(qs_env, matrix)
Calculation of the linear momentum matrix <mu|∂|nu> over Cartesian Gaussian functions.
superstucture that hold various representations of the density and keeps track of which ones are vali...
subroutine, public qs_rho_get(rho_struct, rho_ao, rho_ao_im, rho_ao_kp, rho_ao_im_kp, rho_r, drho_r, rho_g, drho_g, tau_r, tau_g, rho_r_valid, drho_r_valid, rho_g_valid, drho_g_valid, tau_r_valid, tau_g_valid, tot_rho_r, tot_rho_g, rho_r_sccs, soft_valid, complex_rho_ao)
returns info about the density described by this object. If some representation is not available an e...
Routines to perform the RTP in the velocity gauge.
subroutine, public velocity_gauge_nl_force(qs_env, particle_set)
Calculate the force associated to non-local pseudo potential in the velocity gauge.
subroutine, public velocity_gauge_ks_matrix(qs_env, subtract_nl_term)
...
subroutine, public update_vector_potential(qs_env, dft_control)
Update the vector potential in the case where a time-dependant electric field is apply.
General overlap type integrals containers.
subroutine, public release_sap_int(sap_int)
...
subroutine, public sap_sort(sap_int)
...
subroutine, public get_alist(sap_int, alist, atom)
...