~ubuntu-branches/ubuntu/karmic/psicode/karmic

« back to all changes in this revision

Viewing changes to src/bin/cclambda/projections.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 CCLAMBDA
 
3
    \brief Enter brief description of file here 
 
4
*/
 
5
#include <cstdio>
 
6
#include <cmath>
 
7
#include <libdpd/dpd.h>
 
8
#include "MOInfo.h"
 
9
#include "Params.h"
 
10
#define EXTERN
 
11
#include "globals.h"
 
12
 
 
13
namespace psi { namespace cclambda {
 
14
 
 
15
/* projections() computes the projection of the EOM CCSD wavefunction onto the
 
16
reference, singles and doubles spaces, respectively.  These values may be
 
17
compared to those output by ACES2.  Also, an approximate excitation level (AEL)
 
18
may be defined as <Psi|S><S|Psi> + 2<Psi|D><D|Psi>.  For symmetric excitations,
 
19
this AEL theoretically might have a value slightly less than 1.  The sum of
 
20
these projections must equal 1 if R and L are normalized on this space.
 
21
 
 
22
<Psi|0><0|Psi> = <0|Le^(-T)|0><0|Re^T|0> =
 
23
    R0 * (-dot_L1T1 - dot_L2T2 + 0.5*dot_L2T1T1);
 
24
<Psi|S><S|Psi> = <0|Le^(-T)|S><S|Re^T|S> =
 
25
    R0 * (+dot_L1T1 - dot_L2T1T1) + dot_L1R1 - dot_L2T1R1;
 
26
<Psi|D><D|Psi> = <0|Le^(-T)|D><D|Re^T|D> =
 
27
    R0 * (+dot_L2T2 + 0.5*dot_L2T1T1) + dot_L2T1R1 + dot_L2R2;
 
28
 
 
29
where dot_L1T1 = Lme Tme               dot_L2T2 = Lmnef Tmnef
 
30
      dot_L2T1T1 = Lmnef Tme Tnf       dot_L2T1R1 = Lmnef Tme Rnf
 
31
      dot_L1R1 = Lme Rme               dot_L2R2 = Lmnef Rmnef
 
32
*/
 
33
 
 
34
void projections(struct L_Params *pL_params) {
 
35
  int IRR;
 
36
  int i,j, root;
 
37
  double R0, projection_0, projection_S, projection_D, projection_tot, ael;
 
38
  double dot_L1T1=0, dot_L2T2=0, dot_L2T1T1=0, dot_L1R1=0, dot_L2T1R1=0;
 
39
  double dot_L2R2=0;
 
40
  char R1A_lbl[32], R1B_lbl[32], R2AA_lbl[32], R2BB_lbl[32], R2AB_lbl[32];
 
41
  char L1A_lbl[32], L1B_lbl[32], L2AA_lbl[32], L2BB_lbl[32], L2AB_lbl[32], L2AB_lbl2[32];
 
42
  dpdfile2 L1A, L1B, T1A, T1B, I1, R1A, R1B;
 
43
  dpdbuf4 T2, L2, R2;
 
44
  /* assumes that the excited-Rs are available */
 
45
 
 
46
  if (params.ref == 0) {
 
47
    dpd_file2_init(&T1A, CC_OEI, 0, 0, 1, "tIA");
 
48
  }
 
49
  else if (params.ref == 1) {
 
50
    dpd_file2_init(&T1A, CC_OEI, 0, 0, 1, "tIA");
 
51
    dpd_file2_init(&T1B, CC_OEI, 0, 0, 1, "tia");
 
52
  }
 
53
  else if (params.ref == 2) {
 
54
    dpd_file2_init(&T1A, CC_OEI, 0, 0, 1, "tIA");
 
55
    dpd_file2_init(&T1B, CC_OEI, 0, 2, 3, "tia");
 
56
  }
 
57
 
 
58
  for (i=1; i<params.nstates;++i) {
 
59
    IRR = pL_params[i].irrep;
 
60
    R0 = pL_params[i].R0;
 
61
    root = pL_params[i].root;
 
62
    sprintf(R1A_lbl, "RIA %d %d", IRR, root);
 
63
    sprintf(R1B_lbl, "Ria %d %d", IRR, root);
 
64
    sprintf(R2AA_lbl, "RIJAB %d %d", IRR, root);
 
65
    sprintf(R2BB_lbl, "Rijab %d %d", IRR, root);
 
66
    sprintf(R2AB_lbl, "RIjAb %d %d", IRR, root);
 
67
    sprintf(L1A_lbl, "LIA %d %d", IRR, root);
 
68
    sprintf(L1B_lbl, "Lia %d %d", IRR, root);
 
69
    sprintf(L2AA_lbl, "LIJAB %d %d", IRR, root);
 
70
    sprintf(L2BB_lbl, "Lijab %d %d", IRR, root);
 
71
    sprintf(L2AB_lbl, "LIjAb %d %d", IRR, root);
 
72
    sprintf(L2AB_lbl2, "2LIjAb - LIjbA %d %d", IRR, root);
 
73
    
 
74
    if (params.ref == 0) {
 
75
      dpd_file2_init(&L1A, CC_LAMPS, IRR, 0, 1, L1A_lbl);
 
76
    }
 
77
    else if (params.ref == 1) {
 
78
      dpd_file2_init(&L1A, CC_LAMPS, IRR, 0, 1, L1A_lbl);
 
79
      dpd_file2_init(&L1B, CC_LAMPS, IRR, 0, 1, L1B_lbl);
 
80
    }
 
81
    else if (params.ref == 2) {
 
82
      dpd_file2_init(&L1A, CC_LAMPS, IRR, 0, 1, L1A_lbl);
 
83
      dpd_file2_init(&L1B, CC_LAMPS, IRR, 2, 3, L1B_lbl);
 
84
    }
 
85
 
 
86
    if (IRR == 0) {
 
87
      /* dot_L1T1 = <0|Lme Tme|0>, assuming L0=0 (excited state) */
 
88
      if (params.ref == 0) {
 
89
        dot_L1T1 = 2.0 * dpd_file2_dot(&L1A, &T1A);
 
90
      }
 
91
      else if (params.ref >= 1) {
 
92
        dot_L1T1 = dpd_file2_dot(&L1A, &T1A);
 
93
        dot_L1T1 += dpd_file2_dot(&L1B, &T1B);
 
94
      }
 
95
 
 
96
      /* dot_L2T2 = <0|Lmnef Tmnef|0> */
 
97
      if (params.ref == 0) {
 
98
        dpd_buf4_init(&L2, CC_LAMPS, IRR, 0, 5, 0, 5, 0, L2AB_lbl);
 
99
        dpd_buf4_init(&T2, CC_TAMPS, 0, 0, 5, 0, 5, 0, "2 tIjAb - tIjBa");
 
100
        dot_L2T2 = dpd_buf4_dot(&L2, &T2);
 
101
        dpd_buf4_close(&T2);
 
102
        dpd_buf4_close(&L2);
 
103
      }
 
104
      else if (params.ref == 1) {
 
105
        dpd_buf4_init(&L2, CC_LAMPS, IRR, 2, 7, 2, 7, 0, L2AA_lbl);
 
106
        dpd_buf4_init(&T2, CC_TAMPS, 0, 2, 7, 2, 7, 0, "tIJAB");
 
107
        dot_L2T2 = dpd_buf4_dot(&L2, &T2);
 
108
        dpd_buf4_close(&T2);
 
109
        dpd_buf4_close(&L2);
 
110
        dpd_buf4_init(&L2, CC_LAMPS, IRR, 2, 7, 2, 7, 0, L2BB_lbl);
 
111
        dpd_buf4_init(&T2, CC_TAMPS, 0, 2, 7, 2, 7, 0, "tijab");
 
112
        dot_L2T2 += dpd_buf4_dot(&L2, &T2);
 
113
        dpd_buf4_close(&T2);
 
114
        dpd_buf4_close(&L2);
 
115
        dpd_buf4_init(&L2, CC_LAMPS, IRR, 0, 5, 0, 5, 0, L2AB_lbl);
 
116
        dpd_buf4_init(&T2, CC_TAMPS, 0, 0, 5, 0, 5, 0, "tIjAb");
 
117
        dot_L2T2 += dpd_buf4_dot(&L2, &T2);
 
118
        dpd_buf4_close(&T2);
 
119
        dpd_buf4_close(&L2);
 
120
      }
 
121
      else if (params.ref == 2) {
 
122
       dpd_buf4_init(&L2, CC_LAMPS, IRR, 2, 7, 2, 7, 0, L2AA_lbl);
 
123
       dpd_buf4_init(&T2, CC_TAMPS, 0, 2, 7, 2, 7, 0, "tIJAB");
 
124
       dot_L2T2 = dpd_buf4_dot(&L2, &T2);
 
125
       dpd_buf4_close(&T2);
 
126
       dpd_buf4_close(&L2);
 
127
       dpd_buf4_init(&L2, CC_LAMPS, IRR, 12, 17, 12, 17, 0, L2BB_lbl);
 
128
       dpd_buf4_init(&T2, CC_TAMPS, 0, 12, 17, 12, 17, 0, "tijab");
 
129
       dot_L2T2 += dpd_buf4_dot(&L2, &T2);
 
130
       dpd_buf4_close(&T2);
 
131
       dpd_buf4_close(&L2);
 
132
       dpd_buf4_init(&L2, CC_LAMPS, IRR, 22, 28, 22, 28, 0, L2AB_lbl);
 
133
       dpd_buf4_init(&T2, CC_TAMPS, 0, 22, 28, 22, 28, 0, "tIjAb");
 
134
       dot_L2T2 += dpd_buf4_dot(&L2, &T2);
 
135
       dpd_buf4_close(&T2);
 
136
       dpd_buf4_close(&L2);
 
137
     }
 
138
     /* dot_L2T1T1 = TNF (TME LMNEF) + Tnf (Tme Lmnef) + 2*Tnf(TME LMnEf)  */
 
139
     if (params.ref == 0) {
 
140
        dpd_file2_init(&I1, CC_TMP, IRR, 0, 1, "X(N,F)");
 
141
        dpd_buf4_init(&L2, CC_LAMPS, IRR, 0, 5, 0, 5, 0, L2AB_lbl2);
 
142
        dpd_dot13(&T1A, &L2, &I1, 0, 0, 1.0, 0.0);
 
143
        dpd_buf4_close(&L2);
 
144
        dot_L2T1T1 = 2.0 * dpd_file2_dot(&T1A, &I1);
 
145
        dpd_file2_close(&I1);
 
146
     }
 
147
     else if (params.ref == 1) {
 
148
        dpd_file2_init(&I1, CC_TMP, IRR, 0, 1, "X(N,F)");
 
149
        dpd_buf4_init(&L2, CC_LAMPS, IRR, 0, 5, 2, 7, 0, L2AA_lbl);
 
150
        dpd_dot13(&T1A, &L2, &I1, 0, 0, 1.0, 0.0);
 
151
        dpd_buf4_close(&L2);
 
152
        dot_L2T1T1 = dpd_file2_dot(&T1A, &I1);
 
153
        dpd_file2_close(&I1);
 
154
        dpd_file2_init(&I1, CC_TMP, IRR, 0, 1, "X(n,f)");
 
155
        dpd_buf4_init(&L2, CC_LAMPS, IRR, 0, 5, 2, 7, 0, L2BB_lbl);
 
156
        dpd_dot13(&T1B, &L2, &I1, 0, 0, 1.0, 0.0);
 
157
        dpd_buf4_close(&L2);
 
158
        dot_L2T1T1 += dpd_file2_dot(&T1B, &I1);
 
159
        dpd_file2_close(&I1);
 
160
        dpd_file2_init(&I1, CC_TMP, IRR, 0, 1, "X(n,f)");
 
161
        dpd_buf4_init(&L2, CC_LAMPS, IRR, 0, 5, 0, 5, 0, L2AB_lbl);
 
162
        dpd_dot13(&T1A, &L2, &I1, 0, 0, 1.0, 0.0);
 
163
        dpd_buf4_close(&L2);
 
164
        dot_L2T1T1 += 2.0 * dpd_file2_dot(&T1B, &I1);
 
165
        dpd_file2_close(&I1);
 
166
      }
 
167
      else if (params.ref == 2) {
 
168
        dpd_file2_init(&I1, CC_TMP, IRR, 0, 1, "X(N,F)");
 
169
        dpd_buf4_init(&L2, CC_LAMPS, IRR, 0, 5, 2, 7, 0, L2AA_lbl);
 
170
        dpd_dot13(&T1A, &L2, &I1, 0, 0, 1.0, 0.0);
 
171
        dpd_buf4_close(&L2);
 
172
        dot_L2T1T1 = dpd_file2_dot(&T1A, &I1);
 
173
        dpd_file2_close(&I1);
 
174
        dpd_file2_init(&I1, CC_TMP, IRR, 2, 3, "X(n,f)");
 
175
        dpd_buf4_init(&L2, CC_LAMPS, IRR, 10, 15, 12, 17, 0, L2BB_lbl);
 
176
        dpd_dot13(&T1B, &L2, &I1, 0, 0, 1.0, 0.0);
 
177
        dpd_buf4_close(&L2);
 
178
        dot_L2T1T1 += dpd_file2_dot(&T1B, &I1);
 
179
        dpd_file2_close(&I1);
 
180
        dpd_file2_init(&I1, CC_TMP, IRR, 2, 3, "X(n,f)");
 
181
        dpd_buf4_init(&L2, CC_LAMPS, IRR, 22, 28, 22, 28, 0, L2AB_lbl);
 
182
        dpd_dot13(&T1A, &L2, &I1, 0, 0, 1.0, 0.0);
 
183
        dpd_buf4_close(&L2);
 
184
        dot_L2T1T1 += 2.0 * dpd_file2_dot(&T1B, &I1);
 
185
        dpd_file2_close(&I1);
 
186
      }
 
187
    }
 
188
 
 
189
    /* open R files */
 
190
    if (params.ref == 0) {
 
191
      dpd_file2_init(&R1A, CC_RAMPS, IRR, 0, 1, R1A_lbl);
 
192
    }
 
193
    else if (params.ref == 1) {
 
194
      dpd_file2_init(&R1A, CC_RAMPS, IRR, 0, 1, R1A_lbl);
 
195
      dpd_file2_init(&R1B, CC_RAMPS, IRR, 0, 1, R1B_lbl);
 
196
    }
 
197
    else if (params.ref == 2) {
 
198
      dpd_file2_init(&R1A, CC_RAMPS, IRR, 0, 1, R1A_lbl);
 
199
      dpd_file2_init(&R1B, CC_RAMPS, IRR, 2, 3, R1B_lbl);
 
200
    }
 
201
 
 
202
    /* dot_L1R1 = Lme Rme */
 
203
    if (params.ref == 0) {
 
204
      dot_L1R1 = 2.0 * dpd_file2_dot(&L1A,&R1A);
 
205
    }
 
206
    else if (params.ref >= 1) {
 
207
      dot_L1R1 = dpd_file2_dot(&L1A,&R1A);
 
208
      dot_L1R1 += dpd_file2_dot(&L1B,&R1B);
 
209
    }
 
210
 
 
211
    /* dot_L2R2 = <0|Lmnef Rmnef|0> */
 
212
    if (params.ref == 0) {
 
213
      dpd_buf4_init(&L2, CC_LAMPS, IRR, 0, 5, 0, 5, 0, L2AB_lbl2);
 
214
      dpd_buf4_init(&R2, CC_RAMPS, IRR, 0, 5, 0, 5, 0, R2AB_lbl);
 
215
      dot_L2R2 = dpd_buf4_dot(&L2, &R2);
 
216
      dpd_buf4_close(&R2);
 
217
      dpd_buf4_close(&L2);
 
218
    }
 
219
    else if (params.ref == 1) {
 
220
      dpd_buf4_init(&L2, CC_LAMPS, IRR, 2, 7, 2, 7, 0, L2AA_lbl);
 
221
      dpd_buf4_init(&R2, CC_RAMPS, IRR, 2, 7, 2, 7, 0, R2AA_lbl);
 
222
      dot_L2R2 = dpd_buf4_dot(&L2, &R2);
 
223
      dpd_buf4_close(&R2);
 
224
      dpd_buf4_close(&L2);
 
225
      dpd_buf4_init(&L2, CC_LAMPS, IRR, 2, 7, 2, 7, 0, L2BB_lbl);
 
226
      dpd_buf4_init(&R2, CC_RAMPS, IRR, 2, 7, 2, 7, 0, R2BB_lbl);
 
227
      dot_L2R2 += dpd_buf4_dot(&L2, &R2);
 
228
      dpd_buf4_close(&R2);
 
229
      dpd_buf4_close(&L2);
 
230
      dpd_buf4_init(&L2, CC_LAMPS, IRR, 0, 5, 0, 5, 0, L2AB_lbl);
 
231
      dpd_buf4_init(&R2, CC_RAMPS, IRR, 0, 5, 0, 5, 0, R2AB_lbl);
 
232
      dot_L2R2 += dpd_buf4_dot(&L2, &R2);
 
233
      dpd_buf4_close(&R2);
 
234
      dpd_buf4_close(&L2);
 
235
    }
 
236
    else if (params.ref == 2) {
 
237
      dpd_buf4_init(&L2, CC_LAMPS, IRR, 2, 7, 2, 7, 0, L2AA_lbl);
 
238
      dpd_buf4_init(&R2, CC_RAMPS, IRR, 2, 7, 2, 7, 0, R2AA_lbl);
 
239
      dot_L2R2 = dpd_buf4_dot(&L2, &R2);
 
240
      dpd_buf4_close(&R2);
 
241
      dpd_buf4_close(&L2);
 
242
      dpd_buf4_init(&L2, CC_LAMPS, IRR, 12, 17, 12, 17, 0, L2BB_lbl);
 
243
      dpd_buf4_init(&R2, CC_RAMPS, IRR, 12, 17, 12, 17, 0, R2BB_lbl);
 
244
      dot_L2R2 += dpd_buf4_dot(&L2, &R2);
 
245
      dpd_buf4_close(&R2);
 
246
      dpd_buf4_close(&L2);
 
247
      dpd_buf4_init(&L2, CC_LAMPS, IRR, 22, 28, 22, 28, 0, L2AB_lbl);
 
248
      dpd_buf4_init(&R2, CC_RAMPS, IRR, 22, 28, 22, 28, 0, R2AB_lbl);
 
249
      dot_L2R2 += dpd_buf4_dot(&L2, &R2);
 
250
      dpd_buf4_close(&R2);
 
251
      dpd_buf4_close(&L2);
 
252
    }
 
253
 
 
254
    /* dot_L2T1R1 = RNF (TME LMNEF) + Rnf (Tme Lmnef) */
 
255
    /*            + RNF (Tme LNmFe) + Rnf (TME LMnEf) */
 
256
    if (params.ref == 0) {
 
257
      dpd_buf4_init(&L2, CC_LAMPS, IRR, 0, 5, 0, 5, 0, L2AB_lbl2);
 
258
      dpd_file2_init(&I1, CC_TMP, IRR, 0, 1, "X2(N,F)");
 
259
      dpd_dot13(&T1A, &L2, &I1, 0, 0, 1.0, 0.0);
 
260
      dpd_buf4_close(&L2);
 
261
      dot_L2T1R1 = 2.0 * dpd_file2_dot(&R1A, &I1);
 
262
      dpd_file2_close(&I1);
 
263
    }
 
264
    else if (params.ref == 1) {
 
265
      dpd_file2_init(&I1, CC_TMP, IRR, 0, 1, "X2(N,F)");
 
266
      dpd_buf4_init(&L2, CC_LAMPS, IRR, 0, 5, 2, 7, 0, L2AA_lbl);
 
267
      dpd_dot13(&T1A, &L2, &I1, 0, 0, 1.0, 0.0);
 
268
      dpd_buf4_close(&L2);
 
269
      dot_L2T1R1 = dpd_file2_dot(&R1A, &I1);
 
270
      dpd_file2_close(&I1);
 
271
      dpd_file2_init(&I1, CC_TMP, IRR, 0, 1, "X2(n,f)");
 
272
      dpd_buf4_init(&L2, CC_LAMPS, IRR, 0, 5, 2, 7, 0, L2BB_lbl);
 
273
      dpd_dot13(&T1B, &L2, &I1, 0, 0, 1.0, 0.0);
 
274
      dpd_buf4_close(&L2);
 
275
      dot_L2T1R1 += dpd_file2_dot(&R1B, &I1);
 
276
      dpd_file2_close(&I1);
 
277
      dpd_buf4_init(&L2, CC_LAMPS, IRR, 0, 5, 0, 5, 0, L2AB_lbl);
 
278
      dpd_file2_init(&I1, CC_TMP, IRR, 0, 1, "X2(N,F)");
 
279
      dpd_dot24(&T1B, &L2, &I1, 0, 0, 1.0, 0.0);
 
280
      dpd_buf4_close(&L2);
 
281
      dot_L2T1R1 += dpd_file2_dot(&R1A, &I1);
 
282
      dpd_file2_close(&I1);
 
283
      dpd_file2_init(&I1, CC_TMP, IRR, 0, 1, "X2(n,f)");
 
284
      dpd_buf4_init(&L2, CC_LAMPS, IRR, 0, 5, 0, 5, 0, L2AB_lbl);
 
285
      dpd_dot13(&T1A, &L2, &I1, 0, 0, 1.0, 0.0);
 
286
      dpd_buf4_close(&L2);
 
287
      dot_L2T1R1 += dpd_file2_dot(&R1B, &I1);
 
288
      dpd_file2_close(&I1);
 
289
    }
 
290
    else if (params.ref == 2) {
 
291
      dpd_file2_init(&I1, CC_TMP, IRR, 0, 1, "X2(N,F)");
 
292
      dpd_buf4_init(&L2, CC_LAMPS, IRR, 0, 5, 2, 7, 0, L2AA_lbl);
 
293
      dpd_dot13(&T1A, &L2, &I1, 0, 0, 1.0, 0.0);
 
294
      dpd_buf4_close(&L2);
 
295
      dot_L2T1R1 = dpd_file2_dot(&R1A, &I1);
 
296
      dpd_file2_close(&I1);
 
297
      dpd_file2_init(&I1, CC_TMP, IRR, 2, 3, "X2(n,f)");
 
298
      dpd_buf4_init(&L2, CC_LAMPS, IRR, 10, 15, 12, 17, 0, L2BB_lbl);
 
299
      dpd_dot13(&T1B, &L2, &I1, 0, 0, 1.0, 0.0);
 
300
      dpd_buf4_close(&L2);
 
301
      dot_L2T1R1 += dpd_file2_dot(&R1B, &I1);
 
302
      dpd_file2_close(&I1);
 
303
      dpd_buf4_init(&L2, CC_LAMPS, IRR, 22, 28, 22, 28, 0, L2AB_lbl);
 
304
      dpd_file2_init(&I1, CC_TMP, IRR, 0, 1, "X2(N,F)");
 
305
      dpd_dot24(&T1B, &L2, &I1, 0, 0, 1.0, 0.0);
 
306
      dpd_buf4_close(&L2);
 
307
      dot_L2T1R1 += dpd_file2_dot(&R1A, &I1);
 
308
      dpd_file2_close(&I1);
 
309
      dpd_file2_init(&I1, CC_TMP, IRR, 2, 3, "X2(n,f)");
 
310
      dpd_buf4_init(&L2, CC_LAMPS, IRR, 22, 28, 22, 28, 0, L2AB_lbl);
 
311
      dpd_dot13(&T1A, &L2, &I1, 0, 0, 1.0, 0.0);
 
312
      dpd_buf4_close(&L2);
 
313
      dot_L2T1R1 += dpd_file2_dot(&R1B, &I1);
 
314
      dpd_file2_close(&I1);
 
315
    }
 
316
  
 
317
    /* close L1, R1 */
 
318
    if (params.ref == 0) {
 
319
      dpd_file2_close(&R1A); dpd_file2_close(&L1A);
 
320
    }
 
321
    else if (params.ref >= 1) {
 
322
      dpd_file2_close(&R1A); dpd_file2_close(&R1B);
 
323
      dpd_file2_close(&L1A); dpd_file2_close(&L1B);
 
324
    }
 
325
 
 
326
    projection_0 = R0 * (-dot_L1T1 - dot_L2T2 + 0.5*dot_L2T1T1);
 
327
    projection_S = R0 * (+dot_L1T1 - dot_L2T1T1) + dot_L1R1 - dot_L2T1R1;
 
328
    projection_D = R0 * (+dot_L2T2 + 0.5*dot_L2T1T1) + dot_L2T1R1 + dot_L2R2;
 
329
    projection_tot = projection_0 + projection_S + projection_D;
 
330
    ael = projection_S + 2.0 * projection_D;
 
331
 
 
332
    fprintf(outfile,"\n\tProjections for excited state, irrep %s, root %d:\n", moinfo.labels[0], root);
 
333
    fprintf(outfile,"\t<0|Le^(-T)|0><0|Re^T|0>  = %15.10lf\n", projection_0);
 
334
    fprintf(outfile,"\t<0|Le^(-T)|S><S|Re^T|0>  = %15.10lf\n", projection_S);
 
335
    fprintf(outfile,"\t<0|Le^(-T)|D><D|Re^T|0>  = %15.10lf\n", projection_D);
 
336
    fprintf(outfile,"\tSum of above             = %15.10lf\n", projection_tot);
 
337
    fprintf(outfile,"\tApprox. excitation level = %15.10lf\n", ael);
 
338
  } /* sum over states */
 
339
 
 
340
  /* close T1 */
 
341
  dpd_file2_close(&T1A);
 
342
  if (params.ref >= 1)
 
343
    dpd_file2_close(&T1B);
 
344
}
 
345
 
 
346
}} // namespace psi::cclambda