3
#include <libdpd/dpd.h>
9
dpdfile2 fme, fME, Fae, FAE, fAE, tIA, tia;
10
dpdbuf4 tIjAb, tIJAB, tijab, t2;
11
dpdbuf4 newtIjAb, newtIJAB, newtijab;
14
if(params.ref == 0) { /** RHF **/
15
dpd_file2_init(&fAE, CC_OEI, 0, 1, 1, "fAB");
17
dpd_buf4_init(&Zijab, CC_TMP0, 0, 0, 5, 0, 5, 0, "CC2 ZIjAb");
18
dpd_buf4_init(&tIjAb, CC_TAMPS, 0, 0, 5, 0, 5, 0, "tIjAb");
19
dpd_contract424(&tIjAb, &fAE, &Zijab, 3, 1, 0, 1, 0);
20
dpd_buf4_close(&tIjAb);
21
dpd_buf4_init(&newtIjAb, CC_TAMPS, 0, 0, 5, 0, 5, 0, "New tIjAb");
22
dpd_buf4_axpy(&Zijab, &newtIjAb, 1);
23
dpd_buf4_close(&newtIjAb);
24
dpd_buf4_sort_axpy(&Zijab, CC_TAMPS, qpsr, 0, 5, "New tIjAb", 1);
25
dpd_buf4_close(&Zijab);
27
dpd_file2_close(&fAE);
29
else if(params.ref == 1) { /** ROHF **/
31
dpd_file2_init(&tIA, CC_OEI, 0, 0, 1, "tIA");
32
dpd_file2_init(&fME, CC_OEI, 0, 0, 1, "fIA");
33
dpd_file2_init(&FAE, CC2_HET1, 0, 1, 1, "CC2 FAE");
34
dpd_contract222(&tIA, &fME, &FAE, 1, 1, -1, 0);
35
dpd_file2_close(&FAE);
36
dpd_file2_close(&fME);
37
dpd_file2_close(&tIA);
39
dpd_file2_init(&tia, CC_OEI, 0, 0, 1, "tia");
40
dpd_file2_init(&fme, CC_OEI, 0, 0, 1, "fia");
41
dpd_file2_init(&Fae, CC2_HET1, 0, 1, 1, "CC2 Fae");
42
dpd_contract222(&tia, &fme, &Fae, 1, 1, -1, 0);
43
dpd_file2_close(&Fae);
44
dpd_file2_close(&fme);
45
dpd_file2_close(&tia);
48
dpd_file2_init(&FAE, CC2_HET1, 0, 1, 1, "CC2 FAE");
49
dpd_file2_init(&Fae, CC2_HET1, 0, 1, 1, "CC2 Fae");
52
dpd_buf4_init(&tIJAB, CC_TAMPS, 0, 2, 5, 2, 7, 0, "tIJAB");
53
dpd_buf4_init(&t2, CC_TMP0, 0, 2, 5, 2, 5, 0, "T (I>J,AB)");
54
dpd_contract424(&tIJAB, &FAE, &t2, 3, 1, 0, 1, 0);
55
dpd_contract244(&FAE, &tIJAB, &t2, 1, 2, 1, 1, 1);
56
dpd_buf4_init(&newtIJAB, CC_TAMPS, 0, 2, 5, 2, 7, 0, "New tIJAB");
57
dpd_buf4_axpy(&t2, &newtIJAB, 1);
58
dpd_buf4_close(&newtIJAB);
60
dpd_buf4_close(&tIJAB);
63
dpd_buf4_init(&tijab, CC_TAMPS, 0, 2, 5, 2, 7, 0, "tijab");
64
dpd_buf4_init(&t2, CC_TMP0, 0, 2, 5, 2, 5, 0, "T (I>J,AB)");
65
dpd_contract424(&tijab, &Fae, &t2, 3, 1, 0, 1, 0);
66
dpd_contract244(&Fae, &tijab, &t2, 1, 2, 1, 1, 1);
67
dpd_buf4_init(&newtijab, CC_TAMPS, 0, 2, 5, 2, 7, 0, "New tijab");
68
dpd_buf4_axpy(&t2, &newtijab, 1);
69
dpd_buf4_close(&newtijab);
71
dpd_buf4_close(&tijab);
74
dpd_buf4_init(&tIjAb, CC_TAMPS, 0, 0, 5, 0, 5, 0, "tIjAb");
75
dpd_buf4_init(&newtIjAb, CC_TAMPS, 0, 0, 5, 0, 5, 0, "New tIjAb");
76
dpd_contract424(&tIjAb, &Fae, &newtIjAb, 3, 1, 0, 1, 1);
77
dpd_contract244(&FAE, &tIjAb, &newtIjAb, 1, 2, 1, 1, 1);
78
dpd_buf4_close(&newtIjAb);
79
dpd_buf4_close(&tIjAb);
81
dpd_file2_close(&FAE);
82
dpd_file2_close(&Fae);
84
else if(params.ref == 2) { /** UHF **/
86
dpd_file2_init(&tIA, CC_OEI, 0, 0, 1, "tIA");
87
dpd_file2_init(&fME, CC_OEI, 0, 0, 1, "fIA");
88
dpd_file2_init(&FAE, CC2_HET1, 0, 1, 1, "CC2 FAE");
89
dpd_contract222(&tIA, &fME, &FAE, 1, 1, -1, 0);
90
dpd_file2_close(&FAE);
91
dpd_file2_close(&fME);
92
dpd_file2_close(&tIA);
94
dpd_file2_init(&tia, CC_OEI, 0, 2, 3, "tia");
95
dpd_file2_init(&fme, CC_OEI, 0, 2, 3, "fia");
96
dpd_file2_init(&Fae, CC2_HET1, 0, 3, 3, "CC2 Fae");
97
dpd_contract222(&tia, &fme, &Fae, 1, 1, -1, 0);
98
dpd_file2_close(&Fae);
99
dpd_file2_close(&fme);
100
dpd_file2_close(&tia);
103
dpd_file2_init(&FAE, CC2_HET1, 0, 1, 1, "CC2 FAE");
104
dpd_file2_init(&Fae, CC2_HET1, 0, 3, 3, "CC2 Fae");
107
dpd_buf4_init(&tIJAB, CC_TAMPS, 0, 2, 5, 2, 7, 0, "tIJAB");
108
dpd_buf4_init(&t2, CC_TMP0, 0, 2, 5, 2, 5, 0, "T (I>J,AB)");
109
dpd_contract424(&tIJAB, &FAE, &t2, 3, 1, 0, 1, 0);
110
dpd_contract244(&FAE, &tIJAB, &t2, 1, 2, 1, 1, 1);
111
dpd_buf4_close(&tIJAB);
112
dpd_buf4_init(&newtIJAB, CC_TAMPS, 0, 2, 5, 2, 7, 0, "New tIJAB");
113
dpd_buf4_axpy(&t2, &newtIJAB, 1);
114
dpd_buf4_close(&newtIJAB);
118
dpd_buf4_init(&tijab, CC_TAMPS, 0, 12, 15, 12, 17, 0, "tijab");
119
dpd_buf4_init(&t2, CC_TMP0, 0, 12, 15, 12, 15, 0, "T (i>j,ab)");
120
dpd_contract424(&tijab, &Fae, &t2, 3, 1, 0, 1, 0);
121
dpd_contract244(&Fae, &tijab, &t2, 1, 2, 1, 1, 1);
122
dpd_buf4_close(&tijab);
123
dpd_buf4_init(&newtijab, CC_TAMPS, 0, 12, 15, 12, 17, 0, "New tijab");
124
dpd_buf4_axpy(&t2, &newtijab, 1);
125
dpd_buf4_close(&newtijab);
129
dpd_buf4_init(&tIjAb, CC_TAMPS, 0, 22, 28, 22, 28, 0, "tIjAb");
130
dpd_buf4_init(&newtIjAb, CC_TAMPS, 0, 22, 28, 22, 28, 0, "New tIjAb");
131
dpd_contract424(&tIjAb, &Fae, &newtIjAb, 3, 1, 0, 1, 1);
132
dpd_contract244(&FAE, &tIjAb, &newtIjAb, 1, 2, 1, 1, 1);
133
dpd_buf4_close(&newtIjAb);
134
dpd_buf4_close(&tIjAb);
136
dpd_file2_close(&FAE);
137
dpd_file2_close(&Fae);