TRIQS/TRIQS 4.0.0
Researching Interacting Quantum Systems
Loading...
Searching...
No Matches
triqs::gfs::bgf_expr< Tag, L, R >

#include <triqs/gfs/block/expr.hpp>

Detailed Description

template<typename Tag, typename L, typename R>
struct triqs::gfs::bgf_expr< Tag, L, R >

Lazy expression node representing a binary operation between two block Green's function operands.

Models the BlockGreenFunction concept, so expressions can be nested and assigned to a triqs::gfs::block_gf. The mesh and target are deduced from the operands and the operation is evaluated lazily, block by block, on access.

Template Parameters
TagOperation tag (+, -, *, /).
LType of the left operand (a block Green's function or a wrapped scalar).
RType of the right operand (a block Green's function or a wrapped scalar).

Definition at line 106 of file expr.hpp.

Public Types

using L_t = std::decay_t<L>
 Decayed type of the left operand.
using mesh_t = typename details_bgfs_expr::same_or_void<typename L_t::mesh_t, typename R_t::mesh_t>::type
 Mesh type of the expression, deduced from the two operands.
using R_t = std::decay_t<R>
 Decayed type of the right operand.
using target_t = typename details_bgfs_expr::same_or_void<typename L_t::target_t, typename R_t::target_t>::type
 Target type of the expression, deduced from the two operands.

Public Member Functions

template<typename LL, typename RR>
 bgf_expr (LL &&l_, RR &&r_)
 Construct from the two operands.
auto block_names () const
 Get the block names of the expression.
template<typename... Args>
decltype(auto) operator() (Args &&...1) const
 Evaluate the expression via call at the given arguments.
template<typename... Keys>
decltype(auto) operator[] (Keys &&...keys) const
 Evaluate the expression via subscript at the given keys.
auto size () const
 Get the number of blocks of the expression.
auto size1 () const
 Get the number of blocks along the first dimension (for a block2 expression).
auto size2 () const
 Get the number of blocks along the second dimension (for a block2 expression).

Public Attributes

l
 Left operand.
r
 Right operand.

Static Public Attributes

static constexpr int arity = std::max(arity_of<L_t>, arity_of<R_t>)
 Block arity of the expression (1 for triqs::gfs::block_gf, 2 for triqs::gfs::block2_gf).

Friends

std::ostream & operator<< (std::ostream &sout, bgf_expr const &expr)
 Stream output of the expression.

Constructor & Destructor Documentation

◆ bgf_expr()

template<typename Tag, typename L, typename R>
template<typename LL, typename RR>
triqs::gfs::bgf_expr< Tag, L, R >::bgf_expr ( LL && l_,
RR && r_ )
inline

Construct from the two operands.

Template Parameters
LLForwarding type of the left operand.
RRForwarding type of the right operand.
Parameters
l_Left operand.
r_Right operand.

Definition at line 141 of file expr.hpp.

Member Function Documentation

◆ block_names()

template<typename Tag, typename L, typename R>
auto triqs::gfs::bgf_expr< Tag, L, R >::block_names ( ) const
inline

Get the block names of the expression.

Returns
The block names taken from the block Green's function operand.

Definition at line 165 of file expr.hpp.

◆ operator()()

template<typename Tag, typename L, typename R>
template<typename... Args>
decltype(auto) triqs::gfs::bgf_expr< Tag, L, R >::operator() ( Args &&... 1) const
inline

Evaluate the expression via call at the given arguments.

Template Parameters
ArgsTypes of the evaluation arguments.
Returns
The result of applying the operation to the operands' evaluated values.

Definition at line 189 of file expr.hpp.

◆ operator[]()

template<typename Tag, typename L, typename R>
template<typename... Keys>
decltype(auto) triqs::gfs::bgf_expr< Tag, L, R >::operator[] ( Keys &&... keys) const
inline

Evaluate the expression via subscript at the given keys.

Template Parameters
KeysTypes of the access keys.
Parameters
keysBlock indices.
Returns
The result of applying the operation to the operands' subscripted values.

Definition at line 179 of file expr.hpp.

◆ size()

template<typename Tag, typename L, typename R>
auto triqs::gfs::bgf_expr< Tag, L, R >::size ( ) const
inline

Get the number of blocks of the expression.

Returns
The larger block count of the two operands.

Definition at line 147 of file expr.hpp.

◆ size1()

template<typename Tag, typename L, typename R>
auto triqs::gfs::bgf_expr< Tag, L, R >::size1 ( ) const
inline

Get the number of blocks along the first dimension (for a block2 expression).

Returns
The larger first-dimension block count of the two operands.

Definition at line 153 of file expr.hpp.

◆ size2()

template<typename Tag, typename L, typename R>
auto triqs::gfs::bgf_expr< Tag, L, R >::size2 ( ) const
inline

Get the number of blocks along the second dimension (for a block2 expression).

Returns
The larger second-dimension block count of the two operands.

Definition at line 159 of file expr.hpp.


The documentation for this struct was generated from the following file: