|
TRIQS/TRIQS 4.0.0
Researching Interacting Quantum Systems
|
Numerical and mathematical helpers (Legendre, Chebyshev, Padé, real-or-complex, ...).
Classes | |
| struct | triqs::utility::gmp_complex |
| Lightweight complex number backed by GMP mpf_class floats, used during Padé coefficient computation. More... | |
| class | triqs::utility::legendre_generator |
| Recursive generation of Legendre polynomials \( P_l(x) \). More... | |
| class | triqs::utility::pade_approximant |
| Padé approximant of a complex function sampled at \( \{ z_i \} \) with values \( \{ u_i \} \). More... | |
| class | triqs::utility::real_or_complex |
| Type that can represent either a real or a complex number. More... | |
| struct | triqs::utility::time_pt |
| A point in imaginary time, \( \tau_n \in [0, \beta] \), stored on a very fine integer grid. More... | |
| struct | triqs::utility::time_segment |
| Represents the imaginary-time segment \( [0, \beta] \). More... | |
Functions | |
| template<typename T1, typename T2> requires (std::is_arithmetic_v<T1> and std::is_arithmetic_v<T2>) | |
| bool | triqs::utility::kronecker (T1 i, T2 j) |
| Kronecker delta \( \delta_{ij} \). | |
| std::complex< double > | triqs::utility::legendre_T (int n, int l) |
| Get the quantity \( T_{nl} \) from Eq.(E2) in the paper https://doi.org/10.1103/PhysRevB.84.075145. | |
| double | triqs::utility::legendre_t (int l, int p) |
| Get the quantity \( t_l^{(p)} \) from Eq.(E8) in the paper https://doi.org/10.1103/PhysRevB.84.075145. | |
| double | triqs::utility::mod_cyl_bessel_i (int n, double x) |
| Get the modified spherical bessel function \( i_n(x) \) of the first kind of order \( n \) evaluated at \( x \). | |
| double | operator* (time_pt const &tp1, time_pt const &tp2) |
| Multiplication between two time points. | |
| double | operator/ (time_pt const &tp1, time_pt const &tp2) |
| Division between two time points. | |
| nda::vector< double > | triqs::utility::chebyshev_points (long N) |
| Compute Chebyshev points of the first kind on the interval \( [-1, 1] \). | |
| nda::vector< double > | triqs::utility::chebyshev_barycentric_weights (long N) |
| Compute barycentric weights for Chebyshev points of the first kind. | |
| double | triqs::utility::to_standard_interval (double x, double a, double b) |
| Scale a value from interval \( [a, b] \) to the standard interval \( [-1, 1] \). | |
| double | triqs::utility::from_standard_interval (double x, double a, double b) |
| Scale a value from the standard interval \( [-1, 1] \) to interval \( [a, b] \). | |
| template<std::integral I> | |
| bool | triqs::utility::is_zero (I const &x) |
| Exact zero check for integral values. | |
| template<std::floating_point T> | |
| bool | triqs::utility::is_zero (T const &x, T tolerance=100 *std::numeric_limits< T >::epsilon()) |
| Zero check for floating-point values. | |
| template<typename T> | |
| bool | triqs::utility::is_zero (std::complex< T > const &z, T tolerance=100 *std::numeric_limits< T >::epsilon()) |
| Zero check for complex values. | |
| template<std::integral I> | |
| I | triqs::utility::conj (I const &x) |
| Complex conjugate of an integral value. | |
| template<std::floating_point T> | |
| T | triqs::utility::conj (T const &x) |
| Complex conjugate of a floating-point value. | |
| template<typename Z> requires (triqs::is_complex<Z>::value) | |
| Z | triqs::utility::conj (Z const &z) |
| Complex conjugate of a complex value. | |
| template<std::integral I> | |
| I | triqs::utility::real (I const &x) |
| Real part of an integral value. | |
| template<std::floating_point T> | |
| T | triqs::utility::real (T const &x) |
| Real part of a floating-point value. | |
| template<typename Z> requires (triqs::is_complex<Z>::value) | |
| Z | triqs::utility::real (Z const &z) |
| Real part of a complex value. | |
| template<std::integral I> | |
| I | triqs::utility::imag (I const &x) |
| Imaginary part of an integral value. | |
| template<std::floating_point T> | |
| T | triqs::utility::imag (T const &x) |
| Imaginary part of a floating-point value. | |
| template<typename Z> requires (triqs::is_complex<Z>::value) | |
| Z | triqs::utility::imag (Z const &z) |
| Imaginary part of a complex value. | |
|
inline |
#include <triqs/utility/chebyshev.hpp>
Compute barycentric weights for Chebyshev points of the first kind.
Weights are computed as:
\[ w_i = (-1)^i \sin\left(\frac{(2i + 1) \pi}{2N}\right) \]
These weights are used in the barycentric interpolation formula. Weights are returned in the same order as chebyshev_points().
| N | Number of Chebyshev points. |
Definition at line 73 of file chebyshev.hpp.
|
inline |
#include <triqs/utility/chebyshev.hpp>
Compute Chebyshev points of the first kind on the interval \( [-1, 1] \).
Points are computed as:
\[ x_i = \cos\left(\frac{(2i + 1) \pi}{2N}\right) \quad \text{for } i = 0, \ldots, N-1 \]
These are the roots of the Chebyshev polynomial \( T_N(x) \). Points are returned in ascending order.
| N | Number of Chebyshev points. |
Definition at line 50 of file chebyshev.hpp.
| I triqs::utility::conj | ( | I const & | x | ) |
#include <triqs/utility/numeric_ops.hpp>
Complex conjugate of an integral value.
| I | Integral type. |
| x | Value to conjugate. |
Definition at line 80 of file numeric_ops.hpp.
| T triqs::utility::conj | ( | T const & | x | ) |
#include <triqs/utility/numeric_ops.hpp>
Complex conjugate of a floating-point value.
| T | Floating-point type. |
| x | Value to conjugate. |
Definition at line 89 of file numeric_ops.hpp.
| Z triqs::utility::conj | ( | Z const & | z | ) |
#include <triqs/utility/numeric_ops.hpp>
Complex conjugate of a complex value.
| Z | Complex type. |
| z | Value to conjugate. |
Definition at line 100 of file numeric_ops.hpp.
|
inline |
#include <triqs/utility/chebyshev.hpp>
Scale a value from the standard interval \( [-1, 1] \) to interval \( [a, b] \).
| x | Value in \( [-1, 1] \). |
| a | Lower bound of the target interval. |
| b | Upper bound of the target interval. |
Definition at line 102 of file chebyshev.hpp.
| I triqs::utility::imag | ( | I const & | x | ) |
#include <triqs/utility/numeric_ops.hpp>
Imaginary part of an integral value.
| I | Integral type. |
| x | Value to inspect. |
Definition at line 142 of file numeric_ops.hpp.
| T triqs::utility::imag | ( | T const & | x | ) |
#include <triqs/utility/numeric_ops.hpp>
Imaginary part of a floating-point value.
| T | Floating-point type. |
| x | Value to inspect. |
Definition at line 151 of file numeric_ops.hpp.
| Z triqs::utility::imag | ( | Z const & | z | ) |
#include <triqs/utility/numeric_ops.hpp>
Imaginary part of a complex value.
| Z | Complex type. |
| z | Value to inspect. |
Definition at line 162 of file numeric_ops.hpp.
| bool triqs::utility::is_zero | ( | I const & | x | ) |
#include <triqs/utility/numeric_ops.hpp>
Exact zero check for integral values.
| I | Integral type. |
| x | Value to test. |
Definition at line 49 of file numeric_ops.hpp.
| bool triqs::utility::is_zero | ( | std::complex< T > const & | z, |
| T | tolerance = 100 * std::numeric_limits<T>::epsilon() ) |
#include <triqs/utility/numeric_ops.hpp>
Zero check for complex values.
| T | Value type. |
| z | Value to test. |
| tolerance | Absolute tolerance \( \epsilon \). |
Definition at line 69 of file numeric_ops.hpp.
| bool triqs::utility::is_zero | ( | T const & | x, |
| T | tolerance = 100 * std::numeric_limits<T>::epsilon() ) |
#include <triqs/utility/numeric_ops.hpp>
Zero check for floating-point values.
| T | Floating-point type. |
| x | Value to test. |
| tolerance | Absolute tolerance \( \epsilon \). |
Definition at line 59 of file numeric_ops.hpp.
|
inline |
#include <triqs/utility/kronecker.hpp>
Kronecker delta \( \delta_{ij} \).
| T1 | Arithmetic type of the first index. |
| T2 | Arithmetic type of the second index. |
| i | Index \( i \). |
| j | Index \( j \). |
Definition at line 45 of file kronecker.hpp.
| std::complex< double > triqs::utility::legendre_T | ( | int | n, |
| int | l ) |
#include <triqs/utility/legendre.cpp>
Get the quantity \( T_{nl} \) from Eq.(E2) in the paper https://doi.org/10.1103/PhysRevB.84.075145.
| n | Matsubara index \( n \). |
| l | Legendre polynomial order \( l \). |
Definition at line 37 of file legendre.cpp.
| double triqs::utility::legendre_t | ( | int | l, |
| int | p ) |
#include <triqs/utility/legendre.cpp>
Get the quantity \( t_l^{(p)} \) from Eq.(E8) in the paper https://doi.org/10.1103/PhysRevB.84.075145.
| l | Legendre polynomial order \( l \). |
| p | Index \( p \). |
Definition at line 53 of file legendre.cpp.
| double triqs::utility::mod_cyl_bessel_i | ( | int | n, |
| double | x ) |
#include <triqs/utility/legendre.cpp>
Get the modified spherical bessel function \( i_n(x) \) of the first kind of order \( n \) evaluated at \( x \).
| n | Order \( n \) of the modified spherical Bessel function. |
| x | Value \( x \) at which to evaluate the function. |
Definition at line 68 of file legendre.cpp.
Multiplication between two time points.
| tp1 | Left-hand side time point \( \tau_l \). |
| tp2 | Right-hand side time point \( \tau_r \). |
Definition at line 224 of file time_pt.hpp.
Division between two time points.
| tp1 | Left-hand side time point \( \tau_l \). |
| tp2 | Right-hand side time point \( \tau_r \). |
Definition at line 234 of file time_pt.hpp.
| I triqs::utility::real | ( | I const & | x | ) |
#include <triqs/utility/numeric_ops.hpp>
Real part of an integral value.
| I | Integral type. |
| x | Value to inspect. |
Definition at line 111 of file numeric_ops.hpp.
| T triqs::utility::real | ( | T const & | x | ) |
#include <triqs/utility/numeric_ops.hpp>
Real part of a floating-point value.
| T | Floating-point type. |
| x | Value to inspect. |
Definition at line 120 of file numeric_ops.hpp.
| Z triqs::utility::real | ( | Z const & | z | ) |
#include <triqs/utility/numeric_ops.hpp>
Real part of a complex value.
| Z | Complex type. |
| z | Value to inspect. |
Definition at line 131 of file numeric_ops.hpp.
|
inline |
#include <triqs/utility/chebyshev.hpp>
Scale a value from interval \( [a, b] \) to the standard interval \( [-1, 1] \).
| x | Value in \( [a, b] \). |
| a | Lower bound of the original interval. |
| b | Upper bound of the original interval. |
Definition at line 92 of file chebyshev.hpp.