22#include "./G2_iw_nfft.hpp"
24namespace triqs_cthyb {
26 using namespace G2_iw;
28 template <G2_channel Channel>
29 measure_G2_iw_nfft<Channel>::measure_G2_iw_nfft(std::optional<G2_iw_t> &G2_iw_opt,
32 : measure_G2_iw_base<Channel>(G2_iw_opt, data, G2_measures) {
36 std::cout <<
"G2_iw_nfft NFFT buffer sizes:\n";
37 for (
auto bidx : range(M.size())) {
38 std::string bname = M.block_names()[bidx];
41 if (G2_measures.params.nfft_buf_sizes.count(bname)) {
42 buf_size = G2_measures.params.nfft_buf_sizes.at(bname);
44 array<long, 2> buf_sizes{M(bidx).target_shape()};
45 buf_sizes() = buf_size;
47 std::cout <<
"block_name = " << bname <<
" nfft_buf_size = " << buf_size <<
"\n";
49 M_nfft.emplace_back(M(bidx).mesh(), M(bidx).data(), buf_sizes);
54 template <G2_channel Channel>
void measure_G2_iw_nfft<Channel>::accumulate(mc_weight_t s) {
56 auto nfft_fill = [
this](det_type
const &det, nfft_array_t<2, 2> &nfft_matrix) {
57 const double beta = this->data.config.beta();
58 foreach (det, [&nfft_matrix, beta](op_t
const &x, op_t
const &y, det_scalar_t M) {
59 nfft_matrix.push_back({beta - double(x.first), double(y.first)}, {x.second, y.second}, M);
67 for (
auto bidx : range(M.size())) {
68 nfft_fill(data.dets[bidx], M_nfft[bidx]);
80 template class measure_G2_iw_nfft<G2_channel::AllFermionic>;
81 template class measure_G2_iw_nfft<G2_channel::PP>;
82 template class measure_G2_iw_nfft<G2_channel::PH>;