From c8806ddda880c2f112bb115ea761e62e7f415cd9 Mon Sep 17 00:00:00 2001 From: hschnait Date: Tue, 8 Mar 2022 18:49:12 +0100 Subject: [PATCH] Updatye SumkDFT_Tools to new gf_struct --- python/triqs_dft_tools/sumk_dft_tools.py | 34 ++++++++++++------------ 1 file changed, 17 insertions(+), 17 deletions(-) diff --git a/python/triqs_dft_tools/sumk_dft_tools.py b/python/triqs_dft_tools/sumk_dft_tools.py index acf9e1c3..ff159a9d 100644 --- a/python/triqs_dft_tools/sumk_dft_tools.py +++ b/python/triqs_dft_tools/sumk_dft_tools.py @@ -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): @@ -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_) @@ -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): @@ -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))) @@ -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() @@ -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]: