diff --git a/doc/guide/analysis.rst b/doc/guide/analysis.rst index bfe912a3..f84a14ef 100644 --- a/doc/guide/analysis.rst +++ b/doc/guide/analysis.rst @@ -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) diff --git a/doc/guide/dftdmft_singleshot.rst b/doc/guide/dftdmft_singleshot.rst index 635b938e..37767256 100644 --- a/doc/guide/dftdmft_singleshot.rst +++ b/doc/guide/dftdmft_singleshot.rst @@ -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: diff --git a/doc/guide/full_tutorial.rst b/doc/guide/full_tutorial.rst index 21ace0d5..b358dfc9 100644 --- a/doc/guide/full_tutorial.rst +++ b/doc/guide/full_tutorial.rst @@ -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 diff --git a/doc/guide/images_scripts/Ce-gamma.py b/doc/guide/images_scripts/Ce-gamma.py index b347a699..b0bc20e5 100644 --- a/doc/guide/images_scripts/Ce-gamma.py +++ b/doc/guide/images_scripts/Ce-gamma.py @@ -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: diff --git a/doc/guide/images_scripts/dft_dmft_cthyb.py b/doc/guide/images_scripts/dft_dmft_cthyb.py index 330ae5df..2de25a3e 100644 --- a/doc/guide/images_scripts/dft_dmft_cthyb.py +++ b/doc/guide/images_scripts/dft_dmft_cthyb.py @@ -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 diff --git a/doc/guide/images_scripts/dft_dmft_cthyb_slater.py b/doc/guide/images_scripts/dft_dmft_cthyb_slater.py index aee1f760..5d7d95e2 100644 --- a/doc/guide/images_scripts/dft_dmft_cthyb_slater.py +++ b/doc/guide/images_scripts/dft_dmft_cthyb_slater.py @@ -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 + diff --git a/doc/guide/transport.rst b/doc/guide/transport.rst index 24cf19a7..17a74df6 100644 --- a/doc/guide/transport.rst +++ b/doc/guide/transport.rst @@ -33,8 +33,8 @@ The frequency depended optical conductivity is given by Prerequisites ------------- -First perform a standard :ref:`DFT+DMFT calculation ` for your desired material and obtain the real-frequency self energy by doing an -analytic continuation. +First perform a standard :ref:`DFT+DMFT calculation ` 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