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

Detailed Description

Member code shared by triqs::gfs::block_gf and triqs::gfs::block_gf_view.

Definition in file _block_gf_view_common.hpp.

Go to the source code of this file.

Classes

class  iterator_impl< is_const >
 Forward iterator over the blocks of a block Green's function. More...

Typedefs

using const_iterator = iterator_impl<true>
 Const block iterator type.
using iterator = iterator_impl<false>
 Mutable block iterator type.

Functions

iterator begin ()
 Get an 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.
iterator end ()
 Get an iterator past the last block.
gf_struct_t gf_struct () const
 Get the block structure.
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.
static std::string hdf5_format ()
 Get the HDF5 format tag of a block Green's function.
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).
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) const
 Access block (n1, n2) of a two-index block Green's function (const 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) 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).

Function Documentation

◆ begin()

const_iterator begin ( )

Get an iterator to the first block.

Get a const iterator to the first block.

Definition at line 416 of file _block_gf_view_common.hpp.

◆ block_names()

block_names_t const & block_names ( ) const

Get the block names.

Returns
A const reference to the block names.

Definition at line 52 of file _block_gf_view_common.hpp.

◆ block_sizes()

std::vector< int > block_sizes ( ) const

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.

Returns
A vector holding the size of each block.

Definition at line 61 of file _block_gf_view_common.hpp.

◆ data()

data_t const & data ( )

Direct access to the blocks.

Direct access to the blocks (const overload).

Returns
A reference to the block storage.
A const reference to the block storage.

Definition at line 40 of file _block_gf_view_common.hpp.

◆ end()

const_iterator end ( )

Get an iterator past the last block.

Get a const iterator past the last block.

Definition at line 422 of file _block_gf_view_common.hpp.

◆ gf_struct()

gf_struct_t gf_struct ( ) const

Get the block structure.

Will fail if the target shape is non-square, because block_sizes() will fail.

Returns
A triqs::gfs::gf_struct_t pairing each block name with its size.

Definition at line 78 of file _block_gf_view_common.hpp.

◆ h5_read()

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

Read a block Green's function from HDF5.

Read a Green's function from HDF5.

Throws a triqs::runtime_error if the HDF5 format tag does not correspond to the expected block format.

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

Definition at line 304 of file _block_gf_view_common.hpp.

◆ h5_write()

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

Write a block Green's function to HDF5.

Write a Green's function to HDF5.

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

Definition at line 280 of file _block_gf_view_common.hpp.

◆ hdf5_format()

std::string hdf5_format ( )
staticnodiscard

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

Returns
The string "BlockGf" ("Block2Gf" for a block2_gf).

Definition at line 266 of file _block_gf_view_common.hpp.

◆ operator()() [1/4]

view_type operator() ( ) const

Make a const view of *this.

Make a view of *this if it is non const.

Definition at line 135 of file _block_gf_view_common.hpp.

◆ operator()() [2/4]

template<typename... Args>
requires (nda::clef::is_clef_expression<Args...>)
auto operator() ( Args &&... 1) &

Make a lazy CLEF call expression (lvalue overload).

Const lvalue overload of the lazy CLEF call (see the lvalue overload).

Template Parameters
ArgsTypes of the lazy CLEF arguments.
Returns
A lazy call expression.

Definition at line 183 of file _block_gf_view_common.hpp.

◆ operator()() [3/4]

decltype(auto) operator() ( int n) const

Access the n-th block of a one-index block Green's function.

Parameters
nBlock index.
Returns
The n-th block.

Definition at line 145 of file _block_gf_view_common.hpp.

◆ operator()() [4/4]

decltype(auto) operator() ( int n1,
int n2 ) const

Access block (n1, n2) of a two-index block Green's function (const overload).

Access block (n1, n2) of a two-index block Green's function.

Parameters
n1First block index.
n2Second block index.
Returns
The block at (n1, n2).

Definition at line 157 of file _block_gf_view_common.hpp.

◆ operator[]() [1/2]

template<typename Arg>
requires (nda::clef::is_clef_expression<Arg>)
auto operator[] ( Arg && arg) const &

Make a lazy CLEF subscript expression (const lvalue overload).

Lvalue overload of the lazy CLEF subscript (see the const lvalue overload).

Template Parameters
ArgType of the lazy CLEF argument.
Parameters
argLazy CLEF argument.
Returns
A lazy subscript expression.

Definition at line 238 of file _block_gf_view_common.hpp.

◆ operator[]() [2/2]

decltype(auto) operator[] ( int n) const

Access the n-th block of a one-index block Green's function (const overload).

Access the n-th block of a one-index block Green's function.

Parameters
nBlock index.
Returns
The n-th block.

Definition at line 212 of file _block_gf_view_common.hpp.

◆ size()

int size ( ) const

Get the total number of blocks.

Returns
The number of blocks (the product of both dimensions for a block2_gf).

Definition at line 108 of file _block_gf_view_common.hpp.

◆ size1()

int size1 ( ) const

Get the number of blocks along the first index (block2_gf only).

Returns
The number of blocks along the first index.

Definition at line 88 of file _block_gf_view_common.hpp.

◆ size2()

int size2 ( ) const

Get the number of blocks along the second index (block2_gf only).

Returns
The number of blocks along the second index.

Definition at line 98 of file _block_gf_view_common.hpp.