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

fix bugs and tests

This commit is contained in:
Jonathan Karp 2021-08-30 15:58:30 -04:00 committed by Alexander Hampel
parent 6df75d8c39
commit 1e7c66805f
4 changed files with 6 additions and 7 deletions

View File

@ -516,7 +516,7 @@ class SumkDFT(object):
mu = self.chemical_potential mu = self.chemical_potential
ntoi = self.spin_names_to_ind[self.SO] ntoi = self.spin_names_to_ind[self.SO]
spn = self.spin_block_names[self.SO] spn = self.spin_block_names[self.SO]
if self.Sigma_imp is None: if not hasattr(self, "Sigma_imp"):
with_Sigma = False with_Sigma = False
if broadening is None: if broadening is None:
if mesh is None: if mesh is None:
@ -652,7 +652,7 @@ class SumkDFT(object):
self.calculate_min_max_band_energies() self.calculate_min_max_band_energies()
mesh = numpy.array([i for i in self.mesh.values()]) mesh = numpy.array([i for i in self.mesh.values()])
if mesh[0] > (self.min_band_energy - self.chemical_potential) or mesh[-1] < (self.max_band_energy - self.chemical_potential): if mesh[0] > (self.min_band_energy - self.chemical_potential) or mesh[-1] < (self.max_band_energy - self.chemical_potential):
warn('The given Sigma is on a mesh which does not cover the band energy range. The Sigma MeshReFreq runs from %f to %f, while the band energy (minus the chemical potential) runs from %f to %f'%(Sigma_mesh[0], Sigma_mesh[-1], self.min_band_energy, self.max_band_energy)) warn('The given Sigma is on a mesh which does not cover the band energy range. The Sigma MeshReFreq runs from %f to %f, while the band energy (minus the chemical potential) runs from %f to %f'%(mesh[0], mesh[-1], self.min_band_energy, self.max_band_energy))
def transform_to_sumk_blocks(self, Sigma_imp, Sigma_out=None): def transform_to_sumk_blocks(self, Sigma_imp, Sigma_out=None):
r""" transform Sigma from solver to sumk space r""" transform Sigma from solver to sumk space

View File

@ -40,7 +40,7 @@ for name, s in Sigma_hdf:
np.savetxt('Sigma_' + name + '.dat', mesh_a_data) np.savetxt('Sigma_' + name + '.dat', mesh_a_data)
# Read self energy from txt files # Read self energy from txt files
SK = SumkDFTTools(hdf_file = 'SrVO3.ref.h5', use_dft_blocks = True) SK = SumkDFTTools(hdf_file='SrVO3.ref.h5', mesh=Sigma_hdf.mesh, use_dft_blocks=True)
# the order in the orig SrVO3 file is not assured, hence order it here # the order in the orig SrVO3 file is not assured, hence order it here
a_list = sorted([a for a,al in SK.gf_struct_solver[0].items()]) a_list = sorted([a for a,al in SK.gf_struct_solver[0].items()])

View File

@ -32,10 +32,9 @@ Converter = Wien2kConverter(filename='SrVO3', repacking=True)
Converter.convert_dft_input() Converter.convert_dft_input()
Converter.convert_transport_input() Converter.convert_transport_input()
SK = SumkDFTTools(hdf_file='SrVO3.ref.h5', use_dft_blocks=True)
with HDFArchive('SrVO3_Sigma.h5', 'a') as ar: with HDFArchive('SrVO3_Sigma.h5', 'a') as ar:
Sigma = ar['dmft_transp_input']['Sigma_w'] Sigma = ar['dmft_transp_input']['Sigma_w']
SK = SumkDFTTools(hdf_file='SrVO3.ref.h5', mesh=Sigma.mesh, use_dft_blocks=True)
SK.set_Sigma([Sigma]) SK.set_Sigma([Sigma])
SK.chemical_potential = ar['dmft_transp_input']['chemical_potential'] SK.chemical_potential = ar['dmft_transp_input']['chemical_potential']
SK.dc_imp = ar['dmft_transp_input']['dc_imp'] SK.dc_imp = ar['dmft_transp_input']['dc_imp']

View File

@ -28,8 +28,8 @@ from triqs.utility.h5diff import h5diff
SK = SumkDFTTools(hdf_file = 'SrVO3.ref.h5') SK = SumkDFTTools(hdf_file = 'SrVO3.ref.h5')
dm = SK.density_matrix(method = 'using_gf', beta = 40) dm = SK.density_matrix(method = 'using_gf')
dm_pc = SK.partial_charges(beta=40,with_Sigma=False,with_dc=False) dm_pc = SK.partial_charges(with_Sigma=False, with_dc=False)
with HDFArchive('sumkdft_basic.out.h5','w') as ar: with HDFArchive('sumkdft_basic.out.h5','w') as ar:
ar['dm'] = dm ar['dm'] = dm