(git:3f0d10b)
Loading...
Searching...
No Matches
ai_overlap_aabb.F
Go to the documentation of this file.
1!--------------------------------------------------------------------------------------------------!
2! CP2K: A general program to perform molecular dynamics simulations !
3! Copyright 2000-2026 CP2K developers group <https://cp2k.org> !
4! !
5! SPDX-License-Identifier: GPL-2.0-or-later !
6!--------------------------------------------------------------------------------------------------!
7
8! **************************************************************************************************
9!> \brief Calculation of the overlap integrals over Cartesian Gaussian-type
10!> functions.
11!> \par Literature
12!> S. Obara and A. Saika, J. Chem. Phys. 84, 3963 (1986)
13!> \par Parameters
14!> - ax,ay,az : Angular momentum index numbers of orbital a.
15!> - bx,by,bz : Angular momentum index numbers of orbital b.
16!> - coset : Cartesian orbital set pointer.
17!> - dab : Distance between the atomic centers a and b.
18!> - l{a,b} : Angular momentum quantum number of shell a or b.
19!> - l{a,b}_max: Maximum angular momentum quantum number of shell a or b.
20!> - l{a,b}_min: Minimum angular momentum quantum number of shell a or b.
21!> - rab : Distance vector between the atomic centers a and b.
22!> - rpgf{a,b} : Radius of the primitive Gaussian-type function a or b.
23!> - sab : Shell set of overlap integrals.
24!> - zet{a,b} : Exponents of the Gaussian-type functions a or b.
25!> - zetp : Reciprocal of the sum of the exponents of orbital a and b.
26! **************************************************************************************************
28
29 USE ai_os_rr, ONLY: os_rr_ovlp
30 USE kinds, ONLY: dp
31 USE mathconstants, ONLY: pi
32 USE orbital_pointers, ONLY: coset,&
33 indco,&
34 ncoset
35#include "../base/base_uses.f90"
36
37 IMPLICIT NONE
38
39 PRIVATE
40
41 CHARACTER(len=*), PARAMETER, PRIVATE :: moduleN = 'ai_overlap_aabb'
42
43! *** Public subroutines ***
44 PUBLIC :: overlap_aabb
45
46CONTAINS
47
48! **************************************************************************************************
49!> \brief Purpose: Calculation of the two-center overlap integrals [aa|bb]
50!> over Cartesian Gaussian-type functions.
51!> \param la_max_set1 ...
52!> \param la_min_set1 ...
53!> \param npgfa1 ...
54!> \param rpgfa1 ...
55!> \param zeta1 ...
56!> \param la_max_set2 ...
57!> \param la_min_set2 ...
58!> \param npgfa2 ...
59!> \param rpgfa2 ...
60!> \param zeta2 ...
61!> \param lb_max_set1 ...
62!> \param lb_min_set1 ...
63!> \param npgfb1 ...
64!> \param rpgfb1 ...
65!> \param zetb1 ...
66!> \param lb_max_set2 ...
67!> \param lb_min_set2 ...
68!> \param npgfb2 ...
69!> \param rpgfb2 ...
70!> \param zetb2 ...
71!> \param asets_equal ...
72!> \param bsets_equal ...
73!> \param rab ...
74!> \param dab ...
75!> \param saabb primitive integrals, including zero screened blocks and lower-shell padding
76!> \date 06.2014
77!> \author Dorothea Golze
78! **************************************************************************************************
79 SUBROUTINE overlap_aabb(la_max_set1, la_min_set1, npgfa1, rpgfa1, zeta1, &
80 la_max_set2, la_min_set2, npgfa2, rpgfa2, zeta2, &
81 lb_max_set1, lb_min_set1, npgfb1, rpgfb1, zetb1, &
82 lb_max_set2, lb_min_set2, npgfb2, rpgfb2, zetb2, &
83 asets_equal, bsets_equal, rab, dab, saabb)
84
85 INTEGER, INTENT(IN) :: la_max_set1, la_min_set1, npgfa1
86 REAL(kind=dp), DIMENSION(:), INTENT(IN) :: rpgfa1, zeta1
87 INTEGER, INTENT(IN) :: la_max_set2, la_min_set2, npgfa2
88 REAL(kind=dp), DIMENSION(:), INTENT(IN) :: rpgfa2, zeta2
89 INTEGER, INTENT(IN) :: lb_max_set1, lb_min_set1, npgfb1
90 REAL(kind=dp), DIMENSION(:), INTENT(IN) :: rpgfb1, zetb1
91 INTEGER, INTENT(IN) :: lb_max_set2, lb_min_set2, npgfb2
92 REAL(kind=dp), DIMENSION(:), INTENT(IN) :: rpgfb2, zetb2
93 LOGICAL, INTENT(IN) :: asets_equal, bsets_equal
94 REAL(kind=dp), DIMENSION(3), INTENT(IN) :: rab
95 REAL(kind=dp), INTENT(IN) :: dab
96 REAL(kind=dp), DIMENSION(:, :, :, :), INTENT(OUT) :: saabb
97
98 CHARACTER(len=*), PARAMETER :: routinen = 'overlap_aabb'
99
100 INTEGER :: coa, cob, handle, ia, ib, ipgf, ja, jb, jpgf, jpgf_start, kpgf, la_max, la_min, &
101 lb_max, lb_min, ldrr, lpgf, lpgf_start, ncoa1, ncoa2, ncob1, ncob2
102 INTEGER, ALLOCATABLE :: map_a(:, :), map_b(:, :)
103 INTEGER, DIMENSION(3) :: na, nb
104 REAL(kind=dp) :: f0, zeta, zetb, zetp
105 REAL(kind=dp), ALLOCATABLE :: s(:, :)
106 REAL(kind=dp), ALLOCATABLE, DIMENSION(:, :, :) :: rr
107 REAL(kind=dp), DIMENSION(3) :: rap, rbp
108
109 CALL timeset(routinen, handle)
110 saabb = 0.0_dp
111 la_max = la_max_set1 + la_max_set2
112 la_min = la_min_set1 + la_min_set2
113 lb_max = lb_max_set1 + lb_max_set2
114 lb_min = lb_min_set1 + lb_min_set2
115 ldrr = max(la_max, lb_max) + 1
116 ALLOCATE (rr(0:ldrr - 1, 0:ldrr - 1, 3))
117 ALLOCATE (s(ncoset(la_min - 1) + 1:ncoset(la_max), ncoset(lb_min - 1) + 1:ncoset(lb_max)))
118 ALLOCATE (map_a(ncoset(la_min_set1 - 1) + 1:ncoset(la_max_set1), &
119 ncoset(la_min_set2 - 1) + 1:ncoset(la_max_set2)), &
120 map_b(ncoset(lb_min_set1 - 1) + 1:ncoset(lb_max_set1), &
121 ncoset(lb_min_set2 - 1) + 1:ncoset(lb_max_set2)))
122
123 ! Same-center products add Cartesian degrees; the maps are shared by all primitives.
124 DO ja = lbound(map_a, 2), ubound(map_a, 2)
125 DO ia = lbound(map_a, 1), ubound(map_a, 1)
126 na = indco(:, ia) + indco(:, ja)
127 map_a(ia, ja) = coset(na(1), na(2), na(3))
128 END DO
129 END DO
130 DO jb = lbound(map_b, 2), ubound(map_b, 2)
131 DO ib = lbound(map_b, 1), ubound(map_b, 1)
132 nb = indco(:, ib) + indco(:, jb)
133 map_b(ib, jb) = coset(nb(1), nb(2), nb(3))
134 END DO
135 END DO
136
137! *** Loop over all pairs of primitive Gaussian-type functions ***
138
139 DO ipgf = 1, npgfa1
140 ncoa1 = (ipgf - 1)*ncoset(la_max_set1)
141 jpgf_start = merge(ipgf, 1, asets_equal)
142
143 DO jpgf = jpgf_start, npgfa2
144
145 ncoa2 = (jpgf - 1)*ncoset(la_max_set2)
146 zeta = zeta1(ipgf) + zeta2(jpgf)
147
148 DO kpgf = 1, npgfb1
149
150 ncob1 = (kpgf - 1)*ncoset(lb_max_set1)
151 lpgf_start = merge(kpgf, 1, bsets_equal)
152
153 DO lpgf = lpgf_start, npgfb2
154 ncob2 = (lpgf - 1)*ncoset(lb_max_set2)
155
156 ! *** Screening ***
157 IF (min(rpgfa1(ipgf), rpgfa2(jpgf)) + &
158 min(rpgfb1(kpgf), rpgfb2(lpgf)) < dab) cycle
159
160 zetb = zetb1(kpgf) + zetb2(lpgf)
161
162! *** Calculate some prefactors ***
163
164 zetp = 1.0_dp/(zeta + zetb)
165
166 f0 = sqrt((pi*zetp)**3)*exp(-zeta*zetb*zetp*dab*dab)
167 rap(:) = zetb*zetp*rab(:)
168 rbp(:) = -zeta*zetp*rab(:)
169
170 CALL os_rr_ovlp(rap, la_max, rbp, lb_max, 1.0_dp/zetp, ldrr, rr)
171
172 DO cob = ncoset(lb_min - 1) + 1, ncoset(lb_max)
173 nb = indco(:, cob)
174 DO coa = ncoset(la_min - 1) + 1, ncoset(la_max)
175 na = indco(:, coa)
176 s(coa, cob) = f0*rr(na(1), nb(1), 1)*rr(na(2), nb(2), 2)*rr(na(3), nb(3), 3)
177 END DO
178 END DO
179
180! *** Store the primitive overlap integrals ***
181 DO jb = ncoset(lb_min_set2 - 1) + 1, ncoset(lb_max_set2)
182 DO ib = ncoset(lb_min_set1 - 1) + 1, ncoset(lb_max_set1)
183 cob = map_b(ib, jb)
184 DO ja = ncoset(la_min_set2 - 1) + 1, ncoset(la_max_set2)
185 DO ia = ncoset(la_min_set1 - 1) + 1, ncoset(la_max_set1)
186 coa = map_a(ia, ja)
187 saabb(ncoa1 + ia, ncoa2 + ja, ncob1 + ib, ncob2 + jb) = s(coa, cob)
188 IF (asets_equal) saabb(ncoa2 + ja, ncoa1 + ia, ncob1 + ib, ncob2 + jb) = s(coa, cob)
189 IF (bsets_equal) saabb(ncoa1 + ia, ncoa2 + ja, ncob2 + jb, ncob1 + ib) = s(coa, cob)
190 IF (asets_equal .AND. bsets_equal) THEN
191 saabb(ncoa2 + ja, ncoa1 + ia, ncob2 + jb, ncob1 + ib) = s(coa, cob)
192 END IF
193 END DO
194 END DO
195 END DO
196 END DO
197
198 END DO
199 END DO
200 END DO
201 END DO
202
203 DEALLOCATE (rr, s, map_a, map_b)
204 CALL timestop(handle)
205
206 END SUBROUTINE overlap_aabb
207
208END MODULE ai_overlap_aabb
Calculation of the overlap integrals over Cartesian Gaussian-type functions.
subroutine, public overlap_aabb(la_max_set1, la_min_set1, npgfa1, rpgfa1, zeta1, la_max_set2, la_min_set2, npgfa2, rpgfa2, zeta2, lb_max_set1, lb_min_set1, npgfb1, rpgfb1, zetb1, lb_max_set2, lb_min_set2, npgfb2, rpgfb2, zetb2, asets_equal, bsets_equal, rab, dab, saabb)
Purpose: Calculation of the two-center overlap integrals [aa|bb] over Cartesian Gaussian-type functio...
Defines the basic variable types.
Definition kinds.F:23
integer, parameter, public dp
Definition kinds.F:34
Definition of mathematical constants and functions.
real(kind=dp), parameter, public pi
Provides Cartesian and spherical orbital pointers and indices.
integer, dimension(:), allocatable, public ncoset
integer, dimension(:, :, :), allocatable, public coset
integer, dimension(:, :), allocatable, public indco