61#include "./base/base_uses.f90"
67 CHARACTER(len=*),
PARAMETER,
PRIVATE :: moduleN =
'se_core_matrix'
83 LOGICAL,
INTENT(IN) :: calculate_forces
85 CHARACTER(LEN=*),
PARAMETER :: routinen =
'build_se_core_matrix'
87 INTEGER :: after, atom_a, atom_b, handle, i, iatom, icol, icor, ikind, inode, irow, itype, &
88 iw, j, jatom, jkind, natom, natorb_a, nkind, nr_a, nra, nrb
89 INTEGER,
ALLOCATABLE,
DIMENSION(:) :: atom_of_kind, nrt
90 LOGICAL :: defined, found, omit_headers, use_virial
91 LOGICAL,
ALLOCATABLE,
DIMENSION(:) :: se_defined
92 REAL(kind=
dp) :: delta, dr, econst, eheat, eisol, kh, &
93 udd, uff, upp, uss, zpa, zpb, zsa, zsb
94 REAL(kind=
dp),
ALLOCATABLE,
DIMENSION(:) :: zpt, zst
95 REAL(kind=
dp),
ALLOCATABLE,
DIMENSION(:, :) :: hmt, umt
96 REAL(kind=
dp),
DIMENSION(16) :: ha, hb, ua
97 REAL(kind=
dp),
DIMENSION(3) :: force_ab, rij
98 REAL(kind=
dp),
DIMENSION(:),
POINTER :: beta_a, sto_exponents_a
99 REAL(kind=
dp),
DIMENSION(:, :),
POINTER :: dsmat, h_block, h_blocka, pabmat, pamat, &
103 TYPE(
dbcsr_p_type),
DIMENSION(:),
POINTER :: matrix_h, matrix_p, matrix_s
104 TYPE(
dbcsr_type),
POINTER :: diagmat_h, diagmat_p
107 DIMENSION(:),
POINTER :: nl_iterator
113 TYPE(
qs_kind_type),
DIMENSION(:),
POINTER :: qs_kind_set
121 CALL timeset(routinen, handle)
123 NULLIFY (logger, energy)
126 NULLIFY (rho, force, atomic_kind_set, qs_kind_set, sab_orb, &
127 diagmat_h, diagmat_p, particle_set, matrix_p, ks_env)
133 particle_set=particle_set, &
134 atomic_kind_set=atomic_kind_set, &
135 qs_kind_set=qs_kind_set, &
136 dft_control=dft_control, &
144 IF (calculate_forces)
THEN
146 matrix_name=
"OVERLAP", &
147 basis_type_a=
"ORB", &
148 basis_type_b=
"ORB", &
151 use_virial = virial%pv_availability .AND. (.NOT. virial%pv_numer)
154 matrix_name=
"OVERLAP", &
155 basis_type_a=
"ORB", &
156 basis_type_b=
"ORB", &
162 IF (calculate_forces)
THEN
165 IF (
SIZE(matrix_p) == 2)
THEN
166 CALL dbcsr_add(matrix_p(1)%matrix, matrix_p(2)%matrix, alpha_scalar=1.0_dp, beta_scalar=1.0_dp)
168 delta = dft_control%qs_control%se_control%delta
170 atom_of_kind=atom_of_kind)
178 ALLOCATE (matrix_h(1)%matrix)
179 CALL dbcsr_copy(matrix_h(1)%matrix, matrix_s(1)%matrix,
"CORE HAMILTONIAN MATRIX")
180 CALL dbcsr_set(matrix_h(1)%matrix, 0.0_dp)
189 itype =
get_se_type(dft_control%qs_control%method_id)
192 nkind =
SIZE(atomic_kind_set)
194 ALLOCATE (se_defined(nkind))
195 ALLOCATE (hmt(16, nkind))
196 ALLOCATE (umt(16, nkind))
198 ALLOCATE (zst(nkind))
199 ALLOCATE (zpt(nkind))
200 ALLOCATE (nrt(nkind))
205 CALL get_qs_kind(qs_kind_set(ikind), se_parameter=se_kind_a)
206 CALL get_se_param(se_kind_a, defined=defined, natorb=natorb_a, &
207 beta=beta_a, uss=uss, upp=upp, udd=udd, uff=uff, eisol=eisol, eheat=eheat, &
208 nr=nr_a, sto_exponents=sto_exponents_a)
209 econst = econst - (eisol - eheat)*real(natom,
dp)
210 se_defined(ikind) = (defined .AND. natorb_a >= 1)
211 hmt(1, ikind) = beta_a(0)
212 hmt(2:4, ikind) = beta_a(1)
213 hmt(5:9, ikind) = beta_a(2)
214 hmt(10:16, ikind) = beta_a(3)
216 umt(2:4, ikind) = upp
217 umt(5:9, ikind) = udd
218 umt(10:16, ikind) = uff
220 zst(ikind) = sto_exponents_a(0)
221 zpt(ikind) = sto_exponents_a(1)
225 energy%core_self = econst
229 CALL get_iterator_info(nl_iterator, ikind=ikind, jkind=jkind, iatom=iatom, jatom=jatom, inode=inode, r=rij)
230 IF (.NOT. se_defined(ikind)) cycle
231 IF (.NOT. se_defined(jkind)) cycle
232 ha(1:16) = hmt(1:16, ikind)
233 ua(1:16) = umt(1:16, ikind)
234 hb(1:16) = hmt(1:16, jkind)
244 SELECT CASE (dft_control%qs_control%method_id)
249 cpassert(
ASSOCIATED(h_blocka))
250 IF (calculate_forces)
THEN
252 cpassert(
ASSOCIATED(pamat))
259 SELECT CASE (dft_control%qs_control%method_id)
261 cpabort(
"Unknown method for semi-empirical calculation")
264 DO i = 1,
SIZE(h_blocka, 1)
265 h_blocka(i, i) = h_blocka(i, i) + ua(i)
270 IF (iatom <= jatom)
THEN
279 irow, icol, h_block, found)
280 cpassert(
ASSOCIATED(h_block))
285 irow, icol, s_block, found)
286 cpassert(
ASSOCIATED(s_block))
287 IF (irow == iatom)
THEN
288 DO i = 1,
SIZE(h_block, 1)
289 DO j = 1,
SIZE(h_block, 2)
290 h_block(i, j) = h_block(i, j) + kh*(ha(i) + hb(j))*s_block(i, j)
294 DO i = 1,
SIZE(h_block, 1)
295 DO j = 1,
SIZE(h_block, 2)
296 h_block(i, j) = h_block(i, j) + kh*(ha(j) + hb(i))*s_block(i, j)
300 IF (calculate_forces)
THEN
301 atom_a = atom_of_kind(iatom)
302 atom_b = atom_of_kind(jatom)
305 cpassert(
ASSOCIATED(pabmat))
307 force_ab(icor) = 0._dp
310 cpassert(
ASSOCIATED(dsmat))
311 dsmat = 2._dp*kh*dsmat*pabmat
312 IF (irow == iatom)
THEN
313 DO i = 1,
SIZE(h_block, 1)
314 DO j = 1,
SIZE(h_block, 2)
315 force_ab(icor) = force_ab(icor) + (ha(i) + hb(j))*dsmat(i, j)
319 DO i = 1,
SIZE(h_block, 1)
320 DO j = 1,
SIZE(h_block, 2)
321 force_ab(icor) = force_ab(icor) + (ha(j) + hb(i))*dsmat(i, j)
330 IF (calculate_forces .AND. (iatom /= jatom .OR. dr >
rij_threshold))
THEN
331 IF (irow == iatom) force_ab = -force_ab
332 force(ikind)%all_potential(:, atom_a) = &
333 force(ikind)%all_potential(:, atom_a) - force_ab(:)
334 force(jkind)%all_potential(:, atom_b) = &
335 force(jkind)%all_potential(:, atom_b) + force_ab(:)
344 DEALLOCATE (se_defined, hmt, umt, zst, zpt, nrt)
348 CALL dbcsr_add(matrix_h(1)%matrix, diagmat_h, 1.0_dp, 1.0_dp)
352 qs_env%input,
"DFT%PRINT%AO_MATRICES/CORE_HAMILTONIAN"),
cp_p_file))
THEN
356 CALL section_vals_val_get(qs_env%input,
"DFT%PRINT%AO_MATRICES%OMIT_HEADERS", l_val=omit_headers)
357 after = min(max(after, 1), 16)
359 scale=
evolt, output_unit=iw, omit_headers=omit_headers)
361 "DFT%PRINT%AO_MATRICES/CORE_HAMILTONIAN")
364 IF (calculate_forces)
THEN
365 IF (
SIZE(matrix_p) == 2)
THEN
366 CALL dbcsr_add(matrix_p(1)%matrix, matrix_p(2)%matrix, alpha_scalar=1.0_dp, beta_scalar=-1.0_dp)
368 DEALLOCATE (atom_of_kind)
374 CALL timestop(handle)
389 SUBROUTINE makes(R, nra, nrb, ZSA, ZSB, ZPA, ZPB, S)
391 REAL(kind=
dp),
DIMENSION(3) :: r
393 REAL(kind=
dp) :: zsa, zsb, zpa, zpb
394 REAL(kind=
dp),
DIMENSION(4, 4) :: s
396 INTEGER,
DIMENSION(4, 4),
PARAMETER :: &
397 nc1 = reshape([2, 4, 4, 6, 4, 3, 6, 7, 4, 6, 4, 8, 6, 7, 8, 5], [4, 4]), &
398 nc2 = reshape([4, 4, 8, 8, 6, 8, 6, 12, 8, 8, 12, 8, 10, 12, 14, 16], [4, 4]), &
399 nc3 = reshape([4, 6, 8, 10, 4, 8, 8, 12, 8, 6, 12, 14, 8, 12, 8, 16], [4, 4]), &
400 nc4 = reshape([4, 8, 11, 14, 8, 6, 12, 14, 11, 12, 10, 20, 14, 14, 20, 12], [4, 4]), &
401 nc5 = reshape([2, 4, 6, 8, 4, 4, 8, 8, 6, 8, 6, 12, 8, 8, 12, 8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 0, 0, 0, 0, 0, 0, 0], [4, 4, 20])
414 INTEGER,
DIMENSION(4, 4, 20),
PARAMETER :: c2 = reshape([1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, &
415 1, 1, 1, 1, -1, 1, 1, 2, -2, -1, 1, 1, -3, -2, -1, 1, -4, -3, -2, -1, 1, -1, 1, 1, 1, 1, &
416 -2, 1, 1, 1, 1, -3, 1, 1, 1, 1, -1, -1, -1, 2, 1, -1, -2, -2, 3, -2, -2, -3, 6, 2, -1, -3,&
417 0, 0, 1, -2, -2, -1, 1, 1, -3, 2, -1, 3, -4, -3, -2, -1, 0, 0, -1, -1, 1, 1, 1, -2, -1, -1&
418 , 2, 3, -4, 2, 4, 3, 0, 0, -1, -2, 0, -1, 0, -2, 3, 2, -2, -1, 6, 2, -1, -3, 0, 0, -1, -1,&
419 0, 1, 0, 1, -1, -1, 1, -1, 1, -3, -1, 3, 0, 0, 0, 0, 0, 0, 0, -2, 0, 0, 2, 0, -4, 2, 4, 3 &
420 , 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, -1, 0, 1, 1, -2, -3, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0&
421 , -3, -1, 3, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, -1, 0, 0, 1, 1, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, &
422 0, 0, 0, 0, 0, -2, -3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0&
423 , 0, 0, 0, 0, 0, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, &
424 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, &
425 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],&
427 INTEGER,
DIMENSION(4, 4, 20),
PARAMETER :: c3 = reshape([-1, -1, -1, -1, -1, -1, -1, -1, -1, &
428 -1, -1, -1, -1, -1, -1, -1, -1, -2, -3, -4, 1, -1, -2, -3, 1, 1, -1, -2, 2, 1, 1, -1, 1, 1&
429 , 1, 1, 1, 1, 1, 1, 1, 2, 1, 1, 1, 1, 3, 1, 1, -1, -3, -6, -1, 1, 2, -2, 1, -2, 2, 1, -2, &
430 2, -3, 3, 0, 2, 3, 4, 0, 1, 2, 3, -1, -1, 1, 2, -2, -1, -3, 1, 0, 1, -1, -4, 0, 1, 1, 2, &
431 -1, 1, 2, 4, 1, -2, 3, 3, 0, 0, 3, 6, 0, -1, -2, 2, -1, 0, -2, -1, 2, -2, 1, -3, 0, 0, 1, &
432 -1, 0, -1, -1, 3, 1, 0, -1, 1, -1, -1, -1, -3, 0, 0, 0, 4, 0, 0, 0, -2, 0, 0, -2, -4, 0, 2&
433 , 0, -3, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, -1, -2, 0, 1, 0, -3, 0, 0, 0, 0, 0, 0, 0, -3, 0, 0,&
434 1, -1, 0, 1, 0, 3, 0, 0, 0, 0, 0, 0, 0, -1, 0, 0, 1, -1, 0, -1, 0, 1, 0, 0, 0, 0, 0, 0, 0,&
435 0, 0, 0, 0, 2, 0, 0, 0, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 0, 0, &
436 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -1, 0, 0, 0&
437 , 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0&
438 , 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0&
440 INTEGER,
DIMENSION(4, 4, 20),
PARAMETER :: c4 = reshape([-1, -1, -1, -1, -1, -1, -1, -1, -1, &
441 -1, -1, -1, -1, -1, -1, -1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, -1, -2, -3,&
442 1, 1, -1, -2, 2, 1, 2, -1, 3, 2, 1, 3, -1, 1, 2, 3, -1, -1, 1, 2, -2, -1, -1, 1, -3, -2, &
443 -1, -2, 0, 1, -1, -3, 1, -1, 1, 1, -1, 1, -1, 2, -3, 1, 2, -1, 0, -1, 2, 4, -1, 1, -1, -1 &
444 , 2, -1, -1, -1, 4, -1, -1, -3, 0, 1, -1, -1, -1, 0, 1, 2, -1, -1, -1, -1, -1, -2, -1, 3, &
445 0, -1, 2, -1, 1, 0, -1, -2, -2, 1, 2, 2, 1, 2, -2, 1, 0, 0, -2, 4, 0, 0, -1, 1, 2, -1, 1, &
446 -1, -4, 1, 1, 2, 0, 0, 1, -3, 0, 0, 1, -1, 1, 1, -1, -1, 3, -1, 1, -3, 0, 0, -1, 3, 0, 0, &
447 -1, -2, -1, 1, 0, -1, 3, 2, -1, -1, 0, 0, 0, -3, 0, 0, 1, 2, 0, -1, 0, -1, -3, -2, -1, 1, &
448 0, 0, 0, 1, 0, 0, 0, -1, 0, 0, 0, 2, -1, -1, 2, 0, 0, 0, 0, -1, 0, 0, 0, 1, 0, 0, 0, -1, 1&
449 , 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -1, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, &
450 0, 2, 0, 0, -2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0,&
451 0, 0, 0, -1, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, -1, 0, 0, 0, 0, 0, 0, &
452 0, 0, 0, 0, 0, 0, -1, 0, 0, 1, 0], [4, 4, 20])
453 INTEGER,
DIMENSION(4, 4, 20),
PARAMETER :: c5 = reshape([-1, -1, -1, -1, -1, -1, -1, -1, -1, &
454 -1, -1, -1, -1, -1, -1, -1, 1, -1, -2, -3, 1, 1, -1, -2, 2, 1, 2, -1, 3, 2, 1, 3, 0, 1, -1&
455 , -3, 1, 1, 1, 1, -1, 1, 1, 2, -3, 1, 2, 1, 0, 1, 1, 1, -1, -1, 1, 2, 1, 1, -1, 1, 1, -2, &
456 1, -3, 0, 0, 2, -1, 0, 0, 1, 2, -2, -1, -2, 2, 1, -2, -2, -3, 0, 0, 1, 3, 0, 0, 1, 1, 1, &
457 -1, 1, 1, -3, 1, -1, 1, 0, 0, 0, 3, 0, 0, -1, -2, 0, -1, 0, -1, 3, 2, -1, 3, 0, 0, 0, 1, 0&
458 , 0, -1, -1, 0, 1, 0, -2, -1, -1, -2, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -1, 0, 0, 1, 0,&
459 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -2, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0,&
460 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 &
461 , 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0&
462 , 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0&
463 , 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,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, 0, 0, 0, 0, 5, 0, 0, 5, 0&
581 , 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0&
582 , 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0&
583 , 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0&
584 , 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0&
585 , 0, 0, 0, 0, 0, 0, 0, 0], [4, 4, 20])
587 INTEGER :: k, k1, k2, mu
588 REAL(kind=
dp) :: cp, ct, fac1, fac2, j, jc, jcc, jss, rr, &
589 sp, st, xx, yy, za, zb
590 REAL(kind=
dp),
DIMENSION(3) :: v
591 REAL(kind=
dp),
DIMENSION(3, 3) :: arot
598 IF (rr < 1.0e-20_dp)
THEN
611 fac1 = fac1*sqrt(4.0_dp/3.0_dp)
614 fac1 = fac1*sqrt(8.0_dp/45.0_dp)
617 fac1 = fac1*sqrt(4.0_dp/315.0_dp)
619 WRITE (*, *)
'nra= ', nra
629 fac1 = fac1*sqrt(4.0_dp/3.0_dp)
632 fac1 = fac1*sqrt(8.0_dp/45.0_dp)
635 fac1 = fac1*sqrt(4.0_dp/315.0_dp)
637 WRITE (*, *)
'nrb= ', nrb
645 IF (abs(ct) < 1.0_dp)
THEN
646 st = sqrt(1.0_dp - ct**2)
672 fac2 = sqrt(za**(2*nra + 1)*zb**(2*nrb + 1))
673 xx = 0.5_dp*rr*(za + zb)
674 yy = 0.5_dp*rr*(za - zb)
677 DO k = 1, nc1(nra, nrb)
678 j = j + real(c1(nra, nrb, k),
dp)*aa(ma1(nra, nrb, k), xx)*bb(mb1(nra, nrb, k), yy)
680 j = j*rr**(nra + nrb + 1)
681 j = j/2.0_dp**(nra + nrb + 2)
683 s(1, 1) = s(1, 1) + fac1*fac2*j
687 fac2 = sqrt(za**(2*nra + 1)*zb**(2*nrb + 1))
688 xx = 0.5_dp*rr*(za + zb)
689 yy = 0.5_dp*rr*(za - zb)
692 DO k = 1, nc2(nra, nrb)
693 jc = jc + real(c2(nra, nrb, k),
dp)*aa(ma2(nra, nrb, k), xx)*bb(mb2(nra, nrb, k), yy)
695 jc = jc*rr**(nra + nrb + 1)
696 jc = jc/2.0_dp**(nra + nrb + 2)
699 s(k1 + 1, 1) = s(k1 + 1, 1) &
700 & + sqrt(3.0_dp)*arot(k1, 3)*fac1*fac2*jc
705 fac2 = sqrt(za**(2*nra + 1)*zb**(2*nrb + 1))
706 xx = 0.5_dp*rr*(za + zb)
707 yy = 0.5_dp*rr*(za - zb)
710 DO k = 1, nc3(nra, nrb)
711 jc = jc + real(c3(nra, nrb, k),
dp)*aa(ma3(nra, nrb, k), xx)*bb(mb3(nra, nrb, k), yy)
713 jc = jc*rr**(nra + nrb + 1)
714 jc = jc/2.0_dp**(nra + nrb + 2)
717 s(1, k1 + 1) = s(1, k1 + 1) &
718 & - sqrt(3.0_dp)*arot(k1, 3)*fac1*fac2*jc
723 fac2 = sqrt(za**(2*nra + 1)*zb**(2*nrb + 1))
724 xx = 0.5_dp*rr*(za + zb)
725 yy = 0.5_dp*rr*(za - zb)
728 DO k = 1, nc4(nra, nrb)
729 jss = jss + real(c4(nra, nrb, k),
dp)*aa(ma4(nra, nrb, k), xx)*bb(mb4(nra, nrb, k), yy)
731 jss = jss*rr**(nra + nrb + 1)
732 jss = jss/2.0_dp**(nra + nrb + 2)
735 DO k = 1, nc5(nra, nrb)
736 jcc = jcc + real(c5(nra, nrb, k),
dp)*aa(ma5(nra, nrb, k), xx)*bb(mb5(nra, nrb, k), yy)
738 jcc = jcc*rr**(nra + nrb + 1)
739 jcc = jcc/2.0_dp**(nra + nrb + 2)
743 s(k1 + 1, k2 + 1) = s(k1 + 1, k2 + 1) &
744 & + 1.5_dp*arot(k1, 1)*arot(k2, 1)*fac1*fac2*jss &
745 & + 1.5_dp*arot(k1, 2)*arot(k2, 2)*fac1*fac2*jss &
746 & - 3.0_dp*arot(k1, 3)*arot(k2, 3)*fac1*fac2*jcc
765 SUBROUTINE makeds(R, nra, nrb, ZSA, ZSB, ZPA, ZPB, dS)
767 REAL(kind=
dp),
DIMENSION(3) :: r
769 REAL(kind=
dp) :: zsa, zsb, zpa, zpb
770 REAL(kind=
dp),
DIMENSION(4, 4, 3) :: ds
772 INTEGER,
DIMENSION(4, 4),
PARAMETER :: &
773 nc1 = reshape([2, 4, 4, 6, 4, 3, 6, 7, 4, 6, 4, 8, 6, 7, 8, 5], [4, 4]), &
774 nc2 = reshape([4, 4, 8, 8, 6, 8, 6, 12, 8, 8, 12, 8, 10, 12, 14, 16], [4, 4]), &
775 nc3 = reshape([4, 6, 8, 10, 4, 8, 8, 12, 8, 6, 12, 14, 8, 12, 8, 16], [4, 4]), &
776 nc4 = reshape([4, 8, 11, 14, 8, 6, 12, 14, 11, 12, 10, 20, 14, 14, 20, 12], [4, 4]), &
777 nc5 = reshape([2, 4, 6, 8, 4, 4, 8, 8, 6, 8, 6, 12, 8, 8, 12, 8], [4, 4])
778 INTEGER,
DIMENSION(4, 4, 20),
PARAMETER :: c1 = reshape([1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, &
779 1, 1, 1, 1, -1, 1, 2, 3, -1, -2, 1, 2, -2, -1, -3, 1, -3, -2, -1, -4, 0, -1, -2, 2, -1, 1,&
780 -2, -1, 2, -2, 3, -3, 2, -1, -3, 6, 0, -1, -1, -2, 1, 0, -2, -4, -1, 2, -1, -3, 2, 4, 3, &
781 -4, 0, 0, 0, -3, 0, 0, 1, -1, 0, 1, 0, 3, -3, -1, 3, 1, 0, 0, 0, -1, 0, 0, 1, 2, 0, -1, 0,&
782 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 1, 1, -2, -1, -1&
794 , 2, 3, -4, 2, 4, 3, 0, 0, -1, -2, 0, -1, 0, -2, 3, 2, -2, -1, 6, 2, -1, -3, 0, 0, -1, -1,&
795 0, 1, 0, 1, -1, -1, 1, -1, 1, -3, -1, 3, 0, 0, 0, 0, 0, 0, 0, -2, 0, 0, 2, 0, -4, 2, 4, 3 &
796 , 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, -1, 0, 1, 1, -2, -3, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0&
797 , -3, -1, 3, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, -1, 0, 0, 1, 1, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, &
798 0, 0, 0, 0, 0, -2, -3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0&
799 , 0, 0, 0, 0, 0, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, &
800 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, &
801 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],&
803 INTEGER,
DIMENSION(4, 4, 20),
PARAMETER :: c3 = reshape([-1, -1, -1, -1, -1, -1, -1, -1, -1, &
804 -1, -1, -1, -1, -1, -1, -1, -1, -2, -3, -4, 1, -1, -2, -3, 1, 1, -1, -2, 2, 1, 1, -1, 1, 1&
805 , 1, 1, 1, 1, 1, 1, 1, 2, 1, 1, 1, 1, 3, 1, 1, -1, -3, -6, -1, 1, 2, -2, 1, -2, 2, 1, -2, &
806 2, -3, 3, 0, 2, 3, 4, 0, 1, 2, 3, -1, -1, 1, 2, -2, -1, -3, 1, 0, 1, -1, -4, 0, 1, 1, 2, &
807 -1, 1, 2, 4, 1, -2, 3, 3, 0, 0, 3, 6, 0, -1, -2, 2, -1, 0, -2, -1, 2, -2, 1, -3, 0, 0, 1, &
808 -1, 0, -1, -1, 3, 1, 0, -1, 1, -1, -1, -1, -3, 0, 0, 0, 4, 0, 0, 0, -2, 0, 0, -2, -4, 0, 2&
809 , 0, -3, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, -1, -2, 0, 1, 0, -3, 0, 0, 0, 0, 0, 0, 0, -3, 0, 0,&
810 1, -1, 0, 1, 0, 3, 0, 0, 0, 0, 0, 0, 0, -1, 0, 0, 1, -1, 0, -1, 0, 1, 0, 0, 0, 0, 0, 0, 0,&
811 0, 0, 0, 0, 2, 0, 0, 0, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 0, 0, &
812 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -1, 0, 0, 0&
813 , 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0&
814 , 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0&
816 INTEGER,
DIMENSION(4, 4, 20),
PARAMETER :: c4 = reshape([-1, -1, -1, -1, -1, -1, -1, -1, -1, &
817 -1, -1, -1, -1, -1, -1, -1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, -1, -2, -3,&
818 1, 1, -1, -2, 2, 1, 2, -1, 3, 2, 1, 3, -1, 1, 2, 3, -1, -1, 1, 2, -2, -1, -1, 1, -3, -2, &
819 -1, -2, 0, 1, -1, -3, 1, -1, 1, 1, -1, 1, -1, 2, -3, 1, 2, -1, 0, -1, 2, 4, -1, 1, -1, -1 &
820 , 2, -1, -1, -1, 4, -1, -1, -3, 0, 1, -1, -1, -1, 0, 1, 2, -1, -1, -1, -1, -1, -2, -1, 3, &
821 0, -1, 2, -1, 1, 0, -1, -2, -2, 1, 2, 2, 1, 2, -2, 1, 0, 0, -2, 4, 0, 0, -1, 1, 2, -1, 1, &
822 -1, -4, 1, 1, 2, 0, 0, 1, -3, 0, 0, 1, -1, 1, 1, -1, -1, 3, -1, 1, -3, 0, 0, -1, 3, 0, 0, &
823 -1, -2, -1, 1, 0, -1, 3, 2, -1, -1, 0, 0, 0, -3, 0, 0, 1, 2, 0, -1, 0, -1, -3, -2, -1, 1, &
824 0, 0, 0, 1, 0, 0, 0, -1, 0, 0, 0, 2, -1, -1, 2, 0, 0, 0, 0, -1, 0, 0, 0, 1, 0, 0, 0, -1, 1&
825 , 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -1, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, &
826 0, 2, 0, 0, -2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0,&
827 0, 0, 0, -1, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, -1, 0, 0, 0, 0, 0, 0, &
828 0, 0, 0, 0, 0, 0, -1, 0, 0, 1, 0], [4, 4, 20])
829 INTEGER,
DIMENSION(4, 4, 20),
PARAMETER :: c5 = reshape([-1, -1, -1, -1, -1, -1, -1, -1, -1, &
830 -1, -1, -1, -1, -1, -1, -1, 1, -1, -2, -3, 1, 1, -1, -2, 2, 1, 2, -1, 3, 2, 1, 3, 0, 1, -1&
831 , -3, 1, 1, 1, 1, -1, 1, 1, 2, -3, 1, 2, 1, 0, 1, 1, 1, -1, -1, 1, 2, 1, 1, -1, 1, 1, -2, &
832 1, -3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0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0&
961 , 0, 0, 0, 0, 0, 0, 0, 0], [4, 4, 20])
963 INTEGER :: k, k1, k2, mu
964 REAL(kind=
dp) :: cp, ct, dj, djc, djcc, djss, dxx, dyy, &
965 f, fac1, fac2, j, jc, jcc, jss, rr, &
966 sp, st, w, w1, w2, xx, yy, za, zb
967 REAL(kind=
dp),
DIMENSION(3) :: dcp,
dct, dsp, dst, v
968 REAL(kind=
dp),
DIMENSION(3, 3) :: arot
969 REAL(kind=
dp),
DIMENSION(3, 3, 3) :: darot
976 IF (rr < 1.0e-20_dp)
THEN
979 ds(mu, mu, :) = 0.0_dp
989 fac1 = fac1*sqrt(4.0_dp/3.0_dp)
992 fac1 = fac1*sqrt(8.0_dp/45.0_dp)
995 fac1 = fac1*sqrt(4.0_dp/315.0_dp)
997 WRITE (*, *)
'nra= ', nra
1007 fac1 = fac1*sqrt(4.0_dp/3.0_dp)
1010 fac1 = fac1*sqrt(8.0_dp/45.0_dp)
1013 fac1 = fac1*sqrt(4.0_dp/315.0_dp)
1015 WRITE (*, *)
'nrb= ', nrb
1023 IF (abs(ct) >= 1.0_dp)
THEN
1025 dct(:) = v(:)*v(3)/rr**3
1026 dct(3) =
dct(3) - 1.0_dp/rr
1038 darot(1, 1, :) =
dct(:)
1039 darot(1, 2, :) = 0.0_dp
1040 darot(1, 3, :) = 0.0_dp
1041 darot(2, 1, :) = 0.0_dp
1042 darot(2, 2, :) = 0.0_dp
1043 darot(2, 3, :) = 0.0_dp
1044 darot(3, 1, :) = 0.0_dp
1045 darot(3, 2, :) = 0.0_dp
1046 darot(3, 3, :) =
dct(:)
1050 xx = sqrt(v(1)**2 + v(2)**2)
1055 dct(:) = v(:)*v(3)/rr**3
1056 dct(3) =
dct(3) - 1.0_dp/rr
1057 dst(:) = -ct*
dct(:)/st
1058 dcp(:) = v(:)*v(1)/(rr**3*st)
1059 dcp(:) = dcp(:) + v(1)*dst(:)/(rr*st**2)
1060 dcp(1) = dcp(1) - 1.0_dp/(rr*st)
1061 dsp(:) = v(:)*v(2)/(rr**3*st)
1062 dsp(:) = dsp(:) + v(2)*dst(:)/(rr*st**2)
1063 dsp(2) = dsp(2) - 1.0_dp/(rr*st)
1075 darot(1, 1, :) =
dct(:)*cp + ct*dcp(:)
1076 darot(1, 2, :) = -dsp(:)
1077 darot(1, 3, :) = dst(:)*cp + st*dcp(:)
1078 darot(2, 1, :) =
dct(:)*
sp + ct*dsp(:)
1079 darot(2, 2, :) = dcp(:)
1080 darot(2, 3, :) = dst(:)*
sp + st*dsp(:)
1081 darot(3, 1, :) = -dst(:)
1082 darot(3, 2, :) = 0.0_dp
1083 darot(3, 3, :) =
dct(:)
1089 fac2 = sqrt(za**(2*nra + 1)*zb**(2*nrb + 1))
1090 xx = 0.5_dp*rr*(za + zb)
1091 yy = 0.5_dp*rr*(za - zb)
1092 dxx = 0.5_dp*(za + zb)
1093 dyy = 0.5_dp*(za - zb)
1098 f = rr**(nra + nrb + 1)/2.0_dp**(nra + nrb + 2)
1099 DO k = 1, nc1(nra, nrb)
1100 w = w + real(c1(nra, nrb, k),
dp)*aa(ma1(nra, nrb, k), xx)*bb(mb1(nra, nrb, k), yy)
1101 w1 = w1 + real(c1(nra, nrb, k),
dp)*aa(ma1(nra, nrb, k) + 1, xx)*bb(mb1(nra, nrb, k), yy)
1102 w2 = w2 + real(c1(nra, nrb, k),
dp)*aa(ma1(nra, nrb, k), xx)*bb(mb1(nra, nrb, k) + 1, yy)
1105 dj = f*real(nra + nrb + 1,
dp)*w/rr
1109 ds(1, 1, :) = ds(1, 1, :) + fac1*fac2*dj*v(:)/rr
1113 fac2 = sqrt(za**(2*nra + 1)*zb**(2*nrb + 1))
1114 xx = 0.5_dp*rr*(za + zb)
1115 yy = 0.5_dp*rr*(za - zb)
1116 dxx = 0.5_dp*(za + zb)
1117 dyy = 0.5_dp*(za - zb)
1122 f = rr**(nra + nrb + 1)/2.0_dp**(nra + nrb + 2)
1123 DO k = 1, nc2(nra, nrb)
1124 w = w + real(c2(nra, nrb, k),
dp)*aa(ma2(nra, nrb, k), xx)*bb(mb2(nra, nrb, k), yy)
1125 w1 = w1 + real(c2(nra, nrb, k),
dp)*aa(ma2(nra, nrb, k) + 1, xx)*bb(mb2(nra, nrb, k), yy)
1126 w2 = w2 + real(c2(nra, nrb, k),
dp)*aa(ma2(nra, nrb, k), xx)*bb(mb2(nra, nrb, k) + 1, yy)
1129 djc = f*real(nra + nrb + 1,
dp)*w/rr
1130 djc = djc - dxx*f*w1
1131 djc = djc - dyy*f*w2
1134 ds(k1 + 1, 1, :) = ds(k1 + 1, 1, :) &
1135 & + sqrt(3.0_dp)*arot(k1, 3)*fac1*fac2*djc*v(:)/rr &
1136 & + sqrt(3.0_dp)*darot(k1, 3, :)*fac1*fac2*jc
1141 fac2 = sqrt(za**(2*nra + 1)*zb**(2*nrb + 1))
1142 xx = 0.5_dp*rr*(za + zb)
1143 yy = 0.5_dp*rr*(za - zb)
1144 dxx = 0.5_dp*(za + zb)
1145 dyy = 0.5_dp*(za - zb)
1150 f = rr**(nra + nrb + 1)/2.0_dp**(nra + nrb + 2)
1151 DO k = 1, nc3(nra, nrb)
1152 w = w + real(c3(nra, nrb, k),
dp)*aa(ma3(nra, nrb, k), xx)*bb(mb3(nra, nrb, k), yy)
1153 w1 = w1 + real(c3(nra, nrb, k),
dp)*aa(ma3(nra, nrb, k) + 1, xx)*bb(mb3(nra, nrb, k), yy)
1154 w2 = w2 + real(c3(nra, nrb, k),
dp)*aa(ma3(nra, nrb, k), xx)*bb(mb3(nra, nrb, k) + 1, yy)
1157 djc = f*real(nra + nrb + 1,
dp)*w/rr
1158 djc = djc - dxx*f*w1
1159 djc = djc - dyy*f*w2
1162 ds(1, k1 + 1, :) = ds(1, k1 + 1, :) &
1163 & - sqrt(3.0_dp)*arot(k1, 3)*fac1*fac2*djc*v(:)/rr &
1164 & - sqrt(3.0_dp)*darot(k1, 3, :)*fac1*fac2*jc
1169 fac2 = sqrt(za**(2*nra + 1)*zb**(2*nrb + 1))
1170 xx = 0.5_dp*rr*(za + zb)
1171 yy = 0.5_dp*rr*(za - zb)
1172 dxx = 0.5_dp*(za + zb)
1173 dyy = 0.5_dp*(za - zb)
1178 f = rr**(nra + nrb + 1)/2.0_dp**(nra + nrb + 2)
1179 DO k = 1, nc4(nra, nrb)
1180 w = w + real(c4(nra, nrb, k),
dp)*aa(ma4(nra, nrb, k), xx)*bb(mb4(nra, nrb, k), yy)
1181 w1 = w1 + real(c4(nra, nrb, k),
dp)*aa(ma4(nra, nrb, k) + 1, xx)*bb(mb4(nra, nrb, k), yy)
1182 w2 = w2 + real(c4(nra, nrb, k),
dp)*aa(ma4(nra, nrb, k), xx)*bb(mb4(nra, nrb, k) + 1, yy)
1185 djss = f*real(nra + nrb + 1,
dp)*w/rr
1186 djss = djss - dxx*f*w1
1187 djss = djss - dyy*f*w2
1192 f = rr**(nra + nrb + 1)/2.0_dp**(nra + nrb + 2)
1193 DO k = 1, nc5(nra, nrb)
1194 w = w + real(c5(nra, nrb, k),
dp)*aa(ma5(nra, nrb, k), xx)*bb(mb5(nra, nrb, k), yy)
1195 w1 = w1 + real(c5(nra, nrb, k),
dp)*aa(ma5(nra, nrb, k) + 1, xx)*bb(mb5(nra, nrb, k), yy)
1196 w2 = w2 + real(c5(nra, nrb, k),
dp)*aa(ma5(nra, nrb, k), xx)*bb(mb5(nra, nrb, k) + 1, yy)
1199 djcc = f*real(nra + nrb + 1,
dp)*w/rr
1200 djcc = djcc - dxx*f*w1
1201 djcc = djcc - dyy*f*w2
1205 ds(k1 + 1, k2 + 1, :) = ds(k1 + 1, k2 + 1, :) &
1206 & + 1.5_dp*arot(k1, 1)*arot(k2, 1)*fac1*fac2*djss*v(:)/rr &
1207 & + 1.5_dp*darot(k1, 1, :)*arot(k2, 1)*fac1*fac2*jss &
1208 & + 1.5_dp*arot(k1, 1)*darot(k2, 1, :)*fac1*fac2*jss &
1209 & + 1.5_dp*arot(k1, 2)*arot(k2, 2)*fac1*fac2*djss*v(:)/rr &
1210 & + 1.5_dp*darot(k1, 2, :)*arot(k2, 2)*fac1*fac2*jss &
1211 & + 1.5_dp*arot(k1, 2)*darot(k2, 2, :)*fac1*fac2*jss &
1212 & - 3.0_dp*arot(k1, 3)*arot(k2, 3)*fac1*fac2*djcc*v(:)/rr &
1213 & - 3.0_dp*darot(k1, 3, :)*arot(k2, 3)*fac1*fac2*jcc &
1214 & - 3.0_dp*arot(k1, 3)*darot(k2, 3, :)*fac1*fac2*jcc
1220 END SUBROUTINE makeds
1231 REAL(kind=
dp) :: x, aa
1257 p = 120.0_dp + x*( &
1264 p = 720.0_dp + x*( &
1272 p = 5040.0_dp + x*( &
1281 p = 40320.0_dp + x*( &
1291 p = 362880.0_dp + x*( &
1302 p = 3628800.0_dp + x*( &
1303 3628800.0_dp + x*( &
1304 1814400.0_dp + x*( &
1311 10.0_dp + x)))))))))
1314 WRITE (*, *)
' n= ', n,
' in AA(n,x) '
1327 aa = exp(-x)*p/x**(n + 1)
1340 REAL(kind=
dp) :: y, bb
1342 IF (abs(y) > 1.0e-20_dp)
THEN
1343 bb = real((-1)**(n + 1),
dp)*aa(n, -y) - aa(n, y)
1345 IF (mod(n, 2) == 0)
THEN
1346 bb = 2.0_dp/real(n + 1,
dp)
1348 bb = -y*2.0_dp/real(n + 2,
dp)
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.
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.
Defines control structures, which contain the parameters and the settings for the DFT-based calculati...
subroutine, public dbcsr_deallocate_matrix(matrix)
...
subroutine, public dbcsr_copy(matrix_b, matrix_a, name, keep_sparsity, keep_imaginary)
...
subroutine, public dbcsr_get_block_p(matrix, row, col, block, found, row_size, col_size)
...
subroutine, public dbcsr_replicate_all(matrix)
...
subroutine, public dbcsr_distribute(matrix)
...
subroutine, public dbcsr_sum_replicated(matrix)
...
subroutine, public dbcsr_set(matrix, alpha)
...
subroutine, public dbcsr_add(matrix_a, matrix_b, alpha_scalar, beta_scalar)
...
subroutine, public dbcsr_get_block_diag(matrix, diag)
Copies the diagonal blocks of matrix into diag.
DBCSR operations in CP2K.
subroutine, public cp_dbcsr_write_sparse_matrix(sparse_matrix, before, after, qs_env, para_env, first_row, last_row, first_col, last_col, scale, output_unit, omit_headers, cartesian_basis)
...
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,...
integer, parameter, public cp_p_file
integer function, public cp_print_key_should_output(iteration_info, basis_section, print_key_path, used_print_key, first_time)
returns what should be done with the given property if btest(res,cp_p_store) then the property should...
the type I Discrete Cosine Transform (DCT-I)
Defines the basic variable types.
integer, parameter, public dp
integer, parameter, public sp
Interface to the message passing library MPI.
Define the data structure for the particle information.
Definition of physical constants:
real(kind=dp), parameter, public evolt
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.
subroutine, public set_ks_env(ks_env, v_hartree_rspace, s_mstruct_changed, rho_changed, exc_accint, 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_vhxc, 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, vppl, xcint_weights, rho_core, rho_nlcc, rho_nlcc_g, vee, neighbor_list_id, kpoints, 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_pp, sab_xtb_nonbond, sab_vdw, sab_scp, sab_almo, sab_kp, sab_kp_nosym, sab_cneo, task_list, task_list_soft, subsys, dft_control, dbcsr_dist, distribution_2d, pw_env, para_env, blacs_env)
...
Define the neighbor list data types and the corresponding functionality.
subroutine, public neighbor_list_iterator_create(iterator_set, nl, search, nthread)
Neighbor list iterator functions.
subroutine, public neighbor_list_iterator_release(iterator_set)
...
integer function, public neighbor_list_iterate(iterator_set, mepos)
...
subroutine, public get_iterator_info(iterator_set, mepos, ikind, jkind, nkind, ilist, nlist, inode, nnode, iatom, jatom, r, cell)
...
Calculation of overlap matrix, its derivatives and forces.
subroutine, public build_overlap_matrix(ks_env, matrix_s, matrixkp_s, matrix_name, nderivative, basis_type_a, basis_type_b, sab_nl, calculate_forces, matrix_p, matrixkp_p, ext_kpoints)
Calculation of the overlap matrix 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...
Calculation of the Hamiltonian integral matrix <a|H|b> for semi-empirical methods.
subroutine, public build_se_core_matrix(qs_env, para_env, calculate_forces)
...
Arrays of parameters used in the semi-empirical calculations \References Everywhere in this module TC...
real(kind=dp), parameter, public rij_threshold
Definition of the semi empirical parameter types.
subroutine, public get_se_param(sep, name, typ, defined, z, zeff, natorb, eheat, beta, sto_exponents, uss, upp, udd, uff, alp, eisol, gss, gsp, gpp, gp2, acoul, nr, de, ass, asp, app, hsp, gsd, gpd, gdd, ppddg, dpddg, ngauss)
Get info from the semi-empirical type.
Working with the semi empirical parameter types.
integer function, public get_se_type(se_method)
Gives back the unique semi_empirical METHOD type.
pure subroutine, public virial_pair_force(pv_virial, f0, force, rab)
Computes the contribution to the stress tensor from two-body pair-wise forces.
Provides all information about an atomic kind.
type of a logger, at the moment it contains just a print level starting at which level it should be l...
stores all the informations relevant to an mpi environment
Provides all information about a quickstep kind.
calculation environment to calculate the ks matrix, holds all the needed vars. assumes that the core ...
keeps the density in various representations, keeping track of which ones are valid.