TRIQS/triqs_modest 3.3.0
Brillouin zone summation
Loading...
Searching...
No Matches
triqs::modest::embedding

#include <triqs_modest/embedding.hpp>

Detailed Description

The embedding class.

The embeddding class encodes the mapping between impurities and the correlated space 𝓒 (cf. ModEST implementation notes). In particular, it maps the individual "blocks" within an impurity self-energy to a block and spin of the embedded self-energy function, which can then be upfolded (downfolded) to obtain the lattice self-energy and the local Green's function.

Definition at line 29 of file embedding.hpp.

Public Member Functions

 embedding (std::vector< long > sigma_embed_decomposition, std::vector< std::vector< long > > imp_decompositions, nda::array< imp_block_t, 2 > psi, std::vector< std::string > sigma_names)
 Default constructor.
 
template<typename Mesh >
std::vector< std::pair< block_gf< Mesh, matrix_valued >, block_matrix_t > > make_zero_imp_self_energies (Mesh const &mesh)
 
Accessors
imp_block_t operator[] (long alpha, long sigma) const
 bracket accessor: [α, σ] -> the corresponding impurity block (n_imp, γ, τ)
 
nda::array< imp_block_t, 2 > get_psi () const
 the mapping table ψ
 
long n_alpha () const
 Number of blocks in α for the Σ_embed.
 
long n_sigma () const
 Number of blocks in σ for the Σ_embed.
 
long n_gamma (long imp_idx) const
 Number of blocks in γ for the Σ_imp[imp_idx].
 
long n_impurities () const
 Number of impurities.
 
std::vector< std::string > sigma_names () const
 The names of the sigma indices.
 
std::vector< long > imp_decomposition (long imp_idx) const
 The impurity decomposition.
 
C2PY_IGNORE gf_struct2_t sigma_embed_block_shape () const
 Gf block structure for Σ_embed.
 
std::vector< gf_struct_t > imp_block_shape () const
 Gf block structure for the impurity solvers.
 
std::string description (bool verbosity=false) const
 Summarize the embedding object.
 
Unary Ops

Embedding methods which operate on itself and return a new Embedding object.

bool operator== (embedding const &other) const =default
 
embedding drop (long imp_idx) const
 Remove an impurity from the embedding table ψ
 
embedding replace (long imp_idx_to_remove, long imp_idx_to_replace_with) const
 Replaces one impurity in the embedding table ψ.
 
embedding flip_spin (long alpha) const
 Flip the spins (σ) for block α.

 
embedding flip_spin (std::vector< long > alphas) const
 Flip the spins (σ) for all [α].
 
embedding split (long imp_idx, std::function< bool(long)> p) const
 Predicate p (long block_idx) -> 0 or 1.
 
embedding split (long imp_idx, std::vector< long > const &block_list) const
 Split impurity imp_idx based on block_list.
 
embedding split (long imp_idx, std::initializer_list< const char * > x)=delete
 
Complex Ops

Embedding methods which operate on a given object X where X ∈ (block2gf, block_gf, block_matrix, etc.)

template<typename Mesh >
block2_gf< Mesh, matrix_valued > embed (std::vector< block_gf< Mesh, matrix_valued > > const &Sigma_imp_vec) const
 embed single-particle quantities
 
template<typename Mesh >
std::pair< block2_gf< Mesh, matrix_valued >, block2_matrix_tembed (std::vector< block_gf< Mesh, matrix_valued > > const &Sigma_imp_vec, std::vector< block_matrix_t > const &Sigma_imp_static_vec) const
 embed single-particle quantities
 
block2_matrix_t embed (std::vector< block_matrix_t > const &Sigma_imp_static_vec) const
 embed block matrices
 
nda::array< nda::array< dcomplex, 3 >, 2 > embed (std::vector< std::vector< nda::array< dcomplex, 3 > > > const &Sigma_imp_vec) const
 embed single-particle quantities (coqui)
 
std::vector< nda::array< dcomplex, 5 > > embed (std::vector< nda::array< dcomplex, 5 > > const &pi_imp_vec) const
 embed two-particle quantities (coqui)
 
template<typename Mesh >
std::vector< block_gf< Mesh, matrix_valued > > extract (block2_gf< Mesh, matrix_valued > const &g_loc) const
 embed tensors
 
std::vector< block_matrix_textract (block2_matrix_t const &matrix_C) const
 extract matrices
 
std::vector< std::vector< nda::array< dcomplex, 3 > > > extract (nda::array< dcomplex, 4 > const &g_loc) const
 extract single-particle quantities (CoQui)
 
std::vector< nda::array< dcomplex, 5 > > extract (nda::array< dcomplex, 5 > const &Pi_loc) const
 extract two-particle quantities (CoQui)
 

Friends

void h5_read (h5::group g, std::string const &name, embedding &x)
 
void h5_write (h5::group g, std::string const &name, embedding const &x)
 h5 read/write
 
std::ostream & operator<< (std::ostream &out, embedding const &E)
 stream
 

Constructor & Destructor Documentation

◆ embedding()

