2
#include <libdpd/dpd.h>
6
/* FOLD_ROHF(): Fold the ROHF Fock matrix contributions to the energy
7
** (or energy derivative) into the two-particle density matrix. Here
8
** we are trying to convert from an energy expression of the form:
10
** E = sum_pq Dpq fpq + 1/4 sum_pqrs Gpqrs <pq||rs>
14
** E = sum_pq Dpq hpq + 1/4 sum_pqrs Gpqrs <pq||rs>
16
** We do this by shifting some one-particle density matrix components
17
** into appropriate two-particle density matrix components:
19
** G'pmrm = Dpr + 4 * Gpmrm
21
** One problem is that we need to make sure the resulting density,
22
** G'pqrs, is still antisymmetric to permutation of p and q or r and
23
** s. So, for example, for the Gimkm component we compute:
25
** G'pmrm = Dpr + Gpmrm
26
** G'mprm = Dpr - Gmprm
27
** G'pmmr = Dpr - Gpmmr
28
** G'mpmr = Dpr + Gmpmr
31
void fold_ROHF(struct RHO_Params rho_params)
34
int i, j, k, l, m, a, b;
35
int I, J, K, L, M, A, B;
36
int IM, JM, MI, MJ, MK, ML, MA, MB;
37
int Gi, Gj, Gk, Gl, Gm, Ga, Gb;
39
int *occ_off, *vir_off;
40
int *occ_sym, *vir_sym;
42
dpdfile2 D, D1, D2, F;
43
dpdbuf4 G, Aints, E, C, DInts, FInts, BInts, G1, G2;
44
double one_energy=0.0, two_energy=0.0, total_two_energy=0.0;
45
double test_energy = 0.0, tmp;
48
nirreps = moinfo.nirreps;
49
occpi = moinfo.occpi; virtpi = moinfo.virtpi;
50
occ_off = moinfo.occ_off; vir_off = moinfo.vir_off;
51
occ_sym = moinfo.occ_sym; vir_sym = moinfo.vir_sym;
52
openpi = moinfo.openpi;
55
fprintf(outfile, "\n\tEnergies re-computed from Fock-adjusted CC density:\n");
56
fprintf(outfile, "\t---------------------------------------------------\n");
58
dpd_file2_init(&D, CC_OEI, 0, 0, 0, rho_params.DIJ_lbl);
59
dpd_file2_init(&F, CC_OEI, 0, 0, 0, "h(i,j)");
60
this_energy = dpd_file2_dot(&D, &F);
64
/* fprintf(outfile, "\tDIJ = %20.15f\n", this_energy); */
65
one_energy += this_energy;
67
dpd_file2_init(&D, CC_OEI, 0, 0, 0, rho_params.Dij_lbl);
68
dpd_file2_init(&F, CC_OEI, 0, 0, 0, "h(i,j)");
69
this_energy = dpd_file2_dot(&D, &F);
73
/* fprintf(outfile, "\tDij = %20.15f\n", this_energy); */
74
one_energy += this_energy;
76
dpd_file2_init(&D, CC_OEI, 0, 1, 1, rho_params.DAB_lbl);
77
dpd_file2_init(&F, CC_OEI, 0, 1, 1, "h(a,b)");
78
this_energy = dpd_file2_dot(&D, &F);
82
/* fprintf(outfile, "\tDAB = %20.15f\n", this_energy); */
83
one_energy += this_energy;
85
dpd_file2_init(&D, CC_OEI, 0, 1, 1, rho_params.Dab_lbl);
86
dpd_file2_init(&F, CC_OEI, 0, 1, 1, "h(a,b)");
87
this_energy = dpd_file2_dot(&D, &F);
91
/* fprintf(outfile, "\tDab = %20.15f\n", this_energy); */
92
one_energy += this_energy;
94
dpd_file2_init(&D, CC_OEI, 0, 0, 1, rho_params.DIA_lbl);
95
dpd_file2_init(&F, CC_OEI, 0, 0, 1, "h(i,a)");
96
this_energy = dpd_file2_dot(&D, &F);
100
/* fprintf(outfile, "\tDIA = %20.15f\n", this_energy); */
101
one_energy += this_energy;
103
dpd_file2_init(&D, CC_OEI, 0, 0, 1, rho_params.Dia_lbl);
104
dpd_file2_init(&F, CC_OEI, 0, 0, 1, "h(i,a)");
105
this_energy = dpd_file2_dot(&D, &F);
109
/* fprintf(outfile, "\tDia = %20.15f\n", this_energy); */
110
one_energy += this_energy;
112
dpd_file2_init(&D, CC_OEI, 0, 0, 1, rho_params.DAI_lbl);
113
dpd_file2_init(&F, CC_OEI, 0, 0, 1, "h(i,a)");
114
this_energy = dpd_file2_dot(&D, &F);
118
/* fprintf(outfile, "\tDAI = %20.15f\n", this_energy); */
119
one_energy += this_energy;
121
dpd_file2_init(&D, CC_OEI, 0, 0, 1, rho_params.Dai_lbl);
122
dpd_file2_init(&F, CC_OEI, 0, 0, 1, "h(i,a)");
123
this_energy = dpd_file2_dot(&D, &F);
127
/* fprintf(outfile, "\tDai = %20.15f\n", this_energy); */
128
one_energy += this_energy;
130
fprintf(outfile, "\tOne-electron energy = %20.15f\n", one_energy);
134
dpd_file2_init(&D, CC_OEI, 0, 0, 0, rho_params.DIJ_lbl);
135
dpd_file2_mat_init(&D);
136
dpd_file2_mat_rd(&D);
138
dpd_buf4_init(&G, CC_GAMMA, 0, 0, 0, 2, 2, 0, "GIJKL");
139
for(h=0; h < nirreps; h++) {
140
dpd_buf4_mat_irrep_init(&G, h);
141
dpd_buf4_mat_irrep_rd(&G, h);
143
for(Gm=0; Gm < nirreps; Gm++) {
146
for(i=0; i < occpi[Gi]; i++) {
148
for(j=0; j < occpi[Gj]; j++) {
150
for(m=0; m < occpi[Gm]; m++) {
153
IM = G.params->rowidx[I][M];
154
JM = G.params->colidx[J][M];
155
MI = G.params->rowidx[M][I];
156
MJ = G.params->colidx[M][J];
158
G.matrix[h][IM][JM] += D.matrix[Gi][i][j];
159
G.matrix[h][IM][MJ] -= D.matrix[Gi][i][j];
160
G.matrix[h][MI][MJ] += D.matrix[Gi][i][j];
161
G.matrix[h][MI][JM] -= D.matrix[Gi][i][j];
167
dpd_buf4_mat_irrep_wrt(&G, h);
168
dpd_buf4_mat_irrep_close(&G, h);
171
if(!params.aobasis) {
173
dpd_buf4_init(&Aints, CC_AINTS, 0, 0, 0, 0, 0, 1, "A <ij|kl>");
174
two_energy += 0.25 * dpd_buf4_dot(&Aints, &G);
175
dpd_buf4_close(&Aints);
180
dpd_file2_mat_close(&D);
183
dpd_file2_init(&D, CC_OEI, 0, 0, 0, rho_params.Dij_lbl);
184
dpd_file2_mat_init(&D);
185
dpd_file2_mat_rd(&D);
187
dpd_buf4_init(&G, CC_GAMMA, 0, 0, 0, 2, 2, 0, "Gijkl");
188
for(h=0; h < nirreps; h++) {
189
dpd_buf4_mat_irrep_init(&G, h);
190
dpd_buf4_mat_irrep_rd(&G, h);
192
for(Gm=0; Gm < nirreps; Gm++) {
195
for(i=0; i < (occpi[Gi] - openpi[Gi]); i++) {
197
for(j=0; j < (occpi[Gj] - openpi[Gj]); j++) {
199
for(m=0; m < (occpi[Gm] - openpi[Gm]); m++) {
202
IM = G.params->rowidx[I][M];
203
JM = G.params->colidx[J][M];
204
MI = G.params->rowidx[M][I];
205
MJ = G.params->colidx[M][J];
207
G.matrix[h][IM][JM] += D.matrix[Gi][i][j];
208
G.matrix[h][MI][JM] -= D.matrix[Gi][i][j];
209
G.matrix[h][MI][MJ] += D.matrix[Gi][i][j];
210
G.matrix[h][IM][MJ] -= D.matrix[Gi][i][j];
216
dpd_buf4_mat_irrep_wrt(&G, h);
217
dpd_buf4_mat_irrep_close(&G, h);
220
if(!params.aobasis) {
221
dpd_buf4_init(&Aints, CC_AINTS, 0, 0, 0, 0, 0, 1, "A <ij|kl>");
222
two_energy += 0.25 * dpd_buf4_dot(&Aints, &G);
223
dpd_buf4_close(&Aints);
228
dpd_file2_mat_close(&D);
231
dpd_file2_init(&D, CC_OEI, 0, 0, 0, rho_params.DIJ_lbl);
232
dpd_file2_mat_init(&D);
233
dpd_file2_mat_rd(&D);
235
dpd_buf4_init(&G, CC_GAMMA, 0, 0, 0, 0, 0, 0, "GIjKl");
236
for(h=0; h < nirreps; h++) {
237
dpd_buf4_mat_irrep_init(&G, h);
238
dpd_buf4_mat_irrep_rd(&G, h);
240
for(Gm=0; Gm < nirreps; Gm++) {
243
for(i=0; i < occpi[Gi]; i++) {
245
for(j=0; j < occpi[Gj]; j++) {
247
for(m=0; m < (occpi[Gm] - openpi[Gm]); m++) {
250
IM = G.params->rowidx[I][M];
251
JM = G.params->colidx[J][M];
253
G.matrix[h][IM][JM] += D.matrix[Gi][i][j];
259
dpd_buf4_mat_irrep_wrt(&G, h);
260
dpd_buf4_mat_irrep_close(&G, h);
264
dpd_file2_mat_close(&D);
268
dpd_file2_init(&D, CC_OEI, 0, 0, 0, rho_params.Dij_lbl);
269
dpd_file2_mat_init(&D);
270
dpd_file2_mat_rd(&D);
272
dpd_buf4_init(&G, CC_GAMMA, 0, 0, 0, 0, 0, 0, "GIjKl");
273
for(h=0; h < nirreps; h++) {
274
dpd_buf4_mat_irrep_init(&G, h);
275
dpd_buf4_mat_irrep_rd(&G, h);
277
for(Gm=0; Gm < nirreps; Gm++) {
280
for(k=0; k < (occpi[Gk] - openpi[Gk]); k++) {
282
for(l=0; l < (occpi[Gl] - openpi[Gl]); l++) {
284
for(m=0; m < occpi[Gm]; m++) {
287
MK = G.params->rowidx[M][K];
288
ML = G.params->colidx[M][L];
290
G.matrix[h][MK][ML] += D.matrix[Gk][k][l];
296
dpd_buf4_mat_irrep_wrt(&G, h);
297
dpd_buf4_mat_irrep_close(&G, h);
300
if(!params.aobasis) {
301
dpd_buf4_init(&Aints, CC_AINTS, 0, 0, 0, 0, 0, 0, "A <ij|kl>");
302
two_energy += dpd_buf4_dot(&Aints, &G);
303
dpd_buf4_close(&Aints);
308
if(!params.aobasis) {
309
total_two_energy += two_energy;
310
fprintf(outfile, "\tIJKL energy = %20.15f\n", two_energy);
314
dpd_file2_mat_close(&D);
317
dpd_file2_init(&D1, CC_OEI, 0, 0, 1, rho_params.DIA_lbl);
318
dpd_file2_mat_init(&D1);
319
dpd_file2_mat_rd(&D1);
320
dpd_file2_init(&D2, CC_OEI, 0, 0, 1, rho_params.DAI_lbl);
321
dpd_file2_mat_init(&D2);
322
dpd_file2_mat_rd(&D2);
324
dpd_buf4_init(&G, CC_GAMMA, 0, 0, 10, 2, 10, 0, "GIJKA");
325
for(h=0; h < nirreps; h++) {
326
dpd_buf4_mat_irrep_init(&G, h);
327
dpd_buf4_mat_irrep_rd(&G, h);
329
for(Gm=0; Gm < nirreps; Gm++) {
332
for(i=0; i < occpi[Gi]; i++) {
334
for(a=0; a < (virtpi[Ga] - openpi[Ga]); a++) {
336
for(m=0; m < occpi[Gm]; m++) {
339
MI = G.params->rowidx[M][I];
340
IM = G.params->rowidx[I][M];
341
MA = G.params->colidx[M][A];
343
G.matrix[h][MI][MA] += 0.5 * (D1.matrix[Gi][i][a] +
344
D2.matrix[Gi][i][a]);
345
G.matrix[h][IM][MA] -= 0.5 * (D1.matrix[Gi][i][a] +
346
D2.matrix[Gi][i][a]);
352
dpd_buf4_mat_irrep_wrt(&G, h);
353
dpd_buf4_mat_irrep_close(&G, h);
356
if(!params.aobasis) {
358
dpd_buf4_init(&E, CC_EINTS, 0, 0, 10, 2, 10, 0, "E <ij||ka> (i>j,ka)");
359
two_energy += dpd_buf4_dot(&E, &G);
365
dpd_file2_mat_close(&D1);
366
dpd_file2_close(&D1);
367
dpd_file2_mat_close(&D2);
368
dpd_file2_close(&D2);
370
dpd_file2_init(&D1, CC_OEI, 0, 0, 1, rho_params.Dia_lbl);
371
dpd_file2_mat_init(&D1);
372
dpd_file2_mat_rd(&D1);
373
dpd_file2_init(&D2, CC_OEI, 0, 0, 1, rho_params.Dai_lbl);
374
dpd_file2_mat_init(&D2);
375
dpd_file2_mat_rd(&D2);
377
dpd_buf4_init(&G, CC_GAMMA, 0, 0, 10, 2, 10, 0, "Gijka");
378
for(h=0; h < nirreps; h++) {
379
dpd_buf4_mat_irrep_init(&G, h);
380
dpd_buf4_mat_irrep_rd(&G, h);
382
for(Gm=0; Gm < nirreps; Gm++) {
385
for(i=0; i < (occpi[Gi] - openpi[Gi]); i++) {
387
for(a=0; a < virtpi[Ga]; a++) {
389
for(m=0; m < (occpi[Gm] - openpi[Gm]); m++) {
392
MI = G.params->rowidx[M][I];
393
IM = G.params->rowidx[I][M];
394
MA = G.params->colidx[M][A];
396
G.matrix[h][MI][MA] += 0.5 * (D1.matrix[Gi][i][a] +
397
D2.matrix[Gi][i][a]);
398
G.matrix[h][IM][MA] -= 0.5 * (D1.matrix[Gi][i][a] +
399
D2.matrix[Gi][i][a]);
405
dpd_buf4_mat_irrep_wrt(&G, h);
406
dpd_buf4_mat_irrep_close(&G, h);
408
if(!params.aobasis) {
409
dpd_buf4_init(&E, CC_EINTS, 0, 0, 10, 2, 10, 0, "E <ij||ka> (i>j,ka)");
410
two_energy += dpd_buf4_dot(&E, &G);
416
dpd_file2_mat_close(&D1);
417
dpd_file2_close(&D1);
418
dpd_file2_mat_close(&D2);
419
dpd_file2_close(&D2);
421
dpd_file2_init(&D1, CC_OEI, 0, 0, 1, rho_params.DIA_lbl);
422
dpd_file2_mat_init(&D1);
423
dpd_file2_mat_rd(&D1);
424
dpd_file2_init(&D2, CC_OEI, 0, 0, 1, rho_params.DAI_lbl);
425
dpd_file2_mat_init(&D2);
426
dpd_file2_mat_rd(&D2);
428
dpd_buf4_init(&G, CC_GAMMA, 0, 0, 10, 0, 10, 0, "GiJkA");
429
for(h=0; h < nirreps; h++) {
430
dpd_buf4_mat_irrep_init(&G, h);
431
dpd_buf4_mat_irrep_rd(&G, h);
433
for(Gm=0; Gm < nirreps; Gm++) {
436
for(i=0; i < occpi[Gi]; i++) {
438
for(a=0; a < (virtpi[Ga] - openpi[Ga]); a++) {
440
for(m=0; m < (occpi[Gm] - openpi[Gm]); m++) {
443
MI = G.params->rowidx[M][I];
444
MA = G.params->colidx[M][A];
446
G.matrix[h][MI][MA] += 0.5 * (D1.matrix[Gi][i][a] +
447
D2.matrix[Gi][i][a]);
453
dpd_buf4_mat_irrep_wrt(&G, h);
454
dpd_buf4_mat_irrep_close(&G, h);
457
if(!params.aobasis) {
458
dpd_buf4_init(&E, CC_EINTS, 0, 0, 10, 0, 10, 0, "E <ij|ka>");
459
two_energy += 2 * dpd_buf4_dot(&E, &G);
465
dpd_file2_mat_close(&D1);
466
dpd_file2_close(&D1);
467
dpd_file2_mat_close(&D2);
468
dpd_file2_close(&D2);
471
dpd_file2_init(&D1, CC_OEI, 0, 0, 1, rho_params.Dia_lbl);
472
dpd_file2_mat_init(&D1);
473
dpd_file2_mat_rd(&D1);
474
dpd_file2_init(&D2, CC_OEI, 0, 0, 1, rho_params.Dai_lbl);
475
dpd_file2_mat_init(&D2);
476
dpd_file2_mat_rd(&D2);
478
dpd_buf4_init(&G, CC_GAMMA, 0, 0, 10, 0, 10, 0, "GIjKa");
479
for(h=0; h < nirreps; h++) {
480
dpd_buf4_mat_irrep_init(&G, h);
481
dpd_buf4_mat_irrep_rd(&G, h);
483
for(Gm=0; Gm < nirreps; Gm++) {
486
for(i=0; i < (occpi[Gi] - openpi[Gi]); i++) {
488
for(a=0; a < virtpi[Ga]; a++) {
490
for(m=0; m < occpi[Gm]; m++) {
493
MI = G.params->rowidx[M][I];
494
MA = G.params->colidx[M][A];
496
G.matrix[h][MI][MA] += 0.5 * (D1.matrix[Gi][i][a] +
497
D2.matrix[Gi][i][a]);
503
dpd_buf4_mat_irrep_wrt(&G, h);
504
dpd_buf4_mat_irrep_close(&G, h);
507
if(!params.aobasis) {
508
dpd_buf4_init(&E, CC_EINTS, 0, 0, 10, 0, 10, 0, "E <ij|ka>");
509
two_energy += 2 * dpd_buf4_dot(&E, &G);
515
if(!params.aobasis) {
516
total_two_energy += two_energy;
517
fprintf(outfile, "\tIJKA energy = %20.15f\n", two_energy);
521
dpd_file2_mat_close(&D1);
522
dpd_file2_close(&D1);
523
dpd_file2_mat_close(&D2);
524
dpd_file2_close(&D2);
526
if(!params.aobasis) {
528
dpd_buf4_init(&DInts, CC_DINTS, 0, 2, 7, 2, 7, 0, "D <ij||ab> (i>j,a>b)");
529
dpd_buf4_init(&G, CC_GAMMA, 0, 2, 7, 2, 7, 0, "GIJAB");
530
two_energy += dpd_buf4_dot(&G, &DInts);
532
dpd_buf4_init(&G, CC_GAMMA, 0, 2, 7, 2, 7, 0, "Gijab");
533
two_energy += dpd_buf4_dot(&G, &DInts);
535
dpd_buf4_close(&DInts);
536
dpd_buf4_init(&DInts, CC_DINTS, 0, 0, 5, 0, 5, 0, "D <ij|ab>");
537
dpd_buf4_init(&G, CC_GAMMA, 0, 0, 5, 0, 5, 0, "GIjAb");
538
two_energy += dpd_buf4_dot(&G, &DInts);
540
dpd_buf4_close(&DInts);
543
total_two_energy += two_energy;
544
fprintf(outfile, "\tIJAB energy = %20.15f\n", two_energy);
548
dpd_file2_init(&D, CC_OEI, 0, 1, 1, rho_params.DAB_lbl);
549
dpd_file2_mat_init(&D);
550
dpd_file2_mat_rd(&D);
552
dpd_buf4_init(&G, CC_GAMMA, 0, 10, 10, 10, 10, 0, "GIBJA");
553
for(h=0; h < nirreps; h++) {
554
dpd_buf4_mat_irrep_init(&G, h);
555
dpd_buf4_mat_irrep_rd(&G, h);
557
for(Gm=0; Gm < nirreps; Gm++) {
560
for(b=0; b < (virtpi[Gb] - openpi[Gb]); b++) {
562
for(a=0; a < (virtpi[Ga] - openpi[Ga]); a++) {
564
for(m=0; m < occpi[Gm]; m++) {
567
MB = G.params->rowidx[M][B];
568
MA = G.params->colidx[M][A];
570
G.matrix[h][MB][MA] += D.matrix[Ga][a][b];
576
dpd_buf4_mat_irrep_wrt(&G, h);
577
dpd_buf4_mat_irrep_close(&G, h);
580
if(!params.aobasis) {
582
dpd_buf4_init(&C, CC_CINTS, 0, 10, 10, 10, 10, 0, "C <ia||jb>");
583
two_energy += dpd_buf4_dot(&C, &G);
589
dpd_file2_mat_close(&D);
593
dpd_file2_init(&D, CC_OEI, 0, 1, 1, rho_params.Dab_lbl);
594
dpd_file2_mat_init(&D);
595
dpd_file2_mat_rd(&D);
597
dpd_buf4_init(&G, CC_GAMMA, 0, 10, 10, 10, 10, 0, "Gibja");
598
for(h=0; h < nirreps; h++) {
599
dpd_buf4_mat_irrep_init(&G, h);
600
dpd_buf4_mat_irrep_rd(&G, h);
602
for(Gm=0; Gm < nirreps; Gm++) {
605
for(b=0; b < virtpi[Gb]; b++) {
607
for(a=0; a < virtpi[Ga]; a++) {
609
for(m=0; m < (occpi[Gm] - openpi[Gm]); m++) {
612
MB = G.params->rowidx[M][B];
613
MA = G.params->colidx[M][A];
615
G.matrix[h][MB][MA] += D.matrix[Ga][a][b];
621
dpd_buf4_mat_irrep_wrt(&G, h);
622
dpd_buf4_mat_irrep_close(&G, h);
625
if(!params.aobasis) {
626
dpd_buf4_init(&C, CC_CINTS, 0, 10, 10, 10, 10, 0, "C <ia||jb>");
627
two_energy += dpd_buf4_dot(&C, &G);
633
dpd_file2_mat_close(&D);
637
dpd_file2_init(&D, CC_OEI, 0, 1, 1, rho_params.Dab_lbl);
638
dpd_file2_mat_init(&D);
639
dpd_file2_mat_rd(&D);
641
dpd_buf4_init(&G, CC_GAMMA, 0, 10, 10, 10, 10, 0, "GIbJa");
642
for(h=0; h < nirreps; h++) {
643
dpd_buf4_mat_irrep_init(&G, h);
644
dpd_buf4_mat_irrep_rd(&G, h);
646
for(Gm=0; Gm < nirreps; Gm++) {
649
for(b=0; b < virtpi[Gb]; b++) {
651
for(a=0; a < virtpi[Ga]; a++) {
653
for(m=0; m < occpi[Gm]; m++) {
656
MB = G.params->rowidx[M][B];
657
MA = G.params->colidx[M][A];
659
G.matrix[h][MB][MA] += D.matrix[Ga][a][b];
665
dpd_buf4_mat_irrep_wrt(&G, h);
666
dpd_buf4_mat_irrep_close(&G, h);
669
if(!params.aobasis) {
670
dpd_buf4_init(&C, CC_CINTS, 0, 10, 10, 10, 10, 0, "C <ia|jb>");
671
two_energy += dpd_buf4_dot(&C, &G);
677
dpd_file2_mat_close(&D);
681
dpd_file2_init(&D, CC_OEI, 0, 1, 1, rho_params.DAB_lbl);
682
dpd_file2_mat_init(&D);
683
dpd_file2_mat_rd(&D);
685
dpd_buf4_init(&G, CC_GAMMA, 0, 10, 10, 10, 10, 0, "GiBjA");
686
for(h=0; h < nirreps; h++) {
687
dpd_buf4_mat_irrep_init(&G, h);
688
dpd_buf4_mat_irrep_rd(&G, h);
690
for(Gm=0; Gm < nirreps; Gm++) {
693
for(b=0; b < (virtpi[Gb] - openpi[Gb]); b++) {
695
for(a=0; a < (virtpi[Ga] - openpi[Ga]); a++) {
697
for(m=0; m < (occpi[Gm] - openpi[Gm]); m++) {
700
MB = G.params->rowidx[M][B];
701
MA = G.params->colidx[M][A];
703
G.matrix[h][MB][MA] += D.matrix[Ga][a][b];
708
dpd_buf4_mat_irrep_wrt(&G, h);
709
dpd_buf4_mat_irrep_close(&G, h);
712
if(!params.aobasis) {
713
dpd_buf4_init(&C, CC_CINTS, 0, 10, 10, 10, 10, 0, "C <ia|jb>");
714
two_energy += dpd_buf4_dot(&C, &G);
720
dpd_file2_mat_close(&D);
724
if(!params.aobasis) {
725
dpd_buf4_init(&DInts, CC_DINTS, 0, 10, 10, 10, 10, 0, "D <ij|ab> (ib,ja)");
726
dpd_buf4_init(&G, CC_GAMMA, 0, 10, 10, 10, 10, 0, "GIbjA");
727
two_energy -= dpd_buf4_dot(&G, &DInts);
729
dpd_buf4_init(&G, CC_GAMMA, 0, 10, 10, 10, 10, 0, "GiBJa");
730
two_energy -= dpd_buf4_dot(&G, &DInts);
732
dpd_buf4_close(&DInts);
734
total_two_energy += two_energy;
735
fprintf(outfile, "\tIBJA energy = %20.15f\n", two_energy);
739
if(!params.aobasis) {
741
dpd_buf4_init(&FInts, CC_FINTS, 0, 10, 7, 10, 5, 1, "F <ia|bc>");
742
dpd_buf4_sort(&FInts, CC_TMP0, qprs, 11, 7, "F(CI,AB)");
743
dpd_buf4_close(&FInts);
744
dpd_buf4_init(&FInts, CC_TMP0, 0, 11, 7, 11, 7, 0, "F(CI,AB)");
745
dpd_buf4_init(&G, CC_GAMMA, 0, 11, 7, 11, 7, 0, "GCIAB");
746
two_energy = -1.0 * dpd_buf4_dot(&G, &FInts);
748
dpd_buf4_init(&G, CC_GAMMA, 0, 11, 7, 11, 7, 0, "Gciab");
749
two_energy -= dpd_buf4_dot(&G, &FInts);
751
dpd_buf4_close(&FInts);
752
dpd_buf4_init(&FInts, CC_FINTS, 0, 10, 5, 10, 5, 0, "F <ia|bc>");
753
dpd_buf4_sort(&FInts, CC_TMP0, qprs, 11, 5, "F(cI,Ba)");
754
dpd_buf4_close(&FInts);
755
dpd_buf4_init(&FInts, CC_TMP0, 0, 11, 5, 11, 5, 0, "F(cI,Ba)");
756
dpd_buf4_sort(&FInts, CC_TMP1, pqsr, 11, 5, "F(cI,aB)");
757
dpd_buf4_close(&FInts);
758
dpd_buf4_init(&FInts, CC_TMP1, 0, 11, 5, 11, 5, 0, "F(cI,aB)");
759
dpd_buf4_init(&G, CC_GAMMA, 0, 11, 5, 11, 5, 0, "GcIaB");
760
two_energy += dpd_buf4_dot(&G, &FInts);
762
dpd_buf4_init(&G, CC_GAMMA, 0, 11, 5, 11, 5, 0, "GCiAb");
763
two_energy += dpd_buf4_dot(&G, &FInts);
765
dpd_buf4_close(&FInts);
768
total_two_energy += two_energy;
769
fprintf(outfile, "\tCIAB energy = %20.15f\n", two_energy);
773
if(!params.aobasis) {
775
dpd_buf4_init(&BInts, CC_BINTS, 0, 7, 7, 5, 5, 1, "B <ab|cd>");
776
dpd_buf4_init(&G, CC_GAMMA, 0, 7, 7, 7, 7, 0, "GABCD");
777
two_energy += dpd_buf4_dot(&G, &BInts);
779
dpd_buf4_init(&G, CC_GAMMA, 0, 7, 7, 7, 7, 0, "Gabcd");
780
two_energy += dpd_buf4_dot(&G, &BInts);
782
dpd_buf4_close(&BInts);
783
dpd_buf4_init(&BInts, CC_BINTS, 0, 5, 5, 5, 5, 0, "B <ab|cd>");
784
dpd_buf4_init(&G, CC_GAMMA, 0, 5, 5, 5, 5, 0, "GAbCd");
785
two_energy += dpd_buf4_dot(&G, &BInts);
787
dpd_buf4_close(&BInts);
790
if(!params.aobasis) {
791
total_two_energy += two_energy;
792
fprintf(outfile, "\tABCD energy = %20.15f\n", two_energy);
793
fprintf(outfile, "\tTotal two-electron energy = %20.15f\n", total_two_energy);
795
fprintf(outfile, "\tCCSD correlation energy = %20.15f\n",
796
one_energy + total_two_energy);
797
fprintf(outfile, "\tTotal CCSD energy = %20.15f\n",
798
one_energy + total_two_energy + moinfo.eref);
801
fprintf(outfile, "\tTotal EOM CCSD correlation energy = %20.15f\n",
802
one_energy + total_two_energy);
803
fprintf(outfile, "\tCCSD correlation + EOM excitation energy = %20.15f\n",
804
moinfo.ecc + params.cceom_energy);
805
fprintf(outfile, "\tTotal EOM CCSD energy = %20.15f\n",
806
one_energy + total_two_energy + moinfo.eref);