TRIQS/triqs_cthyb 4.0.0
A TRIQS application
Loading...
Searching...
No Matches
G2_iw_acc.hpp
1/*******************************************************************************
2 *
3 * TRIQS: a Toolbox for Research in Interacting Quantum Systems
4 *
5 * Copyright (C) 2018, The Simons Foundation & H. U.R. Strand
6 * Author: H. U.R. Strand
7 *
8 * TRIQS is free software: you can redistribute it and/or modify it under the
9 * terms of the GNU General Public License as published by the Free Software
10 * Foundation, either version 3 of the License, or (at your option) any later
11 * version.
12 *
13 * TRIQS is distributed in the hope that it will be useful, but WITHOUT ANY
14 * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
15 * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
16 * details.
17 *
18 * You should have received a copy of the GNU General Public License along with
19 * TRIQS. If not, see <http://www.gnu.org/licenses/>.
20 *
21 ******************************************************************************/
22#pragma once
23
24#include <vector>
25#include <mpi/mpi.hpp>
26#include <triqs/utility/timer.hpp> // DEBUG
27
28#include "../qmc_data.hpp"
29#include "util.hpp"
30
31namespace triqs_cthyb {
32
33 namespace G2_iw {
34
35 using namespace nda;
36
37 using M_block_t = block_gf<prod<imfreq, imfreq>, matrix_valued>;
38 using M_t = M_block_t::g_t;
39 using M_mesh_t = M_block_t::g_t::mesh_t;
40
41 using M_arr_t = array<std::complex<double>, 4>;
42 using M_block_arr_t = std::vector<M_arr_t>;
43
44 // Measure the two-particle Green's function in Matsubara frequency
45 template <G2_channel Channel> class measure_G2_iw_base {
46
47 public:
48 measure_G2_iw_base(std::optional<G2_iw_t> &G2_iw_opt, qmc_data const &data,
49 G2_measures_t const &G2_measures);
50 void accumulate_G2(mc_weight_t s);
51 void collect_results(mpi::communicator const &c);
52
53 protected:
54 qmc_data const &data;
55 G2_iw_t::view_type G2_iw;
56 mc_weight_t average_sign;
57 block_order order;
58 G2_measures_t G2_measures;
59
60 M_block_t M;
61 M_mesh_t M_mesh;
62
63 triqs::utility::timer timer_M;
64 triqs::utility::timer timer_G2;
65 };
66
67 } // namespace G2_iw
68
69} // namespace triqs_cthyb