Skip to content

Commit

Permalink
Backport into triqs v1.4 (only G1)
Browse files Browse the repository at this point in the history
Succeeded in build, but failed in all make test.
  • Loading branch information
j-otsuki committed Feb 23, 2018
1 parent f707a09 commit 5fedfe9
Show file tree
Hide file tree
Showing 4 changed files with 30 additions and 34 deletions.
4 changes: 2 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@ list(APPEND CMAKE_MODULE_PATH ${POMEROL_PATH}/share/pomerol/cmake)
# Load TRIQS, including all predefined variables from TRIQS installation
find_package(TRIQS REQUIRED)

if(NOT TRIQS_VERSION EQUAL 1.5)
message(FATAL_ERROR "The application requires the TRIQS library version 1.5 (got ${TRIQS_VERSION})")
if(NOT TRIQS_VERSION EQUAL 1.4)
message(FATAL_ERROR "The application requires the TRIQS library version 1.4 (got ${TRIQS_VERSION})")
endif()

# Load Pomerol
Expand Down
2 changes: 2 additions & 0 deletions c++/pomerol_ed.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -327,6 +327,7 @@ namespace pomerol2triqs {
// Two-particle Green's function //
///////////////////////////////////

/*
template <typename Mesh, typename Filler>
auto pomerol_ed::compute_g2(gf_struct_t const &gf_struct, gf_mesh<Mesh> const &mesh, block_order_t block_order, g2_blocks_t const &g2_blocks,
Filler filler) const -> block2_gf<Mesh, tensor_valued<4>> {
Expand Down Expand Up @@ -535,4 +536,5 @@ namespace pomerol2triqs {
return g2;
}
*/
}
18 changes: 9 additions & 9 deletions c++/pomerol_ed.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,10 @@
#include <triqs/gfs.hpp>
#include <triqs/operators/many_body_operator.hpp>
#include <triqs/hilbert_space/fundamental_operator_set.hpp>
#include <triqs/utility/optional_compat.hpp>
// #include <triqs/utility/optional_compat.hpp>
#include <triqs/mpi/boost.hpp>

#include "g2_parameters.hpp"
// #include "g2_parameters.hpp"

