TRIQS/TRIQS 4.0.0
Researching Interacting Quantum Systems
Loading...
Searching...
No Matches
triqs::gfs::retime

#include <triqs/mesh/retime.hpp>

Detailed Description

Real time mesh type.

A real time mesh is defined by its size \( N \geq 0 \) and a time interval \( [t_{\mathrm{min}}, t_{\mathrm{max}}] \). It contains \( N \) equally spaced mesh points on the interval \( [t_{\mathrm{min}}, t_{\mathrm{max}}] \) such that the distance between two consecutive mesh points (step size) is constant.

A real time mesh has the following properties:

  • Each mesh point is identified by a unique index \( n \in \{0, 1, \ldots, N-1\} \).
  • An index \( n \) is mapped to the corresponding data index \( d \) by the identity function \( d(n) = n \) and vice versa.
  • An index \( n \) is mapped to the corresponding value \( t \) by the linear function \( t(n) = t_{\mathrm{min}} + n \cdot \Delta \) such that \( t(0) = t_{\mathrm{min}} \) and \( t(N - 1) = t_{\mathrm{max}} \). The step size of the mesh is \( \Delta = \frac{t_{\mathrm{max}} - t_{\mathrm{min}}}{N - 1} \) for \( N > 1 \), otherwise it is undefined. For implementation purposes, we set \( \Delta = 0 \) and \( \Delta^{-1} = 0 \) for \( N = 0 \) and \( \Delta = 0 \) and \( \Delta^{-1} = \infty \) for \( N = 1 \).
  • An arbitrary value \( t \in [t_{\mathrm{min}}, t_{\mathrm{max}}] \) is mapped to the closest mesh point with index \( n \) by the function \( n(t) = \left\lfloor \frac{t - t_{\mathrm{min}}}{\Delta} + 0.5 \right\rfloor \).

Green's function containers that are based on a real time mesh store the function values at the discrete time points \( t(n) \), i.e. \( f_n = f(t(n)) \), and use linear interpolation to evaluate the function at an arbitrary time \( t \in [t_{\mathrm{min}}, t_{\mathrm{max}}] \).

Definition at line 70 of file retime.hpp.

Inheritance diagram for triqs::gfs::retime:
triqs::mesh::detail::linear< retime, double >

Public Types

using mesh_point_t = detail::linear<retime, double>::mesh_point_t
 Mesh point type of a triqs::mesh::retime mesh (see triqs::mesh::detail::linear::mesh_point_t).
Public Types inherited from triqs::mesh::detail::linear< retime, double >
using data_index_t
 Data index type.
using index_t
 Index type.
using value_t
 Value type.

Public Member Functions

 retime (double t_min=0.0, double t_max=0.0, long n_t=0)
 Construct a real time mesh on the interval \( [t_{\mathrm{min}}, t_{\mathrm{max}}] \) with \( N \geq 0 \) equally spaced mesh points.
 retime (std::pair< double, double > window, int n_t)
 Construct a real time mesh on the interval \( [t_{\mathrm{min}}, t_{\mathrm{max}}] \) with \( N \geq 0 \) equally spaced mesh points.
double t_max () const noexcept
 Get the upper bound of the interval \( t_{\mathrm{max}} \), i.e. the value of the last mesh point.
double t_min () const noexcept
 Get the lower bound of the interval \( t_{\mathrm{min}} \), i.e. the value of the first mesh point.
Public Member Functions inherited from triqs::mesh::detail::linear< retime, double >
 linear ()=default
 Default construct an empty linear mesh of size \( N = 0 \).
auto begin () const
 Get an iterator to the beginning of the mesh.
auto cbegin () const
 Get a const iterator to the beginning of the mesh.
auto cend () const
 Get a const iterator to the end of the mesh.
value_t delta () const noexcept
 Get the step size \( \Delta \) of the mesh, i.e. the distance between two consecutive mesh points.
value_t delta_inv () const noexcept
 Get the inverse of the step size of the mesh, i.e. \( 1 / \Delta \).
void deserialize (auto &ar)
 Deserialize the mesh from a generic archive.
auto end () const
 Get an iterator to the end of the mesh.
auto evaluate (auto const &f, double x) const
 Linear interpolation of a function \( f \) defined on a triqs::mesh::detail::linear mesh at a value \(x \in [a, b] \).
