TRIQS/TRIQS 4.0.0
Researching Interacting Quantum Systems
Loading...
Searching...
No Matches
_gf_view_common.hpp

Detailed Description

Member code shared by triqs::gfs::gf, triqs::gfs::gf_view and triqs::gfs::gf_const_view.

Definition in file _gf_view_common.hpp.

Go to the source code of this file.

Functions

template<typename Self, typename... Args>
static decltype(auto) call_impl (Self &&self, Args &&...1)
 Evaluate the Green's function at the given arguments.
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.
static std::string hdf5_format ()
 Get the HDF5 format tag of a Green's function.
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()).
std::ostream & operator<< (std::ostream &out, this_t const &)
 Write a Green's function to an output stream.
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) 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).
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.

Variables

static constexpr bool has_no_boundcheck = true
 Whether bound checking of the data array is disabled (controlled by NDA_ENFORCE_BOUNDCHECK).

Function Documentation

◆ call_impl()

template<typename Self, typename... Args>
decltype(auto) call_impl ( Self && self,
Args &&... 1 )
static

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
SelfDeduced (explicit object parameter) type of the Green's function.
ArgsTypes 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 48 of file _gf_view_common.hpp.

◆ h5_read()

friend void h5_read ( h5::group fg,
std::string const & subgroup_name,
this_t & g )

Read a Green's function from HDF5.

Read a block Green's function from HDF5.

Throws a triqs::runtime_error if the HDF5 format tag does not correspond to a Green's function.

Parameters
fgh5::group to read from.
subgroup_nameName of the subgroup to read.
gGreen's function to read into.

Definition at line 236 of file _gf_view_common.hpp.

◆ h5_write()

friend void h5_write ( h5::group fg,
std::string const & subgroup_name,
this_t const & g )

Write a Green's function to HDF5.

Write a block Green's function to HDF5.

Parameters
fgh5::group to write into.
subgroup_nameName of the subgroup to create.
gGreen's function to write.

Definition at line 221 of file _gf_view_common.hpp.

◆ hdf5_format()

std::string hdf5_format ( )
staticnodiscard

Get the HDF5 format tag of a Green's function.

Returns
The string "Gf".

Definition at line 209 of file _gf_view_common.hpp.

◆ operator()()

template<typename... Args>
decltype(auto) operator() ( Args &&... 1) const &

Const lvalue overload of the call operator (delegates to call_impl()).

Lvalue overload of the call operator (delegates to call_impl()).

Definition at line 65 of file _gf_view_common.hpp.

◆ operator<<()

friend std::ostream & operator<< ( std::ostream & out,
this_t const &  )

Write a Green's function to an output stream.

Parameters
outstd::ostream output stream.
Returns
Reference to the output stream.

Definition at line 252 of file _gf_view_common.hpp.

◆ operator[]() [1/3]

template<typename... Arg>
requires (sizeof...(Arg) == arity)
decltype(auto) operator[] ( Arg &&... arg) const &
noexcept

Access the Green's function at a mesh point/index (const lvalue overload).

Lvalue overload of the variadic operator[] (see the 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.

Template Parameters
ArgTypes of the access arguments (one per mesh dimension).
Parameters
argMesh points, indices or all_t selectors.
Returns
The stored value, a sliced view, or a lazy expression.

Definition at line 169 of file _gf_view_common.hpp.

◆ operator[]() [2/3]

template<typename... T>
requires (sizeof...(T) == arity)
decltype(auto) operator[] ( std::tuple< T... > const & tu) const
noexcept

Access the Green's function at a mesh point/index passed as a tuple (const overload).

Non-const overload of the tuple operator[] (see the const overload).

Flattens the tuple into the variadic operator[]. Ensures backward compatibility and easy use when the arguments are stored in a tuple.

Template Parameters
TTypes of the tuple elements (one per mesh dimension).
Parameters
tuTuple of mesh points/indices.
Returns
The value (or sub-view) at the given point.

Definition at line 92 of file _gf_view_common.hpp.

◆ operator[]() [3/3]

decltype(auto) operator[] ( typename mesh_t::index_t const & index)
noexcept

Access a single-variable Green's function by a mesh index.

Parameters
indexMesh index.
Returns
The stored value at the corresponding mesh point.

Definition at line 197 of file _gf_view_common.hpp.