triqs::modest::embedding::embedding ( std::vector< long >  sigma_embed_decomposition,
std::vector< std::vector< long > >  imp_decompositions,
nda::array< imp_block_t, 2 >  psi,
std::vector< std::string >  sigma_names 
)

Default constructor.

Constructor

Parameters
sigma_embed_decompositionDecomposition (list of block sizes) for Σ_embed: [α] = block size
Note
The decompositions are given for α, γ index, and are independent of σ
Parameters
imp_decompositionsList of decomposition of solvers: [n_imp][γ] = block size
psiThe mapping ψ[α,σ] -> n_imp, γ, τ
sigma_namesNames for the values of the σ index (e.g., "up", "down")

Definition at line 16 of file embedding.cpp.

Member Function Documentation

◆ description()

std::string triqs::modest::embedding::description ( bool  verbosity = false) const

Summarize the embedding object.

Definition at line 98 of file embedding.cpp.

◆ drop()

embedding triqs::modest::embedding::drop ( long  imp_idx) const

Remove an impurity from the embedding table ψ

Remove the impurity imp_idx, maps the corresponding α blocks to -1 (i.e. no longer connected to an impurity) and relabel the other impurities with number > imp_idx.

Parameters
imp_idxIndex of the impurity to remove from the table ψ
Returns
New embedding with the updated ψ map.

Definition at line 200 of file embedding.cpp.

◆ embed() [1/5]

template<typename Mesh >
block2_gf< Mesh, matrix_valued > triqs::modest::embedding::embed ( std::vector< block_gf< Mesh, matrix_valued > > const &  Sigma_imp_vec) const

embed single-particle quantities

Embed impurity solver self-energies into an embedded self-energy.

\Sigma_{embed}^{ασ} = \Sigma_{imp}^{ψ(α,σ)} ψ(α,σ) -> (n_imp, γ, τ)

Parameters
Sigma_imp_veca list of impurity self-energies
Returns
Σ_embed[alpha, sigma] in C space using the embed decomposition

Definition at line 315 of file embedding.hpp.

◆ embed() [2/5]

template<typename Mesh >
std::pair< block2_gf< Mesh, matrix_valued >, block2_matrix_t > triqs::modest::embedding::embed ( std::vector< block_gf< Mesh, matrix_valued > > const &  Sigma_imp_vec,
std::vector< block_matrix_t > const &  Sigma_imp_static_vec 
) const

embed single-particle quantities

Embed the impurity self-energy decomposed as a list of dynamic and a list of static parts.

Template Parameters
MeshThe type of mesh
Parameters
Sigma_imp_vecA list of dynamic impurity self-energies
Sigma_imp_static_vecA list of static impurity self-energies
Returns
The self-energy in the C space as a pair (dynamic, static).

Definition at line 340 of file embedding.hpp.

◆ embed() [3/5]

block2_matrix_t triqs::modest::embedding::embed ( std::vector< block_matrix_t > const &  Sigma_imp_static_vec) const

embed block matrices

Definition at line 272 of file embedding.cpp.

◆ embed() [4/5]

std::vector< nda::array< dcomplex, 5 > > triqs::modest::embedding::embed ( std::vector< nda::array< dcomplex, 5 > > const &  pi_imp_vec) const

embed two-particle quantities (coqui)

Definition at line 362 of file embedding.cpp.

◆ embed() [5/5]

nda::array< nda::array< dcomplex, 3 >, 2 > triqs::modest::embedding::embed ( std::vector< std::vector< nda::array< dcomplex, 3 > > > const &  Sigma_imp_vec) const

embed single-particle quantities (coqui)

Definition at line 335 of file embedding.cpp.

◆ extract() [1/4]

template<typename Mesh >
std::vector< block_gf< Mesh, matrix_valued > > triqs::modest::embedding::extract ( block2_gf< Mesh, matrix_valued > const &  g) const

embed tensors

Extract the impurity Green's function.

extract single-particle quantities (ModEST)

Template Parameters
MeshThe mesh type triqs::mesh::{dlr_imfreq, imfreq}
Parameters
gBlock2Gf of gloc in MxM space
Returns
local impurity Green's function

Definition at line 357 of file embedding.hpp.

◆ extract() [2/4]

std::vector< block_matrix_t > triqs::modest::embedding::extract ( block2_matrix_t const &  matrix_C) const

extract matrices

Definition at line 286 of file embedding.cpp.

◆ extract() [3/4]

std::vector< std::vector< nda::array< dcomplex, 3 > > > triqs::modest::embedding::extract ( nda::array< dcomplex, 4 > const &  g_loc) const

extract single-particle quantities (CoQui)

Definition at line 311 of file embedding.cpp.

◆ extract() [4/4]

std::vector< nda::array< dcomplex, 5 > > triqs::modest::embedding::extract ( nda::array< dcomplex, 5 > const &  Pi_loc) const

extract two-particle quantities (CoQui)

Definition at line 346 of file embedding.cpp.

◆ flip_spin() [1/2]

embedding triqs::modest::embedding::flip_spin ( long  alpha) const

Flip the spins (σ) for block α.

