TRIQS/triqs_modest 3.3.0
Modular Electronic Structure Toolkit
Loading...
Searching...
No Matches
triqs::modest::embedding

#include <triqs_modest/embedding.hpp>

Detailed Description

The embedding class.

The embedding class encodes the mapping between impurities and the correlated space \( \mathcal{C} \) (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)
 Construct an embedding object.
 
template<typename Mesh >
std::vector< std::pair< block_gf< Mesh, matrix_valued >, block_matrix_t > > make_zero_imp_self_energies (Mesh const &mesh)
 Zero initialize impurity self-energies.
 
Accessors
imp_block_t operator[] (long alpha, long sigma) const
 Bracket accessor: \( \psi[\alpha,\sigma] \).
 
nda::array< imp_block_t, 2 > get_psi () const
 The mapping table \( \psi \).
 
long n_alpha () const
 Number of blocks in \( \alpha \) for the \( \Sigma_{\text{embed}} \).
 
long n_sigma () const
 Number of blocks in \( \sigma \) for the \( \Sigma_{\text{embed}} \).
 
long n_gamma (long imp_idx) const
 Number of blocks in \( \gamma \) for the \( \Sigma_{\text{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 \( \Sigma_{\text{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 \( \psi \).
 
embedding replace (long imp_idx_to_remove, long imp_idx_to_replace_with) const
 Replaces one impurity in the embedding table \( \psi \).
 
embedding flip_spin (long alpha) const
 Flip the spins ( \( \sigma \)) for block \( \alpha \).
 
embedding flip_spin (std::vector< long > alphas) const
 Flip the spins ( \( \sigma \)) for all \( [\alpha] \).
 
embedding split (long imp_idx, std::function< bool(long)> p) const
 Split impurity imp_idx.
 
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 (TRIQS/ModEST).
 
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 (TRIQS/ModEST).
 
block2_matrix_t embed (std::vector< block_matrix_t > const &Sigma_imp_static_vec) const
 Embed block matrices (TRIQS/ModEST).
 
template<typename Mesh >
std::vector< block_gf< Mesh, matrix_valued > > extract (block2_gf< Mesh, matrix_valued > const &g_loc) const
 Extract single-particle quantities (TRIQS/ModEST).
 
std::vector< block_matrix_textract (block2_matrix_t const &matrix_C) const
 Extract matrices (TRIQS/ModEST).
 
CoQui Ops

Embedding methods which operate on a given object X where X ∈ (nda::array<dcomplex, 4>, nda::array<dcomplex, 5>, etc.) These methods are used to extract and embed quantities in the CoQui format.

std::vector< nda::array< dcomplex, 3 > > embed_1p (std::vector< std::vector< nda::array< dcomplex, 3 > > > const &Sigma_imp_vec) const
 Embed single-particle quantities (CoQui).
 
nda::array< dcomplex, 5 > embed_2p (std::vector< nda::array< dcomplex, 5 > > const &pi_imp_vec) const
 Embed two-particle quantities (CoQui).
 
nda::array< dcomplex, 4 > embed_tensor (std::vector< nda::array< dcomplex, 4 > > const &U_tensor_vec) const
 Embed tensors (CoQui).
 
std::vector< std::vector< nda::array< dcomplex, 3 > > > extract_1p (nda::array< dcomplex, 4 > const &g_loc) const
 Extract single-particle quantities (CoQui).
 
std::vector< nda::array< dcomplex, 5 > > extract_2p (nda::array< dcomplex, 5 > const &Pi_loc) const
 Extract two-particle quantities (CoQui).
 
std::vector< nda::array< dcomplex, 4 > > extract_tensor (nda::array< dcomplex, 4 > const &U_tensor) const
 Extract tensors (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)
 

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 
)

Construct an embedding object.

Parameters
sigma_embed_decompositionDecomposition (list of block sizes) for \( \Sigma_{\text{embed}} \): \([ \alpha ] = \) block size. Note that the decompositions are given for \( \alpha \), \( \gamma \) index, and are independent of \( \sigma \).
imp_decompositionsList of decomposition of solvers: [n_imp][ \( \gamma \)] = block size.
psiThe mapping \( \psi[\alpha,\sigma]\) -> n_imp, \( \gamma \), \( \tau \).
sigma_namesNames for the values of the \( \sigma \) index (e.g., "up", "down").

Definition at line 18 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 132 of file embedding.cpp.

◆ drop()

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

Remove an impurity from the embedding table \( \psi \).

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

Parameters
imp_idxIndex of the impurity to remove from the table \( \psi \).
Returns
New embedding with the updated \( \psi \) map.

Definition at line 235 of file embedding.cpp.

◆ embed() [1/3]

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

Embed single-particle quantities (TRIQS/ModEST).

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

  • \( \Sigma_{\text{embed}}^{ασ} = \Sigma_{\text{imp}}^{ψ(α,σ)} \),
  • \( \psi(\alpha,\sigma) \to \) (n_imp, \( \gamma \), \( \tau \)).
Parameters
Sigma_imp_vecA list of impurity self-energies.
Returns
\( \Sigma_{\text{embed}}[\alpha, \sigma] \) in \( \mathcal{C} \) space using the embed decomposition.

Definition at line 265 of file embedding.hpp.

◆ embed() [2/3]

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
inline

Embed single-particle quantities (TRIQS/ModEST).

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 \( \mathcal{C} \) space as a pair (dynamic, static).

Definition at line 292 of file embedding.hpp.

◆ embed() [3/3]

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

Embed block matrices (TRIQS/ModEST).

Definition at line 307 of file embedding.cpp.

◆ embed_1p()

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

Embed single-particle quantities (CoQui).

Definition at line 407 of file embedding.cpp.

◆ embed_2p()

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

Embed two-particle quantities (CoQui).

Definition at line 450 of file embedding.cpp.

◆ embed_tensor()

nda::array< dcomplex, 4 > triqs::modest::embedding::embed_tensor ( std::vector< nda::array< dcomplex, 4 > > const &  U_tensor_vec) const

Embed tensors (CoQui).

Definition at line 363 of file embedding.cpp.

◆ extract() [1/2]

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

Extract single-particle quantities (TRIQS/ModEST).

Template Parameters
MeshThe mesh type triqs::mesh::{dlr_imfreq, imfreq}.
Parameters
g_locBlock2Gf of gloc in \( M \times M \) space.
Returns
Local impurity Green's function.

Definition at line 312 of file embedding.hpp.

◆ extract() [2/2]

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

Extract matrices (TRIQS/ModEST).

Definition at line 322 of file embedding.cpp.

◆ extract_1p()

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

Extract single-particle quantities (CoQui).

Definition at line 383 of file embedding.cpp.

◆ extract_2p()

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

Extract two-particle quantities (CoQui).

Definition at line 434 of file embedding.cpp.

◆ extract_tensor()

std::vector< nda::array< dcomplex, 4 > > triqs::modest::embedding::extract_tensor ( nda::array< dcomplex, 4 > const &  U_tensor) const

Extract tensors (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 ( \( \sigma \)) for block \( \alpha \).

For block \( \alpha \) transforms \( (\sigma,\sigma') \to (\tau, \tau') \) to \( (\sigma, \sigma') \to (\tau', \tau)\).

Parameters
alphaThe index of the alpha block to flip the spins.
Returns
New embedding with the updated \( \psi \) map.

Definition at line 218 of file embedding.cpp.

◆ flip_spin() [2/2]

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

Flip the spins ( \( \sigma \)) for all \( [\alpha] \).

For block \( \alpha \) transforms \( (\sigma,\sigma') \to (\tau, \tau') \) to \( (\sigma, \sigma') \to (\tau', \tau)\).

Parameters
alphasA list of alpha blocks to flip the spins.
Returns
New embedding with the updated \( \psi \) map.

Definition at line 227 of file embedding.cpp.

◆ get_psi()

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

The mapping table \( \psi \).

Definition at line 111 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 206 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 129 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

Zero initialize impurity self-energies.

Definition at line 223 of file embedding.hpp.

◆ n_alpha()

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

Number of blocks in \( \alpha \) for the \( \Sigma_{\text{embed}} \).

Definition at line 114 of file embedding.hpp.

◆ n_gamma()

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

Number of blocks in \( \gamma \) for the \( \Sigma_{\text{imp}} \) [imp_idx].

Definition at line 120 of file embedding.hpp.

◆ n_impurities()

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

Number of impurities.

Definition at line 123 of file embedding.hpp.

◆ n_sigma()

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

Number of blocks in \( \sigma \) for the \( \Sigma_{\text{embed}} \).

Definition at line 117 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: \( \psi[\alpha,\sigma] \).

Returns
The corresponding impurity block (n_imp, \( \gamma \), \( \tau \)).

Definition at line 107 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 \( \psi \).

Replaces the impurity solver corresponding to imp_idx_to_remove with the impurity solver at imp_idx_to_replace_with and updates the underlying table \( \psi \).

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_remove.
Returns
A new embedding with the updated \( \psi \) map.

Definition at line 249 of file embedding.cpp.

◆ sigma_embed_block_shape()

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

Gf block structure for \( \Sigma_{\text{embed}} \).

Definition at line 198 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 126 of file embedding.hpp.

◆ split() [1/3]

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

Split impurity imp_idx.

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

Definition at line 263 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 \( \psi \) map.

Definition at line 298 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

Definition at line 191 of file embedding.cpp.


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