Skip to content

Commit d67d70d

Browse files
committed
fix read error for tetrahedron data and eigs properties
1 parent 27a2586 commit d67d70d

File tree

2 files changed

+7
-13
lines changed

2 files changed

+7
-13
lines changed

python/triqs_dft_tools/converters/plovasp/elstruct.py

+6-12
Original file line numberDiff line numberDiff line change
@@ -90,17 +90,11 @@ def __init__(self, vasp_data):
9090

9191
# FIXME: Reading from EIGENVAL is obsolete and should be
9292
# removed completely.
93-
# if not vasp_data.eigenval.eigs is None:
94-
if False:
93+
if vasp_data.eigenval.eigs is not None:
9594
print("eigvals from EIGENVAL")
9695
self.eigvals = vasp_data.eigenval.eigs
9796
self.ferw = vasp_data.eigenval.ferw.transpose((2, 0, 1))
98-
99-
nk_eig = vasp_data.eigenval.nktot
100-
assert nk_eig == self.nktot, "PLOCAR is inconsistent with EIGENVAL (number of k-points)"
101-
102-
# Check that the number of band is the same in PROJCAR and EIGENVAL
103-
assert nb_plo == self.nband, "PLOCAR is inconsistent with EIGENVAL (number of bands)"
97+
self.efermi = vasp_data.doscar.efermi
10498
else:
10599
print("eigvals from LOCPROJ")
106100
self.eigvals = vasp_data.plocar.eigs
@@ -151,7 +145,7 @@ def debug_density_matrix(self):
151145

152146
# Spin factor
153147
sp_fac = 2.0 if ns == 1 and self.nc_flag == False else 1.0
154-
148+
155149
if self.nc_flag == False:
156150
den_mat = np.zeros((ns, nproj, nproj), dtype=float)
157151
overlap = np.zeros((ns, nproj, nproj), dtype=float)
@@ -184,9 +178,9 @@ def debug_density_matrix(self):
184178
out += " "
185179
out += ''.join(map("{0:12.7f}".format, dov))
186180
print(out)
187-
188-
189-
181+
182+
183+
190184
else:
191185
print("!! WARNING !! Non Collinear Routine")
192186
den_mat = np.zeros((ns, nproj, nproj), dtype=float)

python/triqs_dft_tools/converters/plovasp/vaspio.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -723,7 +723,7 @@ def __init__(self, h5path):
723723
self.ntet = kpoints['num_tetrahedra']
724724
self.vtet = kpoints['volume_weight_tetrahedra']
725725
self.itet = kpoints['coordinate_id_tetrahedra']
726-
except StopIteration as ValueError:
726+
except KeyError:
727727
print(" No tetrahedron data found in vasptriqs.h5. Skipping...")
728728
self.ntet = 0
729729

0 commit comments

Comments
 (0)