triqs.operators.util.extractors.dict_to_matrix

triqs.operators.util.extractors.dict_to_matrix()

Signature : (dict2_t<real_or_complex> d, gf_struct_t gf_struct) -> real_or_complex_array<2>

Convert a 2/4-index dictionary to a 2/4-dimensional NumPy array given the structure of the Green’s function. The elements missing from the dictionary are assumed to be zero.

Parameters:
  • d (dict) – The 2/4-index dictionary.

  • gf_struct (dict) – The structure of the Green’s function, {block_index : [inner indices]}.

Returns:

arr – The resulting NumPy array.

Return type:

array