3
0
mirror of https://github.com/triqs/dft_tools synced 2024-12-23 12:55:17 +01:00

Update wannier90_converter.py

Can specify DFT Fermi energy in the inp file and it's subtracted from the r = 0 term when reading the hr file.
This commit is contained in:
jkarp314 2020-05-28 15:53:41 -04:00 committed by Jonathan Karp
parent a94f8ed942
commit 4cc530a129

View File

@ -142,6 +142,10 @@ class Wannier90Converter(ConverterTools):
# l, dim, SO flag, irep): # l, dim, SO flag, irep):
corr_shells = [{name: int(val) for name, val in zip( corr_shells = [{name: int(val) for name, val in zip(
corr_shell_entries, R)} for icrsh in range(n_corr_shells)] corr_shell_entries, R)} for icrsh in range(n_corr_shells)]
try:
fermi_energy = R.next()
except:
fermi_energy = 0.
except StopIteration: # a more explicit error if the file is corrupted. except StopIteration: # a more explicit error if the file is corrupted.
mpi.report(self._name + ": reading input file %s failed!" % mpi.report(self._name + ": reading input file %s failed!" %
self.inp_file) self.inp_file)
@ -443,6 +447,9 @@ class Wannier90Converter(ConverterTools):
"Inconsistent indices for R vector n. %s" % ir) "Inconsistent indices for R vector n. %s" % ir)
# fill h_of_r with the matrix elements of the Hamiltonian # fill h_of_r with the matrix elements of the Hamiltonian
if not numpy.any(rcurr) and ii == jj:
h_of_r[ir][ii, jj] = complex(float(cline[5]) - fermi_energy, float(cline[6]))
else:
h_of_r[ir][ii, jj] = complex(float(cline[5]), float(cline[6])) h_of_r[ir][ii, jj] = complex(float(cline[5]), float(cline[6]))
except ValueError: except ValueError: