triqs_dft_tools.block_structure.BlockStructure.convert_matrix

BlockStructure.convert_matrix(G, G_struct=None, ish_from=0, ish_to=None, show_warnings=True, G_out=None, space_from='solver', space_to='solver')[source]

Convert matrix from its structure to this structure.

Warning

Elements that are zero in the new structure due to the new block structure will be just ignored, thus approximated to zero.

Parameters:
Gdict of numpy array

the matrix that should be converted

G_structBlockStructure or str

the structure of that G or None (then, this structure is used)

ish_fromint

shell index of the input structure

ish_toint

shell index of the output structure; if None (the default), it is the same as ish_from

show_warningsbool or float

whether to show warnings when elements of the Green’s function get thrown away if float, set the threshold for the magnitude of an element about to be thrown away to trigger a warning (default: 1.e-10)

G_outdict of numpy array

the output numpy array (if not given, a new one is created)

space_from‘solver’ or ‘sumk’

whether the matrix G corresponds to the solver or sumk structure of G_struct

space_to‘solver’ or ‘sumk’

whether the output matrix should be according to the solver of sumk structure of this structure

**kwargs

options passed to the constructor for the new Gf