1 //
2 // BAGEL - Brilliantly Advanced General Electronic Structure Library
3 // Filename: RelCASPT2_gen5.cc
4 // Copyright (C) 2014 Toru Shiozaki
5 //
6 // Author: Toru Shiozaki <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 #include <bagel_config.h>
26 #ifdef COMPILE_SMITH
27
28 #include <src/smith/relcaspt2/RelCASPT2_tasks5.h>
29
30 using namespace std;
31 using namespace bagel;
32 using namespace bagel::SMITH;
33 using namespace bagel::SMITH::RelCASPT2;
34
Task200(vector<shared_ptr<Tensor>> t,array<shared_ptr<const IndexRange>,3> range)35 Task200::Task200(vector<shared_ptr<Tensor>> t, array<shared_ptr<const IndexRange>,3> range) {
36 array<shared_ptr<const Tensor>,1> in = {{t[1]}};
37 out_ = t[0];
38 in_ = in;
39 subtasks_.reserve(range[2]->nblock()*range[1]->nblock()*range[2]->nblock()*range[1]->nblock());
40 for (auto& a1 : *range[2])
41 for (auto& x0 : *range[1])
42 for (auto& a2 : *range[2])
43 for (auto& x1 : *range[1])
44 if (t[0]->is_local(x1, a2, x0, a1))
45 subtasks_.push_back(make_shared<Task_local>(array<const Index,4>{{x1, a2, x0, a1}}, in, t[0], range));
46 }
47
Task201(vector<shared_ptr<Tensor>> t,array<shared_ptr<const IndexRange>,3> range)48 Task201::Task201(vector<shared_ptr<Tensor>> t, array<shared_ptr<const IndexRange>,3> range) {
49 array<shared_ptr<const Tensor>,2> in = {{t[1], t[2]}};
50 out_ = t[0];
51 in_ = in;
52 subtasks_.reserve(range[1]->nblock()*range[1]->nblock()*range[2]->nblock()*range[2]->nblock());
53 for (auto& x1 : *range[1])
54 for (auto& x0 : *range[1])
55 for (auto& a2 : *range[2])
56 for (auto& a1 : *range[2])
57 if (t[0]->is_local(a1, a2, x0, x1))
58 subtasks_.push_back(make_shared<Task_local>(array<const Index,4>{{a1, a2, x0, x1}}, in, t[0], range));
59 }
60
Task202(vector<shared_ptr<Tensor>> t,array<shared_ptr<const IndexRange>,3> range,const double e)61 Task202::Task202(vector<shared_ptr<Tensor>> t, array<shared_ptr<const IndexRange>,3> range, const double e) {
62 array<shared_ptr<const Tensor>,2> in = {{t[1], t[2]}};
63 out_ = t[0];
64 in_ = in;
65 subtasks_.reserve(range[1]->nblock()*range[1]->nblock()*range[2]->nblock()*range[2]->nblock());
66 for (auto& x1 : *range[1])
67 for (auto& x0 : *range[1])
68 for (auto& a2 : *range[2])
69 for (auto& a1 : *range[2])
70 if (t[0]->is_local(a1, a2, x0, x1))
71 subtasks_.push_back(make_shared<Task_local>(array<const Index,4>{{a1, a2, x0, x1}}, in, t[0], range, e));
72 }
73
Task203(vector<shared_ptr<Tensor>> t,const bool reset)74 Task203::Task203(vector<shared_ptr<Tensor>> t, const bool reset) : reset_(reset) {
75 s_ = t[0];
76 }
77
Task204(vector<shared_ptr<Tensor>> t,array<shared_ptr<const IndexRange>,3> range)78 Task204::Task204(vector<shared_ptr<Tensor>> t, array<shared_ptr<const IndexRange>,3> range) {
79 array<shared_ptr<const Tensor>,1> in = {{t[1]}};
80 out_ = t[0];
81 in_ = in;
82 subtasks_.reserve(range[1]->nblock()*range[0]->nblock()*range[1]->nblock()*range[0]->nblock());
83 for (auto& x0 : *range[1])
84 for (auto& c1 : *range[0])
85 for (auto& x1 : *range[1])
86 for (auto& c2 : *range[0])
87 if (t[0]->is_local(c2, x1, c1, x0))
88 subtasks_.push_back(make_shared<Task_local>(array<const Index,4>{{c2, x1, c1, x0}}, in, t[0], range));
89 }
90
Task205(vector<shared_ptr<Tensor>> t,array<shared_ptr<const IndexRange>,3> range)91 Task205::Task205(vector<shared_ptr<Tensor>> t, array<shared_ptr<const IndexRange>,3> range) {
92 array<shared_ptr<const Tensor>,2> in = {{t[1], t[2]}};
93 out_ = t[0];
94 in_ = in;
95 subtasks_.reserve(range[1]->nblock()*range[1]->nblock()*range[0]->nblock()*range[0]->nblock());
96 for (auto& x1 : *range[1])
97 for (auto& x0 : *range[1])
98 for (auto& c2 : *range[0])
99 for (auto& c1 : *range[0])
100 if (t[0]->is_local(c1, c2, x0, x1))
101 subtasks_.push_back(make_shared<Task_local>(array<const Index,4>{{c1, c2, x0, x1}}, in, t[0], range));
102 }
103
Task206(vector<shared_ptr<Tensor>> t,array<shared_ptr<const IndexRange>,3> range)104 Task206::Task206(vector<shared_ptr<Tensor>> t, array<shared_ptr<const IndexRange>,3> range) {
105 array<shared_ptr<const Tensor>,1> in = {{t[1]}};
106 out_ = t[0];
107 in_ = in;
108 subtasks_.reserve(range[1]->nblock()*range[1]->nblock()*range[1]->nblock()*range[0]->nblock());
109 for (auto& x1 : *range[1])
110 for (auto& x0 : *range[1])
111 for (auto& x2 : *range[1])
112 for (auto& c1 : *range[0])
113 if (t[0]->is_local(c1, x2, x0, x1))
114 subtasks_.push_back(make_shared<Task_local>(array<const Index,4>{{c1, x2, x0, x1}}, in, t[0], range));
115 }
116
Task207(vector<shared_ptr<Tensor>> t,array<shared_ptr<const IndexRange>,3> range)117 Task207::Task207(vector<shared_ptr<Tensor>> t, array<shared_ptr<const IndexRange>,3> range) {
118 array<shared_ptr<const Tensor>,2> in = {{t[1], t[2]}};
119 out_ = t[0];
120 in_ = in;
121 subtasks_.reserve(range[1]->nblock()*range[1]->nblock()*range[1]->nblock()*range[0]->nblock());
122 for (auto& x0 : *range[1])
123 for (auto& x1 : *range[1])
124 for (auto& x2 : *range[1])
125 for (auto& c1 : *range[0])
126 if (t[0]->is_local(c1, x2, x1, x0))
127 subtasks_.push_back(make_shared<Task_local>(array<const Index,4>{{c1, x2, x1, x0}}, in, t[0], range));
128 }
129
Task208(vector<shared_ptr<Tensor>> t,array<shared_ptr<const IndexRange>,3> range)130 Task208::Task208(vector<shared_ptr<Tensor>> t, array<shared_ptr<const IndexRange>,3> range) {
131 array<shared_ptr<const Tensor>,2> in = {{t[1], t[2]}};
132 out_ = t[0];
133 in_ = in;
134 subtasks_.reserve(range[1]->nblock()*range[1]->nblock()*range[1]->nblock()*range[0]->nblock());
135 for (auto& x0 : *range[1])
136 for (auto& x1 : *range[1])
137 for (auto& x2 : *range[1])
138 for (auto& c1 : *range[0])
139 if (t[0]->is_local(c1, x2, x1, x0))
140 subtasks_.push_back(make_shared<Task_local>(array<const Index,4>{{c1, x2, x1, x0}}, in, t[0], range));
141 }
142
Task209(vector<shared_ptr<Tensor>> t,array<shared_ptr<const IndexRange>,3> range)143 Task209::Task209(vector<shared_ptr<Tensor>> t, array<shared_ptr<const IndexRange>,3> range) {
144 array<shared_ptr<const Tensor>,2> in = {{t[1], t[2]}};
145 out_ = t[0];
146 in_ = in;
147 subtasks_.reserve(range[1]->nblock()*range[1]->nblock()*range[1]->nblock()*range[0]->nblock());
148 for (auto& x0 : *range[1])
149 for (auto& x1 : *range[1])
150 for (auto& x2 : *range[1])
151 for (auto& c1 : *range[0])
152 if (t[0]->is_local(c1, x2, x1, x0))
153 subtasks_.push_back(make_shared<Task_local>(array<const Index,4>{{c1, x2, x1, x0}}, in, t[0], range));
154 }
155
Task210(vector<shared_ptr<Tensor>> t,array<shared_ptr<const IndexRange>,3> range)156 Task210::Task210(vector<shared_ptr<Tensor>> t, array<shared_ptr<const IndexRange>,3> range) {
157 array<shared_ptr<const Tensor>,1> in = {{t[1]}};
158 out_ = t[0];
159 in_ = in;
160 subtasks_.reserve(range[2]->nblock()*range[0]->nblock()*range[1]->nblock()*range[0]->nblock());
161 for (auto& a2 : *range[2])
162 for (auto& c1 : *range[0])
163 for (auto& x0 : *range[1])
164 for (auto& c3 : *range[0])
165 if (t[0]->is_local(c3, x0, c1, a2))
166 subtasks_.push_back(make_shared<Task_local>(array<const Index,4>{{c3, x0, c1, a2}}, in, t[0], range));
167 }
168
Task211(vector<shared_ptr<Tensor>> t,array<shared_ptr<const IndexRange>,3> range)169 Task211::Task211(vector<shared_ptr<Tensor>> t, array<shared_ptr<const IndexRange>,3> range) {
170 array<shared_ptr<const Tensor>,2> in = {{t[1], t[2]}};
171 out_ = t[0];
172 in_ = in;
173 subtasks_.reserve(range[1]->nblock()*range[2]->nblock()*range[0]->nblock()*range[0]->nblock());
174 for (auto& x0 : *range[1])
175 for (auto& a2 : *range[2])
176 for (auto& c1 : *range[0])
177 for (auto& c3 : *range[0])
178 if (t[0]->is_local(c3, c1, a2, x0))
179 subtasks_.push_back(make_shared<Task_local>(array<const Index,4>{{c3, c1, a2, x0}}, in, t[0], range));
180 }
181
Task212(vector<shared_ptr<Tensor>> t,array<shared_ptr<const IndexRange>,3> range)182 Task212::Task212(vector<shared_ptr<Tensor>> t, array<shared_ptr<const IndexRange>,3> range) {
183 array<shared_ptr<const Tensor>,1> in = {{t[1]}};
184 out_ = t[0];
185 in_ = in;
186 subtasks_.reserve(range[2]->nblock()*range[0]->nblock()*range[1]->nblock()*range[0]->nblock());
187 for (auto& a2 : *range[2])
188 for (auto& c1 : *range[0])
189 for (auto& x1 : *range[1])
190 for (auto& c3 : *range[0])
191 if (t[0]->is_local(c3, x1, c1, a2))
192 subtasks_.push_back(make_shared<Task_local>(array<const Index,4>{{c3, x1, c1, a2}}, in, t[0], range));
193 }
194
Task213(vector<shared_ptr<Tensor>> t,array<shared_ptr<const IndexRange>,3> range)195 Task213::Task213(vector<shared_ptr<Tensor>> t, array<shared_ptr<const IndexRange>,3> range) {
196 array<shared_ptr<const Tensor>,1> in = {{t[1]}};
197 out_ = t[0];
198 in_ = in;
199 subtasks_.reserve(range[2]->nblock()*range[1]->nblock()*range[1]->nblock()*range[0]->nblock());
200 for (auto& a1 : *range[2])
201 for (auto& x0 : *range[1])
202 for (auto& x1 : *range[1])
203 for (auto& c2 : *range[0])
204 if (t[0]->is_local(c2, x1, x0, a1))
205 subtasks_.push_back(make_shared<Task_local>(array<const Index,4>{{c2, x1, x0, a1}}, in, t[0], range));
206 }
207
Task214(vector<shared_ptr<Tensor>> t,array<shared_ptr<const IndexRange>,3> range)208 Task214::Task214(vector<shared_ptr<Tensor>> t, array<shared_ptr<const IndexRange>,3> range) {
209 array<shared_ptr<const Tensor>,2> in = {{t[1], t[2]}};
210 out_ = t[0];
211 in_ = in;
212 subtasks_.reserve(range[1]->nblock()*range[1]->nblock()*range[2]->nblock()*range[0]->nblock());
213 for (auto& x0 : *range[1])
214 for (auto& x1 : *range[1])
215 for (auto& a1 : *range[2])
216 for (auto& c2 : *range[0])
217 if (t[0]->is_local(c2, a1, x1, x0))
218 subtasks_.push_back(make_shared<Task_local>(array<const Index,4>{{c2, a1, x1, x0}}, in, t[0], range));
219 }
220
Task215(vector<shared_ptr<Tensor>> t,array<shared_ptr<const IndexRange>,3> range)221 Task215::Task215(vector<shared_ptr<Tensor>> t, array<shared_ptr<const IndexRange>,3> range) {
222 array<shared_ptr<const Tensor>,1> in = {{t[1]}};
223 out_ = t[0];
224 in_ = in;
225 subtasks_.reserve(range[1]->nblock()*range[1]->nblock()*range[2]->nblock()*range[0]->nblock());
226 for (auto& x2 : *range[1])
227 for (auto& x3 : *range[1])
228 for (auto& a1 : *range[2])
229 for (auto& c2 : *range[0])
230 if (t[0]->is_local(c2, a1, x3, x2))
231 subtasks_.push_back(make_shared<Task_local>(array<const Index,4>{{c2, a1, x3, x2}}, in, t[0], range));
232 }
233
Task216(vector<shared_ptr<Tensor>> t,array<shared_ptr<const IndexRange>,3> range)234 Task216::Task216(vector<shared_ptr<Tensor>> t, array<shared_ptr<const IndexRange>,3> range) {
235 array<shared_ptr<const Tensor>,2> in = {{t[1], t[2]}};
236 out_ = t[0];
237 in_ = in;
238 subtasks_.reserve(range[1]->nblock()*range[1]->nblock()*range[2]->nblock()*range[0]->nblock());
239 for (auto& x0 : *range[1])
240 for (auto& x1 : *range[1])
241 for (auto& a1 : *range[2])
242 for (auto& c2 : *range[0])
243 if (t[0]->is_local(c2, a1, x1, x0))
244 subtasks_.push_back(make_shared<Task_local>(array<const Index,4>{{c2, a1, x1, x0}}, in, t[0], range));
245 }
246
Task217(vector<shared_ptr<Tensor>> t,array<shared_ptr<const IndexRange>,3> range)247 Task217::Task217(vector<shared_ptr<Tensor>> t, array<shared_ptr<const IndexRange>,3> range) {
248 array<shared_ptr<const Tensor>,2> in = {{t[1], t[2]}};
249 out_ = t[0];
250 in_ = in;
251 subtasks_.reserve(range[1]->nblock()*range[1]->nblock()*range[2]->nblock()*range[0]->nblock());
252 for (auto& x0 : *range[1])
253 for (auto& x1 : *range[1])
254 for (auto& a1 : *range[2])
255 for (auto& c2 : *range[0])
256 if (t[0]->is_local(c2, a1, x1, x0))
257 subtasks_.push_back(make_shared<Task_local>(array<const Index,4>{{c2, a1, x1, x0}}, in, t[0], range));
258 }
259
Task218(vector<shared_ptr<Tensor>> t,array<shared_ptr<const IndexRange>,3> range)260 Task218::Task218(vector<shared_ptr<Tensor>> t, array<shared_ptr<const IndexRange>,3> range) {
261 array<shared_ptr<const Tensor>,2> in = {{t[1], t[2]}};
262 out_ = t[0];
263 in_ = in;
264 subtasks_.reserve(range[1]->nblock()*range[1]->nblock()*range[2]->nblock()*range[0]->nblock());
265 for (auto& x0 : *range[1])
266 for (auto& x1 : *range[1])
267 for (auto& a1 : *range[2])
268 for (auto& c2 : *range[0])
269 if (t[0]->is_local(c2, a1, x1, x0))
270 subtasks_.push_back(make_shared<Task_local>(array<const Index,4>{{c2, a1, x1, x0}}, in, t[0], range));
271 }
272
Task219(vector<shared_ptr<Tensor>> t,array<shared_ptr<const IndexRange>,3> range)273 Task219::Task219(vector<shared_ptr<Tensor>> t, array<shared_ptr<const IndexRange>,3> range) {
274 array<shared_ptr<const Tensor>,1> in = {{t[1]}};
275 out_ = t[0];
276 in_ = in;
277 subtasks_.reserve(range[2]->nblock()*range[0]->nblock()*range[1]->nblock()*range[1]->nblock());
278 for (auto& a2 : *range[2])
279 for (auto& c1 : *range[0])
280 for (auto& x1 : *range[1])
281 for (auto& x0 : *range[1])
282 if (t[0]->is_local(x0, x1, c1, a2))
283 subtasks_.push_back(make_shared<Task_local>(array<const Index,4>{{x0, x1, c1, a2}}, in, t[0], range));
284 }
285
Task220(vector<shared_ptr<Tensor>> t,array<shared_ptr<const IndexRange>,3> range)286 Task220::Task220(vector<shared_ptr<Tensor>> t, array<shared_ptr<const IndexRange>,3> range) {
287 array<shared_ptr<const Tensor>,2> in = {{t[1], t[2]}};
288 out_ = t[0];
289 in_ = in;
290 subtasks_.reserve(range[1]->nblock()*range[1]->nblock()*range[2]->nblock()*range[0]->nblock());
291 for (auto& x0 : *range[1])
292 for (auto& x1 : *range[1])
293 for (auto& a2 : *range[2])
294 for (auto& c1 : *range[0])
295 if (t[0]->is_local(c1, a2, x1, x0))
296 subtasks_.push_back(make_shared<Task_local>(array<const Index,4>{{c1, a2, x1, x0}}, in, t[0], range));
297 }
298
Task221(vector<shared_ptr<Tensor>> t,array<shared_ptr<const IndexRange>,3> range)299 Task221::Task221(vector<shared_ptr<Tensor>> t, array<shared_ptr<const IndexRange>,3> range) {
300 array<shared_ptr<const Tensor>,1> in = {{t[1]}};
301 out_ = t[0];
302 in_ = in;
303 subtasks_.reserve(range[1]->nblock()*range[1]->nblock()*range[2]->nblock()*range[0]->nblock());
304 for (auto& x2 : *range[1])
305 for (auto& x3 : *range[1])
306 for (auto& a2 : *range[2])
307 for (auto& c1 : *range[0])
308 if (t[0]->is_local(c1, a2, x3, x2))
309 subtasks_.push_back(make_shared<Task_local>(array<const Index,4>{{c1, a2, x3, x2}}, in, t[0], range));
310 }
311
Task222(vector<shared_ptr<Tensor>> t,array<shared_ptr<const IndexRange>,3> range)312 Task222::Task222(vector<shared_ptr<Tensor>> t, array<shared_ptr<const IndexRange>,3> range) {
313 array<shared_ptr<const Tensor>,2> in = {{t[1], t[2]}};
314 out_ = t[0];
315 in_ = in;
316 subtasks_.reserve(range[1]->nblock()*range[1]->nblock()*range[2]->nblock()*range[0]->nblock());
317 for (auto& x0 : *range[1])
318 for (auto& x1 : *range[1])
319 for (auto& a2 : *range[2])
320 for (auto& c1 : *range[0])
321 if (t[0]->is_local(c1, a2, x1, x0))
322 subtasks_.push_back(make_shared<Task_local>(array<const Index,4>{{c1, a2, x1, x0}}, in, t[0], range));
323 }
324
Task223(vector<shared_ptr<Tensor>> t,array<shared_ptr<const IndexRange>,3> range)325 Task223::Task223(vector<shared_ptr<Tensor>> t, array<shared_ptr<const IndexRange>,3> range) {
326 array<shared_ptr<const Tensor>,2> in = {{t[1], t[2]}};
327 out_ = t[0];
328 in_ = in;
329 subtasks_.reserve(range[1]->nblock()*range[1]->nblock()*range[2]->nblock()*range[0]->nblock());
330 for (auto& x0 : *range[1])
331 for (auto& x1 : *range[1])
332 for (auto& a2 : *range[2])
333 for (auto& c1 : *range[0])
334 if (t[0]->is_local(c1, a2, x1, x0))
335 subtasks_.push_back(make_shared<Task_local>(array<const Index,4>{{c1, a2, x1, x0}}, in, t[0], range));
336 }
337
Task224(vector<shared_ptr<Tensor>> t,array<shared_ptr<const IndexRange>,3> range)338 Task224::Task224(vector<shared_ptr<Tensor>> t, array<shared_ptr<const IndexRange>,3> range) {
339 array<shared_ptr<const Tensor>,1> in = {{t[1]}};
340 out_ = t[0];
341 in_ = in;
342 subtasks_.reserve(range[2]->nblock()*range[1]->nblock()*range[1]->nblock()*range[1]->nblock());
343 for (auto& a1 : *range[2])
344 for (auto& x0 : *range[1])
345 for (auto& x2 : *range[1])
346 for (auto& x1 : *range[1])
347 if (t[0]->is_local(x1, x2, x0, a1))
348 subtasks_.push_back(make_shared<Task_local>(array<const Index,4>{{x1, x2, x0, a1}}, in, t[0], range));
349 }
350
Task225(vector<shared_ptr<Tensor>> t,array<shared_ptr<const IndexRange>,3> range)351 Task225::Task225(vector<shared_ptr<Tensor>> t, array<shared_ptr<const IndexRange>,3> range) {
352 array<shared_ptr<const Tensor>,2> in = {{t[1], t[2]}};
353 out_ = t[0];
354 in_ = in;
355 subtasks_.reserve(range[1]->nblock()*range[1]->nblock()*range[1]->nblock()*range[2]->nblock());
356 for (auto& x1 : *range[1])
357 for (auto& x2 : *range[1])
358 for (auto& x0 : *range[1])
359 for (auto& a1 : *range[2])
360 if (t[0]->is_local(a1, x0, x2, x1))
361 subtasks_.push_back(make_shared<Task_local>(array<const Index,4>{{a1, x0, x2, x1}}, in, t[0], range));
362 }
363
Task226(vector<shared_ptr<Tensor>> t,array<shared_ptr<const IndexRange>,3> range)364 Task226::Task226(vector<shared_ptr<Tensor>> t, array<shared_ptr<const IndexRange>,3> range) {
365 array<shared_ptr<const Tensor>,2> in = {{t[1], t[2]}};
366 out_ = t[0];
367 in_ = in;
368 subtasks_.reserve(range[1]->nblock()*range[1]->nblock()*range[1]->nblock()*range[2]->nblock());
369 for (auto& x1 : *range[1])
370 for (auto& x2 : *range[1])
371 for (auto& x0 : *range[1])
372 for (auto& a1 : *range[2])
373 if (t[0]->is_local(a1, x0, x2, x1))
374 subtasks_.push_back(make_shared<Task_local>(array<const Index,4>{{a1, x0, x2, x1}}, in, t[0], range));
375 }
376
Task227(vector<shared_ptr<Tensor>> t,array<shared_ptr<const IndexRange>,3> range)377 Task227::Task227(vector<shared_ptr<Tensor>> t, array<shared_ptr<const IndexRange>,3> range) {
378 array<shared_ptr<const Tensor>,2> in = {{t[1], t[2]}};
379 out_ = t[0];
380 in_ = in;
381 subtasks_.reserve(range[1]->nblock()*range[1]->nblock()*range[1]->nblock()*range[2]->nblock());
382 for (auto& x1 : *range[1])
383 for (auto& x2 : *range[1])
384 for (auto& x0 : *range[1])
385 for (auto& a1 : *range[2])
386 if (t[0]->is_local(a1, x0, x2, x1))
387 subtasks_.push_back(make_shared<Task_local>(array<const Index,4>{{a1, x0, x2, x1}}, in, t[0], range));
388 }
389
Task228(vector<shared_ptr<Tensor>> t,array<shared_ptr<const IndexRange>,3> range)390 Task228::Task228(vector<shared_ptr<Tensor>> t, array<shared_ptr<const IndexRange>,3> range) {
391 array<shared_ptr<const Tensor>,1> in = {{t[1]}};
392 out_ = t[0];
393 in_ = in;
394 subtasks_.reserve(range[2]->nblock()*range[0]->nblock()*range[2]->nblock()*range[0]->nblock());
395 for (auto& a2 : *range[2])
396 for (auto& c1 : *range[0])
397 for (auto& a4 : *range[2])
398 for (auto& c3 : *range[0])
399 if (t[0]->is_local(c3, a4, c1, a2))
400 subtasks_.push_back(make_shared<Task_local>(array<const Index,4>{{c3, a4, c1, a2}}, in, t[0], range));
401 }
402
Task229(vector<shared_ptr<Tensor>> t,array<shared_ptr<const IndexRange>,3> range)403 Task229::Task229(vector<shared_ptr<Tensor>> t, array<shared_ptr<const IndexRange>,3> range) {
404 array<shared_ptr<const Tensor>,1> in = {{t[1]}};
405 out_ = t[0];
406 in_ = in;
407 subtasks_.reserve(range[2]->nblock()*range[0]->nblock()*range[2]->nblock()*range[0]->nblock());
408 for (auto& a2 : *range[2])
409 for (auto& c3 : *range[0])
410 for (auto& a4 : *range[2])
411 for (auto& c1 : *range[0])
412 if (t[0]->is_local(c1, a4, c3, a2))
413 subtasks_.push_back(make_shared<Task_local>(array<const Index,4>{{c1, a4, c3, a2}}, in, t[0], range));
414 }
415
Task230(vector<shared_ptr<Tensor>> t,array<shared_ptr<const IndexRange>,3> range)416 Task230::Task230(vector<shared_ptr<Tensor>> t, array<shared_ptr<const IndexRange>,3> range) {
417 array<shared_ptr<const Tensor>,1> in = {{t[1]}};
418 out_ = t[0];
419 in_ = in;
420 subtasks_.reserve(range[2]->nblock()*range[1]->nblock()*range[2]->nblock()*range[0]->nblock());
421 for (auto& a1 : *range[2])
422 for (auto& x0 : *range[1])
423 for (auto& a3 : *range[2])
424 for (auto& c2 : *range[0])
425 if (t[0]->is_local(c2, a3, x0, a1))
426 subtasks_.push_back(make_shared<Task_local>(array<const Index,4>{{c2, a3, x0, a1}}, in, t[0], range));
427 }
428
Task231(vector<shared_ptr<Tensor>> t,array<shared_ptr<const IndexRange>,3> range)429 Task231::Task231(vector<shared_ptr<Tensor>> t, array<shared_ptr<const IndexRange>,3> range) {
430 array<shared_ptr<const Tensor>,2> in = {{t[1], t[2]}};
431 out_ = t[0];
432 in_ = in;
433 subtasks_.reserve(range[1]->nblock()*range[2]->nblock()*range[0]->nblock()*range[2]->nblock());
434 for (auto& x0 : *range[1])
435 for (auto& a1 : *range[2])
436 for (auto& c2 : *range[0])
437 for (auto& a3 : *range[2])
438 if (t[0]->is_local(a3, c2, a1, x0))
439 subtasks_.push_back(make_shared<Task_local>(array<const Index,4>{{a3, c2, a1, x0}}, in, t[0], range));
440 }
441
Task232(vector<shared_ptr<Tensor>> t,array<shared_ptr<const IndexRange>,3> range)442 Task232::Task232(vector<shared_ptr<Tensor>> t, array<shared_ptr<const IndexRange>,3> range) {
443 array<shared_ptr<const Tensor>,1> in = {{t[1]}};
444 out_ = t[0];
445 in_ = in;
446 subtasks_.reserve(range[2]->nblock()*range[0]->nblock()*range[2]->nblock()*range[1]->nblock());
447 for (auto& a1 : *range[2])
448 for (auto& c2 : *range[0])
449 for (auto& a3 : *range[2])
450 for (auto& x1 : *range[1])
451 if (t[0]->is_local(x1, a3, c2, a1))
452 subtasks_.push_back(make_shared<Task_local>(array<const Index,4>{{x1, a3, c2, a1}}, in, t[0], range));
453 }
454
Task233(vector<shared_ptr<Tensor>> t,array<shared_ptr<const IndexRange>,3> range)455 Task233::Task233(vector<shared_ptr<Tensor>> t, array<shared_ptr<const IndexRange>,3> range) {
456 array<shared_ptr<const Tensor>,1> in = {{t[1]}};
457 out_ = t[0];
458 in_ = in;
459 subtasks_.reserve(range[2]->nblock()*range[1]->nblock()*range[2]->nblock()*range[1]->nblock());
460 for (auto& a1 : *range[2])
461 for (auto& x0 : *range[1])
462 for (auto& a2 : *range[2])
463 for (auto& x1 : *range[1])
464 if (t[0]->is_local(x1, a2, x0, a1))
465 subtasks_.push_back(make_shared<Task_local>(array<const Index,4>{{x1, a2, x0, a1}}, in, t[0], range));
466 }
467
Task234(vector<shared_ptr<Tensor>> t,array<shared_ptr<const IndexRange>,3> range)468 Task234::Task234(vector<shared_ptr<Tensor>> t, array<shared_ptr<const IndexRange>,3> range) {
469 array<shared_ptr<const Tensor>,2> in = {{t[1], t[2]}};
470 out_ = t[0];
471 in_ = in;
472 subtasks_.reserve(range[1]->nblock()*range[1]->nblock()*range[2]->nblock()*range[2]->nblock());
473 for (auto& x1 : *range[1])
474 for (auto& x0 : *range[1])
475 for (auto& a2 : *range[2])
476 for (auto& a1 : *range[2])
477 if (t[0]->is_local(a1, a2, x0, x1))
478 subtasks_.push_back(make_shared<Task_local>(array<const Index,4>{{a1, a2, x0, x1}}, in, t[0], range));
479 }
480
Task235(vector<shared_ptr<Tensor>> t,const bool reset)481 Task235::Task235(vector<shared_ptr<Tensor>> t, const bool reset) : reset_(reset) {
482 n_ = t[0];
483 }
484
Task236(vector<shared_ptr<Tensor>> t,array<shared_ptr<const IndexRange>,3> range)485 Task236::Task236(vector<shared_ptr<Tensor>> t, array<shared_ptr<const IndexRange>,3> range) {
486 array<shared_ptr<const Tensor>,1> in = {{t[1]}};
487 out_ = t[0];
488 in_ = in;
489 subtasks_.reserve(range[1]->nblock()*range[0]->nblock()*range[1]->nblock()*range[0]->nblock());
490 for (auto& x0 : *range[1])
491 for (auto& c1 : *range[0])
492 for (auto& x1 : *range[1])
493 for (auto& c2 : *range[0])
494 if (t[0]->is_local(c2, x1, c1, x0))
495 subtasks_.push_back(make_shared<Task_local>(array<const Index,4>{{c2, x1, c1, x0}}, in, t[0], range));
496 }
497
Task237(vector<shared_ptr<Tensor>> t,array<shared_ptr<const IndexRange>,3> range)498 Task237::Task237(vector<shared_ptr<Tensor>> t, array<shared_ptr<const IndexRange>,3> range) {
499 array<shared_ptr<const Tensor>,2> in = {{t[1], t[2]}};
500 out_ = t[0];
501 in_ = in;
502 subtasks_.reserve(range[1]->nblock()*range[1]->nblock()*range[0]->nblock()*range[0]->nblock());
503 for (auto& x1 : *range[1])
504 for (auto& x0 : *range[1])
505 for (auto& c2 : *range[0])
506 for (auto& c1 : *range[0])
507 if (t[0]->is_local(c1, c2, x0, x1))
508 subtasks_.push_back(make_shared<Task_local>(array<const Index,4>{{c1, c2, x0, x1}}, in, t[0], range));
509 }
510
Task238(vector<shared_ptr<Tensor>> t,array<shared_ptr<const IndexRange>,3> range)511 Task238::Task238(vector<shared_ptr<Tensor>> t, array<shared_ptr<const IndexRange>,3> range) {
512 array<shared_ptr<const Tensor>,1> in = {{t[1]}};
513 out_ = t[0];
514 in_ = in;
515 subtasks_.reserve(range[1]->nblock()*range[1]->nblock()*range[1]->nblock()*range[0]->nblock());
516 for (auto& x1 : *range[1])
517 for (auto& x0 : *range[1])
518 for (auto& x2 : *range[1])
519 for (auto& c1 : *range[0])
520 if (t[0]->is_local(c1, x2, x0, x1))
521 subtasks_.push_back(make_shared<Task_local>(array<const Index,4>{{c1, x2, x0, x1}}, in, t[0], range));
522 }
523
Task239(vector<shared_ptr<Tensor>> t,array<shared_ptr<const IndexRange>,3> range)524 Task239::Task239(vector<shared_ptr<Tensor>> t, array<shared_ptr<const IndexRange>,3> range) {
525 array<shared_ptr<const Tensor>,2> in = {{t[1], t[2]}};
526 out_ = t[0];
527 in_ = in;
528 subtasks_.reserve(range[1]->nblock()*range[1]->nblock()*range[1]->nblock()*range[0]->nblock());
529 for (auto& x0 : *range[1])
530 for (auto& x1 : *range[1])
531 for (auto& x2 : *range[1])
532 for (auto& c1 : *range[0])
533 if (t[0]->is_local(c1, x2, x1, x0))
534 subtasks_.push_back(make_shared<Task_local>(array<const Index,4>{{c1, x2, x1, x0}}, in, t[0], range));
535 }
536
Task240(vector<shared_ptr<Tensor>> t,array<shared_ptr<const IndexRange>,3> range)537 Task240::Task240(vector<shared_ptr<Tensor>> t, array<shared_ptr<const IndexRange>,3> range) {
538 array<shared_ptr<const Tensor>,1> in = {{t[1]}};
539 out_ = t[0];
540 in_ = in;
541 subtasks_.reserve(range[2]->nblock()*range[0]->nblock()*range[1]->nblock()*range[0]->nblock());
542 for (auto& a2 : *range[2])
543 for (auto& c1 : *range[0])
544 for (auto& x0 : *range[1])
545 for (auto& c3 : *range[0])
546 if (t[0]->is_local(c3, x0, c1, a2))
547 subtasks_.push_back(make_shared<Task_local>(array<const Index,4>{{c3, x0, c1, a2}}, in, t[0], range));
548 }
549
Task241(vector<shared_ptr<Tensor>> t,array<shared_ptr<const IndexRange>,3> range)550 Task241::Task241(vector<shared_ptr<Tensor>> t, array<shared_ptr<const IndexRange>,3> range) {
551 array<shared_ptr<const Tensor>,2> in = {{t[1], t[2]}};
552 out_ = t[0];
553 in_ = in;
554 subtasks_.reserve(range[1]->nblock()*range[0]->nblock()*range[2]->nblock()*range[0]->nblock());
555 for (auto& x0 : *range[1])
556 for (auto& c1 : *range[0])
557 for (auto& a2 : *range[2])
558 for (auto& c3 : *range[0])
559 if (t[0]->is_local(c3, a2, c1, x0))
560 subtasks_.push_back(make_shared<Task_local>(array<const Index,4>{{c3, a2, c1, x0}}, in, t[0], range));
561 }
562
Task242(vector<shared_ptr<Tensor>> t,array<shared_ptr<const IndexRange>,3> range)563 Task242::Task242(vector<shared_ptr<Tensor>> t, array<shared_ptr<const IndexRange>,3> range) {
564 array<shared_ptr<const Tensor>,1> in = {{t[1]}};
565 out_ = t[0];
566 in_ = in;
567 subtasks_.reserve(range[1]->nblock()*range[0]->nblock()*range[2]->nblock()*range[0]->nblock());
568 for (auto& x1 : *range[1])
569 for (auto& c1 : *range[0])
570 for (auto& a2 : *range[2])
571 for (auto& c3 : *range[0])
572 if (t[0]->is_local(c3, a2, c1, x1))
573 subtasks_.push_back(make_shared<Task_local>(array<const Index,4>{{c3, a2, c1, x1}}, in, t[0], range));
574 }
575
Task243(vector<shared_ptr<Tensor>> t,array<shared_ptr<const IndexRange>,3> range)576 Task243::Task243(vector<shared_ptr<Tensor>> t, array<shared_ptr<const IndexRange>,3> range) {
577 array<shared_ptr<const Tensor>,1> in = {{t[1]}};
578 out_ = t[0];
579 in_ = in;
580 subtasks_.reserve(range[2]->nblock()*range[1]->nblock()*range[1]->nblock()*range[0]->nblock());
581 for (auto& a1 : *range[2])
582 for (auto& x0 : *range[1])
583 for (auto& x1 : *range[1])
584 for (auto& c2 : *range[0])
585 if (t[0]->is_local(c2, x1, x0, a1))
586 subtasks_.push_back(make_shared<Task_local>(array<const Index,4>{{c2, x1, x0, a1}}, in, t[0], range));
587 }
588
Task244(vector<shared_ptr<Tensor>> t,array<shared_ptr<const IndexRange>,3> range)589 Task244::Task244(vector<shared_ptr<Tensor>> t, array<shared_ptr<const IndexRange>,3> range) {
590 array<shared_ptr<const Tensor>,2> in = {{t[1], t[2]}};
591 out_ = t[0];
592 in_ = in;
593 subtasks_.reserve(range[1]->nblock()*range[1]->nblock()*range[0]->nblock()*range[2]->nblock());
594 for (auto& x1 : *range[1])
595 for (auto& x0 : *range[1])
596 for (auto& c2 : *range[0])
597 for (auto& a1 : *range[2])
598 if (t[0]->is_local(a1, c2, x0, x1))
599 subtasks_.push_back(make_shared<Task_local>(array<const Index,4>{{a1, c2, x0, x1}}, in, t[0], range));
600 }
601
Task245(vector<shared_ptr<Tensor>> t,array<shared_ptr<const IndexRange>,3> range)602 Task245::Task245(vector<shared_ptr<Tensor>> t, array<shared_ptr<const IndexRange>,3> range) {
603 array<shared_ptr<const Tensor>,2> in = {{t[1], t[2]}};
604 out_ = t[0];
605 in_ = in;
606 subtasks_.reserve(range[1]->nblock()*range[1]->nblock()*range[0]->nblock()*range[2]->nblock());
607 for (auto& x1 : *range[1])
608 for (auto& x0 : *range[1])
609 for (auto& c2 : *range[0])
610 for (auto& a1 : *range[2])
611 if (t[0]->is_local(a1, c2, x0, x1))
612 subtasks_.push_back(make_shared<Task_local>(array<const Index,4>{{a1, c2, x0, x1}}, in, t[0], range));
613 }
614
Task246(vector<shared_ptr<Tensor>> t,array<shared_ptr<const IndexRange>,3> range)615 Task246::Task246(vector<shared_ptr<Tensor>> t, array<shared_ptr<const IndexRange>,3> range) {
616 array<shared_ptr<const Tensor>,1> in = {{t[1]}};
617 out_ = t[0];
618 in_ = in;
619 subtasks_.reserve(range[2]->nblock()*range[0]->nblock()*range[1]->nblock()*range[1]->nblock());
620 for (auto& a2 : *range[2])
621 for (auto& c1 : *range[0])
622 for (auto& x1 : *range[1])
623 for (auto& x0 : *range[1])
624 if (t[0]->is_local(x0, x1, c1, a2))
625 subtasks_.push_back(make_shared<Task_local>(array<const Index,4>{{x0, x1, c1, a2}}, in, t[0], range));
626 }
627
Task247(vector<shared_ptr<Tensor>> t,array<shared_ptr<const IndexRange>,3> range)628 Task247::Task247(vector<shared_ptr<Tensor>> t, array<shared_ptr<const IndexRange>,3> range) {
629 array<shared_ptr<const Tensor>,2> in = {{t[1], t[2]}};
630 out_ = t[0];
631 in_ = in;
632 subtasks_.reserve(range[1]->nblock()*range[1]->nblock()*range[0]->nblock()*range[2]->nblock());
633 for (auto& x0 : *range[1])
634 for (auto& x1 : *range[1])
635 for (auto& c1 : *range[0])
636 for (auto& a2 : *range[2])
637 if (t[0]->is_local(a2, c1, x1, x0))
638 subtasks_.push_back(make_shared<Task_local>(array<const Index,4>{{a2, c1, x1, x0}}, in, t[0], range));
639 }
640
Task248(vector<shared_ptr<Tensor>> t,array<shared_ptr<const IndexRange>,3> range)641 Task248::Task248(vector<shared_ptr<Tensor>> t, array<shared_ptr<const IndexRange>,3> range) {
642 array<shared_ptr<const Tensor>,1> in = {{t[1]}};
643 out_ = t[0];
644 in_ = in;
645 subtasks_.reserve(range[1]->nblock()*range[0]->nblock()*range[2]->nblock()*range[1]->nblock());
646 for (auto& x2 : *range[1])
647 for (auto& c1 : *range[0])
648 for (auto& a2 : *range[2])
649 for (auto& x3 : *range[1])
650 if (t[0]->is_local(x3, a2, c1, x2))
651 subtasks_.push_back(make_shared<Task_local>(array<const Index,4>{{x3, a2, c1, x2}}, in, t[0], range));
652 }
653
Task249(vector<shared_ptr<Tensor>> t,array<shared_ptr<const IndexRange>,3> range)654 Task249::Task249(vector<shared_ptr<Tensor>> t, array<shared_ptr<const IndexRange>,3> range) {
655 array<shared_ptr<const Tensor>,1> in = {{t[1]}};
656 out_ = t[0];
657 in_ = in;
658 subtasks_.reserve(range[2]->nblock()*range[1]->nblock()*range[1]->nblock()*range[1]->nblock());
659 for (auto& a1 : *range[2])
660 for (auto& x0 : *range[1])
661 for (auto& x2 : *range[1])
662 for (auto& x1 : *range[1])
663 if (t[0]->is_local(x1, x2, x0, a1))
664 subtasks_.push_back(make_shared<Task_local>(array<const Index,4>{{x1, x2, x0, a1}}, in, t[0], range));
665 }
666
667 #endif
668