diff --git a/c++/g2_parameters.hpp b/c++/g2_parameters.hpp index 168d168..584dc32 100644 --- a/c++/g2_parameters.hpp +++ b/c++/g2_parameters.hpp @@ -4,7 +4,7 @@ using triqs::hilbert_space::gf_struct_t; using indices_t = triqs::hilbert_space::fundamental_operator_set::indices_t; using four_indices_t = std::tuple; -using three_freqs_t = std::vector< std::tuple >; +using three_freqs_t = std::tuple; namespace pomerol2triqs { @@ -21,11 +21,13 @@ namespace pomerol2triqs { /// Inverse temperature double beta; - /// Channel in which Matsubara frequency representation is defined. + /// Channel in which Matsubara frequency representation is defined channel_t channel = PH; - /// Number of bosonic and fermionic Matsubara frequencies. - int n_b, n_f; + /// Number of non-negative bosonic Matsubara frequencies + int n_b; + /// Number of positive fermionic Matsubara frequencies + int n_f; /// indices of operators in TRIQS convention: (block_name, inner_index) indices_t index1, index2, index3, index4; @@ -42,17 +44,19 @@ namespace pomerol2triqs { /// Inverse temperature double beta; - /// Channel in which Matsubara frequency representation is defined. + /// Channel in which Matsubara frequency representation is defined channel_t channel = PH; - /// Number of bosonic and fermionic Matsubara frequencies. - int n_b, n_f; + /// Number of non-negative bosonic Matsubara frequencies + int n_b; + /// Number of positive fermionic Matsubara frequencies + int n_f; - /// set of indices of four operators in TRIQS convention: (block_name, inner_index)*4 - std::vector vec_four_indices; + /// four operator indices in TRIQS convention: (block_name, inner_index)*4 + std::vector four_indices; }; - struct g2_iw_freq_vec_params_t { + struct g2_iw_freq_fix_params_t { /// Block structure of GF gf_struct_t gf_struct; @@ -60,15 +64,14 @@ namespace pomerol2triqs { /// Inverse temperature double beta; - /// Channel in which Matsubara frequency representation is defined. + /// Channel in which Matsubara frequency representation is defined channel_t channel = PH; /// three frequencies (wb, wf1, wf2). - three_freqs_t three_freqs; + std::vector three_freqs; - /// set of indices of four operators in TRIQS convention: (block_name, inner_index)*4 - // indices_t index1, index2, index3, index4; - std::vector vec_four_indices; + /// four operator indices in TRIQS convention: (block_name, inner_index)*4 + std::vector four_indices; }; /* diff --git a/c++/pomerol_ed.cpp b/c++/pomerol_ed.cpp index 8a56472..5f138d4 100644 --- a/c++/pomerol_ed.cpp +++ b/c++/pomerol_ed.cpp @@ -469,7 +469,7 @@ namespace pomerol2triqs { */ // core function for computing G2 - std::vector > pomerol_ed::compute_g2(gf_struct_t const &gf_struct, double beta, channel_t channel, indices_t index1, indices_t index2, indices_t index3, indices_t index4, three_freqs_t const &three_freqs){ + 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){ if (!matrix_h) TRIQS_RUNTIME_ERROR << "G2_iw: no Hamiltonian has been diagonalized"; compute_rho(beta); @@ -492,34 +492,35 @@ namespace pomerol2triqs { pom_g2.compute(false, {}, comm); // compute g2 value using MPI - g2_iw_freq_vec_t g2( three_freqs.size() ); + g2_iw_freq_fix_t g2( three_freqs.size() ); for(int i=comm.rank(); i(three_freqs[i]); int wf1 = std::get<1>(three_freqs[i]); int wf2 = std::get<2>(three_freqs[i]); - g2[i] = -pom_g2(wb+wf1, wf2, wf1); + g2(i) = -pom_g2(wb+wf1, wf2, wf1); } // broadcast results for(int i=0; i > > pomerol_ed::compute_g2_indices_loop(gf_struct_t const &gf_struct, double beta, channel_t channel, std::vector const &vec_four_indices, three_freqs_t const &three_freqs){ - std::vector vec_g2; + std::vector< triqs::arrays::array, 1> > pomerol_ed::compute_g2(gf_struct_t const &gf_struct, double beta, channel_t channel, std::vector const &four_indices, std::vector const &three_freqs){ + + std::vector vec_g2; // TODO: MPI - for( auto four_indices : vec_four_indices ){ - indices_t index1 = std::get<0>(four_indices); - indices_t index2 = std::get<1>(four_indices); - indices_t index3 = std::get<2>(four_indices); - indices_t index4 = std::get<3>(four_indices); - vec_g2.push_back( compute_g2(gf_struct, beta, channel, index1, index2, index3, index4, three_freqs) ); + for( auto ind4 : four_indices ){ + indices_t index1 = std::get<0>(ind4); + indices_t index2 = std::get<1>(ind4); + indices_t index3 = std::get<2>(ind4); + indices_t index4 = std::get<3>(ind4); + vec_g2.push_back( compute_g2_core(gf_struct, beta, channel, index1, index2, index3, index4, three_freqs) ); } return vec_g2; } @@ -532,8 +533,8 @@ namespace pomerol2triqs { p2.channel = p.channel; p2.n_b = p.n_b; p2.n_f = p.n_f; - four_indices_t four_indices = std::make_tuple(p.index1, p.index2, p.index3, p.index4); - p2.vec_four_indices.push_back( four_indices ); + four_indices_t ind4 = std::make_tuple(p.index1, p.index2, p.index3, p.index4); + p2.four_indices.push_back( ind4 ); std::vector vec_g2 = G2_iw_freq_box(p2); return vec_g2[0]; @@ -542,7 +543,7 @@ namespace pomerol2triqs { 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) - three_freqs_t three_freqs; + std::vector three_freqs; std::vector< std::tuple > three_indices; // (ib, if1, if2) { // indices of fermionic Matsubara frequencies [-n_f:n_f) @@ -566,8 +567,8 @@ namespace pomerol2triqs { } // compute g2 values - // g2_iw_freq_vec_t g2_three_freqs = compute_g2(p.gf_struct, p.beta, p.channel, p.index1, p.index2, p.index3, p.index4, three_freqs); - std::vector vec_g2_freq_vec = compute_g2_indices_loop(p.gf_struct, p.beta, p.channel, p.vec_four_indices, three_freqs); + // g2_iw_freq_fix_t g2_three_freqs = compute_g2(p.gf_struct, p.beta, p.channel, p.index1, p.index2, p.index3, p.index4, three_freqs); + std::vector 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) std::vector vec_g2_freq_box; @@ -577,7 +578,7 @@ namespace pomerol2triqs { int ib = std::get<0>(three_indices[i]); int if1 = std::get<1>(three_indices[i]); int if2 = std::get<2>(three_indices[i]); - g2(ib, if1, if2) = g2_freq_vec[i]; + g2(ib, if1, if2) = g2_freq_vec(i); } vec_g2_freq_box.push_back(g2); } @@ -586,11 +587,8 @@ namespace pomerol2triqs { } - // auto pomerol_ed::G2_iw_three_freqs(g2_three_freqs_params_t const &p) -> g2_iw_freq_vec_t { - // return compute_g2(p.gf_struct, p.beta, p.channel, p.index1, p.index2, p.index3, p.index4, p.three_freqs); - // } - auto pomerol_ed::G2_iw_freqs_vec(g2_iw_freq_vec_params_t const &p) -> std::vector { - return compute_g2_indices_loop(p.gf_struct, p.beta, p.channel, p.vec_four_indices, p.three_freqs); + 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 { diff --git a/c++/pomerol_ed.hpp b/c++/pomerol_ed.hpp index 661e71f..5b4f4e5 100644 --- a/c++/pomerol_ed.hpp +++ b/c++/pomerol_ed.hpp @@ -83,14 +83,14 @@ namespace pomerol2triqs { // using w_nu_nup_t = cartesian_product; // using w_l_lp_t = cartesian_product; using g2_iw_freq_box_t = triqs::arrays::array, 3>; - using g2_iw_freq_vec_t = std::vector >; + using g2_iw_freq_fix_t = triqs::arrays::array, 1>; // template // block2_gf> compute_g2(gf_struct_t const &gf_struct, gf_mesh const &mesh, block_order_t block_order, // g2_blocks_t const &g2_blocks, Filler filler) const; - g2_iw_freq_vec_t compute_g2(gf_struct_t const &gf_struct, double beta, channel_t channel, indices_t index1, indices_t index2, indices_t index3, indices_t index4, three_freqs_t const &three_freqs); - // std::vector compute_g2_indices_loop(gf_struct_t const &gf_struct, double beta, channel_t channel, std::vector const &vec_four_indices, three_freqs_t const &three_freqs); - std::vector< g2_iw_freq_vec_t > compute_g2_indices_loop(gf_struct_t const &gf_struct, double beta, channel_t channel, std::vector const &vec_four_indices, three_freqs_t const &three_freqs); + g2_iw_freq_fix_t 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); + + std::vector compute_g2(gf_struct_t const &gf_struct, double beta, channel_t channel, std::vector const &four_indices, std::vector const &three_freqs); double density_matrix_cutoff = 1e-15; @@ -122,17 +122,17 @@ namespace pomerol2triqs { /// Retarded Green's function on real energy axis block_gf G_w(gf_struct_t const &gf_struct, double beta, std::pair const &energy_window, int n_w, double im_shift = 0); - /// Two-particle Green's function. Specify frequency cutoff, n_b and n_f. + /// Two-particle Green's function, Legacy support TRIQS_WRAP_ARG_AS_DICT g2_iw_freq_box_t G2_iw_legacy(g2_iw_legacy_params_t const &p); - /// Two-particle Green's function. Specify frequency cutoff, n_b and n_f. + /// Two-particle Green's function, in a low-frequency box with cutoff n_b and n_f TRIQS_WRAP_ARG_AS_DICT std::vector G2_iw_freq_box(g2_iw_freq_box_params_t const &p); - /// Two-particle Green's function. Specify three frequencies (wb, wf1, wf2). + /// Two-particle Green's function, for fixed frequencies (wb, wf1, wf2) TRIQS_WRAP_ARG_AS_DICT - std::vector G2_iw_freqs_vec(g2_iw_freq_vec_params_t const &p); + std::vector G2_iw_freq_fix(g2_iw_freq_fix_params_t const &p); /// Two-particle Green's function, Matsubara frequencies // TRIQS_WRAP_ARG_AS_DICT diff --git a/example/2band.atom.py b/example/2band.atom.py index 2f1628f..24a5841 100644 --- a/example/2band.atom.py +++ b/example/2band.atom.py @@ -96,10 +96,12 @@ ############################### # G2_iw = ed.G2_iw_legacy( index1=('up',0), index2=('dn',0), index3=('dn',1), index4=('up',1), **common_g2_params ) -G2_iw = ed.G2_iw_freq_box( vec_four_indices=[(('up',0), ('dn',0), ('dn',1), ('up',1)),], **common_g2_params )[0] -print type(G2_iw) -print G2_iw.shape +four_indices = [(('up',0), ('dn',0), ('dn',1), ('up',1))] +G2_iw = ed.G2_iw_freq_box( four_indices=four_indices, **common_g2_params ) + +print "G2_iw :", type(G2_iw), "of size", len(G2_iw) +print "G2_iw[0] :", type(G2_iw[0]), "of size", G2_iw[0].shape # # Compute G^{(2),ph}(i\omega;i\nu,i\nu'), AABB block order # G2_iw_inu_inup_ph_AABB = ed.G2_iw_inu_inup(channel = "PH", @@ -126,4 +128,4 @@ ar['G_iw'] = G_iw ar['G_tau'] = G_tau ar['G_w'] = G_w - ar['G2_ph'] = G2_iw + ar['G2_ph'] = G2_iw[0] diff --git a/example/slater.py b/example/slater.py index ff227cb..4a41cbf 100644 --- a/example/slater.py +++ b/example/slater.py @@ -137,19 +137,36 @@ common_g2_params = {'channel' : "PH", 'gf_struct' : gf_struct, - 'beta' : beta, - 'n_f' : g2_n_wf, - 'n_b' : g2_n_wb, } + 'beta' : beta,} ############################### # G^{(2)}(i\omega;i\nu,i\nu') # ############################### # G2_iw = ed.G2_iw_legacy( index1=('up',0), index2=('dn',0), index3=('dn',1), index4=('up',1), **common_g2_params ) -G2_iw = ed.G2_iw_freq_box( vec_four_indices=[(('up',0), ('dn',0), ('dn',1), ('up',1)),], **common_g2_params )[0] + +# four-operators indices +four_indices = [] +four_indices.append( (('up',0), ('dn',0), ('dn',1), ('up',1)) ) +four_indices.append( (('up',0), ('up',0), ('dn',1), ('dn',1)) ) + +# compute G2 in a low-frequency box +G2_iw = ed.G2_iw_freq_box( four_indices=four_indices, n_f=g2_n_wf, n_b=g2_n_wb, **common_g2_params ) + +if mpi.is_master_node(): + print "G2_iw :", type(G2_iw), "of size", len(G2_iw) + print "G2_iw[0] :", type(G2_iw[0]), "of size", G2_iw[0].shape + with HDFArchive('slater_gf.out.h5', 'a') as ar: + ar['G2_iw_freq_box'] = G2_iw + +# compute G2 for given freqs, (wb, wf1, wf2) +three_freqs = [] +three_freqs.append( (0, 1, 2) ) +three_freqs.append( (0, 1, -2) ) +G2_iw = ed.G2_iw_freq_fix( four_indices=four_indices, three_freqs=three_freqs, **common_g2_params ) if mpi.is_master_node(): - print type(G2_iw) - print G2_iw.shape + print "G2_iw :", type(G2_iw), "of size", len(G2_iw) + print "G2_iw[0] :", type(G2_iw[0]), "of size", G2_iw[0].shape with HDFArchive('slater_gf.out.h5', 'a') as ar: - ar['G2_iw'] = G2_iw + ar['G2_iw_freq_fix'] = G2_iw diff --git a/python/pomerol2triqs_converters.hxx b/python/pomerol2triqs_converters.hxx index abc54be..aa543f1 100644 --- a/python/pomerol2triqs_converters.hxx +++ b/python/pomerol2triqs_converters.hxx @@ -114,21 +114,22 @@ template <> struct py_converter { }} -// --- C++ Python converter for g2_iw_freq_vec_params_t +// --- C++ Python converter for g2_iw_freq_box_params_t #include #include #include namespace triqs { namespace py_tools { -template <> struct py_converter { - static PyObject *c2py(g2_iw_freq_vec_params_t const & x) { +template <> struct py_converter { + static PyObject *c2py(g2_iw_freq_box_params_t const & x) { PyObject * d = PyDict_New(); - PyDict_SetItemString( d, "gf_struct" , convert_to_python(x.gf_struct)); - PyDict_SetItemString( d, "beta" , convert_to_python(x.beta)); - PyDict_SetItemString( d, "channel" , convert_to_python(x.channel)); - PyDict_SetItemString( d, "three_freqs" , convert_to_python(x.three_freqs)); - PyDict_SetItemString( d, "vec_four_indices", convert_to_python(x.vec_four_indices)); + PyDict_SetItemString( d, "gf_struct" , convert_to_python(x.gf_struct)); + PyDict_SetItemString( d, "beta" , convert_to_python(x.beta)); + PyDict_SetItemString( d, "channel" , convert_to_python(x.channel)); + PyDict_SetItemString( d, "n_b" , convert_to_python(x.n_b)); + PyDict_SetItemString( d, "n_f" , convert_to_python(x.n_f)); + PyDict_SetItemString( d, "four_indices", convert_to_python(x.four_indices)); return d; } @@ -146,13 +147,14 @@ template <> struct py_converter { r = T{}; } - static g2_iw_freq_vec_params_t py2c(PyObject *dic) { - g2_iw_freq_vec_params_t res; + static g2_iw_freq_box_params_t py2c(PyObject *dic) { + g2_iw_freq_box_params_t res; res.gf_struct = convert_from_python(PyDict_GetItemString(dic, "gf_struct")); res.beta = convert_from_python(PyDict_GetItemString(dic, "beta")); - _get_optional(dic, "channel" , res.channel ,PH); - res.three_freqs = convert_from_python(PyDict_GetItemString(dic, "three_freqs")); - res.vec_four_indices = convert_from_python>(PyDict_GetItemString(dic, "vec_four_indices")); + _get_optional(dic, "channel" , res.channel ,PH); + res.n_b = convert_from_python(PyDict_GetItemString(dic, "n_b")); + res.n_f = convert_from_python(PyDict_GetItemString(dic, "n_f")); + res.four_indices = convert_from_python>(PyDict_GetItemString(dic, "four_indices")); return res; } @@ -183,7 +185,7 @@ template <> struct py_converter { std::stringstream fs, fs2; int err=0; #ifndef TRIQS_ALLOW_UNUSED_PARAMETERS - std::vector ks, all_keys = {"gf_struct","beta","channel","three_freqs","vec_four_indices"}; + std::vector ks, all_keys = {"gf_struct","beta","channel","n_b","n_f","four_indices"}; pyref keys = PyDict_Keys(dic); if (!convertible_from_python>(keys, true)) { fs << "\nThe dict keys are not strings"; @@ -195,16 +197,17 @@ template <> struct py_converter { fs << "\n"<< ++err << " The parameter '" << k << "' is not recognized."; #endif - _check_mandatory(dic, fs, err, "gf_struct" , "gf_struct_t"); - _check_mandatory(dic, fs, err, "beta" , "double"); - _check_optional (dic, fs, err, "channel" , "pomerol2triqs::channel_t"); - _check_mandatory(dic, fs, err, "three_freqs" , "three_freqs_t"); - _check_mandatory>(dic, fs, err, "vec_four_indices", "std::vector"); + _check_mandatory(dic, fs, err, "gf_struct" , "gf_struct_t"); + _check_mandatory(dic, fs, err, "beta" , "double"); + _check_optional (dic, fs, err, "channel" , "pomerol2triqs::channel_t"); + _check_mandatory(dic, fs, err, "n_b" , "int"); + _check_mandatory(dic, fs, err, "n_f" , "int"); + _check_mandatory>(dic, fs, err, "four_indices", "std::vector"); if (err) goto _error; return true; _error: - fs2 << "\n---- There " << (err > 1 ? "are " : "is ") << err<< " error"<<(err >1 ?"s" : "")<< " in Python -> C++ transcription for the class g2_iw_freq_vec_params_t\n" < 1 ? "are " : "is ") << err<< " error"<<(err >1 ?"s" : "")<< " in Python -> C++ transcription for the class g2_iw_freq_box_params_t\n" < struct py_converter { }} -// --- C++ Python converter for g2_iw_freq_box_params_t +// --- C++ Python converter for g2_iw_freq_fix_params_t #include #include #include namespace triqs { namespace py_tools { -template <> struct py_converter { - static PyObject *c2py(g2_iw_freq_box_params_t const & x) { +template <> struct py_converter { + static PyObject *c2py(g2_iw_freq_fix_params_t const & x) { PyObject * d = PyDict_New(); - PyDict_SetItemString( d, "gf_struct" , convert_to_python(x.gf_struct)); - PyDict_SetItemString( d, "beta" , convert_to_python(x.beta)); - PyDict_SetItemString( d, "channel" , convert_to_python(x.channel)); - PyDict_SetItemString( d, "n_b" , convert_to_python(x.n_b)); - PyDict_SetItemString( d, "n_f" , convert_to_python(x.n_f)); - PyDict_SetItemString( d, "vec_four_indices", convert_to_python(x.vec_four_indices)); + PyDict_SetItemString( d, "gf_struct" , convert_to_python(x.gf_struct)); + PyDict_SetItemString( d, "beta" , convert_to_python(x.beta)); + PyDict_SetItemString( d, "channel" , convert_to_python(x.channel)); + PyDict_SetItemString( d, "three_freqs" , convert_to_python(x.three_freqs)); + PyDict_SetItemString( d, "four_indices", convert_to_python(x.four_indices)); return d; } @@ -246,14 +248,13 @@ template <> struct py_converter { r = T{}; } - static g2_iw_freq_box_params_t py2c(PyObject *dic) { - g2_iw_freq_box_params_t res; + static g2_iw_freq_fix_params_t py2c(PyObject *dic) { + g2_iw_freq_fix_params_t res; res.gf_struct = convert_from_python(PyDict_GetItemString(dic, "gf_struct")); res.beta = convert_from_python(PyDict_GetItemString(dic, "beta")); - _get_optional(dic, "channel" , res.channel ,PH); - res.n_b = convert_from_python(PyDict_GetItemString(dic, "n_b")); - res.n_f = convert_from_python(PyDict_GetItemString(dic, "n_f")); - res.vec_four_indices = convert_from_python>(PyDict_GetItemString(dic, "vec_four_indices")); + _get_optional(dic, "channel" , res.channel ,PH); + res.three_freqs = convert_from_python>(PyDict_GetItemString(dic, "three_freqs")); + res.four_indices = convert_from_python>(PyDict_GetItemString(dic, "four_indices")); return res; } @@ -284,7 +285,7 @@ template <> struct py_converter { std::stringstream fs, fs2; int err=0; #ifndef TRIQS_ALLOW_UNUSED_PARAMETERS - std::vector ks, all_keys = {"gf_struct","beta","channel","n_b","n_f","vec_four_indices"}; + std::vector ks, all_keys = {"gf_struct","beta","channel","three_freqs","four_indices"}; pyref keys = PyDict_Keys(dic); if (!convertible_from_python>(keys, true)) { fs << "\nThe dict keys are not strings"; @@ -296,17 +297,16 @@ template <> struct py_converter { fs << "\n"<< ++err << " The parameter '" << k << "' is not recognized."; #endif - _check_mandatory(dic, fs, err, "gf_struct" , "gf_struct_t"); - _check_mandatory(dic, fs, err, "beta" , "double"); - _check_optional (dic, fs, err, "channel" , "pomerol2triqs::channel_t"); - _check_mandatory(dic, fs, err, "n_b" , "int"); - _check_mandatory(dic, fs, err, "n_f" , "int"); - _check_mandatory>(dic, fs, err, "vec_four_indices", "std::vector"); + _check_mandatory(dic, fs, err, "gf_struct" , "gf_struct_t"); + _check_mandatory(dic, fs, err, "beta" , "double"); + _check_optional (dic, fs, err, "channel" , "pomerol2triqs::channel_t"); + _check_mandatory >(dic, fs, err, "three_freqs" , "std::vector"); + _check_mandatory>(dic, fs, err, "four_indices", "std::vector"); if (err) goto _error; return true; _error: - fs2 << "\n---- There " << (err > 1 ? "are " : "is ") << err<< " error"<<(err >1 ?"s" : "")<< " in Python -> C++ transcription for the class g2_iw_freq_box_params_t\n" < 1 ? "are " : "is ") << err<< " error"<<(err >1 ?"s" : "")<< " in Python -> C++ transcription for the class g2_iw_freq_fix_params_t\n" <, 3> G2_iw_legacy (**pomerol2triqs::g2_iw_legacy_params_t)""", - doc = r"""Two-particle Green's function. Specify frequency cutoff, n_b and n_f.""") + doc = r"""Two-particle Green's function, Legacy support""") c.add_method("""std::vector< triqs::arrays::array, 3> > G2_iw_freq_box (**pomerol2triqs::g2_iw_freq_box_params_t)""", - doc = r"""Two-particle Green's function. Specify frequency cutoff, n_b and n_f.""") + doc = r"""Two-particle Green's function, in a low-frequency box with cutoff n_b and n_f""") -c.add_method("""std::vector< std::vector > > G2_iw_freqs_vec (**pomerol2triqs::g2_iw_freq_vec_params_t)""", - doc = r"""Two-particle Green's function. Specify three frequencies (wb, wf1, wf2).""") +c.add_method("""std::vector< triqs::arrays::array, 1> > G2_iw_freq_fix (**pomerol2triqs::g2_iw_freq_fix_params_t)""", + doc = r"""Two-particle Green's function, for fixed frequencies (wb, wf1, wf2)""") module.add_class(c) diff --git a/python/pomerol2triqs_parameters.rst b/python/pomerol2triqs_parameters.rst index 2e303b1..4030bee 100644 --- a/python/pomerol2triqs_parameters.rst +++ b/python/pomerol2triqs_parameters.rst @@ -5,11 +5,11 @@ +----------------+--------------------------+---------+----------------------------------------------------------------------+ | beta | double | -- | Inverse temperature | +----------------+--------------------------+---------+----------------------------------------------------------------------+ -| channel | pomerol2triqs::channel_t | PH | Channel in which Matsubara frequency representation is defined. | +| channel | pomerol2triqs::channel_t | PH | Channel in which Matsubara frequency representation is defined | +----------------+--------------------------+---------+----------------------------------------------------------------------+ -| n_b | int | -- | Number of bosonic and fermionic Matsubara frequencies. | +| n_b | int | -- | Number of non-negative bosonic Matsubara frequencies | +----------------+--------------------------+---------+----------------------------------------------------------------------+ -| n_f | int | -- | Number of bosonic and fermionic Matsubara frequencies. | +| n_f | int | -- | Number of positive fermionic Matsubara frequencies | +----------------+--------------------------+---------+----------------------------------------------------------------------+ | index1 | indices_t | -- | indices of operators in TRIQS convention: (block_name, inner_index) | +----------------+--------------------------+---------+----------------------------------------------------------------------+ @@ -22,34 +22,34 @@ -+------------------+-----------------------------+---------+------------------------------------------------------------------+ -| Parameter Name | Type | Default | Documentation | -+==================+=============================+=========+==================================================================+ -| gf_struct | gf_struct_t | -- | Block structure of GF | -+------------------+-----------------------------+---------+------------------------------------------------------------------+ -| beta | double | -- | Inverse temperature | -+------------------+-----------------------------+---------+------------------------------------------------------------------+ -| channel | pomerol2triqs::channel_t | PH | Channel in which Matsubara frequency representation is defined. | -+------------------+-----------------------------+---------+------------------------------------------------------------------+ -| three_freqs | three_freqs_t | -- | three frequencies (wb, wf1, wf2). | -+------------------+-----------------------------+---------+------------------------------------------------------------------+ -| vec_four_indices | std::vector | -- | | -+------------------+-----------------------------+---------+------------------------------------------------------------------+ ++----------------+-----------------------------+---------+-------------------------------------------------------------------------+ +| Parameter Name | Type | Default | Documentation | ++================+=============================+=========+=========================================================================+ +| gf_struct | gf_struct_t | -- | Block structure of GF | ++----------------+-----------------------------+---------+-------------------------------------------------------------------------+ +| beta | double | -- | Inverse temperature | ++----------------+-----------------------------+---------+-------------------------------------------------------------------------+ +| channel | pomerol2triqs::channel_t | PH | Channel in which Matsubara frequency representation is defined | ++----------------+-----------------------------+---------+-------------------------------------------------------------------------+ +| n_b | int | -- | Number of non-negative bosonic Matsubara frequencies | ++----------------+-----------------------------+---------+-------------------------------------------------------------------------+ +| n_f | int | -- | Number of positive fermionic Matsubara frequencies | ++----------------+-----------------------------+---------+-------------------------------------------------------------------------+ +| four_indices | std::vector | -- | four operator indices in TRIQS convention: (block_name, inner_index)*4 | ++----------------+-----------------------------+---------+-------------------------------------------------------------------------+ -+------------------+-----------------------------+---------+------------------------------------------------------------------------------------+ -| Parameter Name | Type | Default | Documentation | -+==================+=============================+=========+====================================================================================+ -| gf_struct | gf_struct_t | -- | Block structure of GF | -+------------------+-----------------------------+---------+------------------------------------------------------------------------------------+ -| beta | double | -- | Inverse temperature | -+------------------+-----------------------------+---------+------------------------------------------------------------------------------------+ -| channel | pomerol2triqs::channel_t | PH | Channel in which Matsubara frequency representation is defined. | -+------------------+-----------------------------+---------+------------------------------------------------------------------------------------+ -| n_b | int | -- | Number of bosonic and fermionic Matsubara frequencies. | -+------------------+-----------------------------+---------+------------------------------------------------------------------------------------+ -| n_f | int | -- | Number of bosonic and fermionic Matsubara frequencies. | -+------------------+-----------------------------+---------+------------------------------------------------------------------------------------+ -| vec_four_indices | std::vector | -- | set of indices of four operators in TRIQS convention: (block_name, inner_index)*4 | -+------------------+-----------------------------+---------+------------------------------------------------------------------------------------+ \ No newline at end of file ++----------------+-----------------------------+---------+-------------------------------------------------------------------------+ +| Parameter Name | Type | Default | Documentation | ++================+=============================+=========+=========================================================================+ +| gf_struct | gf_struct_t | -- | Block structure of GF | ++----------------+-----------------------------+---------+-------------------------------------------------------------------------+ +| beta | double | -- | Inverse temperature | ++----------------+-----------------------------+---------+-------------------------------------------------------------------------+ +| channel | pomerol2triqs::channel_t | PH | Channel in which Matsubara frequency representation is defined | ++----------------+-----------------------------+---------+-------------------------------------------------------------------------+ +| three_freqs | std::vector | -- | three frequencies (wb, wf1, wf2). | ++----------------+-----------------------------+---------+-------------------------------------------------------------------------+ +| four_indices | std::vector | -- | four operator indices in TRIQS convention: (block_name, inner_index)*4 | ++----------------+-----------------------------+---------+-------------------------------------------------------------------------+ \ No newline at end of file diff --git a/test/python/anderson_g2_matsubara.py b/test/python/anderson_g2_matsubara.py index 26c9785..e61f8fc 100644 --- a/test/python/anderson_g2_matsubara.py +++ b/test/python/anderson_g2_matsubara.py @@ -91,7 +91,7 @@ four_indices.append( (('up',0), ('dn',0), ('dn',0), ('up',0)) ) # uddu four_indices.append( (('dn',0), ('up',0), ('up',0), ('dn',0)) ) # duud -G2_iw_ph = ed.G2_iw_freq_box( vec_four_indices=four_indices, **common_g2_params ) +G2_iw_ph = ed.G2_iw_freq_box( four_indices=four_indices, **common_g2_params ) G2_iw_ph_uuuu = G2_iw_ph[0] G2_iw_ph_dddd = G2_iw_ph[1] G2_iw_ph_uudd = G2_iw_ph[2] diff --git a/test/python/wick.py b/test/python/wick.py index d2a3c6d..a5d621f 100644 --- a/test/python/wick.py +++ b/test/python/wick.py @@ -96,7 +96,7 @@ four_indices.append( (('up',0), ('dn',0), ('dn',0), ('up',0)) ) # uddu four_indices.append( (('dn',0), ('up',0), ('up',0), ('dn',0)) ) # duud -G2_ph = ed.G2_iw_freq_box( vec_four_indices=four_indices, **common_g2_params ) +G2_ph = ed.G2_iw_freq_box( four_indices=four_indices, **common_g2_params ) G2_ph_uuuu = G2_ph[0] G2_ph_dddd = G2_ph[1] G2_ph_uudd = G2_ph[2]