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