3
#include <libciomr/libciomr.h>
6
#include <libmints/basisset.h>
7
#include <libmints/gshell.h>
8
#include <libmints/overlap.h>
9
#include <libmints/eri.h>
10
#include <libmints//wavefunction.h>
11
#include <physconst.h>
13
#define MAX(a, b) ((a) > (b) ? (a) : (b))
19
void calc_f(double *F, int n, double t)
27
static double K = 1.0/M_2_SQRTPI;
35
for(m=0; m<=n-1; m++){
36
F[m+1] = ((2*m + 1)*F[m] - et)/(t2);
49
term1 = num/df[m2+2*i+2];
51
} while (fabs(term1) > EPS && i < MAX_FAC);
54
F[m] = (t2*F[m+1] + et)/(2*m+1);
59
ERI::ERI(IntegralFactory* integral, Ref<BasisSet> &bs1, Ref<BasisSet> &bs2, Ref<BasisSet> &bs3, Ref<BasisSet> &bs4, int deriv)
60
: TwoBodyInt(integral, bs1, bs2, bs3, bs4, deriv)
62
// Initialize libint static data
67
// Figure out some information to initialize libint/libderiv with
68
// 1. Maximum angular momentum
69
int max_am = MAX(MAX(bs1_->max_am(), bs2_->max_am()), MAX(bs3_->max_am(), bs4_->max_am()));
70
// 2. Maximum number of primitive combinations
71
int max_nprim = bs1_->max_nprimitive() * bs2_->max_nprimitive() * bs3_->max_nprimitive() * bs4_->max_nprimitive();
72
// 3. Maximum Cartesian class size
73
max_cart_ = ioff[bs1_->max_am()] * ioff[bs2_->max_am()] * ioff[bs3_->max_am()] * ioff[bs4_->max_am()] +1;
75
// Make sure libint is compiled to handle our max AM
76
if (max_am >= LIBINT_MAX_AM) {
77
fprintf(stderr, "ERROR: ERI - libint cannot handle angular momentum this high.\n Recompile libint for higher angular momentum, then recompile this program.\n");
80
if (deriv_ == 1 && max_am >= LIBDERIV_MAX_AM1) {
81
fprintf(stderr, "ERROR: ERI - libderiv cannot handle angular momentum this high.\n Recompile libderiv for higher angular momentum, then recompile this program.\n");
86
init_libint(&libint_, max_am, max_nprim);
87
// and libderiv, if needed
89
init_libderiv1(&libderiv_, max_am, max_nprim, max_cart_-1);
91
size_t size = INT_NCART(bs1_->max_am()) * INT_NCART(bs2_->max_am()) *
92
INT_NCART(bs3_->max_am()) * INT_NCART(bs4_->max_am());
94
// Used in pure_transform
95
tformbuf_ = new double[size];
96
memset(tformbuf_, 0, sizeof(double)*size);
101
target_ = new double[size];
102
memset(target_, 0, sizeof(double)*size);
104
source_ = new double[size];
105
memset(source_, 0, sizeof(double)*size);
107
init_fjt(4*max_am + DERIV_LVL);
117
free_libint(&libint_);
119
free_libderiv(&libderiv_);
123
void ERI::init_fjt(int max)
126
double denom,d2jmax1,r2jmax1,wval,d2wval,sum,term,rexpw;
130
d_ = block_matrix(n1, n2);
132
/* Tabulate the gamma function for t(=wval)=0.0. */
134
for (i=0; i<n1; i++) {
135
d_[i][0] = 1.0/denom;
139
/* Tabulate the gamma function from t(=wval)=0.1, to 12.0. */
140
d2jmax1 = 2.0*(n1-1) + 1.0;
141
r2jmax1 = 1.0/d2jmax1;
142
for (i=1; i<TABLESIZE; i++) {
148
for (j=2; j<=200; j++) {
150
term = term * d2wval / denom;
152
if (term <= 1.0e-15) break;
156
/* Fill in the values for the highest j gtable entries (top row). */
157
d_[n1-1][i] = rexpw * sum;
159
/* Work down the table filling in the rest of the column. */
161
for (j=n1 - 2; j>=0; j--) {
163
d_[j][i] = (d_[j+1][i]*d2wval + rexpw)/denom;
167
/* Form some denominators, so divisions can be eliminated below. */
168
denom_ = new double[max+1];
170
for (i=1; i<=max; i++) {
171
denom_[i] = 1.0/(2*i - 1);
174
wval_infinity_ = 2*max + 37.0;
175
itable_infinity_ = (int) (10 * wval_infinity_);
178
void ERI::int_fjt(double *F, int J, double wval)
180
const double sqrpih = 0.886226925452758;
181
const double coef2 = 0.5000000000000000;
182
const double coef3 = -0.1666666666666667;
183
const double coef4 = 0.0416666666666667;
184
const double coef5 = -0.0083333333333333;
185
const double coef6 = 0.0013888888888889;
186
const double gfac30 = 0.4999489092;
187
const double gfac31 = -0.2473631686;
188
const double gfac32 = 0.321180909;
189
const double gfac33 = -0.3811559346;
190
const double gfac20 = 0.4998436875;
191
const double gfac21 = -0.24249438;
192
const double gfac22 = 0.24642845;
193
const double gfac10 = 0.499093162;
194
const double gfac11 = -0.2152832;
195
const double gfac00 = -0.490;
197
double wdif, d2wal, rexpw, /* denom, */ gval, factor, rwval, term;
198
int i, itable, irange;
200
/* Compute an index into the table. */
201
/* The test is needed to avoid floating point exceptions for
202
* large values of wval. */
203
if (wval > wval_infinity_) {
204
itable = itable_infinity_;
207
itable = (int) (10.0 * wval);
210
/* If itable is small enough use the table to compute int_fjttable. */
211
if (itable < TABLESIZE) {
213
wdif = wval - 0.1 * itable;
215
/* Compute fjt for J. */
216
F[J] = (((((coef6 * d_[J+6][itable]*wdif
217
+ coef5 * d_[J+5][itable])*wdif
218
+ coef4 * d_[J+4][itable])*wdif
219
+ coef3 * d_[J+3][itable])*wdif
220
+ coef2 * d_[J+2][itable])*wdif
221
- d_[J+1][itable])*wdif
224
/* Compute the rest of the fjt. */
227
/* denom = 2*J + 1; */
228
for (i=J; i>0; i--) {
229
/* denom = denom - 2.0; */
230
F[i-1] = (d2wal*F[i] + rexpw)*denom_[i];
233
/* If wval <= 2*J + 36.0, use the following formula. */
234
else if (itable <= 20*J + 360) {
238
/* Subdivide wval into 6 ranges. */
239
irange = itable/30 - 3;
241
gval = gfac30 + rwval*(gfac31 + rwval*(gfac32 + rwval*gfac33));
242
F[0] = sqrpih*sqrt(rwval) - rexpw*gval*rwval;
244
else if (irange == 2) {
245
gval = gfac20 + rwval*(gfac21 + rwval*gfac22);
246
F[0] = sqrpih*sqrt(rwval) - rexpw*gval*rwval;
248
else if (irange == 3 || irange == 4) {
249
gval = gfac10 + rwval*gfac11;
250
F[0] = sqrpih*sqrt(rwval) - rexpw*gval*rwval;
252
else if (irange == 5 || irange == 6) {
254
F[0] = sqrpih*sqrt(rwval) - rexpw*gval*rwval;
257
F[0] = sqrpih*sqrt(rwval);
260
/* Compute the rest of the int_fjttable from table->d[0]. */
261
factor = 0.5 * rwval;
262
term = factor * rexpw;
263
for (i=1; i<=J; i++) {
264
F[i] = factor * F[i-1] - term;
265
factor = rwval + factor;
268
/* For large values of wval use this algorithm: */
271
F[0] = sqrpih*sqrt(rwval);
272
factor = 0.5 * rwval;
273
for (i=1; i<=J; i++) {
274
F[i] = factor * F[i-1];
275
factor = rwval + factor;
280
void ERI::compute_shell(int sh1, int sh2, int sh3, int sh4)
282
// Need to ensure the ordering asked by the user is valid for libint
283
// compute_quartet does NOT check this. SEGFAULTS should occur if order
284
// is not guaranteed.
286
int am1, am2, am3, am4, temp;
287
bool p13p24 = false, p12 = false, p34 = false;
289
// AM used for ordering
290
am1 = bs1_->shell(sh1)->am(0);
291
am2 = bs2_->shell(sh2)->am(0);
292
am3 = bs3_->shell(sh3)->am(0);
293
am4 = bs4_->shell(sh4)->am(0);
295
int n1 = bs1_->shell(sh1)->nfunction(0);
296
int n2 = bs1_->shell(sh2)->nfunction(0);
297
int n3 = bs1_->shell(sh3)->nfunction(0);
298
int n4 = bs1_->shell(sh4)->nfunction(0);
300
// l(a) >= l(b), l(c) >= l(d), and l(c) + l(d) >= l(a) + l(b).
319
if ((am1 + am2) > (am3 + am4)) {
320
// Swap s1 and s2 with s3 and s4
331
// s1, s2, s3, s4 contain the shells to do in libint order
332
compute_quartet(s1, s2, s3, s4);
334
// Permute integrals back, if needed
335
if (p12 || p34 || p13p24)
336
permute_target(source_, target_, s1, s2, s3, s4, p12, p34, p13p24);
338
// copy the integrals to the target_
339
memcpy(target_, source_, n1 * n2 * n3 * n4 *sizeof(double));
343
void ERI::compute_quartet(int sh1, int sh2, int sh3, int sh4)
345
Ref<GaussianShell> s1, s2, s3, s4;
347
s1 = bs1_->shell(sh1);
348
s2 = bs2_->shell(sh2);
349
s3 = bs3_->shell(sh3);
350
s4 = bs4_->shell(sh4);
356
int am = am1 + am2 + am3 + am4; // total am
357
int nprim1 = s1->nprimitive();
358
int nprim2 = s2->nprimitive();
359
int nprim3 = s3->nprimitive();
360
int nprim4 = s4->nprimitive();
361
size_t nprim, nprim_combination = nprim1 * nprim2 * nprim3 * nprim4;
362
double A[3], B[3], C[3], D[3];
363
A[0] = s1->center()[0];
364
A[1] = s1->center()[1];
365
A[2] = s1->center()[2];
366
B[0] = s2->center()[0];
367
B[1] = s2->center()[1];
368
B[2] = s2->center()[2];
369
C[0] = s3->center()[0];
370
C[1] = s3->center()[1];
371
C[2] = s3->center()[2];
372
D[0] = s4->center()[0];
373
D[1] = s4->center()[1];
374
D[2] = s4->center()[2];
376
// compute intermediates
378
AB2 += (A[0] - B[0]) * (A[0] - B[0]);
379
AB2 += (A[1] - B[1]) * (A[1] - B[1]);
380
AB2 += (A[2] - B[2]) * (A[2] - B[2]);
382
CD2 += (C[0] - D[0]) * (C[0] - D[0]);
383
CD2 += (C[1] - D[1]) * (C[1] - D[1]);
384
CD2 += (C[2] - D[2]) * (C[2] - D[2]);
386
libint_.AB[0] = A[0] - B[0];
387
libint_.AB[1] = A[1] - B[1];
388
libint_.AB[2] = A[2] - B[2];
389
libint_.CD[0] = C[0] - D[0];
390
libint_.CD[1] = C[1] - D[1];
391
libint_.CD[2] = C[2] - D[2];
393
// Prepare all the data needed by libint
395
for (int p1=0; p1<nprim1; ++p1) {
396
double a1 = s1->exp(p1);
397
double c1 = s1->coef(0, p1);
398
for (int p2=0; p2<nprim2; ++p2) {
399
double a2 = s2->exp(p2);
400
double c2 = s2->coef(0, p2);
401
double zeta = a1 + a2;
402
double ooz = 1.0/zeta;
403
double oo2z = 1.0/(2.0 * zeta);
408
P[0] = (a1*A[0] + a2*B[0])*ooz;
409
P[1] = (a1*A[1] + a2*B[1])*ooz;
410
P[2] = (a1*A[2] + a2*B[2])*ooz;
418
double Sab = pow(M_PI*ooz, 3.0/2.0) * exp(-a1*a2*ooz*AB2) * c1 * c2;
420
for (int p3=0; p3<nprim3; ++p3) {
421
double a3 = s3->exp(p3);
422
double c3 = s3->coef(0, p3);
423
for (int p4=0; p4<nprim4; ++p4) {
424
double a4 = s4->exp(p4);
425
double c4 = s4->coef(0, p4);
428
double oo2n = 1.0/(2.0*nu);
429
double oo2zn = 1.0/(2.0*(zeta+nu));
430
double rho = (zeta*nu)/(zeta+nu);
431
double oo2rho = 1 / (2.0*rho);
433
double QC[3], QD[3], WP[3], WQ[3], PQ[3];
436
Q[0] = (a3*C[0] + a4*D[0])*oon;
437
Q[1] = (a3*C[1] + a4*D[1])*oon;
438
Q[2] = (a3*C[2] + a4*D[2])*oon;
450
PQ2 += (P[0] - Q[0]) * (P[0] - Q[0]);
451
PQ2 += (P[1] - Q[1]) * (P[1] - Q[1]);
452
PQ2 += (P[2] - Q[2]) * (P[2] - Q[2]);
454
W[0] = (zeta*P[0] + nu*Q[0]) / (zeta + nu);
455
W[1] = (zeta*P[1] + nu*Q[1]) / (zeta + nu);
456
W[2] = (zeta*P[2] + nu*Q[2]) / (zeta + nu);
464
for (int i=0; i<3; ++i) {
465
libint_.PrimQuartet[nprim].U[0][i] = PA[i];
466
libint_.PrimQuartet[nprim].U[2][i] = QC[i];
467
libint_.PrimQuartet[nprim].U[4][i] = WP[i];
468
libint_.PrimQuartet[nprim].U[5][i] = WQ[i];
470
libint_.PrimQuartet[nprim].oo2z = oo2z;
471
libint_.PrimQuartet[nprim].oo2n = oo2n;
472
libint_.PrimQuartet[nprim].oo2zn = oo2zn;
473
libint_.PrimQuartet[nprim].poz = rho * ooz;
474
libint_.PrimQuartet[nprim].pon = rho * oon;
475
libint_.PrimQuartet[nprim].oo2p = oo2rho;
477
double T = rho * PQ2;
478
calc_f(libint_.PrimQuartet[nprim].F, am+1, T);
480
// Modify F to include overlap of ab and cd, eqs 14, 15, 16 of libint manual
481
double Scd = pow(M_PI*oon, 3.0/2.0) * exp(-a3*a4*oon*CD2) * c3 * c4;
482
double val = 2.0 * sqrt(rho * M_1_PI) * Sab * Scd;
483
for (int i=0; i<am+1; ++i) {
484
libint_.PrimQuartet[nprim].F[i] *= val;
492
// How many are there?
493
size_t size = INT_NCART(am1) * INT_NCART(am2) * INT_NCART(am3) * INT_NCART(am4);
495
// Compute the integral
497
REALTYPE *target_ints;
499
target_ints = build_eri[am1][am2][am3][am4](&libint_, nprim);
501
memcpy(source_, target_ints, sizeof(double)*size);
505
for (size_t i=0; i<nprim_combination; ++i)
506
temp += (double)libint_.PrimQuartet[i].F[0];
510
// Normalize the integrals for angular momentum
511
normalize_am(s1, s2, s3, s4);
513
// Transform the integrals to the spherical basis
514
pure_transform(sh1, sh2, sh3, sh4);
516
// Results are in source_
519
void ERI::compute_shell_deriv1(int sh1, int sh2, int sh3, int sh4)
522
fprintf(stderr, "ERROR - ERI: ERI object not initialized to handle derivatives.\n");
525
// Need to ensure the ordering asked by the user is valid for libint
526
// compute_quartet does NOT check this. SEGFAULTS should occur if order
527
// is not guaranteed.
529
int am1, am2, am3, am4, temp;
530
bool p13p24 = false, p12 = false, p34 = false;
532
// AM used for ordering
533
am1 = bs1_->shell(sh1)->am(0);
534
am2 = bs2_->shell(sh2)->am(0);
535
am3 = bs3_->shell(sh3)->am(0);
536
am4 = bs4_->shell(sh4)->am(0);
538
int n1 = bs1_->shell(sh1)->nfunction(0);
539
int n2 = bs1_->shell(sh2)->nfunction(0);
540
int n3 = bs1_->shell(sh3)->nfunction(0);
541
int n4 = bs1_->shell(sh4)->nfunction(0);
543
// l(a) >= l(b), l(c) >= l(d), and l(c) + l(d) >= l(a) + l(b).
562
if ((am1 + am2) > (am3 + am4)) {
563
// Swap s1 and s2 with s3 and s4
574
// s1, s2, s3, s4 contain the shells to do in libderive order
575
compute_quartet_deriv1(s1, s2, s3, s4); // compute 9 sets of integral derivatives
577
size_t size = n1 * n2 * n3 * n4;
578
// Permute integrals back, if needed
579
if (p12 || p34 || p13p24) {
581
for (int i=0; i<3*natom_; ++i)
582
permute_target(source_+(i*size), target_+(i*size), s1, s2, s3, s4, p12, p34, p13p24);
585
// copy the integrals to the target_, 3n of them
586
memcpy(target_, source_, 3 * natom_ * size *sizeof(double));
590
void ERI::compute_quartet_deriv1(int sh1, int sh2, int sh3, int sh4)
592
Ref<GaussianShell> s1, s2, s3, s4;
594
s1 = bs1_->shell(sh1);
595
s2 = bs2_->shell(sh2);
596
s3 = bs3_->shell(sh3);
597
s4 = bs4_->shell(sh4);
603
int am = am1 + am2 + am3 + am4; // total am
604
int nprim1 = s1->nprimitive();
605
int nprim2 = s2->nprimitive();
606
int nprim3 = s3->nprimitive();
607
int nprim4 = s4->nprimitive();
609
double A[3], B[3], C[3], D[3];
610
A[0] = s1->center()[0];
611
A[1] = s1->center()[1];
612
A[2] = s1->center()[2];
613
B[0] = s2->center()[0];
614
B[1] = s2->center()[1];
615
B[2] = s2->center()[2];
616
C[0] = s3->center()[0];
617
C[1] = s3->center()[1];
618
C[2] = s3->center()[2];
619
D[0] = s4->center()[0];
620
D[1] = s4->center()[1];
621
D[2] = s4->center()[2];
623
// compute intermediates
625
AB2 += (A[0] - B[0]) * (A[0] - B[0]);
626
AB2 += (A[1] - B[1]) * (A[1] - B[1]);
627
AB2 += (A[2] - B[2]) * (A[2] - B[2]);
629
CD2 += (C[0] - D[0]) * (C[0] - D[0]);
630
CD2 += (C[1] - D[1]) * (C[1] - D[1]);
631
CD2 += (C[2] - D[2]) * (C[2] - D[2]);
633
libderiv_.AB[0] = A[0] - B[0];
634
libderiv_.AB[1] = A[1] - B[1];
635
libderiv_.AB[2] = A[2] - B[2];
636
libderiv_.CD[0] = C[0] - D[0];
637
libderiv_.CD[1] = C[1] - D[1];
638
libderiv_.CD[2] = C[2] - D[2];
640
// Prepare all the data needed by libint
642
for (int p1=0; p1<nprim1; ++p1) {
643
double a1 = s1->exp(p1);
644
double c1 = s1->coef(0, p1);
645
for (int p2=0; p2<nprim2; ++p2) {
646
double a2 = s2->exp(p2);
647
double c2 = s2->coef(0, p2);
648
double zeta = a1 + a2;
649
double ooz = 1.0/zeta;
650
double oo2z = 1.0/(2.0 * zeta);
655
P[0] = (a1*A[0] + a2*B[0])*ooz;
656
P[1] = (a1*A[1] + a2*B[1])*ooz;
657
P[2] = (a1*A[2] + a2*B[2])*ooz;
665
double Sab = pow(M_PI*ooz, 3.0/2.0) * exp(-a1*a2*ooz*AB2) * c1 * c2;
667
for (int p3=0; p3<nprim3; ++p3) {
668
double a3 = s3->exp(p3);
669
double c3 = s3->coef(0, p3);
670
for (int p4=0; p4<nprim4; ++p4) {
671
double a4 = s4->exp(p4);
672
double c4 = s4->coef(0, p4);
675
double oo2n = 1.0/(2.0*nu);
676
double oo2zn = 1.0/(2.0*(zeta+nu));
677
double rho = (zeta*nu)/(zeta+nu);
678
double oo2rho = 1 / (2.0*rho);
680
double QC[3], QD[3], WP[3], WQ[3], PQ[3];
683
Q[0] = (a3*C[0] + a4*D[0])*oon;
684
Q[1] = (a3*C[1] + a4*D[1])*oon;
685
Q[2] = (a3*C[2] + a4*D[2])*oon;
697
PQ2 += (P[0] - Q[0]) * (P[0] - Q[0]);
698
PQ2 += (P[1] - Q[1]) * (P[1] - Q[1]);
699
PQ2 += (P[2] - Q[2]) * (P[2] - Q[2]);
701
W[0] = (zeta*P[0] + nu*Q[0]) / (zeta + nu);
702
W[1] = (zeta*P[1] + nu*Q[1]) / (zeta + nu);
703
W[2] = (zeta*P[2] + nu*Q[2]) / (zeta + nu);
711
for (int i=0; i<3; ++i) {
712
libderiv_.PrimQuartet[nprim].U[0][i] = PA[i];
713
libderiv_.PrimQuartet[nprim].U[1][i] = PB[i];
714
libderiv_.PrimQuartet[nprim].U[2][i] = QC[i];
715
libderiv_.PrimQuartet[nprim].U[3][i] = QD[i];
716
libderiv_.PrimQuartet[nprim].U[4][i] = WP[i];
717
libderiv_.PrimQuartet[nprim].U[5][i] = WQ[i];
719
libderiv_.PrimQuartet[nprim].oo2z = oo2z;
720
libderiv_.PrimQuartet[nprim].oo2n = oo2n;
721
libderiv_.PrimQuartet[nprim].oo2zn = oo2zn;
722
libderiv_.PrimQuartet[nprim].poz = rho * ooz;
723
libderiv_.PrimQuartet[nprim].pon = rho * oon;
724
// libderiv_.PrimQuartet[nprim].oo2p = oo2rho; // NOT SET IN CINTS
725
libderiv_.PrimQuartet[nprim].twozeta_a = 2.0 * a1;
726
libderiv_.PrimQuartet[nprim].twozeta_b = 2.0 * a2;
727
libderiv_.PrimQuartet[nprim].twozeta_c = 2.0 * a3;
728
libderiv_.PrimQuartet[nprim].twozeta_d = 2.0 * a4;
730
double T = rho * PQ2;
731
int_fjt(libderiv_.PrimQuartet[nprim].F, am+DERIV_LVL, T);
733
// Modify F to include overlap of ab and cd, eqs 14, 15, 16 of libint manual
734
double Scd = pow(M_PI*oon, 3.0/2.0) * exp(-a3*a4*oon*CD2) * c3 * c4;
735
double val = 2.0 * sqrt(rho * M_1_PI) * Sab * Scd;
736
for (int i=0; i<=am+DERIV_LVL; ++i) {
737
libderiv_.PrimQuartet[nprim].F[i] *= val;
746
// How many are there?
747
size_t size = INT_NCART(am1) * INT_NCART(am2) * INT_NCART(am3) * INT_NCART(am4);
749
// Compute the integral
750
build_deriv1_eri[am1][am2][am3][am4](&libderiv_, nprim);
752
// Sum results into derivs_
753
int center_i = s1->ncenter()*3*size;
754
int center_j = s2->ncenter()*3*size;
755
int center_k = s3->ncenter()*3*size;
756
int center_l = s4->ncenter()*3*size;
758
memset(source_, 0, sizeof(double) * size * 3 * natom_);
760
for (size_t i=0; i < size; ++i) {
761
source_[center_i+(0*size)+i] += libderiv_.ABCD[0][i];
762
source_[center_i+(1*size)+i] += libderiv_.ABCD[1][i];
763
source_[center_i+(2*size)+i] += libderiv_.ABCD[2][i];
765
// Use translational invariance to determine center_j derivatives
766
source_[center_j+(0*size)+i] -= (libderiv_.ABCD[0][i] + libderiv_.ABCD[6][i] + libderiv_.ABCD[9][i]);
767
source_[center_j+(1*size)+i] -= (libderiv_.ABCD[1][i] + libderiv_.ABCD[7][i] + libderiv_.ABCD[10][i]);
768
source_[center_j+(2*size)+i] -= (libderiv_.ABCD[2][i] + libderiv_.ABCD[8][i] + libderiv_.ABCD[11][i]);
770
source_[center_k+(0*size)+i] += libderiv_.ABCD[6][i];
771
source_[center_k+(1*size)+i] += libderiv_.ABCD[7][i];
772
source_[center_k+(2*size)+i] += libderiv_.ABCD[8][i];
774
source_[center_l+(0*size)+i] += libderiv_.ABCD[9][i];
775
source_[center_l+(1*size)+i] += libderiv_.ABCD[10][i];
776
source_[center_l+(2*size)+i] += libderiv_.ABCD[11][i];
779
// Normalize the 3n sets of integrals
780
normalize_am(s1, s2, s3, s4, 3*natom_);
782
// Transform the integrals to the spherical basis
783
// pure_transform can only do 1 at a time. We need to do 3n.
784
for (int i=0; i<3*natom_; ++i)
785
pure_transform(sh1, sh2, sh3, sh4, i);
787
// Results are in source_