3
#include <libdpd/dpd.h>
8
void local_filter_T1(dpdfile2 *T1);
12
dpdfile2 newtIA, newtia, tIA, tia, fIA, fia;
13
dpdfile2 FAE, Fae, FMI, Fmi, FME, Fme;
15
dpdbuf4 tIJAB, tijab, tIjAb, tiJaB;
16
dpdbuf4 C, C_anti, D, F_anti, F, E_anti, E, Z;
18
if(params.ref == 0) { /** RHF **/
19
dpd_file2_init(&fIA, CC_OEI, 0, 0, 1, "fIA");
20
dpd_file2_copy(&fIA, CC_OEI, "New tIA");
21
dpd_file2_close(&fIA);
23
dpd_file2_init(&newtIA, CC_OEI, 0, 0, 1, "New tIA");
25
dpd_file2_init(&tIA, CC_OEI, 0, 0, 1, "tIA");
27
dpd_file2_init(&FAE, CC_OEI, 0, 1, 1, "FAE");
28
dpd_contract222(&tIA, &FAE, &newtIA, 0, 0, 1, 1);
29
dpd_file2_close(&FAE);
31
dpd_file2_init(&FMI, CC_OEI, 0, 0, 0, "FMI");
32
dpd_contract222(&FMI, &tIA, &newtIA, 1, 1, -1, 1);
33
dpd_file2_close(&FMI);
35
dpd_file2_close(&tIA);
37
dpd_file2_init(&FME, CC_OEI, 0, 0, 1, "FME");
39
dpd_buf4_init(&tIjAb, CC_TAMPS, 0, 10, 10, 10, 10, 0, "2 tIAjb - tIBja");
40
dpd_contract422(&tIjAb, &FME, &newtIA, 0, 0, 1, 1);
41
dpd_buf4_close(&tIjAb);
43
dpd_file2_close(&FME);
45
dpd_buf4_init(&C_anti, CC_CINTS, 0, 10, 10, 10, 10, 0, "C <ia||jb>");
46
dpd_buf4_init(&D, CC_DINTS, 0, 0, 5, 0, 5, 0, "D <ij|ab>");
48
dpd_file2_init(&tIA, CC_OEI, 0, 0, 1, "tIA");
50
dpd_dot14(&tIA, &C_anti, &newtIA, 0, 1, -1, 1);
51
dpd_dot13(&tIA, &D, &newtIA, 0, 0, 1, 1);
53
dpd_file2_close(&tIA);
55
dpd_buf4_close(&C_anti);
58
dpd_buf4_init(&Z, CC_TMP0, 0, 10, 0, 10, 0, 0, "Z(ma,mi)");
59
dpd_buf4_init(&F, CC_FINTS, 0, 10, 5, 10, 5, 0, "F 2<ia|bc> - <ia|cb>");
60
dpd_buf4_init(&tIjAb, CC_TAMPS, 0, 0, 5, 0, 5, 0, "tIjAb");
61
dpd_contract444(&F, &tIjAb, &Z, 0, 0, 1.0, 0.0);
62
dpd_buf4_close(&tIjAb);
64
dpd_trace42_13(&Z, &newtIA, 1, 1.0, 1.0);
67
dpd_buf4_init(&E, CC_EINTS, 0, 11, 0, 11, 0, 0, "E 2<ai|jk> - <ai|kj>");
68
dpd_buf4_init(&tIjAb, CC_TAMPS, 0, 0, 5, 0, 5, 0, "tIjAb");
69
dpd_contract442(&E, &tIjAb, &newtIA, 1, 3, -1, 1);
71
dpd_buf4_close(&tIjAb);
73
dpd_file2_copy(&newtIA, CC_OEI, "New tIA Increment");
74
dpd_file2_close(&newtIA);
76
dpd_file2_init(&newtIA, CC_OEI, 0, 0, 1, "New tIA Increment");
77
if(params.local && local.filter_singles) {
78
local_filter_T1(&newtIA);
81
dpd_file2_init(&dIA, CC_OEI, 0, 0, 1, "dIA");
82
dpd_file2_dirprd(&dIA, &newtIA);
83
dpd_file2_close(&dIA);
85
dpd_file2_close(&newtIA);
87
/* Add the new increment to the old tIA to get the New tIA */
88
dpd_file2_init(&tIA, CC_OEI, 0, 0, 1, "tIA");
89
dpd_file2_copy(&tIA, CC_OEI, "New tIA");
90
dpd_file2_close(&tIA);
91
dpd_file2_init(&newtIA, CC_OEI, 0, 0, 1, "New tIA");
92
dpd_file2_init(&tIA, CC_OEI, 0, 0, 1, "New tIA Increment");
93
dpd_file2_axpy(&tIA, &newtIA, 1, 0);
94
dpd_file2_close(&tIA);
95
dpd_file2_close(&newtIA);
97
else if(params.ref == 1) { /** ROHF **/
99
dpd_file2_init(&fIA, CC_OEI, 0, 0, 1, "fIA");
100
dpd_file2_copy(&fIA, CC_OEI, "New tIA");
101
dpd_file2_close(&fIA);
103
dpd_file2_init(&fia, CC_OEI, 0, 0, 1, "fia");
104
dpd_file2_copy(&fia, CC_OEI, "New tia");
105
dpd_file2_close(&fia);
107
dpd_file2_init(&newtIA, CC_OEI, 0, 0, 1, "New tIA");
108
dpd_file2_init(&newtia, CC_OEI, 0, 0, 1, "New tia");
111
dpd_file2_init(&tIA, CC_OEI, 0, 0, 1, "tIA");
112
dpd_file2_init(&tia, CC_OEI, 0, 0, 1, "tia");
114
dpd_file2_init(&FAE, CC_OEI, 0, 1, 1, "FAE");
115
dpd_file2_init(&Fae, CC_OEI, 0, 1, 1, "Fae");
117
dpd_contract222(&tIA, &FAE, &newtIA, 0, 0, 1, 1);
118
dpd_contract222(&tia, &Fae, &newtia, 0, 0, 1, 1);
120
dpd_file2_close(&FAE); dpd_file2_close(&Fae);
122
dpd_file2_close(&tIA); dpd_file2_close(&tia);
124
dpd_file2_init(&tIA, CC_OEI, 0, 0, 1, "tIA");
125
dpd_file2_init(&tia, CC_OEI, 0, 0, 1, "tia");
127
dpd_file2_init(&FMI, CC_OEI, 0, 0, 0, "FMI");
128
dpd_file2_init(&Fmi, CC_OEI, 0, 0, 0, "Fmi");
130
dpd_contract222(&FMI, &tIA, &newtIA, 1, 1, -1, 1);
131
dpd_contract222(&Fmi, &tia, &newtia, 1, 1, -1, 1);
133
dpd_file2_close(&FMI); dpd_file2_close(&Fmi);
134
dpd_file2_close(&tIA); dpd_file2_close(&tia);
136
dpd_file2_init(&FME, CC_OEI, 0, 0, 1, "FME");
137
dpd_file2_init(&Fme, CC_OEI, 0, 0, 1, "Fme");
139
dpd_buf4_init(&tIJAB, CC_TAMPS, 0, 0, 5, 2, 7, 0, "tIJAB");
140
dpd_buf4_init(&tijab, CC_TAMPS, 0, 0, 5, 2, 7, 0, "tijab");
142
dpd_dot13(&FME, &tIJAB, &newtIA, 0, 0, 1, 1);
143
dpd_dot13(&Fme, &tijab, &newtia, 0, 0, 1, 1);
145
dpd_buf4_close(&tIJAB);
146
dpd_buf4_close(&tijab);
148
dpd_buf4_init(&tIjAb, CC_TAMPS, 0, 0, 5, 0, 5, 0, "tIjAb");
150
dpd_dot24(&Fme, &tIjAb, &newtIA, 0, 0, 1, 1);
151
dpd_dot13(&FME, &tIjAb, &newtia, 0, 0, 1, 1);
153
dpd_buf4_close(&tIjAb);
155
dpd_file2_close(&FME);
156
dpd_file2_close(&Fme);
158
dpd_buf4_init(&C_anti, CC_CINTS, 0, 10, 10, 10, 10, 0,
160
dpd_buf4_init(&D, CC_DINTS, 0, 0, 5, 0, 5, 0, "D <ij|ab>");
162
dpd_file2_init(&tIA, CC_OEI, 0, 0, 1, "tIA");
163
dpd_file2_init(&tia, CC_OEI, 0, 0, 1, "tia");
165
dpd_dot14(&tIA, &C_anti, &newtIA, 0, 1, -1, 1);
166
dpd_dot13(&tia, &D, &newtIA, 0, 0, 1, 1);
168
dpd_dot14(&tia, &C_anti, &newtia, 0, 1, -1, 1);
169
dpd_dot13(&tIA, &D, &newtia, 0, 0, 1, 1);
171
dpd_file2_close(&tIA);
172
dpd_file2_close(&tia);
174
dpd_buf4_close(&C_anti);
177
dpd_buf4_init(&F_anti, CC_FINTS, 0, 10, 7, 10, 5, 1, "F <ia|bc>");
178
dpd_buf4_init(&tIJAB, CC_TAMPS, 0, 0, 7, 2, 7, 0, "tIJAB");
179
dpd_buf4_init(&tijab, CC_TAMPS, 0, 0, 7, 2, 7, 0, "tijab");
181
dpd_contract442(&tIJAB, &F_anti, &newtIA, 1, 1, 1, 1);
182
dpd_contract442(&tijab, &F_anti, &newtia, 1, 1, 1, 1);
184
dpd_buf4_close(&tIJAB);
185
dpd_buf4_close(&tijab);
186
dpd_buf4_close(&F_anti);
188
dpd_buf4_init(&F, CC_FINTS, 0, 10, 5, 10, 5, 0, "F <ia|bc>");
189
dpd_buf4_init(&tIjAb, CC_TAMPS, 0, 0, 5, 0, 5, 0, "tIjAb");
190
dpd_buf4_init(&tiJaB, CC_TAMPS, 0, 0, 5, 0, 5, 0, "tiJaB");
192
dpd_contract442(&tiJaB, &F, &newtIA, 1, 1, 1, 1);
193
dpd_contract442(&tIjAb, &F, &newtia, 1, 1, 1, 1);
196
dpd_buf4_close(&tIjAb);
197
dpd_buf4_close(&tiJaB);
199
dpd_buf4_init(&E_anti, CC_EINTS, 0, 11, 2, 11, 0, 1, "E <ai|jk>");
200
dpd_buf4_init(&tIJAB, CC_TAMPS, 0, 2, 5, 2, 7, 0, "tIJAB");
201
dpd_buf4_init(&tijab, CC_TAMPS, 0, 2, 5, 2, 7, 0, "tijab");
203
dpd_contract442(&E_anti, &tIJAB, &newtIA, 1, 3, -1, 1);
204
dpd_contract442(&E_anti, &tijab, &newtia, 1, 3, -1, 1);
206
dpd_buf4_close(&E_anti);
207
dpd_buf4_close(&tIJAB);
208
dpd_buf4_close(&tijab);
210
dpd_buf4_init(&E, CC_EINTS, 0, 11, 0, 11, 0, 0, "E <ai|jk>");
211
dpd_buf4_init(&tIjAb, CC_TAMPS, 0, 0, 5, 0, 5, 0, "tIjAb");
212
dpd_buf4_init(&tiJaB, CC_TAMPS, 0, 0, 5, 0, 5, 0, "tiJaB");
214
dpd_contract442(&E, &tiJaB, &newtIA, 1, 3, -1, 1);
215
dpd_contract442(&E, &tIjAb, &newtia, 1, 3, -1, 1);
218
dpd_buf4_close(&tIjAb);
219
dpd_buf4_close(&tiJaB);
221
dpd_file2_init(&dIA, CC_OEI, 0, 0, 1, "dIA");
222
dpd_file2_dirprd(&dIA, &newtIA);
223
dpd_file2_close(&dIA);
225
dpd_file2_init(&dia, CC_OEI, 0, 0, 1, "dia");
226
dpd_file2_dirprd(&dia, &newtia);
227
dpd_file2_close(&dia);
229
dpd_file2_close(&newtIA); dpd_file2_close(&newtia);
231
else if(params.ref == 2) { /*** UHF ***/
233
dpd_file2_init(&fIA, CC_OEI, 0, 0, 1, "fIA");
234
dpd_file2_copy(&fIA, CC_OEI, "New tIA");
235
dpd_file2_close(&fIA);
237
dpd_file2_init(&fia, CC_OEI, 0, 2, 3, "fia");
238
dpd_file2_copy(&fia, CC_OEI, "New tia");
239
dpd_file2_close(&fia);
241
dpd_file2_init(&newtIA, CC_OEI, 0, 0, 1, "New tIA");
242
dpd_file2_init(&newtia, CC_OEI, 0, 2, 3, "New tia");
244
dpd_file2_init(&tIA, CC_OEI, 0, 0, 1, "tIA");
245
dpd_file2_init(&tia, CC_OEI, 0, 2, 3, "tia");
247
dpd_file2_init(&FAE, CC_OEI, 0, 1, 1, "FAE");
248
dpd_contract222(&tIA, &FAE, &newtIA, 0, 0, 1, 1);
249
dpd_file2_close(&FAE);
251
dpd_file2_init(&Fae, CC_OEI, 0, 3, 3, "Fae");
252
dpd_contract222(&tia, &Fae, &newtia, 0, 0, 1, 1);
253
dpd_file2_close(&Fae);
255
dpd_file2_init(&FMI, CC_OEI, 0, 0, 0, "FMI");
256
dpd_contract222(&FMI, &tIA, &newtIA, 1, 1, -1, 1);
257
dpd_file2_close(&FMI);
259
dpd_file2_init(&Fmi, CC_OEI, 0, 2, 2, "Fmi");
260
dpd_contract222(&Fmi, &tia, &newtia, 1, 1, -1, 1);
261
dpd_file2_close(&Fmi);
263
dpd_file2_close(&tIA);
264
dpd_file2_close(&tia);
266
dpd_file2_init(&FME, CC_OEI, 0, 0, 1, "FME");
267
dpd_file2_init(&Fme, CC_OEI, 0, 2, 3, "Fme");
270
dpd_buf4_init(&tIJAB, CC_TAMPS, 0, 0, 5, 2, 7, 0, "tIJAB");
271
dpd_dot13(&FME, &tIJAB, &newtIA, 0, 0, 1, 1);
272
dpd_buf4_close(&tIJAB);
274
dpd_buf4_init(&tijab, CC_TAMPS, 0, 10, 15, 12, 17, 0, "tijab");
275
dpd_dot13(&Fme, &tijab, &newtia, 0, 0, 1, 1);
276
dpd_buf4_close(&tijab);
278
dpd_buf4_init(&tIjAb, CC_TAMPS, 0, 22, 28, 22, 28, 0, "tIjAb");
279
dpd_dot24(&Fme, &tIjAb, &newtIA, 0, 0, 1, 1);
280
dpd_dot13(&FME, &tIjAb, &newtia, 0, 0, 1, 1);
281
dpd_buf4_close(&tIjAb);
283
dpd_file2_close(&FME);
284
dpd_file2_close(&Fme);
288
dpd_file2_init(&tIA, CC_OEI, 0, 0, 1, "tIA");
289
dpd_file2_init(&tia, CC_OEI, 0, 2, 3, "tia");
291
dpd_buf4_init(&C, CC_CINTS, 0, 20, 20, 20, 20, 0, "C <IA||JB>");
292
dpd_dot14(&tIA, &C, &newtIA, 0, 1, -1, 1);
295
dpd_buf4_init(&C, CC_CINTS, 0, 30, 30, 30, 30, 0, "C <ia||jb>");
296
dpd_dot14(&tia, &C, &newtia, 0, 1, -1, 1);
299
dpd_buf4_init(&D, CC_DINTS, 0, 23, 29, 23, 29, 0, "D <iJ|aB>");
300
dpd_dot13(&tia, &D, &newtIA, 0, 0, 1, 1);
303
dpd_buf4_init(&D, CC_DINTS, 0, 22, 28, 22, 28, 0, "D <Ij|Ab>");
304
dpd_dot13(&tIA, &D, &newtia, 0, 0, 1, 1);
307
dpd_file2_close(&tIA);
308
dpd_file2_close(&tia);
311
dpd_buf4_init(&F, CC_FINTS, 0, 20, 7, 20, 5, 1, "F <IA|BC>");
312
dpd_buf4_init(&tIJAB, CC_TAMPS, 0, 0, 7, 2, 7, 0, "tIJAB");
313
dpd_contract442(&tIJAB, &F, &newtIA, 1, 1, 1, 1);
314
dpd_buf4_close(&tIJAB);
317
dpd_buf4_init(&F, CC_FINTS, 0, 30, 17, 30, 15, 1, "F <ia|bc>");
318
dpd_buf4_init(&tijab, CC_TAMPS, 0, 10, 17, 12, 17, 0, "tijab");
319
dpd_contract442(&tijab, &F, &newtia, 1, 1, 1, 1);
320
dpd_buf4_close(&tijab);
323
dpd_buf4_init(&F, CC_FINTS, 0, 28, 26, 28, 26, 0, "F <Ab|Ci>");
324
dpd_buf4_init(&tIjAb, CC_TAMPS, 0, 22, 28, 22, 28, 0, "tIjAb");
325
dpd_contract442(&tIjAb, &F, &newtIA, 0, 2, 1, 1);
326
dpd_buf4_close(&tIjAb);
329
dpd_buf4_init(&F, CC_FINTS, 0, 24, 28, 24, 28, 0, "F <Ia|Bc>");
330
dpd_buf4_init(&tIjAb, CC_TAMPS, 0, 22, 28, 22, 28, 0, "tIjAb");
331
dpd_contract442(&tIjAb, &F, &newtia, 1, 1, 1, 1);
332
dpd_buf4_close(&tIjAb);
337
dpd_buf4_init(&E, CC_EINTS, 0, 21, 2, 21, 0, 1, "E <AI|JK>");
338
dpd_buf4_init(&tIJAB, CC_TAMPS, 0, 2, 5, 2, 7, 0, "tIJAB");
339
dpd_contract442(&E, &tIJAB, &newtIA, 1, 3, -1, 1);
342
dpd_buf4_init(&E, CC_EINTS, 0, 31, 12, 31, 10, 1, "E <ai|jk>");
343
dpd_buf4_init(&tijab, CC_TAMPS, 0, 12, 15, 12, 17, 0, "tijab");
344
dpd_contract442(&E, &tijab, &newtia, 1, 3, -1, 1);
347
dpd_buf4_init(&E, CC_EINTS, 0, 22, 24, 22, 24, 0, "E <Ij|Ka>");
348
dpd_buf4_init(&tIjAb, CC_TAMPS, 0, 22, 28, 22, 28, 0, "tIjAb");
349
dpd_contract442(&E, &tIjAb, &newtIA, 2, 2, -1, 1);
351
dpd_buf4_close(&tIjAb);
353
dpd_buf4_init(&E, CC_EINTS, 0, 23, 27, 23, 27, 0, "E <iJ|kA>");
354
dpd_buf4_init(&tIjAb, CC_TAMPS, 0, 23, 29, 23, 29, 0, "tiJaB");
355
dpd_contract442(&E, &tIjAb, &newtia, 2, 2, -1, 1);
357
dpd_buf4_close(&tIjAb);
360
dpd_file2_init(&dIA, CC_OEI, 0, 0, 1, "dIA");
361
dpd_file2_dirprd(&dIA, &newtIA);
362
dpd_file2_close(&dIA);
364
dpd_file2_init(&dia, CC_OEI, 0, 2, 3, "dia");
365
dpd_file2_dirprd(&dia, &newtia);
366
dpd_file2_close(&dia);
368
dpd_file2_close(&newtIA);
369
dpd_file2_close(&newtia);