|
TRIQS/TRIQS 4.0.0
Researching Interacting Quantum Systems
|
Various utilities used with Meshes.
Classes | |
| struct | triqs::mesh::closest_mesh_point_t< T > |
| Lazy struct used in various function overloads as a placeholder for the closest mesh point to a given value. More... | |
| struct | triqs::mesh::energy_t |
| Represents an energy value to distinguish constructors in imaginary-frequency mesh. More... | |
| struct | triqs::mesh::mesh_iterator< M > |
| A generic random access iterator for 1D meshes. More... | |
Enumerations | |
| enum | triqs::mesh::statistic_enum |
| Enum to specify particle statistics. More... | |
Functions | |
| template<typename... Ts> | |
| auto | triqs::mesh::closest_mesh_pt (Ts &&...ts) |
| Construct a triqs::mesh::closest_mesh_point_t object for a single value or a std::tuple of triqs::mesh::closest_mesh_point_t objects for multiple values. | |
| template<Mesh M> | |
| M | triqs::mesh::copy (M const &m) |
| Get a copy of a mesh (for Python bindings). | |
| template<Mesh M> | |
| void | triqs::mesh::copy_from (M &m1, M const &m2) |
| Copy one mesh into another (for Python bindings). | |
| template<Mesh M> | |
| __inline__ auto | triqs::mesh::evaluate (M const &, auto const &f, typename M::index_t const &n) |
| Evaluate a function \( f \) at the index of a mesh point of the given mesh. | |
| template<Mesh M> | |
| __inline__ auto | triqs::mesh::evaluate (M const &m, auto const &f, typename M::mesh_point_t const &mp) |
| Evaluate a function \( f \) at a specific mesh point of the given mesh. | |
| template<typename T> | |
| __inline__ auto | triqs::mesh::evaluate (Mesh auto const &, auto const &f, mesh::closest_mesh_point_t< T > const &cmp) |
| Evaluate a function \( f \) at a triqs::mesh::closest_mesh_point_t object. | |
| __inline__ auto | triqs::mesh::evaluate (Mesh auto const &, auto const &f, nda::range::all_t) |
| Evaluate a function \( f \) for nda::range::all. | |
| template<Mesh... Ms, typename... Xs> | |
| __inline__ auto | triqs::mesh::evaluate (mesh::prod< Ms... > const &m, auto const &f, Xs const &...xs) |
| Evaluate a multivariate function \( f \) defined on the given product mesh at the given arguments. | |
| template<typename... Ds, typename X1, typename... Xs> | |
| __inline__ auto | triqs::mesh::evaluate (std::tuple< Ds... > const &tup, auto const &f, X1 const &x1, Xs const &...xs) |
| Evaluate a multivariate function \( f \) defined on the given domains (meshes) at the given arguments. | |
| template<typename... Ts> | |
| uint64_t | triqs::mesh::hash (Ts &&...ts) |
| Generic hash function for multiple arguments. | |
| template<nda::MemoryArray R> | |
| std::size_t | triqs::mesh::hash_bytes (R const &r) |
| Hash the raw bytes of a contiguous nda array's elements (forwards to the byte-span overload). | |
| std::size_t | triqs::mesh::hash_bytes (std::span< std::byte const > bytes) |
| Hash the raw bytes of a span via the standard library's std::hash<std::string_view>. | |
| auto | triqs::mesh::operator* (statistic_enum s1, statistic_enum s2) |
| Multiplication operator for two triqs::mesh::statistic_enum objects. | |
| long | triqs::mesh::positive_modulo (long x, long y) |
| Calculate the positive modulo of two integer numbers. | |
| int | triqs::mesh::sign (statistic_enum s) |
| Get the sign associated with the given particle statistics. | |
| template<MeshWithValues M> | |
| auto | triqs::mesh::values (M const &m) |
| Get the values of all mesh points in a mesh. | |
Variables | |
| template<Mesh M> | |
| static constexpr bool | triqs::mesh::is_product = false |
| Constexpr bool that is true if the given triqs::mesh::Mesh type is a product of meshes, i.e. a triqs::mesh::prod. | |
| template<Mesh M> | |
| static constexpr int | triqs::mesh::n_variables = 1 |
| Constexpr variable that holds the number of meshes in a triqs::mesh::Mesh type ( \( 1 \) for non-product meshes). | |
#include <triqs/mesh/utils.hpp>
Enum to specify particle statistics.
The following statistics are supported:
|
nodiscard |
#include <triqs/mesh/utils.hpp>
Construct a triqs::mesh::closest_mesh_point_t object for a single value or a std::tuple of triqs::mesh::closest_mesh_point_t objects for multiple values.
| Ts | Value types. |
| ts | Values to be wrapped in triqs::mesh::closest_mesh_point_t objects. |
|
nodiscard |
#include <triqs/mesh/utils.hpp>
Get a copy of a mesh (for Python bindings).
| M | A mesh type. |
| m | The mesh object to copy. |
| void triqs::mesh::copy_from | ( | M & | m1, |
| M const & | m2 ) |
#include <triqs/mesh/utils.hpp>
Copy one mesh into another (for Python bindings).
Simply calls the copy assignment operator of the mesh.
| M | A mesh type. |
| m1 | The mesh object to copy into. |
| m2 | The mesh object to copy from. |
| __inline__ auto triqs::mesh::evaluate | ( | M const & | , |
| auto const & | f, | ||
| typename M::index_t const & | n ) |
#include <triqs/mesh/evaluate.hpp>
Evaluate a function \( f \) at the index of a mesh point of the given mesh.
It simply forwards the index to the function object \( f \).
| M | triqs::mesh::Mesh type. |
| f | Callable object \( f \) representing the function to be evaluated. |
| n | Mesh point index \( n \). |
Definition at line 63 of file evaluate.hpp.
| __inline__ auto triqs::mesh::evaluate | ( | M const & | m, |
| auto const & | f, | ||
| typename M::mesh_point_t const & | mp ) |
#include <triqs/mesh/evaluate.hpp>
Evaluate a function \( f \) at a specific mesh point of the given mesh.
If the given mesh satisfies the triqs::mesh::MeshWithValues concept, it calls evaluate with the mesh, the function object \( f \) and the value of the mesh point. Otherwise, it calls \( f \) with the mesh point itself.
| M | triqs::mesh::Mesh type. |
| m | Mesh object. |
| f | Callable object \( f \) representing the function to be evaluated. |
| mp | Mesh point of the mesh. |
Definition at line 100 of file evaluate.hpp.
| __inline__ auto triqs::mesh::evaluate | ( | Mesh auto const & | , |
| auto const & | f, | ||
| mesh::closest_mesh_point_t< T > const & | cmp ) |
#include <triqs/mesh/evaluate.hpp>
Evaluate a function \( f \) at a triqs::mesh::closest_mesh_point_t object.
It simply forwards the given object to the function object \( f \).
| T | Value type of triqs::mesh::closest_mesh_point_t. |
| f | Callable object \( f \) representing the function to be evaluated. |
| cmp | triqs::mesh::closest_mesh_point_t object. |
Definition at line 75 of file evaluate.hpp.
| __inline__ auto triqs::mesh::evaluate | ( | Mesh auto const & | , |
| auto const & | f, | ||
| nda::range::all_t | ) |
#include <triqs/mesh/evaluate.hpp>
Evaluate a function \( f \) for nda::range::all.
It simply calls the function object \( f \) with nda::range::all.
| f | Callable object \( f \) representing the function to be evaluated. |
Definition at line 85 of file evaluate.hpp.
| __inline__ auto triqs::mesh::evaluate | ( | mesh::prod< Ms... > const & | m, |
| auto const & | f, | ||
| Xs const &... | xs ) |
#include <triqs/mesh/evaluate.hpp>
Evaluate a multivariate function \( f \) defined on the given product mesh at the given arguments.
It simply forwards the arguments and the components of the product mesh to triqs::mesh::evaluate.
| Ms | triqs::mesh::Mesh types of the product mesh. |
| Xs | Argument types. |
| m | Product mesh. |
| f | Callable object \( f \) representing the function to be evaluated. |
| xs | Arguments \( x_1, \dots, x_n \). |
Definition at line 177 of file evaluate.hpp.
| __inline__ auto triqs::mesh::evaluate | ( | std::tuple< Ds... > const & | tup, |
| auto const & | f, | ||
| X1 const & | x1, | ||
| Xs const &... | xs ) |
#include <triqs/mesh/evaluate.hpp>
Evaluate a multivariate function \( f \) defined on the given domains (meshes) at the given arguments.
The function is evaluated by currying, i.e. it is evaluated step by step for each domain.
Suppose that we want to evaluate the function \( f : \mathrm{D}_1 \times \dots \times \mathrm{D}_n \to \mathrm{R} \) at the points \( x_1 \in \mathrm{D}_1, \dots, x_n \in \mathrm{D}_n \). Then currying works by creating a sequence of functions each taking one argument:
\[ \mathrm{curry}(f) : \mathrm{D}_n \to ( \mathrm{D_{n-1}} \to ( \dots \to ( \mathrm{D}_1 \to \mathrm{R} ) ) ) \; . \]
Here, \( \mathrm{curry}(f) \) is a function that
This is used to evaluate Green's functions defined on product meshes.
Output:
| Ds | Domain (Mesh) types. |
| X1 | First argument type. |
| Xs | Remaining argument types. |
| tup | Tuple of the domains (meshes) \( \mathrm{D}_1, \dots, \mathrm{D}_n \). |
| f | Callable object \( f \) representing the function to be evaluated. |
| x1 | First argument \( x_1 \in \mathrm{D}_1 \). |
| xs | Remaining arguments \( x_2 \in \mathrm{D}_2, \dots, x_n \in \mathrm{D}_n \). |
Definition at line 149 of file evaluate.hpp.
|
nodiscard |
#include <triqs/mesh/utils.hpp>
Generic hash function for multiple arguments.
It simply uses std::hash for each argument and adds the results.
| Ts | Argument types. |
| ts | Objects to be hashed. |
|
nodiscard |
#include <triqs/mesh/utils.hpp>
Hash the raw bytes of a contiguous nda array's elements (forwards to the byte-span overload).
Contiguity is asserted at runtime, since nda views may be strided.
| R | An nda::MemoryArray type. |
| r | Array to hash; must be contiguous (stride 1). |
|
inlinenodiscard |
#include <triqs/mesh/utils.hpp>
Hash the raw bytes of a span via the standard library's std::hash<std::string_view>.
A proper byte mixer, sensitive to every element and their ordering.
| bytes | Byte span to be hashed. |
|
inlinenodiscard |
#include <triqs/mesh/utils.hpp>
Multiplication operator for two triqs::mesh::statistic_enum objects.
| s1 | Left-hand side operand. |
| s2 | Right-hand side operand. |
|
inlinenodiscard |
#include <triqs/mesh/utils.hpp>
Calculate the positive modulo of two integer numbers.
| x | Left-hand side operand \( x \) of the modulo operation. |
| y | Right-hand side operand \( y \geq 0 \) of the modulo operation. |
\[ \begin{cases} x \mod y & \text{if } x \geq 0 \\ x \mod y + y & \text{if } \text{x < 0} \end{cases} \]
|
inlinenodiscard |
#include <triqs/mesh/utils.hpp>
Get the sign associated with the given particle statistics.
| s | triqs::mesh::statistic_enum value. |
|
nodiscard |
#include <triqs/mesh/utils.hpp>
Get the values of all mesh points in a mesh.
| M | A mesh type whose points each carry a value. |
| m | A mesh object. |