72 CHARACTER(LEN=*),
INTENT(IN) :: basis_type
76 CHARACTER(len=*),
PARAMETER :: routinen =
'build_com_tr_matrix'
78 INTEGER :: handle, iatom, icol, ikind, ir, irow, &
79 iset, jatom, jkind, jset, ldsab, ltab, &
80 mepos, ncoa, ncob, nkind, nseta, &
81 nsetb, nthread, sgfa, sgfb
82 INTEGER,
DIMENSION(3) :: cell
83 INTEGER,
DIMENSION(:),
POINTER :: la_max, la_min, lb_max, lb_min, npgfa, &
85 INTEGER,
DIMENSION(:, :),
POINTER :: first_sgfa, first_sgfb
86 LOGICAL :: do_symmetric, found, trans
87 REAL(kind=
dp) :: rab2, tab
88 REAL(kind=
dp),
ALLOCATABLE,
DIMENSION(:, :) :: qab, tkab
89 REAL(kind=
dp),
ALLOCATABLE,
DIMENSION(:, :, :) :: kab
90 REAL(kind=
dp),
DIMENSION(3) :: rab
91 REAL(kind=
dp),
DIMENSION(:),
POINTER :: set_radius_a, set_radius_b
92 REAL(kind=
dp),
DIMENSION(:, :),
POINTER :: kx_block, ky_block, kz_block, rpgfa, &
93 rpgfb, scon_a, scon_b, zeta, zetb
97 DIMENSION(:),
POINTER :: nl_iterator
99 CALL timeset(routinen, handle)
101 nkind =
SIZE(qs_kind_set)
104 cpassert(
SIZE(sab_nl) > 0)
108 ALLOCATE (basis_set_list(nkind))
131 ALLOCATE (kab(ldsab, ldsab, 3), qab(ldsab, ldsab))
135 iatom=iatom, jatom=jatom, r=rab, cell=cell)
136 basis_set_a => basis_set_list(ikind)%gto_basis_set
137 IF (.NOT.
ASSOCIATED(basis_set_a)) cycle
138 basis_set_b => basis_set_list(jkind)%gto_basis_set
139 IF (.NOT.
ASSOCIATED(basis_set_b)) cycle
141 first_sgfa => basis_set_a%first_sgf
142 la_max => basis_set_a%lmax
143 la_min => basis_set_a%lmin
144 npgfa => basis_set_a%npgf
145 nseta = basis_set_a%nset
146 nsgfa => basis_set_a%nsgf_set
147 rpgfa => basis_set_a%pgf_radius
148 set_radius_a => basis_set_a%set_radius
149 scon_a => basis_set_a%scon
150 zeta => basis_set_a%zet
152 first_sgfb => basis_set_b%first_sgf
153 lb_max => basis_set_b%lmax
154 lb_min => basis_set_b%lmin
155 npgfb => basis_set_b%npgf
156 nsetb = basis_set_b%nset
157 nsgfb => basis_set_b%nsgf_set
158 rpgfb => basis_set_b%pgf_radius
159 set_radius_b => basis_set_b%set_radius
160 scon_b => basis_set_b%scon
161 zetb => basis_set_b%zet
163 IF (do_symmetric)
THEN
164 IF (iatom <= jatom)
THEN
177 row=irow, col=icol, block=kx_block, found=found)
181 row=irow, col=icol, block=ky_block, found=found)
185 row=irow, col=icol, block=kz_block, found=found)
188 rab2 = rab(1)*rab(1) + rab(2)*rab(2) + rab(3)*rab(3)
190 trans = do_symmetric .AND. (iatom > jatom)
194 ncoa = npgfa(iset)*(
ncoset(la_max(iset)) -
ncoset(la_min(iset) - 1))
195 sgfa = first_sgfa(1, iset)
199 IF (set_radius_a(iset) + set_radius_b(jset) < tab) cycle
201 ncob = npgfb(jset)*(
ncoset(lb_max(jset)) -
ncoset(lb_min(jset) - 1))
202 sgfb = first_sgfb(1, jset)
205 ltab = max(npgfa(iset)*
ncoset(la_max(iset) + 1), npgfb(jset)*
ncoset(lb_max(jset) + 1))
206 ALLOCATE (tkab(ltab, ltab))
207 CALL kinetic(la_max(iset) + 1, la_min(iset), npgfa(iset), rpgfa(:, iset), zeta(:, iset), &
208 lb_max(jset) + 1, lb_min(jset), npgfb(jset), rpgfb(:, jset), zetb(:, jset), &
211 CALL comab_opr(la_max(iset), npgfa(iset), rpgfa(:, iset), la_min(iset), &
212 lb_max(jset), npgfb(jset), rpgfb(:, jset), lb_min(jset), &
217 CALL contraction(kab(:, :, ir), qab, ca=scon_a(:, sgfa:), na=ncoa, ma=nsgfa(iset), &
218 cb=scon_b(:, sgfb:), nb=ncob, mb=nsgfb(jset), trans=trans)
222 CALL block_add(
"IN", qab, nsgfa(iset), nsgfb(jset), kx_block, sgfa, sgfb, trans=trans)
224 CALL block_add(
"IN", qab, nsgfa(iset), nsgfb(jset), ky_block, sgfa, sgfb, trans=trans)
226 CALL block_add(
"IN", qab, nsgfa(iset), nsgfb(jset), kz_block, sgfa, sgfb, trans=trans)
235 DEALLOCATE (kab, qab)
240 DEALLOCATE (basis_set_list)
242 CALL timestop(handle)