From 031ba1ea403dcb9f537e8d850dbfa796a31c7518 Mon Sep 17 00:00:00 2001 From: Harry LaBollita <40074811+harrisonlabollita@users.noreply.github.com> Date: Tue, 25 Oct 2022 09:27:36 -0400 Subject: [PATCH] Fixes issue with projected A(k,w) (#225) * projected Akw fixed * assert statement on ishell for PR #225 Co-authored-by: Harrison LaBollita --- python/triqs_dft_tools/sumk_dft_tools.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/python/triqs_dft_tools/sumk_dft_tools.py b/python/triqs_dft_tools/sumk_dft_tools.py index 9cf955f2..5527902b 100644 --- a/python/triqs_dft_tools/sumk_dft_tools.py +++ b/python/triqs_dft_tools/sumk_dft_tools.py @@ -831,7 +831,7 @@ class SumkDFTTools(SumkDFT): subgrp=self.bands_data, things_to_read=things_to_read) if not value_read: return value_read - if ishell: + if ishell is not None: things_to_read = ['rot_mat_all', 'rot_mat_all_time_inv'] value_read = self.read_input_from_hdf( subgrp=self.parproj_data, things_to_read=things_to_read) @@ -860,6 +860,7 @@ class SumkDFTTools(SumkDFT): [self.shells[ishell]['dim'], self.n_k, n_om], numpy.float_) for sp in spn} if ishell is not None: + assert isinstance(ishell, int) and ishell in range(len(self.shells)), "ishell must be of type integer and consistent with number of shells." gf_struct_parproj = [ (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[0].mesh)) @@ -897,7 +898,7 @@ class SumkDFTTools(SumkDFT): for ish in range(self.shells[ishell]['dim']): for sp in spn: - Akw[sp][ish, ik] = -gf.data[numpy.where((mesh > om_minplot)&(mesh < om_maxplot))].imag.trace(axis1=1, axis2=2)/numpy.pi + Akw[sp][ish, ik] = -G_loc[sp].data[numpy.where((mesh > om_minplot)&(mesh < om_maxplot)),ish,ish].imag/numpy.pi # Collect data from mpi for sp in spn: Akw[sp] = mpi.all_reduce(mpi.world, Akw[sp], lambda x, y: x + y)