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

#include <triqs/mesh/refreq.hpp>

Detailed Description

Real frequency mesh type.

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

A real frequency 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 \( \omega \) by the linear function \( \omega(n) = \omega_{\mathrm{min}} + n \cdot \Delta \) such that \( \omega(0) = \omega_{\mathrm{min}} \) and \( \omega(N - 1) = \omega_{\mathrm{max}} \). The step size of the mesh is \( \Delta = \frac{\omega_{\mathrm{max}} - \omega_{\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 \( \omega \in [\omega_{\mathrm{min}}, \omega_{\mathrm{max}}] \) is mapped to the closest mesh point with index \( n \) by the function \( n(\omega) = \left\lfloor \frac{\omega - \omega_{\mathrm{min}}}{\Delta} + 0.5 \right\rfloor \).

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

Definition at line 72 of file refreq.hpp.

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

Public Types

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

Public Member Functions

 refreq (double w_min=0.0, double w_max=0.0, long n_w=0)
 Construct a real frequency mesh on the interval \( [\omega_{\text{min}}, \omega_{\text{max}}] \) with \( N \geq 0 \) equally spaced mesh points.
 refreq (std::pair< double, double > window, int n_w)
 Construct a real frequency mesh on the interval \( [\omega_{\text{min}}, \omega_{\text{max}}] \) with \( N \geq 0 \) equally spaced mesh points.
double w_max () const
 Get the upper bound of the interval \( \omega_{\text{max}} \), i.e. the value of the last mesh point.
double w_min () const
 Get the lower bound of the interval \( \omega_{\text{min}} \), i.e. the value of the first mesh point.
Public Member Functions inherited from triqs::mesh::detail::linear< refreq, 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) \).
Public Member Functions inherited from triqs::mesh::tail_fitter_handle
tail_fitterget_tail_fitter () const
 Get the triqs::mesh::tail_fitter object.
tail_fitterget_tail_fitter (double tail_fraction, int n_tail_max=tail_fitter::default_n_tail_max, std::optional< int > expansion_order={}) const
 Construct a new triqs::mesh::tail_fitter object with the given parameters and return it.
void set_tail_fit_parameters (double tail_fraction, int n_tail_max=tail_fitter::default_n_tail_max, std::optional< int > expansion_order={}) const
 Set the pointer to a new tail-fitter object constructed with the given parameters.

Static Public Member Functions

static std::string hdf5_format ()
 Get the HDF5 format tag.
static constexpr bool positive_only ()
 Is the mesh restricted to positive frequencies?

Friends

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

Additional Inherited Members

Protected Member Functions inherited from triqs::mesh::detail::linear< refreq, 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

◆ refreq() [1/2]

triqs::mesh::refreq::refreq ( double w_min = 0.0,
double w_max = 0.0,
long n_w = 0 )
inline

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

Parameters
w_minLower bound \( \omega_{\mathrm{min}} \) of the frequency interval.
w_maxUpper bound \( \omega_{\mathrm{max}} \) of the frequency interval.
n_wSize of the mesh.

Definition at line 86 of file refreq.hpp.

◆ refreq() [2/2]

triqs::mesh::refreq::refreq ( std::pair< double, double > window,
int n_w )
inline

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

Parameters
windowPair containing the lower and upper bounds of the frequency interval.
n_wSize of the mesh.

Definition at line 95 of file refreq.hpp.

◆ h5_read

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

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

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

Definition at line 125 of file refreq.hpp.

◆ h5_write

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

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

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

Definition at line 116 of file refreq.hpp.

◆ operator<<

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

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

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

Definition at line 134 of file refreq.hpp.


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