(git:4cf809f)
Loading...
Searching...
No Matches
ai_contraction_sphi.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 Contraction of integrals over primitive Cartesian Gaussians based on the contraction
10!> matrix sphi which is part of the gto_basis_set_type
11!> \par History
12!> -added abc_contract_xsmm routine, A. Bussy (04.2020)
13!> \author Dorothea Golze (05.2016)
14! **************************************************************************************************
16
17 USE kinds, ONLY: dp, int_8
18#if defined(__LIBXS)
19 USE libxs, ONLY: libxs_gemm_config_t, libxs_gemm_dispatch, &
20 libxs_gemm_call, libxs_datatype_f64
21 use, INTRINSIC :: iso_c_binding, only: c_loc, c_funloc
22#endif
23
24#include "../base/base_uses.f90"
25
26 IMPLICIT NONE
27
28 PRIVATE
29
30 CHARACTER(len=*), PARAMETER, PRIVATE :: moduleN = 'ai_contraction_sphi'
31
33
34CONTAINS
35
36! **************************************************************************************************
37!> \brief contract overlap integrals (a,b) and transfer to spherical Gaussians
38!> \param abint contracted, normalized integrals of spherical Gaussians
39!> \param sab uncontracted, unnormalized integrals of primitive Cartesian Gaussians
40!> \param sphi_a contraction matrix for center a
41!> \param sphi_b contraction matrix for center b
42!> \param ncoa number of cartesian orbitals on a
43!> \param ncob number of cartesian orbitals on b
44!> \param nsgfa number of spherical Gaussian functions on a
45!> \param nsgfb number of spherical Gaussian functions on b
46! **************************************************************************************************
47 SUBROUTINE ab_contract(abint, sab, sphi_a, sphi_b, ncoa, ncob, nsgfa, nsgfb)
48
49 REAL(kind=dp), DIMENSION(:, :), INTENT(INOUT) :: abint
50 REAL(kind=dp), DIMENSION(:, :), INTENT(IN) :: sab, sphi_a, sphi_b
51 INTEGER, INTENT(IN) :: ncoa, ncob, nsgfa, nsgfb
52
53 CHARACTER(LEN=*), PARAMETER :: routinen = 'ab_contract'
54
55 INTEGER :: handle
56 REAL(kind=dp), ALLOCATABLE, DIMENSION(:, :) :: cpp
57
58 CALL timeset(routinen, handle)
59
60 cpassert(ncob <= SIZE(sab, 2))
61
62 IF ((nsgfa*ncob*(ncoa + nsgfb)) <= (nsgfb*ncoa*(ncob + nsgfa))) THEN ! (sphi_a x sab) x sphi_b
63 ALLOCATE (cpp(nsgfa, ncob))
64 ! [nsgfa,ncoa] x [ncoa,ncob] -> [nsgfa,ncob]
65 CALL dgemm("T", "N", nsgfa, ncob, ncoa, 1._dp, sphi_a, SIZE(sphi_a, 1), sab, SIZE(sab, 1), 0.0_dp, cpp, nsgfa)
66 ! [nsgfa,ncob] x [ncob,nsgfb] -> [nsgfa,nsgfb]
67 CALL dgemm("N", "N", nsgfa, nsgfb, ncob, 1._dp, cpp, nsgfa, sphi_b, SIZE(sphi_b, 1), 0.0_dp, &
68 abint, SIZE(abint, 1))
69 ELSE ! sphi_a x (sab x sphi_b)
70 ALLOCATE (cpp(ncoa, nsgfb))
71 ! [ncoa,ncob] x [ncob,nsgfb] -> [ncoa,nsgfb]
72 CALL dgemm("N", "N", ncoa, nsgfb, ncob, 1._dp, sab, SIZE(sab, 1), sphi_b, SIZE(sphi_b, 1), 0.0_dp, cpp, ncoa)
73 ! [nsgfa,ncoa] x [ncoa,nsgfb] -> [nsgfa,nsgfb]
74 CALL dgemm("T", "N", nsgfa, nsgfb, ncoa, 1._dp, sphi_a, SIZE(sphi_a, 1), cpp, ncoa, 0.0_dp, &
75 abint, SIZE(abint, 1))
76 END IF
77
78 DEALLOCATE (cpp)
79
80 CALL timestop(handle)
81
82 END SUBROUTINE ab_contract
83
84! **************************************************************************************************
85!> \brief contract three-center overlap integrals (a,b,c) and transfer
86!> to spherical Gaussians
87!> \param abcint contracted, normalized integrals of spherical Gaussians
88!> \param sabc uncontracted, unnormalized integrals of primitive Cartesian Gaussians
89!> \param sphi_a contraction matrix for center a
90!> \param sphi_b contraction matrix for center b
91!> \param sphi_c contraction matrix for center c
92!> \param ncoa number of cartesian orbitals on a
93!> \param ncob number of cartesian orbitals on b
94!> \param ncoc number of cartesian orbitals on c
95!> \param nsgfa number of spherical Gaussian functions on a
96!> \param nsgfb number of spherical Gaussian functions on b
97!> \param nsgfc number of spherical Gaussian functions on c
98! **************************************************************************************************
99 SUBROUTINE abc_contract(abcint, sabc, sphi_a, sphi_b, sphi_c, ncoa, ncob, ncoc, &
100 nsgfa, nsgfb, nsgfc)
101
102 REAL(kind=dp), DIMENSION(:, :, :) :: abcint, sabc
103 REAL(kind=dp), DIMENSION(:, :) :: sphi_a, sphi_b, sphi_c
104 INTEGER, INTENT(IN) :: ncoa, ncob, ncoc, nsgfa, nsgfb, nsgfc
105
106 CHARACTER(LEN=*), PARAMETER :: routinen = 'abc_contract'
107
108 INTEGER :: handle, i, m1, m2, m3, msphia, msphib, &
109 msphic, mx
110 REAL(kind=dp), ALLOCATABLE, DIMENSION(:, :, :) :: tmp
111
112 CALL timeset(routinen, handle)
113
114 cpassert(SIZE(abcint, 1) == nsgfa)
115 cpassert(SIZE(abcint, 2) == nsgfb)
116
117 msphia = SIZE(sphi_a, 1)
118 msphib = SIZE(sphi_b, 1)
119 msphic = SIZE(sphi_c, 1)
120
121 m1 = SIZE(sabc, 1)
122 m2 = SIZE(sabc, 2)
123 m3 = SIZE(sabc, 3)
124 mx = max(m2, nsgfb)
125
126 ! ALLOCATE (cpp(nsgfa, m2, m3), cpc(nsgfa, nsgfb, m3))
127 ALLOCATE (tmp(nsgfa, mx, m3 + 1))
128
129 CALL dgemm("T", "N", nsgfa, m2*m3, ncoa, 1._dp, sphi_a, msphia, sabc, m1, 0.0_dp, tmp(:, :, 2), nsgfa)
130 DO i = 1, m3
131 CALL dgemm("N", "N", nsgfa, nsgfb, ncob, 1._dp, tmp(:, :, i + 1), nsgfa, sphi_b, msphib, &
132 0.0_dp, tmp(:, :, i), nsgfa)
133 END DO
134 CALL dgemm("N", "N", nsgfa*nsgfb, nsgfc, ncoc, 1._dp, tmp, nsgfa*mx, sphi_c, msphic, 0.0_dp, &
135 abcint, nsgfa*nsgfb)
136
137 DEALLOCATE (tmp)
138
139 CALL timestop(handle)
140
141 END SUBROUTINE abc_contract
142
143! **************************************************************************************************
144!> \brief contract four-center overlap integrals (a,b,c,d) and transfer
145!> to spherical Gaussians
146!> \param abcdint contracted, normalized integrals of spherical Gaussians
147!> \param sabcd uncontracted, unnormalized integrals of primitive Cartesian Gaussians
148!> \param sphi_a contraction matrix for center a
149!> \param sphi_b contraction matrix for center b
150!> \param sphi_c contraction matrix for center c
151!> \param sphi_d contraction matrix for center d
152!> \param ncoa number of cartesian orbitals on a
153!> \param ncob number of cartesian orbitals on b
154!> \param ncoc number of cartesian orbitals on c
155!> \param ncod number of cartesian orbitals on d
156!> \param nsgfa number of spherical Gaussian functions on a
157!> \param nsgfb number of spherical Gaussian functions on b
158!> \param nsgfc number of spherical Gaussian functions on c
159!> \param nsgfd number of spherical Gaussian functions on d
160! **************************************************************************************************
161 SUBROUTINE abcd_contract(abcdint, sabcd, sphi_a, sphi_b, sphi_c, sphi_d, ncoa, ncob, &
162 ncoc, ncod, nsgfa, nsgfb, nsgfc, nsgfd)
163
164 REAL(kind=dp), DIMENSION(:, :, :, :), &
165 INTENT(INOUT) :: abcdint
166 REAL(kind=dp), DIMENSION(:, :, :, :), INTENT(IN) :: sabcd
167 REAL(kind=dp), DIMENSION(:, :), INTENT(IN) :: sphi_a, sphi_b, sphi_c, sphi_d
168 INTEGER, INTENT(IN) :: ncoa, ncob, ncoc, ncod, nsgfa, nsgfb, &
169 nsgfc, nsgfd
170
171 CHARACTER(LEN=*), PARAMETER :: routinen = 'abcd_contract'
172
173 INTEGER :: handle, isgfc, isgfd, m1, m2, m3, m4, &
174 msphia, msphib, msphic, msphid
175 REAL(kind=dp), ALLOCATABLE, DIMENSION(:, :) :: temp_cccc, work_cpcc
176 REAL(kind=dp), ALLOCATABLE, DIMENSION(:, :, :) :: temp_cpcc, work_cppc
177 REAL(kind=dp), ALLOCATABLE, DIMENSION(:, :, :, :) :: cpcc, cppc, cppp
178
179 CALL timeset(routinen, handle)
180
181 msphia = SIZE(sphi_a, 1)
182 msphib = SIZE(sphi_b, 1)
183 msphic = SIZE(sphi_c, 1)
184 msphid = SIZE(sphi_d, 1)
185
186 m1 = SIZE(sabcd, 1)
187 m2 = SIZE(sabcd, 2)
188 m3 = SIZE(sabcd, 3)
189 m4 = SIZE(sabcd, 4)
190
191 ALLOCATE (cppp(nsgfa, m2, m3, m4), cppc(nsgfa, m2, m3, nsgfd), &
192 cpcc(nsgfa, m2, nsgfc, nsgfd))
193
194 ALLOCATE (work_cppc(nsgfa, m2, m3), temp_cpcc(nsgfa, m2, nsgfc))
195 work_cppc = 0._dp
196 temp_cpcc = 0._dp
197
198 ALLOCATE (work_cpcc(nsgfa, m2), temp_cccc(nsgfa, nsgfb))
199 work_cpcc = 0._dp
200 temp_cccc = 0._dp
201
202 CALL dgemm("T", "N", nsgfa, m2*m3*m4, ncoa, 1._dp, sphi_a, msphia, sabcd, m1, &
203 0.0_dp, cppp, nsgfa)
204 CALL dgemm("N", "N", nsgfa*m2*m3, nsgfd, ncod, 1._dp, cppp, nsgfa*m2*m3, &
205 sphi_d, msphid, 0.0_dp, cppc, nsgfa*m2*m3)
206
207 DO isgfd = 1, nsgfd
208 work_cppc(:, :, :) = cppc(:, :, :, isgfd)
209 CALL dgemm("N", "N", nsgfa*m2, nsgfc, ncoc, 1._dp, work_cppc, nsgfa*m2, &
210 sphi_c, msphic, 0.0_dp, temp_cpcc, nsgfa*m2)
211 cpcc(:, :, :, isgfd) = temp_cpcc(:, :, :)
212 DO isgfc = 1, nsgfc
213 work_cpcc(:, :) = cpcc(:, :, isgfc, isgfd)
214 CALL dgemm("N", "N", nsgfa, nsgfb, ncob, 1._dp, work_cpcc, nsgfa, sphi_b, &
215 msphib, 0.0_dp, temp_cccc, nsgfa)
216 abcdint(:, :, isgfc, isgfd) = temp_cccc(:, :)
217 END DO
218 END DO
219
220 DEALLOCATE (cpcc, cppc, cppp)
221 DEALLOCATE (work_cpcc, work_cppc, temp_cpcc, temp_cccc)
222
223 CALL timestop(handle)
224
225 END SUBROUTINE abcd_contract
226
227! **************************************************************************************************
228!> \brief 3-center contraction routine from primitive cartesian Gaussians to spherical Gaussian
229!> functions using BLAS dgemm.
230!> Requires pre-transposition of the sphi_a array. The call-side shall DEALLOCATE buffers
231!> end of scope or after last use. This function ALLOCATEs or grows the work buffers
232!> as necessary.
233!> \param abcint contracted integrals
234!> \param sabc uncontracted integrals
235!> \param sphi_a assumed to have dimensions nsgfa x ncoa
236!> \param sphi_b assumed to have dimensions ncob x nsgfb
237!> \param sphi_c assumed to have dimensions ncoc x nsgfc
238!> \param ncoa ...
239!> \param ncob ...
240!> \param ncoc ...
241!> \param nsgfa ...
242!> \param nsgfb ...
243!> \param nsgfc ...
244!> \param cpp_buffer Buffer used for intermediate results (automatically allocated).
245!> \param ccp_buffer Buffer used for intermediate results (automatically allocated).
246!> \param prefac Prefactor which is finally multiplied into abcint (default: 1.0).
247!> \param pstfac Factor used to consider initial abcint (default: 0.0).
248! **************************************************************************************************
249 SUBROUTINE abc_contract_xsmm(abcint, sabc, sphi_a, sphi_b, sphi_c, ncoa, ncob, ncoc, &
250 nsgfa, nsgfb, nsgfc, cpp_buffer, ccp_buffer, prefac, pstfac)
251
252 REAL(kind=dp), DIMENSION(:, :, :) :: abcint
253 REAL(kind=dp), DIMENSION(*), INTENT(IN), TARGET :: sabc
254 REAL(kind=dp), DIMENSION(:, :), CONTIGUOUS, INTENT(IN), TARGET :: sphi_a, sphi_b, sphi_c
255 INTEGER, INTENT(IN) :: ncoa, ncob, ncoc, nsgfa, nsgfb, nsgfc
256 REAL(kind=dp), DIMENSION(:), ALLOCATABLE, TARGET :: cpp_buffer, ccp_buffer
257 REAL(kind=dp), INTENT(IN), OPTIONAL :: prefac, pstfac
258
259 CHARACTER(LEN=*), PARAMETER :: routinen = 'abc_contract_xsmm'
260
261 REAL(kind=dp) :: alpha, beta
262 INTEGER(KIND=int_8) :: cpp_size, ccp_size
263 INTEGER :: handle, i
264 LOGICAL :: ab_first
265#if defined(__LIBXS)
266 TYPE(libxs_gemm_config_t) :: cfg1, cfg2
267 INTEGER :: rc1, rc2
268#if defined(__MKL)
269 INTERFACE
270 FUNCTION mkl_cblas_jit_create_dgemm(jitter, &
271 layout, transa, transb, m, n, k, &
272 alpha, lda, ldb, beta, ldc) &
273 result(status) BIND(C)
274 use, INTRINSIC :: iso_c_binding, only: c_ptr, c_int, c_double
275 INTEGER(C_INT) :: status
276 TYPE(c_ptr) :: jitter
277 INTEGER(C_INT), VALUE :: layout, transa, transb
278 INTEGER(C_INT), VALUE :: m, n, k, lda, ldb, ldc
279 REAL(c_double), VALUE :: alpha, beta
280 END FUNCTION
281 FUNCTION mkl_jit_get_dgemm_ptr(jitter) RESULT(ptr) BIND(C)
282 use, INTRINSIC :: iso_c_binding, only: c_funptr, c_ptr
283 TYPE(c_funptr) :: ptr
284 TYPE(c_ptr), INTENT(IN), VALUE :: jitter
285 END FUNCTION
286 END INTERFACE
287#endif
288#if defined(__LIBXSMM)
289 INTERFACE
290 FUNCTION libxsmm_dispatch_gemm(shape, flags, prefetch) &
291 result(fn) BIND(C)
292 use, INTRINSIC :: iso_c_binding, only: c_funptr, c_int
293 INTEGER(C_INT), INTENT(IN) :: shape(10)
294 INTEGER(C_INT), INTENT(IN), VALUE :: flags, prefetch
295 TYPE(c_funptr) :: fn
296 END FUNCTION
297 END INTERFACE
298#endif
299 INTERFACE
300 SUBROUTINE dgemm_blas(transa, transb, m, n, k, alpha, a, lda, b, ldb, beta, c, ldc) &
301 BIND(C, NAME="dgemm_")
302 use, INTRINSIC :: iso_c_binding, only: c_int, c_char, c_double
303 CHARACTER(1, C_CHAR), INTENT(IN) :: transa, transb
304 INTEGER(C_INT), INTENT(IN) :: m, n, k, lda, ldb, ldc
305 REAL(c_double), INTENT(IN) :: alpha, beta, a(*), b(*)
306 REAL(c_double), INTENT(INOUT) :: c(*)
307 END SUBROUTINE
308 END INTERFACE
309#endif
310
311 CALL timeset(routinen, handle)
312
313 alpha = 1.0_dp
314 IF (PRESENT(prefac)) alpha = prefac
315
316 beta = 0.0_dp
317 IF (PRESENT(pstfac)) beta = pstfac
318
319 ! M*N*K FLOPS are used to decide if contracting (AB)C vs A(BC)
320 IF ((nsgfa*ncob*(ncoa + nsgfb)) <= (ncoa*nsgfb*(ncob + nsgfa))) THEN
321 cpp_size = nsgfa*ncob
322 ab_first = .true.
323 ELSE
324 cpp_size = ncoa*nsgfb
325 ab_first = .false.
326 END IF
327
328 ccp_size = nsgfa*nsgfb*ncoc
329 IF (.NOT. ALLOCATED(ccp_buffer)) THEN
330 ALLOCATE (ccp_buffer(ccp_size))
331 ELSE IF (SIZE(ccp_buffer) < ccp_size) THEN
332 DEALLOCATE (ccp_buffer)
333 ALLOCATE (ccp_buffer(ccp_size))
334 END IF
335
336 IF (.NOT. ALLOCATED(cpp_buffer)) THEN
337 ALLOCATE (cpp_buffer(cpp_size))
338 ELSE IF (SIZE(cpp_buffer) < cpp_size) THEN
339 DEALLOCATE (cpp_buffer)
340 ALLOCATE (cpp_buffer(cpp_size))
341 END IF
342
343#if defined(__LIBXS)
344 IF (ab_first) THEN
345 rc1 = libxs_gemm_dispatch(cfg1, libxs_datatype_f64, 'N', 'N', &
346 nsgfa, ncob, ncoa, nsgfa, ncoa, nsgfa, 1.0d0, 0.0d0 &
347#if defined(__MKL)
348 , jit_create_dgemm=c_funloc(mkl_cblas_jit_create_dgemm) &
349 , jit_get_dgemm=c_funloc(mkl_jit_get_dgemm_ptr) &
350#endif
351#if defined(__LIBXSMM)
352 , xgemm_dispatch=c_funloc(libxsmm_dispatch_gemm) &
353#endif
354 , dgemm_blas=c_funloc(dgemm_blas))
355 rc2 = libxs_gemm_dispatch(cfg2, libxs_datatype_f64, 'N', 'N', &
356 nsgfa, nsgfb, ncob, nsgfa, ncob, nsgfa, 1.0d0, 0.0d0 &
357#if defined(__MKL)
358 , jit_create_dgemm=c_funloc(mkl_cblas_jit_create_dgemm) &
359 , jit_get_dgemm=c_funloc(mkl_jit_get_dgemm_ptr) &
360#endif
361#if defined(__LIBXSMM)
362 , xgemm_dispatch=c_funloc(libxsmm_dispatch_gemm) &
363#endif
364 , dgemm_blas=c_funloc(dgemm_blas))
365 ELSE
366 rc1 = libxs_gemm_dispatch(cfg1, libxs_datatype_f64, 'N', 'N', &
367 ncoa, nsgfb, ncob, ncoa, ncob, ncoa, 1.0d0, 0.0d0 &
368#if defined(__MKL)
369 , jit_create_dgemm=c_funloc(mkl_cblas_jit_create_dgemm) &
370 , jit_get_dgemm=c_funloc(mkl_jit_get_dgemm_ptr) &
371#endif
372#if defined(__LIBXSMM)
373 , xgemm_dispatch=c_funloc(libxsmm_dispatch_gemm) &
374#endif
375 , dgemm_blas=c_funloc(dgemm_blas))
376 rc2 = libxs_gemm_dispatch(cfg2, libxs_datatype_f64, 'N', 'N', &
377 nsgfa, nsgfb, ncoa, nsgfa, ncoa, nsgfa, 1.0d0, 0.0d0 &
378#if defined(__MKL)
379 , jit_create_dgemm=c_funloc(mkl_cblas_jit_create_dgemm) &
380 , jit_get_dgemm=c_funloc(mkl_jit_get_dgemm_ptr) &
381#endif
382#if defined(__LIBXSMM)
383 , xgemm_dispatch=c_funloc(libxsmm_dispatch_gemm) &
384#endif
385 , dgemm_blas=c_funloc(dgemm_blas))
386 END IF
387 IF (0 /= rc1 .AND. 0 /= rc2) THEN
388 IF (ab_first) THEN
389 DO i = 0, ncoc - 1
390 CALL libxs_gemm_call(cfg1, c_loc(sphi_a(1, 1)), &
391 c_loc(sabc(i*ncoa*ncob + 1)), c_loc(cpp_buffer(1)))
392 CALL libxs_gemm_call(cfg2, c_loc(cpp_buffer(1)), &
393 c_loc(sphi_b(1, 1)), c_loc(ccp_buffer(i*nsgfa*nsgfb + 1)))
394 END DO
395 ELSE
396 DO i = 0, ncoc - 1
397 CALL libxs_gemm_call(cfg1, c_loc(sabc(i*ncoa*ncob + 1)), &
398 c_loc(sphi_b(1, 1)), c_loc(cpp_buffer(1)))
399 CALL libxs_gemm_call(cfg2, c_loc(sphi_a(1, 1)), &
400 c_loc(cpp_buffer(1)), c_loc(ccp_buffer(i*nsgfa*nsgfb + 1)))
401 END DO
402 END IF
403 ELSE
404#endif
405 IF (ab_first) THEN ! (AB)C
406 DO i = 0, ncoc - 1
407 CALL dgemm("N", "N", nsgfa, ncob, ncoa, 1.0_dp, sphi_a, nsgfa, sabc(i*ncoa*ncob + 1), &
408 ncoa, 0.0_dp, cpp_buffer, nsgfa)
409 CALL dgemm("N", "N", nsgfa, nsgfb, ncob, 1.0_dp, cpp_buffer, nsgfa, sphi_b, ncob, 0.0_dp, &
410 ccp_buffer(i*nsgfa*nsgfb + 1), nsgfa)
411 END DO
412 ELSE ! A(BC)
413 DO i = 0, ncoc - 1
414 CALL dgemm("N", "N", ncoa, nsgfb, ncob, 1.0_dp, sabc(i*ncoa*ncob + 1), ncoa, sphi_b, &
415 ncob, 0.0_dp, cpp_buffer, ncoa)
416 CALL dgemm("N", "N", nsgfa, nsgfb, ncoa, 1.0_dp, sphi_a, nsgfa, cpp_buffer, ncoa, 0.0_dp, &
417 ccp_buffer(i*nsgfa*nsgfb + 1), nsgfa)
418 END DO
419 END IF
420#if defined(__LIBXS)
421 END IF
422#endif
423 ! contractions over c: [nsgfa*nsgfb,ncoc] x [ncoc,nsgfc] -> [sgfa*nsgfb,nsgfc]
424 CALL dgemm("N", "N", nsgfa*nsgfb, nsgfc, ncoc, alpha, ccp_buffer, nsgfa*nsgfb, &
425 sphi_c, ncoc, beta, abcint, nsgfa*nsgfb)
426
427 CALL timestop(handle)
428
429 END SUBROUTINE abc_contract_xsmm
430
431END MODULE ai_contraction_sphi
static void dgemm(const char transa, const char transb, const int m, const int n, const int k, const double alpha, const double *a, const int lda, const double *b, const int ldb, const double beta, double *c, const int ldc)
Convenient wrapper to hide Fortran nature of dgemm_, swapping a and b.
Contraction of integrals over primitive Cartesian Gaussians based on the contraction matrix sphi whic...
subroutine, public abc_contract(abcint, sabc, sphi_a, sphi_b, sphi_c, ncoa, ncob, ncoc, nsgfa, nsgfb, nsgfc)
contract three-center overlap integrals (a,b,c) and transfer to spherical Gaussians
subroutine, public abcd_contract(abcdint, sabcd, sphi_a, sphi_b, sphi_c, sphi_d, ncoa, ncob, ncoc, ncod, nsgfa, nsgfb, nsgfc, nsgfd)
contract four-center overlap integrals (a,b,c,d) and transfer to spherical Gaussians
subroutine, public abc_contract_xsmm(abcint, sabc, sphi_a, sphi_b, sphi_c, ncoa, ncob, ncoc, nsgfa, nsgfb, nsgfc, cpp_buffer, ccp_buffer, prefac, pstfac)
3-center contraction routine from primitive cartesian Gaussians to spherical Gaussian functions using...
subroutine, public ab_contract(abint, sab, sphi_a, sphi_b, ncoa, ncob, nsgfa, nsgfb)
contract overlap integrals (a,b) and transfer to spherical Gaussians
Defines the basic variable types.
Definition kinds.F:23
integer, parameter, public int_8
Definition kinds.F:54
integer, parameter, public dp
Definition kinds.F:34