LIBINT 2.9.0
OSVRR_sx_sx_deriv.h
1/*
2 * Copyright (C) 2004-2024 Edward F. Valeev
3 *
4 * This file is part of Libint library.
5 *
6 * Libint library is free software: you can redistribute it and/or modify
7 * it under the terms of the GNU Lesser General Public License as published by
8 * the Free Software Foundation, either version 3 of the License, or
9 * (at your option) any later version.
10 *
11 * Libint library is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU Lesser General Public License for more details.
15 *
16 * You should have received a copy of the GNU Lesser General Public License
17 * along with Libint library. If not, see <http://www.gnu.org/licenses/>.
18 *
19 */
20
21#ifndef _libint2_src_lib_libint_osvrrsxsxderiv_h_
22#define _libint2_src_lib_libint_osvrrsxsxderiv_h_
23
24#include <libint2.h>
25#include <libint2/cgshell_ordering.h>
26#include <util_types.h>
27
28#include <cstdlib>
29
30namespace libint2 {
31
32template <int part, int Lb, int Ld, int Da_x, int Da_y, int Da_z, int Db_x,
33 int Db_y, int Db_z, int Dc_x, int Dc_y, int Dc_z, int Dd_x, int Dd_y,
34 int Dd_z, bool unit_a, bool vectorize>
36 static void compute(
37 const Libint_t* inteval, LIBINT2_REALTYPE* target,
38 const LIBINT2_REALTYPE* src0, const LIBINT2_REALTYPE* src1,
39 const LIBINT2_REALTYPE* src2, const LIBINT2_REALTYPE* src3,
40 const LIBINT2_REALTYPE* src4, const LIBINT2_REALTYPE* src5,
41 const LIBINT2_REALTYPE* src6, const LIBINT2_REALTYPE* src7,
42 const LIBINT2_REALTYPE* src8, const LIBINT2_REALTYPE* src9,
43 const LIBINT2_REALTYPE* src10, const LIBINT2_REALTYPE* src11,
44 const LIBINT2_REALTYPE* src12, const LIBINT2_REALTYPE* src13,
45 const LIBINT2_REALTYPE* src14, const LIBINT2_REALTYPE* src15,
46 const LIBINT2_REALTYPE* src16, const LIBINT2_REALTYPE* src17,
47 const LIBINT2_REALTYPE* src18, const LIBINT2_REALTYPE* src19,
48 const LIBINT2_REALTYPE* src20, const LIBINT2_REALTYPE* src21,
49 const LIBINT2_REALTYPE* src22);
50};
51
81template <int Lb, int Ld, int Da_x, int Da_y, int Da_z, int Db_x, int Db_y,
82 int Db_z, int Dc_x, int Dc_y, int Dc_z, int Dd_x, int Dd_y, int Dd_z,
83 bool unit_a, bool vectorize>
84struct OSVRR_sx_sx_deriv<0, Lb, Ld, Da_x, Da_y, Da_z, Db_x, Db_y, Db_z, Dc_x,
85 Dc_y, Dc_z, Dd_x, Dd_y, Dd_z, unit_a, vectorize> {
86 static void compute(
87 const Libint_t* inteval, LIBINT2_REALTYPE* target,
88 const LIBINT2_REALTYPE* src0, const LIBINT2_REALTYPE* src1,
89 const LIBINT2_REALTYPE* src2, const LIBINT2_REALTYPE* src3,
90 const LIBINT2_REALTYPE* src4, const LIBINT2_REALTYPE* src5,
91 const LIBINT2_REALTYPE* src6, const LIBINT2_REALTYPE* src7,
92 const LIBINT2_REALTYPE* src8, const LIBINT2_REALTYPE* src9,
93 const LIBINT2_REALTYPE* src10, const LIBINT2_REALTYPE* src11,
94 const LIBINT2_REALTYPE* src12, const LIBINT2_REALTYPE* src13,
95 const LIBINT2_REALTYPE* src14, const LIBINT2_REALTYPE* src15,
96 const LIBINT2_REALTYPE* src16, const LIBINT2_REALTYPE* src17,
97 const LIBINT2_REALTYPE* src18, const LIBINT2_REALTYPE* src19,
98 const LIBINT2_REALTYPE* src20, const LIBINT2_REALTYPE* src21,
99 const LIBINT2_REALTYPE* src22) {
100 // works for (sd|sp) and higher
101 assert(not(Lb < 2 || Ld < 1));
102
103 const unsigned int veclen = vectorize ? inteval->veclen : 1;
104
105 const unsigned int Nd = INT_NCART(Ld);
106 const unsigned int NdV = Nd * veclen;
107
108 int bx, by, bz;
109 FOR_CART(bx, by, bz, Lb)
110
111 int b[3];
112 b[0] = bx;
113 b[1] = by;
114 b[2] = bz;
115
116 enum XYZ { x = 0, y = 1, z = 2 };
117 // Build along x, if possible
118 XYZ xyz = z;
119 if (by != 0) xyz = y;
120 if (bx != 0) xyz = x;
121 --b[xyz];
122
123 // redirect
124 const LIBINT2_REALTYPE *PB, *WP;
125 switch (xyz) {
126 case x:
127#if LIBINT2_DEFINED(eri, PB_x)
128 if (not unit_a) PB = inteval->PB_x;
129#endif
130 WP = inteval->WP_x;
131 break;
132 case y:
133#if LIBINT2_DEFINED(eri, PB_y)
134 if (not unit_a) PB = inteval->PB_y;
135#endif
136 WP = inteval->WP_y;
137 break;
138 case z:
139#if LIBINT2_DEFINED(eri, PB_z)
140 if (not unit_a) PB = inteval->PB_z;
141#endif
142 WP = inteval->WP_z;
143 break;
144 }
145
146 const unsigned int ibm1 = INT_CARTINDEX(Lb - 1, b[0], b[1]);
147 const unsigned int bm10d0_offset = ibm1 * NdV;
148 const LIBINT2_REALTYPE* src0_ptr = (not unit_a) ? src0 + bm10d0_offset : 0;
149 const LIBINT2_REALTYPE* src1_ptr = src1 + bm10d0_offset;
150
151 // if b-2_xyz exists, include (0 b-2_xyz | 0 d)
152 if (b[xyz] > 0) {
153 --b[xyz];
154 const unsigned int ibm2 = INT_CARTINDEX(Lb - 2, b[0], b[1]);
155 const unsigned int bm20d0_offset = ibm2 * NdV;
156 ++b[xyz];
157 const LIBINT2_REALTYPE* src2_ptr = src2 + bm20d0_offset;
158 const LIBINT2_REALTYPE* src3_ptr = src3 + bm20d0_offset;
159 const LIBINT2_REALTYPE bxyz = (LIBINT2_REALTYPE)b[xyz];
160
161 unsigned int dv = 0;
162 for (unsigned int d = 0; d < Nd; ++d) {
163 for (unsigned int v = 0; v < veclen; ++v, ++dv) {
164 LIBINT2_REALTYPE value =
165 WP[v] * src1_ptr[dv] +
166 bxyz * inteval->oo2z[v] *
167 (src2_ptr[dv] - inteval->roz[v] * src3_ptr[dv]);
168 if (not unit_a) value += PB[v] * src0_ptr[dv];
169 target[dv] = value;
170 }
171 }
172#if LIBINT2_FLOP_COUNT
173 inteval->nflops[0] += (unit_a ? 6 : 8) * NdV;
174#endif
175
176 } else {
177 unsigned int dv = 0;
178 for (unsigned int d = 0; d < Nd; ++d) {
179 for (unsigned int v = 0; v < veclen; ++v, ++dv) {
180 LIBINT2_REALTYPE value = WP[v] * src1_ptr[dv];
181 if (not unit_a) value += PB[v] * src0_ptr[dv];
182 target[dv] = value;
183 }
184 }
185#if LIBINT2_FLOP_COUNT
186 inteval->nflops[0] += (unit_a ? 1 : 3) * NdV;
187#endif
188 }
189
190 {
191 const unsigned int Ndm1 = INT_NCART(Ld - 1);
192 const unsigned int Ndm1V = Ndm1 * veclen;
193 const unsigned int bm10dm10_offset = ibm1 * Ndm1V;
194 const LIBINT2_REALTYPE* src4_ptr = src4 + bm10dm10_offset;
195
196 // loop over d-1 shell and include (0 b-1_xyz | 0 d-1_xyz) to (0 b | 0 d)
197 int dx, dy, dz;
198 FOR_CART(dx, dy, dz, Ld - 1)
199
200 int d[3];
201 d[0] = dx;
202 d[1] = dy;
203 d[2] = dz;
204 ++d[xyz];
205
206 const unsigned int dc = INT_CARTINDEX(Ld, d[0], d[1]);
207 const unsigned int dc_offset = dc * veclen;
208 LIBINT2_REALTYPE* tptr = target + dc_offset;
209 const LIBINT2_REALTYPE dxyz = (LIBINT2_REALTYPE)d[xyz];
210 for (unsigned int v = 0; v < veclen; ++v) {
211 tptr[v] += dxyz * inteval->oo2ze[v] * src4_ptr[v];
212 }
213#if LIBINT2_FLOP_COUNT
214 inteval->nflops[0] += 3 * veclen;
215#endif
216 src4_ptr += veclen;
217
218 END_FOR_CART
219 }
220
221#define OSVRR_SX_SX_DERIV_DCONTR_A(target, srcA, srcB, id, ecoef1, ecoef2) \
222 { \
223 const LIBINT2_REALTYPE* srcA_ptr = srcA + bm10d0_offset; \
224 const LIBINT2_REALTYPE* srcB_ptr = srcB + bm10d0_offset; \
225 const LIBINT2_REALTYPE di = (LIBINT2_REALTYPE)id; \
226 const LIBINT2_REALTYPE* c1 = inteval->ecoef1; \
227 const LIBINT2_REALTYPE* c2 = inteval->ecoef2; \
228 unsigned int dv = 0; \
229 bool has_unit = srcA == nullptr; \
230 if (!has_unit) { \
231 for (unsigned int d = 0; d < Nd; ++d) { \
232 for (unsigned int v = 0; v < veclen; ++v, ++dv) { \
233 target[dv] += di * (c1[v] * srcA_ptr[dv] - c2[v] * srcB_ptr[dv]); \
234 } \
235 } \
236 } else { \
237 for (unsigned int d = 0; d < Nd; ++d) { \
238 for (unsigned int v = 0; v < veclen; ++v, ++dv) { \
239 target[dv] -= di * c2[v] * srcB_ptr[dv]); \
240 } \
241 } \
242 } \
243 }
244
245#define OSVRR_SX_SX_DERIV_DCONTR_B(target, srcA, srcB, id, ecoef1, ecoef2) \
246 { \
247 const LIBINT2_REALTYPE* srcA_ptr = srcA + bm10d0_offset; \
248 const LIBINT2_REALTYPE* srcB_ptr = srcB + bm10d0_offset; \
249 const LIBINT2_REALTYPE di = (LIBINT2_REALTYPE)id; \
250 const LIBINT2_REALTYPE* c1 = inteval->ecoef1; \
251 const LIBINT2_REALTYPE* c2 = inteval->ecoef2; \
252 unsigned int dv = 0; \
253 bool has_unit = srcA == nullptr; \
254 if (!has_unit) { \
255 for (unsigned int d = 0; d < Nd; ++d) { \
256 for (unsigned int v = 0; v < veclen; ++v, ++dv) { \
257 target[dv] -= di * (c1[v] * srcA_ptr[dv] + c2[v] * srcB_ptr[dv]); \
258 } \
259 } \
260 } else { \
261 for (unsigned int d = 0; d < Nd; ++d) { \
262 for (unsigned int v = 0; v < veclen; ++v, ++dv) { \
263 target[dv] -= di * c2[v] * srcB_ptr[dv]; \
264 } \
265 } \
266 } \
267 }
268
269#define OSVRR_SX_SX_DERIV_DCONTR_CD(target, srcA, id, ecoef1) \
270 { \
271 const LIBINT2_REALTYPE* srcA_ptr = srcA + bm10d0_offset; \
272 const LIBINT2_REALTYPE di = (LIBINT2_REALTYPE)id; \
273 const LIBINT2_REALTYPE* c1 = inteval->ecoef1; \
274 unsigned int dv = 0; \
275 for (unsigned int d = 0; d < Nd; ++d) { \
276 for (unsigned int v = 0; v < veclen; ++v, ++dv) { \
277 target[dv] += di * c1[v] * srcA_ptr[dv]; \
278 } \
279 } \
280 }
281
282 // if Da_x-1 exists
283#if LIBINT2_DEFINED(any, rho12_over_alpha2) && \
284 LIBINT2_DEFINED(any, alpha1_rho_over_zeta2)
285 if (Da_x > 0 && xyz == x) {
286 OSVRR_SX_SX_DERIV_DCONTR_A(target, src5, src6, Da_x, rho12_over_alpha2,
287 alpha1_rho_over_zeta2);
288#if LIBINT2_FLOP_COUNT
289 inteval->nflops[0] += (src5 == nullptr ? 3 : 5) * NdV;
290#endif
291 }
292 if (Da_y > 0 && xyz == y) {
293 OSVRR_SX_SX_DERIV_DCONTR_A(target, src11, src12, Da_y, rho12_over_alpha2,
294 alpha1_rho_over_zeta2);
295#if LIBINT2_FLOP_COUNT
296 inteval->nflops[0] += (src11 == nullptr ? 3 : 5) * NdV;
297#endif
298 }
299 if (Da_z > 0 && xyz == z) {
300 OSVRR_SX_SX_DERIV_DCONTR_A(target, src17, src18, Da_z, rho12_over_alpha2,
301 alpha1_rho_over_zeta2);
302#if LIBINT2_FLOP_COUNT
303 inteval->nflops[0] += (src17 == nullptr ? 3 : 5) * NdV;
304#endif
305 }
306#endif
307
308 // if Db_x-1 exists
309#if LIBINT2_DEFINED(any, rho12_over_alpha2) && \
310 LIBINT2_DEFINED(any, alpha2_rho_over_zeta2)
311 if (Db_x > 0 && xyz == x) {
312 OSVRR_SX_SX_DERIV_DCONTR_B(target, src7, src8, Db_x, rho12_over_alpha2,
313 alpha2_rho_over_zeta2);
314#if LIBINT2_FLOP_COUNT
315 inteval->nflops[0] += (src7 == nullptr ? 3 : 5) * NdV;
316#endif
317 }
318 if (Db_y > 0 && xyz == y) {
319 OSVRR_SX_SX_DERIV_DCONTR_B(target, src13, src14, Db_y, rho12_over_alpha2,
320 alpha2_rho_over_zeta2);
321#if LIBINT2_FLOP_COUNT
322 inteval->nflops[0] += (src13 == nullptr ? 3 : 5) * NdV;
323#endif
324 }
325 if (Db_z > 0 && xyz == z) {
326 OSVRR_SX_SX_DERIV_DCONTR_B(target, src19, src20, Db_z, rho12_over_alpha2,
327 alpha2_rho_over_zeta2);
328#if LIBINT2_FLOP_COUNT
329 inteval->nflops[0] += (src19 == nullptr ? 3 : 5) * NdV;
330#endif
331 }
332#endif
333
334 // if Dc_x-1 exists
335#if LIBINT2_DEFINED(any, alpha3_over_zetapluseta)
336 if (Dc_x > 0 && xyz == x) {
337 OSVRR_SX_SX_DERIV_DCONTR_CD(target, src9, Dc_x, alpha3_over_zetapluseta);
338#if LIBINT2_FLOP_COUNT
339 inteval->nflops[0] += 3 * NdV;
340#endif
341 }
342 if (Dc_y > 0 && xyz == y) {
343 OSVRR_SX_SX_DERIV_DCONTR_CD(target, src15, Dc_y, alpha3_over_zetapluseta);
344#if LIBINT2_FLOP_COUNT
345 inteval->nflops[0] += 3 * NdV;
346#endif
347 }
348 if (Dc_z > 0 && xyz == z) {
349 OSVRR_SX_SX_DERIV_DCONTR_CD(target, src21, Dc_z, alpha3_over_zetapluseta);
350#if LIBINT2_FLOP_COUNT
351 inteval->nflops[0] += 3 * NdV;
352#endif
353 }
354#endif
355 // if Dd_x-1 exists
356#if LIBINT2_DEFINED(any, alpha4_over_zetapluseta)
357 if (Dd_x > 0 && xyz == x) {
358 OSVRR_SX_SX_DERIV_DCONTR_CD(target, src10, Dd_x, alpha4_over_zetapluseta);
359#if LIBINT2_FLOP_COUNT
360 inteval->nflops[0] += 3 * NdV;
361#endif
362 }
363 if (Dd_y > 0 && xyz == y) {
364 OSVRR_SX_SX_DERIV_DCONTR_CD(target, src16, Dd_y, alpha4_over_zetapluseta);
365#if LIBINT2_FLOP_COUNT
366 inteval->nflops[0] += 3 * NdV;
367#endif
368 }
369 if (Dd_z > 0 && xyz == z) {
370 OSVRR_SX_SX_DERIV_DCONTR_CD(target, src22, Dd_z, alpha4_over_zetapluseta);
371#if LIBINT2_FLOP_COUNT
372 inteval->nflops[0] += 3 * NdV;
373#endif
374 }
375#endif
376
377 target += NdV;
378
379 END_FOR_CART // end of loop over a-1
380
382 // inteval->nflops[0] = inteval->nflops[0] + 222 * 1 * 1 * veclen;
383 }
384};
385
387template <int part, int Lb, int Ld, int Da_x, int Da_y, int Da_z, int Db_x,
388 int Db_y, int Db_z, int Dc_x, int Dc_y, int Dc_z, int Dd_x, int Dd_y,
389 int Dd_z, bool vectorize>
391 static void compute(
392 const Libint_t* inteval, LIBINT2_REALTYPE* target,
393 const LIBINT2_REALTYPE* src1, const LIBINT2_REALTYPE* src4,
394 const LIBINT2_REALTYPE* src5, const LIBINT2_REALTYPE* src6,
395 const LIBINT2_REALTYPE* src7, const LIBINT2_REALTYPE* src8,
396 const LIBINT2_REALTYPE* src9, const LIBINT2_REALTYPE* src10,
397 const LIBINT2_REALTYPE* src11, const LIBINT2_REALTYPE* src12,
398 const LIBINT2_REALTYPE* src13, const LIBINT2_REALTYPE* src14,
399 const LIBINT2_REALTYPE* src15, const LIBINT2_REALTYPE* src16,
400 const LIBINT2_REALTYPE* src17, const LIBINT2_REALTYPE* src18,
401 const LIBINT2_REALTYPE* src19, const LIBINT2_REALTYPE* src20,
402 const LIBINT2_REALTYPE* src21, const LIBINT2_REALTYPE* src22);
403};
404
431template <int Lb, int Ld, int Da_x, int Da_y, int Da_z, int Db_x, int Db_y,
432 int Db_z, int Dc_x, int Dc_y, int Dc_z, int Dd_x, int Dd_y, int Dd_z,
433 bool vectorize>
434struct OSAVRR_sx_sx_deriv<0, Lb, Ld, Da_x, Da_y, Da_z, Db_x, Db_y, Db_z, Dc_x,
435 Dc_y, Dc_z, Dd_x, Dd_y, Dd_z, vectorize> {
436 static void compute(
437 const Libint_t* inteval, LIBINT2_REALTYPE* target,
438 const LIBINT2_REALTYPE* src1, const LIBINT2_REALTYPE* src4,
439 const LIBINT2_REALTYPE* src5, const LIBINT2_REALTYPE* src6,
440 const LIBINT2_REALTYPE* src7, const LIBINT2_REALTYPE* src8,
441 const LIBINT2_REALTYPE* src9, const LIBINT2_REALTYPE* src10,
442 const LIBINT2_REALTYPE* src11, const LIBINT2_REALTYPE* src12,
443 const LIBINT2_REALTYPE* src13, const LIBINT2_REALTYPE* src14,
444 const LIBINT2_REALTYPE* src15, const LIBINT2_REALTYPE* src16,
445 const LIBINT2_REALTYPE* src17, const LIBINT2_REALTYPE* src18,
446 const LIBINT2_REALTYPE* src19, const LIBINT2_REALTYPE* src20,
447 const LIBINT2_REALTYPE* src21, const LIBINT2_REALTYPE* src22) {
448 // works for (sd|sp) and higher
449 assert(not(Lb < 2 || Ld < 1));
450
451 const unsigned int veclen = vectorize ? inteval->veclen : 1;
452
453 const unsigned int Nd = INT_NCART(Ld);
454 const unsigned int NdV = Nd * veclen;
455
456 int bx, by, bz;
457 FOR_CART(bx, by, bz, Lb)
458
459 int b[3];
460 b[0] = bx;
461 b[1] = by;
462 b[2] = bz;
463
464 enum XYZ { x = 0, y = 1, z = 2 };
465 // Build along x, if possible
466 XYZ xyz = z;
467 if (by != 0) xyz = y;
468 if (bx != 0) xyz = x;
469 --b[xyz];
470
471 // redirect
472 const LIBINT2_REALTYPE* WP;
473 switch (xyz) {
474 case x:
475 WP = inteval->WP_x;
476 break;
477 case y:
478 WP = inteval->WP_y;
479 break;
480 case z:
481 WP = inteval->WP_z;
482 break;
483 }
484
485 const unsigned int ibm1 = INT_CARTINDEX(Lb - 1, b[0], b[1]);
486 const unsigned int bm10d0_offset = ibm1 * NdV;
487 const LIBINT2_REALTYPE* src1_ptr = src1 + bm10d0_offset;
488
489 {
490 unsigned int dv = 0;
491 for (unsigned int d = 0; d < Nd; ++d) {
492 for (unsigned int v = 0; v < veclen; ++v, ++dv) {
493 target[dv] = WP[v] * src1_ptr[dv];
494 }
495 }
496#if LIBINT2_FLOP_COUNT
497 inteval->nflops[0] += NdV;
498#endif
499 }
500
501 {
502 const unsigned int Ndm1 = INT_NCART(Ld - 1);
503 const unsigned int Ndm1V = Ndm1 * veclen;
504 const unsigned int bm10dm10_offset = ibm1 * Ndm1V;
505 const LIBINT2_REALTYPE* src4_ptr = src4 + bm10dm10_offset;
506
507 // loop over d-1 shell and include (0 b-1_xyz | 0 d-1_xyz) to (0 b | 0 d)
508 int dx, dy, dz;
509 FOR_CART(dx, dy, dz, Ld - 1)
510
511 int d[3];
512 d[0] = dx;
513 d[1] = dy;
514 d[2] = dz;
515 ++d[xyz];
516
517 const unsigned int dc = INT_CARTINDEX(Ld, d[0], d[1]);
518 const unsigned int dc_offset = dc * veclen;
519 LIBINT2_REALTYPE* tptr = target + dc_offset;
520 const LIBINT2_REALTYPE dxyz = (LIBINT2_REALTYPE)d[xyz];
521 for (unsigned int v = 0; v < veclen; ++v) {
522 tptr[v] += dxyz * inteval->oo2ze[v] * src4_ptr[v];
523 }
524#if LIBINT2_FLOP_COUNT
525 inteval->nflops[0] += 3 * veclen;
526#endif
527 src4_ptr += veclen;
528
529 END_FOR_CART
530 }
531
532 // if Da_x-1 exists
533#if LIBINT2_DEFINED(any, rho12_over_alpha2) && \
534 LIBINT2_DEFINED(any, alpha1_rho_over_zeta2)
535 if (Da_x > 0 && xyz == x) {
536 OSVRR_SX_SX_DERIV_DCONTR_A(target, src5, src6, Da_x, rho12_over_alpha2,
537 alpha1_rho_over_zeta2);
538#if LIBINT2_FLOP_COUNT
539 inteval->nflops[0] += (src5 == nullptr ? 3 : 5) * NdV;
540#endif
541 }
542 if (Da_y > 0 && xyz == y) {
543 OSVRR_SX_SX_DERIV_DCONTR_A(target, src11, src12, Da_y, rho12_over_alpha2,
544 alpha1_rho_over_zeta2);
545#if LIBINT2_FLOP_COUNT
546 inteval->nflops[0] += (src11 == nullptr ? 3 : 5) * NdV;
547#endif
548 }
549 if (Da_z > 0 && xyz == z) {
550 OSVRR_SX_SX_DERIV_DCONTR_A(target, src17, src18, Da_z, rho12_over_alpha2,
551 alpha1_rho_over_zeta2);
552#if LIBINT2_FLOP_COUNT
553 inteval->nflops[0] += (src17 == nullptr ? 3 : 5) * NdV;
554#endif
555 }
556#endif
557#undef OSVRR_SX_SX_DERIV_DCONTR_A
558
559 // if Db_x-1 exists
560#if LIBINT2_DEFINED(any, rho12_over_alpha2) && \
561 LIBINT2_DEFINED(any, alpha2_rho_over_zeta2)
562 if (Db_x > 0 && xyz == x) {
563 OSVRR_SX_SX_DERIV_DCONTR_B(target, src7, src8, Db_x, rho12_over_alpha2,
564 alpha2_rho_over_zeta2);
565#if LIBINT2_FLOP_COUNT
566 inteval->nflops[0] += (src7 == nullptr ? 3 : 5) * NdV;
567#endif
568 }
569 if (Db_y > 0 && xyz == y) {
570 OSVRR_SX_SX_DERIV_DCONTR_B(target, src13, src14, Db_y, rho12_over_alpha2,
571 alpha2_rho_over_zeta2);
572#if LIBINT2_FLOP_COUNT
573 inteval->nflops[0] += (src13 == nullptr ? 3 : 5) * NdV;
574#endif
575 }
576 if (Db_z > 0 && xyz == z) {
577 OSVRR_SX_SX_DERIV_DCONTR_B(target, src19, src20, Db_z, rho12_over_alpha2,
578 alpha2_rho_over_zeta2);
579#if LIBINT2_FLOP_COUNT
580 inteval->nflops[0] += (src19 == nullptr ? 3 : 5) * NdV;
581#endif
582 }
583#endif
584#undef OSVRR_SX_SX_DERIV_DCONTR_B
585
586 // if Dc_x-1 exists
587#if LIBINT2_DEFINED(any, alpha3_over_zetapluseta)
588 if (Dc_x > 0 && xyz == x) {
589 OSVRR_SX_SX_DERIV_DCONTR_CD(target, src9, Dc_x, alpha3_over_zetapluseta);
590#if LIBINT2_FLOP_COUNT
591 inteval->nflops[0] += 3 * NdV;
592#endif
593 }
594 if (Dc_y > 0 && xyz == y) {
595 OSVRR_SX_SX_DERIV_DCONTR_CD(target, src15, Dc_y, alpha3_over_zetapluseta);
596#if LIBINT2_FLOP_COUNT
597 inteval->nflops[0] += 3 * NdV;
598#endif
599 }
600 if (Dc_z > 0 && xyz == z) {
601 OSVRR_SX_SX_DERIV_DCONTR_CD(target, src21, Dc_z, alpha3_over_zetapluseta);
602#if LIBINT2_FLOP_COUNT
603 inteval->nflops[0] += 3 * NdV;
604#endif
605 }
606#endif
607 // if Dd_x-1 exists
608#if LIBINT2_DEFINED(any, alpha4_over_zetapluseta)
609 if (Dd_x > 0 && xyz == x) {
610 OSVRR_SX_SX_DERIV_DCONTR_CD(target, src10, Dd_x, alpha4_over_zetapluseta);
611#if LIBINT2_FLOP_COUNT
612 inteval->nflops[0] += 3 * NdV;
613#endif
614 }
615 if (Dd_y > 0 && xyz == y) {
616 OSVRR_SX_SX_DERIV_DCONTR_CD(target, src16, Dd_y, alpha4_over_zetapluseta);
617#if LIBINT2_FLOP_COUNT
618 inteval->nflops[0] += 3 * NdV;
619#endif
620 }
621 if (Dd_z > 0 && xyz == z) {
622 OSVRR_SX_SX_DERIV_DCONTR_CD(target, src22, Dd_z, alpha4_over_zetapluseta);
623#if LIBINT2_FLOP_COUNT
624 inteval->nflops[0] += 3 * NdV;
625#endif
626 }
627#endif
628#undef OSVRR_SX_SX_DERIV_DCONTR_CD
629
630 target += NdV;
631
632 END_FOR_CART // end of loop over a-1
633
635 // inteval->nflops[0] = inteval->nflops[0] + 222 * 1 * 1 * veclen;
636 }
637};
638
639}; // namespace libint2
640
641#endif // header guard
Defaults definitions for various parameters assumed by Libint.
Definition algebra.cc:24
static void compute(const Libint_t *inteval, LIBINT2_REALTYPE *target, const LIBINT2_REALTYPE *src1, const LIBINT2_REALTYPE *src4, const LIBINT2_REALTYPE *src5, const LIBINT2_REALTYPE *src6, const LIBINT2_REALTYPE *src7, const LIBINT2_REALTYPE *src8, const LIBINT2_REALTYPE *src9, const LIBINT2_REALTYPE *src10, const LIBINT2_REALTYPE *src11, const LIBINT2_REALTYPE *src12, const LIBINT2_REALTYPE *src13, const LIBINT2_REALTYPE *src14, const LIBINT2_REALTYPE *src15, const LIBINT2_REALTYPE *src16, const LIBINT2_REALTYPE *src17, const LIBINT2_REALTYPE *src18, const LIBINT2_REALTYPE *src19, const LIBINT2_REALTYPE *src20, const LIBINT2_REALTYPE *src21, const LIBINT2_REALTYPE *src22)
Definition OSVRR_sx_sx_deriv.h:436
the Ahlrichs version
Definition OSVRR_sx_sx_deriv.h:390
static void compute(const Libint_t *inteval, LIBINT2_REALTYPE *target, const LIBINT2_REALTYPE *src0, const LIBINT2_REALTYPE *src1, const LIBINT2_REALTYPE *src2, const LIBINT2_REALTYPE *src3, const LIBINT2_REALTYPE *src4, const LIBINT2_REALTYPE *src5, const LIBINT2_REALTYPE *src6, const LIBINT2_REALTYPE *src7, const LIBINT2_REALTYPE *src8, const LIBINT2_REALTYPE *src9, const LIBINT2_REALTYPE *src10, const LIBINT2_REALTYPE *src11, const LIBINT2_REALTYPE *src12, const LIBINT2_REALTYPE *src13, const LIBINT2_REALTYPE *src14, const LIBINT2_REALTYPE *src15, const LIBINT2_REALTYPE *src16, const LIBINT2_REALTYPE *src17, const LIBINT2_REALTYPE *src18, const LIBINT2_REALTYPE *src19, const LIBINT2_REALTYPE *src20, const LIBINT2_REALTYPE *src21, const LIBINT2_REALTYPE *src22)
Definition OSVRR_sx_sx_deriv.h:86
Definition OSVRR_sx_sx_deriv.h:35