LIBINT 2.7.2
OSVRR_sx_sx_deriv.h
1/*
2 * Copyright (C) 2004-2021 Edward F. Valeev
3 *
4 * This file is part of Libint.
5 *
6 * Libint 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 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. 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 <cstdlib>
25#include <libint2.h>
26#include <util_types.h>
27#include <libint2/cgshell_ordering.h>
28
29namespace libint2 {
30
31 template <int part, int Lb, int Ld,
32 int Da_x,
33 int Da_y,
34 int Da_z,
35 int Db_x,
36 int Db_y,
37 int Db_z,
38 int Dc_x,
39 int Dc_y,
40 int Dc_z,
41 int Dd_x,
42 int Dd_y,
43 int Dd_z,
44 bool unit_a,
45 bool vectorize> struct OSVRR_sx_sx_deriv {
46 static void compute(const Libint_t* inteval,
47 LIBINT2_REALTYPE* target,
48 const LIBINT2_REALTYPE* src0,
49 const LIBINT2_REALTYPE* src1,
50 const LIBINT2_REALTYPE* src2,
51 const LIBINT2_REALTYPE* src3,
52 const LIBINT2_REALTYPE* src4,
53 const LIBINT2_REALTYPE* src5,
54 const LIBINT2_REALTYPE* src6,
55 const LIBINT2_REALTYPE* src7,
56 const LIBINT2_REALTYPE* src8,
57 const LIBINT2_REALTYPE* src9,
58 const LIBINT2_REALTYPE* src10,
59 const LIBINT2_REALTYPE* src11,
60 const LIBINT2_REALTYPE* src12,
61 const LIBINT2_REALTYPE* src13,
62 const LIBINT2_REALTYPE* src14,
63 const LIBINT2_REALTYPE* src15,
64 const LIBINT2_REALTYPE* src16,
65 const LIBINT2_REALTYPE* src17,
66 const LIBINT2_REALTYPE* src18,
67 const LIBINT2_REALTYPE* src19,
68 const LIBINT2_REALTYPE* src20,
69 const LIBINT2_REALTYPE* src21,
70 const LIBINT2_REALTYPE* src22
71 );
72 };
73
103 template <int Lb, int Ld,
104 int Da_x,
105 int Da_y,
106 int Da_z,
107 int Db_x,
108 int Db_y,
109 int Db_z,
110 int Dc_x,
111 int Dc_y,
112 int Dc_z,
113 int Dd_x,
114 int Dd_y,
115 int Dd_z,
116 bool unit_a,
117 bool vectorize> struct OSVRR_sx_sx_deriv<0,Lb,Ld,
118 Da_x,Da_y,Da_z,
119 Db_x,Db_y,Db_z,
120 Dc_x,Dc_y,Dc_z,
121 Dd_x,Dd_y,Dd_z,
122 unit_a,
123 vectorize> {
124
125 static void compute(const Libint_t* inteval,
126 LIBINT2_REALTYPE* target,
127 const LIBINT2_REALTYPE* src0,
128 const LIBINT2_REALTYPE* src1,
129 const LIBINT2_REALTYPE* src2,
130 const LIBINT2_REALTYPE* src3,
131 const LIBINT2_REALTYPE* src4,
132 const LIBINT2_REALTYPE* src5,
133 const LIBINT2_REALTYPE* src6,
134 const LIBINT2_REALTYPE* src7,
135 const LIBINT2_REALTYPE* src8,
136 const LIBINT2_REALTYPE* src9,
137 const LIBINT2_REALTYPE* src10,
138 const LIBINT2_REALTYPE* src11,
139 const LIBINT2_REALTYPE* src12,
140 const LIBINT2_REALTYPE* src13,
141 const LIBINT2_REALTYPE* src14,
142 const LIBINT2_REALTYPE* src15,
143 const LIBINT2_REALTYPE* src16,
144 const LIBINT2_REALTYPE* src17,
145 const LIBINT2_REALTYPE* src18,
146 const LIBINT2_REALTYPE* src19,
147 const LIBINT2_REALTYPE* src20,
148 const LIBINT2_REALTYPE* src21,
149 const LIBINT2_REALTYPE* src22
150 ) {
151
152 // works for (sd|sp) and higher
153 assert(not (Lb < 2 || Ld < 1));
154
155 const unsigned int veclen = vectorize ? inteval->veclen : 1;
156
157 const unsigned int Nd = INT_NCART(Ld);
158 const unsigned int NdV = Nd * veclen;
159
160 int bx, by, bz;
161 FOR_CART(bx, by, bz, Lb)
162
163 int b[3]; b[0] = bx; b[1] = by; b[2] = bz;
164
165 enum XYZ {x=0, y=1, z=2};
166 // Build along x, if possible
167 XYZ xyz = z;
168 if (by != 0) xyz = y;
169 if (bx != 0) xyz = x;
170 --b[xyz];
171
172 // redirect
173 const LIBINT2_REALTYPE *PB, *WP;
174 switch(xyz) {
175 case x:
176#if LIBINT2_DEFINED(eri,PB_x)
177 if (not unit_a) PB = inteval->PB_x;
178#endif
179 WP = inteval->WP_x;
180 break;
181 case y:
182#if LIBINT2_DEFINED(eri,PB_y)
183 if (not unit_a) PB = inteval->PB_y;
184#endif
185 WP = inteval->WP_y;
186 break;
187 case z:
188#if LIBINT2_DEFINED(eri,PB_z)
189 if (not unit_a) PB = inteval->PB_z;
190#endif
191 WP = inteval->WP_z;
192 break;
193 }
194
195 const unsigned int ibm1 = INT_CARTINDEX(Lb-1,b[0],b[1]);
196 const unsigned int bm10d0_offset = ibm1 * NdV;
197 const LIBINT2_REALTYPE* src0_ptr = (not unit_a) ? src0 + bm10d0_offset : 0;
198 const LIBINT2_REALTYPE* src1_ptr = src1 + bm10d0_offset;
199
200 // if b-2_xyz exists, include (0 b-2_xyz | 0 d)
201 if (b[xyz] > 0) {
202 --b[xyz];
203 const unsigned int ibm2 = INT_CARTINDEX(Lb-2,b[0],b[1]);
204 const unsigned int bm20d0_offset = ibm2 * NdV;
205 ++b[xyz];
206 const LIBINT2_REALTYPE* src2_ptr = src2 + bm20d0_offset;
207 const LIBINT2_REALTYPE* src3_ptr = src3 + bm20d0_offset;
208 const LIBINT2_REALTYPE bxyz = (LIBINT2_REALTYPE)b[xyz];
209
210 unsigned int dv = 0;
211 for(unsigned int d = 0; d < Nd; ++d) {
212 for(unsigned int v=0; v<veclen; ++v, ++dv) {
213 LIBINT2_REALTYPE value = WP[v] * src1_ptr[dv] + bxyz * inteval->oo2z[v] * (src2_ptr[dv] - inteval->roz[v] * src3_ptr[dv]);
214 if (not unit_a) value += PB[v] * src0_ptr[dv];
215 target[dv] = value;
216 }
217 }
218#if LIBINT2_FLOP_COUNT
219 inteval->nflops[0] += (unit_a ? 6 : 8) * NdV;
220#endif
221
222 }
223 else {
224 unsigned int dv = 0;
225 for(unsigned int d = 0; d < Nd; ++d) {
226 for(unsigned int v=0; v<veclen; ++v, ++dv) {
227 LIBINT2_REALTYPE value = WP[v] * src1_ptr[dv];
228 if (not unit_a) value += PB[v] * src0_ptr[dv];
229 target[dv] = value;
230 }
231 }
232#if LIBINT2_FLOP_COUNT
233 inteval->nflops[0] += (unit_a ? 1 : 3) * NdV;
234#endif
235 }
236
237 {
238 const unsigned int Ndm1 = INT_NCART(Ld-1);
239 const unsigned int Ndm1V = Ndm1 * veclen;
240 const unsigned int bm10dm10_offset = ibm1 * Ndm1V;
241 const LIBINT2_REALTYPE* src4_ptr = src4 + bm10dm10_offset;
242
243 // loop over d-1 shell and include (0 b-1_xyz | 0 d-1_xyz) to (0 b | 0 d)
244 int dx, dy, dz;
245 FOR_CART(dx, dy, dz, Ld-1)
246
247 int d[3]; d[0] = dx; d[1] = dy; d[2] = dz;
248 ++d[xyz];
249
250 const unsigned int dc = INT_CARTINDEX(Ld,d[0],d[1]);
251 const unsigned int dc_offset = dc * veclen;
252 LIBINT2_REALTYPE* tptr = target + dc_offset;
253 const LIBINT2_REALTYPE dxyz = (LIBINT2_REALTYPE)d[xyz];
254 for(unsigned int v=0; v<veclen; ++v) {
255 tptr[v] += dxyz * inteval->oo2ze[v] * src4_ptr[v];
256 }
257#if LIBINT2_FLOP_COUNT
258 inteval->nflops[0] += 3 * veclen;
259#endif
260 src4_ptr += veclen;
261
262 END_FOR_CART
263 }
264
265#define OSVRR_SX_SX_DERIV_DCONTR_A(target,srcA,srcB,id,ecoef1,ecoef2) { \
266 const LIBINT2_REALTYPE* srcA_ptr = srcA + bm10d0_offset; \
267 const LIBINT2_REALTYPE* srcB_ptr = srcB + bm10d0_offset; \
268 const LIBINT2_REALTYPE di = (LIBINT2_REALTYPE)id; \
269 const LIBINT2_REALTYPE* c1 = inteval->ecoef1; \
270 const LIBINT2_REALTYPE* c2 = inteval->ecoef2; \
271 unsigned int dv = 0; \
272 bool has_unit = srcA == nullptr; \
273 if (!has_unit) { \
274 for(unsigned int d = 0; d < Nd; ++d) { \
275 for(unsigned int v=0; v<veclen; ++v, ++dv) { \
276 target[dv] += di * (c1[v] * srcA_ptr[dv] - c2[v] * srcB_ptr[dv]); \
277 } \
278 } \
279 } else { \
280 for(unsigned int d = 0; d < Nd; ++d) { \
281 for(unsigned int v=0; v<veclen; ++v, ++dv) { \
282 target[dv] -= di * c2[v] * srcB_ptr[dv]); \
283 } \
284 } \
285 } \
286}
287
288#define OSVRR_SX_SX_DERIV_DCONTR_B(target,srcA,srcB,id,ecoef1,ecoef2) { \
289 const LIBINT2_REALTYPE* srcA_ptr = srcA + bm10d0_offset; \
290 const LIBINT2_REALTYPE* srcB_ptr = srcB + bm10d0_offset; \
291 const LIBINT2_REALTYPE di = (LIBINT2_REALTYPE)id; \
292 const LIBINT2_REALTYPE* c1 = inteval->ecoef1; \
293 const LIBINT2_REALTYPE* c2 = inteval->ecoef2; \
294 unsigned int dv = 0; \
295 bool has_unit = srcA == nullptr; \
296 if (!has_unit) { \
297 for(unsigned int d = 0; d < Nd; ++d) { \
298 for(unsigned int v=0; v<veclen; ++v, ++dv) { \
299 target[dv] -= di * (c1[v] * srcA_ptr[dv] + c2[v] * srcB_ptr[dv]); \
300 } \
301 } \
302 } else { \
303 for(unsigned int d = 0; d < Nd; ++d) { \
304 for(unsigned int v=0; v<veclen; ++v, ++dv) { \
305 target[dv] -= di * c2[v] * srcB_ptr[dv]; \
306 } \
307 } \
308 } \
309}
310
311#define OSVRR_SX_SX_DERIV_DCONTR_CD(target,srcA,id,ecoef1) { \
312 const LIBINT2_REALTYPE* srcA_ptr = srcA + bm10d0_offset; \
313 const LIBINT2_REALTYPE di = (LIBINT2_REALTYPE)id; \
314 const LIBINT2_REALTYPE* c1 = inteval->ecoef1; \
315 unsigned int dv = 0; \
316 for(unsigned int d = 0; d < Nd; ++d) { \
317 for(unsigned int v=0; v<veclen; ++v, ++dv) { \
318 target[dv] += di * c1[v] * srcA_ptr[dv]; \
319 } \
320 } \
321}
322
323 // if Da_x-1 exists
324#if LIBINT2_DEFINED(any,rho12_over_alpha2) && LIBINT2_DEFINED(any,alpha1_rho_over_zeta2)
325 if (Da_x > 0 && xyz == x){
326 OSVRR_SX_SX_DERIV_DCONTR_A(target,src5,src6,Da_x,rho12_over_alpha2,alpha1_rho_over_zeta2);
327#if LIBINT2_FLOP_COUNT
328 inteval->nflops[0] += (src5 == nullptr ? 3 : 5) * NdV;
329#endif
330 }
331 if (Da_y > 0 && xyz == y){
332 OSVRR_SX_SX_DERIV_DCONTR_A(target,src11,src12,Da_y,rho12_over_alpha2,alpha1_rho_over_zeta2);
333#if LIBINT2_FLOP_COUNT
334 inteval->nflops[0] += (src11 == nullptr ? 3 : 5) * NdV;
335#endif
336 }
337 if (Da_z > 0 && xyz == z){
338 OSVRR_SX_SX_DERIV_DCONTR_A(target,src17,src18,Da_z,rho12_over_alpha2,alpha1_rho_over_zeta2);
339#if LIBINT2_FLOP_COUNT
340 inteval->nflops[0] += (src17 == nullptr ? 3 : 5) * NdV;
341#endif
342 }
343#endif
344
345 // if Db_x-1 exists
346#if LIBINT2_DEFINED(any,rho12_over_alpha2) && LIBINT2_DEFINED(any,alpha2_rho_over_zeta2)
347 if (Db_x > 0 && xyz == x){
348 OSVRR_SX_SX_DERIV_DCONTR_B(target,src7,src8,Db_x,rho12_over_alpha2,alpha2_rho_over_zeta2);
349#if LIBINT2_FLOP_COUNT
350 inteval->nflops[0] += (src7 == nullptr ? 3 : 5) * NdV;
351#endif
352 }
353 if (Db_y > 0 && xyz == y){
354 OSVRR_SX_SX_DERIV_DCONTR_B(target,src13,src14,Db_y,rho12_over_alpha2,alpha2_rho_over_zeta2);
355#if LIBINT2_FLOP_COUNT
356 inteval->nflops[0] += (src13 == nullptr ? 3 : 5) * NdV;
357#endif
358 }
359 if (Db_z > 0 && xyz == z){
360 OSVRR_SX_SX_DERIV_DCONTR_B(target,src19,src20,Db_z,rho12_over_alpha2,alpha2_rho_over_zeta2);
361#if LIBINT2_FLOP_COUNT
362 inteval->nflops[0] += (src19 == nullptr ? 3 : 5) * NdV;
363#endif
364 }
365#endif
366
367 // if Dc_x-1 exists
368#if LIBINT2_DEFINED(any,alpha3_over_zetapluseta)
369 if (Dc_x > 0 && xyz == x){
370 OSVRR_SX_SX_DERIV_DCONTR_CD(target,src9,Dc_x,alpha3_over_zetapluseta);
371#if LIBINT2_FLOP_COUNT
372 inteval->nflops[0] += 3 * NdV;
373#endif
374 }
375 if (Dc_y > 0 && xyz == y){
376 OSVRR_SX_SX_DERIV_DCONTR_CD(target,src15,Dc_y,alpha3_over_zetapluseta);
377#if LIBINT2_FLOP_COUNT
378 inteval->nflops[0] += 3 * NdV;
379#endif
380 }
381 if (Dc_z > 0 && xyz == z){
382 OSVRR_SX_SX_DERIV_DCONTR_CD(target,src21,Dc_z,alpha3_over_zetapluseta);
383#if LIBINT2_FLOP_COUNT
384 inteval->nflops[0] += 3 * NdV;
385#endif
386 }
387#endif
388 // if Dd_x-1 exists
389#if LIBINT2_DEFINED(any,alpha4_over_zetapluseta)
390 if (Dd_x > 0 && xyz == x){
391 OSVRR_SX_SX_DERIV_DCONTR_CD(target,src10,Dd_x,alpha4_over_zetapluseta);
392#if LIBINT2_FLOP_COUNT
393 inteval->nflops[0] += 3 * NdV;
394#endif
395 }
396 if (Dd_y > 0 && xyz == y){
397 OSVRR_SX_SX_DERIV_DCONTR_CD(target,src16,Dd_y,alpha4_over_zetapluseta);
398#if LIBINT2_FLOP_COUNT
399 inteval->nflops[0] += 3 * NdV;
400#endif
401 }
402 if (Dd_z > 0 && xyz == z){
403 OSVRR_SX_SX_DERIV_DCONTR_CD(target,src22,Dd_z,alpha4_over_zetapluseta);
404#if LIBINT2_FLOP_COUNT
405 inteval->nflops[0] += 3 * NdV;
406#endif
407 }
408#endif
409
410 target += NdV;
411
412 END_FOR_CART // end of loop over a-1
413
415 //inteval->nflops[0] = inteval->nflops[0] + 222 * 1 * 1 * veclen;
416
417 }
418
419 };
420
422 template <int part, int Lb, int Ld,
423 int Da_x,
424 int Da_y,
425 int Da_z,
426 int Db_x,
427 int Db_y,
428 int Db_z,
429 int Dc_x,
430 int Dc_y,
431 int Dc_z,
432 int Dd_x,
433 int Dd_y,
434 int Dd_z,
435 bool vectorize> struct OSAVRR_sx_sx_deriv {
436 static void compute(const Libint_t* inteval,
437 LIBINT2_REALTYPE* target,
438 const LIBINT2_REALTYPE* src1,
439 const LIBINT2_REALTYPE* src4,
440 const LIBINT2_REALTYPE* src5,
441 const LIBINT2_REALTYPE* src6,
442 const LIBINT2_REALTYPE* src7,
443 const LIBINT2_REALTYPE* src8,
444 const LIBINT2_REALTYPE* src9,
445 const LIBINT2_REALTYPE* src10,
446 const LIBINT2_REALTYPE* src11,
447 const LIBINT2_REALTYPE* src12,
448 const LIBINT2_REALTYPE* src13,
449 const LIBINT2_REALTYPE* src14,
450 const LIBINT2_REALTYPE* src15,
451 const LIBINT2_REALTYPE* src16,
452 const LIBINT2_REALTYPE* src17,
453 const LIBINT2_REALTYPE* src18,
454 const LIBINT2_REALTYPE* src19,
455 const LIBINT2_REALTYPE* src20,
456 const LIBINT2_REALTYPE* src21,
457 const LIBINT2_REALTYPE* src22
458 );
459 };
460
487 template <int Lb, int Ld,
488 int Da_x,
489 int Da_y,
490 int Da_z,
491 int Db_x,
492 int Db_y,
493 int Db_z,
494 int Dc_x,
495 int Dc_y,
496 int Dc_z,
497 int Dd_x,
498 int Dd_y,
499 int Dd_z,
500 bool vectorize> struct OSAVRR_sx_sx_deriv<0,Lb,Ld,
501 Da_x,Da_y,Da_z,
502 Db_x,Db_y,Db_z,
503 Dc_x,Dc_y,Dc_z,
504 Dd_x,Dd_y,Dd_z,
505 vectorize> {
506
507 static void compute(const Libint_t* inteval,
508 LIBINT2_REALTYPE* target,
509 const LIBINT2_REALTYPE* src1,
510 const LIBINT2_REALTYPE* src4,
511 const LIBINT2_REALTYPE* src5,
512 const LIBINT2_REALTYPE* src6,
513 const LIBINT2_REALTYPE* src7,
514 const LIBINT2_REALTYPE* src8,
515 const LIBINT2_REALTYPE* src9,
516 const LIBINT2_REALTYPE* src10,
517 const LIBINT2_REALTYPE* src11,
518 const LIBINT2_REALTYPE* src12,
519 const LIBINT2_REALTYPE* src13,
520 const LIBINT2_REALTYPE* src14,
521 const LIBINT2_REALTYPE* src15,
522 const LIBINT2_REALTYPE* src16,
523 const LIBINT2_REALTYPE* src17,
524 const LIBINT2_REALTYPE* src18,
525 const LIBINT2_REALTYPE* src19,
526 const LIBINT2_REALTYPE* src20,
527 const LIBINT2_REALTYPE* src21,
528 const LIBINT2_REALTYPE* src22
529 ) {
530
531 // works for (sd|sp) and higher
532 assert(not (Lb < 2 || Ld < 1));
533
534 const unsigned int veclen = vectorize ? inteval->veclen : 1;
535
536 const unsigned int Nd = INT_NCART(Ld);
537 const unsigned int NdV = Nd * veclen;
538
539 int bx, by, bz;
540 FOR_CART(bx, by, bz, Lb)
541
542 int b[3]; b[0] = bx; b[1] = by; b[2] = bz;
543
544 enum XYZ {x=0, y=1, z=2};
545 // Build along x, if possible
546 XYZ xyz = z;
547 if (by != 0) xyz = y;
548 if (bx != 0) xyz = x;
549 --b[xyz];
550
551 // redirect
552 const LIBINT2_REALTYPE *WP;
553 switch(xyz) {
554 case x:
555 WP = inteval->WP_x;
556 break;
557 case y:
558 WP = inteval->WP_y;
559 break;
560 case z:
561 WP = inteval->WP_z;
562 break;
563 }
564
565 const unsigned int ibm1 = INT_CARTINDEX(Lb-1,b[0],b[1]);
566 const unsigned int bm10d0_offset = ibm1 * NdV;
567 const LIBINT2_REALTYPE* src1_ptr = src1 + bm10d0_offset;
568
569 {
570 unsigned int dv = 0;
571 for(unsigned int d = 0; d < Nd; ++d) {
572 for(unsigned int v=0; v<veclen; ++v, ++dv) {
573 target[dv] = WP[v] * src1_ptr[dv];
574 }
575 }
576#if LIBINT2_FLOP_COUNT
577 inteval->nflops[0] += NdV;
578#endif
579 }
580
581 {
582 const unsigned int Ndm1 = INT_NCART(Ld-1);
583 const unsigned int Ndm1V = Ndm1 * veclen;
584 const unsigned int bm10dm10_offset = ibm1 * Ndm1V;
585 const LIBINT2_REALTYPE* src4_ptr = src4 + bm10dm10_offset;
586
587 // loop over d-1 shell and include (0 b-1_xyz | 0 d-1_xyz) to (0 b | 0 d)
588 int dx, dy, dz;
589 FOR_CART(dx, dy, dz, Ld-1)
590
591 int d[3]; d[0] = dx; d[1] = dy; d[2] = dz;
592 ++d[xyz];
593
594 const unsigned int dc = INT_CARTINDEX(Ld,d[0],d[1]);
595 const unsigned int dc_offset = dc * veclen;
596 LIBINT2_REALTYPE* tptr = target + dc_offset;
597 const LIBINT2_REALTYPE dxyz = (LIBINT2_REALTYPE)d[xyz];
598 for(unsigned int v=0; v<veclen; ++v) {
599 tptr[v] += dxyz * inteval->oo2ze[v] * src4_ptr[v];
600 }
601#if LIBINT2_FLOP_COUNT
602 inteval->nflops[0] += 3 * veclen;
603#endif
604 src4_ptr += veclen;
605
606 END_FOR_CART
607 }
608
609 // if Da_x-1 exists
610#if LIBINT2_DEFINED(any,rho12_over_alpha2) && LIBINT2_DEFINED(any,alpha1_rho_over_zeta2)
611 if (Da_x > 0 && xyz == x){
612 OSVRR_SX_SX_DERIV_DCONTR_A(target,src5,src6,Da_x,rho12_over_alpha2,alpha1_rho_over_zeta2);
613#if LIBINT2_FLOP_COUNT
614 inteval->nflops[0] += (src5 == nullptr ? 3 : 5) * NdV;
615#endif
616 }
617 if (Da_y > 0 && xyz == y){
618 OSVRR_SX_SX_DERIV_DCONTR_A(target,src11,src12,Da_y,rho12_over_alpha2,alpha1_rho_over_zeta2);
619#if LIBINT2_FLOP_COUNT
620 inteval->nflops[0] += (src11 == nullptr ? 3 : 5) * NdV;
621#endif
622 }
623 if (Da_z > 0 && xyz == z){
624 OSVRR_SX_SX_DERIV_DCONTR_A(target,src17,src18,Da_z,rho12_over_alpha2,alpha1_rho_over_zeta2);
625#if LIBINT2_FLOP_COUNT
626 inteval->nflops[0] += (src17 == nullptr ? 3 : 5) * NdV;
627#endif
628 }
629#endif
630#undef OSVRR_SX_SX_DERIV_DCONTR_A
631
632 // if Db_x-1 exists
633#if LIBINT2_DEFINED(any,rho12_over_alpha2) && LIBINT2_DEFINED(any,alpha2_rho_over_zeta2)
634 if (Db_x > 0 && xyz == x){
635 OSVRR_SX_SX_DERIV_DCONTR_B(target,src7,src8,Db_x,rho12_over_alpha2,alpha2_rho_over_zeta2);
636#if LIBINT2_FLOP_COUNT
637 inteval->nflops[0] += (src7 == nullptr ? 3 : 5) * NdV;
638#endif
639 }
640 if (Db_y > 0 && xyz == y){
641 OSVRR_SX_SX_DERIV_DCONTR_B(target,src13,src14,Db_y,rho12_over_alpha2,alpha2_rho_over_zeta2);
642#if LIBINT2_FLOP_COUNT
643 inteval->nflops[0] += (src13 == nullptr ? 3 : 5) * NdV;
644#endif
645 }
646 if (Db_z > 0 && xyz == z){
647 OSVRR_SX_SX_DERIV_DCONTR_B(target,src19,src20,Db_z,rho12_over_alpha2,alpha2_rho_over_zeta2);
648#if LIBINT2_FLOP_COUNT
649 inteval->nflops[0] += (src19 == nullptr ? 3 : 5) * NdV;
650#endif
651 }
652#endif
653#undef OSVRR_SX_SX_DERIV_DCONTR_B
654
655 // if Dc_x-1 exists
656#if LIBINT2_DEFINED(any,alpha3_over_zetapluseta)
657 if (Dc_x > 0 && xyz == x){
658 OSVRR_SX_SX_DERIV_DCONTR_CD(target,src9,Dc_x,alpha3_over_zetapluseta);
659#if LIBINT2_FLOP_COUNT
660 inteval->nflops[0] += 3 * NdV;
661#endif
662 }
663 if (Dc_y > 0 && xyz == y){
664 OSVRR_SX_SX_DERIV_DCONTR_CD(target,src15,Dc_y,alpha3_over_zetapluseta);
665#if LIBINT2_FLOP_COUNT
666 inteval->nflops[0] += 3 * NdV;
667#endif
668 }
669 if (Dc_z > 0 && xyz == z){
670 OSVRR_SX_SX_DERIV_DCONTR_CD(target,src21,Dc_z,alpha3_over_zetapluseta);
671#if LIBINT2_FLOP_COUNT
672 inteval->nflops[0] += 3 * NdV;
673#endif
674 }
675#endif
676 // if Dd_x-1 exists
677#if LIBINT2_DEFINED(any,alpha4_over_zetapluseta)
678 if (Dd_x > 0 && xyz == x){
679 OSVRR_SX_SX_DERIV_DCONTR_CD(target,src10,Dd_x,alpha4_over_zetapluseta);
680#if LIBINT2_FLOP_COUNT
681 inteval->nflops[0] += 3 * NdV;
682#endif
683 }
684 if (Dd_y > 0 && xyz == y){
685 OSVRR_SX_SX_DERIV_DCONTR_CD(target,src16,Dd_y,alpha4_over_zetapluseta);
686#if LIBINT2_FLOP_COUNT
687 inteval->nflops[0] += 3 * NdV;
688#endif
689 }
690 if (Dd_z > 0 && xyz == z){
691 OSVRR_SX_SX_DERIV_DCONTR_CD(target,src22,Dd_z,alpha4_over_zetapluseta);
692#if LIBINT2_FLOP_COUNT
693 inteval->nflops[0] += 3 * NdV;
694#endif
695 }
696#endif
697#undef OSVRR_SX_SX_DERIV_DCONTR_CD
698
699 target += NdV;
700
701 END_FOR_CART // end of loop over a-1
702
704 //inteval->nflops[0] = inteval->nflops[0] + 222 * 1 * 1 * veclen;
705
706 }
707
708 };
709
710};
711
712#endif // header guard
713
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:507
the Ahlrichs version
Definition: OSVRR_sx_sx_deriv.h:435
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:125
Definition: OSVRR_sx_sx_deriv.h:45