|
TRIQS/TRIQS 4.0.0
Researching Interacting Quantum Systems
|
#include <triqs/gfs/gf/gf_const_view.hpp>
A read-only, non-owning view of a Green's function.
triqs::gfs::gf_const_view refers to the mesh and data of an existing Green's function (or a slice thereof) without owning them and without allowing modification of the underlying data. See triqs::gfs::gf for the owning container and triqs::gfs::gf_view for the mutable view.
| 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 view. |
Definition at line 47 of file gf_const_view.hpp.
Classes | |
| struct | target_and_shape_t |
| Lightweight handle bundling the target type and its shape. More... | |
Public Types | |
| using | complex_t = gf_const_view<M, typename Target::complex_t, Layout> |
| Associated complex-valued type. | |
| using | const_view_type = gf_const_view<M, Target, Layout> |
| Associated const view type. | |
| using | data_t = nda::basic_array_view<const scalar_t, data_rank, Layout> |
| Type of the (const) data array view. | |
| 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, Layout> |
| Associated mutable view type. | |
| using | real_t = gf_const_view<M, typename Target::real_t, Layout> |
| Associated real-valued type. | |
| using | regular_type = gf<M, Target> |
| 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_const_view<M, Target, Layout> |
| Associated (non const) view type. | |
Public Member Functions | |
| gf_const_view ()=default | |
| Construct an empty view, not bound to any data. | |
| gf_const_view (gf< M, Target > &&g) noexcept | |
| Construct a const view onto an rvalue Green's function. | |
| gf_const_view (gf< M, Target > &g) | |
| Construct a const view onto a (non const) Green's function. | |
| gf_const_view (gf< M, Target > const &g) | |
| Construct a const view onto a const Green's function. | |
| gf_const_view (gf_const_view &&)=default | |
| Move constructor. | |
| gf_const_view (gf_const_view const &x)=default | |
| Copy constructor (shallow: the new view refers to the same data). | |
| gf_const_view (gf_view< M, Target > const &g) | |
| Construct a const view from a (mutable) view. | |
| gf_const_view (mesh_t m, data_t dat) | |
| Build a const view on top of a mesh and a data array. | |
| template<typename Fdata> | |
| auto | apply_on_data (Fdata &&fd) |
| Build a const view 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 whose data is the result of applying a function to the data array (const overload). | |
| data_t & | data () & |
| Get the data array view. | |
| data_t | data () && |
| Get the data array view (rvalue overload). | |
| data_t const & | data () const & |
| Get the data array view (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_const_view & | operator= (gf_const_view const &)=delete |
| Deleted: a const view cannot be assigned to. | |
|
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. | |
| void | rebind (gf_const_view< M, Target > const &g) noexcept |
| Rebind the const view to refer to the mesh and data of another const view. | |
| void | rebind (gf_view< M, Target > const &X) noexcept |
| Rebind the const view onto a (mutable) view. | |
| 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. | |
Static Public Member Functions | |
| template<typename Self, typename... Args> | |
| static decltype(auto) | call_impl (Self &&self, Args &&...1) |
| Evaluate the Green's function at the given arguments. | |
| static std::string | hdf5_format () |
| Get the HDF5 format tag of a Green's function. | |
Static Public Attributes | |
| static constexpr int | arity = n_variables<M> |
| Arity of the function, i.e. the number of mesh variables. | |
| static constexpr int | data_rank = arity + Target::rank |
| Rank of the data array representing the function (arity + target_rank). | |
| static constexpr bool | has_no_boundcheck = true |
| Whether bound checking of the data array is disabled (controlled by NDA_ENFORCE_BOUNDCHECK). | |
| static constexpr bool | is_const = true |
| Whether this type is a const view (always true for triqs::gfs::gf_const_view). | |
| static constexpr bool | is_view = true |
| Whether this type is a view (always true for triqs::gfs::gf_const_view). | |
| static constexpr int | target_rank = Target::rank |
| Rank of the target. | |
Friends | |
| void | h5_read (h5::group fg, std::string const &subgroup_name, this_t &g) |
| Read a Green's function from HDF5. | |
| void | h5_write (h5::group fg, std::string const &subgroup_name, this_t const &g) |
| Write a Green's function to HDF5. | |
| std::ostream & | operator<< (std::ostream &out, this_t const &) |
| Write a Green's function to an output stream. | |
| void | swap (gf_const_view &a, gf_const_view &b) noexcept |
| Swap two const views. | |
|
default |
Copy constructor (shallow: the new view refers to the same data).
| x | View to copy from. |
|
inline |
Construct a const view from a (mutable) view.
| g | View to view as const. |
Definition at line 205 of file gf_const_view.hpp.
|
inline |
Construct a const view onto a const Green's function.
| g | Green's function to view. |
Definition at line 211 of file gf_const_view.hpp.
|
inline |
Construct a const view onto a (non const) Green's function.
| g | Green's function to view. |
Definition at line 217 of file gf_const_view.hpp.
|
inlinenoexcept |
Construct a const view onto an rvalue Green's function.
| g | Green's function to view. |
Definition at line 224 of file gf_const_view.hpp.
|
inline |
Build a const view on top of a mesh and a data array.
| m | Mesh. |
| dat | Data array (view). |
Definition at line 232 of file gf_const_view.hpp.
|
inline |
Build a const view whose data is the result of applying a function to the data array.
| Fdata | Type of the callable applied to the data array. |
| fd | Callable taking the data array and returning a transformed array. |
Definition at line 275 of file gf_const_view.hpp.
|
inline |
Build a const view whose data is the result of applying a function to the data array (const overload).
| Fdata | Type of the callable applied to the data array. |
| fd | Callable taking the data array and returning a transformed array. |
Definition at line 289 of file gf_const_view.hpp.
|
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).
| Self | Deduced (explicit object parameter) type of the Green's function. |
| Args | Types of the evaluation arguments (one per mesh dimension). |
Definition at line 49 of file gf_const_view.hpp.
|
inline |
Get the data array view.
Definition at line 130 of file gf_const_view.hpp.
|
inline |
Get the data array view (rvalue overload).
Definition at line 142 of file gf_const_view.hpp.
|
inline |
Get the data array view (const overload).
Definition at line 136 of file gf_const_view.hpp.
|
inline |
Get the shape of the data array.
Needed for generic code: expressions of Green's functions (e.g. g1 + g2) have a data shape but no data array.
Definition at line 152 of file gf_const_view.hpp.
|
inlinestaticnodiscard |
Get the HDF5 format tag of a Green's function.
Definition at line 210 of file gf_const_view.hpp.
|
inline |
Get the mesh of the Green's function.
Definition at line 124 of file gf_const_view.hpp.
|
inlinenoexcept |
Access the Green's function at a mesh point/index (const lvalue overload).
Unlike operator(), this accesses the stored value directly (no interpolation). Passing all_t for one or more dimensions returns a (const) view sliced over the remaining mesh, and lazy arguments return a lazy subscript expression.
| Arg | Types of the access arguments (one per mesh dimension). |
| arg | Mesh points, indices or all_t selectors. |
Definition at line 170 of file gf_const_view.hpp.
|
inlinenoexcept |
Access the Green's function at a mesh point/index passed as a tuple (const overload).
Flattens the tuple into the variadic operator[]. Ensures backward compatibility and easy use when the arguments are stored in a tuple.
| T | Types of the tuple elements (one per mesh dimension). |
| tu | Tuple of mesh points/indices. |
Definition at line 93 of file gf_const_view.hpp.
|
inlinenoexcept |
Access a single-variable Green's function by a mesh index.
| index | Mesh index. |
Definition at line 198 of file gf_const_view.hpp.
|
inlinenoexcept |
Rebind the const view to refer to the mesh and data of another const view.
| g | Const view to rebind onto. |
Definition at line 249 of file gf_const_view.hpp.
|
inlinenoexcept |
Rebind the const view onto a (mutable) view.
| X | View to rebind onto. |
Definition at line 258 of file gf_const_view.hpp.
|
inline |
Get a handle to the target and its shape.
Definition at line 158 of file gf_const_view.hpp.
|
inline |
Get a generator over the multi-indices of the target space.
Definition at line 170 of file gf_const_view.hpp.
|
inline |
Get the shape of the target.
Definition at line 164 of file gf_const_view.hpp.
|
friend |
Read a Green's function from HDF5.
Throws a triqs::runtime_error if the HDF5 format tag does not correspond to a Green's function.
| fg | h5::group to read from. |
| subgroup_name | Name of the subgroup to read. |
| g | Green's function to read into. |
Definition at line 237 of file gf_const_view.hpp.
|
friend |
Write a Green's function to HDF5.
| fg | h5::group to write into. |
| subgroup_name | Name of the subgroup to create. |
| g | Green's function to write. |
Definition at line 222 of file gf_const_view.hpp.
|
friend |
Write a Green's function to an output stream.
| out | std::ostream output stream. |
Definition at line 253 of file gf_const_view.hpp.
|
friend |
Swap two const views.
| a | First view. |
| b | Second view. |
Definition at line 241 of file gf_const_view.hpp.