mirror of
https://github.com/triqs/dft_tools
synced 2024-09-12 05:38:31 +02:00
Add adapt_deg_shells method and call it in map_gf_struct
This commit is contained in:
parent
f695ccac7a
commit
bd228de768
@ -437,6 +437,19 @@ class BlockStructure(object):
|
|||||||
else:
|
else:
|
||||||
self.sumk_to_solver[ish][k] = (None, None)
|
self.sumk_to_solver[ish][k] = (None, None)
|
||||||
# adapt deg_shells
|
# adapt deg_shells
|
||||||
|
|
||||||
|
self.adapt_deg_shells(gf_struct, ish)
|
||||||
|
|
||||||
|
|
||||||
|
# reindexing gf_struct so that it starts with 0
|
||||||
|
for k in gf_struct:
|
||||||
|
gf_struct[k] = range(len(gf_struct[k]))
|
||||||
|
self.gf_struct_solver[ish] = gf_struct
|
||||||
|
|
||||||
|
def adapt_deg_shells(gf_struct, ish=0):
|
||||||
|
""" Adapts the deg_shells to a new gf_struct
|
||||||
|
Internally called when using pick_gf_struct and map_gf_struct
|
||||||
|
"""
|
||||||
if self.deg_shells is not None:
|
if self.deg_shells is not None:
|
||||||
for degsh in self.deg_shells[ish]:
|
for degsh in self.deg_shells[ish]:
|
||||||
if isinstance(degsh, dict):
|
if isinstance(degsh, dict):
|
||||||
@ -456,10 +469,6 @@ class BlockStructure(object):
|
|||||||
if not key in gf_struct:
|
if not key in gf_struct:
|
||||||
warn('Removing shells from degenerate shell {}.')
|
warn('Removing shells from degenerate shell {}.')
|
||||||
degsh.remove(key)
|
degsh.remove(key)
|
||||||
# reindexing gf_struct so that it starts with 0
|
|
||||||
for k in gf_struct:
|
|
||||||
gf_struct[k] = range(len(gf_struct[k]))
|
|
||||||
self.gf_struct_solver[ish] = gf_struct
|
|
||||||
|
|
||||||
def pick_gf_struct_sumk(self, new_gf_struct):
|
def pick_gf_struct_sumk(self, new_gf_struct):
|
||||||
""" Pick selected orbitals within blocks.
|
""" Pick selected orbitals within blocks.
|
||||||
@ -588,6 +597,9 @@ class BlockStructure(object):
|
|||||||
for k in self.sumk_to_solver[ish].keys():
|
for k in self.sumk_to_solver[ish].keys():
|
||||||
if not k in su2so:
|
if not k in su2so:
|
||||||
su2so[k] = (None, None)
|
su2so[k] = (None, None)
|
||||||
|
|
||||||
|
adapt_deg_shells(gf_struct, ish)
|
||||||
|
|
||||||
self.gf_struct_solver[ish] = gf_struct
|
self.gf_struct_solver[ish] = gf_struct
|
||||||
self.solver_to_sumk[ish] = so2su
|
self.solver_to_sumk[ish] = so2su
|
||||||
self.sumk_to_solver[ish] = su2so
|
self.sumk_to_solver[ish] = su2so
|
||||||
|
Loading…
Reference in New Issue
Block a user