3
\brief Enter brief description of file here
8
#include <libipv1/ip_lib.h>
9
#include <libdpd/dpd.h>
16
namespace psi { namespace ccenergy {
20
int row,col,h,nirreps;
25
nirreps = moinfo.nirreps;
27
if(params.ref == 0) { /** RHF **/
29
dpd_file2_init(&T1, CC_OEI, 0, 0, 1, "New tIA");
30
dpd_file2_mat_init(&T1);
31
dpd_file2_mat_rd(&T1);
32
dpd_file2_init(&T1old, CC_OEI, 0, 0, 1, "tIA");
33
dpd_file2_mat_init(&T1old);
34
dpd_file2_mat_rd(&T1old);
35
for(h=0; h < nirreps; h++)
36
for(row=0; row < T1.params->rowtot[h]; row++)
37
for(col=0; col < T1.params->coltot[h]; col++)
38
rms += (T1.matrix[h][row][col] - T1old.matrix[h][row][col]) *
39
(T1.matrix[h][row][col] - T1old.matrix[h][row][col]);
41
dpd_file2_mat_close(&T1);
43
dpd_file2_mat_close(&T1old);
44
dpd_file2_close(&T1old);
46
dpd_buf4_init(&T2, CC_TAMPS, 0, 0, 5, 0, 5, 0, "New tIjAb");
47
dpd_buf4_init(&T2old, CC_TAMPS, 0, 0, 5, 0, 5, 0, "tIjAb");
48
for(h=0; h < nirreps; h++) {
49
dpd_buf4_mat_irrep_init(&T2, h);
50
dpd_buf4_mat_irrep_rd(&T2, h);
51
dpd_buf4_mat_irrep_init(&T2old, h);
52
dpd_buf4_mat_irrep_rd(&T2old, h);
53
for(row=0; row < T2.params->rowtot[h]; row++)
54
for(col=0; col < T2.params->coltot[h]; col++)
55
rms += (T2.matrix[h][row][col] - T2old.matrix[h][row][col]) *
56
(T2.matrix[h][row][col] - T2old.matrix[h][row][col]);
57
dpd_buf4_mat_irrep_close(&T2, h);
58
dpd_buf4_mat_irrep_close(&T2old, h);
60
dpd_buf4_close(&T2old);
64
else if(params.ref == 1) { /** ROHF **/
66
dpd_file2_init(&T1, CC_OEI, 0, 0, 1, "New tIA");
67
dpd_file2_mat_init(&T1);
68
dpd_file2_mat_rd(&T1);
69
dpd_file2_init(&T1old, CC_OEI, 0, 0, 1, "tIA");
70
dpd_file2_mat_init(&T1old);
71
dpd_file2_mat_rd(&T1old);
72
for(h=0; h < nirreps; h++)
73
for(row=0; row < T1.params->rowtot[h]; row++)
74
for(col=0; col < T1.params->coltot[h]; col++)
75
rms += (T1.matrix[h][row][col] - T1old.matrix[h][row][col]) *
76
(T1.matrix[h][row][col] - T1old.matrix[h][row][col]);
78
dpd_file2_mat_close(&T1);
80
dpd_file2_mat_close(&T1old);
81
dpd_file2_close(&T1old);
83
dpd_file2_init(&T1, CC_OEI, 0, 0, 1, "New tia");
84
dpd_file2_mat_init(&T1);
85
dpd_file2_mat_rd(&T1);
86
dpd_file2_init(&T1old, CC_OEI, 0, 0, 1, "tia");
87
dpd_file2_mat_init(&T1old);
88
dpd_file2_mat_rd(&T1old);
89
for(h=0; h < nirreps; h++)
90
for(row=0; row < T1.params->rowtot[h]; row++)
91
for(col=0; col < T1.params->coltot[h]; col++)
92
rms += (T1.matrix[h][row][col] - T1old.matrix[h][row][col]) *
93
(T1.matrix[h][row][col] - T1old.matrix[h][row][col]);
95
dpd_file2_mat_close(&T1);
97
dpd_file2_mat_close(&T1old);
98
dpd_file2_close(&T1old);
100
dpd_buf4_init(&T2, CC_TAMPS, 0, 2, 7, 2, 7, 0, "New tIJAB");
101
dpd_buf4_init(&T2old, CC_TAMPS, 0, 2, 7, 2, 7, 0, "tIJAB");
102
for(h=0; h < nirreps; h++) {
103
dpd_buf4_mat_irrep_init(&T2, h);
104
dpd_buf4_mat_irrep_rd(&T2, h);
105
dpd_buf4_mat_irrep_init(&T2old, h);
106
dpd_buf4_mat_irrep_rd(&T2old, h);
107
for(row=0; row < T2.params->rowtot[h]; row++)
108
for(col=0; col < T2.params->coltot[h]; col++)
109
rms += (T2.matrix[h][row][col] - T2old.matrix[h][row][col]) *
110
(T2.matrix[h][row][col] - T2old.matrix[h][row][col]);
111
dpd_buf4_mat_irrep_close(&T2, h);
112
dpd_buf4_mat_irrep_close(&T2old, h);
114
dpd_buf4_close(&T2old);
117
dpd_buf4_init(&T2, CC_TAMPS, 0, 2, 7, 2, 7, 0, "New tijab");
118
dpd_buf4_init(&T2old, CC_TAMPS, 0, 2, 7, 2, 7, 0, "tijab");
119
for(h=0; h < nirreps; h++) {
120
dpd_buf4_mat_irrep_init(&T2, h);
121
dpd_buf4_mat_irrep_rd(&T2, h);
122
dpd_buf4_mat_irrep_init(&T2old, h);
123
dpd_buf4_mat_irrep_rd(&T2old, h);
124
for(row=0; row < T2.params->rowtot[h]; row++)
125
for(col=0; col < T2.params->coltot[h]; col++)
126
rms += (T2.matrix[h][row][col] - T2old.matrix[h][row][col]) *
127
(T2.matrix[h][row][col] - T2old.matrix[h][row][col]);
128
dpd_buf4_mat_irrep_close(&T2, h);
129
dpd_buf4_mat_irrep_close(&T2old, h);
131
dpd_buf4_close(&T2old);
134
dpd_buf4_init(&T2, CC_TAMPS, 0, 0, 5, 0, 5, 0, "New tIjAb");
135
dpd_buf4_init(&T2old, CC_TAMPS, 0, 0, 5, 0, 5, 0, "tIjAb");
136
for(h=0; h < nirreps; h++) {
137
dpd_buf4_mat_irrep_init(&T2, h);
138
dpd_buf4_mat_irrep_rd(&T2, h);
139
dpd_buf4_mat_irrep_init(&T2old, h);
140
dpd_buf4_mat_irrep_rd(&T2old, h);
141
for(row=0; row < T2.params->rowtot[h]; row++)
142
for(col=0; col < T2.params->coltot[h]; col++)
143
rms += (T2.matrix[h][row][col] - T2old.matrix[h][row][col]) *
144
(T2.matrix[h][row][col] - T2old.matrix[h][row][col]);
145
dpd_buf4_mat_irrep_close(&T2, h);
146
dpd_buf4_mat_irrep_close(&T2old, h);
148
dpd_buf4_close(&T2old);
151
else if(params.ref == 2) { /** UHF **/
153
dpd_file2_init(&T1, CC_OEI, 0, 0, 1, "New tIA");
154
dpd_file2_mat_init(&T1);
155
dpd_file2_mat_rd(&T1);
156
dpd_file2_init(&T1old, CC_OEI, 0, 0, 1, "tIA");
157
dpd_file2_mat_init(&T1old);
158
dpd_file2_mat_rd(&T1old);
159
for(h=0; h < nirreps; h++)
160
for(row=0; row < T1.params->rowtot[h]; row++)
161
for(col=0; col < T1.params->coltot[h]; col++)
162
rms += (T1.matrix[h][row][col] - T1old.matrix[h][row][col]) *
163
(T1.matrix[h][row][col] - T1old.matrix[h][row][col]);
165
dpd_file2_mat_close(&T1);
166
dpd_file2_close(&T1);
167
dpd_file2_mat_close(&T1old);
168
dpd_file2_close(&T1old);
170
dpd_file2_init(&T1, CC_OEI, 0, 2, 3, "New tia");
171
dpd_file2_mat_init(&T1);
172
dpd_file2_mat_rd(&T1);
173
dpd_file2_init(&T1old, CC_OEI, 0, 2, 3, "tia");
174
dpd_file2_mat_init(&T1old);
175
dpd_file2_mat_rd(&T1old);
176
for(h=0; h < nirreps; h++)
177
for(row=0; row < T1.params->rowtot[h]; row++)
178
for(col=0; col < T1.params->coltot[h]; col++)
179
rms += (T1.matrix[h][row][col] - T1old.matrix[h][row][col]) *
180
(T1.matrix[h][row][col] - T1old.matrix[h][row][col]);
182
dpd_file2_mat_close(&T1);
183
dpd_file2_close(&T1);
184
dpd_file2_mat_close(&T1old);
185
dpd_file2_close(&T1old);
187
dpd_buf4_init(&T2, CC_TAMPS, 0, 2, 7, 2, 7, 0, "New tIJAB");
188
dpd_buf4_init(&T2old, CC_TAMPS, 0, 2, 7, 2, 7, 0, "tIJAB");
189
for(h=0; h < nirreps; h++) {
190
dpd_buf4_mat_irrep_init(&T2, h);
191
dpd_buf4_mat_irrep_rd(&T2, h);
192
dpd_buf4_mat_irrep_init(&T2old, h);
193
dpd_buf4_mat_irrep_rd(&T2old, h);
194
for(row=0; row < T2.params->rowtot[h]; row++)
195
for(col=0; col < T2.params->coltot[h]; col++)
196
rms += (T2.matrix[h][row][col] - T2old.matrix[h][row][col]) *
197
(T2.matrix[h][row][col] - T2old.matrix[h][row][col]);
198
dpd_buf4_mat_irrep_close(&T2, h);
199
dpd_buf4_mat_irrep_close(&T2old, h);
201
dpd_buf4_close(&T2old);
204
dpd_buf4_init(&T2, CC_TAMPS, 0, 12, 17, 12, 17, 0, "New tijab");
205
dpd_buf4_init(&T2old, CC_TAMPS, 0, 12, 17, 12, 17, 0, "tijab");
206
for(h=0; h < nirreps; h++) {
207
dpd_buf4_mat_irrep_init(&T2, h);
208
dpd_buf4_mat_irrep_rd(&T2, h);
209
dpd_buf4_mat_irrep_init(&T2old, h);
210
dpd_buf4_mat_irrep_rd(&T2old, h);
211
for(row=0; row < T2.params->rowtot[h]; row++)
212
for(col=0; col < T2.params->coltot[h]; col++)
213
rms += (T2.matrix[h][row][col] - T2old.matrix[h][row][col]) *
214
(T2.matrix[h][row][col] - T2old.matrix[h][row][col]);
215
dpd_buf4_mat_irrep_close(&T2, h);
216
dpd_buf4_mat_irrep_close(&T2old, h);
218
dpd_buf4_close(&T2old);
221
dpd_buf4_init(&T2, CC_TAMPS, 0, 22, 28, 22, 28, 0, "New tIjAb");
222
dpd_buf4_init(&T2old, CC_TAMPS, 0, 22, 28, 22, 28, 0, "tIjAb");
223
for(h=0; h < nirreps; h++) {
224
dpd_buf4_mat_irrep_init(&T2, h);
225
dpd_buf4_mat_irrep_rd(&T2, h);
226
dpd_buf4_mat_irrep_init(&T2old, h);
227
dpd_buf4_mat_irrep_rd(&T2old, h);
228
for(row=0; row < T2.params->rowtot[h]; row++)
229
for(col=0; col < T2.params->coltot[h]; col++)
230
rms += (T2.matrix[h][row][col] - T2old.matrix[h][row][col]) *
231
(T2.matrix[h][row][col] - T2old.matrix[h][row][col]);
232
dpd_buf4_mat_irrep_close(&T2, h);
233
dpd_buf4_mat_irrep_close(&T2old, h);
235
dpd_buf4_close(&T2old);
242
if(rms < params.convergence) return 1;
245
}} // namespace psi::ccenergy