changed HDFArchive statments to avoid problems with TRIQS issue #245. Bugfixes for broken reference links.

This commit is contained in:
aichhorn 2015-08-18 11:01:34 +02:00
parent e5fe091cef
commit 3b344f4089
7 changed files with 61 additions and 66 deletions

View File

@ -117,7 +117,7 @@ Momentum resolved spectral function (with self energy)
Another quantity of interest is the momentum-resolved spectral function, which can directly be compared to ARPES
experiments. We assume here that we already converted the output of the :program:`dmftproj` program with the
converter routines (see :ref:`interfacetowien`). The spectral function is calculated by::
converter routines (see :ref:`conversion`). The spectral function is calculated by::
SK.spaghettis(broadening)

View File

@ -220,7 +220,9 @@ of the last iteration::
if previous_present:
if mpi.is_master_node():
S.Sigma_iw << HDFArchive(dft_filename+'.h5','a')['dmft_output']['Sigma_iw']
ar = HDFArchive(dft_filename+'.h5','a')
S.Sigma_iw << ar['dmft_output']['Sigma_iw']
del ar
chemical_potential,dc_imp,dc_energ = SK.load(['chemical_potential','dc_imp','dc_energ'])
S.Sigma_iw << mpi.bcast(S.Sigma_iw)
SK.set_mu(chemical_potential)
@ -261,23 +263,22 @@ refinements::
# Now mix Sigma and G with factor sigma_mix, if wanted:
if (iteration_number>1 or previous_present):
if mpi.is_master_node():
ar = HDFArchive(dft_filename+'.h5','a')['dmft_output']
ar = HDFArchive(dft_filename+'.h5','a')
mpi.report("Mixing Sigma and G with factor %s"%sigma_mix)
S.Sigma_iw << sigma_mix * S.Sigma_iw + (1.0-sigma_mix) * ar['Sigma_iw']
S.G_iw << sigma_mix * S.G_iw + (1.0-sigma_mix) * ar['G_iw']
S.Sigma_iw << sigma_mix * S.Sigma_iw + (1.0-sigma_mix) * ar['dmft_output']['Sigma_iw']
S.G_iw << sigma_mix * S.G_iw + (1.0-sigma_mix) * ar['dmft_output']['G_iw']
del ar
S.G_iw << mpi.bcast(S.G_iw)
S.Sigma_iw << mpi.bcast(S.Sigma_iw)
# Write the final Sigma and G to the hdf5 archive:
if mpi.is_master_node():
ar = HDFArchive(dft_filename+'.h5','a')['dmft_output']
if previous_runs: iteration_number += previous_runs
ar['iterations'] = iteration_number
ar['G_0'] = S.G0_iw
ar['G_tau'] = S.G_tau
ar['G_iw'] = S.G_iw
ar['Sigma_iw'] = S.Sigma_iw
ar = HDFArchive(dft_filename+'.h5','a')
ar['dmft_output']['iterations'] = iteration_number + previous_runs
ar['dmft_output']['G_0'] = S.G0_iw
ar['dmft_output']['G_tau'] = S.G_tau
ar['dmft_output']['G_iw'] = S.G_iw
ar['dmft_output']['Sigma_iw'] = S.Sigma_iw
del ar
# Set the new double counting:

View File

@ -82,7 +82,7 @@ DMFT setup: Hubbard-I calculations in TRIQS
--------------------------------------------
In order to run DFT+DMFT calculations within Hubbard-I we need the corresponding python script, :ref:`Ce-gamma_script`.
It is generally similar to the script for the case of DMFT calculations with the CT-QMC solver (see :ref:`dftdmft_singleshot`),
It is generally similar to the script for the case of DMFT calculations with the CT-QMC solver (see :ref:`singleshot`),
however there are also some differences. First difference is that we import the Hubbard-I solver by::
from pytriqs.applications.impurity_solvers.hubbard_I.hubbard_solver import Solver

View File

@ -50,7 +50,9 @@ chemical_potential=chemical_potential_init
# load previous data: old self-energy, chemical potential, DC correction
if previous_present:
if mpi.is_master_node():
S.Sigma << HDFArchive(dft_filename+'.h5','a')['dmft_output']['Sigma']
ar = HDFArchive(dft_filename+'.h5','a')
S.Sigma << ar['dmft_output']['Sigma']
del ar
chemical_potential,dc_imp,dc_energ = SK.load(['chemical_potential','dc_imp','dc_energ'])
S.Sigma << mpi.bcast(S.Sigma)
SK.set_mu(chemical_potential)
@ -88,10 +90,10 @@ for iteration_number in range(1,Loops+1):
# Now mix Sigma and G with factor Mix, if wanted:
if (iteration_number>1 or previous_present):
if (mpi.is_master_node() and (sigma_mix<1.0)):
ar = HDFArchive(dft_filename+'.h5','a')['dmft_output']
ar = HDFArchive(dft_filename+'.h5','a')
mpi.report("Mixing Sigma and G with factor %s"%sigma_mix)
S.Sigma << sigma_mix * S.Sigma + (1.0-sigma_mix) * ar['Sigma']
S.G << sigma_mix * S.G + (1.0-sigma_mix) * ar['G']
S.Sigma << sigma_mix * S.Sigma + (1.0-sigma_mix) * ar['dmft_output']['Sigma']
S.G << sigma_mix * S.G + (1.0-sigma_mix) * ar['dmft_output']['G']
del ar
S.G << mpi.bcast(S.G)
S.Sigma << mpi.bcast(S.Sigma)
@ -107,11 +109,10 @@ for iteration_number in range(1,Loops+1):
# store the impurity self-energy, GF as well as correlation energy in h5
if mpi.is_master_node():
ar = HDFArchive(dft_filename+'.h5','a')['dmft_output']
if previous_runs: iteration_number += previous_runs
ar['iterations'] = iteration_number
ar['G'] = S.G
ar['Sigma'] = S.Sigma
ar = HDFArchive(dft_filename+'.h5','a')
ar['dmft_output']['iterations'] = iteration_number + previous_runs
ar['dmft_output']['G'] = S.G
ar['dmft_output']['Sigma'] = S.Sigma
del ar
#Save essential SumkDFT data:

View File

@ -67,7 +67,9 @@ if previous_present:
dc_imp = 0
dc_energ = 0
if mpi.is_master_node():
S.Sigma_iw << HDFArchive(dft_filename+'.h5','a')['dmft_output']['Sigma_iw']
ar = HDFArchive(dft_filename+'.h5','a')
S.Sigma_iw << ar['dmft_output']['Sigma_iw']
del ar
chemical_potential,dc_imp,dc_energ = SK.load(['chemical_potential','dc_imp','dc_energ'])
S.Sigma_iw << mpi.bcast(S.Sigma_iw)
chemical_potential = mpi.bcast(chemical_potential)
@ -95,12 +97,12 @@ for iteration_number in range(1,loops+1):
if mpi.is_master_node():
# We can do a mixing of Delta in order to stabilize the DMFT iterations:
S.G0_iw << S.Sigma_iw + inverse(S.G_iw)
ar = HDFArchive(dft_filename+'.h5','a')['dmft_output']
ar = HDFArchive(dft_filename+'.h5','a')
if (iteration_number>1 or previous_present):
mpi.report("Mixing input Delta with factor %s"%delta_mix)
Delta = (delta_mix * delta(S.G0_iw)) + (1.0-delta_mix) * ar['Delta_iw']
Delta = (delta_mix * delta(S.G0_iw)) + (1.0-delta_mix) * ar['dmft_output']['Delta_iw']
S.G0_iw << S.G0_iw + delta(S.G0_iw) - Delta
ar['Delta_iw'] = delta(S.G0_iw)
ar['dmft_output']['Delta_iw'] = delta(S.G0_iw)
S.G0_iw << inverse(S.G0_iw)
del ar
@ -115,25 +117,24 @@ for iteration_number in range(1,loops+1):
# Now mix Sigma and G with factor sigma_mix, if wanted:
if (iteration_number>1 or previous_present):
if mpi.is_master_node():
ar = HDFArchive(dft_filename+'.h5','a')['dmft_output']
ar = HDFArchive(dft_filename+'.h5','a')
mpi.report("Mixing Sigma and G with factor %s"%sigma_mix)
S.Sigma_iw << sigma_mix * S.Sigma_iw + (1.0-sigma_mix) * ar['Sigma_iw']
S.G_iw << sigma_mix * S.G_iw + (1.0-sigma_mix) * ar['G_iw']
S.Sigma_iw << sigma_mix * S.Sigma_iw + (1.0-sigma_mix) * ar['dmft_output']['Sigma_iw']
S.G_iw << sigma_mix * S.G_iw + (1.0-sigma_mix) * ar['dmft_output']['G_iw']
del ar
S.G_iw << mpi.bcast(S.G_iw)
S.Sigma_iw << mpi.bcast(S.Sigma_iw)
# Write the final Sigma and G to the hdf5 archive:
if mpi.is_master_node():
ar = HDFArchive(dft_filename+'.h5','a')['dmft_output']
if previous_runs: iteration_number += previous_runs
ar['iterations'] = iteration_number
ar['G_tau'] = S.G_tau
ar['G_iw'] = S.G_iw
ar['Sigma_iw'] = S.Sigma_iw
ar['G0-%s'%(iteration_number)] = S.G0_iw
ar['G-%s'%(iteration_number)] = S.G_iw
ar['Sigma-%s'%(iteration_number)] = S.Sigma_iw
ar = HDFArchive(dft_filename+'.h5','a')
ar['dmft_output']['iterations'] = iteration_number + previous_runs
ar['dmft_output']['G_tau'] = S.G_tau
ar['dmft_output']['G_iw'] = S.G_iw
ar['dmft_output']['Sigma_iw'] = S.Sigma_iw
ar['dmft_output']['G0-%s'%(iteration_number)] = S.G0_iw
ar['dmft_output']['G-%s'%(iteration_number)] = S.G_iw
ar['dmft_output']['Sigma-%s'%(iteration_number)] = S.Sigma_iw
del ar
# Set the new double counting:
@ -143,8 +144,3 @@ for iteration_number in range(1,loops+1):
# Save stuff into the dft_output group of hdf5 archive in case of rerun:
SK.save(['chemical_potential','dc_imp','dc_energ'])
if mpi.is_master_node():
ar = HDFArchive("dftdmft.h5",'w')
ar["G_tau"] = S.G_tau
ar["G_iw"] = S.G_iw
ar["Sigma_iw"] = S.Sigma_iw

View File

