LIBINT 2.9.0
OSVRR_xs_xs_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_osvrrxsxsderiv_h_
22#define _libint2_src_lib_libint_osvrrxsxsderiv_h_
23
24#include <libint2.h>
25#include <libint2/cgshell_ordering.h>
26#include <util_types.h>
27
28#include <cassert>
29#include <cstdlib>
30
31namespace libint2 {
32
33template <int part, int La, int Lc, int Da_x, int Da_y, int Da_z, int Db_x,
34 int Db_y, int Db_z, int Dc_x, int Dc_y, int Dc_z, int Dd_x, int Dd_y,
35 int Dd_z, bool unit_b, bool vectorize>
37 static void compute(
38 const Libint_t* inteval, LIBINT2_REALTYPE* target,
39 const LIBINT2_REALTYPE* src0, const LIBINT2_REALTYPE* src1,
40 const LIBINT2_REALTYPE* src2, const LIBINT2_REALTYPE* src3,
41 const LIBINT2_REALTYPE* src4, const LIBINT2_REALTYPE* src5,
42 const LIBINT2_REALTYPE* src6, const LIBINT2_REALTYPE* src7,
43 const LIBINT2_REALTYPE* src8, const LIBINT2_REALTYPE* src9,
44 const LIBINT2_REALTYPE* src10, const LIBINT2_REALTYPE* src11,
45 const LIBINT2_REALTYPE* src12, const LIBINT2_REALTYPE* src13,
46 const LIBINT2_REALTYPE* src14, const LIBINT2_REALTYPE* src15,
47 const LIBINT2_REALTYPE* src16, const LIBINT2_REALTYPE* src17,
48 const LIBINT2_REALTYPE* src18, const LIBINT2_REALTYPE* src19,
49 const LIBINT2_REALTYPE* src20, const LIBINT2_REALTYPE* src21,
50 const LIBINT2_REALTYPE* src22);
51};
52
82template <int La, int Lc, int Da_x, int Da_y, int Da_z, int Db_x, int Db_y,
83 int Db_z, int Dc_x, int Dc_y, int Dc_z, int Dd_x, int Dd_y, int Dd_z,
84 bool unit_b, bool vectorize>
85struct OSVRR_xs_xs_deriv<0, La, Lc, Da_x, Da_y, Da_z, Db_x, Db_y, Db_z, Dc_x,
86 Dc_y, Dc_z, Dd_x, Dd_y, Dd_z, unit_b, vectorize> {
87 static void compute(
88 const Libint_t* inteval, LIBINT2_REALTYPE* target,
89 const LIBINT2_REALTYPE* src0, const LIBINT2_REALTYPE* src1,
90 const LIBINT2_REALTYPE* src2, const LIBINT2_REALTYPE* src3,
91 const LIBINT2_REALTYPE* src4, const LIBINT2_REALTYPE* src5,
92 const LIBINT2_REALTYPE* src6, const LIBINT2_REALTYPE* src7,
93 const LIBINT2_REALTYPE* src8, const LIBINT2_REALTYPE* src9,
94 const LIBINT2_REALTYPE* src10, const LIBINT2_REALTYPE* src11,
95 const LIBINT2_REALTYPE* src12, const LIBINT2_REALTYPE* src13,
96 const LIBINT2_REALTYPE* src14, const LIBINT2_REALTYPE* src15,
97 const LIBINT2_REALTYPE* src16, const LIBINT2_REALTYPE* src17,
98 const LIBINT2_REALTYPE* src18, const LIBINT2_REALTYPE* src19,
99 const LIBINT2_REALTYPE* src20, const LIBINT2_REALTYPE* src21,
100 const LIBINT2_REALTYPE* src22) {
101 // works for (ds|ps) and higher
102 assert(not(La < 2 || Lc < 1));
103
104 const unsigned int veclen = vectorize ? inteval->veclen : 1;
105
106 const unsigned int Nc = INT_NCART(Lc);
107 const unsigned int NcV = Nc * veclen;
108
109 int ax, ay, az;
110 FOR_CART(ax, ay, az, La)
111
112 int a[3];
113 a[0] = ax;
114 a[1] = ay;
115 a[2] = az;
116
117 enum XYZ { x = 0, y = 1, z = 2 };
118 // Build along x, if possible
119 XYZ xyz = z;
120 if (ay != 0) xyz = y;
121 if (ax != 0) xyz = x;
122 --a[xyz];
123
124 // redirect
125 const LIBINT2_REALTYPE *PA, *WP;
126 switch (xyz) {
127 case x:
128#if LIBINT2_DEFINED(eri, PA_x)
129 if (not unit_b) PA = inteval->PA_x;
130#endif
131 WP = inteval->WP_x;
132 break;
133 case y:
134#if LIBINT2_DEFINED(eri, PA_y)
135 if (not unit_b) PA = inteval->PA_y;
136#endif
137 WP = inteval->WP_y;
138 break;
139 case z:
140#if LIBINT2_DEFINED(eri, PA_z)
141 if (not unit_b) PA = inteval->PA_z;
142#endif
143 WP = inteval->WP_z;
144 break;
145 }
146
147 const unsigned int iam1 = INT_CARTINDEX(La - 1, a[0], a[1]);
148 const unsigned int am10c0_offset = iam1 * NcV;
149 const LIBINT2_REALTYPE* src0_ptr = unit_b ? 0 : src0 + am10c0_offset;
150 const LIBINT2_REALTYPE* src1_ptr = src1 + am10c0_offset;
151
152 // if a-2_xyz exists, include (a-2_xyz 0 | c 0)
153 if (a[xyz] > 0) {
154 --a[xyz];
155 const unsigned int iam2 = INT_CARTINDEX(La - 2, a[0], a[1]);
156 const unsigned int am20c0_offset = iam2 * NcV;
157 ++a[xyz];
158 const LIBINT2_REALTYPE* src2_ptr = src2 + am20c0_offset;
159 const LIBINT2_REALTYPE* src3_ptr = src3 + am20c0_offset;
160 const LIBINT2_REALTYPE axyz = (LIBINT2_REALTYPE)a[xyz];
161
162 unsigned int cv = 0;
163 for (unsigned int c = 0; c < Nc; ++c) {
164 for (unsigned int v = 0; v < veclen; ++v, ++cv) {
165 LIBINT2_REALTYPE value =
166 WP[v] * src1_ptr[cv] +
167 axyz * inteval->oo2z[v] *
168 (src2_ptr[cv] - inteval->roz[v] * src3_ptr[cv]);
169 if (not unit_b) value += PA[v] * src0_ptr[cv];
170 target[cv] = value;
171 }
172 }
173#if LIBINT2_FLOP_COUNT
174 inteval->nflops[0] += (unit_b ? 6 : 8) * NcV;
175#endif
176
177 } else {
178 unsigned int cv = 0;
179 for (unsigned int c = 0; c < Nc; ++c) {
180 for (unsigned int v = 0; v < veclen; ++v, ++cv) {
181 LIBINT2_REALTYPE value = WP[v] * src1_ptr[cv];
182 if (not unit_b) value += PA[v] * src0_ptr[cv];
183 target[cv] = value;
184 }
185 }
186#if LIBINT2_FLOP_COUNT
187 inteval->nflops[0] += (unit_b ? 1 : 3) * NcV;
188#endif
189 }
190
191 {
192 const unsigned int Ncm1 = INT_NCART(Lc - 1);
193 const unsigned int Ncm1V = Ncm1 * veclen;
194 const unsigned int am10cm10_offset = iam1 * Ncm1V;
195 const LIBINT2_REALTYPE* src4_ptr = src4 + am10cm10_offset;
196
197 // loop over c-1 shell and include (a-1_xyz 0 | c-1_xyz 0) to (a 0 | c 0)
198 int cx, cy, cz;
199 FOR_CART(cx, cy, cz, Lc - 1)
200
201 int c[3];
202 c[0] = cx;
203 c[1] = cy;
204 c[2] = cz;
205 ++c[xyz];
206
207 const unsigned int cc = INT_CARTINDEX(Lc, c[0], c[1]);
208 const unsigned int cc_offset = cc * veclen;
209 LIBINT2_REALTYPE* tptr = target + cc_offset;
210 const LIBINT2_REALTYPE cxyz = (LIBINT2_REALTYPE)c[xyz];
211 for (unsigned int v = 0; v < veclen; ++v) {
212 tptr[v] += cxyz * inteval->oo2ze[v] * src4_ptr[v];
213 }
214#if LIBINT2_FLOP_COUNT
215 inteval->nflops[0] += 3 * veclen;
216#endif
217 src4_ptr += veclen;
218
219 END_FOR_CART // end of loop over c-1
220 }
221
222// see vrr_11_twoprep_11.h for the has_unit logic
223#define OSVRR_XS_XS_DERIV_DCONTR_A(target, srcA, srcB, id, ecoef1, ecoef2) \
224 { \
225 const LIBINT2_REALTYPE* srcA_ptr = srcA + am10c0_offset; \
226 const LIBINT2_REALTYPE* srcB_ptr = srcB + am10c0_offset; \
227 const LIBINT2_REALTYPE di = (LIBINT2_REALTYPE)id; \
228 const LIBINT2_REALTYPE* c1 = inteval->ecoef1; \
229 const LIBINT2_REALTYPE* c2 = inteval->ecoef2; \
230 unsigned int cv = 0; \
231 bool has_unit = srcA == nullptr; \
232 if (!has_unit) { \
233 for (unsigned int c = 0; c < Nc; ++c) { \
234 for (unsigned int v = 0; v < veclen; ++v, ++cv) { \
235 target[cv] -= di * (c1[v] * srcA_ptr[cv] + c2[v] * srcB_ptr[cv]); \
236 } \
237 } \
238 } else { \
239 for (unsigned int c = 0; c < Nc; ++c) { \
240 for (unsigned int v = 0; v < veclen; ++v, ++cv) { \
241 target[cv] -= di * c2[v] * srcB_ptr[cv]; \
242 } \
243 } \
244 } \
245 }
246
247// see vrr_11_twoprep_11.h for the has_unit logic
248#define OSVRR_XS_XS_DERIV_DCONTR_B(target, srcA, srcB, id, ecoef1, ecoef2) \
249 { \
250 const LIBINT2_REALTYPE* srcA_ptr = srcA + am10c0_offset; \
251 const LIBINT2_REALTYPE* srcB_ptr = srcB + am10c0_offset; \
252 const LIBINT2_REALTYPE di = (LIBINT2_REALTYPE)id; \
253 const LIBINT2_REALTYPE* c1 = inteval->ecoef1; \
254 const LIBINT2_REALTYPE* c2 = inteval->ecoef2; \
255 unsigned int cv = 0; \
256 bool has_unit = srcA == nullptr; \
257 if (!has_unit) { \
258 for (unsigned int c = 0; c < Nc; ++c) { \
259 for (unsigned int v = 0; v < veclen; ++v, ++cv) { \
260 target[cv] += di * (c1[v] * srcA_ptr[cv] - c2[v] * srcB_ptr[cv]); \
261 } \
262 } \
263 } else { \
264 for (unsigned int c = 0; c < Nc; ++c) { \
265 for (unsigned int v = 0; v < veclen; ++v, ++cv) { \
266 target[cv] -= di * c2[v] * srcB_ptr[cv]; \
267 } \
268 } \
269 } \
270 }
271
272#define OSVRR_XS_XS_DERIV_DCONTR_CD(target, srcA, id, ecoef1) \
273 { \
274 const LIBINT2_REALTYPE* srcA_ptr = srcA + am10c0_offset; \
275 const LIBINT2_REALTYPE di = (LIBINT2_REALTYPE)id; \
276 const LIBINT2_REALTYPE* c1 = inteval->ecoef1; \
277 unsigned int cv = 0; \
278 for (unsigned int c = 0; c < Nc; ++c) { \
279 for (unsigned int v = 0; v < veclen; ++v, ++cv) { \
280 target[cv] += di * c1[v] * srcA_ptr[cv]; \
281 } \
282 } \
283 }
284
285 // if Da_x-1 exists
286#if LIBINT2_DEFINED(any, rho12_over_alpha1) && \
287 LIBINT2_DEFINED(any, alpha1_rho_over_zeta2)
288 if (Da_x > 0 && xyz == x) {
289 OSVRR_XS_XS_DERIV_DCONTR_A(target, src5, src6, Da_x, rho12_over_alpha1,
290 alpha1_rho_over_zeta2);
291#if LIBINT2_FLOP_COUNT
292 inteval->nflops[0] += (src5 == nullptr ? 3 : 5) * NcV;
293#endif
294 }
295 if (Da_y > 0 && xyz == y) {
296 OSVRR_XS_XS_DERIV_DCONTR_A(target, src11, src12, Da_y, rho12_over_alpha1,
297 alpha1_rho_over_zeta2);
298#if LIBINT2_FLOP_COUNT
299 inteval->nflops[0] += (src11 == nullptr ? 3 : 5) * NcV;
300#endif
301 }
302 if (Da_z > 0 && xyz == z) {
303 OSVRR_XS_XS_DERIV_DCONTR_A(target, src17, src18, Da_z, rho12_over_alpha1,
304 alpha1_rho_over_zeta2);
305#if LIBINT2_FLOP_COUNT
306 inteval->nflops[0] += (src17 == nullptr ? 3 : 5) * NcV;
307#endif
308 }
309#endif
310
311 // if Db_x-1 exists
312#if LIBINT2_DEFINED(any, rho12_over_alpha1) && \
313 LIBINT2_DEFINED(any, alpha2_rho_over_zeta2)
314 if (Db_x > 0 && xyz == x) {
315 OSVRR_XS_XS_DERIV_DCONTR_B(target, src7, src8, Db_x, rho12_over_alpha1,
316 alpha2_rho_over_zeta2);
317#if LIBINT2_FLOP_COUNT
318 inteval->nflops[0] += (src7 == nullptr ? 3 : 5) * NcV;
319#endif
320 }
321 if (Db_y > 0 && xyz == y) {
322 OSVRR_XS_XS_DERIV_DCONTR_B(target, src13, src14, Db_y, rho12_over_alpha1,
323 alpha2_rho_over_zeta2);
324#if LIBINT2_FLOP_COUNT
325 inteval->nflops[0] += (src13 == nullptr ? 3 : 5) * NcV;
326#endif
327 }
328 if (Db_z > 0 && xyz == z) {
329 OSVRR_XS_XS_DERIV_DCONTR_B(target, src19, src20, Db_z, rho12_over_alpha1,
330 alpha2_rho_over_zeta2);
331#if LIBINT2_FLOP_COUNT
332 inteval->nflops[0] += (src19 == nullptr ? 3 : 5) * NcV;
333#endif
334 }
335#endif
336
337 // if Dc_x-1 exists
338#if LIBINT2_DEFINED(any, alpha3_over_zetapluseta)
339 if (Dc_x > 0 && xyz == x) {
340 OSVRR_XS_XS_DERIV_DCONTR_CD(target, src9, Dc_x, alpha3_over_zetapluseta);
341#if LIBINT2_FLOP_COUNT
342 inteval->nflops[0] += 3 * NcV;
343#endif
344 }
345 if (Dc_y > 0 && xyz == y) {
346 OSVRR_XS_XS_DERIV_DCONTR_CD(target, src15, Dc_y, alpha3_over_zetapluseta);
347#if LIBINT2_FLOP_COUNT
348 inteval->nflops[0] += 3 * NcV;
349#endif
350 }
351 if (Dc_z > 0 && xyz == z) {
352 OSVRR_XS_XS_DERIV_DCONTR_CD(target, src21, Dc_z, alpha3_over_zetapluseta);
353#if LIBINT2_FLOP_COUNT
354 inteval->nflops[0] += 3 * NcV;
355#endif
356 }
357#endif
358 // if Dd_x-1 exists
359#if LIBINT2_DEFINED(any, alpha4_over_zetapluseta)
360 if (Dd_x > 0 && xyz == x) {
361 OSVRR_XS_XS_DERIV_DCONTR_CD(target, src10, Dd_x, alpha4_over_zetapluseta);
362#if LIBINT2_FLOP_COUNT
363 inteval->nflops[0] += 3 * NcV;
364#endif
365 }
366 if (Dd_y > 0 && xyz == y) {
367 OSVRR_XS_XS_DERIV_DCONTR_CD(target, src16, Dd_y, alpha4_over_zetapluseta);
368#if LIBINT2_FLOP_COUNT
369 inteval->nflops[0] += 3 * NcV;
370#endif
371 }
372 if (Dd_z > 0 && xyz == z) {
373 OSVRR_XS_XS_DERIV_DCONTR_CD(target, src22, Dd_z, alpha4_over_zetapluseta);
374#if LIBINT2_FLOP_COUNT
375 inteval->nflops[0] += 3 * NcV;
376#endif
377 }
378#endif
379
380 target += NcV;
381
382 END_FOR_CART // end of loop over a-1
383
385 // inteval->nflops[0] = inteval->nflops[0] + 222 * 1 * 1 * veclen;
386 }
387};
388
389// Ahlrichs' extension of OS VRR
390template <int part, int La, int Lc, int Da_x, int Da_y, int Da_z, int Db_x,
391 int Db_y, int Db_z, int Dc_x, int Dc_y, int Dc_z, int Dd_x, int Dd_y,
392 int Dd_z,
393 // unit_b is always true
394 bool vectorize>
396 static void compute(
397 const Libint_t* inteval, LIBINT2_REALTYPE* target,
398 const LIBINT2_REALTYPE* src1, const LIBINT2_REALTYPE* src4,
399 const LIBINT2_REALTYPE* src5, const LIBINT2_REALTYPE* src6,
400 const LIBINT2_REALTYPE* src7, const LIBINT2_REALTYPE* src8,
401 const LIBINT2_REALTYPE* src9, const LIBINT2_REALTYPE* src10,
402 const LIBINT2_REALTYPE* src11, const LIBINT2_REALTYPE* src12,
403 const LIBINT2_REALTYPE* src13, const LIBINT2_REALTYPE* src14,
404 const LIBINT2_REALTYPE* src15, const LIBINT2_REALTYPE* src16,
405 const LIBINT2_REALTYPE* src17, const LIBINT2_REALTYPE* src18,
406 const LIBINT2_REALTYPE* src19, const LIBINT2_REALTYPE* src20,
407 const LIBINT2_REALTYPE* src21, const LIBINT2_REALTYPE* src22);
408};
409
436template <int La, int Lc, int Da_x, int Da_y, int Da_z, int Db_x, int Db_y,
437 int Db_z, int Dc_x, int Dc_y, int Dc_z, int Dd_x, int Dd_y, int Dd_z,
438 bool vectorize>
439struct OSAVRR_xs_xs_deriv<0, La, Lc, Da_x, Da_y, Da_z, Db_x, Db_y, Db_z, Dc_x,
440 Dc_y, Dc_z, Dd_x, Dd_y, Dd_z, vectorize> {
441 static void compute(
442 const Libint_t* inteval, LIBINT2_REALTYPE* target,
443 const LIBINT2_REALTYPE* src1, const LIBINT2_REALTYPE* src4,
444 const LIBINT2_REALTYPE* src5, const LIBINT2_REALTYPE* src6,
445 const LIBINT2_REALTYPE* src7, const LIBINT2_REALTYPE* src8,
446 const LIBINT2_REALTYPE* src9, const LIBINT2_REALTYPE* src10,
447 const LIBINT2_REALTYPE* src11, const LIBINT2_REALTYPE* src12,
448 const LIBINT2_REALTYPE* src13, const LIBINT2_REALTYPE* src14,
449 const LIBINT2_REALTYPE* src15, const LIBINT2_REALTYPE* src16,
450 const LIBINT2_REALTYPE* src17, const LIBINT2_REALTYPE* src18,
451 const LIBINT2_REALTYPE* src19, const LIBINT2_REALTYPE* src20,
452 const LIBINT2_REALTYPE* src21, const LIBINT2_REALTYPE* src22) {
453 // works for (ps|ps) and higher
454 assert(not(La < 1 || Lc < 1));
455
456 const unsigned int veclen = vectorize ? inteval->veclen : 1;
457
458 const unsigned int Nc = INT_NCART(Lc);
459 const unsigned int NcV = Nc * veclen;
460
461 int ax, ay, az;
462 FOR_CART(ax, ay, az, La)
463
464 int a[3];
465 a[0] = ax;
466 a[1] = ay;
467 a[2] = az;
468
469 enum XYZ { x = 0, y = 1, z = 2 };
470 // Build along x, if possible
471 XYZ xyz = z;
472 if (ay != 0) xyz = y;
473 if (ax != 0) xyz = x;
474 --a[xyz];
475
476 // redirect
477 const LIBINT2_REALTYPE* WP;
478 switch (xyz) {
479 case x:
480 WP = inteval->WP_x;
481 break;
482 case y:
483 WP = inteval->WP_y;
484 break;
485 case z:
486 WP = inteval->WP_z;
487 break;
488 }
489
490 const unsigned int iam1 = INT_CARTINDEX(La - 1, a[0], a[1]);
491 const unsigned int am10c0_offset = iam1 * NcV;
492 const LIBINT2_REALTYPE* src1_ptr = src1 + am10c0_offset;
493
494 {
495 unsigned int cv = 0;
496 for (unsigned int c = 0; c < Nc; ++c) {
497 for (unsigned int v = 0; v < veclen; ++v, ++cv) {
498 target[cv] = WP[v] * src1_ptr[cv];
499 }
500 }
501#if LIBINT2_FLOP_COUNT
502 inteval->nflops[0] += NcV;
503#endif
504 }
505
506 {
507 const unsigned int Ncm1 = INT_NCART(Lc - 1);
508 const unsigned int Ncm1V = Ncm1 * veclen;
509 const unsigned int am10cm10_offset = iam1 * Ncm1V;
510 const LIBINT2_REALTYPE* src4_ptr = src4 + am10cm10_offset;
511
512 // loop over c-1 shell and include (a-1_xyz 0 | c-1_xyz 0) to (a 0 | c 0)
513 int cx, cy, cz;
514 FOR_CART(cx, cy, cz, Lc - 1)
515
516 int c[3];
517 c[0] = cx;
518 c[1] = cy;
519 c[2] = cz;
520 ++c[xyz];
521
522 const unsigned int cc = INT_CARTINDEX(Lc, c[0], c[1]);
523 const unsigned int cc_offset = cc * veclen;
524 LIBINT2_REALTYPE* tptr = target + cc_offset;
525 const LIBINT2_REALTYPE cxyz = (LIBINT2_REALTYPE)c[xyz];
526 for (unsigned int v = 0; v < veclen; ++v) {
527 tptr[v] += cxyz * inteval->oo2ze[v] * src4_ptr[v];
528 }
529#if LIBINT2_FLOP_COUNT
530 inteval->nflops[0] += 3 * veclen;
531#endif
532 src4_ptr += veclen;
533
534 END_FOR_CART // end of loop over c-1
535 }
536
537 // if Da_x-1 exists
538#if LIBINT2_DEFINED(any, rho12_over_alpha1) && \
539 LIBINT2_DEFINED(any, alpha1_rho_over_zeta2)
540 if (Da_x > 0 && xyz == x) {
541 OSVRR_XS_XS_DERIV_DCONTR_A(target, src5, src6, Da_x, rho12_over_alpha1,
542 alpha1_rho_over_zeta2);
543#if LIBINT2_FLOP_COUNT
544 inteval->nflops[0] += (src5 == nullptr ? 3 : 5) * NcV;
545#endif
546 }
547 if (Da_y > 0 && xyz == y) {
548 OSVRR_XS_XS_DERIV_DCONTR_A(target, src11, src12, Da_y, rho12_over_alpha1,
549 alpha1_rho_over_zeta2);
550#if LIBINT2_FLOP_COUNT
551 inteval->nflops[0] += (src11 == nullptr ? 3 : 5) * NcV;
552#endif
553 }
554 if (Da_z > 0 && xyz == z) {
555 OSVRR_XS_XS_DERIV_DCONTR_A(target, src17, src18, Da_z, rho12_over_alpha1,
556 alpha1_rho_over_zeta2);
557#if LIBINT2_FLOP_COUNT
558 inteval->nflops[0] += (src17 == nullptr ? 3 : 5) * NcV;
559#endif
560 }
561#endif
562#undef OSVRR_XS_XS_DERIV_DCONTR_A
563
564 // if Db_x-1 exists
565#if LIBINT2_DEFINED(any, rho12_over_alpha1) && \
566 LIBINT2_DEFINED(any, alpha2_rho_over_zeta2)
567 if (Db_x > 0 && xyz == x) {
568 OSVRR_XS_XS_DERIV_DCONTR_B(target, src7, src8, Db_x, rho12_over_alpha1,
569 alpha2_rho_over_zeta2);
570#if LIBINT2_FLOP_COUNT
571 inteval->nflops[0] += (src7 == nullptr ? 3 : 5) * NcV;
572#endif
573 }
574 if (Db_y > 0 && xyz == y) {
575 OSVRR_XS_XS_DERIV_DCONTR_B(target, src13, src14, Db_y, rho12_over_alpha1,
576 alpha2_rho_over_zeta2);
577#if LIBINT2_FLOP_COUNT
578 inteval->nflops[0] += (src13 == nullptr ? 3 : 5) * NcV;
579#endif
580 }
581 if (Db_z > 0 && xyz == z) {
582 OSVRR_XS_XS_DERIV_DCONTR_B(target, src19, src20, Db_z, rho12_over_alpha1,
583 alpha2_rho_over_zeta2);
584#if LIBINT2_FLOP_COUNT
585 inteval->nflops[0] += (src19 == nullptr ? 3 : 5) * NcV;
586#endif
587 }
588#endif
589#undef OSVRR_XS_XS_DERIV_DCONTR_B
590
591 // if Dc_x-1 exists
592#if LIBINT2_DEFINED(any, alpha3_over_zetapluseta)
593 if (Dc_x > 0 && xyz == x) {
594 OSVRR_XS_XS_DERIV_DCONTR_CD(target, src9, Dc_x, alpha3_over_zetapluseta);
595#if LIBINT2_FLOP_COUNT
596 inteval->nflops[0] += 3 * NcV;
597#endif
598 }
599 if (Dc_y > 0 && xyz == y) {
600 OSVRR_XS_XS_DERIV_DCONTR_CD(target, src15, Dc_y, alpha3_over_zetapluseta);
601#if LIBINT2_FLOP_COUNT
602 inteval->nflops[0] += 3 * NcV;
603#endif
604 }
605 if (Dc_z > 0 && xyz == z) {
606 OSVRR_XS_XS_DERIV_DCONTR_CD(target, src21, Dc_z, alpha3_over_zetapluseta);
607#if LIBINT2_FLOP_COUNT
608 inteval->nflops[0] += 3 * NcV;
609#endif
610 }
611#endif
612 // if Dd_x-1 exists
613#if LIBINT2_DEFINED(any, alpha4_over_zetapluseta)
614 if (Dd_x > 0 && xyz == x) {
615 OSVRR_XS_XS_DERIV_DCONTR_CD(target, src10, Dd_x, alpha4_over_zetapluseta);
616#if LIBINT2_FLOP_COUNT
617 inteval->nflops[0] += 3 * NcV;
618#endif
619 }
620 if (Dd_y > 0 && xyz == y) {
621 OSVRR_XS_XS_DERIV_DCONTR_CD(target, src16, Dd_y, alpha4_over_zetapluseta);
622#if LIBINT2_FLOP_COUNT
623 inteval->nflops[0] += 3 * NcV;
624#endif
625 }
626 if (Dd_z > 0 && xyz == z) {
627 OSVRR_XS_XS_DERIV_DCONTR_CD(target, src22, Dd_z, alpha4_over_zetapluseta);
628#if LIBINT2_FLOP_COUNT
629 inteval->nflops[0] += 3 * NcV;
630#endif
631 }
632#endif
633#undef OSVRR_XS_XS_DERIV_DCONTR_CD
634
635 target += NcV;
636
637 END_FOR_CART // end of loop over a-1
638
640 // inteval->nflops[0] = inteval->nflops[0] + 222 * 1 * 1 * veclen;
641 }
642};
643
644}; // namespace libint2
645
646#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_xs_xs_deriv.h:441
Definition OSVRR_xs_xs_deriv.h:395
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_xs_xs_deriv.h:87
Definition OSVRR_xs_xs_deriv.h:36