~ubuntu-branches/ubuntu/precise/psicode/precise

« back to all changes in this revision

Viewing changes to src/bin/ccenergy/Fmi.cc

  • Committer: Bazaar Package Importer
  • Author(s): Michael Banck, Michael Banck, Daniel Leidert
  • Date: 2009-02-23 00:12:02 UTC
  • mfrom: (1.1.2 upstream)
  • Revision ID: james.westby@ubuntu.com-20090223001202-rutldoy3dimfpesc
Tags: 3.4.0-1
* New upstream release.

[ Michael Banck ]
* debian/patches/01_DESTDIR.dpatch: Refreshed.
* debian/patches/02_FHS.dpatch: Removed, applied upstream.
* debian/patches/03_debian_docdir: Likewise.
* debian/patches/04_man.dpatch: Likewise.
* debian/patches/06_466828_fix_gcc_43_ftbfs.dpatch: Likewise.
* debian/patches/07_464867_move_executables: Fixed and refreshed.
* debian/patches/00list: Adjusted.
* debian/control: Improved description.
* debian/patches-held: Removed.
* debian/rules (install/psi3): Do not ship the ruby bindings for now.

[ Daniel Leidert ]
* debian/rules: Fix txtdir via DEB_MAKE_INSTALL_TARGET.
* debian/patches/01_DESTDIR.dpatch: Refreshed.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*! \file
 
2
    \ingroup CCENERGY
 
3
    \brief Enter brief description of file here 
 
4
*/
 
5
#include <cstdio>
 
6
#include <cstdlib>
 
7
#include <libdpd/dpd.h>
 
8
#include "Params.h"
 
9
#include "MOInfo.h"
 
10
#define EXTERN
 
11
#include "globals.h"
 
