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

blockstructure: adapt deg_shells in pick

This commit is contained in:
Gernot J. Kraberger 2019-02-07 14:09:18 +01:00 committed by Hermann Schnait
parent 8e4c923d21
commit 1705e5268f

View File

@ -436,6 +436,24 @@ class BlockStructure(object):
self.sumk_to_solver[ish][k] = (blk, new_ind)
else:
self.sumk_to_solver[ish][k] = (None, None)
# adapt deg_shells
if self.deg_shells is not None:
for degsh in self.deg_shells[ish]:
for key in degsh.keys():
if isinstance(degsh, dict):
if not key in gf_struct:
del degsh[key]
continue
if gf_struct[key] != self.gf_struct_solver[ish][key]:
v, C = degsh[key]
degsh[key][0] = \
v[gf_struct[key], :][:, gf_struct[key]]
warn(
'Removing shells from degenerate shell {}. Cannot guarantee that they continue to be equivalent.')
else:
if not key in gf_struct:
degsh.remove(key)
continue
# reindexing gf_struct so that it starts with 0
for k in gf_struct:
gf_struct[k] = range(len(gf_struct[k]))