From dee49fa88fc44db3bfcbe282b722790e8a9fceff Mon Sep 17 00:00:00 2001 From: Junya Otsuki Date: Tue, 8 May 2018 11:08:38 +0900 Subject: [PATCH] Clean up --- c++/pomerol_ed.cpp | 118 +-------------------------------------------- 1 file changed, 1 insertion(+), 117 deletions(-) diff --git a/c++/pomerol_ed.cpp b/c++/pomerol_ed.cpp index 5f138d4..8fb9049 100644 --- a/c++/pomerol_ed.cpp +++ b/c++/pomerol_ed.cpp @@ -397,76 +397,6 @@ namespace pomerol2triqs { /////////////////////////////////// // Two-particle Green's function // /////////////////////////////////// -/* - auto pomerol_ed::G2_iw(g2_iw_inu_inup_params_t const &p) -> g2_t { - if (!matrix_h) TRIQS_RUNTIME_ERROR << "G2_iw: no Hamiltonian has been diagonalized"; - compute_rho(p.beta); - compute_field_operators(p.gf_struct); - - if (verbose && !comm.rank()) { std::cout << "\nPomerol: computing TwoParticleGF" << std::endl; } - - Pomerol::ParticleIndex pom_i1 = lookup_pomerol_index(p.index1); - Pomerol::ParticleIndex pom_i2 = lookup_pomerol_index(p.index2); - Pomerol::ParticleIndex pom_i3 = lookup_pomerol_index(p.index3); - Pomerol::ParticleIndex pom_i4 = lookup_pomerol_index(p.index4); - - Pomerol::TwoParticleGF pom_g2(*states_class, *matrix_h, - ops_container->getAnnihilationOperator(pom_i2), - ops_container->getAnnihilationOperator(pom_i4), - ops_container->getCreationOperator(pom_i1), - ops_container->getCreationOperator(pom_i3), - *rho); - pom_g2.prepare(); - pom_g2.compute(false, {}, comm); - - // indices of fermionic Matsubara frequencies [-n_f:n_f) - std::vector index_wf(2*p.n_f); - std::iota(index_wf.begin(), index_wf.end(), -p.n_f); - // for( auto i : iw_f ) std::cout << i << std::endl; - - // indices of bosonic Matsubara frequencies [0:n_b) - std::vector index_wb(p.n_b); - std::iota(index_wb.begin(), index_wb.end(), 0); - // for( auto i : iw_b ) std::cout << i << std::endl; - - // std::cout << "Start freq loop: rank" << comm.rank() << std::endl; - // g2_t g2(p.n_b, 2*p.n_f, 2*p.n_f); - // // std::cout << typeid(g2).name() << std::endl; - // for(int ib=0; ib > three_freqs; - for(int ib=0; ib(three_freqs[i]); - int if1 = std::get<1>(three_freqs[i]); - int if2 = std::get<2>(three_freqs[i]); - g2(ib, if1, if2) = -pom_g2(index_wb[ib]+index_wf[if1], index_wf[if2], index_wf[if1]); - } - - // broadcast results - for(int i=0; i(three_freqs[i]); - int if1 = std::get<1>(three_freqs[i]); - int if2 = std::get<2>(three_freqs[i]); - int sender = i % comm.size(); - boost::mpi::broadcast(comm, g2(ib, if1, if2), sender); - } - - // std::cout << "End freq loop: rank" << comm.rank() << std::endl; - return g2; - } -*/ // core function for computing G2 triqs::arrays::array, 1> pomerol_ed::compute_g2_core(gf_struct_t const &gf_struct, double beta, channel_t channel, indices_t index1, indices_t index2, indices_t index3, indices_t index4, std::vector const &three_freqs){ @@ -540,6 +470,7 @@ namespace pomerol2triqs { return vec_g2[0]; } + auto pomerol_ed::G2_iw_freq_box(g2_iw_freq_box_params_t const &p) -> std::vector { // create a list of three frequencies, (wb, wf1, wf2) @@ -559,7 +490,6 @@ namespace pomerol2triqs { for(int ib=0; ib vec_g2_freq_vec = compute_g2(p.gf_struct, p.beta, p.channel, p.four_indices, three_freqs); // reshape G2 (from freq_vec to freq_box) @@ -590,51 +519,6 @@ namespace pomerol2triqs { auto pomerol_ed::G2_iw_freq_fix(g2_iw_freq_fix_params_t const &p) -> std::vector { return compute_g2(p.gf_struct, p.beta, p.channel, p.four_indices, p.three_freqs); } -/* - auto pomerol_ed::G2_iw_three_freqs(g2_three_freqs_params_t const &p) -> g2_three_freqs_t { - if (!matrix_h) TRIQS_RUNTIME_ERROR << "G2_iw: no Hamiltonian has been diagonalized"; - compute_rho(p.beta); - compute_field_operators(p.gf_struct); - - if (verbose && !comm.rank()) { std::cout << "\nPomerol: computing TwoParticleGF" << std::endl; } - - Pomerol::ParticleIndex pom_i1 = lookup_pomerol_index(p.index1); - Pomerol::ParticleIndex pom_i2 = lookup_pomerol_index(p.index2); - Pomerol::ParticleIndex pom_i3 = lookup_pomerol_index(p.index3); - Pomerol::ParticleIndex pom_i4 = lookup_pomerol_index(p.index4); - - Pomerol::TwoParticleGF pom_g2(*states_class, *matrix_h, - ops_container->getAnnihilationOperator(pom_i2), - ops_container->getAnnihilationOperator(pom_i4), - ops_container->getCreationOperator(pom_i1), - ops_container->getCreationOperator(pom_i3), - *rho); - pom_g2.prepare(); - pom_g2.compute(false, {}, comm); - - // compute g2 value using MPI - g2_three_freqs_t g2( p.three_freqs.size() ); - for(int i=comm.rank(); i(three_freqs[i]); - // int if1 = std::get<1>(three_freqs[i]); - // int if2 = std::get<2>(three_freqs[i]); - // g2(ib, if1, if2) = -pom_g2(index_wb[ib]+index_wf[if1], index_wf[if2], index_wf[if1]); - int wb = std::get<0>(p.three_freqs[i]); - int wf1 = std::get<1>(p.three_freqs[i]); - int wf2 = std::get<2>(p.three_freqs[i]); - g2[i] = -pom_g2(wb+wf1, wf2, wf1); - } - - // broadcast results - for(int i=0; i