TRIQS/TRIQS 4.0.0
Researching Interacting Quantum Systems
Loading...
Searching...
No Matches
block_gf.hpp
#include "./gf_struct.hpp"
#include "../gf/gf.hpp"
#include "../gf/targets.hpp"
#include "../../utility/concept_tools.hpp"
#include "../../utility/exceptions.hpp"
#include "../../utility/factory.hpp"
#include "../../utility/macros.hpp"
#include <itertools/itertools.hpp>
#include <mpi/mpi.hpp>
#include <string>
#include <type_traits>
#include <utility>
#include <vector>
#include "./_block_gf_view_common.hpp"

Detailed Description

Provides the block Green's function container.

Definition in file block_gf.hpp.

Go to the source code of this file.

Classes

class  triqs::gfs::block_gf< Mesh, Target, Layout, Arity >
 The owning block Green's function container. More...
class  triqs::gfs::block_gf< Mesh, Target, Layout, Arity >::iterator_impl< is_const >
 Forward iterator over the blocks of a block Green's function. More...

Concepts

concept  triqs::gfs::BlockGf
 Concept checking that a type is a block Green's function.

Typedefs

template<typename Mesh, typename Target = matrix_valued, typename Layout = nda::C_layout>
using triqs::gfs::block2_gf = block_gf<Mesh, Target, Layout, 2>
 Owning two-index block Green's function (a matrix of blocks).
template<typename Mesh, typename Target = matrix_valued, typename Layout = nda::C_stride_layout>
using triqs::gfs::block2_gf_const_view = block_gf_view<Mesh, Target, Layout, 2, true>
 Const view of a two-index block Green's function.
template<typename G>
using triqs::gfs::block2_gf_const_view_of = block2_gf_const_view<get_mesh_t<G>, get_target_t<G>>
 The triqs::gfs::block2_gf_const_view type matching the mesh and target of G.
template<typename G>
using triqs::gfs::block2_gf_of = block2_gf<get_mesh_t<G>, get_target_t<G>>
 The triqs::gfs::block2_gf type matching the mesh and target of G.
template<typename Mesh, typename Target = matrix_valued, typename Layout = nda::C_stride_layout>
using triqs::gfs::block2_gf_view = block_gf_view<Mesh, Target, Layout, 2, false>
 Mutable view of a two-index block Green's function.
template<typename G>
using triqs::gfs::block2_gf_view_of = block2_gf_view<get_mesh_t<G>, get_target_t<G>>
 The triqs::gfs::block2_gf_view type matching the mesh and target of G.
template<typename Mesh, typename Target = matrix_valued, typename Layout = nda::C_stride_layout, int Arity = 1>
using triqs::gfs::block_gf_const_view = block_gf_view<Mesh, Target, Layout, Arity, true>
 Const view alias for a block Green's function.
template<typename G>
using triqs::gfs::block_gf_const_view_of = block_gf_const_view<get_mesh_t<G>, get_target_t<G>>
 The triqs::gfs::block_gf_const_view type matching the mesh and target of G.
template<typename G>
using triqs::gfs::block_gf_of = block_gf<get_mesh_t<G>, get_target_t<G>>
 The triqs::gfs::block_gf type matching the mesh and target of G.
template<typename G>
using triqs::gfs::block_gf_view_of = block_gf_view<get_mesh_t<G>, get_target_t<G>>
 The triqs::gfs::block_gf_view type matching the mesh and target of G.
template<typename G>
using triqs::gfs::get_mesh_t = typename std::decay_t<G>::mesh_t
 The mesh type of a block Green's function type G.
template<typename G>
using triqs::gfs::get_target_t = typename std::decay_t<G>::target_t
 The target type of a block Green's function type G.

Functions

template<typename T, typename... U>
triqs::gfs::factory (U &&...x)
 Generic factory to construct an object of a given type from an arbitrary parameter pack of arguments.
template<int N = 0, typename BG>
requires is_block_gf_v<BG>
auto const & triqs::gfs::get_mesh (BG const &bg)
 Get the mesh of a block Green's function, or its N-th component for a product mesh.
template<BlockGf BG>
void triqs::gfs::mpi_broadcast (BG &&bg, mpi::communicator c, int root)
 Implementation of an MPI broadcast for triqs::gfs::block_gf and triqs::gfs::block_gf_view types.
template<BlockGf BG1, BlockGf BG2>
void triqs::gfs::mpi_reduce_into (BG1 const &bg_in, BG2 &&bg_out, mpi::communicator c, int root, bool all, MPI_Op op)
 Implementation of an MPI reduce for triqs::gfs::block_gf and triqs::gfs::block_gf_view types that reduces directly into an existing block GF object.

Variables

template<typename, typename = std::void_t<>>
constexpr int triqs::gfs::arity_of = -1
 Block arity of a type: T::arity if present, -1 otherwise.
template<typename G, int n = 0>
constexpr bool triqs::gfs::is_block_gf_v = false
 Trait to check whether a type is a block Green's function.

Function Documentation

◆ factory()

template<typename T, typename... U>
T triqs::utility::factory ( U &&... x)

Generic factory to construct an object of a given type from an arbitrary parameter pack of arguments.

The actual construction is delegated to the helper class detail::factories<T>, whose static invoke member is called with the forwarded arguments. By default detail::factories<T> simply forwards its single argument to a constructor of T, so any type that is directly constructible from the given argumnets works out of the box.

To support custom construction logic for a type T (e.g. element-wise conversion, allocation, or building from a different representation), provide a partial or full specialization of detail::factories<T> exposing one or more static invoke overloads that return a T. The library already specializes it for std::vector<T> to allow constructing a vector from another vector with element-wise conversion.

Template Parameters
TTarget type.
UArgument types.
Parameters
xConstructor arguments.
Returns
A newly constructed T instance.

Definition at line 95 of file factory.hpp.