TRIQS/TRIQS 4.0.0
Researching Interacting Quantum Systems
Loading...
Searching...
No Matches
defs.hpp
#include "../../arrays.hpp"
#include "../../mesh/concepts.hpp"
#include "../../mesh/matsubara_freq.hpp"
#include "../../mesh/prod.hpp"
#include "../../mesh/utils.hpp"
#include "../../utility/factory.hpp"
#include <array>
#include <complex>
#include <cstddef>
#include <utility>

Detailed Description

Provides common type aliases, forward declarations and internal helpers for the Green's function containers.

Definition in file defs.hpp.

Go to the source code of this file.

Classes

struct  triqs::gfs::default_evaluator
 Default evaluator policy. More...
struct  triqs::gfs::matsubara_freq
 Represents a Matsubara frequency \( i\omega_n \). More...

Enumerations

enum  triqs::gfs::statistic_enum
 Enum to specify particle statistics. More...

Functions

template<typename... Ts>
auto triqs::gfs::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<typename T, typename... U>
triqs::gfs::factory (U &&...x)
 Generic factory to construct an object of a given type from an arbitrary parameter pack of arguments.

Variables

template<Mesh M>
static constexpr int triqs::gfs::n_variables
 Constexpr variable that holds the number of meshes in a triqs::mesh::Mesh type ( \( 1 \) for non-product meshes).

Enumeration Type Documentation

◆ statistic_enum

Enum to specify particle statistics.

The following statistics are supported:

  • Boson and
  • Fermion.

Definition at line 163 of file utils.hpp.

Function Documentation

◆ closest_mesh_pt()

template<typename... Ts>
auto triqs::mesh::closest_mesh_pt ( Ts &&... ts)
nodiscard

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 Parameters
TsValue types.
Parameters
tsValues to be wrapped in triqs::mesh::closest_mesh_point_t objects.
Returns
Either a triqs::mesh::closest_mesh_point_t object or a tuple of such objects.

Definition at line 199 of file utils.hpp.

◆ factory()

template<typename T, typename... U>
T triqs::utility::factory ( U &&... x)

Generic factory to construct an object of a given type from an arbitrary parameter pack of arguments.

The actual construction is delegated to the helper class detail::factories<T>, whose static invoke member is called with the forwarded arguments. By default detail::factories<T> simply forwards its single argument to a constructor of T, so any type that is directly constructible from the given argumnets works out of the box.

To support custom construction logic for a type T (e.g. element-wise conversion, allocation, or building from a different representation), provide a partial or full specialization of detail::factories<T> exposing one or more static invoke overloads that return a T. The library already specializes it for std::vector<T> to allow constructing a vector from another vector with element-wise conversion.

Template Parameters
TTarget type.
UArgument types.
Parameters
xConstructor arguments.
Returns
A newly constructed T instance.

Definition at line 95 of file factory.hpp.