Skip to content

Commit

Permalink
Updatye SumkDFT_Tools to new gf_struct
Browse files Browse the repository at this point in the history
  • Loading branch information
hschnait committed Mar 8, 2022
1 parent 660807f commit c8806dd
Showing 1 changed file with 17 additions and 17 deletions.
34 changes: 17 additions & 17 deletions python/triqs_dft_tools/sumk_dft_tools.py
Original file line number Diff line number Diff line change
Expand Up @@ -97,8 +97,8 @@ def dos_wannier_basis(self, mu=None, broadening=None, mesh=None, with_Sigma=True
G_loc = []
for icrsh in range(self.n_corr_shells):
spn = self.spin_block_names[self.corr_shells[icrsh]['SO']]
glist = [GfReFreq(indices=inner, window=(om_min, om_max), n_points=n_om)
for block, inner in self.gf_struct_sumk[icrsh]]
glist = [GfReFreq(target_shape=(block_dim, block_dim), window=(om_min, om_max), n_points=n_om)
for block, block_dim in self.gf_struct_sumk[icrsh]]
G_loc.append(
BlockGf(name_list=spn, block_list=glist, make_copies=False))
for icrsh in range(self.n_corr_shells):
Expand Down Expand Up @@ -236,8 +236,8 @@ def dos_wannier_basis_all(self, mu=None, broadening=None, mesh=None, with_Sigma=
n_local_orbs = self.proj_mat_csc.shape[2]
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)
for block, inner in gf_struct_parproj_all[0]]
glist_all = [GfReFreq(target_shape=(block_dim, block_dim), window=(om_min, om_max), n_points=n_om)
for block, block_dim in gf_struct_parproj_all[0]]
G_loc_all = BlockGf(name_list=spn, block_list=glist_all, make_copies=False)

DOS = {sp: numpy.zeros([n_om], numpy.float_)
Expand Down Expand Up @@ -364,11 +364,11 @@ def dos_parproj_basis(self, mu=None, broadening=None, mesh=None, with_Sigma=True

G_loc = []
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):
glist = [GfReFreq(indices=inner, window=(om_min, om_max), n_points=n_om)
for block, inner in gf_struct_parproj[ish]]
glist = [GfReFreq(target_shape=(block_dim, block_dim), window=(om_min, om_max), n_points=n_om)
for block, block_dim in gf_struct_parproj[ish]]
G_loc.append(
BlockGf(name_list=spn, block_list=glist, make_copies=False))
for ish in range(self.n_shells):
Expand Down Expand Up @@ -873,9 +873,9 @@ def spaghettis(self, broadening=None, plot_shift=0.0, plot_range=None, ishell=No

if not ishell is None:
gf_struct_parproj = [
(sp, list(range(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))
for block, inner in gf_struct_parproj], make_copies=False)
(sp, self.shells[ishell]['dim']) for sp in spn]
G_loc = BlockGf(name_block_generator=[(block, GfReFreq(target_shape=(block_dim, block_dim), mesh=self.Sigma_imp_w[0].mesh))
for block, block_dim in gf_struct_parproj], make_copies=False)
G_loc.zero()

ikarray = numpy.array(list(range(self.n_k)))
Expand Down Expand Up @@ -993,16 +993,16 @@ def partial_charges(self, beta=40, mu=None, with_Sigma=True, with_dc=True):
for ish in range(self.n_shells)]
for isp in range(len(spn))]
# 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)]
if with_Sigma:
G_loc = [BlockGf(name_block_generator=[(block, GfImFreq(indices=inner, mesh=self.Sigma_imp_iw[0].mesh))
for block, inner in gf_struct_parproj[ish]], make_copies=False)
G_loc = [BlockGf(name_block_generator=[(block, GfImFreq(target_shape=(block_dim, block_dim), mesh=self.Sigma_imp_iw[0].mesh))
for block, block_dim in gf_struct_parproj[ish]], make_copies=False)
for ish in range(self.n_shells)]
beta = self.Sigma_imp_iw[0].mesh.beta
else:
G_loc = [BlockGf(name_block_generator=[(block, GfImFreq(indices=inner, beta=beta))
for block, inner in gf_struct_parproj[ish]], make_copies=False)
G_loc = [BlockGf(name_block_generator=[(block, GfImFreq(target_shape=(block_dim, block_dim), beta=beta))
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):
G_loc[ish].zero()
Expand Down Expand Up @@ -1227,8 +1227,8 @@ def transport_distribution(self, beta, directions=['xx'], energy_window=None, Om
for icrsh in range(self.n_corr_shells):
Sigma_save = self.Sigma_imp_w[icrsh].copy()
spn = self.spin_block_names[self.corr_shells[icrsh]['SO']]
glist = lambda: [GfReFreq(indices=inner, window=(self.omega[
0], self.omega[-1]), n_points=n_om) for block, inner in self.gf_struct_sumk[icrsh]]
glist = lambda: [GfReFreq(target_shape=(block_dim, block_dim), window=(self.omega[
0], self.omega[-1]), n_points=n_om) for block, block_dim in self.gf_struct_sumk[icrsh]]
self.Sigma_imp_w[icrsh] = BlockGf(
name_list=spn, block_list=glist(), make_copies=False)
for i, g in self.Sigma_imp_w[icrsh]:
Expand Down

0 comments on commit c8806dd

Please sign in to comment.