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

write deltaN only to vasp h5 if present, write to GAMMA text file only for old interface

This commit is contained in:
Alexander Hampel 2024-07-10 14:18:19 -04:00 committed by the-hampel
parent 26b355ea40
commit 692bc85c9e

View File

@ -2353,6 +2353,13 @@ class SumkDFT(object):
assert self.SP == 0, "Spin-polarized density matrix is not implemented"
if mpi.is_master_node():
if os.path.isfile('vasptriqs.h5'):
with HDFArchive('vasptriqs.h5', 'a') as vasp_h5:
if 'triqs' not in vasp_h5:
vasp_h5.create_group('triqs')
vasp_h5['triqs']['band_window'] = band_window
vasp_h5['triqs']['deltaN'] = deltaN
else:
with open(filename, 'w') as f:
f.write(" %i -1 ! Number of k-points, default number of bands\n" % len(kpts_to_write))
for index, ik in enumerate(kpts_to_write):
@ -2371,12 +2378,6 @@ class SumkDFT(object):
f.write(" %.14f %.14f" % (valre, valim))
f.write("\n")
if os.path.isfile('vasptriqs.h5'):
with HDFArchive('vasptriqs.h5', 'a') as vasp_h5:
if 'triqs' not in vasp_h5:
vasp_h5.create_group('triqs')
vasp_h5['triqs']['band_window'] = band_window
vasp_h5['triqs']['deltaN'] = deltaN
elif dm_type == 'elk':