TRIQS/TRIQS 4.0.0
Researching Interacting Quantum Systems
Loading...
Searching...
No Matches
extractors.hpp
#include "../many_body_operator.hpp"
#include "../../arrays.hpp"
#include "../../hilbert_space/fundamental_operator_set.hpp"
#include "../../utility/first_include.hpp"
#include <complex>
#include <map>
#include <string>
#include <tuple>
#include <variant>

Detailed Description

Provides utilities to extract coefficients (matrices and tensors) from many-body operators.

Definition in file extractors.hpp.

Go to the source code of this file.

Typedefs

template<typename T>
using triqs::operators::utils::block_matrix_t = array<nda::matrix<T>, 1>
 Type of a block matrix.
template<typename T>
using triqs::operators::utils::dict2_t = std::map<std::tuple<indices_t, indices_t>, T>
 Map from an index pair \( (\alpha_i, \alpha_j) \) to a coefficient of type T.
template<typename T>
using triqs::operators::utils::dict4_t = std::map<std::tuple<indices_t, indices_t, indices_t, indices_t>, T>
 Map from an index quadruple \( (\alpha_i, \alpha_j, \alpha_k, \alpha_l) \) to a coefficient of type T.
template<typename T>
using triqs::operators::utils::op_t = operators::many_body_operator_generic<T>
 Alias for triqs::operators::many_body_operator_generic.
template<int N>
using triqs::operators::utils::real_or_complex_array = std::variant<array<double, N>, array<std::complex<double>, N>>
 Variant of a rank-N array that can hold either real or complex values.

Functions

template<typename T>
block_matrix_t< T > triqs::operators::utils::block_matrix_from_op (op_t< T > const &h, hilbert_space::gf_struct_t const &gf_struct, bool ignore_irrelevant=false)
 Convert a block-diagonal quadratic operator into its block-matrix representation.
template<typename T = double, typename D, std::size_t R = std::tuple_size_v<typename D::key_type>>
array< T, R > triqs::operators::utils::dict_to_matrix (D const &dict, hilbert_space::fundamental_operator_set const &fs)
 Convert a coefficient dictionary into a dense rank-N array indexed by integers from a fundamental operator set.
template<typename D, std::size_t R = std::tuple_size_v<typename D::key_type>>
real_or_complex_array< R > triqs::operators::utils::dict_to_variant_matrix (D const &dict, hilbert_space::fundamental_operator_set const &fs)
 Convert a real or complex valued coefficient dictionary into a real_or_complex_array.
template<typename T>
dict2_t< T > triqs::operators::utils::extract_h_dict (op_t< T > const &h, bool ignore_irrelevant=false)
 Extract the coefficients of a normal-ordered quadratic operator.
template<typename T>
dict2_t< T > triqs::operators::utils::extract_U_dict2 (op_t< T > const &h, bool ignore_irrelevant=false)
 Extract the coefficients of a density-density interaction operator.
template<typename T>
dict4_t< T > triqs::operators::utils::extract_U_dict4 (op_t< T > const &h, bool ignore_irrelevant=false)
 Extract the coefficients of a general two-particle interaction operator.
template<typename T>
op_t< T > triqs::operators::utils::filter_op (op_t< T > const &h, long len)
 Keep only terms of a given length of a many-body operator \( \hat{h} \).
template<typename T>
op_t< T > triqs::operators::utils::op_from_block_matrix (block_matrix_t< T > const &bl_mat, hilbert_space::gf_struct_t const &gf_struct)
 Build a block-diagonal quadratic operator from its block-matrix representation.
template<typename T>
op_t< T > triqs::operators::utils::quadratic_terms (op_t< T > const &h)
 Keep only quadratic terms of a many-body operator \( \hat{h} \).
template<typename T>
op_t< T > triqs::operators::utils::quartic_terms (op_t< T > const &h)
 Keep only quartic terms of a many-body operator \( \hat{h} \).