From 3cd95dcd0282889dc74bad750e7e9c2dbefe13aa Mon Sep 17 00:00:00 2001 From: phibeck Date: Fri, 18 Feb 2022 16:38:01 -0500 Subject: [PATCH 1/2] Bugfix for analyse_block_structure in sumk_dft This caused inconsistencies between the shapes of Hloc and density_matrix, since they were in the shape of n_corr_shells vs n_inequiv_shells, respectively. --- python/triqs_dft_tools/sumk_dft.py | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/python/triqs_dft_tools/sumk_dft.py b/python/triqs_dft_tools/sumk_dft.py index b08e2227..6b832066 100644 --- a/python/triqs_dft_tools/sumk_dft.py +++ b/python/triqs_dft_tools/sumk_dft.py @@ -853,11 +853,11 @@ def analyse_block_structure(self, threshold=0.00001, include_shells=None, dm=Non If include_shells is not provided all correlated shells will be analysed. dm : list of dict, optional List of density matrices from which block stuctures are to be analysed. - Each density matrix is a dict {block names: 2d numpy arrays}. + Each density matrix is a dict {block names: 2d numpy arrays} for each correlated shell. If not provided, dm will be calculated from the DFT Hamiltonian by a simple-point BZ integration. hloc : list of dict, optional List of local Hamiltonian matrices from which block stuctures are to be analysed - Each Hamiltonian is a dict {block names: 2d numpy arrays}. + Each Hamiltonian is a dict {block names: 2d numpy arrays} for each inequivalent shell. If not provided, it will be calculated using eff_atomic_levels. """ @@ -873,8 +873,6 @@ def analyse_block_structure(self, threshold=0.00001, include_shells=None, dm=Non for ish in range(self.n_inequiv_shells)] if hloc is None: hloc = self.eff_atomic_levels() - H_loc = [hloc[self.corr_to_inequiv[ish]] - for ish in range(self.n_corr_shells)] if include_shells is None: include_shells = list(range(self.n_inequiv_shells)) @@ -884,7 +882,7 @@ def analyse_block_structure(self, threshold=0.00001, include_shells=None, dm=Non n_orb = self.corr_shells[self.inequiv_to_corr[ish]]['dim'] # gives an index list of entries larger that threshold dmbool = (abs(dens_mat[ish][sp]) > threshold) - hlocbool = (abs(H_loc[ish][sp]) > threshold) + hlocbool = (abs(hloc[ish][sp]) > threshold) # Determine off-diagonal entries in upper triangular part of # density matrix From 64dd1cb16730d9e459afbafdf9ffba7240d03f78 Mon Sep 17 00:00:00 2001 From: Hermann Schnait Date: Tue, 1 Mar 2022 09:31:01 +0100 Subject: [PATCH 2/2] Update docstring for extract_G_loc concering n_inequiv_shells and n_corr_shells --- python/triqs_dft_tools/sumk_dft.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/python/triqs_dft_tools/sumk_dft.py b/python/triqs_dft_tools/sumk_dft.py index 6b832066..7f734761 100644 --- a/python/triqs_dft_tools/sumk_dft.py +++ b/python/triqs_dft_tools/sumk_dft.py @@ -729,8 +729,8 @@ def extract_G_loc(self, mu=None, iw_or_w='iw', with_Sigma=True, with_dc=True, br G_loc : list of BlockGf (Green's function) objects List of the local Green's functions for all (inequivalent) correlated shells, rotated into the corresponding local frames. - If ``transform_to_solver_blocks`` is True, it will be one per correlated shell, else one per - inequivalent correlated shell. + If ``transform_to_solver_blocks`` is True, it will be one per inequivalent correlated shell, else one per + correlated shell. """ if mu is None: