triqs.mesh.meshes.MeshReFreq
- class triqs.mesh.meshes.MeshReFreq
Bases:
objectReal 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}}]\).
Dispatched C++ constructor(s).
[1] (w_min: float = 0, w_max: float = 0, n_w: int = 0) [2] (window: tuple[float, float], n_w: int)
Construct a real frequency mesh on the interval \([\omega_{\text{min}}, \omega_{\text{max}}]\) with \(N \geq 0\) equally spaced mesh points.
- Parameters:
- w_minfloat
Lower bound \(\omega_{\mathrm{min}}\) of the frequency interval.
- w_maxfloat
Upper bound \(\omega_{\mathrm{max}}\) of the frequency interval.
- n_wint, int
Size of the mesh.
- windowtuple[float, float]
Pair containing the lower and upper bounds of the frequency interval.
Attributes
Get the step size \(\Delta\) of the mesh, i.e. the distance between two consecutive mesh points.
Get the inverse of the step size of the mesh, i.e. \(1 / \Delta\).
Get the first index of the mesh, i.e. \(0\).
Get the last index of the mesh, i.e. \(N - 1\).
Get the hash value of the mesh.
Is the mesh restricted to positive frequencies?
Get the upper bound of the interval \(\omega_{\text{max}}\), i.e. the value of the last mesh point.
Get the lower bound of the interval \(\omega_{\text{min}}\), i.e. the value of the first mesh point.
Methods
__call__(*args, **kwargs)Call self as a function.
Get a copy of a mesh (for Python bindings).
Copy one mesh into another (for Python bindings).
Check if an index \(n\) is valid.
Set the pointer to a new tail-fitter object constructed with the given parameters.
Map an index \(n \in \{0, 1, \ldots, N-1\}\) to its corresponding data index \(d(n)\).
Map a data index \(d \in \{0, 1, \ldots, N-1\}\) to the corresponding index \(n(d)\).
Map an index \(n \in \{0, 1, \ldots, N-1\}\) to its corresponding value \(m(n)\).
Get the values of all mesh points in a mesh.