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