long first_index () const
 Get the first index of the mesh, i.e. \( 0 \).
bool is_index_valid (index_t n) const noexcept
 Check if an index \( n \) is valid.
long last_index () const
 Get the last index of the mesh, i.e. \( N - 1 \).
uint64_t mesh_hash () const noexcept
 Get the hash value of the mesh.
mesh_point_t operator() (index_t n) const noexcept
 Function call operator to access a mesh point by its index \( n \in \{0, 1, \ldots, N-1\} \).
bool operator== (linear const &rhs) const=default
 Equal-to comparison operator compares \( N \) and the interval \( [a, b] \).
mesh_point_t operator[] (long d) const noexcept
 Subscript operator to access a mesh point by its data index \( d \in \{0, 1, \ldots, N-1\} \).
void serialize (auto &ar) const
 Serialize the mesh to a generic archive.
long size () const noexcept
 Get the size \( N \) of the mesh, i.e. the number of mesh points.
data_index_t to_data_index (index_t n) const noexcept
 Map an index \( n \in \{0, 1, \ldots, N-1\} \) to its corresponding data index \( d(n) \).
index_t to_index (data_index_t d) const noexcept
 Map a data index \( d \in \{0, 1, \ldots, N-1\} \) to the corresponding index \( n(d) \).
value_t to_value (index_t n) const noexcept
 Map an index \( n \in \{0, 1, \ldots, N-1\} \) to its corresponding value \( m(n) \).

Static Public Member Functions

static std::string hdf5_format ()
 Get the HDF5 format tag.

Friends

void h5_read (h5::group g, std::string const &name, retime &m)
 Read a triqs::mesh::retime mesh from HDF5.
void h5_write (h5::group g, std::string const &name, retime const &m)
 Write a triqs::mesh::retime mesh to HDF5.
std::ostream & operator<< (std::ostream &sout, retime const &m)
 Write a triqs::mesh::retime mesh to a std::ostream.

Additional Inherited Members

Protected Member Functions inherited from triqs::mesh::detail::linear< retime, double >
void h5_read_impl (h5::group g, std::string const &name, const char *exp_format)
 Read the mesh from HDF5.
void h5_write_impl (h5::group g, std::string const &name, const char *format) const
 Write the mesh to HDF5.

Constructor & Destructor Documentation

◆ retime() [1/2]

triqs::mesh::retime::retime ( double t_min = 0.0,
double t_max = 0.0,
long n_t = 0 )
inline

Construct a real time mesh on the interval \( [t_{\mathrm{min}}, t_{\mathrm{max}}] \) with \( N \geq 0 \) equally spaced mesh points.

Parameters
t_minLower bound \( t_{\mathrm{min}} \) of the time interval.
t_maxUpper bound \( t_{\mathrm{max}} \) of the time interval.
n_tSize of the mesh.

Definition at line 84 of file retime.hpp.

◆ retime() [2/2]

triqs::mesh::retime::retime ( std::pair< double, double > window,
int n_t )
inline

Construct a real time mesh on the interval \( [t_{\mathrm{min}}, t_{\mathrm{max}}] \) with \( N \geq 0 \) equally spaced mesh points.

Parameters
windowPair containing the lower and upper bounds of the time interval.
n_tSize of the mesh.

Definition at line 93 of file retime.hpp.

◆ h5_read

void h5_read ( h5::group g,
std::string const & name,
retime & m )
friend

Read a triqs::mesh::retime mesh from HDF5.

Parameters
gh5::group to be read from.
nameName of the subgroup.
mMesh object to be read into.

Definition at line 120 of file retime.hpp.

◆ h5_write

void h5_write ( h5::group g,
std::string const & name,
retime const & m )
friend

Write a triqs::mesh::retime mesh to HDF5.

Parameters
gh5::group to be written to.
nameName of the subgroup.
mMesh object to be written.

Definition at line 111 of file retime.hpp.

◆ operator<<

std::ostream & operator<< ( std::ostream & sout,
retime const & m )
friend

Write a triqs::mesh::retime mesh to a std::ostream.

Parameters
soutstd::ostream object.
mMesh to be written.
Returns
Reference to std::ostream object.

Definition at line 129 of file retime.hpp.


The documentation for this class was generated from the following file: