1 //
2 // BAGEL - Brilliantly Advanced General Electronic Structure Library
3 // Filename: RelCASPT2_gamma.cc
4 // Copyright (C) 2014 Toru Shiozaki
5 //
6 // Author: Shiozaki group <shiozaki@northwestern.edu>
7 // Maintainer: Shiozaki group
8 //
9 // This file is part of the BAGEL package.
10 //
11 // This program is free software; you can redistribute it and/or modify
12 // it under the terms of the GNU General Public License as published by
13 // the Free Software Foundation, either version 3 of the License, or
14 // (at your option) any later version.
15 //
16 // This program is distributed in the hope that it will be useful,
17 // but WITHOUT ANY WARRANTY; without even the implied warranty of
18 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 // GNU General Public License for more details.
20 //
21 // You should have received a copy of the GNU General Public License
22 // along with this program. If not, see <http://www.gnu.org/licenses/>.
23 //
24
25
26 #include <bagel_config.h>
27 #ifdef COMPILE_SMITH
28 #include <src/smith/relcaspt2/RelCASPT2.h>
29 #include <src/smith/relcaspt2/RelCASPT2_tasks.h>
30
31 using namespace std;
32 using namespace bagel;
33 using namespace bagel::SMITH;
34 using bagel::SMITH::RelCASPT2::FutureTensor;
35
Gamma0_()36 shared_ptr<FutureTensor> RelCASPT2::RelCASPT2::Gamma0_() {
37 vector<IndexRange> Gamma0_index = {active_, active_, active_, active_};
38 auto Gamma0 = make_shared<Tensor>(Gamma0_index);
39 array<shared_ptr<const IndexRange>,3> pindex = {{rclosed_, ractive_, rvirt_}};
40 auto tensor0 = vector<shared_ptr<Tensor>>{Gamma0, rdm0_, rdm1_, rdm2_, rdm3_, f1_};
41 auto task0 = make_shared<Task0>(tensor0, pindex);
42 return make_shared<FutureTensor>(*Gamma0, task0);
43 }
44
Gamma92_()45 shared_ptr<FutureTensor> RelCASPT2::RelCASPT2::Gamma92_() {
46 vector<IndexRange> Gamma92_index = {active_, active_, active_, active_};
47 auto Gamma92 = make_shared<Tensor>(Gamma92_index);
48 array<shared_ptr<const IndexRange>,3> pindex = {{rclosed_, ractive_, rvirt_}};
49 auto tensor1 = vector<shared_ptr<Tensor>>{Gamma92, rdm0_, rdm1_, rdm2_};
50 auto task1 = make_shared<Task1>(tensor1, pindex);
51 return make_shared<FutureTensor>(*Gamma92, task1);
52 }
53
Gamma2_()54 shared_ptr<FutureTensor> RelCASPT2::RelCASPT2::Gamma2_() {
55 vector<IndexRange> Gamma2_index = {active_, active_, active_, active_, active_, active_};
56 auto Gamma2 = make_shared<Tensor>(Gamma2_index);
57 array<shared_ptr<const IndexRange>,3> pindex = {{rclosed_, ractive_, rvirt_}};
58 auto tensor2 = vector<shared_ptr<Tensor>>{Gamma2, rdm1_, rdm2_, rdm3_};
59 auto task2 = make_shared<Task2>(tensor2, pindex);
60 return make_shared<FutureTensor>(*Gamma2, task2);
61 }
62
Gamma3_()63 shared_ptr<FutureTensor> RelCASPT2::RelCASPT2::Gamma3_() {
64 vector<IndexRange> Gamma3_index = {active_, active_, active_, active_};
65 auto Gamma3 = make_shared<Tensor>(Gamma3_index);
66 array<shared_ptr<const IndexRange>,3> pindex = {{rclosed_, ractive_, rvirt_}};
67 auto tensor3 = vector<shared_ptr<Tensor>>{Gamma3, rdm0_, rdm1_, rdm2_};
68 auto task3 = make_shared<Task3>(tensor3, pindex);
69 return make_shared<FutureTensor>(*Gamma3, task3);
70 }
71
Gamma4_()72 shared_ptr<FutureTensor> RelCASPT2::RelCASPT2::Gamma4_() {
73 vector<IndexRange> Gamma4_index = {active_, active_, active_, active_, active_, active_};
74 auto Gamma4 = make_shared<Tensor>(Gamma4_index);
75 array<shared_ptr<const IndexRange>,3> pindex = {{rclosed_, ractive_, rvirt_}};
76 auto tensor4 = vector<shared_ptr<Tensor>>{Gamma4, rdm1_, rdm2_, rdm3_};
77 auto task4 = make_shared<Task4>(tensor4, pindex);
78 return make_shared<FutureTensor>(*Gamma4, task4);
79 }
80
Gamma5_()81 shared_ptr<FutureTensor> RelCASPT2::RelCASPT2::Gamma5_() {
82 vector<IndexRange> Gamma5_index = {active_, active_, active_, active_, active_, active_};
83 auto Gamma5 = make_shared<Tensor>(Gamma5_index);
84 array<shared_ptr<const IndexRange>,3> pindex = {{rclosed_, ractive_, rvirt_}};
85 auto tensor5 = vector<shared_ptr<Tensor>>{Gamma5, rdm1_, rdm2_, rdm3_, rdm4f_, f1_};
86 auto task5 = make_shared<Task5>(tensor5, pindex);
87 return make_shared<FutureTensor>(*Gamma5, task5);
88 }
89
Gamma6_()90 shared_ptr<FutureTensor> RelCASPT2::RelCASPT2::Gamma6_() {
91 vector<IndexRange> Gamma6_index = {active_, active_, active_, active_, active_, active_};
92 auto Gamma6 = make_shared<Tensor>(Gamma6_index);
93 array<shared_ptr<const IndexRange>,3> pindex = {{rclosed_, ractive_, rvirt_}};
94 auto tensor6 = vector<shared_ptr<Tensor>>{Gamma6, rdm1_, rdm2_, rdm3_};
95 auto task6 = make_shared<Task6>(tensor6, pindex);
96 return make_shared<FutureTensor>(*Gamma6, task6);
97 }
98
Gamma7_()99 shared_ptr<FutureTensor> RelCASPT2::RelCASPT2::Gamma7_() {
100 vector<IndexRange> Gamma7_index = {active_, active_, active_, active_};
101 auto Gamma7 = make_shared<Tensor>(Gamma7_index);
102 array<shared_ptr<const IndexRange>,3> pindex = {{rclosed_, ractive_, rvirt_}};
103 auto tensor7 = vector<shared_ptr<Tensor>>{Gamma7, rdm1_, rdm2_};
104 auto task7 = make_shared<Task7>(tensor7, pindex);
105 return make_shared<FutureTensor>(*Gamma7, task7);
106 }
107
Gamma9_()108 shared_ptr<FutureTensor> RelCASPT2::RelCASPT2::Gamma9_() {
109 vector<IndexRange> Gamma9_index = {active_, active_, active_, active_, active_, active_};
110 auto Gamma9 = make_shared<Tensor>(Gamma9_index);
111 array<shared_ptr<const IndexRange>,3> pindex = {{rclosed_, ractive_, rvirt_}};
112 auto tensor8 = vector<shared_ptr<Tensor>>{Gamma9, rdm1_, rdm2_, rdm3_};
113 auto task8 = make_shared<Task8>(tensor8, pindex);
114 return make_shared<FutureTensor>(*Gamma9, task8);
115 }
116
Gamma12_()117 shared_ptr<FutureTensor> RelCASPT2::RelCASPT2::Gamma12_() {
118 vector<IndexRange> Gamma12_index = {active_, active_, active_, active_};
119 auto Gamma12 = make_shared<Tensor>(Gamma12_index);
120 array<shared_ptr<const IndexRange>,3> pindex = {{rclosed_, ractive_, rvirt_}};
121 auto tensor9 = vector<shared_ptr<Tensor>>{Gamma12, rdm1_, rdm2_};
122 auto task9 = make_shared<Task9>(tensor9, pindex);
123 return make_shared<FutureTensor>(*Gamma12, task9);
124 }
125
Gamma14_()126 shared_ptr<FutureTensor> RelCASPT2::RelCASPT2::Gamma14_() {
127 vector<IndexRange> Gamma14_index = {active_, active_};
128 auto Gamma14 = make_shared<Tensor>(Gamma14_index);
129 array<shared_ptr<const IndexRange>,3> pindex = {{rclosed_, ractive_, rvirt_}};
130 auto tensor10 = vector<shared_ptr<Tensor>>{Gamma14, rdm0_, rdm1_, rdm2_, f1_};
131 auto task10 = make_shared<Task10>(tensor10, pindex);
132 return make_shared<FutureTensor>(*Gamma14, task10);
133 }
134
Gamma16_()135 shared_ptr<FutureTensor> RelCASPT2::RelCASPT2::Gamma16_() {
136 vector<IndexRange> Gamma16_index = {active_, active_};
137 auto Gamma16 = make_shared<Tensor>(Gamma16_index);
138 array<shared_ptr<const IndexRange>,3> pindex = {{rclosed_, ractive_, rvirt_}};
139 auto tensor11 = vector<shared_ptr<Tensor>>{Gamma16, rdm0_, rdm1_};
140 auto task11 = make_shared<Task11>(tensor11, pindex);
141 return make_shared<FutureTensor>(*Gamma16, task11);
142 }
143
Gamma22_()144 shared_ptr<FutureTensor> RelCASPT2::RelCASPT2::Gamma22_() {
145 vector<IndexRange> Gamma22_index = {active_, active_, active_, active_};
146 auto Gamma22 = make_shared<Tensor>(Gamma22_index);
147 array<shared_ptr<const IndexRange>,3> pindex = {{rclosed_, ractive_, rvirt_}};
148 auto tensor12 = vector<shared_ptr<Tensor>>{Gamma22, rdm1_, rdm2_};
149 auto task12 = make_shared<Task12>(tensor12, pindex);
150 return make_shared<FutureTensor>(*Gamma22, task12);
151 }
152
Gamma28_()153 shared_ptr<FutureTensor> RelCASPT2::RelCASPT2::Gamma28_() {
154 vector<IndexRange> Gamma28_index = {active_, active_, active_, active_, active_, active_};
155 auto Gamma28 = make_shared<Tensor>(Gamma28_index);
156 array<shared_ptr<const IndexRange>,3> pindex = {{rclosed_, ractive_, rvirt_}};
157 auto tensor13 = vector<shared_ptr<Tensor>>{Gamma28, rdm1_, rdm2_, rdm3_};
158 auto task13 = make_shared<Task13>(tensor13, pindex);
159 return make_shared<FutureTensor>(*Gamma28, task13);
160 }
161
Gamma29_()162 shared_ptr<FutureTensor> RelCASPT2::RelCASPT2::Gamma29_() {
163 vector<IndexRange> Gamma29_index = {active_, active_, active_, active_};
164 auto Gamma29 = make_shared<Tensor>(Gamma29_index);
165 array<shared_ptr<const IndexRange>,3> pindex = {{rclosed_, ractive_, rvirt_}};
166 auto tensor14 = vector<shared_ptr<Tensor>>{Gamma29, rdm1_, rdm2_};
167 auto task14 = make_shared<Task14>(tensor14, pindex);
168 return make_shared<FutureTensor>(*Gamma29, task14);
169 }
170
Gamma31_()171 shared_ptr<FutureTensor> RelCASPT2::RelCASPT2::Gamma31_() {
172 vector<IndexRange> Gamma31_index = {active_, active_, active_, active_};
173 auto Gamma31 = make_shared<Tensor>(Gamma31_index);
174 array<shared_ptr<const IndexRange>,3> pindex = {{rclosed_, ractive_, rvirt_}};
175 auto tensor15 = vector<shared_ptr<Tensor>>{Gamma31, rdm1_, rdm2_, rdm3_, f1_};
176 auto task15 = make_shared<Task15>(tensor15, pindex);
177 return make_shared<FutureTensor>(*Gamma31, task15);
178 }
179
Gamma32_()180 shared_ptr<FutureTensor> RelCASPT2::RelCASPT2::Gamma32_() {
181 vector<IndexRange> Gamma32_index = {active_, active_, active_, active_};
182 auto Gamma32 = make_shared<Tensor>(Gamma32_index);
183 array<shared_ptr<const IndexRange>,3> pindex = {{rclosed_, ractive_, rvirt_}};
184 auto tensor16 = vector<shared_ptr<Tensor>>{Gamma32, rdm1_, rdm2_};
185 auto task16 = make_shared<Task16>(tensor16, pindex);
186 return make_shared<FutureTensor>(*Gamma32, task16);
187 }
188
Gamma35_()189 shared_ptr<FutureTensor> RelCASPT2::RelCASPT2::Gamma35_() {
190 vector<IndexRange> Gamma35_index = {active_, active_, active_, active_};
191 auto Gamma35 = make_shared<Tensor>(Gamma35_index);
192 array<shared_ptr<const IndexRange>,3> pindex = {{rclosed_, ractive_, rvirt_}};
193 auto tensor17 = vector<shared_ptr<Tensor>>{Gamma35, rdm1_, rdm2_};
194 auto task17 = make_shared<Task17>(tensor17, pindex);
195 return make_shared<FutureTensor>(*Gamma35, task17);
196 }
197
Gamma34_()198 shared_ptr<FutureTensor> RelCASPT2::RelCASPT2::Gamma34_() {
199 vector<IndexRange> Gamma34_index = {active_, active_, active_, active_};
200 auto Gamma34 = make_shared<Tensor>(Gamma34_index);
201 array<shared_ptr<const IndexRange>,3> pindex = {{rclosed_, ractive_, rvirt_}};
202 auto tensor18 = vector<shared_ptr<Tensor>>{Gamma34, rdm1_, rdm2_, rdm3_, f1_};
203 auto task18 = make_shared<Task18>(tensor18, pindex);
204 return make_shared<FutureTensor>(*Gamma34, task18);
205 }
206
Gamma37_()207 shared_ptr<FutureTensor> RelCASPT2::RelCASPT2::Gamma37_() {
208 vector<IndexRange> Gamma37_index = {active_, active_, active_, active_, active_, active_};
209 auto Gamma37 = make_shared<Tensor>(Gamma37_index);
210 array<shared_ptr<const IndexRange>,3> pindex = {{rclosed_, ractive_, rvirt_}};
211 auto tensor19 = vector<shared_ptr<Tensor>>{Gamma37, rdm2_, rdm3_};
212 auto task19 = make_shared<Task19>(tensor19, pindex);
213 return make_shared<FutureTensor>(*Gamma37, task19);
214 }
215
Gamma38_()216 shared_ptr<FutureTensor> RelCASPT2::RelCASPT2::Gamma38_() {
217 vector<IndexRange> Gamma38_index = {active_, active_};
218 auto Gamma38 = make_shared<Tensor>(Gamma38_index);
219 array<shared_ptr<const IndexRange>,3> pindex = {{rclosed_, ractive_, rvirt_}};
220 auto tensor20 = vector<shared_ptr<Tensor>>{Gamma38, rdm1_};
221 auto task20 = make_shared<Task20>(tensor20, pindex);
222 return make_shared<FutureTensor>(*Gamma38, task20);
223 }
224
Gamma51_()225 shared_ptr<FutureTensor> RelCASPT2::RelCASPT2::Gamma51_() {
226 vector<IndexRange> Gamma51_index = {active_, active_, active_, active_, active_, active_};
227 auto Gamma51 = make_shared<Tensor>(Gamma51_index);
228 array<shared_ptr<const IndexRange>,3> pindex = {{rclosed_, ractive_, rvirt_}};
229 auto tensor21 = vector<shared_ptr<Tensor>>{Gamma51, rdm2_, rdm3_};
230 auto task21 = make_shared<Task21>(tensor21, pindex);
231 return make_shared<FutureTensor>(*Gamma51, task21);
232 }
233
Gamma56_()234 shared_ptr<FutureTensor> RelCASPT2::RelCASPT2::Gamma56_() {
235 vector<IndexRange> Gamma56_index = {active_, active_, active_, active_, active_, active_};
236 auto Gamma56 = make_shared<Tensor>(Gamma56_index);
237 array<shared_ptr<const IndexRange>,3> pindex = {{rclosed_, ractive_, rvirt_}};
238 auto tensor22 = vector<shared_ptr<Tensor>>{Gamma56, rdm2_, rdm3_};
239 auto task22 = make_shared<Task22>(tensor22, pindex);
240 return make_shared<FutureTensor>(*Gamma56, task22);
241 }
242
Gamma57_()243 shared_ptr<FutureTensor> RelCASPT2::RelCASPT2::Gamma57_() {
244 vector<IndexRange> Gamma57_index = {active_, active_, active_, active_, active_, active_};
245 auto Gamma57 = make_shared<Tensor>(Gamma57_index);
246 array<shared_ptr<const IndexRange>,3> pindex = {{rclosed_, ractive_, rvirt_}};
247 auto tensor23 = vector<shared_ptr<Tensor>>{Gamma57, rdm2_, rdm3_};
248 auto task23 = make_shared<Task23>(tensor23, pindex);
249 return make_shared<FutureTensor>(*Gamma57, task23);
250 }
251
Gamma58_()252 shared_ptr<FutureTensor> RelCASPT2::RelCASPT2::Gamma58_() {
253 vector<IndexRange> Gamma58_index = {active_, active_, active_, active_, active_, active_};
254 auto Gamma58 = make_shared<Tensor>(Gamma58_index);
255 array<shared_ptr<const IndexRange>,3> pindex = {{rclosed_, ractive_, rvirt_}};
256 auto tensor24 = vector<shared_ptr<Tensor>>{Gamma58, rdm2_, rdm3_, rdm4f_, f1_};
257 auto task24 = make_shared<Task24>(tensor24, pindex);
258 return make_shared<FutureTensor>(*Gamma58, task24);
259 }
260
Gamma59_()261 shared_ptr<FutureTensor> RelCASPT2::RelCASPT2::Gamma59_() {
262 vector<IndexRange> Gamma59_index = {active_, active_, active_, active_, active_, active_};
263 auto Gamma59 = make_shared<Tensor>(Gamma59_index);
264 array<shared_ptr<const IndexRange>,3> pindex = {{rclosed_, ractive_, rvirt_}};
265 auto tensor25 = vector<shared_ptr<Tensor>>{Gamma59, rdm2_, rdm3_};
266 auto task25 = make_shared<Task25>(tensor25, pindex);
267 return make_shared<FutureTensor>(*Gamma59, task25);
268 }
269
Gamma60_()270 shared_ptr<FutureTensor> RelCASPT2::RelCASPT2::Gamma60_() {
271 vector<IndexRange> Gamma60_index = {active_, active_, active_, active_};
272 auto Gamma60 = make_shared<Tensor>(Gamma60_index);
273 array<shared_ptr<const IndexRange>,3> pindex = {{rclosed_, ractive_, rvirt_}};
274 auto tensor26 = vector<shared_ptr<Tensor>>{Gamma60, rdm2_};
275 auto task26 = make_shared<Task26>(tensor26, pindex);
276 return make_shared<FutureTensor>(*Gamma60, task26);
277 }
278
Gamma79_()279 shared_ptr<FutureTensor> RelCASPT2::RelCASPT2::Gamma79_() {
280 vector<IndexRange> Gamma79_index = {active_, active_};
281 auto Gamma79 = make_shared<Tensor>(Gamma79_index);
282 array<shared_ptr<const IndexRange>,3> pindex = {{rclosed_, ractive_, rvirt_}};
283 auto tensor27 = vector<shared_ptr<Tensor>>{Gamma79, rdm2_, f1_};
284 auto task27 = make_shared<Task27>(tensor27, pindex);
285 return make_shared<FutureTensor>(*Gamma79, task27);
286 }
287
Gamma90_()288 shared_ptr<FutureTensor> RelCASPT2::RelCASPT2::Gamma90_() {
289 vector<IndexRange> Gamma90_index = {active_, active_, active_, active_};
290 auto Gamma90 = make_shared<Tensor>(Gamma90_index);
291 array<shared_ptr<const IndexRange>,3> pindex = {{rclosed_, ractive_, rvirt_}};
292 auto tensor28 = vector<shared_ptr<Tensor>>{Gamma90, rdm3_, f1_};
293 auto task28 = make_shared<Task28>(tensor28, pindex);
294 return make_shared<FutureTensor>(*Gamma90, task28);
295 }
296
Gamma105_()297 shared_ptr<FutureTensor> RelCASPT2::RelCASPT2::Gamma105_() {
298 vector<IndexRange> Gamma105_index = {active_, active_, active_, active_, active_, active_};
299 auto Gamma105 = make_shared<Tensor>(Gamma105_index);
300 array<shared_ptr<const IndexRange>,3> pindex = {{rclosed_, ractive_, rvirt_}};
301 auto tensor29 = vector<shared_ptr<Tensor>>{Gamma105, rdm1_, rdm2_, rdm3_};
302 auto task29 = make_shared<Task29>(tensor29, pindex);
303 return make_shared<FutureTensor>(*Gamma105, task29);
304 }
305
306 #endif
307