3
#include <libdpd/dpd.h>
7
/* pertbar(): Constructs the components of the similarity-transformed
8
** one-electron property operator.
10
** NB: For antisymmetric quantities, we must be careful in
11
** contractions involving the bare MO integrals. This only affects
12
** the leading term of XXBAR_IA (which, I admit, is poorly named and
13
** probably should really be called XXBAR_AI), where I copy the XXIA
14
** integrals into place with a -1 sign.
19
void pertbar(char *pert, int irrep_x, int irrep_y, int irrep_z, int anti)
22
dpdfile2 fbar1, f, t1, z;
24
char lbl[32], prefix1[32], prefix2[32], prefix3[32];
26
for(i=0; i < 3; i++) {
29
sprintf(prefix1, "%s_%1s", pert, "X");
30
sprintf(prefix2, "%sBAR_%1s", pert, "X");
31
sprintf(prefix3, "z_%1s", "X");
35
sprintf(prefix1, "%s_%1s", pert, "Y");
36
sprintf(prefix2, "%sBAR_%1s", pert, "Y");
37
sprintf(prefix3, "z_%1s", "Y");
41
sprintf(prefix1, "%s_%1s", pert, "Z");
42
sprintf(prefix2, "%sBAR_%1s", pert, "Z");
43
sprintf(prefix3, "z_%1s", "Z");
47
sprintf(lbl, "%s_IA", prefix1);
48
dpd_file2_init(&f, CC_OEI, irrep, 0, 1, lbl);
49
sprintf(lbl, "%s_ME", prefix2);
50
dpd_file2_copy(&f, CC_OEI, lbl);
54
sprintf(lbl, "%s_IJ", prefix1);
55
dpd_file2_init(&f, CC_OEI, irrep, 0, 0, lbl);
56
sprintf(lbl, "%s_MI", prefix2);
57
dpd_file2_copy(&f, CC_OEI, lbl);
60
sprintf(lbl, "%s_MI", prefix2);
61
dpd_file2_init(&fbar1, CC_OEI, irrep, 0, 0, lbl);
62
sprintf(lbl, "%s_IA", prefix1);
63
dpd_file2_init(&f, CC_OEI, irrep, 0, 1, lbl);
64
dpd_file2_init(&t1, CC_OEI, 0, 0, 1, "tIA");
65
dpd_contract222(&f, &t1, &fbar1, 0, 0, 1, 1);
68
dpd_file2_close(&fbar1);
71
sprintf(lbl, "%s_AB", prefix1);
72
dpd_file2_init(&f, CC_OEI, irrep, 1, 1, lbl);
73
sprintf(lbl, "%s_AE", prefix2);
74
dpd_file2_copy(&f, CC_OEI, lbl);
77
sprintf(lbl, "%s_AE", prefix2);
78
dpd_file2_init(&fbar1, CC_OEI, irrep, 1, 1, lbl);
79
sprintf(lbl, "%s_IA", prefix1);
80
dpd_file2_init(&f, CC_OEI, irrep, 0, 1, lbl);
81
dpd_file2_init(&t1, CC_OEI, 0, 0, 1, "tIA");
82
dpd_contract222(&t1, &f, &fbar1, 1, 1, -1, 1);
85
dpd_file2_close(&fbar1);
88
sprintf(lbl, "%s_IA", prefix1);
89
dpd_file2_init(&f, CC_OEI, irrep, 0, 1, lbl);
90
sprintf(lbl, "%s_IA", prefix2);
91
dpd_file2_copy(&f, CC_OEI, lbl);
94
sprintf(lbl, "%s_IA", prefix2);
95
dpd_file2_init(&fbar1, CC_OEI, irrep, 0, 1, lbl);
96
if(anti) dpd_file2_scm(&fbar1, -1);
98
sprintf(lbl, "%s_AB", prefix1);
99
dpd_file2_init(&f, CC_OEI, irrep, 1, 1, lbl);
100
dpd_file2_init(&t1, CC_OEI, 0, 0, 1, "tIA");
101
dpd_contract222(&t1, &f, &fbar1, 0, 0, 1, 1);
102
dpd_file2_close(&t1);
105
sprintf(lbl, "%s_IJ", prefix1);
106
dpd_file2_init(&f, CC_OEI, irrep, 0, 0, lbl);
107
dpd_file2_init(&t1, CC_OEI, 0, 0, 1, "tIA");
108
dpd_contract222(&f, &t1, &fbar1, 1, 1, -1, 1);
109
dpd_file2_close(&t1);
112
sprintf(lbl, "%s_IA", prefix1);
113
dpd_file2_init(&f, CC_OEI, irrep, 0, 1, lbl);
114
dpd_buf4_init(&t2, CC_TAMPS, 0, 10, 10, 10, 10, 0, "2 tIAjb - tIBja");
115
dpd_contract422(&t2, &f, &fbar1, 0, 0, 1, 1);
119
sprintf(lbl, "%s_MI", prefix3);
120
dpd_file2_init(&z, CC_TMP0, irrep, 0, 0, lbl);
121
dpd_file2_init(&t1, CC_OEI, 0, 0, 1, "tIA");
122
sprintf(lbl, "%s_IA", prefix1);
123
dpd_file2_init(&f, CC_OEI, irrep, 0, 1, lbl);
124
dpd_contract222(&f, &t1, &z, 0, 0, 1, 0);
126
dpd_contract222(&z, &t1, &fbar1, 1, 1, -1, 1);
127
dpd_file2_close(&t1);
130
dpd_file2_close(&fbar1);
133
sprintf(lbl, "%s_MbIj", prefix2);
134
dpd_buf4_init(&fbar2, CC_LR, irrep, 10, 0, 10, 0, 0, lbl);
135
sprintf(lbl, "%s_IA", prefix1);
136
dpd_file2_init(&f, CC_OEI, irrep, 0, 1, lbl);
137
dpd_buf4_init(&t2, CC_TAMPS, 0, 0, 5, 0, 5, 0, "tIjAb");
138
dpd_contract244(&f, &t2, &fbar2, 1, 2, 0, 1, 0);
141
dpd_buf4_close(&fbar2);
144
sprintf(lbl, "%s_IjAb", prefix2);
145
dpd_buf4_init(&fbar2, CC_LR, irrep, 0, 5, 0, 5, 0, lbl);
147
sprintf(lbl, "%s_AB", prefix1);
148
dpd_file2_init(&f, CC_OEI, irrep, 1, 1, lbl);
149
dpd_buf4_init(&t2, CC_TAMPS, 0, 0, 5, 0, 5, 0, "tIjAb");
150
dpd_contract424(&t2, &f, &fbar2, 3, 1, 0, 1, 0);
151
dpd_contract244(&f, &t2, &fbar2, 1, 2, 1, 1, 1);
155
sprintf(lbl, "%s_IJ", prefix1);
156
dpd_file2_init(&f, CC_OEI, irrep, 0, 0, lbl);
157
dpd_buf4_init(&t2, CC_TAMPS, 0, 0, 5, 0, 5, 0, "tIjAb");
158
dpd_contract424(&t2, &f, &fbar2, 1, 0, 1, -1, 1);
159
dpd_contract244(&f, &t2, &fbar2, 0, 0, 0, -1, 1);
163
sprintf(lbl, "%s_AE", prefix3);
164
dpd_file2_init(&z, CC_TMP0, irrep, 1, 1, lbl);
165
dpd_file2_init(&t1, CC_OEI, 0, 0, 1, "tIA");
166
sprintf(lbl, "%s_IA", prefix1);
167
dpd_file2_init(&f, CC_OEI, irrep, 0, 1, lbl);
168
dpd_contract222(&t1, &f, &z, 1, 1, -1, 0);
170
dpd_file2_close(&t1);
171
dpd_buf4_init(&t2, CC_TAMPS, 0, 0, 5, 0, 5, 0, "tIjAb");
172
dpd_contract424(&t2, &z, &fbar2, 3, 1, 0, 1, 1);
173
dpd_contract244(&z, &t2, &fbar2, 1, 2, 1, 1, 1);
177
sprintf(lbl, "%s_MI", prefix3);
178
dpd_file2_init(&z, CC_TMP0, irrep, 0, 0, lbl); /* generated above */
179
dpd_buf4_init(&t2, CC_TAMPS, 0, 0, 5, 0, 5, 0, "tIjAb");
180
dpd_contract424(&t2, &z, &fbar2, 1, 0, 1, -1, 1);
181
dpd_contract244(&z, &t2, &fbar2, 0, 0, 0, -1, 1);
185
dpd_buf4_close(&fbar2);