28 #include "../base/base_uses.f90"
34 CHARACTER(len=*),
PARAMETER,
PRIVATE :: moduleN =
'generic_shg_integrals_init'
50 TYPE(gto_basis_set_type),
POINTER :: basis
51 REAL(kind=
dp),
DIMENSION(:, :, :),
POINTER :: scon_shg
53 INTEGER :: ipgf, iset, ishell, l, maxpgf, maxshell, &
55 INTEGER,
DIMENSION(:),
POINTER :: npgf, nshell
56 REAL(kind=
dp) :: aif, gcc
57 REAL(kind=
dp),
ALLOCATABLE,
DIMENSION(:, :) :: norm
58 REAL(kind=
dp),
DIMENSION(:, :),
POINTER :: zet
62 nshell => basis%nshell
65 maxpgf =
SIZE(basis%gcc, 1)
66 maxshell =
SIZE(basis%gcc, 2)
67 ALLOCATE (norm(basis%nset, maxshell))
68 ALLOCATE (scon_shg(maxpgf, maxshell, nset))
71 CALL basis_norm_shg(basis, norm)
74 DO ishell = 1, nshell(iset)
75 l = basis%l(ishell, iset)
76 DO ipgf = 1, npgf(iset)
77 aif = 1.0_dp/((2._dp*zet(ipgf, iset))**l)
78 gcc = basis%gcc(ipgf, ishell, iset)
79 scon_shg(ipgf, ishell, iset) = norm(iset, ishell)*gcc*aif
93 SUBROUTINE basis_norm_shg(basis, norm)
95 TYPE(gto_basis_set_type),
POINTER :: basis
96 REAL(
dp),
DIMENSION(:, :),
INTENT(INOUT) :: norm
98 INTEGER :: ipgf, iset, ishell, jpgf, l
99 REAL(kind=
dp) :: aai, aaj, cci, ccj, expa, ppl
103 DO iset = 1, basis%nset
104 DO ishell = 1, basis%nshell(iset)
105 l = basis%l(ishell, iset)
106 expa = 0.5_dp*real(2*l + 3,
dp)
107 ppl =
fac(2*l + 2)*
pi**(1.5_dp)/
fac(l + 1)
108 ppl = ppl/(2._dp**real(2*l + 1,
dp))
109 ppl = ppl/real(2*l + 1,
dp)
110 DO ipgf = 1, basis%npgf(iset)
111 cci = basis%gcc(ipgf, ishell, iset)
112 aai = basis%zet(ipgf, iset)
113 DO jpgf = 1, basis%npgf(iset)
114 ccj = basis%gcc(jpgf, ishell, iset)
115 aaj = basis%zet(jpgf, iset)
116 norm(iset, ishell) = norm(iset, ishell) + cci*ccj*ppl/(aai + aaj)**expa
119 norm(iset, ishell) = 1.0_dp/sqrt(norm(iset, ishell))
123 END SUBROUTINE basis_norm_shg
136 TYPE(gto_basis_set_type),
POINTER :: orb_basis, ri_basis
137 INTEGER,
DIMENSION(:, :, :),
POINTER :: orb_index, ri_index
138 REAL(kind=
dp),
DIMENSION(:, :, :, :),
POINTER :: scon_mix
140 INTEGER :: forb, fri, iil, il, ipgf, iset, ishell, jpgf, jset, jshell, l, l1, l2, lmax_orb, &
141 lmax_ri, maxpgf_orb, maxpgf_ri, maxshell_orb, maxshell_ri, nf_orb, nf_ri, nl, nl_max, &
143 INTEGER,
DIMENSION(:),
POINTER :: npgf_orb, npgf_ri, nshell_orb, nshell_ri
144 REAL(kind=
dp) :: cjf, const, const1, const2, gcc_orb, &
145 gcc_ri, prefac, scon1, scon2, zet
146 REAL(kind=
dp),
ALLOCATABLE,
DIMENSION(:) :: shg_fac
147 REAL(kind=
dp),
DIMENSION(:, :),
POINTER :: norm_orb, norm_ri, zet_orb, zet_ri
149 nset_orb = orb_basis%nset
150 npgf_orb => orb_basis%npgf
151 nshell_orb => orb_basis%nshell
152 zet_orb => orb_basis%zet
153 nset_ri = ri_basis%nset
154 npgf_ri => ri_basis%npgf
155 nshell_ri => ri_basis%nshell
156 zet_ri => ri_basis%zet
158 maxpgf_orb =
SIZE(orb_basis%gcc, 1)
159 maxshell_orb =
SIZE(orb_basis%gcc, 2)
160 ALLOCATE (norm_orb(nset_orb, maxshell_orb))
161 maxpgf_ri =
SIZE(ri_basis%gcc, 1)
162 maxshell_ri =
SIZE(ri_basis%gcc, 2)
163 ALLOCATE (norm_ri(nset_ri, maxshell_ri))
165 CALL basis_norm_shg(orb_basis, norm_orb)
166 CALL basis_norm_shg(ri_basis, norm_ri)
168 ALLOCATE (orb_index(maxpgf_orb, maxshell_orb, nset_orb))
169 ALLOCATE (ri_index(maxpgf_ri, maxshell_ri, nset_ri))
173 DO iset = 1, nset_orb
174 DO ishell = 1, nshell_orb(iset)
175 DO ipgf = 1, npgf_orb(iset)
177 orb_index(ipgf, ishell, iset) = nf_orb
185 DO ishell = 1, nshell_ri(iset)
186 DO ipgf = 1, npgf_ri(iset)
188 ri_index(ipgf, ishell, iset) = nf_ri
193 lmax_orb = maxval(orb_basis%lmax)
194 lmax_ri = maxval(ri_basis%lmax)
195 nl_max = int((lmax_orb + lmax_ri)/2) + 1
196 ALLOCATE (scon_mix(nl_max, nf_ri, nf_orb, nl_max))
199 ALLOCATE (shg_fac(0:nl_max - 1))
202 DO iset = 1, nset_orb
203 DO ishell = 1, nshell_orb(iset)
204 l1 = orb_basis%l(ishell, iset)
205 const1 = sqrt(1.0_dp/real(2*l1 + 1,
dp))
207 DO jshell = 1, nshell_ri(jset)
208 l2 = ri_basis%l(jshell, jset)
209 const2 = sqrt(1.0_dp/real(2*l2 + 1,
dp))
210 nl = int((l1 + l2)/2)
211 IF (l1 == 0 .OR. l2 == 0) nl = 0
214 const = const1*const2*2.0_dp*sqrt(
pi*real(2*l + 1,
dp))
216 shg_fac(iil) =
fac(l + iil - 1)*
ifac(l)*real(l,
dp) &
219 DO ipgf = 1, npgf_orb(iset)
220 forb = orb_index(ipgf, ishell, iset)
221 gcc_orb = orb_basis%gcc(ipgf, ishell, iset)
222 scon1 = norm_orb(iset, ishell)*gcc_orb
223 DO jpgf = 1, npgf_ri(jset)
224 fri = ri_index(jpgf, jshell, jset)
225 gcc_ri = ri_basis%gcc(jpgf, jshell, jset)
226 scon2 = norm_ri(jset, jshell)*gcc_ri
227 zet = zet_orb(ipgf, iset) + zet_ri(jpgf, jset)
228 cjf = 1.0_dp/((2._dp*zet)**l)
229 prefac = const*cjf*scon1*scon2
231 scon_mix(iil + 1, fri, forb, il + 1) = prefac*shg_fac(iil)/zet**iil
241 DEALLOCATE (norm_orb, norm_ri, shg_fac)
254 TYPE(gto_basis_set_type),
POINTER :: basis
255 INTEGER,
INTENT(IN) :: m
256 REAL(kind=
dp),
DIMENSION(:, :, :),
INTENT(IN) :: scon_shg
257 REAL(kind=
dp),
ALLOCATABLE,
DIMENSION(:, :, :, :) :: scon_rx2m
259 INTEGER :: ipgf, iset, ishell, j, l, maxpgf, &
261 INTEGER,
DIMENSION(:),
POINTER :: npgf, nshell
262 REAL(kind=
dp),
ALLOCATABLE,
DIMENSION(:) :: shg_fac
263 REAL(kind=
dp),
DIMENSION(:, :),
POINTER :: zet
266 nshell => basis%nshell
270 maxpgf =
SIZE(basis%gcc, 1)
271 maxshell =
SIZE(basis%gcc, 2)
272 ALLOCATE (scon_rx2m(maxpgf, m + 1, maxshell, nset))
274 ALLOCATE (shg_fac(0:m))
278 DO ishell = 1, nshell(iset)
279 l = basis%l(ishell, iset)
281 shg_fac(j) =
fac(l + j - 1)*
ifac(l)*real(l,
dp) &
284 DO ipgf = 1, npgf(iset)
286 scon_rx2m(ipgf, j + 1, ishell, iset) = scon_shg(ipgf, ishell, iset) &
287 *shg_fac(j)/zet(ipgf, iset)**j
309 REAL(kind=
dp),
DIMENSION(:, :, :),
POINTER :: my_cg
310 INTEGER,
DIMENSION(:, :, :),
POINTER :: cg_none0_list
311 INTEGER,
DIMENSION(:, :),
POINTER :: ncg_none0
312 INTEGER,
INTENT(IN) :: maxl1, maxl2
314 INTEGER :: il, ilist, iso, iso1, iso2, l1, l1l2, &
315 l2, lc1, lc2, lp, m1, m2, maxl, mm, &
316 mp, nlist, nlist_max, nsfunc, nsfunc1, &
318 REAL(
dp),
ALLOCATABLE,
DIMENSION(:, :) :: rga
328 ALLOCATE (my_cg(nsfunc1, nsfunc2, nsfunc))
330 ALLOCATE (ncg_none0(nsfunc1, nsfunc2))
332 ALLOCATE (cg_none0_list(nsfunc1, nsfunc2, nlist_max))
335 ALLOCATE (rga(maxl, 2))
345 CALL clebsch_gordon(l1, m1, l2, m2, rga)
349 IF (m1*m2 < 0 .OR. (m1*m2 == 0 .AND. (m1 < 0 .OR. m2 < 0)))
THEN
356 DO lp = mod(l1 + l2, 2), l1l2, 2
358 IF (abs(mp) <= lp)
THEN
360 iso =
nsoset(lp - 1) + lp + 1 + mp
362 iso =
nsoset(lp - 1) + lp + 1 - abs(mp)
364 my_cg(iso1, iso2, iso) = rga(il, 1)
366 IF (mp /= mm .AND. abs(mm) <= lp)
THEN
368 iso =
nsoset(lp - 1) + lp + 1 + mm
370 iso =
nsoset(lp - 1) + lp + 1 - abs(mm)
372 my_cg(iso1, iso2, iso) = rga(il, 2)
377 IF (abs(my_cg(iso1, iso2, ilist)) > 1.e-8_dp)
THEN
379 IF (nlist > nlist_max)
THEN
380 CALL reallocate(cg_none0_list, 1, nsfunc1, 1, nsfunc2, 1, nlist)
383 cg_none0_list(iso1, iso2, nlist) = ilist
386 ncg_none0(iso1, iso2) = nlist
Initialization for solid harmonic Gaussian (SHG) integral scheme. Scheme for calculation of contracte...
subroutine, public contraction_matrix_shg_rx2m(basis, m, scon_shg, scon_rx2m)
...
subroutine, public contraction_matrix_shg_mix(orb_basis, ri_basis, orb_index, ri_index, scon_mix)
mixed contraction matrix for SHG integrals [aba] and [abb] for orbital and ri basis at the same atom
subroutine, public contraction_matrix_shg(basis, scon_shg)
contraction matrix for SHG integrals
subroutine, public get_clebsch_gordon_coefficients(my_cg, cg_none0_list, ncg_none0, maxl1, maxl2)
calculate the Clebsch-Gordon (CG) coefficients for expansion of the product of two spherical harmonic...
Defines the basic variable types.
integer, parameter, public dp
Definition of mathematical constants and functions.
real(kind=dp), parameter, public pi
real(kind=dp), dimension(0:maxfac), parameter, public ifac
real(kind=dp), dimension(0:maxfac), parameter, public fac
Utility routines for the memory handling.
Provides Cartesian and spherical orbital pointers and indices.
integer, dimension(:), allocatable, public nsoset
integer, dimension(:, :), allocatable, public indso
Calculate spherical harmonics.
subroutine, public clebsch_gordon_init(l)
...
subroutine, public clebsch_gordon_deallocate()
...