template<Mesh M, typename Target, typename Layout>
class triqs::gfs::gf< M, Target, Layout >
The owning Green's function container.
triqs::gfs::gf is the central, value-semantic container of the Green's function module. It owns a mesh and a data array, and represents a function defined on the mesh whose value at each mesh point is fixed by the Target type (see triqs::gfs::scalar_valued, triqs::gfs::matrix_valued, triqs::gfs::tensor_valued).
The data array has rank arity + Target::rank, where arity is the number of mesh dimensions. The function can be accessed at a mesh point with operator[] and evaluated at an arbitrary point with operator() (using the interpolation scheme of the mesh).
Non-owning views are provided by triqs::gfs::gf_view and triqs::gfs::gf_const_view.
- Template Parameters
-
| M | Mesh type, modeling triqs::mesh::Mesh; fixes the domain of definition. |
| Target | Target type; fixes the value stored at each mesh point. |
| Layout | Memory layout policy of the data array. |
Definition at line 194 of file gf.hpp.
|
|
using | complex_t = gf<M, typename Target::complex_t, Layout> |
| | Associated complex-valued type.
|
|
using | const_view_type = gf_const_view<M, Target, typename Layout::with_lowest_guarantee_t> |
| | Associated const view type.
|
|
using | data_t = nda::basic_array<scalar_t, data_rank, Layout, 'A', nda::heap<>> |
| | Type of the data array.
|
|
using | mesh_index_t = typename mesh_t::index_t |
| | Type of a mesh index.
|
|
using | mesh_point_t = typename mesh_t::mesh_point_t |
| | Type of a mesh point.
|
|
using | mesh_t = M |
| | Mesh type.
|
|
using | mutable_view_type = gf_view<M, Target, typename Layout::with_lowest_guarantee_t> |
| | Associated mutable view type.
|
|
using | real_t = gf<M, typename Target::real_t, Layout> |
| | Associated real-valued type.
|
|
using | regular_type = gf<M, Target, Layout> |
| | Associated regular (owning) type.
|
|
using | scalar_t = typename Target::scalar_t |
| | Scalar type of the target (real or complex).
|
|
using | target_shape_t = std::array<long, Target::rank> |
| | Type of the target shape, i.e. an array holding the extent of each target dimension.
|
|
using | target_t = Target |
| | Target type.
|
|
using | view_type = gf_view<M, Target, typename Layout::with_lowest_guarantee_t> |
| | Associated (non const) view type.
|
|
|
| gf ()=default |
| | Construct an empty Green's function (with an empty mesh and data array).
|
template<typename G>
requires (GreenFunction<G>::value and std::is_same_v<mesh_t, typename G::mesh_t>) |
| | gf (G const &g) |
| | Construct from any object modeling the GreenFunction concept with the same mesh type.
|
|
| gf (gf &&)=default |
| | Move constructor.
|
| | gf (gf const &x)=default |
| | Copy constructor.
|
| | gf (gf_const_view< M, Target > const &g) |
| | Construct from a const view, making a deep copy of the data.
|
| | gf (gf_view< M, Target > const &g) |
| | Construct from a view, making a deep copy of the data.
|
| | gf (mesh_t m, data_t dat) |
| | Construct from a mesh and a data array.
|
| | gf (mesh_t m, target_shape_t shape={}) |
| | Construct from a mesh and a target shape.
|
| template<typename Fdata> |
| auto | apply_on_data (Fdata &&fd) |
| | Build a view of a Green's function whose data is the result of applying a function to the data array.
|
| template<typename Fdata> |
| auto | apply_on_data (Fdata &&fd) const |
| | Build a const view of a Green's function whose data is the result of applying a function to the data array.
|
| data_t & | data () & |
| | Get the data array.
|
| data_t | data () && |
| | Get the data array (rvalue overload).
|
| data_t const & | data () const & |
| | Get the data array (const overload).
|
| auto const & | data_shape () const |
| | Get the shape of the data array.
|
| mesh_t const & | mesh () const |
| | Get the mesh of the Green's function.
|
|
template<typename... Args> |
| decltype(auto) | operator() (Args &&...1) & |
| | Lvalue overload of the call operator (delegates to call_impl()).
|
|
template<typename... Args> |
| decltype(auto) | operator() (Args &&...1) && |
| | Rvalue overload of the call operator (delegates to call_impl()).
|
|
template<typename... Args> |
| decltype(auto) | operator() (Args &&...1) const & |
| | Const lvalue overload of the call operator (delegates to call_impl()).
|
| gf & | operator= (gf &&rhs) noexcept |
| | Move assignment.
|
| gf & | operator= (gf const &rhs)=default |
| | Copy assignment.
|
template<typename RHS>
requires (GreenFunction<RHS>::value and not std::is_same_v<std::decay_t<RHS>, gf>) |
| gf & | operator= (RHS &&rhs) |
| | Assign from any object modeling the GreenFunction concept.
|
template<typename... Arg>
requires (sizeof...(Arg) == arity) |
| decltype(auto) | operator[] (Arg &&...arg) &&noexcept(has_no_boundcheck) |
| | Rvalue overload of the variadic operator[] (see the const lvalue overload).
|
template<typename... Arg>
requires (sizeof...(Arg) == arity) |
| decltype(auto) | operator[] (Arg &&...arg) &noexcept(has_no_boundcheck) |
| | Lvalue overload of the variadic operator[] (see the const lvalue overload).
|
template<typename... Arg>
requires (sizeof...(Arg) == arity) |
| decltype(auto) | operator[] (Arg &&...arg) const &noexcept(has_no_boundcheck) |
| | Access the Green's function at a mesh point/index (const lvalue overload).
|
template<typename... T>
requires (sizeof...(T) == arity) |
| decltype(auto) | operator[] (std::tuple< T... > const &tu) const noexcept(has_no_boundcheck) |
| | Access the Green's function at a mesh point/index passed as a tuple (const overload).
|
template<typename... T>
requires (sizeof...(T) == arity) |
| decltype(auto) | operator[] (std::tuple< T... > const &tu) noexcept(has_no_boundcheck) |
| | Non-const overload of the tuple operator[] (see the const overload).
|
| decltype(auto) | operator[] (typename mesh_t::index_t const &index) noexcept(has_no_boundcheck) |
| | Access a single-variable Green's function by a mesh index.
|
| target_and_shape_t | target () const |
| | Get a handle to the target and its shape.
|
| auto | target_indices () const |
| | Get a generator over the multi-indices of the target space.
|
| std::array< long, Target::rank > | target_shape () const |
| | Get the shape of the target.
|
template<Mesh M, typename Target, typename Layout>
template<typename Self, typename... Args>
| decltype(auto) triqs::gfs::gf< M, Target, Layout >::call_impl |
( |
Self && | self, |
|
|
Args &&... | 1 ) |
|
inlinestatic |
Evaluate the Green's function at the given arguments.
With no argument, returns a (const) view of the whole Green's function. Otherwise, the number of arguments must equal the arity of the mesh; if any argument is a lazy CLEF expression a lazy call expression is returned, else the Green's function is evaluated using the mesh's interpolation scheme (triqs::gfs::gf_evaluator).
- Template Parameters
-
| Self | Deduced (explicit object parameter) type of the Green's function. |
| Args | Types of the evaluation arguments (one per mesh dimension). |
- Returns
- A view (no argument), a lazy expression (lazy arguments) or the interpolated value.
Definition at line 49 of file gf.hpp.