3
#include <libdpd/dpd.h>
12
dpdfile2 fAB, fab, fIA, fia;
15
dpdbuf4 F_anti, F, D_anti, D;
16
dpdbuf4 tautIJAB, tautijab, tautIjAb, taut;
18
if(params.ref == 0) { /** RHF **/
19
dpd_file2_init(&fAB, CC_OEI, 0, 1, 1, "fAB");
20
dpd_file2_copy(&fAB, CC_OEI, "FAE");
21
dpd_file2_close(&fAB);
23
else if(params.ref == 1) { /** ROHF **/
24
dpd_file2_init(&fAB, CC_OEI, 0, 1, 1, "fAB");
25
dpd_file2_copy(&fAB, CC_OEI, "FAE");
26
dpd_file2_close(&fAB);
28
dpd_file2_init(&fab, CC_OEI, 0, 1, 1, "fab");
29
dpd_file2_copy(&fab, CC_OEI, "Fae");
30
dpd_file2_close(&fab);
32
else if(params.ref == 2) { /** UHF **/
33
dpd_file2_init(&fAB, CC_OEI, 0, 1, 1, "fAB");
34
dpd_file2_copy(&fAB, CC_OEI, "FAE");
35
dpd_file2_close(&fAB);
37
dpd_file2_init(&fab, CC_OEI, 0, 3, 3, "fab");
38
dpd_file2_copy(&fab, CC_OEI, "Fae");
39
dpd_file2_close(&fab);
42
if(params.ref == 0) { /** RHF **/
43
dpd_file2_init(&FAE, CC_OEI, 0, 1, 1, "FAE");
45
dpd_file2_mat_init(&FAE);
46
dpd_file2_mat_rd(&FAE);
49
for(h=0; h < moinfo.nirreps; h++) {
50
for(a=0; a < FAE.params->rowtot[h]; a++)
51
FAE.matrix[h][a][a] = 0;
55
dpd_file2_mat_wrt(&FAE);
56
dpd_file2_mat_close(&FAE);
57
dpd_file2_close(&FAE);
59
else if(params.ref == 1) { /** ROHF **/
60
dpd_file2_init(&FAE, CC_OEI, 0, 1, 1, "FAE");
61
dpd_file2_init(&Fae, CC_OEI, 0, 1, 1, "Fae");
63
dpd_file2_mat_init(&FAE);
64
dpd_file2_mat_rd(&FAE);
65
dpd_file2_mat_init(&Fae);
66
dpd_file2_mat_rd(&Fae);
68
for(h=0; h < moinfo.nirreps; h++) {
70
for(a=0; a < FAE.params->rowtot[h]; a++)
71
for(e=0; e < FAE.params->coltot[h]; e++)
72
FAE.matrix[h][a][e] *= (1 - (a==e));
74
for(a=0; a < Fae.params->rowtot[h]; a++)
75
for(e=0; e < Fae.params->coltot[h]; e++)
76
Fae.matrix[h][a][e] *= (1 - (a==e));
80
dpd_file2_mat_wrt(&FAE);
81
dpd_file2_mat_close(&FAE);
82
dpd_file2_mat_wrt(&Fae);
83
dpd_file2_mat_close(&Fae);
85
dpd_file2_close(&FAE);
86
dpd_file2_close(&Fae);
88
else if(params.ref == 2) { /** UHF **/
89
dpd_file2_init(&FAE, CC_OEI, 0, 1, 1, "FAE");
90
dpd_file2_init(&Fae, CC_OEI, 0, 3, 3, "Fae");
92
dpd_file2_mat_init(&FAE);
93
dpd_file2_mat_rd(&FAE);
94
dpd_file2_mat_init(&Fae);
95
dpd_file2_mat_rd(&Fae);
97
for(h=0; h < moinfo.nirreps; h++) {
99
for(a=0; a < FAE.params->rowtot[h]; a++)
100
for(e=0; e < FAE.params->coltot[h]; e++)
101
FAE.matrix[h][a][e] *= (1 - (a==e));
103
for(a=0; a < Fae.params->rowtot[h]; a++)
104
for(e=0; e < Fae.params->coltot[h]; e++)
105
Fae.matrix[h][a][e] *= (1 - (a==e));
109
dpd_file2_mat_wrt(&FAE);
110
dpd_file2_mat_close(&FAE);
111
dpd_file2_mat_wrt(&Fae);
112
dpd_file2_mat_close(&Fae);
114
dpd_file2_close(&FAE);
115
dpd_file2_close(&Fae);
118
if(params.ref == 0) { /** RHF **/
119
dpd_file2_init(&FAE, CC_OEI, 0, 1, 1, "FAE");
121
dpd_file2_init(&fIA, CC_OEI, 0, 0, 1, "fIA");
122
dpd_file2_init(&tIA, CC_OEI, 0, 0, 1, "tIA");
123
dpd_contract222(&tIA, &fIA, &FAE, 1, 1, -0.5, 1);
124
dpd_file2_close(&tIA);
125
dpd_file2_close(&fIA);
127
dpd_buf4_init(&F_anti, CC_FINTS, 0, 10, 5, 10, 5, 1, "F <ia|bc>");
128
dpd_buf4_init(&F, CC_FINTS, 0, 10, 5, 10, 5, 0,"F <ia|bc>");
129
dpd_file2_init(&tIA, CC_OEI, 0, 0, 1, "tIA");
130
dpd_dot13(&tIA, &F_anti, &FAE, 0, 0, 1.0, 1.0);
131
dpd_dot13(&tIA, &F, &FAE, 0, 0, 1.0, 1.0);
132
dpd_file2_close(&tIA);
133
dpd_buf4_close(&F_anti);
136
dpd_buf4_init(&D, CC_DINTS, 0, 0, 5, 0, 5, 0, "D 2<ij|ab> - <ij|ba>");
137
dpd_buf4_init(&tautIjAb, CC_TAMPS, 0, 0, 5, 0, 5, 0, "tautIjAb");
138
dpd_contract442(&tautIjAb, &D, &FAE, 2, 2, -1, 1);
140
dpd_buf4_close(&tautIjAb);
142
/* Build the tilde intermediates */
143
dpd_file2_copy(&FAE, CC_OEI, "FAEt");
144
dpd_file2_close(&FAE);
146
dpd_file2_init(&FAEt, CC_OEI, 0, 1, 1, "FAEt");
148
dpd_file2_init(&tIA, CC_OEI, 0, 0, 1, "tIA");
149
dpd_file2_init(&FME, CC_OEI, 0, 0, 1, "FME");
150
dpd_contract222(&tIA, &FME, &FAEt, 1, 1, -0.5, 1);
151
dpd_file2_close(&tIA);
152
dpd_file2_close(&FME);
154
dpd_file2_close(&FAEt);
156
else if(params.ref == 1) { /** ROHF **/
157
dpd_file2_init(&FAE, CC_OEI, 0, 1, 1, "FAE");
158
dpd_file2_init(&Fae, CC_OEI, 0, 1, 1, "Fae");
160
dpd_file2_init(&fIA, CC_OEI, 0, 0, 1, "fIA");
161
dpd_file2_init(&tIA, CC_OEI, 0, 0, 1, "tIA");
162
dpd_contract222(&tIA, &fIA, &FAE, 1, 1, -0.5, 1);
163
dpd_file2_close(&tIA);
164
dpd_file2_close(&fIA);
166
dpd_file2_init(&fia, CC_OEI, 0, 0, 1, "fia");
167
dpd_file2_init(&tia, CC_OEI, 0, 0, 1, "tia");
168
dpd_contract222(&tia, &fia, &Fae, 1, 1, -0.5, 1);
169
dpd_file2_close(&tia);
170
dpd_file2_close(&fia);
172
dpd_buf4_init(&F_anti, CC_FINTS, 0, 10, 5, 10, 5, 1, "F <ia|bc>");
173
dpd_buf4_init(&F, CC_FINTS, 0, 10, 5, 10, 5, 0,"F <ia|bc>");
174
dpd_file2_init(&tIA, CC_OEI, 0, 0, 1, "tIA");
175
dpd_file2_init(&tia, CC_OEI, 0, 0, 1, "tia");
177
dpd_dot13(&tIA, &F_anti, &FAE, 0, 0, 1.0, 1.0);
178
dpd_dot13(&tia, &F, &FAE, 0, 0, 1.0, 1.0);
180
dpd_dot13(&tia, &F_anti, &Fae, 0, 0, 1.0, 1.0);
181
dpd_dot13(&tIA, &F, &Fae, 0, 0, 1.0, 1.0);
183
dpd_file2_close(&tIA);
184
dpd_file2_close(&tia);
185
dpd_buf4_close(&F_anti);
188
dpd_buf4_init(&D_anti, CC_DINTS, 0, 2, 5, 2, 5, 0, "D <ij||ab> (i>j,ab)");
190
dpd_buf4_init(&tautIJAB, CC_TAMPS, 0, 2, 5, 2, 7, 0, "tautIJAB");
191
dpd_buf4_init(&tautijab, CC_TAMPS, 0, 2, 5, 2, 7, 0, "tautijab");
193
dpd_contract442(&tautIJAB, &D_anti, &FAE, 2, 2, -1, 1);
194
dpd_contract442(&tautijab, &D_anti, &Fae, 2, 2, -1, 1);
196
dpd_buf4_close(&D_anti);
197
dpd_buf4_close(&tautIJAB);
198
dpd_buf4_close(&tautijab);
200
dpd_buf4_init(&D, CC_DINTS, 0, 0, 5, 0, 5, 0, "D <ij|ab>");
201
dpd_buf4_init(&tautIjAb, CC_TAMPS, 0, 0, 5, 0, 5, 0, "tautIjAb");
203
dpd_contract442(&tautIjAb, &D, &Fae, 3, 3, -1, 1);
204
dpd_contract442(&tautIjAb, &D, &FAE, 2, 2, -1, 1);
207
dpd_buf4_close(&tautIjAb);
210
/* Build the tilde intermediates */
211
dpd_file2_copy(&FAE, CC_OEI, "FAEt");
212
dpd_file2_copy(&Fae, CC_OEI, "Faet");
214
dpd_file2_close(&FAE);
215
dpd_file2_close(&Fae);
217
dpd_file2_init(&FAEt, CC_OEI, 0, 1, 1, "FAEt");
218
dpd_file2_init(&Faet, CC_OEI, 0, 1, 1, "Faet");
220
dpd_file2_init(&tIA, CC_OEI, 0, 0, 1, "tIA");
221
dpd_file2_init(&FME, CC_OEI, 0, 0, 1, "FME");
222
dpd_contract222(&tIA, &FME, &FAEt, 1, 1, -0.5, 1);
223
dpd_file2_close(&tIA);
224
dpd_file2_close(&FME);
226
dpd_file2_init(&tia, CC_OEI, 0, 0, 1, "tia");
227
dpd_file2_init(&Fme, CC_OEI, 0, 0, 1, "Fme");
228
dpd_contract222(&tia, &Fme, &Faet, 1, 1, -0.5, 1);
229
dpd_file2_close(&tia);
230
dpd_file2_close(&Fme);
232
dpd_file2_close(&FAEt);
233
dpd_file2_close(&Faet);
235
else if(params.ref == 2) { /** UHF **/
237
dpd_file2_init(&FAE, CC_OEI, 0, 1, 1, "FAE");
238
dpd_file2_init(&Fae, CC_OEI, 0, 3, 3, "Fae");
240
dpd_file2_init(&fIA, CC_OEI, 0, 0, 1, "fIA");
241
dpd_file2_init(&tIA, CC_OEI, 0, 0, 1, "tIA");
242
dpd_contract222(&tIA, &fIA, &FAE, 1, 1, -0.5, 1);
243
dpd_file2_close(&tIA);
244
dpd_file2_close(&fIA);
246
dpd_file2_init(&fia, CC_OEI, 0, 2, 3, "fia");
247
dpd_file2_init(&tia, CC_OEI, 0, 2, 3, "tia");
248
dpd_contract222(&tia, &fia, &Fae, 1, 1, -0.5, 1);
249
dpd_file2_close(&tia);
250
dpd_file2_close(&fia);
252
dpd_file2_init(&tIA, CC_OEI, 0, 0, 1, "tIA");
253
dpd_file2_init(&tia, CC_OEI, 0, 2, 3, "tia");
255
dpd_buf4_init(&F, CC_FINTS, 0, 20, 5, 20, 5, 1, "F <IA|BC>");
256
dpd_dot13(&tIA, &F, &FAE, 0, 0, 1, 1);
259
dpd_buf4_init(&F, CC_FINTS, 0, 27, 29, 27, 29, 0, "F <iA|bC>");
260
dpd_dot13(&tia, &F, &FAE, 0, 0, 1, 1);
263
dpd_buf4_init(&F, CC_FINTS, 0, 30, 15, 30, 15, 1, "F <ia|bc>");
264
dpd_dot13(&tia, &F, &Fae, 0, 0, 1, 1);
267
dpd_buf4_init(&F, CC_FINTS, 0, 24, 28, 24, 28, 0, "F <Ia|Bc>");
268
dpd_dot13(&tIA, &F, &Fae, 0, 0, 1, 1);
271
dpd_file2_close(&tIA);
272
dpd_file2_close(&tia);
274
dpd_buf4_init(&D, CC_DINTS, 0, 2, 5, 2, 5, 0, "D <IJ||AB> (I>J,AB)");
275
dpd_buf4_init(&taut, CC_TAMPS, 0, 2, 5, 2, 7, 0, "tautIJAB");
276
dpd_contract442(&taut, &D, &FAE, 2, 2, -1, 1);
277
dpd_buf4_close(&taut);
280
dpd_buf4_init(&D, CC_DINTS, 0, 22, 28, 22, 28, 0, "D <Ij|Ab>");
281
dpd_buf4_init(&taut, CC_TAMPS, 0, 22, 28, 22, 28, 0, "tautIjAb");
282
dpd_contract442(&taut, &D, &FAE, 2, 2, -1, 1);
283
dpd_buf4_close(&taut);
286
dpd_buf4_init(&D, CC_DINTS, 0, 12, 15, 12, 15, 0, "D <ij||ab> (i>j,ab)");
287
dpd_buf4_init(&taut, CC_TAMPS, 0, 12, 15, 12, 17, 0, "tautijab");
288
dpd_contract442(&taut, &D, &Fae, 2, 2, -1, 1);
289
dpd_buf4_close(&taut);
292
dpd_buf4_init(&D, CC_DINTS, 0, 22, 28, 22, 28, 0, "D <Ij|Ab>");
293
dpd_buf4_init(&taut, CC_TAMPS, 0, 22, 28, 22, 28, 0, "tautIjAb");
294
dpd_contract442(&taut, &D, &Fae, 3, 3, -1, 1);
295
dpd_buf4_close(&taut);
298
/* Build the tilde intermediates */
299
dpd_file2_copy(&FAE, CC_OEI, "FAEt");
300
dpd_file2_copy(&Fae, CC_OEI, "Faet");
302
dpd_file2_close(&FAE);
303
dpd_file2_close(&Fae);
305
dpd_file2_init(&FAEt, CC_OEI, 0, 1, 1, "FAEt");
306
dpd_file2_init(&Faet, CC_OEI, 0, 3, 3, "Faet");
308
dpd_file2_init(&tIA, CC_OEI, 0, 0, 1, "tIA");
309
dpd_file2_init(&FME, CC_OEI, 0, 0, 1, "FME");
310
dpd_contract222(&tIA, &FME, &FAEt, 1, 1, -0.5, 1);
311
dpd_file2_close(&tIA);
312
dpd_file2_close(&FME);
314
dpd_file2_init(&tia, CC_OEI, 0, 2, 3, "tia");
315
dpd_file2_init(&Fme, CC_OEI, 0, 2, 3, "Fme");
316
dpd_contract222(&tia, &Fme, &Faet, 1, 1, -0.5, 1);
317
dpd_file2_close(&tia);
318
dpd_file2_close(&Fme);
321
dpd_file2_close(&FAEt);
322
dpd_file2_close(&Faet);