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

« back to all changes in this revision

Viewing changes to src/bin/cclambda/projections.c

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