|
TRIQS/TRIQS 4.0.0
Researching Interacting Quantum Systems
|
#include <triqs/gfs/block/block_gf_view.hpp>
A non-owning view of a block Green's function.
triqs::gfs::block_gf_view refers to the blocks of an existing block Green's function without owning them. Whether it is read-only is fixed by the IsConst template parameter (see the triqs::gfs::block_gf_const_view alias). Assigning to a mutable view writes through to the underlying blocks. See triqs::gfs::block_gf for the owning container.
| Mesh | Mesh type of each block, modeling triqs::mesh::Mesh. |
| Target | Target type of each block. |
| Layout | Memory layout policy of each block's data array view. |
| Arity | Number of block indices (1 for block_gf_view, 2 for block2_gf_view). |
| IsConst | Whether the view is read-only. |
Definition at line 53 of file block_gf_view.hpp.
Classes | |
| class | iterator_impl |
| Forward iterator over the blocks of a block Green's function. More... | |
Public Types | |
| using | block_names_t = std::conditional_t<Arity == 1, std::vector<std::string>, std::vector<std::vector<std::string>>> |
| Type storing the block names (a vector of names, or vector of vectors for a block2_gf_view). | |
| using | const_iterator = iterator_impl<true> |
| Const block iterator type. | |
| using | const_view_type = block_gf_view<Mesh, Target, Layout, Arity, true> |
| Associated const view type. | |
| using | data_t = std::conditional_t<Arity == 1, std::vector<g_t>, std::vector<std::vector<g_t>>> |
| Type storing the blocks (a vector of blocks, or vector of vectors for a block2_gf_view). | |
| using | g_t = std::conditional_t<IsConst, gf_const_view<Mesh, Target, Layout>, gf_view<Mesh, Target, Layout>> |
| Type of a single block (a const or mutable view depending on IsConst). | |
| using | iterator = iterator_impl<false> |
| Mutable block iterator type. | |
| using | mesh_t = Mesh |
| Mesh type of each block. | |
| using | mutable_view_type = block_gf_view<Mesh, Target, Layout, Arity> |
| Associated mutable view type. | |
| using | real_t = block_gf_view<Mesh, typename Target::real_t, Layout, Arity, IsConst> |
| The associated real type. | |
| using | regular_type = block_gf<Mesh, Target, typename Layout::contiguous_t, Arity> |
| Associated regular (owning) type. | |
| using | target_t = Target |
| Target type of each block. | |
| using | view_type = block_gf_view<Mesh, Target, Layout, Arity, false> |
| Associated (non const) view type. | |
Public Member Functions | |
| block_gf_view ()=default | |
| Construct an empty view, not bound to any data. | |
| template<typename L> | |
| block_gf_view (block_gf< Mesh, Target, L, Arity > &&g) noexcept | |
| Construct a view onto an rvalue block Green's function. | |
| template<typename L> requires (!IsConst) | |
| block_gf_view (block_gf< Mesh, Target, L, Arity > &g) | |
| Construct a mutable view onto a (non const) block Green's function. | |
| template<typename L> requires (IsConst) | |
| block_gf_view (block_gf< Mesh, Target, L, Arity > const &g) | |
| Construct a const view onto a block Green's function. | |
| block_gf_view (block_gf_view &&)=default | |
| Move constructor. | |
| block_gf_view (block_gf_view const &x)=default | |
| Copy constructor (shallow: the new view refers to the same blocks). | |
| template<typename L> requires (IsConst) | |
| block_gf_view (block_gf_view< Mesh, Target, L, Arity, !IsConst > const &g) | |
| Construct a const view from a mutable view of the same kind. | |
| block_gf_view (block_names_t b, data_t d) | |
| Construct from a list of block names and a list of Green's function views. | |
| iterator | begin () |
| Get an iterator to the first block. | |
| const_iterator | begin () const |
| Get a const iterator to the first block. | |
| block_names_t const & | block_names () const |
| Get the block names. | |
| std::vector< int > | block_sizes () const |
| Get the matrix size of each block. | |
| auto | cbegin () |
| Get a const iterator to the first block. | |
| auto | cend () |
| Get a const iterator past the last block. | |
| data_t & | data () |
| Direct access to the blocks. | |
| data_t const & | data () const |
| Direct access to the blocks (const overload). | |
| iterator | end () |
| Get an iterator past the last block. | |
| const_iterator | end () const |
| Get a const iterator past the last block. | |
| gf_struct_t | gf_struct () const |
| Get the block structure. | |
| view_type | operator() () |
| Make a view of *this if it is non const. | |
| const_view_type | operator() () const |
| Make a const view of *this. | |
| template<typename... Args> requires (nda::clef::is_clef_expression<Args...>) | |
| auto | operator() (Args &&...1) & |
| Make a lazy CLEF call expression (lvalue overload). | |
|
template<typename... Args> requires (nda::clef::is_clef_expression<Args...>) | |
| auto | operator() (Args &&...1) && |
| Rvalue overload of the lazy CLEF call (see the lvalue overload). | |
|
template<typename... Args> requires (nda::clef::is_clef_expression<Args...>) | |
| auto | operator() (Args &&...1) const & |
| Const lvalue overload of the lazy CLEF call (see the lvalue overload). | |
| decltype(auto) | operator() (int n) const |
| Access the n-th block of a one-index block Green's function. | |
| decltype(auto) | operator() (int n1, int n2) |
| Access block (n1, n2) of a two-index block Green's function. | |
| decltype(auto) | operator() (int n1, int n2) const |
| Access block (n1, n2) of a two-index block Green's function (const overload). | |
| block_gf_view & | operator= (block_gf_view const &rhs) |
| ------------— Operator = -----------------— | |
| template<typename L, typename G> requires (not IsConst) | |
| block_gf_view & | operator= (lazy_transform_t< L, G > const &rhs) |
| Assignment operator overload specific for triqs::gfs::lazy_transform_t objects. | |
| template<typename RHS> requires (not IsConst) | |
| block_gf_view & | operator= (RHS const &rhs) |
| Assign from any compatible right hand side, writing through the view without resizing it. | |
|
template<typename Arg> requires (nda::clef::is_clef_expression<Arg>) | |
| auto | operator[] (Arg &&arg) & |
| Lvalue overload of the lazy CLEF subscript (see the const lvalue overload). | |
|
template<typename Arg> requires (nda::clef::is_clef_expression<Arg>) | |
| auto | operator[] (Arg &&arg) && |
| Rvalue overload of the lazy CLEF subscript (see the const lvalue overload). | |
| template<typename Arg> requires (nda::clef::is_clef_expression<Arg>) | |
| auto | operator[] (Arg &&arg) const & |
| Make a lazy CLEF subscript expression (const lvalue overload). | |
| decltype(auto) | operator[] (int n) |
| Access the n-th block of a one-index block Green's function. | |
| decltype(auto) | operator[] (int n) const |
| Access the n-th block of a one-index block Green's function (const overload). | |
| void | rebind (block_gf< Mesh, Target, Layout, Arity > &X) noexcept |
| Rebind a view onto a (non const) block Green's function. | |
| void | rebind (block_gf< Mesh, Target, Layout, Arity > const &X) noexcept |
| Rebind a const view onto a block Green's function. | |
| void | rebind (block_gf_view x) noexcept |
| Rebind the view to refer to the blocks of another view of the same kind. | |
| void | rebind (block_gf_view< Mesh, Target, Layout, Arity, !IsConst > const &X) noexcept |
| Rebind a const view onto a mutable view of the same kind. | |
| int | size () const |
| Get the total number of blocks. | |
| int | size1 () const |
| Get the number of blocks along the first index (block2_gf only). | |
| int | size2 () const |
| Get the number of blocks along the second index (block2_gf only). | |
Static Public Member Functions | |
| static std::string | hdf5_format () |
| Get the HDF5 format tag of a block Green's function. | |
Public Attributes | |
| std::string | name |
| Name of the block Green's function. | |
Static Public Attributes | |
| static constexpr int | arity = Arity |
| Number of block indices (1 for block_gf_view, 2 for block2_gf_view). | |
| static constexpr bool | is_const = IsConst |
| Whether this view is read-only. | |
| static constexpr bool | is_view = true |
| Whether this type is a view (always true for triqs::gfs::block_gf_view). | |
Friends | |
| void | h5_read (h5::group fg, std::string const &subgroup_name, this_t &g) |
| Read a block Green's function from HDF5. | |
| void | h5_write (h5::group fg, std::string const &subgroup_name, this_t const &g) |
| Write a block Green's function to HDF5. | |
| std::ostream & | operator<< (std::ostream &out, block_gf_view const &) |
| Writing a block Green's function to an output stream is not supported. | |
|
default |
Copy constructor (shallow: the new view refers to the same blocks).
| x | View to copy from. |
|
inline |
Construct from a list of block names and a list of Green's function views.
The two lists must have matching sizes (throws a triqs::runtime_error otherwise).
| b | Block names. |
| d | Blocks (Green's function views). |
Definition at line 128 of file block_gf_view.hpp.
|
inline |
Construct a const view onto a block Green's function.
| L | Layout of the block Green's function. |
| g | Block Green's function to view. |
Definition at line 152 of file block_gf_view.hpp.
|
inline |
Construct a mutable view onto a (non const) block Green's function.
| L | Layout of the block Green's function. |
| g | Block Green's function to view. |
Definition at line 162 of file block_gf_view.hpp.
|
inlinenoexcept |
Construct a view onto an rvalue block Green's function.
| L | Layout of the block Green's function. |
| g | Block Green's function to view. |
Definition at line 171 of file block_gf_view.hpp.
|
inline |
Construct a const view from a mutable view of the same kind.
| L | Layout of the view. |
| g | View to copy from. |
Definition at line 179 of file block_gf_view.hpp.
|
inline |
Get the block names.
Definition at line 53 of file block_gf_view.hpp.
|
inline |
Get the matrix size of each block.
Only valid for matrix-valued blocks (rank-2 target); requires each block to have a square target shape.
Definition at line 62 of file block_gf_view.hpp.
|
inline |
Direct access to the blocks.
Definition at line 41 of file block_gf_view.hpp.
|
inline |
Direct access to the blocks (const overload).
Definition at line 47 of file block_gf_view.hpp.
|
inline |
Get the block structure.
Will fail if the target shape is non-square, because block_sizes() will fail.
Definition at line 79 of file block_gf_view.hpp.
|
inlinestaticnodiscard |
Get the HDF5 format tag of a block Green's function.
Definition at line 267 of file block_gf_view.hpp.
|
inline |
Make a lazy CLEF call expression (lvalue overload).
| Args | Types of the lazy CLEF arguments. |
Definition at line 184 of file block_gf_view.hpp.
|
inline |
Access the n-th block of a one-index block Green's function.
| n | Block index. |
Definition at line 146 of file block_gf_view.hpp.
|
inline |
Access block (n1, n2) of a two-index block Green's function.
| n1 | First block index. |
| n2 | Second block index. |
Definition at line 170 of file block_gf_view.hpp.
|
inline |
Access block (n1, n2) of a two-index block Green's function (const overload).
| n1 | First block index. |
| n2 | Second block index. |
Definition at line 158 of file block_gf_view.hpp.
|
inline |
------------— Operator = -----------------—
Copy assignment: copy the data through the view without resizing it.
| rhs | View to copy from. |
Definition at line 190 of file block_gf_view.hpp.
|
inline |
Assignment operator overload specific for triqs::gfs::lazy_transform_t objects.
Applies the deferred lambda block by block, e.g. the lazy object returned by fourier(my_block_gf).
| L | Type of the deferred lambda. |
| G | Type of the deferred value. |
| rhs | The lazy object returned e.g. by fourier(my_block_gf). |
Definition at line 236 of file block_gf_view.hpp.
|
inline |
Assign from any compatible right hand side, writing through the view without resizing it.
rhs can be a scalar (assigned to every block) or anything with .block_names() and [n] returning a Green's function. For a non-scalar right hand side the number of blocks must match (throws otherwise).
| RHS | Type of the right hand side. |
| rhs | Object to assign from. |
Definition at line 208 of file block_gf_view.hpp.
|
inline |
Make a lazy CLEF subscript expression (const lvalue overload).
| Arg | Type of the lazy CLEF argument. |
| arg | Lazy CLEF argument. |
Definition at line 239 of file block_gf_view.hpp.
|
inline |
Access the n-th block of a one-index block Green's function.
| n | Block index. |
Definition at line 224 of file block_gf_view.hpp.
|
inline |
Access the n-th block of a one-index block Green's function (const overload).
| n | Block index. |
Definition at line 213 of file block_gf_view.hpp.
|
inlinenoexcept |
Rebind a view onto a (non const) block Green's function.
| X | Block Green's function to rebind onto. |
Definition at line 285 of file block_gf_view.hpp.
|
inlinenoexcept |
Rebind a const view onto a block Green's function.
| X | Block Green's function to rebind onto. |
Definition at line 275 of file block_gf_view.hpp.
|
inlinenoexcept |
Rebind the view to refer to the blocks of another view of the same kind.
| x | View to rebind onto. |
Definition at line 255 of file block_gf_view.hpp.
|
inlinenoexcept |
Rebind a const view onto a mutable view of the same kind.
| X | View to rebind onto. |
Definition at line 265 of file block_gf_view.hpp.
|
inline |
Get the total number of blocks.
Definition at line 109 of file block_gf_view.hpp.
|
inline |
Get the number of blocks along the first index (block2_gf only).
Definition at line 89 of file block_gf_view.hpp.
|
inline |
Get the number of blocks along the second index (block2_gf only).
Definition at line 99 of file block_gf_view.hpp.
|
friend |
Read a block Green's function from HDF5.
Throws a triqs::runtime_error if the HDF5 format tag does not correspond to the expected block format.
| fg | h5::group to read from. |
| subgroup_name | Name of the subgroup to read. |
| g | Block Green's function to read into. |
Definition at line 305 of file block_gf_view.hpp.
|
friend |
Write a block Green's function to HDF5.
| fg | h5::group to write into. |
| subgroup_name | Name of the subgroup to create. |
| g | Block Green's function to write. |
Definition at line 281 of file block_gf_view.hpp.