Example #1
0
array<double,1> S() {
 array<double,1> res(mesh.size());
 for(auto pt : mesh) {
  int i = pt.index();
  double tau = double(pt);
  res(i) = 0.05*std::exp(-std::abs(tau - 0.5*beta));
 }
 return res;
}
Example #2
0
array<double,1> GF() {
 array<double,1> res(mesh.size());
 for(auto pt : mesh) {
  int i = pt.index();
  double tau = double(pt);
  res(i) = -0.5*(std::exp(-tau*1.3)/(1 + std::exp(-beta*1.3)) +
                 std::exp(tau*0.7)/(1 + std::exp(beta*0.7)));
 }
 return res;
}
Example #3
0
 auto operator()(Expr const &expr, clef::placeholder<N>, gf_mesh<brillouin_zone> const &m, lattice::k_t const &k) {
  auto n = m.locate_neighbours(k).index();
  return clef::eval(expr, clef::placeholder<N>() = no_cast(m[n]));
 }
Example #4
0
File: gf.cpp Project: TRIQS/triqs
 block_gf<legendre> atomic_g_l(gf_lehmann_t<Complex> const &lehmann, gf_struct_t const &gf_struct, gf_mesh<legendre> const &mesh) {
   double beta = mesh.domain().beta;
   auto g      = block_gf{mesh, gf_struct};
   fill_block_gf_from_lehmann<Complex>(g(), lehmann, make_term_proc<Complex>(beta, g()));
   return g;
 }
Example #5
0
 gf_mesh<imtime, Opt> make_mesh_fourier_compatible(gf_mesh<imfreq, Opt> const& m, mesh_kind mk = full_bins) {
  int L = m.size() + (mk == full_bins ? 1 : 0);
  return {m.domain(), L};
 }
Example #6
0
 template <typename Opt> gf_mesh<imfreq, Opt> make_mesh_fourier_compatible(gf_mesh<imtime, Opt> const& m) {
  int L = m.size() - (m.kind() == full_bins ? 1 : 0);
  return {m.domain(), L};
 }
Example #7
0
 /// Read from HDF5
 friend void h5_read(h5::group fg, std::string subgroup_name, gf_mesh &m) {
  h5::group gr = fg.open_group(subgroup_name);
  auto l = [gr](int N, auto &m) { h5_read(gr, "MeshComponent" + std::to_string(N), m); };
  triqs::tuple::for_each_enumerate(m.components(), l);
 }
Example #8
0
 operator cast_t() const { return m->index_to_point(index); }
Example #9
0
 void reset() {
  _atend = false;
  triqs::tuple::for_each(_c, [](auto &m) { m.reset(); });
 }
Example #10
0
 // -------------- HDF5  --------------------------
 /// Write into HDF5
 friend void h5_write(h5::group fg, std::string subgroup_name, gf_mesh const& m) {
  h5::group gr = fg.create_group(subgroup_name);
  h5_write(gr, "domain", m.domain());
  h5_write(gr, "n_pts", m.dims[2]);
  //h5_write(gr, "dims", m.dims.to_vector());
 }
Example #11
0
 linear_index_t linear_index() const { return m->mp_to_linear(_c); }
Example #12
0
 friend gf_mesh mpi_gather(gf_mesh m, mpi::communicator c, int root) {
  return gf_mesh{m.domain(), m.size(), m.positive_only()};
 }
Example #13
0
 /// Scatter a mesh over the communicator c
 friend gf_mesh mpi_scatter(gf_mesh m, mpi::communicator c, int root) {
  auto m2 = gf_mesh{m.domain(), m.size(), m.positive_only()};
  std::tie(m2._first_index_window, m2._last_index_window) = mpi::slice_range(m2._first_index, m2._last_index, c.size(), c.rank());
  return m2;
 }
Example #14
0
 mesh_point(gf_mesh<imfreq> const &mesh) : mesh_point(mesh, mesh.first_index_window()) {}
Example #15
0
 mesh_point(gf_mesh<imfreq> const &mesh, index_t const &index_)
    : matsubara_freq(index_, mesh.domain().beta, mesh.domain().statistic)
    , first_index_window(mesh.first_index_window())
    , last_index_window(mesh.last_index_window()) {}
Example #16
0
 /// Write into HDF5
 friend void h5_write(h5::group fg, std::string subgroup_name, gf_mesh const &m) {
  h5::group gr = fg.create_group(subgroup_name);
  h5_write(gr, "domain", m.domain());
  h5_write(gr, "size", long(m.size()));
  h5_write(gr, "positive_freq_only", (m._positive_only?1:0));
 }