namespace pomerol2triqs {

Expand Down Expand Up @@ -62,9 +62,9 @@ namespace pomerol2triqs {

using w_nu_nup_t = cartesian_product<imfreq, imfreq, imfreq>;
using w_l_lp_t = cartesian_product<imfreq, legendre, legendre>;
template <typename Mesh, typename Filler>
block2_gf<Mesh, tensor_valued<4>> compute_g2(gf_struct_t const &gf_struct, gf_mesh<Mesh> const &mesh, block_order_t block_order,
g2_blocks_t const &g2_blocks, Filler filler) const;
// template <typename Mesh, typename Filler>
// block2_gf<Mesh, tensor_valued<4>> compute_g2(gf_struct_t const &gf_struct, gf_mesh<Mesh> const &mesh, block_order_t block_order,
// g2_blocks_t const &g2_blocks, Filler filler) const;

public:
/// Create a new solver object
Expand All @@ -86,11 +86,11 @@ namespace pomerol2triqs {
block_gf<refreq> G_w(gf_struct_t const &gf_struct, double beta, std::pair<double, double> const &energy_window, int n_w, double im_shift = 0);

/// Two-particle Green's function, Matsubara frequencies
TRIQS_WRAP_ARG_AS_DICT
block2_gf<w_nu_nup_t, tensor_valued<4>> G2_iw_inu_inup(g2_iw_inu_inup_params_t const &p);
// TRIQS_WRAP_ARG_AS_DICT
// block2_gf<w_nu_nup_t, tensor_valued<4>> G2_iw_inu_inup(g2_iw_inu_inup_params_t const &p);

/// Two-particle Green's function, bosonic Matsubara frequency + Legendre coefficients
TRIQS_WRAP_ARG_AS_DICT
block2_gf<w_l_lp_t, tensor_valued<4>> G2_iw_l_lp(g2_iw_l_lp_params_t const &p);
// TRIQS_WRAP_ARG_AS_DICT
// block2_gf<w_l_lp_t, tensor_valued<4>> G2_iw_l_lp(g2_iw_l_lp_params_t const &p);
};
}
40 changes: 17 additions & 23 deletions python/pomerol2triqs_desc.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
# Generated automatically using the command :
# c++2py.py ../c++/pomerol_ed.hpp -I../../../pomerol/installed/include -I/usr/include/eigen3 -I../c++ -p -mpytriqs.applications.impurity_solvers.pomerol2triqs -o pomerol2triqs --moduledoc "TRIQS wrapper around Pomerol ED library"
# c++2py.py ../c++/pomerol_ed.hpp -I../../../local/pomerol/include -I/usr/include/eigen3 -I../c++ -p -mpytriqs.applications.impurity_solvers.pomerol2triqs -o pomerol2triqs --moduledoc "TRIQS wrapper around Pomerol ED library"
from wrap_generator import *

# The module
module = module_(full_name = "pytriqs.applications.impurity_solvers.pomerol2triqs", doc = "TRIQS wrapper around Pomerol ED library")
module = module_(full_name = "pytriqs.applications.impurity_solvers.pomerol2triqs", doc = "TRIQS wrapper around Pomerol ED library", app_name = "pytriqs.applications.impurity_solvers.pomerol2triqs")

# All the triqs C++/Python modules
module.use_module('gf', 'triqs')
module.use_module('operators', 'triqs')

# Add here all includes beyond what is automatically included by the triqs modules
Expand All @@ -17,50 +18,43 @@
#include <triqs/python_tools/converters/map.hpp>
#include <triqs/python_tools/converters/set.hpp>
#include <triqs/python_tools/converters/vector.hpp>
#include <triqs/python_tools/converters/variant.hpp>
#include <triqs/python_tools/converters/variant_int_string.hpp>
#include <triqs/python_tools/converters/tuple.hpp>
#include <triqs/python_tools/converters/operators_real_complex.hpp>
#include <triqs/python_tools/converters/gf.hpp>
#include <triqs/python_tools/converters/block_gf.hpp>
#include <triqs/python_tools/converters/block2_gf.hpp>
#include "./pomerol2triqs_converters.hxx"
""")
module.add_using("namespace pomerol2triqs")
module.add_using("namespace Pomerol")

module.add_enum("spin", ["down", "up"], "Pomerol", "Spin projection")
module.add_enum("block_order_t", ["AABB", "ABBA"], "pomerol2triqs", "G^{(2)} block order")
module.add_enum("channel_t", ["PP", "PH", "AllFermionic"], "pomerol2triqs", "G^{(2)} channel")
# module.add_enum("block_order_t", ["AABB", "ABBA"], "pomerol2triqs", "G^{(2)} block order")
# module.add_enum("channel_t", ["PP", "PH", "AllFermionic"], "pomerol2triqs", "G^{(2)} channel")

# The class pomerol_ed
c = class_(
py_type = "PomerolED", # name of the python class
c_type = "pomerol_ed", # name of the C++ class
doc = r"Main solver class of pomerol2triqs", # doc of the C++ class
doc = r"", # doc of the C++ class
)

c.add_constructor("""(index_converter_t index_converter, bool verbose = false)""",
doc = r"""Create a new solver object""")
doc = """Create a new solver object """)

c.add_method("""void diagonalize(many_body_op_t hamiltonian, bool ignore_symmetries = false)""",
doc = r"""Diagonalize Hamiltonian""")
c.add_method("""void diagonalize (many_body_op_t hamiltonian, bool ignore_symmetries = false)""",
doc = """Diagonalize Hamiltonian optionally employing conservation of N and S_z """)

c.add_method("""void diagonalize(many_body_op_t hamiltonian, std::vector<many_body_op_t> integrals_of_motion)""",
doc = r"""Diagonalize Hamiltonian""")
c.add_method("""void diagonalize (many_body_op_t hamiltonian, std::vector<many_body_op_t> integrals_of_motion)""",
doc = """Diagonalize Hamiltonian using provided integrals of motion """)

c.add_method("""block_gf<imfreq> G_iw (gf_struct_t gf_struct, double beta, int n_iw)""",
doc = r"""Green's function in Matsubara frequencies""")
doc = """Green\'s function in Matsubara frequencies """)

c.add_method("""block_gf<imtime> G_tau (gf_struct_t gf_struct, double beta, int n_tau)""",
doc = r"""Green's function in imaginary time""")
doc = """Green\'s function in imaginary time """)

c.add_method("""block_gf<refreq> G_w(gf_struct_t gf_struct, double beta, std::pair<double, double> energy_window, int n_w, double im_shift = 0)""",
doc = r"""Retarded Green's function on real energy axis""")

c.add_method("""block2_gf<cartesian_product<imfreq, imfreq, imfreq>, tensor_valued<4>> G2_iw_inu_inup(**pomerol2triqs::g2_iw_inu_inup_params_t)""",
doc = r"""Two-particle Green's function, Matsubara frequencies""")

c.add_method("""block2_gf<cartesian_product<imfreq, legendre, legendre>, tensor_valued<4>> G2_iw_l_lp(**pomerol2triqs::g2_iw_l_lp_params_t)""",
doc = r"""Two-particle Green's function, bosonic Matsubara frequency + Legendre coefficients""")
c.add_method("""block_gf<refreq> G_w (gf_struct_t gf_struct, double beta, std::pair<double,double> energy_window, int n_w, double im_shift = 0)""",
doc = """Retarded Green\'s function on real energy axis """)

module.add_class(c)

Expand Down

0 comments on commit 5fedfe9

Please sign in to comment.