@@ -22,16 +22,6 @@ work_data_t::work_data_t(params_t const &p, inputs_t const &inputs, mpi::communi
22
22
gf_struct = p.gf_struct ;
23
23
n_color = count_colors (gf_struct);
24
24
25
- // Compute gf_block_size_partial_sum
26
- { // to make acc local
27
- long acc = 0 ;
28
- for (auto const &[s, l] : gf_struct) {
29
- if (l > 1 ) offdiag_delta = true ;
30
- gf_block_size_partial_sum.push_back (acc);
31
- acc += l;
32
- }
33
- }
34
-
35
25
// Compute color/block conversion tables
36
26
for (auto const &color : range (n_color)) {
37
27
block_number.push_back (find_block_number (color));
@@ -57,6 +47,8 @@ work_data_t::work_data_t(params_t const &p, inputs_t const &inputs, mpi::communi
57
47
spdlog::info (" Orbital energies: mu - eps = {}" , mu);
58
48
}
59
49
50
+ // FIXME: Convert here Block2Gf to matrix Gf.
51
+
60
52
// Do we have D(tau) and J_perp(tau)? Yes, unless the data is 0
61
53
has_Dt = max_element (abs (inputs.d0t .data ())) > 1 .e -13 ;
62
54
has_jperp = max_element (abs (inputs.jperpt .data ())) > 1 .e -13 ;
@@ -156,6 +148,11 @@ work_data_t::work_data_t(params_t const &p, inputs_t const &inputs, mpi::communi
156
148
if (c.rank () == 0 ) { spdlog::info (" Delta(tau) is 0, running only spin moves." ); }
157
149
}
158
150
151
+ // Does gf_struct allow for off-diagonal Delta?
152
+ for (auto const &[s, l] : gf_struct) {
153
+ if (l > 1 ) offdiag_delta = true ;
154
+ }
155
+
159
156
// Take the real part of Delta(tau)
160
157
delta = map ([](gf_const_view<imtime> d) { return real (d); }, inputs.delta );
161
158
for (auto const &bl : range (delta.size ())) {
@@ -169,6 +166,16 @@ work_data_t::work_data_t(params_t const &p, inputs_t const &inputs, mpi::communi
169
166
}
170
167
} // work_data constructor
171
168
169
+ int work_data_t::block_to_color (int block, int idx) const {
170
+ std::vector<long > gf_block_size_partial_sum;
171
+ long acc = 0 ;
172
+ for (auto const &[s, l] : gf_struct) {
173
+ gf_block_size_partial_sum.push_back (acc);
174
+ acc += l;
175
+ }
176
+ return gf_block_size_partial_sum[block] + idx;
177
+ }
178
+
172
179
long work_data_t::find_block_number (int color) const {
173
180
long bl = 0 ;
174
181
long colors_so_far = 0 ;
0 commit comments