2022-11-10 17:11:28 +01:00
|
|
|
import os
|
|
|
|
from h5 import *
|
|
|
|
from triqs.utility.comparison_tests import *
|
|
|
|
from triqs.utility.h5diff import h5diff
|
|
|
|
import triqs.utility.mpi as mpi
|
|
|
|
|
|
|
|
from triqs_dft_tools.converters import ElkConverter
|
2023-04-15 00:43:23 +02:00
|
|
|
from triqs_dft_tools.sumk_dft_tools import *
|
2022-11-10 17:11:28 +01:00
|
|
|
#get current working directory path
|
|
|
|
cwd = format(os.getcwd())
|
|
|
|
#location of test directory
|
|
|
|
testdir = cwd+'/elk_bandcharacter_convert'
|
|
|
|
#change to test directory
|
|
|
|
os.chdir(testdir)
|
|
|
|
|
|
|
|
Converter = ElkConverter(filename='SrVO3', repacking=True)
|
|
|
|
Converter.hdf_file = 'elk_bc_convert.out.h5'
|
|
|
|
Converter.convert_dft_input()
|
|
|
|
Converter.dft_band_characters()
|
|
|
|
|
2023-04-17 12:05:27 +02:00
|
|
|
SK = SumkDFTTools(hdf_file='elk_bc_convert.out.h5', use_dft_blocks=True)
|
|
|
|
SK.occupations(with_Sigma=False, with_dc=False)
|
2023-04-15 00:43:23 +02:00
|
|
|
|
|
|
|
omin = -1.0
|
|
|
|
omax = 1.0
|
|
|
|
oN = 3
|
|
|
|
mesh = MeshReFreq(omin,omax,oN)
|
|
|
|
dos_elk = SK.density_of_states(broadening=0.01, mesh=mesh, with_Sigma=False, with_dc=False, proj_type='elk', save_to_file=False)
|
2023-04-17 12:05:27 +02:00
|
|
|
dos_occ_elk = SK.density_of_states(broadening=0.01, mesh=mesh, with_Sigma=False, with_dc=False, proj_type='elk', dosocc=True, save_to_file=False)
|
2023-04-15 00:43:23 +02:00
|
|
|
|
|
|
|
if mpi.is_master_node():
|
|
|
|
|
|
|
|
#with HDFArchive('elk_bc_convert.ref.h5', 'a') as ar:
|
|
|
|
# ar['dos_elk'] = dos_elk
|
|
|
|
# ar['dos_occ_elk'] = dos_occ_elk
|
|
|
|
# ar['dos_mesh'] = [omin,omax,oN]
|
|
|
|
with HDFArchive('elk_bc_convert.out.h5', 'a') as ar:
|
|
|
|
ar['dos_elk'] = dos_elk
|
2023-04-17 12:05:27 +02:00
|
|
|
ar['dos_occ_elk'] = dos_occ_elk
|
2023-04-15 00:43:23 +02:00
|
|
|
ar['dos_mesh'] = [omin,omax,oN]
|
|
|
|
|
2022-11-10 17:11:28 +01:00
|
|
|
if mpi.is_master_node():
|
|
|
|
h5diff('elk_bc_convert.out.h5','elk_bc_convert.ref.h5')
|
|
|
|
|
|
|
|
#return to cwd
|
|
|
|
os.chdir(cwd)
|