@@ -29,8 +29,8 @@ namespace triqs_ctseg::measures {
29
29
30
30
auto g3w_vec = [&]() {
31
31
std::vector<gf<prod<imfreq, imfreq, imfreq>, tensor_valued<4 >>> green_v;
32
- for (auto const &[bl1_name, bl1_size] : p .gf_struct )
33
- for (auto const &[bl2_name, bl2_size] : p .gf_struct )
32
+ for (auto const &[bl1_name, bl1_size] : wdata .gf_struct )
33
+ for (auto const &[bl2_name, bl2_size] : wdata .gf_struct )
34
34
green_v.emplace_back (gf<prod<imfreq, imfreq, imfreq>, tensor_valued<4 >>(
35
35
{{beta, Fermion, p.n_iw_chi4_f , imfreq::option::all_frequencies},
36
36
{beta, Fermion, p.n_iw_chi4_f , imfreq::option::all_frequencies},
@@ -40,30 +40,26 @@ namespace triqs_ctseg::measures {
40
40
};
41
41
42
42
std::vector<std::string> block_names;
43
- for (auto const &[bl_name, bl_size] : p .gf_struct ) block_names.push_back (bl_name);
43
+ for (auto const &[bl_name, bl_size] : wdata .gf_struct ) block_names.push_back (bl_name);
44
44
auto bosonic_block_names = std::vector<std::string>{};
45
45
for (auto const &str1 : block_names)
46
46
for (auto const &str2 : block_names)
47
47
bosonic_block_names.push_back (str1 + " |" + str2);
48
48
49
49
g3w = make_block_gf<prod<imfreq, imfreq, imfreq>, tensor_valued<4 >>(bosonic_block_names, g3w_vec ());
50
50
f3w = make_block_gf<prod<imfreq, imfreq, imfreq>, tensor_valued<4 >>(bosonic_block_names, g3w_vec ());
51
-
52
- for (auto &g : g3w)
53
- g () = 0 ;
54
- for (auto &f : f3w)
55
- f () = 0 ;
56
51
57
52
LOG (" \n ====================== COMPUTING M-MATRIX ====================== \n " );
58
- if (measure_g3w) Mw_vector = compute_Mw (false );
59
- if (measure_f3w) nMw_vector = compute_Mw (true );
60
53
61
54
n_w_fermionic = std::get<0 >(g3w[0 ].mesh ().components ()).last_index () + 1 ;
62
55
n_w_bosonic = std::get<2 >(g3w[0 ].mesh ().components ()).last_index () + 1 ;
63
56
64
57
w_ini = (2 * (-n_w_fermionic) + 1 ) * M_PI / beta;
65
58
w_inc = 2 * M_PI / beta;
66
59
60
+ Mw_vector = compute_Mw (false );
61
+ if (measure_f3w) nMw_vector = compute_Mw (true );
62
+
67
63
}
68
64
69
65
// -------------------------------------
@@ -106,7 +102,7 @@ namespace triqs_ctseg::measures {
106
102
for (int m = 0 ; m < n_w_bosonic; m++) {
107
103
int n2 = n1 + m;
108
104
int n3 = n4 + m;
109
- g3w[bl](n1, n4, m)(a, b, c, d) + = s * Mw (b1, a, b, n1, n2) * Mw (b2, c, d, n3, n4);
105
+ g3w[bl](n1, n4, m)(a, b, c, d) = s * Mw (b1, a, b, n1, n2) * Mw (b2, c, d, n3, n4);
110
106
if (b1 == b2)
111
107
g3w[bl](n1, n4, m)(a, b, c, d) -= s * Mw (b1, a, d, n1, n4) * Mw (b2, c, b, n3, n2);
112
108
} // m
@@ -132,7 +128,7 @@ namespace triqs_ctseg::measures {
132
128
for (int m = 0 ; m < n_w_bosonic; m++) {
133
129
int n2 = n1 + m;
134
130
int n3 = n4 + m;
135
- f3w[bl](n1, n4, m)(a, b, c, d) + = s * nMw (b1, a, b, n1, n2) * Mw (b2, c, d, n3, n4);
131
+ f3w[bl](n1, n4, m)(a, b, c, d) = s * nMw (b1, a, b, n1, n2) * Mw (b2, c, d, n3, n4);
136
132
if (b1 == b2)
137
133
f3w[bl](n1, n4, m)(a, b, c, d) -= s * nMw (b1, a, d, n1, n4) * Mw (b2, c, b, n3, n2);
138
134
} // m
@@ -143,7 +139,7 @@ namespace triqs_ctseg::measures {
143
139
} // b
144
140
} // a
145
141
} // bl
146
- }
142
+ } // measure_f3w
147
143
148
144
}
149
145
@@ -169,6 +165,7 @@ namespace triqs_ctseg::measures {
169
165
170
166
double four_point::fprefactor (long const &block, std::pair<tau_t , long > const &y) {
171
167
168
+ // Copied from G_F_tau.cpp
172
169
int color = wdata.block_to_color (block, y.second );
173
170
double I_tau = 0 ;
174
171
for (auto const &[c, sl] : itertools::enumerate (config.seglists )) {
@@ -189,9 +186,10 @@ namespace triqs_ctseg::measures {
189
186
190
187
// -------------------------------------
191
188
192
- vector<array<dcomplex, 4 >> four_point::compute_Mw (bool is_nMw) {
189
+ std::vector<array<dcomplex, 4 >> four_point::compute_Mw (bool is_nMw) {
190
+
193
191
int n_w_aux = 2 * n_w_fermionic + n_w_bosonic > 1 ? 2 * n_w_fermionic + n_w_bosonic - 1 : 0 ;
194
- vector<array<dcomplex, 4 >> result;
192
+ std:: vector<array<dcomplex, 4 >> result;
195
193
result.resize (wdata.gf_struct .size ());
196
194
197
195
for (auto const &[bl, bl_pair] : itertools::enumerate (wdata.gf_struct )) {
@@ -241,8 +239,8 @@ namespace triqs_ctseg::measures {
241
239
}
242
240
}
243
241
}
244
-
245
242
return result;
243
+
246
244
}
247
245
248
246
} // namespace triqs_ctseg::measures
0 commit comments