Skip to content

Commit

Permalink
[gw] Moved splitting dyn and const parts out of gw_sigma_impl
Browse files Browse the repository at this point in the history
  • Loading branch information
YannIntVeld committed Mar 22, 2024
1 parent d7cf0a9 commit cdfd23a
Showing 1 changed file with 6 additions and 7 deletions.
13 changes: 6 additions & 7 deletions c++/triqs_tprf/lattice/gw.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -200,21 +200,19 @@ namespace triqs_tprf {
return fock_sigma(v_k, g_wk);
}

template<typename W_t, typename g_t>
auto gw_sigma_impl(W_t W_wk, g_t g_wk) {
template<typename W_dyn_t, typename W_const_t, typename g_t>
auto gw_sigma_impl(W_dyn_t W_dyn_wk, W_const_t W_const_k, g_t g_wk) {

auto Wwm = std::get<0>(W_wk.mesh());
auto Wwm = std::get<0>(W_dyn_wk.mesh());
auto gwm = std::get<0>(g_wk.mesh());

if (Wwm.beta() != gwm.beta())
TRIQS_RUNTIME_ERROR << "gw_sigma: inverse temperatures are not the same.\n";
if (Wwm.statistic() != Boson || gwm.statistic() != Fermion)
TRIQS_RUNTIME_ERROR << "gw_sigma: statistics are incorrect.\n";
if (std::get<1>(W_wk.mesh()) != std::get<1>(g_wk.mesh()))
if (std::get<1>(W_dyn_wk.mesh()) != std::get<1>(g_wk.mesh()))
TRIQS_RUNTIME_ERROR << "gw_sigma: k-space meshes are not the same.\n";

auto [W_dyn_wk, W_const_k] = split_into_dynamic_wk_and_constant_k(W_wk);

// Dynamic GW self energy
//auto g_tr = make_gf_from_fourier<0, 1>(g_wk); // Fixme! Use parallell transform
auto g_wr = fourier_wk_to_wr(g_wk);
Expand Down Expand Up @@ -245,7 +243,8 @@ namespace triqs_tprf {
}

g_wk_t gw_sigma(chi_wk_cvt W_wk, g_wk_cvt g_wk) {
return gw_sigma_impl(W_wk, g_wk);
auto [W_dyn_wk, W_const_k] = split_into_dynamic_wk_and_constant_k(W_wk);
return gw_sigma_impl(W_dyn_wk, W_const_k, g_wk);
}

/*
Expand Down

0 comments on commit cdfd23a

Please sign in to comment.