3
0
mirror of https://github.com/triqs/dft_tools synced 2024-10-31 11:13:46 +01:00

fix read error for tetrahedron data and eigs properties

This commit is contained in:
Alexander Hampel 2024-07-10 13:57:09 -04:00 committed by the-hampel
parent 6f47a72c4b
commit 26b355ea40
2 changed files with 7 additions and 13 deletions

View File

@ -90,17 +90,11 @@ class ElectronicStructure:
# FIXME: Reading from EIGENVAL is obsolete and should be # FIXME: Reading from EIGENVAL is obsolete and should be
# removed completely. # removed completely.
# if not vasp_data.eigenval.eigs is None: if vasp_data.eigenval.eigs is not None:
if False:
print("eigvals from EIGENVAL") print("eigvals from EIGENVAL")
self.eigvals = vasp_data.eigenval.eigs self.eigvals = vasp_data.eigenval.eigs
self.ferw = vasp_data.eigenval.ferw.transpose((2, 0, 1)) self.ferw = vasp_data.eigenval.ferw.transpose((2, 0, 1))
self.efermi = vasp_data.doscar.efermi
nk_eig = vasp_data.eigenval.nktot
assert nk_eig == self.nktot, "PLOCAR is inconsistent with EIGENVAL (number of k-points)"
# Check that the number of band is the same in PROJCAR and EIGENVAL
assert nb_plo == self.nband, "PLOCAR is inconsistent with EIGENVAL (number of bands)"
else: else:
print("eigvals from LOCPROJ") print("eigvals from LOCPROJ")
self.eigvals = vasp_data.plocar.eigs self.eigvals = vasp_data.plocar.eigs
@ -151,7 +145,7 @@ class ElectronicStructure:
# Spin factor # Spin factor
sp_fac = 2.0 if ns == 1 and self.nc_flag == False else 1.0 sp_fac = 2.0 if ns == 1 and self.nc_flag == False else 1.0
if self.nc_flag == False: if self.nc_flag == False:
den_mat = np.zeros((ns, nproj, nproj), dtype=float) den_mat = np.zeros((ns, nproj, nproj), dtype=float)
overlap = np.zeros((ns, nproj, nproj), dtype=float) overlap = np.zeros((ns, nproj, nproj), dtype=float)
@ -184,9 +178,9 @@ class ElectronicStructure:
out += " " out += " "
out += ''.join(map("{0:12.7f}".format, dov)) out += ''.join(map("{0:12.7f}".format, dov))
print(out) print(out)
else: else:
print("!! WARNING !! Non Collinear Routine") print("!! WARNING !! Non Collinear Routine")
den_mat = np.zeros((ns, nproj, nproj), dtype=float) den_mat = np.zeros((ns, nproj, nproj), dtype=float)

View File

@ -723,7 +723,7 @@ class h5Kpoints:
self.ntet = kpoints['num_tetrahedra'] self.ntet = kpoints['num_tetrahedra']
self.vtet = kpoints['volume_weight_tetrahedra'] self.vtet = kpoints['volume_weight_tetrahedra']
self.itet = kpoints['coordinate_id_tetrahedra'] self.itet = kpoints['coordinate_id_tetrahedra']
except StopIteration as ValueError: except KeyError:
print(" No tetrahedron data found in vasptriqs.h5. Skipping...") print(" No tetrahedron data found in vasptriqs.h5. Skipping...")
self.ntet = 0 self.ntet = 0