31#include <fmt/format.h>
37namespace triqs::mesh {
68 class C2PY_RENAME(MeshImTime)
imtime :
public detail::linear<imtime, double> {
81 C2PY_DEPRECATED_PARAMETER_NAME(S :
statistic, n_max : n_tau)
88 [[nodiscard]] C2PY_PROPERTY_GET(
beta)
double beta() const noexcept {
return beta_; }
112 [[nodiscard]]
static std::string
hdf5_format() {
return "MeshImTime"; }
122 h5::group gr = g.create_group(name);
123 h5::write_hdf5_format(gr, m);
124 h5::write(gr,
"beta", m.beta_);
125 h5::write(gr,
"statistic", (m.stat_ == Fermion ?
"F" :
"B"));
126 h5::write(gr,
"n_tau", m.N_);
137 h5::group gr = g.open_group(name);
138 h5::assert_hdf5_format(gr, m,
true);
142 if (not h5::try_read(gr,
"n_tau", N)) h5::read(gr,
"size", N);
143 if (gr.has_key(
"domain")) gr = gr.open_group(
"domain");
145 auto beta = h5::read<double>(gr,
"beta");
146 auto statistic = (h5::read<std::string>(gr,
"statistic") ==
"F" ? Fermion : Boson);
158 auto stat_cstr = (m.stat_ == Boson ?
"Boson" :
"Fermion");
159 return sout << fmt::format(
"Imaginary time mesh with beta = {}, statistics = {}, N = {}", m.beta_, stat_cstr, m.N_);
178 auto evaluate(
imtime const &m,
auto const &f,
double tau) {
return m.
evaluate(f, tau); }
imtime(double beta=1.0, statistic_enum statistic=Fermion, long n_tau=0)
Construct an imaginary time mesh on the interval with equally spaced mesh points and the given part...
Mesh point of a triqs::mesh::detail::linear mesh.
auto evaluate(auto const &f, double x) const
Linear interpolation of a function defined on a triqs::mesh::detail::linear mesh at a value .
void serialize(auto &ar) const
Serialize the mesh to a generic archive.
void deserialize(auto &ar)
Deserialize the mesh from a generic archive.
Imaginary time mesh type.
imtime(double beta=1.0, statistic_enum statistic=Fermion, long n_tau=0)
Construct an imaginary time mesh on the interval with equally spaced mesh points and the given part...
bool operator==(imtime const &) const =default
Equal-to comparison operator compares , and the particle statistics.
void serialize(auto &ar) const
Serialize the mesh to a generic archive.
friend std::ostream & operator<<(std::ostream &sout, imtime const &m)
Write a triqs::mesh::imtime mesh to a std::ostream.
friend void h5_read(h5::group g, std::string const &name, imtime &m)
Read a triqs::mesh::imtime mesh from HDF5.
friend void h5_write(h5::group g, std::string const &name, imtime const &m)
Write a triqs::mesh::imtime mesh to HDF5.
double beta() const noexcept
Get the inverse temperature .
statistic_enum statistic() const noexcept
Get the particle statistics.
detail::linear< imtime, double >::mesh_point_t mesh_point_t
Mesh point type of a triqs::mesh::imtime mesh (see triqs::mesh::detail::linear::mesh_point_t).
void deserialize(auto &ar)
Deserialize the mesh from a generic archive.
static std::string hdf5_format()
Get the HDF5 format tag.
statistic_enum
Enum to specify particle statistics.
Provides a linear mesh type with equally spaced mesh points on an interval.
Common macros used in TRIQS.
Provides various utilities used with Meshes.