10 #include <type_traits> 11 #include <boost/multi_array.hpp> 12 #include <boost/operators.hpp> 30 namespace statistics {
40 boost::additive2<generic_index<X>, int,
41 boost::unit_steppable< generic_index<X>,
42 boost::totally_ordered2< generic_index<X>, int> > >
82 const std::vector<double> &
points()
const{
return points_;}
85 std::vector<double> &
_points() {
return points_;}
88 swap(this->points_, other.points_);
91 std::vector<double> points_;
96 inline void throw_if_empty()
const {
98 throw std::runtime_error(
"real_frequency_mesh is empty");
106 template<
typename GRID>
108 grid.compute_points(_points());
110 int extent()
const {
return points().size();}
121 ar[path+
"/kind"] <<
"REAL_FREQUENCY";
122 ar[path+
"/points"] << points();
128 ar[path+
"/kind"] >> kind;
129 if (kind!=
"REAL_FREQUENCY")
throw std::runtime_error(
"Attempt to read real frequency mesh from non-real frequency data, kind="+kind);
130 ar[path+
"/points"] >> _points();
148 return extent()==mesh.
extent() && std::equal ( mesh.
points().begin(), mesh.
points().end(), points().begin() );;
154 return !(*
this==mesh);
160 if(comm.
rank() == root) throw_if_empty();
164 if(root!=comm.
rank()) {
166 _points().resize(size);
168 broadcast(comm, _points().data(), extent(), root);
174 template <mesh::frequency_positivity_type PTYPE>
185 inline void throw_if_empty()
const {
187 throw std::runtime_error(
"matsubara_mesh is empty");
194 matsubara_mesh(
const matsubara_mesh& rhs) : beta_(rhs.beta_), nfreq_(rhs.nfreq_), statistics_(rhs.statistics_), offset_(rhs.offset_) {check_range();compute_points();}
196 beta_(0.0), nfreq_(0), statistics_(statistics::
FERMIONIC), offset_(-1)
201 beta_(b), nfreq_(nfr), statistics_(statistics), offset_((PTYPE==mesh::
POSITIVE_ONLY)?0:nfr/2) {
212 return offset_+idx();
218 return beta_==mesh.beta_ && nfreq_==mesh.nfreq_ && statistics_==mesh.statistics_ && offset_ == mesh.offset_;
224 return !(*
this==mesh);
228 double beta()
const{
return beta_;}
236 if(statistics_!=other.statistics_)
237 throw std::runtime_error(
"Attempt to swap two meshes with different statistics.");
239 swap(this->beta_, other.beta_);
240 swap(this->nfreq_, other.nfreq_);
247 ar[path+
"/kind"] <<
"MATSUBARA";
248 ar[path+
"/N"] << nfreq_;
249 ar[path+
"/statistics"] << int(statistics_);
250 ar[path+
"/beta"] << beta_;
251 ar[path+
"/positive_only"] << int(positivity_);
252 ar[path+
"/points"] << points();
258 ar[path+
"/kind"] >> kind;
259 if (kind!=
"MATSUBARA")
throw std::runtime_error(
"Attempt to read Matsubara mesh from non-Matsubara data, kind="+kind);
263 ar[path+
"/N"] >> nfr;
264 ar[path+
"/statistics"] >> stat;
265 ar[path+
"/beta"] >> beta;
266 ar[path+
"/positive_only"] >> posonly;
270 throw std::invalid_argument(
"Attempt to read Matsubara mesh with the wrong positivity type "+std::to_string(posonly) );
295 if(comm.
rank() == root) throw_if_empty();
299 int stat = int(statistics_);
302 int pos = int(positivity_);
305 throw std::invalid_argument(
"Attempt to broadcast Matsubara mesh with the wrong positivity type "+std::to_string(pos) );
311 }
catch (
const std::exception& exc) {
314 std::cerr <<
"matsubara_mesh<>::broadcast() exception at WORLD rank=" << wrank << std::endl
316 <<
"\nAborting." << std::endl;
317 MPI_Abort(MPI_COMM_WORLD,1);
327 throw std::invalid_argument(
"positivity should be POSITIVE_ONLY or POSITIVE_NEGATIVE");
333 _points().resize(extent());
334 for(
int i=0;i<nfreq_;++i){
335 _points()[i]=(2*(i-offset_)+statistics_)*M_PI/beta_;
340 template<mesh::frequency_positivity_type PTYPE> std::ostream &operator<<(std::ostream &os, const matsubara_mesh<PTYPE> &M){
341 os<<
"# "<<
"MATSUBARA"<<
" mesh: N: "<<M.
extent()<<
" beta: "<<M.beta()<<
" statistics: ";
349 template <mesh::frequency_positivity_type PTYPE>
357 bool last_point_included_;
358 bool half_point_mesh_;
360 std::vector<double> points_;
362 inline void throw_if_empty()
const {
364 throw std::runtime_error(
"itime_mesh is empty");
371 itime_mesh(): beta_(0.0), ntau_(0), last_point_included_(true), half_point_mesh_(false), statistics_(statistics::
FERMIONIC)
376 last_point_included_(rhs.last_point_included_), half_point_mesh_(rhs.half_point_mesh_), statistics_(rhs.statistics_){
381 itime_mesh(
double beta,
int ntau): beta_(beta), ntau_(ntau), last_point_included_(true), half_point_mesh_(false), statistics_(statistics::
FERMIONIC){
396 return beta_==mesh.beta_ && ntau_==mesh.ntau_ && last_point_included_==mesh.last_point_included_ &&
397 half_point_mesh_ == mesh.half_point_mesh_ && statistics_==mesh.statistics_;
401 double beta()
const{
return beta_;}
403 const std::vector<double> &
points()
const{
return points_;}
408 return !(*
this==mesh);
414 ar[path+
"/kind"] <<
"IMAGINARY_TIME";
415 ar[path+
"/N"] << ntau_;
416 ar[path+
"/statistics"] << int(statistics_);
417 ar[path+
"/beta"] << beta_;
418 ar[path+
"/half_point_mesh"] << int(half_point_mesh_);
419 ar[path+
"/last_point_included"] << int(last_point_included_);
420 ar[path+
"/points"] << points_;
426 ar[path+
"/kind"] >> kind;
427 if (kind!=
"IMAGINARY_TIME")
throw std::runtime_error(
"Attempt to read Imaginary time mesh from non-itime data, kind="+kind);
429 int stat, half_point_mesh, last_point_included;
431 ar[path+
"/N"] >> ntau;
432 ar[path+
"/statistics"] >> stat;
433 ar[path+
"/beta"] >> beta;
434 ar[path+
"/half_point_mesh"] >> half_point_mesh;
435 ar[path+
"/last_point_included"] >> last_point_included;
438 half_point_mesh_=half_point_mesh;
439 last_point_included_=last_point_included;
461 if(comm.
rank() == root) throw_if_empty();
465 broadcast(comm, last_point_included_, root);
467 int stat=statistics_;
475 points_.resize(extent());
476 if(half_point_mesh_){
477 double dtau=beta_/ntau_;
478 for(
int i=0;i<ntau_;++i){
479 points_[i]=(i+0.5)*dtau;
482 for(
int i=0;i<ntau_;++i){
483 double dtau=last_point_included_?beta_/(ntau_-1):beta_/ntau_;
484 for(
int i=0;i<ntau_;++i){
501 std::vector<double> points_;
502 std::vector<double> weights_;
504 inline void throw_if_empty()
const {
506 throw std::runtime_error(
"power_mesh is empty");
513 power_mesh(
const power_mesh& rhs): beta_(rhs.beta_), power_(rhs.power_), uniform_(rhs.uniform_), statistics_(rhs.statistics_){
521 power_mesh(
double beta,
int power,
int uniform): beta_(beta), power_(power), uniform_(uniform), statistics_(statistics::
FERMIONIC){
538 return beta_==mesh.beta_ && ntau_==mesh.ntau_ && power_==mesh.power_ &&
539 uniform_ == mesh.uniform_ && statistics_==mesh.statistics_;
543 double beta()
const{
return beta_;}
545 const std::vector<double> &
points()
const{
return points_;}
546 const std::vector<double> &
weights()
const{
return weights_;}
551 return !(*
this==mesh);
557 ar[path+
"/kind"] <<
"IMAGINARY_TIME_POWER";
558 ar[path+
"/N"] << ntau_;
559 ar[path+
"/statistics"] << int(statistics_);
560 ar[path+
"/beta"] << beta_;
561 ar[path+
"/power"] << power_;
562 ar[path+
"/uniform"] << uniform_;
563 ar[path+
"/points"] << points_;
569 ar[path+
"/kind"] >> kind;
570 if (kind!=
"IMAGINARY_TIME_POWER")
throw std::runtime_error(
"Attempt to read Imaginary time power mesh from non-itime power data, kind="+kind);
572 int stat, power, uniform;
574 ar[path+
"/N"] >> ntau;
575 ar[path+
"/statistics"] >> stat;
576 ar[path+
"/beta"] >> beta;
577 ar[path+
"/power"] >> power;
578 ar[path+
"/uniform"] >> uniform;
605 if(comm.
rank() == root) throw_if_empty();
611 int stat=statistics_;
621 if(uniform_%2 !=0)
throw std::invalid_argument(
"Simpson weights in power grid only work for even uniform spacing.");
622 std::vector<double> power_points;
623 power_points.push_back(0);
624 for(
int i=power_;i>=0;--i){
625 power_points.push_back(beta_*0.5*
std::pow(2.,-i));
627 for(
int i=power_;i>0;--i){
628 power_points.push_back(beta_*(1.-0.5*
std::pow(2.,-i)));
630 power_points.push_back(beta_);
631 std::sort(power_points.begin(),power_points.end());
635 for(std::size_t i=0;i<power_points.size()-1;++i){
636 for(
int j=0;j<uniform_;++j){
637 double dtau=(power_points[i+1]-power_points[i])/(
double)(uniform_);
638 points_.push_back(power_points[i]+dtau*j);
641 points_.push_back(power_points.back());
642 ntau_=points_.size();
646 weights_.resize(extent());
647 weights_[0 ]=(points_[1] -points_[0 ])/(2.*beta_);
648 weights_[extent()-1]=(points_.back()-points_[extent()-2])/(2.*beta_);
650 for(
int i=1;i<extent()-1;++i){
651 weights_[i]=(points_[i+1]-points_[i-1])/(2.*beta_);
667 points_.resize(boost::extents[rhs.
points_.shape()[0]][rhs.
points_.shape()[1]]);
677 inline void throw_if_empty()
const {
679 throw std::runtime_error(
"momentum_realspace_index_mesh is empty");
698 int extent()
const {
return points_.shape()[0];}
702 const std::string &
kind()
const{
return kind_;}
707 return kind_ == mesh.kind_ &&
714 return !(*
this==mesh);
717 const container_type &
points()
const{
return points_;}
718 container_type &
points() {
return points_;}
723 ar[path+
"/kind"] << kind_;
724 ar[path+
"/points"] << points_;
730 ar[path+
"/kind"] >> kind;
731 if (kind!=kind_)
throw std::runtime_error(
"Attempt to load momentum/realspace index mesh from incorrect mesh kind="+kind+
" (expected: "+kind_+
")");
732 ar[path+
"/points"] >> points_;
751 if (comm.
rank()==root) {
755 std::array<size_t, 2> sizes{{points_.shape()[0], points_.shape()[1]}};
757 if (comm.
rank()!=root) points_.resize(sizes);
777 base_type::operator=(rhs);
823 std::vector<int> points_;
833 const std::vector<int> &
points()
const{
return points_;}
837 throw std::runtime_error(
"index_mesh is empty");
844 return npoints_==mesh.npoints_;
850 return !(*
this==mesh);
856 ar[path+
"/kind"] <<
"INDEX";
857 ar[path+
"/N"] << npoints_;
863 ar[path+
"/kind"] >> kind;
864 if (kind!=
"INDEX")
throw std::runtime_error(
"Attempt to read Index mesh from non-Index data, kind="+kind);
884 void compute_points(){ points_.resize(npoints_);
for(
int i=0;i<npoints_;++i){points_[i]=i;} }
890 if(comm.
rank() == root) throw_if_empty();
905 inline void throw_if_empty()
const {
907 throw std::runtime_error(
"legendre_mesh is empty");
915 beta_(0.0), n_max_(0), statistics_(statistics) {}
918 beta_(b), n_max_(n_max), statistics_(statistics) {
934 return beta_==mesh.beta_ && n_max_==mesh.n_max_ && statistics_==mesh.statistics_;
940 return !(*
this==mesh);
944 double beta()
const{
return beta_;}
952 if (this->statistics_ != other.statistics_) {
953 throw std::runtime_error(
"Attempt to swap LEGENDRE meshes with different statistics");
955 swap(this->beta_, other.beta_);
956 swap(this->n_max_, other.n_max_);
963 ar[path+
"/kind"] <<
"LEGENDRE";
964 ar[path+
"/N"] << n_max_;
965 ar[path+
"/statistics"] << int(statistics_);
966 ar[path+
"/beta"] << beta_;
972 ar[path+
"/kind"] >> kind;
973 if (kind!=
"LEGENDRE")
throw std::runtime_error(
"Attempt to read LEGENDRE mesh from non-LEGENDRE data, kind="+kind);
977 ar[path+
"/N"] >> n_max;
978 ar[path+
"/statistics"] >> stat;
979 ar[path+
"/beta"] >> beta;
1000 #ifdef ALPS_HAVE_MPI 1004 if(comm.
rank() == root) throw_if_empty();
1008 int stat =
static_cast<int>(statistics_);
1015 }
catch (
const std::exception& exc) {
1018 std::cerr <<
"legendre_mesh<>::broadcast() exception at WORLD rank=" << wrank << std::endl
1020 <<
"\nAborting." << std::endl;
1021 MPI_Abort(MPI_COMM_WORLD,1);
1033 _points().resize(extent());
1034 for(
int i=0;i<n_max_;++i){
1052 std::vector<piecewise_polynomial<T> > basis_functions_;
1056 void set_validity() {
1058 valid_ = valid_ && dim_ > 0;
1059 valid_ = valid_ && std::size_t(dim_) == basis_functions_.size();
1060 valid_ = valid_ && beta_ >= 0.0;
1063 if (basis_functions_.size() > 1u) {
1064 for (std::size_t l=0; l < basis_functions_.size()-1; ++l) {
1065 valid_ = valid_ && (basis_functions_[l].section_edges() == basis_functions_[l+1].section_edges());
1070 void check_validity()
const {
1072 throw std::runtime_error(
"numerical mesh has not been properly constructed!");
1078 numerical_mesh(
const numerical_mesh<T>& rhs) : beta_(rhs.beta_), dim_(rhs.dim_), basis_functions_(rhs.basis_functions_), statistics_(rhs.statistics_), valid_(rhs.valid_) {
1083 beta_(0.0), dim_(0), statistics_(statistics), basis_functions_(), valid_(false) {}
1087 beta_(b), dim_(basis_functions.
size()), statistics_(statistics), basis_functions_(basis_functions), valid_(false) {
1106 return beta_==mesh.beta_ && dim_==mesh.dim_ && statistics_==mesh.statistics_ && basis_functions_==mesh.basis_functions_;
1112 return !(*
this==mesh);
1116 double beta()
const{
return beta_;}
1119 assert(l>=0 && l < dim_);
1121 return basis_functions_[l];
1130 swap(this->beta_, other.beta_);
1131 swap(this->dim_, other.dim_);
1132 if (this->statistics_ != other.statistics_) {
1133 throw std::runtime_error(
"Do not swap numerical meshes with different statistics!");
1135 swap(this->basis_functions_, other.basis_functions_);
1140 this->beta_ = other.beta_;
1141 this->dim_ = other.dim_;
1142 this->statistics_ = other.statistics_;
1143 this->basis_functions_ = other.basis_functions_;
1144 base_mesh::operator=(other);
1150 ar[path+
"/kind"] <<
"NUMERICAL_MESH";
1151 ar[path+
"/N"] << dim_;
1152 ar[path+
"/statistics"] << int(statistics_);
1153 ar[path+
"/beta"] << beta_;
1154 for (
int l=0; l < dim_; ++l) {
1155 basis_functions_[l].save(ar, path+
"/basis_functions"+std::to_string(l));
1162 ar[path+
"/kind"] >> kind;
1163 if (kind!=
"NUMERICAL_MESH")
throw std::runtime_error(
"Attempt to read NUMERICAL_MESH mesh from non-numerical-mesh data, kind="+kind);
1167 ar[path+
"/N"] >> dim;
1168 ar[path+
"/statistics"] >> stat;
1169 if (valid_ && stat != statistics_) {
1170 throw std::runtime_error(
"Attemp to load data with different statistics!");
1173 ar[path+
"/beta"] >> beta;
1174 basis_functions_.resize(dim);
1175 for (
int l=0; l < dim; ++l) {
1176 basis_functions_[l].load(ar, path+
"/basis_functions"+std::to_string(l));
1198 #ifdef ALPS_HAVE_MPI 1202 if(comm.
rank() == root) check_validity();
1207 int stat =
static_cast<int>(statistics_);
1212 basis_functions_.resize(dim_);
1213 for (
int l=0; l < dim_; ++l) {
1214 basis_functions_[l].broadcast(comm, root);
1220 }
catch (
const std::exception& exc) {
1223 std::cerr <<
"numerical_mesh<>::broadcast() exception at WORLD rank=" << wrank << std::endl
1225 <<
"\nAborting." << std::endl;
1226 MPI_Abort(MPI_COMM_WORLD,1);
1233 _points().resize(extent());
1234 for(
int i=0;i<dim_;++i){
1260 struct can_have_tail_yes {
typedef bool mesh_can_have_tail; };
1262 struct can_have_tail_no {
typedef bool mesh_cannot_have_tail; };
1265 template <
typename>
struct can_have_tail:
public can_have_tail_no {};
1268 template <>
struct can_have_tail<matsubara_positive_mesh>:
public can_have_tail_yes {};
1270 template <>
struct can_have_tail<matsubara_pn_mesh>:
public can_have_tail_yes {};
1272 template <>
struct can_have_tail<itime_mesh>:
public can_have_tail_yes {};
1278 std::ostream& operator<<(std::ostream& s, const boost::multi_array<double, 1>& data);
generic_index< index_mesh > index_type
bool operator>(int x) const
bool operator==(const real_frequency_mesh &mesh) const
Comparison operators.
void save(alps::hdf5::archive &ar, const std::string &path) const
const std::vector< int > & points() const
generic_index & operator+=(int i)
generic_index< itime_mesh > index_type
index_mesh::index_type index
bool operator==(const numerical_mesh &mesh) const
Comparison operators.
void swap(matsubara_mesh< PTYPE > &a, matsubara_mesh< PTYPE > &b)
Swaps two Matsubara meshes.
momentum_index_mesh(int ns, int ndim)
const std::vector< double > & weights() const
void save(alps::hdf5::archive &ar) const
Save to HDF5.
numerical_mesh< double >::index_type numerical_mesh_index
bool operator==(const legendre_mesh &mesh) const
Comparison operators.
bool operator<(int x) const
mesh::frequency_positivity_type positivity() const
matsubara_mesh(const matsubara_mesh &rhs)
copy constructor
void save(alps::hdf5::archive &ar, const std::string &path) const
int operator()(index_type idx) const
generic_index & operator--()
void save(alps::hdf5::archive &ar) const
Save to HDF5.
momentum_realspace_index_mesh(const momentum_realspace_index_mesh &rhs)
const piecewise_polynomial< T > & basis_function(int l) const
statistics::statistics_type statistics() const
itime_mesh(const itime_mesh &rhs)
void load(archive &ar, std::string const &path, T &value, std::vector< std::size_t > chunk=std::vector< std::size_t >(), std::vector< std::size_t >=std::vector< std::size_t >())
void save(alps::hdf5::archive &ar, const std::string &path) const
generic_index< real_frequency_mesh > index_type
legendre_mesh(const legendre_mesh &rhs)
std::ostream & operator<<(std::ostream &os, const real_frequency_mesh &M)
std::enable_if<!is_sequence< T >::value, std::size_t >::type size(T const &)
int operator()(index_type idx) const
int dimension() const
returns the spatial dimension
void load(alps::hdf5::archive &ar, const std::string &path)
void broadcast(C const &c, P &p, int r=0)
momentum_index_mesh & operator=(const momentum_index_mesh &rhs)
bool operator!=(const itime_mesh &mesh) const
Comparison operators.
container_type & points()
int operator()(index_type idx) const
generic_index< matsubara_mesh > index_type
statistics::statistics_type statistics() const
void swap(legendre_mesh &other)
Swaps this and another mesh.
bool operator!=(const numerical_mesh &mesh) const
Comparison operators.
index_mesh(const index_mesh &rhs)
bool operator!=(const momentum_realspace_index_mesh &mesh) const
Comparison operators.
bool operator==(const power_mesh &mesh) const
Comparison operators.
momentum_index_mesh(const momentum_index_mesh &rhs)
numerical_mesh(double b, const std::vector< piecewise_polynomial< T > > &basis_functions, gf::statistics::statistics_type statistics=statistics::FERMIONIC)
real_frequency_mesh(const GRID &grid)
bool operator!=(const power_mesh &mesh) const
Comparison operators.
void load(alps::hdf5::archive &ar, const std::string &path)
momentum_realspace_index_mesh()
bool operator!=(const matsubara_mesh &mesh) const
Comparison operators.
momentum_realspace_index_mesh & operator=(const momentum_realspace_index_mesh &rhs)
int operator()(index_type idx) const
Returns the index of the mesh point in the data array.
real_space_index_mesh(const real_space_index_mesh &rhs)
const std::vector< double > & points() const
matsubara_mesh< mesh::POSITIVE_ONLY > matsubara_positive_mesh
void save(alps::hdf5::archive &ar, const std::string &path) const
Encapsulation of an MPI communicator and some communicator-related operations.
generic_index< legendre_mesh > index_type
itime_mesh::index_type itime_index
int operator()(index_type idx) const
numerical_mesh & operator=(const numerical_mesh &other)
void swap(matsubara_mesh &other)
Swaps this and another mesh.
boost::multi_array< double, 2 > container_type
Common part of interface and implementation for GF meshes.
bool operator==(const matsubara_mesh &mesh) const
Comparison operators.
generic_index & operator++()
void load(alps::hdf5::archive &ar)
Load from HDF5.
const container_type & points() const
int operator()(index_type idx) const
legendre_mesh(gf::statistics::statistics_type statistics=statistics::FERMIONIC)
void save(alps::hdf5::archive &ar) const
Save to HDF5.
int operator()(index_type idx) const
Returns the index of the mesh point in the data array.
matsubara_mesh< mesh::POSITIVE_NEGATIVE > matsubara_pn_mesh
bool operator==(const momentum_realspace_index_mesh &mesh) const
Comparison operators.
void save(alps::hdf5::archive &ar, const std::string &path) const
void load(alps::hdf5::archive &ar, const std::string &path)
Mesh of real frequencies.
void save(alps::hdf5::archive &ar) const
Save to HDF5.
bool operator==(const index_mesh &mesh) const
Comparison operators.
real_space_index_mesh::index_type real_space_index
bool operator!=(const index_mesh &mesh) const
Comparison operators.
real_space_index_mesh(int ns, int ndim)
void save(alps::hdf5::archive &ar, const std::string &path) const
void save(alps::hdf5::archive &ar, const std::string &path) const
void load(alps::hdf5::archive &ar)
Load from HDF5.
void load(alps::hdf5::archive &ar, const std::string &path)
itime_mesh(double beta, int ntau)
bool operator!=(const real_frequency_mesh &mesh) const
Comparison operators.
void save(alps::hdf5::archive &ar) const
Save to HDF5.
bool operator==(int x) const
statistics::statistics_type statistics() const
int extent() const
Returns the number of points.
base_mesh(const base_mesh &rhs)
void load(alps::hdf5::archive &ar)
Load from HDF5.
void load(alps::hdf5::archive &ar)
Load from HDF5.
momentum_realspace_index_mesh(const std::string &kind, int ns, int ndim)
std::string get_context() const
numerical_mesh(const numerical_mesh< T > &rhs)
statistics::statistics_type statistics() const
matsubara_mesh< mesh::POSITIVE_ONLY >::index_type matsubara_index
numerical_mesh(gf::statistics::statistics_type statistics=statistics::FERMIONIC)
generic_index< numerical_mesh > index_type
legendre_mesh::index_type legendre_index
void load(alps::hdf5::archive &ar)
Load from HDF5.
real_frequency_mesh(const real_frequency_mesh &rhs)
int operator()(index_type idx) const
double beta() const
Getter variables for members.
void load(alps::hdf5::archive &ar, const std::string &path)
const std::vector< double > & points() const
void swap(base_mesh &other)
Functions to MPI-broadcast internal data structures.
std::vector< double > & _points()
legendre_mesh(double b, int n_max, gf::statistics::statistics_type statistics=statistics::FERMIONIC)
void save(alps::hdf5::archive &ar) const
Save to HDF5.
momentum_realspace_index_mesh(const std::string &kind, const container_type &mesh_points)
void load(alps::hdf5::archive &ar, const std::string &path)
std::vector< T > pow(std::vector< T > vec, U index)
void load(alps::hdf5::archive &ar, const std::string &path)
int rank() const
Returns process rank in this communicator.
momentum_index_mesh(const container_type &mesh_points)
void save(alps::hdf5::archive &ar) const
Save to HDF5.
double beta() const
Getter variables for members.
void load(alps::hdf5::archive &ar, const std::string &path)
bool operator==(const itime_mesh &mesh) const
Comparison operators.
void load(alps::hdf5::archive &ar)
Load from HDF5.
statistics::statistics_type statistics() const
void broadcast(const communicator &comm, T *vals, std::size_t count, int root)
Broadcasts array vals of a primitive type T, length count on communicator comm with root root ...
power_mesh(const power_mesh &rhs)
generic_index< momentum_index_mesh > index_type
void swap(numerical_mesh &other)
Swaps this and another mesh.
frequency_positivity_type
const std::string & kind() const
returns the mesh kind
bool operator!=(const legendre_mesh &mesh) const
Comparison operators.
double beta() const
getter functions for member variables
matsubara_mesh(double b, int nfr, gf::statistics::statistics_type statistics=statistics::FERMIONIC)
power_mesh(double beta, int power, int uniform)
index_mesh & operator=(const index_mesh &rhs)
void load(alps::hdf5::archive &ar)
Load from HDF5.
void throw_if_empty() const
void save(alps::hdf5::archive &ar) const
Save to HDF5.
int operator()(index_type idx) const
matsubara_mesh< mesh::POSITIVE_NEGATIVE >::index_type matsubara_pn_index
generic_index< power_mesh > index_type
double beta() const
getter functions for member variables
void load(alps::hdf5::archive &ar)
Load from HDF5.
real_space_index_mesh(const container_type &mesh_points)
double beta() const
getter functions for member variables
momentum_index_mesh::index_type momentum_index
generic_index< momentum_index_mesh > index_type
real_frequency_mesh::index_type real_freq_index
const std::vector< double > & points() const
Const access to mesh points.
generic_index & operator-=(int i)
Class representing a piecewise polynomial and utilities.
void save(archive &ar, std::string const &path, T const &value, std::vector< std::size_t >=std::vector< std::size_t >(), std::vector< std::size_t > chunk=std::vector< std::size_t >(), std::vector< std::size_t >=std::vector< std::size_t >())
void save(alps::hdf5::archive &ar, const std::string &path) const