3
0
mirror of https://github.com/triqs/dft_tools synced 2024-12-23 04:43:42 +01:00

Updatye SumkDFT_Tools to new gf_struct

This commit is contained in:
hschnait 2022-03-08 18:49:12 +01:00
parent 660807fe25
commit c8806ddda8

View File

@ -97,8 +97,8 @@ class SumkDFTTools(SumkDFT):
G_loc = [] G_loc = []
for icrsh in range(self.n_corr_shells): for icrsh in range(self.n_corr_shells):
spn = self.spin_block_names[self.corr_shells[icrsh]['SO']] spn = self.spin_block_names[self.corr_shells[icrsh]['SO']]
glist = [GfReFreq(indices=inner, window=(om_min, om_max), n_points=n_om) glist = [GfReFreq(target_shape=(block_dim, block_dim), window=(om_min, om_max), n_points=n_om)
for block, inner in self.gf_struct_sumk[icrsh]] for block, block_dim in self.gf_struct_sumk[icrsh]]
G_loc.append( G_loc.append(
BlockGf(name_list=spn, block_list=glist, make_copies=False)) BlockGf(name_list=spn, block_list=glist, make_copies=False))
for icrsh in range(self.n_corr_shells): for icrsh in range(self.n_corr_shells):
@ -236,8 +236,8 @@ class SumkDFTTools(SumkDFT):
n_local_orbs = self.proj_mat_csc.shape[2] n_local_orbs = self.proj_mat_csc.shape[2]
gf_struct_parproj_all = [[(sp, list(range(n_local_orbs))) for sp in spn]] gf_struct_parproj_all = [[(sp, list(range(n_local_orbs))) for sp in spn]]
glist_all = [GfReFreq(indices=inner, window=(om_min, om_max), n_points=n_om) glist_all = [GfReFreq(target_shape=(block_dim, block_dim), window=(om_min, om_max), n_points=n_om)
for block, inner in gf_struct_parproj_all[0]] for block, block_dim in gf_struct_parproj_all[0]]
G_loc_all = BlockGf(name_list=spn, block_list=glist_all, make_copies=False) G_loc_all = BlockGf(name_list=spn, block_list=glist_all, make_copies=False)
DOS = {sp: numpy.zeros([n_om], numpy.float_) DOS = {sp: numpy.zeros([n_om], numpy.float_)
@ -364,11 +364,11 @@ class SumkDFTTools(SumkDFT):
G_loc = [] G_loc = []
spn = self.spin_block_names[self.SO] spn = self.spin_block_names[self.SO]
gf_struct_parproj = [[(sp, list(range(self.shells[ish]['dim']))) for sp in spn] gf_struct_parproj = [[(sp, self.shells[ish]['dim']) for sp in spn]
for ish in range(self.n_shells)] for ish in range(self.n_shells)]
for ish in range(self.n_shells): for ish in range(self.n_shells):
glist = [GfReFreq(indices=inner, window=(om_min, om_max), n_points=n_om) glist = [GfReFreq(target_shape=(block_dim, block_dim), window=(om_min, om_max), n_points=n_om)
for block, inner in gf_struct_parproj[ish]] for block, block_dim in gf_struct_parproj[ish]]
G_loc.append( G_loc.append(
BlockGf(name_list=spn, block_list=glist, make_copies=False)) BlockGf(name_list=spn, block_list=glist, make_copies=False))
for ish in range(self.n_shells): for ish in range(self.n_shells):
@ -873,9 +873,9 @@ class SumkDFTTools(SumkDFT):
if not ishell is None: if not ishell is None:
gf_struct_parproj = [ gf_struct_parproj = [
(sp, list(range(self.shells[ishell]['dim']))) for sp in spn] (sp, self.shells[ishell]['dim']) for sp in spn]
G_loc = BlockGf(name_block_generator=[(block, GfReFreq(indices=inner, mesh=self.Sigma_imp_w[0].mesh)) G_loc = BlockGf(name_block_generator=[(block, GfReFreq(target_shape=(block_dim, block_dim), mesh=self.Sigma_imp_w[0].mesh))
for block, inner in gf_struct_parproj], make_copies=False) for block, block_dim in gf_struct_parproj], make_copies=False)
G_loc.zero() G_loc.zero()
ikarray = numpy.array(list(range(self.n_k))) ikarray = numpy.array(list(range(self.n_k)))
@ -993,16 +993,16 @@ class SumkDFTTools(SumkDFT):
for ish in range(self.n_shells)] for ish in range(self.n_shells)]
for isp in range(len(spn))] for isp in range(len(spn))]
# Set up G_loc # Set up G_loc
gf_struct_parproj = [[(sp, list(range(self.shells[ish]['dim']))) for sp in spn] gf_struct_parproj = [[(sp, self.shells[ish]['dim']) for sp in spn]
for ish in range(self.n_shells)] for ish in range(self.n_shells)]
if with_Sigma: if with_Sigma:
G_loc = [BlockGf(name_block_generator=[(block, GfImFreq(indices=inner, mesh=self.Sigma_imp_iw[0].mesh)) G_loc = [BlockGf(name_block_generator=[(block, GfImFreq(target_shape=(block_dim, block_dim), mesh=self.Sigma_imp_iw[0].mesh))
for block, inner in gf_struct_parproj[ish]], make_copies=False) for block, block_dim in gf_struct_parproj[ish]], make_copies=False)
for ish in range(self.n_shells)] for ish in range(self.n_shells)]
beta = self.Sigma_imp_iw[0].mesh.beta beta = self.Sigma_imp_iw[0].mesh.beta
else: else:
G_loc = [BlockGf(name_block_generator=[(block, GfImFreq(indices=inner, beta=beta)) G_loc = [BlockGf(name_block_generator=[(block, GfImFreq(target_shape=(block_dim, block_dim), beta=beta))
for block, inner in gf_struct_parproj[ish]], make_copies=False) for block, block_dim in gf_struct_parproj[ish]], make_copies=False)
for ish in range(self.n_shells)] for ish in range(self.n_shells)]
for ish in range(self.n_shells): for ish in range(self.n_shells):
G_loc[ish].zero() G_loc[ish].zero()
@ -1227,8 +1227,8 @@ class SumkDFTTools(SumkDFT):
for icrsh in range(self.n_corr_shells): for icrsh in range(self.n_corr_shells):
Sigma_save = self.Sigma_imp_w[icrsh].copy() Sigma_save = self.Sigma_imp_w[icrsh].copy()
spn = self.spin_block_names[self.corr_shells[icrsh]['SO']] spn = self.spin_block_names[self.corr_shells[icrsh]['SO']]
glist = lambda: [GfReFreq(indices=inner, window=(self.omega[ glist = lambda: [GfReFreq(target_shape=(block_dim, block_dim), window=(self.omega[
0], self.omega[-1]), n_points=n_om) for block, inner in self.gf_struct_sumk[icrsh]] 0], self.omega[-1]), n_points=n_om) for block, block_dim in self.gf_struct_sumk[icrsh]]
self.Sigma_imp_w[icrsh] = BlockGf( self.Sigma_imp_w[icrsh] = BlockGf(
name_list=spn, block_list=glist(), make_copies=False) name_list=spn, block_list=glist(), make_copies=False)
for i, g in self.Sigma_imp_w[icrsh]: for i, g in self.Sigma_imp_w[icrsh]: