Skip to content

Commit

Permalink
Bugfix for analyse_block_structure in sumk_dft
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
phibeck committed Feb 18, 2022
1 parent 289265a commit 3cd95dc
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions python/triqs_dft_tools/sumk_dft.py
Original file line number Diff line number Diff line change
Expand Up @@ -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.
"""

Expand All @@ -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))
Expand All @@ -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
Expand Down

0 comments on commit 3cd95dc

Please sign in to comment.