|
TRIQS/TRIQS 4.0.0
Researching Interacting Quantum Systems
|
#include <triqs/gfs/block/block_gf.hpp>
The owning block Green's function container.
triqs::gfs::block_gf is a value-semantic container holding a list of Green's functions (the blocks), each a triqs::gfs::gf, and models the BlockGreenFunction concept.
For Arity == 1 the blocks form a simple vector (a block_gf). For Arity == 2 they form a matrix of blocks (a triqs::gfs::block2_gf).
Each block is accessed by index (or block name) via operator[] (operator() for a block2_gf). Non-owning views are provided by triqs::gfs::block_gf_view.
| 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. |
| Arity | Number of block indices (1 for block_gf, 2 for block2_gf). |
Definition at line 259 of file block_gf.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). | |
| using | const_iterator = iterator_impl<true> |
| Const block iterator type. | |
| using | const_view_type = block_gf_view<Mesh, Target, typename Layout::with_lowest_guarantee_t, 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). | |
| using | g_t = gf<Mesh, Target, Layout> |
| Type of a single block. | |
| 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, typename Layout::with_lowest_guarantee_t, Arity> |
| Associated mutable view type. | |
| using | real_t = block_gf<Mesh, typename Target::real_t, Layout, Arity> |
| The associated real type. | |
| using | regular_type = block_gf<Mesh, Target, Layout, Arity> |
| Associated regular (owning) type. | |
| using | target_t = Target |
| Target type of each block. | |
| using | view_type = block_gf_view<Mesh, Target, typename Layout::with_lowest_guarantee_t, Arity, false> |
| Associated (non const) view type. | |
Public Member Functions | |
| block_gf ()=default | |
| Construct an empty block Green's function (with no blocks). | |
| block_gf (block_gf &&)=default | |
| Move constructor. | |
| block_gf (block_gf const &x)=default | |
| Copy constructor. | |
| template<typename L, bool Cnst> | |
| block_gf (block_gf_view< Mesh, Target, L, Arity, Cnst > const &g) | |
| Construct from a view of the same kind, making a deep copy of the data. | |
| block_gf (block_names_t b) | |
| Construct a one-index block_gf with the given block names and default-constructed blocks. | |
| block_gf (block_names_t b, data_t d) | |
| Construct from a list of block names and a list of Green's functions. | |
| block_gf (block_names_t b, g_t const &g) | |
| Construct a one-index block_gf from block names and one Green's function copied into every block. | |
| block_gf (data_t V) | |
| Construct a two-index block2_gf from a matrix of Green's functions. | |
| block_gf (data_t V) | |
| Construct a one-index block_gf from a vector of Green's functions (block names default to "0", "1", ...). | |
| template<typename G> requires (BlockGreenFunction_v<G> and (std::is_same_v<get_target_t<G>, Target> or std::is_same_v<typename get_target_t<G>::complex_t, Target>)) | |
| block_gf (G const &x) | |
| Construct from any object modeling the BlockGreenFunction concept with a compatible target. | |
| block_gf (int n) | |
| Construct a one-index block_gf of n default-constructed blocks. | |
| block_gf (int n, g_t const &g) | |
| Construct a one-index block_gf of n copies of a Green's function. | |
| block_gf (int n, int p, g_t const &g) | |
| Construct a two-index block2_gf of n x p copies of a Green's function. | |
| block_gf (Mesh const &m, gf_struct_t const &gf_struct) | |
| Construct a one-index block_gf from a mesh and a triqs::gfs::gf_struct_t. | |
| template<typename Int> requires (Arity == 1 && std::is_integral_v<Int>) | |
| block_gf (Mesh const &m, std::vector< Int > const &bl_sizes) | |
| Construct a one-index block_gf from a mesh and a vector of block sizes (block names default to "0", ...). | |
| 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 & | operator= (block_gf &&rhs)=default |
| Move assignment. | |
| block_gf & | operator= (block_gf const &rhs)=default |
| Copy assignment. | |
| template<typename RHS> requires (BlockGreenFunction_v<RHS>) | |
| block_gf & | operator= (RHS &&rhs) |
| Assign from any object modeling the BlockGreenFunction concept. | |
|
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). | |
| 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, 2 for block2_gf). | |
| static constexpr bool | is_const = false |
| Whether this type is a const view (always false for triqs::gfs::block_gf). | |
| static constexpr bool | is_view = false |
| Whether this type is a view (always false for triqs::gfs::block_gf). | |
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 const &) |
| Writing a block Green's function to an output stream is not supported. | |
|
default |
Copy constructor.
| x | Block Green's function to copy from. |
|
inline |
Construct from a list of block names and a list of Green's functions.
The two lists must have matching sizes (throws a triqs::runtime_error otherwise).
| b | Block names. |
| d | Blocks (Green's functions). |
Definition at line 333 of file block_gf.hpp.
|
inline |
Construct from a view of the same kind, making a deep copy of the data.
| L | Layout of the view. |
| Cnst | Whether the view is const. |
| g | View to copy from. |
Definition at line 356 of file block_gf.hpp.
|
inline |
Construct from any object modeling the BlockGreenFunction concept with a compatible target.
The block Green's function is default constructed and then assigned from x, which resizes it accordingly.
| G | A type modeling BlockGreenFunction with the same (or complex-promoted) target type and same arity. |
| x | Object to construct from (e.g. another block Green's function or a lazy expression). |
Definition at line 369 of file block_gf.hpp.
|
inline |
Construct a one-index block_gf from a vector of Green's functions (block names default to "0", "1", ...).
| V | Blocks (Green's functions). |
Definition at line 380 of file block_gf.hpp.
|
inline |
Construct a one-index block_gf of n default-constructed blocks.
| n | Number of blocks. |
Definition at line 388 of file block_gf.hpp.
|
inline |
Construct a one-index block_gf of n copies of a Green's function.
| n | Number of blocks. |
| g | Green's function to copy into each block. |
Definition at line 398 of file block_gf.hpp.
|
inline |
Construct a one-index block_gf from block names and one Green's function copied into every block.
| b | Block names. |
| g | Green's function to copy into each block. |
Definition at line 408 of file block_gf.hpp.
|
inline |
Construct a one-index block_gf with the given block names and default-constructed blocks.
| b | Block names. |
Definition at line 416 of file block_gf.hpp.
|
inline |
Construct a one-index block_gf from a mesh and a triqs::gfs::gf_struct_t.
One block is created per entry of the structure, sized according to the block size (scalar-valued targets ignore the size).
| m | Mesh shared by all blocks. |
| gf_struct | Block structure (block name and size for each block). |
Definition at line 429 of file block_gf.hpp.
|
inline |
Construct a one-index block_gf from a mesh and a vector of block sizes (block names default to "0", ...).
| Int | Integral type of the block sizes. |
| m | Mesh shared by all blocks. |
| bl_sizes | Size of each block. |
Definition at line 450 of file block_gf.hpp.
|
inline |
Construct a two-index block2_gf of n x p copies of a Green's function.
| n | Number of blocks along the first index. |
| p | Number of blocks along the second index. |
| g | Green's function to copy into each block. |
Definition at line 470 of file block_gf.hpp.
|
inline |
Construct a two-index block2_gf from a matrix of Green's functions.
| V | Blocks (vector of vectors of Green's functions). |
Definition at line 478 of file block_gf.hpp.
|
inline |
Get the block names.
Definition at line 53 of file block_gf.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.hpp.
|
inline |
Direct access to the blocks.
Definition at line 41 of file block_gf.hpp.
|
inline |
Direct access to the blocks (const overload).
Definition at line 47 of file block_gf.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.hpp.
|
inlinestaticnodiscard |
Get the HDF5 format tag of a block Green's function.
Definition at line 267 of file block_gf.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.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.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.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.hpp.
|
default |
Move assignment.
| rhs | Block Green's function to move from. |
|
default |
Copy assignment.
| rhs | Block Green's function to assign from. |
|
inline |
Assign from any object modeling the BlockGreenFunction concept.
The assignment resizes the blocks and block names to match rhs, invalidating all existing pointers/views into them. rhs can be any object modeling the block Green's function concept, in particular a lazy expression of block Green's functions.
| RHS | Type of the right hand side; must model BlockGreenFunction. |
| rhs | Object to assign from. |
Definition at line 513 of file block_gf.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.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.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.hpp.
|
inline |
Get the total number of blocks.
Definition at line 109 of file block_gf.hpp.
|
inline |
Get the number of blocks along the first index (block2_gf only).
Definition at line 89 of file block_gf.hpp.
|
inline |
Get the number of blocks along the second index (block2_gf only).
Definition at line 99 of file block_gf.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.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.hpp.