Logarithmic real frequency mesh type.
A logarithmic real frequency mesh is defined by a cutoff frequency \( \varepsilon > 0 \), an upper bound \( \omega_{\mathrm{max}} \geq \varepsilon \) and a common ratio \( r > 1 \). It contains a symmetric set of \( N \) mesh points around zero, formed by mirroring the positive geometric sequence \( \omega_{\mathrm{max}},
\omega_{\mathrm{max}} / r, \omega_{\mathrm{max}} / r^2, \ldots \) (taken while the sequence stays above \( \varepsilon \)) to the negative axis. The mesh always has an even number of points and does not include zero.
A logarithmic 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_n \) by
- \( \omega_n = -\omega_{\mathrm{max}} / r^n \) for \( 0 \leq n < N/2 \) and
- \( \omega_n = \omega_{\mathrm{max}} / r^{N - 1 - n} \) for \( N/2 \leq n \leq N - 1 \),
such that the mesh points are sorted in ascending order with \( \omega_0 = -\omega_{\mathrm{max}} \) and \( \omega_{N-1} = \omega_{\mathrm{max}} \).
- An arbitrary value \( \omega \in [-\omega_{\mathrm{max}}, \omega_{\mathrm{max}}] \) is mapped to the closest mesh point with index \( n \) by binary search on the sorted mesh points.
Green's function containers that are based on a logarithmic 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{max}}, \omega_{\mathrm{max}}] \).
Definition at line 74 of file refreq_log.hpp.
|
|
| refreq_log ()=default |
| | Default constructor creates an empty mesh.
|
| | refreq_log (double eps, double w_max, double ratio) |
| | Construct a logarithmic real frequency mesh.
|
|
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.
|
| void | deserialize (auto &ar) |
| | Deserialize the mesh from a generic archive.
|
|
auto | end () const |
| | Get an iterator to the end of the mesh.
|
|
double | eps () const noexcept |
| | Get the smallest positive frequency \( \varepsilon \).
|
| bool | is_index_valid (index_t n) const noexcept |
| | Check if an index \( n \) is valid.
|
| bool | is_value_valid (double w) const noexcept |
| | Check if a value \( \omega \) is within the mesh range.
|
|
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.
|
|
bool | operator== (refreq_log const &) const =default |
| | Equal-to comparison operator compares \( \varepsilon \), \( \omega_{\mathrm{max}} \) and the ratio.
|
| mesh_point_t | operator[] (closest_mesh_point_t< double > const &cmp) const noexcept |
| | Subscript operator to access the mesh point closest to a given value.
|
| mesh_point_t | operator[] (long d) const noexcept |
| | Subscript operator to access a mesh point by its data index.
|
|
std::vector< double > const & | points () const noexcept |
| | Get the vector of frequency point values.
|
|
double | ratio () const noexcept |
| | Get the common ratio \( r \) of the geometric sequence.
|
| 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 (closest_mesh_point_t< double > const &cmp) const noexcept |
| | Map a value to the closest mesh point and return its data index.
|
| data_index_t | to_data_index (index_t n) const noexcept |
| | Map an index \( n \) to its corresponding data index \( d(n) = n \).
|
| index_t | to_index (closest_mesh_point_t< double > const &cmp) const noexcept |
| | Map a value to the closest mesh point and return its index using binary search.
|
| index_t | to_index (data_index_t d) const noexcept |
| | Map a data index \( d \) to the corresponding index \( n(d) = d \).
|
| double | to_value (index_t n) const noexcept |
| | Map an index \( n \) to its corresponding value \( \omega_n \).
|
|
double | w_max () const noexcept |
| | Get the largest frequency \( \omega_{\mathrm{max}} \).
|