Dear all
Hi
I want plot the density of states of "Sr2RuO4" using DFT+DMFT method by triqs (with version 3.0.0) and WIEN2k codes . After a full charge self consistency , for calculation of real part of Sigma I used maxent method. for this purpose I used below scripts:
`from triqs_maxent import *
from h5 import *
Load self-energy from h5-file
with HDFArchive('Sr2RuO4_b37.h5', 'r') as ar:
S_iw = ar['S_iw']
dc = ar['dc']
Initialize SigmaContinuator, we use the
double counting (dc) as constant shift c.
isc = InversionSigmaContinuator(S_iw, dc)
run TauMaxEnt for each block and collect results
in dict res.
res = {}
for name, gaux_iw in isc.Gaux_iw:
tm = TauMaxEnt()
tm.set_G_iw(gaux_iw)
tm.set_error(1e-4)
tm.omega = HyperbolicOmegaMesh(omega_min=-10, omega_max=10, n_points=500)
tm.alpha_mesh = LogAlphaMesh(alpha_min=1e-2, alpha_max=1e2, n_points=30)
res[name] = tm.run()
save results and the SigmaContinuator to h5-file
with HDFArchive('Sr2RuO4_b37.h5', 'a') as ar:
for key in res:
ar['maxent_result_' + key] = res[key].data
ar['isc'] = isc`
and:
`from triqs_maxent import *
from h5 import *
from triqs.plot.mpl_interface import oplot
load res and SigmaContinuator from h5-file
res = {}
with HDFArchive('Sr2RuO4_b37.h5', 'r') as ar:
S_iw = ar['S_iw']
for key in S_iw.indices:
res[key] = ar['maxent_result_' + key]
isc = ar['isc']
get S_w from the auxilliary spectral function Aaux_w
Aaux_w = {}
w = res['up_0'].omega
for key in res:
Aaux_w[key] = res[key].analyzer_results['LineFitAnalyzer']['A_out']
isc.set_Gaux_w_from_Aaux_w(Aaux_w, w, np_interp_A=10000,
np_omega=4000, w_min=-1.0, w_max=1.0)
save SigmaContinuator again (now it contains S_w)
with HDFArchive('Sr2RuO4_b37.h5', 'a') as ar:
ar['isc'] = isc
check linfit and plot S_w
plt.figure()
plt.subplot(1, 2, 1)
for key in res:
res[key].analyzer_results['LineFitAnalyzer'].plot_linefit()
plt.ylim(1e1, 1e4)
plt.subplot(1, 2, 2)
oplot(isc.S_w['up_0'], mode='I', label='maxent xy', lw=3)
oplot(isc.S_w['up_1'], mode='I', label='maxent xz', lw=3)
plt.ylabel(r'$\Sigma(\omega)$')
plt.xlim(-0.75, 0.75)
plt.ylim(-0.4, 0.0)`
I could run this scripts without any error but when I want use S_W for post processing by the following script:
from triqs_dft_tools.sumk_dft import * with HDFArchive('Sr2RuO4_b37.h5', 'r') as ar: SigmaReFreq = ar['dmft_output']['Sigma_w'] SK.set_Sigma([SigmaReFreq]) chemical_potential, dc_imp, dc_energ = SK.load(['chemical_potential','dc_imp','dc_energ']) SK.set_mu(chemical_potential) SK.set_dc(dc_imp,dc_energ)
I have an error that:
tarting run with 1 MPI rank(s) at : 2020-12-23 01:07:00.014444 Traceback (most recent call last): File "7.py", line 3, in <module> SigmaReFreq = ar['dmft_output']['Sigma_w'] File "/home/reyhan/triqs/triqs/triqs.install/lib/python3.6/site-packages/h5/archive.py", line 205, in __getitem__ return self.__getitem1__(key,self._reconstruct_python_objects) File "/home/reyhan/triqs/triqs/triqs.install/lib/python3.6/site-packages/h5/archive.py", line 211, in __getitem1__ raise KeyError("Key %s does not exist."%key) KeyError: 'Key dmft_output does not exist.'
I check my "case.h5" and see that it has below content:
"['S_iw', 'dc', 'isc', 'maxent_result_down_0', 'maxent_result_down_1', 'maxent_result_down_2', 'maxent_result_up_0', 'maxent_result_up_1', 'maxent_result_up_2']>"
Have you any idea about my problem?
Sincerely yours
Reyhaneh