For block α transforms (σ,σ') -> (τ, τ') to (σ, σ') -> (τ', τ).

Parameters
alphathe index of the alpha block to flip the spins.
Returns
a new embedding with the updated ψ map.

Definition at line 184 of file embedding.cpp.

◆ flip_spin() [2/2]

embedding triqs::modest::embedding::flip_spin ( std::vector< long >  alphas) const

Flip the spins (σ) for all [α].

For block α transforms (σ,σ') -> (τ, τ') to (σ, σ') -> (τ', τ).

Parameters
alphasa list of alpha blocks to flip the spins.
Returns
New embedding with the updated ψ map.

Definition at line 192 of file embedding.cpp.

◆ get_psi()

nda::array< imp_block_t, 2 > triqs::modest::embedding::get_psi ( ) const
inline

the mapping table ψ

Definition at line 103 of file embedding.hpp.

◆ imp_block_shape()

std::vector< gf_struct_t > triqs::modest::embedding::imp_block_shape ( ) const

Gf block structure for the impurity solvers.

Definition at line 172 of file embedding.cpp.

◆ imp_decomposition()

std::vector< long > triqs::modest::embedding::imp_decomposition ( long  imp_idx) const
inline

The impurity decomposition.

Definition at line 121 of file embedding.hpp.

◆ make_zero_imp_self_energies()

template<typename Mesh >
std::vector< std::pair< block_gf< Mesh, matrix_valued >, block_matrix_t > > triqs::modest::embedding::make_zero_imp_self_energies ( Mesh const &  mesh)
inline

Definition at line 206 of file embedding.hpp.

◆ n_alpha()

long triqs::modest::embedding::n_alpha ( ) const
inline

Number of blocks in α for the Σ_embed.

Definition at line 106 of file embedding.hpp.

◆ n_gamma()

long triqs::modest::embedding::n_gamma ( long  imp_idx) const
inline

Number of blocks in γ for the Σ_imp[imp_idx].

Definition at line 112 of file embedding.hpp.

◆ n_impurities()

long triqs::modest::embedding::n_impurities ( ) const
inline

Number of impurities.

Definition at line 115 of file embedding.hpp.

◆ n_sigma()

long triqs::modest::embedding::n_sigma ( ) const
inline

Number of blocks in σ for the Σ_embed.

Definition at line 109 of file embedding.hpp.

◆ operator==()

bool triqs::modest::embedding::operator== ( embedding const &  other) const
default

◆ operator[]()

imp_block_t triqs::modest::embedding::operator[] ( long  alpha,
long  sigma 
) const
inline

bracket accessor: [α, σ] -> the corresponding impurity block (n_imp, γ, τ)

Definition at line 99 of file embedding.hpp.

◆ replace()

embedding triqs::modest::embedding::replace ( long  imp_idx_to_remove,
long  imp_idx_to_replace_with 
) const

Replaces one impurity in the embedding table ψ.

Replaces the impurity solver corresponding to imp_idx_to with the impurity solver at imp_idx_from and updates the underlying table ψ.

Parameters
imp_idx_to_removethe index of the impurity solver to be replaced.
imp_idx_to_replace_withthe index of the impurity solver that will replace imp_idx_to.
Returns
a new embedding with the updated ψ map.

Definition at line 214 of file embedding.cpp.

◆ sigma_embed_block_shape()

gf_struct2_t triqs::modest::embedding::sigma_embed_block_shape ( ) const

Gf block structure for Σ_embed.

Definition at line 164 of file embedding.cpp.

◆ sigma_names()

std::vector< std::string > triqs::modest::embedding::sigma_names ( ) const
inline

The names of the sigma indices.

Definition at line 118 of file embedding.hpp.

◆ split() [1/3]

embedding triqs::modest::embedding::split ( long  imp_idx,
std::function< bool(long)>  p 
) const

Predicate p (long block_idx) -> 0 or 1.

Definition at line 228 of file embedding.cpp.

◆ split() [2/3]

embedding triqs::modest::embedding::split ( long  imp_idx,
std::initializer_list< const char * >  x 
)
delete

◆ split() [3/3]

embedding triqs::modest::embedding::split ( long  imp_idx,
std::vector< long > const &  block_list 
) const

Split impurity imp_idx based on block_list.

For impurity imp_idx, split part of its blocks into a new impurity. The blocks that were split off remain mapped to their original alpha blocks with the updated imp_idx.

Parameters
imp_idxImpurity number
block_listA list of blocks of imp_idx to split off.
Returns
New embedding with the updated ψ map.

Definition at line 263 of file embedding.cpp.

Friends And Related Symbol Documentation

◆ h5_read

void h5_read ( h5::group  g,
std::string const &  name,
embedding x 
)
friend

Definition at line 96 of file h5.cpp.

◆ h5_write

void h5_write ( h5::group  g,
std::string const &  name,
embedding const &  x 
)
friend

h5 read/write

Definition at line 104 of file h5.cpp.

◆ operator<<

std::ostream & operator<< ( std::ostream &  out,
embedding const &  E 
)
friend

stream

Definition at line 157 of file embedding.cpp.


The documentation for this class was generated from the following files: