~ubuntu-branches/ubuntu/quantal/psicode/quantal

« back to all changes in this revision

Viewing changes to src/bin/cceom/sigmaCC3_RHF.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 <stdlib.h>
3
 
#include <math.h>
4
 
#include <libciomr/libciomr.h>
5
 
#include <libdpd/dpd.h>
6
 
#include <libqt/qt.h>
7
 
#define EXTERN
8
 
#include "globals.h"
9
 
 
10
 
/* This function computes the extra contributions to sigma_1 and sigma_2
11
 
  for EOM_CC3 computations that are not normally present in a EOM_CCSD
12
 
  calculation */
13
 
 
14
 
/* The additional terms are:
15
 
 * Term 1:
16
 
 * <S| H    <T| (Uhat C2)c   |0> |T> / (w-wt) -> sigma_1
17
 
 * <D| Hhat <T| (Uhat C2)c   |0> |T> / (w-wt) -> sigma_2
18
 
 * Term 2:
19
 
 * <S| H    <T| (Utilde T2)c |0> |T> / (w-wt) -> sigma_1
20
 
 * <D| Hhat <T| (Utilde T2)c |0> |T> / (w-wt) -> sigma_2
21
 
 * Term 3:
22
 
 * <D| H'   <T| (Uhat T2)c   |0> |T> / (-wt) -> sigma_2
23
 
 *
24
 
 *  See Eqn. (83) in JCP, 103, 7429, 1995
25
 
 *  All three terms can be evaluated by the same functions in 
26
 
 *  cc3_sigma_RHF given different matrix elements.
27
 
 *  
28
 
 * - RHF case modifed from ccenergy cc3 code, RAK 2006
29
 
 * */
30
 
 
31
 
/* extern void cc3_sigma_RHF(dpdbuf4 *CIjAb, dpdbuf4 *WAbEi, dpdbuf4 *WMbIj,
32
 
    int do_singles, dpdbuf4 *Dints, dpdfile2 *SIA,
33
 
    int do_doubles, dpdfile2 *FME, dpdbuf4 *WAmEf, dpdbuf4 *WMnIe,
34
 
    dpdbuf4 *SIjAb, double energy); */
35
 
 
36
 
void sigmaCC3_RHF_obsolete(int i, int C_irr, double omega)
37
 
{
38
 
  int ii,j,a,b,A,B,Ga,Gb,Gij=0,ab,ab0,ab1;
39
 
  dpdfile2 SIA, FME;
40
 
  dpdbuf4 CMnEf, WAbEi, WMbIj, Dints, WmAEf, WMnIe, SIjAb;
41
 
  dpdbuf4 tIjAb;
42
 
  char lbl[32];
43
 
 
44
 
  sprintf(lbl, "%s %d", "SIA", i);
45
 
  dpd_file2_init(&SIA, EOM_SIA, C_irr, 0, 1, lbl);
46
 
  sprintf(lbl, "%s %d", "SIjAb", i);
47
 
  dpd_buf4_init(&SIjAb, EOM_SIjAb, C_irr, 0, 5, 0, 5, 0, lbl);
48
 
 
49
 
  /*** alpha-alpha-beta term 1 ***/ 
50
 
  /* quantities to compute X3 */
51
 
  sprintf(lbl, "%s %d", "CMnEf", i);
52
 
  dpd_buf4_init(&CMnEf, EOM_CMnEf, C_irr, 0, 5, 0, 5, 0, lbl);
53
 
  dpd_buf4_init(&WAbEi, CC3_HET1, 0, 10, 5, 10, 5, 0, "CC3 WAbEi (iE,bA)");
54
 
  dpd_buf4_init(&WMbIj, CC3_HET1, 0, 0, 10, 0, 10, 0, "CC3 WMbIj (Ij,Mb)");
55
 
  /* quantities to compute sigma */
56
 
  dpd_buf4_init(&Dints, CC_DINTS, 0, 0, 5, 0, 5, 0, "D 2<ij|ab> - <ij|ba>");
57
 
  dpd_file2_init(&FME, CC_OEI, 0, 0, 1, "FME");
58
 
  dpd_buf4_init(&WmAEf, CC3_HET1, 0, 10, 5, 10, 5, 0, "CC3 WAmEf (mA,Ef)");
59
 
  dpd_buf4_init(&WMnIe, CC3_HET1, 0, 0, 10, 0, 10, 0, "CC3 WMnIe (Mn,Ie)");
60
 
 
61
 
       /* * <S| H    <T| (Uhat C2)c   |0> |T> / (w-wt) -> sigma_1
62
 
          * <D| Hhat <T| (Uhat C2)c   |0> |T> / (w-wt) -> sigma_2 */
63
 
 
64
 
  cc3_sigma_RHF(&CMnEf, &WAbEi, &WMbIj, 1,  &Dints, &SIA, 
65
 
    1, &FME, &WmAEf, &WMnIe, &SIjAb, moinfo.occpi, moinfo.occ_off,
66
 
    moinfo.virtpi, moinfo.vir_off, omega, outfile);
67
 
 
68
 
  dpd_buf4_close(&CMnEf);
69
 
  dpd_buf4_close(&WAbEi);
70
 
  dpd_buf4_close(&WMbIj);
71
 
  dpd_buf4_close(&Dints);
72
 
  dpd_file2_close(&FME);
73
 
  dpd_buf4_close(&WmAEf);
74
 
  dpd_buf4_close(&WMnIe);
75
 
 
76
 
#ifdef EOM_DEBUG
77
 
  dpd_file2_close(&SIA);
78
 
  dpd_buf4_close(&SIjAb);
79
 
  check_sum("<Psi|Hhat<T|(Uhat C2)c|0>|T>/(w-wt)", i, C_irr);
80
 
  sprintf(lbl, "%s %d", "SIA", i);
81
 
  dpd_file2_init(&SIA, EOM_SIA, C_irr, 0, 1, lbl);
82
 
  sprintf(lbl, "%s %d", "SIjAb", i);
83
 
  dpd_buf4_init(&SIjAb, EOM_SIjAb, C_irr, 0, 5, 0, 5, 0, lbl);
84
 
#endif
85
 
 
86
 
  /* do alpha-alpha-beta term 2 */
87
 
  dpd_buf4_init(&tIjAb, CC_TAMPS, 0, 0, 5, 0, 5, 0, "tIjAb");
88
 
  dpd_buf4_init(&WAbEi, CC3_HC1ET1, C_irr, 10, 5, 10, 5, 0, "Ht_WAbEi (iE,bA)");
89
 
  dpd_buf4_init(&WMbIj, CC3_HC1ET1, C_irr, 0, 10, 0, 10, 0, "Ht_WMbIj (Ij,Mb)");
90
 
 
91
 
  dpd_buf4_init(&Dints, CC_DINTS, 0, 0, 5, 0, 5, 0, "D 2<ij|ab> - <ij|ba>");
92
 
  dpd_file2_init(&FME, CC_OEI, 0, 0, 1, "FME");
93
 
  dpd_buf4_init(&WmAEf, CC3_HET1, 0, 10, 5, 10, 5, 0, "CC3 WAmEf (mA,Ef)");
94
 
  dpd_buf4_init(&WMnIe, CC3_HET1, 0, 0, 10, 0, 10, 0, "CC3 WMnIe (Mn,Ie)");
95
 
 
96
 
         /* * <S| H    <T| (Utilde T2)c |0> |T> / (w-wt) -> sigma_1
97
 
            * <D| Hhat <T| (Utilde T2)c |0> |T> / (w-wt) -> sigma_2 */
98
 
 
99
 
  cc3_sigma_RHF(&tIjAb, &WAbEi, &WMbIj, 1,  &Dints, &SIA,
100
 
     1, &FME, &WmAEf, &WMnIe, &SIjAb, moinfo.occpi, moinfo.occ_off,
101
 
     moinfo.virtpi, moinfo.vir_off, omega, outfile);
102
 
 
103
 
  dpd_buf4_close(&tIjAb);
104
 
  dpd_buf4_close(&WAbEi);
105
 
  dpd_buf4_close(&WMbIj);
106
 
  dpd_buf4_close(&Dints);
107
 
  dpd_file2_close(&FME);
108
 
  dpd_buf4_close(&WmAEf);
109
 
  dpd_buf4_close(&WMnIe);
110
 
 
111
 
#ifdef EOM_DEBUG
112
 
  dpd_file2_close(&SIA);
113
 
  dpd_buf4_close(&SIjAb);
114
 
  check_sum("<Psi|Hhat<T|(Utilde T2)c|0>|T>/(w-wt)", i, C_irr);
115
 
  sprintf(lbl, "%s %d", "SIA", i);
116
 
  dpd_file2_init(&SIA, EOM_SIA, C_irr, 0, 1, lbl);
117
 
  sprintf(lbl, "%s %d", "SIjAb", i);
118
 
  dpd_buf4_init(&SIjAb, EOM_SIjAb, C_irr, 0, 5, 0, 5, 0, lbl);
119
 
#endif
120
 
 
121
 
  /* alpha-alpha-beta term 3 */
122
 
  dpd_buf4_init(&tIjAb, CC_TAMPS, 0, 0, 5, 0, 5, 0, "tIjAb");
123
 
  dpd_buf4_init(&WAbEi, CC3_HET1, 0, 10, 5, 10, 5, 0, "CC3 WAbEi (iE,bA)");
124
 
  dpd_buf4_init(&WMbIj, CC3_HET1, 0, 0, 10, 0, 10, 0, "CC3 WMbIj (Ij,Mb)");
125
 
 
126
 
  dpd_file2_init(&FME, CC3_HC1, C_irr, 0, 1, "HC1 FME");
127
 
  dpd_buf4_init(&WmAEf, CC3_HC1, C_irr, 10, 5, 10, 5, 0, "HC1 WAmEf (mA,Ef)");
128
 
  dpd_buf4_init(&WMnIe, CC3_HC1, C_irr, 0, 10, 0, 10, 0, "HC1 WMnIe (Mn,Ie)");
129
 
 
130
 
         /* <D| H'   <T| (Uhat T2)c   |0> |T> / (-wt) -> sigma_2 */
131
 
 
132
 
  cc3_sigma_RHF(&tIjAb, &WAbEi, &WMbIj, 0, NULL, NULL,
133
 
     1, &FME, &WmAEf, &WMnIe, &SIjAb, moinfo.occpi, moinfo.occ_off,
134
 
     moinfo.virtpi, moinfo.vir_off, 0.0, outfile);
135
 
 
136
 
  dpd_buf4_close(&tIjAb); 
137
 
  dpd_buf4_close(&WAbEi);
138
 
  dpd_buf4_close(&WMbIj);
139
 
  dpd_file2_close(&FME);
140
 
  dpd_buf4_close(&WmAEf);
141
 
  dpd_buf4_close(&WMnIe);
142
 
 
143
 
#ifdef EOM_DEBUG
144
 
  dpd_file2_close(&SIA);
145
 
  dpd_buf4_close(&SIjAb);
146
 
  check_sum("<Psi|H'<T|(Uhat T2)c|0>|T>/(w-wt)", i, C_irr);
147
 
  sprintf(lbl, "%s %d", "SIA", i);
148
 
  dpd_file2_init(&SIA, EOM_SIA, C_irr, 0, 1, lbl);
149
 
  sprintf(lbl, "%s %d", "SIjAb", i);
150
 
  dpd_buf4_init(&SIjAb, EOM_SIjAb, C_irr, 0, 5, 0, 5, 0, lbl);
151
 
#endif
152
 
 
153
 
  dpd_file2_close(&SIA);
154
 
  dpd_buf4_close(&SIjAb);
155
 
  return;
156
 
}