@ -68,7 +68,9 @@ if previous_present:
dc_imp = 0
dc_energ = 0
if mpi.is_master_node():
S.Sigma_iw << HDFArchive(dft_filename+'.h5','a')['dmft_output']['Sigma_iw']
ar = HDFArchive(dft_filename+'.h5','a')
S.Sigma_iw << ar['dmft_output']['Sigma_iw']
del ar
chemical_potential,dc_imp,dc_energ = SK.load(['chemical_potential','dc_imp','dc_energ'])
S.Sigma_iw << mpi.bcast(S.Sigma_iw)
chemical_potential = mpi.bcast(chemical_potential)
@ -96,12 +98,12 @@ for iteration_number in range(1,loops+1):
if mpi.is_master_node():
# We can do a mixing of Delta in order to stabilize the DMFT iterations:
S.G0_iw << S.Sigma_iw + inverse(S.G_iw)
ar = HDFArchive(dft_filename+'.h5','a')['dmft_output']
ar = HDFArchive(dft_filename+'.h5','a')
if (iteration_number>1 or previous_present):
mpi.report("Mixing input Delta with factor %s"%delta_mix)
Delta = (delta_mix * delta(S.G0_iw)) + (1.0-delta_mix) * ar['Delta_iw']
Delta = (delta_mix * delta(S.G0_iw)) + (1.0-delta_mix) * ar['dmft_output']['Delta_iw']
S.G0_iw << S.G0_iw + delta(S.G0_iw) - Delta
ar['Delta_iw'] = delta(S.G0_iw)
ar['dmft_output']['Delta_iw'] = delta(S.G0_iw)
S.G0_iw << inverse(S.G0_iw)
del ar
@ -116,25 +118,24 @@ for iteration_number in range(1,loops+1):
# Now mix Sigma and G with factor sigma_mix, if wanted:
if (iteration_number>1 or previous_present):
if mpi.is_master_node():
ar = HDFArchive(dft_filename+'.h5','a')['dmft_output']
ar = HDFArchive(dft_filename+'.h5','a')
mpi.report("Mixing Sigma and G with factor %s"%sigma_mix)
S.Sigma_iw << sigma_mix * S.Sigma_iw + (1.0-sigma_mix) * ar['Sigma_iw']
S.G_iw << sigma_mix * S.G_iw + (1.0-sigma_mix) * ar['G_iw']
S.Sigma_iw << sigma_mix * S.Sigma_iw + (1.0-sigma_mix) * ar['dmft_output']['Sigma_iw']
S.G_iw << sigma_mix * S.G_iw + (1.0-sigma_mix) * ar['dmft_output']['G_iw']
del ar
S.G_iw << mpi.bcast(S.G_iw)
S.Sigma_iw << mpi.bcast(S.Sigma_iw)
# Write the final Sigma and G to the hdf5 archive:
if mpi.is_master_node():
ar = HDFArchive(dft_filename+'.h5','a')['dmft_output']
if previous_runs: iteration_number += previous_runs
ar['iterations'] = iteration_number
ar['G_tau'] = S.G_tau
ar['G_iw'] = S.G_iw
ar['Sigma_iw'] = S.Sigma_iw
ar['G0-%s'%(iteration_number)] = S.G0_iw
ar['G-%s'%(iteration_number)] = S.G_iw
ar['Sigma-%s'%(iteration_number)] = S.Sigma_iw
ar = HDFArchive(dft_filename+'.h5','a')
ar['dmft_output']['iterations'] = iteration_number + previous_runs
ar['dmft_output']['G_tau'] = S.G_tau
ar['dmft_output']['G_iw'] = S.G_iw
ar['dmft_output']['Sigma_iw'] = S.Sigma_iw
ar['dmft_output']['G0-%s'%(iteration_number)] = S.G0_iw
ar['dmft_output']['G-%s'%(iteration_number)] = S.G_iw
ar['dmft_output']['Sigma-%s'%(iteration_number)] = S.Sigma_iw
del ar
# Set the new double counting:
@ -144,8 +145,4 @@ for iteration_number in range(1,loops+1):
# Save stuff into the dft_output group of hdf5 archive in case of rerun:
SK.save(['chemical_potential','dc_imp','dc_energ'])
if mpi.is_master_node():
ar = HDFArchive("dftdmft.h5",'w')
ar["G_tau"] = S.G_tau
ar["G_iw"] = S.G_iw
ar["Sigma_iw"] = S.Sigma_iw

View File

@ -33,8 +33,8 @@ The frequency depended optical conductivity is given by
Prerequisites
-------------
First perform a standard :ref:`DFT+DMFT calculation <dftdmft_selfcons>` for your desired material and obtain the real-frequency self energy by doing an
analytic continuation.
First perform a standard :ref:`DFT+DMFT calculation <full_charge_selfcons>` for your desired material and obtain the
real-frequency self energy by doing an analytic continuation.
.. warning::
This package does NOT provide an explicit method to do an **analytic continuation** of