triqs.operators.util.extractors.dict_to_matrix

triqs.operators.util.extractors.dict_to_matrix()

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

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.

ddict

The 2/4-index dictionary.

gf_structdict

The structure of the Green’s function, {block_index : [inner indices]}.

arrarray

The resulting NumPy array.

Signature : (dict4_t<real_or_complex> d, gf_struct_t gf_struct) -> real_or_complex_array<4>

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.

ddict

The 2/4-index dictionary.

gf_structdict

The structure of the Green’s function, {block_index : [inner indices]}.

arrarray

The resulting NumPy array.