3
0
mirror of https://github.com/triqs/dft_tools synced 2024-09-16 17:35:31 +02:00

Update map_gf_struct_solver function to new gf_struct convention

This commit is contained in:
hschnait 2022-03-08 17:38:50 +01:00
parent 0a95ffd9d0
commit abf70b6ead

View File

@ -280,13 +280,9 @@ class BlockStructure(object):
# zero out all the lines of the transformation that are # zero out all the lines of the transformation that are
# not included in gf_struct_solver # not included in gf_struct_solver
#TODO CHECK THIS!
for iorb in range(self.gf_struct_sumk_dict[icrsh][block]): for iorb in range(self.gf_struct_sumk_dict[icrsh][block]):
if self.sumk_to_solver[ish][(block, iorb)][0] is None: if self.sumk_to_solver[ish][(block, iorb)][0] is None:
trans[icrsh][block][iorb, :] = 0.0 trans[icrsh][block][iorb, :] = 0.0
# for iorb, norb in enumerate(self.gf_struct_sumk_dict[icrsh][block]):
# if self.sumk_to_solver[ish][(block, norb)][0] is None:
# trans[icrsh][block][iorb, :] = 0.0
return trans return trans
@property @property
@ -560,7 +556,6 @@ class BlockStructure(object):
gfs[icrsh][ind_sol[0]].append(ind_sol[1]) gfs[icrsh][ind_sol[0]].append(ind_sol[1])
self.pick_gf_struct_solver(gfs) self.pick_gf_struct_solver(gfs)
# TODO!
def map_gf_struct_solver(self, mapping): def map_gf_struct_solver(self, mapping):
r""" Map the Green function structure from one struct to another. r""" Map the Green function structure from one struct to another.
@ -612,6 +607,11 @@ class BlockStructure(object):
if not k in su2so: if not k in su2so:
su2so[k] = (None, None) su2so[k] = (None, None)
for new_block in gf_struct:
assert all(np.sort(gf_struct[new_block]) == list(range(len(gf_struct[new_block])))) ,\
"New gf_struct does not have valid 0-based indices!"
gf_struct[new_block] = len(gf_struct[new_block])
self.adapt_deg_shells(gf_struct, ish) self.adapt_deg_shells(gf_struct, ish)
self.gf_struct_solver[ish] = gf_struct self.gf_struct_solver[ish] = gf_struct