12
 
 
13
namespace psi { namespace ccenergy {
 
14
 
 
15
void Fmi_build(void)
 
16
{
 
17
  int h,m,i;
 
18
  dpdfile2 FMI, Fmi, FMIt, Fmit, fIJ, fij, fIA, fia;
 
19
  dpdfile2 tIA, tia, FME, Fme;
 
20
  dpdbuf4 E_anti, E, D_anti, D;
 
21
  dpdbuf4 tautIJAB, tautijab, tautIjAb;
 
22
 
 
23
  if(params.ref == 0) { /** RHF **/
 
24
    dpd_file2_init(&fIJ, CC_OEI, 0, 0, 0, "fIJ");
 
25
    dpd_file2_copy(&fIJ, CC_OEI, "FMI");
 
26
    dpd_file2_close(&fIJ);
 
27
  }
 
28
  else if(params.ref == 1) { /** ROHF **/
 
29
    dpd_file2_init(&fIJ, CC_OEI, 0, 0, 0, "fIJ");
 
30
    dpd_file2_copy(&fIJ, CC_OEI, "FMI");
 
31
    dpd_file2_close(&fIJ);
 
32
  
 
33
    dpd_file2_init(&fij, CC_OEI, 0, 0, 0, "fij");
 
34
    dpd_file2_copy(&fij, CC_OEI, "Fmi");
 
35
    dpd_file2_close(&fij);
 
36
  }
 
37
  else if(params.ref == 2) { /** UHF **/
 
38
    dpd_file2_init(&fIJ, CC_OEI, 0, 0, 0, "fIJ");
 
39
    dpd_file2_copy(&fIJ, CC_OEI, "FMI");
 
40
    dpd_file2_close(&fIJ);
 
41
  
 
42
    dpd_file2_init(&fij, CC_OEI, 0, 2, 2, "fij");
 
43
    dpd_file2_copy(&fij, CC_OEI, "Fmi");
 
44
    dpd_file2_close(&fij);
 
45
  }
 
46
 
 
47
  if(params.ref == 0) { /** RHF **/
 
48
    dpd_file2_init(&FMI, CC_OEI, 0, 0, 0, "FMI");
 
49
    dpd_file2_mat_init(&FMI);
 
50
    dpd_file2_mat_rd(&FMI);
 
51
 
 
52
    /*
 
53
    for(h=0; h < moinfo.nirreps; h++) {
 
54
      for(m=0; m < FMI.params->rowtot[h]; m++) 
 
55
        FMI.matrix[h][m][m] = 0;
 
56
    }
 
57
    */
 
58
 
 
59
    dpd_file2_mat_wrt(&FMI);
 
60
    dpd_file2_mat_close(&FMI);
 
61
    dpd_file2_close(&FMI);
 
62
  }
 
63
  else if(params.ref == 1) { /** ROHF **/
 
64
    dpd_file2_init(&FMI, CC_OEI, 0, 0, 0, "FMI");
 
65
    dpd_file2_init(&Fmi, CC_OEI, 0, 0, 0, "Fmi");
 
66
 
 
67
    dpd_file2_mat_init(&FMI);
 
68
    dpd_file2_mat_rd(&FMI);
 
69
    dpd_file2_mat_init(&Fmi);
 
70
    dpd_file2_mat_rd(&Fmi);
 
71
 
 
72
    for(h=0; h < moinfo.nirreps; h++) {
 
73
      for(m=0; m < FMI.params->rowtot[h]; m++) 
 
74
        FMI.matrix[h][m][m] = 0;
 
75
 
 
76
      for(m=0; m < Fmi.params->rowtot[h]; m++) 
 
77
        Fmi.matrix[h][m][m] = 0;
 
78
    }
 
79
 
 
80
    dpd_file2_mat_wrt(&FMI);
 
81
    dpd_file2_mat_close(&FMI);
 
82
    dpd_file2_mat_wrt(&Fmi);
 
83
    dpd_file2_mat_close(&Fmi);
 
84
 
 
85
    dpd_file2_close(&FMI);
 
86
    dpd_file2_close(&Fmi);
 
87
  }
 
88
  else if(params.ref == 2) { /** UHF **/
 
89
    dpd_file2_init(&FMI, CC_OEI, 0, 0, 0, "FMI");
 
90
    dpd_file2_init(&Fmi, CC_OEI, 0, 2, 2, "Fmi");
 
91
 
 
92
    dpd_file2_mat_init(&FMI);
 
93
    dpd_file2_mat_rd(&FMI);
 
94
    dpd_file2_mat_init(&Fmi);
 
95
    dpd_file2_mat_rd(&Fmi);
 
96
 
 
97
    for(h=0; h < moinfo.nirreps; h++) {
 
98
      for(m=0; m < FMI.params->rowtot[h]; m++) 
 
99
        FMI.matrix[h][m][m] = 0;
 
100
 
 
101
      for(m=0; m < Fmi.params->rowtot[h]; m++) 
 
102
        Fmi.matrix[h][m][m] = 0;
 
103
    }
 
104
 
 
105
    dpd_file2_mat_wrt(&FMI);
 
106
    dpd_file2_mat_close(&FMI);
 
107
    dpd_file2_mat_wrt(&Fmi);
 
108
    dpd_file2_mat_close(&Fmi);
 
109
 
 
110
    dpd_file2_close(&FMI);
 
111
    dpd_file2_close(&Fmi);
 
112
  }
 
113
 
 
114
  if(params.ref == 0) { /** RHF **/
 
115
    dpd_file2_init(&FMI, CC_OEI, 0, 0, 0, "FMI");
 
116
 
 
117
    dpd_file2_init(&fIA, CC_OEI, 0, 0, 1, "fIA");
 
118
    dpd_file2_init(&tIA, CC_OEI, 0, 0, 1, "tIA");
 
119
    dpd_contract222(&fIA, &tIA, &FMI, 0, 0, 0.5, 1);
 
120
    dpd_file2_close(&tIA);
 
121
    dpd_file2_close(&fIA);
 
122
  
 
123
    dpd_buf4_init(&E_anti, CC_EINTS, 0, 11, 0, 11, 0, 1, "E <ai|jk>");
 
124
    dpd_buf4_init(&E, CC_EINTS, 0, 11, 0, 11, 0, 0, "E <ai|jk>");
 
125
 
 
126
    dpd_file2_init(&tIA, CC_OEI, 0, 0, 1, "tIA");
 
127
 
 
128
    dpd_dot13(&tIA, &E_anti, &FMI, 1, 1, 1.0, 1.0);
 
129
    dpd_dot13(&tIA, &E, &FMI, 1, 1, 1.0, 1.0);
 
130
 
 
131
    dpd_file2_close(&tIA);
 
132
 
 
133
    dpd_buf4_close(&E_anti);
 
134
    dpd_buf4_close(&E);
 
135
 
 
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(&D, &tautIjAb, &FMI, 0, 0, 1, 1);
 
139
    dpd_buf4_close(&tautIjAb);
 
140
    dpd_buf4_close(&D);
 
141
 
 
142
    /* Build the tilde intermediate */
 
143
    dpd_file2_copy(&FMI, CC_OEI, "FMIt");
 
144
    dpd_file2_close(&FMI);
 
145
 
 
146
    dpd_file2_init(&FMIt, CC_OEI, 0, 0, 0, "FMIt");
 
147
 
 
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(&FME, &tIA, &FMIt, 0, 0, 0.5, 1);
 
151
    dpd_file2_close(&FME);
 
152
    dpd_file2_close(&tIA);
 
153
 
 
154
    dpd_file2_close(&FMIt);
 
155
  }
 
156
  else if(params.ref == 1) { /** ROHF **/
 
157
 
 
158
    dpd_file2_init(&FMI, CC_OEI, 0, 0, 0, "FMI");
 
159
    dpd_file2_init(&Fmi, CC_OEI, 0, 0, 0, "Fmi");
 
160
 
 
161
    dpd_file2_init(&fIA, CC_OEI, 0, 0, 1, "fIA");
 
162
    dpd_file2_init(&tIA, CC_OEI, 0, 0, 1, "tIA");
 
163
    dpd_contract222(&fIA, &tIA, &FMI, 0, 0, 0.5, 1);
 
164
    dpd_file2_close(&tIA);
 
165
    dpd_file2_close(&fIA);
 
166
  
 
167
    dpd_file2_init(&fia, CC_OEI, 0, 0, 1, "fia");
 
168
    dpd_file2_init(&tia, CC_OEI, 0, 0, 1, "tia");
 
169
    dpd_contract222(&fia, &tia, &Fmi, 0, 0, 0.5, 1);
 
170
    dpd_file2_close(&tia);
 
171
    dpd_file2_close(&fia);
 
172
  
 
173
    dpd_buf4_init(&E_anti, CC_EINTS, 0, 11, 0, 11, 0, 1, "E <ai|jk>");
 
174
    dpd_buf4_init(&E, CC_EINTS, 0, 11, 0, 11, 0, 0, "E <ai|jk>");
 
175
    dpd_file2_init(&tIA, CC_OEI, 0, 0, 1, "tIA");
 
176
    dpd_file2_init(&tia, CC_OEI, 0, 0, 1, "tia");
 
177
 
 
178
    dpd_dot13(&tIA, &E_anti, &FMI, 1, 1, 1.0, 1.0);
 
179
    dpd_dot13(&tia, &E, &FMI, 1, 1, 1.0, 1.0);
 
180
 
 
181
    dpd_dot13(&tia, &E_anti, &Fmi, 1, 1, 1.0, 1.0);
 
182
    dpd_dot13(&tIA, &E, &Fmi, 1, 1, 1.0, 1.0);
 
183
 
 
184
    dpd_file2_close(&tIA);
 
185
    dpd_file2_close(&tia);
 
186
    dpd_buf4_close(&E_anti);
 
187
    dpd_buf4_close(&E);
 
188
 
 
189
    dpd_buf4_init(&D_anti, CC_DINTS, 0, 0, 7, 0, 7, 0, "D <ij||ab> (ij,a>b)");
 
190
    dpd_buf4_init(&tautIJAB, CC_TAMPS, 0, 0, 7, 2, 7, 0, "tautIJAB");
 
191
    dpd_buf4_init(&tautijab, CC_TAMPS, 0, 0, 7, 2, 7, 0, "tautijab");
 
192
 
 
193
    dpd_contract442(&D_anti, &tautIJAB, &FMI, 0, 0, 1, 1);
 
194
    dpd_contract442(&D_anti, &tautijab, &Fmi, 0, 0, 1, 1);
 
195
 
 
196
    dpd_buf4_close(&tautIJAB);
 
197
    dpd_buf4_close(&tautijab);
 
198
    dpd_buf4_close(&D_anti);
 
199
 
 
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");
 
202
 
 
203
    dpd_contract442(&D, &tautIjAb, &FMI, 0, 0, 1, 1);
 
204
    dpd_contract442(&D, &tautIjAb, &Fmi, 1, 1, 1, 1);
 
205
 
 
206
    dpd_buf4_close(&tautIjAb);
 
207
    dpd_buf4_close(&D);
 
208
 
 
209
    /* Build the tilde intermediate */
 
210
    dpd_file2_copy(&FMI, CC_OEI, "FMIt");
 
211
    dpd_file2_copy(&Fmi, CC_OEI, "Fmit");
 
212
 
 
213
    dpd_file2_close(&FMI);
 
214
    dpd_file2_close(&Fmi);
 
215
 
 
216
    dpd_file2_init(&FMIt, CC_OEI, 0, 0, 0, "FMIt");
 
217
    dpd_file2_init(&Fmit, CC_OEI, 0, 0, 0, "Fmit");
 
218
 
 
219
    dpd_file2_init(&tIA, CC_OEI, 0, 0, 1, "tIA");
 
220
    dpd_file2_init(&FME, CC_OEI, 0, 0, 1, "FME");
 
221
    dpd_contract222(&FME, &tIA, &FMIt, 0, 0, 0.5, 1);
 
222
    dpd_file2_close(&FME);
 
223
    dpd_file2_close(&tIA);
 
224
 
 
225
    dpd_file2_init(&tia, CC_OEI, 0, 0, 1, "tia");
 
226
    dpd_file2_init(&Fme, CC_OEI, 0, 0, 1, "Fme");
 
227
    dpd_contract222(&Fme, &tia, &Fmit, 0, 0, 0.5, 1);
 
228
    dpd_file2_close(&Fme);
 
229
    dpd_file2_close(&tia);
 
230
 
 
231
    dpd_file2_close(&FMIt);
 
232
    dpd_file2_close(&Fmit);
 
233
  }
 
234
  else if(params.ref == 2) { /** UHF **/
 
235
 
 
236
    dpd_file2_init(&FMI, CC_OEI, 0, 0, 0, "FMI");
 
237
    dpd_file2_init(&Fmi, CC_OEI, 0, 2, 2, "Fmi");
 
238
 
 
239
    dpd_file2_init(&fIA, CC_OEI, 0, 0, 1, "fIA");
 
240
    dpd_file2_init(&tIA, CC_OEI, 0, 0, 1, "tIA");
 
241
    dpd_contract222(&fIA, &tIA, &FMI, 0, 0, 0.5, 1);
 
242
    dpd_file2_close(&tIA);
 
243
    dpd_file2_close(&fIA);
 
244
  
 
245
    dpd_file2_init(&fia, CC_OEI, 0, 2, 3, "fia");
 
246
    dpd_file2_init(&tia, CC_OEI, 0, 2, 3, "tia");
 
247
    dpd_contract222(&fia, &tia, &Fmi, 0, 0, 0.5, 1);
 
248
    dpd_file2_close(&tia);
 
249
    dpd_file2_close(&fia);
 
250
  
 
251
    dpd_file2_init(&tIA, CC_OEI, 0, 0, 1, "tIA");
 
252
    dpd_file2_init(&tia, CC_OEI, 0, 2, 3, "tia");
 
253
 
 
254
    dpd_buf4_init(&E_anti, CC_EINTS, 0, 21, 0, 21, 0, 1, "E <AI|JK>");
 
255
    dpd_buf4_init(&E, CC_EINTS, 0, 22, 24, 22, 24, 0, "E <Ij|Ka>");
 
256
 
 
257
    dpd_dot13(&tIA, &E_anti, &FMI, 1, 1, 1, 1);
 
258
    dpd_dot24(&tia, &E, &FMI, 0, 0, 1, 1);
 
259
 
 
260
    dpd_buf4_close(&E);
 
261
    dpd_buf4_close(&E_anti);
 
262
 
 
263
    dpd_buf4_init(&E_anti, CC_EINTS, 0, 31, 10, 31, 10, 1, "E <ai|jk>");
 
264
    dpd_buf4_init(&E, CC_EINTS, 0, 26, 22, 26, 22, 0, "E <Ai|Jk>");
 
265
 
 
266
    dpd_dot13(&tia, &E_anti, &Fmi, 1, 1, 1, 1);
 
267
    dpd_dot13(&tIA, &E, &Fmi, 1, 1, 1, 1);
 
268
 
 
269
    dpd_buf4_close(&E);
 
270
    dpd_buf4_close(&E_anti);
 
271
 
 
272
    dpd_file2_close(&tIA);
 
273
    dpd_file2_close(&tia);
 
274
 
 
275
    dpd_buf4_init(&D, CC_DINTS, 0, 0, 7, 0, 7, 0, "D <IJ||AB> (IJ,A>B)");
 
276
    dpd_buf4_init(&tautIJAB, CC_TAMPS, 0, 0, 7, 2, 7, 0, "tautIJAB");
 
277
    dpd_contract442(&D, &tautIJAB, &FMI, 0, 0, 1, 1);
 
278
    dpd_buf4_close(&tautIJAB);
 
279
    dpd_buf4_close(&D);
 
280
 
 
281
    dpd_buf4_init(&D, CC_DINTS, 0, 10, 17, 10, 17, 0, "D <ij||ab> (ij,a>b)");
 
282
    dpd_buf4_init(&tautijab, CC_TAMPS, 0, 10, 17, 12, 17, 0, "tautijab");
 
283
    dpd_contract442(&D, &tautijab, &Fmi, 0, 0, 1, 1);
 
284
    dpd_buf4_close(&tautijab);
 
285
    dpd_buf4_close(&D);
 
286
 
 
287
    dpd_buf4_init(&D, CC_DINTS, 0, 22, 28, 22, 28, 0, "D <Ij|Ab>");
 
288
    dpd_buf4_init(&tautIjAb, CC_TAMPS, 0, 22, 28, 22, 28, 0, "tautIjAb");
 
289
    dpd_contract442(&D, &tautIjAb, &FMI, 0, 0, 1, 1);
 
290
    dpd_buf4_close(&tautIjAb);
 
291
    dpd_buf4_close(&D);
 
292
 
 
293
    dpd_buf4_init(&D, CC_DINTS, 0, 23, 29, 23, 29, 0, "D <iJ|aB>");
 
294
    dpd_buf4_init(&tautIjAb, CC_TAMPS, 0, 23, 29, 23, 29, 0, "tautiJaB");
 
295
    dpd_contract442(&D, &tautIjAb, &Fmi, 0, 0, 1, 1);
 
296
    dpd_buf4_close(&tautIjAb);
 
297
    dpd_buf4_close(&D);
 
298
 
 
299
 
 
300
    /* Build the tilde intermediate */
 
301
    dpd_file2_copy(&FMI, CC_OEI, "FMIt");
 
302
    dpd_file2_copy(&Fmi, CC_OEI, "Fmit");
 
303
 
 
304
    dpd_file2_close(&FMI);
 
305
    dpd_file2_close(&Fmi);
 
306
 
 
307
    dpd_file2_init(&FMIt, CC_OEI, 0, 0, 0, "FMIt");
 
308
    dpd_file2_init(&Fmit, CC_OEI, 0, 2, 2, "Fmit");
 
309
 
 
310
    dpd_file2_init(&tIA, CC_OEI, 0, 0, 1, "tIA");
 
311
    dpd_file2_init(&FME, CC_OEI, 0, 0, 1, "FME");
 
312
    dpd_contract222(&FME, &tIA, &FMIt, 0, 0, 0.5, 1);
 
313
    dpd_file2_close(&FME);
 
314
    dpd_file2_close(&tIA);
 
315
 
 
316
    dpd_file2_init(&tia, CC_OEI, 0, 2, 3, "tia");
 
317
    dpd_file2_init(&Fme, CC_OEI, 0, 2, 3, "Fme");
 
318
    dpd_contract222(&Fme, &tia, &Fmit, 0, 0, 0.5, 1);
 
319
    dpd_file2_close(&Fme);
 
320
    dpd_file2_close(&tia);
 
321
 
 
322
    dpd_file2_close(&FMIt);
 
323
    dpd_file2_close(&Fmit);
 
324
  }
 
325
}
 
326
}} // namespace psi::ccenergy