diff --git a/doc/Ce-HI.rst b/doc/Ce-HI.rst index 18432c61..0cbb4012 100644 --- a/doc/Ce-HI.rst +++ b/doc/Ce-HI.rst @@ -1,11 +1,11 @@ .. index:: tutorial on Ce within Hub.-I approximation -.. _LDADMFTtutorial: +.. _DFTDMFTtutorial: -LDA+DMFT tutorial: Ce with Hubbard-I approximation +DFT+DMFT tutorial: Ce with Hubbard-I approximation ================================================== -In this tutorial we will perform LDA+DMFT :program:`Wien2k` calculations of the high-temperature :math:`\gamma`-phase of Ce employing the +In this tutorial we will perform DFT+DMFT :program:`Wien2k` calculations of the high-temperature :math:`\gamma`-phase of Ce employing the Hubbard-I approximation for its localized *4f* shell. First we create the Wien2k :file:`Ce-gamma.struct` file as described in `Wien2k manual `_ for the :math:`\gamma`-Ce fcc structure with lattice parameter of 9.75 a.u. @@ -61,7 +61,7 @@ This program produces the following files: * :file:`Ce-gamma.ctqmcout` and :file:`Ce-gamma.symqmc` containing projector operators and symmetry operations for orthonormalized Wannier orbitals, respectively. * :file:`Ce-gamma.parproj` and :file:`Ce-gamma.sympar` containing projector operators and symmetry operations for uncorrelated states, respectively. These files are needed for projected density-of-states or spectral-function calculations. - * :file:`Ce-gamma.oubwin` needed for the charge desity recalculation in the case of fully self-consistent LDA+DMFT run (see below). + * :file:`Ce-gamma.oubwin` needed for the charge desity recalculation in the case of fully self-consistent DFT+DMFT run (see below). Now we have all necessary input from :program:`Wien2k` for running DMFT calculations. @@ -73,18 +73,18 @@ Now we have all necessary input from :program:`Wien2k` for running DMFT calculat Hubbard-I calculations in TRIQS ------------------------------- -In order to run LDA+DMFT calculations within Hubbard-I we need the corresponding python script, :ref:`Ce-gamma-script`. +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:`advanced`), however there are also some differences. First, instead of *pytriqs.applications.dft.solver_multiband* we import Hubbard-I solver :: from pytriqs.applications.impurity_solvers.hubbard_I.hubbard_solver import Solver -The Hubbard-I solver is very fast and we do not need to take into account the LDA blocking structure or use any approximation for the *U*-matrix :: +The Hubbard-I solver is very fast and we do not need to take into account the DFT blocking structure or use any approximation for the *U*-matrix :: - use_blocks = False # use bloc structure from LDA input + use_blocks = False # use bloc structure from DFT input use_matrix = True # use the U matrix calculated from Slater coefficients instead of (U+2J, U, U-J) -We load and convert the :program:`dmftproj` output and initialize the *SumkLDA* class as described in :ref:`LDADMFTmain` and :ref:`advanced` and then set up the Hubbard-I solver :: +We load and convert the :program:`dmftproj` output and initialize the *SumkDFT* class as described in :ref:`DFTDMFTmain` and :ref:`advanced` and then set up the Hubbard-I solver :: S = Solver(beta = beta, l = l) @@ -96,7 +96,7 @@ The Hubbard-I initialization `Solver` has also optional parameters one may use: * `n_msb`: the number of Matsubara frequencies used. The default is `n_msb=1025`. * `use_spin_orbit`: if set 'True' the solver is run with spin-orbit coupling -included. To perform actual LDA+DMFT calculations with spin-orbit one should +included. To perform actual DFT+DMFT calculations with spin-orbit one should also run :program:`Wien2k` and :program:`dmftproj` in spin-polarized mode and with spin-orbit included. By default, `use_spin_orbit=False`. @@ -127,11 +127,11 @@ Green's function and then save them in the hdf5 file . Then the double counting is recalculated and the correlation energy is computed with the Migdal formula and stored in hdf5. Finally, we compute the modified charge density and save it as well as correlational correction to the total energy in -:file:`Ce-gamma.qdmft` file, which is then read by :program:`lapw2` in the case of self-consistent LDA+DMFT calculations. +:file:`Ce-gamma.qdmft` file, which is then read by :program:`lapw2` in the case of self-consistent DFT+DMFT calculations. -.. index:: running LDA+DMFT calculations +.. index:: running DFT+DMFT calculations -Running LDA+DMFT calculations +Running DFT+DMFT calculations ----------------------------- After having prepared the script one may run one-shot DMFT calculations by @@ -148,12 +148,12 @@ enables MPI. The exact form of this command will, of course, depend on mpi-launcher installed in your system. Instead of doing one-shot run one may also perform fully self-consistent -LDA+DMFT calculations, as we will do in this tutorial. We launch these +DFT+DMFT calculations, as we will do in this tutorial. We launch these calculations as follows :: run_triqs -qdmft -where `-qdmft` flag turns on LDA+DMFT calculations with :program:`Wien2k`. We +where `-qdmft` flag turns on DFT+DMFT calculations with :program:`Wien2k`. We use here the default convergence criterion in :program:`Wien2k` (convergence to 0.1 mRy in energy). @@ -193,9 +193,9 @@ The corresponding script :ref:`Ce-gamma_DOS-script` contains several new paramet N_om=2001 # number of points on the real-energy axis mesh broadening = 0.02 # broadening (the imaginary shift of the real-energy mesh) -Then one needs to load projectors needed for calculations of corresponding projected densities of states, as well as corresponding symmetries. To get access to analysing tools we initialize the `SumkLDATools` class :: +Then one needs to load projectors needed for calculations of corresponding projected densities of states, as well as corresponding symmetries. To get access to analysing tools we initialize the `SumkDFTTools` class :: - SK = SumkLDATools(hdf_file=lda_filename+'.h5', use_lda_blocks=False) + SK = SumkDFTTools(hdf_file=dft_filename+'.h5', use_dft_blocks=False) Then after the solver initialization and setting up atomic levels we compute atomic Green's function and self-energy on the real axis:: diff --git a/doc/Ce-gamma.py b/doc/Ce-gamma.py index 3416b556..03c56b5c 100644 --- a/doc/Ce-gamma.py +++ b/doc/Ce-gamma.py @@ -1,8 +1,8 @@ -from pytriqs.applications.dft.sumk_lda import * +from pytriqs.applications.dft.sumk_dft import * from pytriqs.applications.dft.converters.wien2k_converter import * from pytriqs.applications.impurity_solvers.hubbard_I.hubbard_solver import Solver -lda_filename = 'Ce-gamma' +dft_filename = 'Ce-gamma' beta = 40 U_int = 6.00 J_hund = 0.70 @@ -10,17 +10,17 @@ Loops = 2 # Number of DMFT sc-loops Mix = 0.7 # Mixing factor in QMC # 1.0 ... all from imp; 0.0 ... all from Gloc DC_type = 0 # 0...FLL, 1...Held, 2... AMF, 3...Lichtenstein -useBlocs = False # use bloc structure from LDA input +useBlocs = False # use bloc structure from DFT input useMatrix = True # use the U matrix calculated from Slater coefficients instead of (U+2J, U, U-J) Natomic = 1 -HDFfilename = lda_filename+'.h5' +HDFfilename = dft_filename+'.h5' use_val= U_int * (Natomic - 0.5) - J_hund * (Natomic * 0.5 - 0.5) # Convert DMFT input: # Can be commented after the first run -Converter = Wien2kConverter(filename=lda_filename) +Converter = Wien2kConverter(filename=dft_filename) Converter.convert_dmft_input() #check if there are previous runs: @@ -42,7 +42,7 @@ previous_runs = mpi.bcast(previous_runs) previous_present = mpi.bcast(previous_present) # Init the SumK class -SK=SumkLDA(hdf_file=lda_filename+'.h5',use_lda_blocks=False) +SK=SumkDFT(hdf_file=dft_filename+'.h5',use_dft_blocks=False) Norb = SK.corr_shells[0][3] l = SK.corr_shells[0][2] @@ -154,7 +154,7 @@ for Iteration_Number in range(1,Loops+1): # find exact chemical potential if (SK.density_required): SK.chemical_potential = SK.find_mu( precision = 0.000001 ) -dN,d = SK.calc_density_correction(filename = lda_filename+'.qdmft') +dN,d = SK.calc_density_correction(filename = dft_filename+'.qdmft') mpi.report("Trace of Density Matrix: %s"%d) @@ -166,6 +166,6 @@ if (mpi.is_master_node()): DCenerg = ar['DCenerg%s'%itn] del ar correnerg -= DCenerg[0] - f=open(lda_filename+'.qdmft','a') + f=open(dft_filename+'.qdmft','a') f.write("%.16f\n"%correnerg) f.close() diff --git a/doc/Ce-gamma_DOS.py b/doc/Ce-gamma_DOS.py index 8f2be822..573084c3 100644 --- a/doc/Ce-gamma_DOS.py +++ b/doc/Ce-gamma_DOS.py @@ -1,27 +1,27 @@ -from pytriqs.applications.dft.sumk_lda_tools import * +from pytriqs.applications.dft.sumk_dft_tools import * from pytriqs.applications.dft.converters.wien2k_converter import * from pytriqs.applications.impurity_solvers.hubbard_I.hubbard_solver import Solver # Creates the data directory, cd into it: #Prepare_Run_Directory(DirectoryName = "Ce-Gamma") -lda_filename = 'Ce-gamma' +dft_filename = 'Ce-gamma' Beta = 40 U_int = 6.00 J_hund = 0.70 DC_type = 0 # 0...FLL, 1...Held, 2... AMF, 3...Lichtenstein load_previous = True # load previous results -useBlocs = False # use bloc structure from LDA input +useBlocs = False # use bloc structure from DFT input useMatrix = True # use the U matrix calculated from Slater coefficients instead of (U+2J, U, U-J) ommin=-4.0 ommax=6.0 N_om=2001 broadening = 0.02 -HDFfilename = lda_filename+'.h5' +HDFfilename = dft_filename+'.h5' # Convert DMFT input: # Can be commented after the first run -Converter = Wien2kConverter(filename=lda_filename,repacking=True) +Converter = Wien2kConverter(filename=dft_filename,repacking=True) Converter.convert_dmft_input() Converter.convert_parproj_input() @@ -48,7 +48,7 @@ previous_present = mpi.bcast(previous_present) # from a converted h5 archive. # Init the SumK class -SK = SumkLDATools(hdf_file=lda_filename+'.h5',use_lda_blocks=False) +SK = SumkDFTTools(hdf_file=dft_filename+'.h5',use_dft_blocks=False) if (mpi.is_master_node()): diff --git a/doc/LDADMFTmain.rst b/doc/DFTDMFTmain.rst similarity index 89% rename from doc/LDADMFTmain.rst rename to doc/DFTDMFTmain.rst index a9e4a8bd..738879db 100644 --- a/doc/LDADMFTmain.rst +++ b/doc/DFTDMFTmain.rst @@ -1,33 +1,33 @@ -.. index:: LDA+DMFT calculation +.. index:: DFT+DMFT calculation -.. _LDADMFTmain: +.. _DFTDMFTmain: -The LDA+DMFT calculation +The DFT+DMFT calculation ======================== -After having set up the hdf5 arxive, we can now do our LDA+DMFT calculation. It consists of +After having set up the hdf5 arxive, we can now do our DFT+DMFT calculation. It consists of initialisation steps, and the actual DMFT self consistency loop. -.. index:: initialisation of LDA+DMFT +.. index:: initialisation of DFT+DMFT Initialisation of the calculation --------------------------------- Before doing the calculation, we have to intialize all the objects that we will need. The first thing is the -:class:`SumkLDA` class. It contains all basic routines that are necessary to perform a summation in k-space +:class:`SumkDFT` class. It contains all basic routines that are necessary to perform a summation in k-space to get the local quantities used in DMFT. It is initialized by:: - from pytriqs.applications.dft.sumk_lda import * - SK = SumkLDA(hdf_file = filename) + from pytriqs.applications.dft.sumk_dft import * + SK = SumkDFT(hdf_file = filename) The only necessary parameter is the filename of the hdf5 archive. In addition, there are some optional parameters: * `mu`: The chemical potential at initialization. This value is only used if no other value is found in the hdf5 arxive. The default value is 0.0. * `h_field`: External magnetic field. The default value is 0.0. - * `use_lda_blocks`: If true, the structure of the density matrix is analysed at initialisation, and non-zero matrix elements + * `use_dft_blocks`: If true, the structure of the density matrix is analysed at initialisation, and non-zero matrix elements are identified. The DMFT calculation is then restricted to these matrix elements, yielding a more efficient solution of the local interaction problem. Degeneracies in orbital and spin space are also identified and stored for later use. The default value is `False`. - * `lda_data`, `symmcorr_data`, `parproj_data`, `symmpar_data`, `bands_data`: These string variables define the subgroups in the hdf5 arxive, + * `dft_data`, `symmcorr_data`, `parproj_data`, `symmpar_data`, `bands_data`: These string variables define the subgroups in the hdf5 arxive, where the corresponding information is stored. The default values are consistent with those in :ref:`interfacetowien`. At initialisation, the necessary data is read from the hdf5 file. If a calculation is restarted based on a previous hdf5 file, information on @@ -47,7 +47,7 @@ The necessary parameters are the inverse temperature `beta`, the Coulomb interac and the number of orbitals `n_orb`. There are again several optional parameters that allow the tailoring of the local Hamiltonian to specific needs. They are: - * `gf_struct`: The block structure of the local density matrix given in the format calculated by :class:`SumkLDA`. + * `gf_struct`: The block structure of the local density matrix given in the format calculated by :class:`SumkDFT`. * `map`: If `gf_struct` is given as parameter, `map` also must be given. This is the mapping from the block structure to a general up/down structure. @@ -76,11 +76,11 @@ parameters for which default values are set. Generally, they should be reset for * `length_cycle`: Number of CTQMC moves per one cycle. * `n_warmup_cycles`: Number of initial CTQMC cycles before measurements start. Usually of order of 10000, sometimes needs to be increased significantly. -Most of above parameters can be taken directly from the :class:`SumkLDA` class, without defining them by hand. We will see a specific example +Most of above parameters can be taken directly from the :class:`SumkDFT` class, without defining them by hand. We will see a specific example at the end of this tutorial. -.. index:: LDA+DMFT loop, one-shot calculation +.. index:: DFT+DMFT loop, one-shot calculation Doing the DMFT loop ------------------- @@ -104,7 +104,7 @@ set up the loop over DMFT iterations and the self-consistency condition:: SK.set_dc( dm, U_interact = U, J_hund = J, use_dc_formula = 0) # Set the double counting term SK.save() # save everything to the hdf5 arxive -These basic steps are enough to set up the basic DMFT Loop. For a detailed description of the :class:`SumkLDA` routines, +These basic steps are enough to set up the basic DMFT Loop. For a detailed description of the :class:`SumkDFT` routines, see the reference manual. After the self-consistency steps, the solution of the Anderson impurity problem is calculation by CTQMC. Different to model calculations, we have to do a few more steps after this, because of the double-counting correction. We first calculate the density of the impurity problem. Then, the routine `set_dc` takes as parameters this density matrix, the @@ -119,11 +119,11 @@ At the end of the calculation, we can save the Greens function and self energy i from pytriqs.archive import HDFArchive import pytriqs.utility.mpi as mpi if mpi.is_master_node(): - ar = HDFArchive("YourLDADMFTcalculation.h5",'w') + ar = HDFArchive("YourDFTDMFTcalculation.h5",'w') ar["G"] = S.G ar["Sigma"] = S.Sigma This is it! -These are the essential steps to do a one-shot LDA+DMFT calculation. For full charge-self consistent calculations, there are some more things +These are the essential steps to do a one-shot DFT+DMFT calculation. For full charge-self consistent calculations, there are some more things to consider, which we will see later on. diff --git a/doc/advanced.rst b/doc/advanced.rst index 4cd8af90..9dc6eff2 100644 --- a/doc/advanced.rst +++ b/doc/advanced.rst @@ -7,7 +7,7 @@ Normally, one wants to adjust some more parameters in order to make the calculat will see a more advanced example, which is also suited for parallel execution. First, we load the necessary modules:: - from pytriqs.applications.dft.sumk_lda import * + from pytriqs.applications.dft.sumk_dft import * from pytriqs.applications.dft.converters.wien2k_converter import * from pytriqs.applications.dft.solver_multiband import * from pytriqs.gf.local import * @@ -15,7 +15,7 @@ First, we load the necessary modules:: Then we define some parameters:: - lda_filename='srvo3' + dft_filename='srvo3' U = 2.7 J = 0.65 beta = 40 @@ -23,7 +23,7 @@ Then we define some parameters:: mix = 0.8 # Mixing factor of Sigma after solution of the AIM Delta_mix = 1.0 # Mixing factor of Delta as input for the AIM dc_type = 1 # DC type: 0 FLL, 1 Held, 2 AMF - use_blocks = True # use bloc structure from LDA input + use_blocks = True # use bloc structure from DFT input use_matrix = False # True: Slater parameters, False: Kanamori parameters U+2J, U, U-J use_spinflip = False # use the full rotational invariant interaction? prec_mu = 0.0001 @@ -32,10 +32,10 @@ Then we define some parameters:: warming_iterations = 2000 -Most of these parameters are self-explaining. The first, `lda_filename`, gives the filename of the input files. +Most of these parameters are self-explaining. The first, `dft_filename`, gives the filename of the input files. The next step, as described in the previous section, is to convert the input files:: - Converter = Wien2kConverter(filename=lda_filename, repacking=True) + Converter = Wien2kConverter(filename=dft_filename, repacking=True) Converter.convert_dmft_input() mpi.barrier() @@ -46,7 +46,7 @@ from scratch:: previous_runs = 0 previous_present = False if mpi.is_master_node(): - ar = HDFArchive(lda_filename+'.h5','a') + ar = HDFArchive(dft_filename+'.h5','a') if 'iterations' in ar: previous_present = True previous_runs = ar['iterations'] @@ -56,18 +56,18 @@ from scratch:: # if previous runs are present, no need for recalculating the bloc structure: calc_blocs = use_blocks and (not previous_present) -Now we can use all this information to initialise the :class:`SumkLDA` class:: +Now we can use all this information to initialise the :class:`SumkDFT` class:: - SK=SumkLDA(hdf_file=lda_filename+'.h5',use_lda_blocks=calc_blocs) + SK=SumkDFT(hdf_file=dft_filename+'.h5',use_dft_blocks=calc_blocs) -If there was a previous run, we know already about the block structure, and therefore `UseLDABlocs` is set to `False`. +If there was a previous run, we know already about the block structure, and therefore `UseDFTBlocs` is set to `False`. The next step is to initialise the Solver:: Norb = SK.corr_shells[0][3] l = SK.corr_shells[0][2] S = SolverMultiBand(beta=beta,n_orb=Norb,gf_struct=SK.gf_struct_solver[0],map=SK.map[0]) -As we can see, many options of the solver are set by properties of the :class:`SumkLDA` class, so we don't have +As we can see, many options of the solver are set by properties of the :class:`SumkDFT` class, so we don't have to set them manually. If there are previous runs stored in the hdf5 archive, we can now load the self energy @@ -75,7 +75,7 @@ of the last iteration:: if (previous_present): if (mpi.is_master_node()): - ar = HDFArchive(lda_filename+'.h5','a') + ar = HDFArchive(dft_filename+'.h5','a') S.Sigma << ar['SigmaImFreq'] del ar S.Sigma = mpi.bcast(S.Sigma) @@ -123,7 +123,7 @@ previous section, with some additional refinement:: # Now mix Sigma and G with factor Mix, if wanted: if ((iteration_number>1) or (previous_present)): if (mpi.is_master_node()): - ar = HDFArchive(lda_filename+'.h5','a') + ar = HDFArchive(dft_filename+'.h5','a') mpi.report("Mixing Sigma and G with factor %s"%mix) S.Sigma << mix * S.Sigma + (1.0-mix) * ar['Sigma'] S.G << mix * S.G + (1.0-mix) * ar['GF'] @@ -133,7 +133,7 @@ previous section, with some additional refinement:: # Write the final Sigma and G to the hdf5 archive: if (mpi.is_master_node()): - ar = HDFArchive(lda_filename+'.h5','a') + ar = HDFArchive(dft_filename+'.h5','a') ar['iterations'] = previous_runs + iteration_number ar['Sigma'] = S.Sigma ar['GF'] = S.G @@ -146,7 +146,7 @@ previous section, with some additional refinement:: #Save stuff: SK.save() -This is all we need for the LDA+DMFT calculation. At the end, all results are stored in the hdf5 output file. +This is all we need for the DFT+DMFT calculation. At the end, all results are stored in the hdf5 output file. diff --git a/doc/analysis.rst b/doc/analysis.rst index 03fdfdb0..4668f268 100644 --- a/doc/analysis.rst +++ b/doc/analysis.rst @@ -11,10 +11,10 @@ This section explains how to use some tools of the package in order to analyse t There are methods included e.g. in the :program:`ALPS` package, which can be used for these purposes. But be careful: All these methods have to be used very carefully! -The tools for analysis can be found in an extension of the :class:`SumkLDA` class and are -loaded by importing the module :class:`SumkLDATools`:: +The tools for analysis can be found in an extension of the :class:`SumkDFT` class and are +loaded by importing the module :class:`SumkDFTTools`:: - from pytriqs.applications.dft.sumk_lda_tools import * + from pytriqs.applications.dft.sumk_dft_tools import * There are two practical tools for which you do not need a self energy on the real axis, namely the: @@ -26,12 +26,12 @@ The self energy on the real frequency axis is necessary in computing the: * momentum-integrated spectral function including self-energy effects, * momentum-resolved spectral function (i.e. ARPES). -The initialisation of the class is equivalent to that of the :class:`SumkLDA` +The initialisation of the class is equivalent to that of the :class:`SumkDFT` class:: - SK = SumkLDATools(hdf_file = filename) + SK = SumkDFTTools(hdf_file = filename) -Note that all routines available in :class:`SumkLDA` are also available here. +Note that all routines available in :class:`SumkDFT` are also available here. Routines without real-frequency self energy ------------------------------------------- @@ -72,7 +72,7 @@ Most conveniently, it is stored as a real frequency :class:`BlockGf` object in t You may also store it in text files. If all blocks of your self energy are of dimension 1x1, you store them in `fname_(block)0.dat` files. Here `(block)` is a block name (`up`, `down`, or combined `ud`). In the case when you have matrix blocks, you store them in `(i)_(j).dat` files, where `(i)` and `(j)` are the orbital indices, in the `fname_(block)` directory. -This self energy is loaded and put into the :class:`SumkLDA` class by the function:: +This self energy is loaded and put into the :class:`SumkDFT` class by the function:: SK.constr_Sigma_real_axis(filename, hdf=True, hdf_dataset='SigmaReFreq',n_om=0) diff --git a/doc/documentation.rst b/doc/documentation.rst index 63211c24..3ebddae9 100644 --- a/doc/documentation.rst +++ b/doc/documentation.rst @@ -13,7 +13,7 @@ A (not so) quick tour :maxdepth: 1 interface - LDADMFTmain + DFTDMFTmain advanced analysis selfcons @@ -45,6 +45,6 @@ This is the reference manual for the python routines. :maxdepth: 2 reference/h5structure - reference/sumk_lda + reference/sumk_dft diff --git a/doc/interface.rst b/doc/interface.rst index 3e7927aa..58434bb2 100644 --- a/doc/interface.rst +++ b/doc/interface.rst @@ -33,11 +33,11 @@ an hdf5 arxive, named :file:`material_of_interest.h5`, where all the data is sto There are three optional parameters to the Constructor: - * `lda_subgrp`: We store all data in subgroups of the hdf5 arxive. For the main data + * `dft_subgrp`: We store all data in subgroups of the hdf5 arxive. For the main data that is needed for the DMFT loop, we use the subgroup specified by this optional parameter. - The default value `lda_input` is used as the subgroup name. + The default value `dft_input` is used as the subgroup name. * `symmcorr_subgrp`: In this subgroup we store all the data for applying the symmetry - operations in the DMFT loop. The default value is `lda_symmcorr_input`. + operations in the DMFT loop. The default value is `dft_symmcorr_input`. * `repacking`: If true, and the hdf5 file already exists, the system command :program:`h5repack` is invoked. This command ensures a minimal file size of the hdf5 file. The default value is `False`. If you wish to use this, ensure @@ -48,13 +48,13 @@ hdf5 arxive by:: Converter.convert_dmft_input() -This reads all the data, and stores it in the subgroup `lda_subgrp`, as discussed above. +This reads all the data, and stores it in the subgroup `dft_subgrp`, as discussed above. In this step, the files :file:`material_of_interest.ctqmcout` and :file:`material_of_interest.symqmc` have to be present in the working directory. After this step, all the necessary information for the DMFT loop is stored in the hdf5 arxive, where the string variable `Converter.hdf_file` gives the file name of the arxive. -You can now proceed with :ref:`LDADMFTmain`. +You can now proceed with :ref:`DFTDMFTmain`. Data for post-processing @@ -70,8 +70,8 @@ of :program:`Wien2k`, you have to use:: This reads the files :file:`material_of_interest.parproj` and :file:`material_of_interest.sympar`. Again, there are two optional parameters - * `parproj_subgrp`: The subgroup for partial projectors data. The default value is `lda_parproj_input`. - * `symmpar_subgrp`: The subgroup for symmetry operations data. The default value is `lda_symmpar_input`. + * `parproj_subgrp`: The subgroup for partial projectors data. The default value is `dft_parproj_input`. + * `symmpar_subgrp`: The subgroup for symmetry operations data. The default value is `dft_symmpar_input`. Another routine of the class allows to read the input for plotting the momentum-resolved spectral function. It is done by:: @@ -79,7 +79,7 @@ spectral function. It is done by:: Converter.convert_bands_input() The optional parameter that controls where the data is stored is `bands_subgrp`, -with the default value `lda_bands_input`. +with the default value `dft_bands_input`. After having converted this input, you can further proceed with the :ref:`analysis`. @@ -87,7 +87,7 @@ MPI issues ---------- The interface package is written such that all the operations are done only on the master node. -The broadcasting to the nodes has to be done by hand. The :class:`SumkLDA`, described in the +The broadcasting to the nodes has to be done by hand. The :class:`SumkDFT`, described in the following section, takes care of this automatically. Interfaces to other packages diff --git a/doc/reference/h5structure.rst b/doc/reference/h5structure.rst index 444dbe9a..7ba99eef 100644 --- a/doc/reference/h5structure.rst +++ b/doc/reference/h5structure.rst @@ -11,7 +11,7 @@ hdf5 data format In order to be used with the DMFT routines, the following data needs to be provided in the hdf5 file. It contains a lot of information in order to perform DMFT calculations for all kinds of situations, e.g. d-p Hamiltonians, more than one correlated atomic shell, or using symmetry operations for the k-summation. We store all data in subgroups of the hdf5 arxive: -:program:`Main data`: There needs to be one subgroup for the main data of the calculation. The default name of this group is `lda_input`. Its contents are +:program:`Main data`: There needs to be one subgroup for the main data of the calculation. The default name of this group is `dft_input`. Its contents are * `energy_unit`, numpy.float. The unit of energy used for the calculation diff --git a/doc/reference/sumk_lda.rst b/doc/reference/sumk_dft.rst similarity index 85% rename from doc/reference/sumk_lda.rst rename to doc/reference/sumk_dft.rst index 663b3978..77e6841c 100644 --- a/doc/reference/sumk_lda.rst +++ b/doc/reference/sumk_dft.rst @@ -1,5 +1,5 @@ -SumK_LDA +SumK_DFT ======== .. toctree:: diff --git a/doc/selfcons.rst b/doc/selfcons.rst index c2fc1121..6904f0c4 100644 --- a/doc/selfcons.rst +++ b/doc/selfcons.rst @@ -12,15 +12,15 @@ changes in the charge density due to correlation effects. In the following, we d :program:`TRIQS` tools in combination with the :program:`Wien2k` program, although an extension to other codes is also possible. -We can use the DMFT script as introduced in sections :ref:`LDADMFTmain` and :ref:`advanced`, with a few simple +We can use the DMFT script as introduced in sections :ref:`DFTDMFTmain` and :ref:`advanced`, with a few simple modifications. First, in order to be compatible with the :program:`Wien2k` standards, the DMFT script has to be named ``case.py``, where `case` is the name of the :program:`Wien2k` calculation, see the section -:ref:`interfacetowien` for details. We can then set the variable `lda_filename` dynamically:: +:ref:`interfacetowien` for details. We can then set the variable `dft_filename` dynamically:: import os - lda_filename = os.getcwd().rpartition('/')[2] + dft_filename = os.getcwd().rpartition('/')[2] -This sets the `lda_filename` to the name of the current directory. The remainder of the script is identical to +This sets the `dft_filename` to the name of the current directory. The remainder of the script is identical to that for one-shot calculations. Only at the very end do we have to calculate the modified charge density, and store it in a format such that :program:`Wien2k` can read it. Therefore, after the DMFT loop that we saw in the previous section, we symmetrise the self energy, and recalculate the impurity Green function:: @@ -35,12 +35,12 @@ Now we calculate the modified charge density:: # find exact chemical potential SK.put_Sigma(Sigma_imp = [ S.Sigma ]) chemical_potential = SK.find_mu( precision = 0.000001 ) - dN, d = SK.calc_density_correction(filename = lda_filename+'.qdmft') + dN, d = SK.calc_density_correction(filename = dft_filename+'.qdmft') SK.save() First we find the chemical potential with high precision, and after that the routine ``SK.calc_density_correction(filename)`` calculates the density matrix including correlation effects. The result -is stored in the file `lda_filename.qdmft`, which is later read by the :program:`Wien2k` program. The last statement saves +is stored in the file `dft_filename.qdmft`, which is later read by the :program:`Wien2k` program. The last statement saves the chemical potential into the hdf5 archive. We need also the correlation energy, which we evaluate by the Migdal formula:: @@ -53,7 +53,7 @@ From this value, we substract the double counting energy:: and save this value too:: if (mpi.is_master_node()): - f=open(lda_filename+'.qdmft','a') + f=open(dft_filename+'.qdmft','a') f.write("%.16f\n"%correnerg) f.close() @@ -83,5 +83,5 @@ For practical purposes, you keep the number of DMFT loops within one DFT cycle l unstable convergence, you have to adjust the parameters such as `loops`, `mix`, or `Delta_mix` to improve the convergence. -In the next section, :ref:`LDADMFTtutorial`, we will see in a detailed +In the next section, :ref:`DFTDMFTtutorial`, we will see in a detailed example how such a self consistent calculation is performed. diff --git a/lda_dmft_cthyb.py b/lda_dmft_cthyb.py index 6fd78939..66dd5461 100644 --- a/lda_dmft_cthyb.py +++ b/lda_dmft_cthyb.py @@ -4,11 +4,11 @@ from pytriqs.operators import * from pytriqs.archive import HDFArchive from pytriqs.applications.impurity_solvers.cthyb import * from pytriqs.gf.local import * -from pytriqs.applications.dft.sumk_lda import * +from pytriqs.applications.dft.sumk_dft import * from pytriqs.applications.dft.converters.wien2k_converter import * from pytriqs.applications.dft.solver_multiband import * -lda_filename='Gd_fcc' +dft_filename='Gd_fcc' U = 9.6 J = 0.8 beta = 40 @@ -16,7 +16,7 @@ loops = 10 # Number of DMFT sc-loops sigma_mix = 1.0 # Mixing factor of Sigma after solution of the AIM delta_mix = 1.0 # Mixing factor of Delta as input for the AIM dc_type = 0 # DC type: 0 FLL, 1 Held, 2 AMF -use_blocks = True # use bloc structure from LDA input +use_blocks = True # use bloc structure from DFT input prec_mu = 0.0001 # Solver parameters @@ -29,14 +29,14 @@ p["length_cycle"] = 50 p["n_warmup_cycles"] = 50 p["n_cycles"] = 5000 -Converter = Wien2kConverter(filename=lda_filename, repacking=True) +Converter = Wien2kConverter(filename=dft_filename, repacking=True) Converter.convert_dmft_input() mpi.barrier() previous_runs = 0 previous_present = False if mpi.is_master_node(): - f = HDFArchive(lda_filename+'.h5','a') + f = HDFArchive(dft_filename+'.h5','a') if 'dmft_output' in f: ar = f['dmft_output'] if 'iterations' in ar: @@ -50,7 +50,7 @@ previous_present = mpi.bcast(previous_present) # if previous runs are present, no need for recalculating the bloc structure: calc_blocs = use_blocks and (not previous_present) -SK=SumkLDA(hdf_file=lda_filename+'.h5',use_lda_blocks=calc_blocs) +SK=SumkDFT(hdf_file=dft_filename+'.h5',use_dft_blocks=calc_blocs) n_orb = SK.corr_shells[0][3] l = SK.corr_shells[0][2] @@ -68,7 +68,7 @@ S = Solver(beta=beta, gf_struct=gf_struct) if (previous_present): if (mpi.is_master_node()): - S.Sigma_iw << HDFArchive(lda_filename+'.h5','a')['dmft_output']['Sigma_iw'] + S.Sigma_iw << HDFArchive(dft_filename+'.h5','a')['dmft_output']['Sigma_iw'] S.Sigma_iw = mpi.bcast(S.Sigma_iw) for iteration_number in range(1,loops+1): @@ -90,7 +90,7 @@ 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(lda_filename+'.h5','a')['dmft_output'] + ar = HDFArchive(dft_filename+'.h5','a')['dmft_output'] 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'] @@ -111,7 +111,7 @@ 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(lda_filename+'.h5','a')['dmft_output'] + ar = HDFArchive(dft_filename+'.h5','a')['dmft_output'] 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'] @@ -121,7 +121,7 @@ for iteration_number in range(1,loops+1): # Write the final Sigma and G to the hdf5 archive: if (mpi.is_master_node()): - ar = HDFArchive(lda_filename+'.h5','a') + ar = HDFArchive(dft_filename+'.h5','a') ar['iterations'] = previous_runs + iteration_number ar['Sigma_iw'] = S.Sigma_iw ar['G_iw'] = S.G_iw @@ -135,6 +135,6 @@ for iteration_number in range(1,loops+1): SK.save() if mpi.is_master_node(): - ar = HDFArchive("ldadmft.h5",'w') + ar = HDFArchive("dftdmft.h5",'w') ar["G_iw"] = S.G_iw ar["Sigma_iw"] = S.Sigma_iw diff --git a/python/TODOFIX b/python/TODOFIX index 8379fd7f..3f57fa05 100644 --- a/python/TODOFIX +++ b/python/TODOFIX @@ -1,4 +1,4 @@ -* remove inequiv_shells from sumk_lda, modify update_archive scripts +* remove inequiv_shells from sumk_dft, modify update_archive scripts ========================== Substitutions: @@ -30,9 +30,9 @@ SymmCorr -> dft_symmcorr_input SumK_LDA_ParProj -> dft_parproj_input SymmPar -> dft_symmpar_input -def __init__(self, filename, lda_subgrp = 'SumK_LDA', symm_subgrp = 'SymmCorr', repacking = False): +def __init__(self, filename, dft_subgrp = 'SumK_LDA', symm_subgrp = 'SymmCorr', repacking = False): --> -def __init__(self, filename, lda_subgrp = 'dft_input', symm_subgrp = 'dft_symm_input', repacking = False): +def __init__(self, filename, dft_subgrp = 'dft_input', symm_subgrp = 'dft_symm_input', repacking = False): declare all groupnames in init diff --git a/python/__init__.py b/python/__init__.py index afe27e12..cc71fe66 100644 --- a/python/__init__.py +++ b/python/__init__.py @@ -20,13 +20,13 @@ # ################################################################################ -from sumk_lda import SumkLDA +from sumk_dft import SumkDFT from symmetry import Symmetry -from sumk_lda_tools import SumkLDATools +from sumk_dft_tools import SumkDFTTools from U_matrix import * from converters import * -__all__=['SumkLDA','Symmetry','SumkLDATools','Wien2kConverter','HkConverter', +__all__=['SumkDFT','Symmetry','SumkDFTTools','Wien2kConverter','HkConverter', 'U_J_to_radial_integrals', 'U_matrix', 'U_matrix_kanamori', 'angular_matrix_element', 'clebsch_gordan', 'cubic_names', 'eg_submatrix', 'reduce_4index_to_2index', 'spherical_to_cubic', 't2g_submatrix', diff --git a/python/build_sigma_from_txt.py b/python/build_sigma_from_txt.py index e7e67df1..1f8ab975 100644 --- a/python/build_sigma_from_txt.py +++ b/python/build_sigma_from_txt.py @@ -28,7 +28,7 @@ sk = R.next() except StopIteration : # a more explicit error if the file is corrupted. - raise "SumkLDA.read_Sigma_ME : reading mesh failed!" + raise "SumkDFT.read_Sigma_ME : reading mesh failed!" R.close() # check whether the mesh is uniform @@ -58,7 +58,7 @@ isig = R.next() g.data[iom,iL,iR]=rsig+1j*isig except StopIteration : # a more explicit error if the file is corrupted. - raise "SumkLDA.read_Sigma_ME : reading Sigma from file failed!" + raise "SumkDFT.read_Sigma_ME : reading Sigma from file failed!" R.close() diff --git a/python/clear_h5_output.py b/python/clear_h5_output.py index b0b22105..17eb0ccb 100644 --- a/python/clear_h5_output.py +++ b/python/clear_h5_output.py @@ -7,13 +7,13 @@ if len(sys.argv) < 2: sys.exit() print """ -This script is to remove any SumkLDA generated output from the h5 archive +This script is to remove any SumkDFT generated output from the h5 archive and to restore it to the original post-converter state. """ filename = sys.argv[1] A = h5py.File(filename) -for group in ['lda_output','dmft_output']: +for group in ['dft_output','dmft_output']: if group in A: del(A[group]) A.close() diff --git a/python/converters/hk_converter.py b/python/converters/hk_converter.py index 79b50394..f3ad3ca9 100644 --- a/python/converters/hk_converter.py +++ b/python/converters/hk_converter.py @@ -29,18 +29,18 @@ from converter_tools import * class HkConverter(ConverterTools): """ - Conversion from general H(k) file to an hdf5 file that can be used as input for the SumK_LDA class. + Conversion from general H(k) file to an hdf5 file that can be used as input for the SumKDFT class. """ - def __init__(self, hk_file, hdf_file, lda_subgrp = 'lda_input', symmcorr_subgrp = 'lda_symmcorr_input', repacking = False): + def __init__(self, hk_file, hdf_file, dft_subgrp = 'dft_input', symmcorr_subgrp = 'dft_symmcorr_input', repacking = False): """ Init of the class. """ assert type(hk_file)==StringType,"hk_file must be a filename" self.hdf_file = hdf_file - self.lda_file = hk_file - self.lda_subgrp = lda_subgrp + self.dft_file = hk_file + self.dft_subgrp = dft_subgrp self.symmcorr_subgrp = symmcorr_subgrp self.fortran_to_replace = {'D':'E', '(':' ', ')':' ', ',':' '} @@ -57,10 +57,10 @@ class HkConverter(ConverterTools): # Read and write only on the master node if not (mpi.is_master_node()): return - mpi.report("Reading input from %s..."%self.lda_file) + mpi.report("Reading input from %s..."%self.dft_file) # R is a generator : each R.Next() will return the next number in the file - R = ConverterTools.read_fortran_file(self,self.lda_file,self.fortran_to_replace) + R = ConverterTools.read_fortran_file(self,self.dft_file,self.fortran_to_replace) try: energy_unit = 1.0 # the energy conversion factor is 1.0, we assume eV in files n_k = int(R.next()) # read the number of k points @@ -188,16 +188,16 @@ class HkConverter(ConverterTools): things_to_set = ['n_shells','shells','n_corr_shells','corr_shells','n_spin_blocs','n_orbitals','n_k','SO','SP','energy_unit'] for it in things_to_set: setattr(self,it,locals()[it]) except StopIteration : # a more explicit error if the file is corrupted. - raise "HK Converter : reading file lda_file failed!" + raise "HK Converter : reading file dft_file failed!" R.close() # Save to the HDF5: ar = HDFArchive(self.hdf_file,'a') - if not (self.lda_subgrp in ar): ar.create_group(self.lda_subgrp) + if not (self.dft_subgrp in ar): ar.create_group(self.dft_subgrp) things_to_save = ['energy_unit','n_k','k_dep_projection','SP','SO','charge_below','density_required', 'symm_op','n_shells','shells','n_corr_shells','corr_shells','use_rotations','rot_mat', 'rot_mat_time_inv','n_reps','dim_reps','T','n_orbitals','proj_mat','bz_weights','hopping', 'n_inequiv_shells', 'corr_to_inequiv', 'inequiv_to_corr'] - for it in things_to_save: ar[self.lda_subgrp][it] = locals()[it] + for it in things_to_save: ar[self.dft_subgrp][it] = locals()[it] del ar diff --git a/python/converters/wien2k_converter.py b/python/converters/wien2k_converter.py index a15d1a2f..5ce36ecf 100644 --- a/python/converters/wien2k_converter.py +++ b/python/converters/wien2k_converter.py @@ -28,24 +28,24 @@ from converter_tools import * class Wien2kConverter(ConverterTools): """ - Conversion from Wien2k output to an hdf5 file that can be used as input for the SumkLDA class. + Conversion from Wien2k output to an hdf5 file that can be used as input for the SumkDFT class. """ - def __init__(self, filename, lda_subgrp = 'lda_input', symmcorr_subgrp = 'lda_symmcorr_input', - parproj_subgrp='lda_parproj_input', symmpar_subgrp='lda_symmpar_input', - bands_subgrp = 'lda_bands_input', repacking = False): + def __init__(self, filename, dft_subgrp = 'dft_input', symmcorr_subgrp = 'dft_symmcorr_input', + parproj_subgrp='dft_parproj_input', symmpar_subgrp='dft_symmpar_input', + bands_subgrp = 'dft_bands_input', repacking = False): """ Init of the class. Variable filename gives the root of all filenames, e.g. case.ctqmcout, case.h5, and so on. """ - assert type(filename)==StringType, "Please provide the LDA files' base name as a string." + assert type(filename)==StringType, "Please provide the DFT files' base name as a string." self.hdf_file = filename+'.h5' - self.lda_file = filename+'.ctqmcout' + self.dft_file = filename+'.ctqmcout' self.symmcorr_file = filename+'.symqmc' self.parproj_file = filename+'.parproj' self.symmpar_file = filename+'.sympar' self.band_file = filename+'.outband' - self.lda_subgrp = lda_subgrp + self.dft_subgrp = dft_subgrp self.symmcorr_subgrp = symmcorr_subgrp self.parproj_subgrp = parproj_subgrp self.symmpar_subgrp = symmpar_subgrp @@ -66,10 +66,10 @@ class Wien2kConverter(ConverterTools): # Read and write only on the master node if not (mpi.is_master_node()): return - mpi.report("Reading input from %s..."%self.lda_file) + mpi.report("Reading input from %s..."%self.dft_file) # R is a generator : each R.Next() will return the next number in the file - R = ConverterTools.read_fortran_file(self,self.lda_file,self.fortran_to_replace) + R = ConverterTools.read_fortran_file(self,self.dft_file,self.fortran_to_replace) try: energy_unit = R.next() # read the energy convertion factor n_k = int(R.next()) # read the number of k points @@ -182,20 +182,20 @@ class Wien2kConverter(ConverterTools): things_to_set = ['n_shells','shells','n_corr_shells','corr_shells','n_spin_blocs','n_orbitals','n_k','SO','SP','energy_unit'] for it in things_to_set: setattr(self,it,locals()[it]) except StopIteration : # a more explicit error if the file is corrupted. - raise "Wien2k_converter : reading file lda_file failed!" + raise "Wien2k_converter : reading file %s failed!"%filename R.close() # Reading done! # Save it to the HDF: ar = HDFArchive(self.hdf_file,'a') - if not (self.lda_subgrp in ar): ar.create_group(self.lda_subgrp) + if not (self.dft_subgrp in ar): ar.create_group(self.dft_subgrp) # The subgroup containing the data. If it does not exist, it is created. If it exists, the data is overwritten! things_to_save = ['energy_unit','n_k','k_dep_projection','SP','SO','charge_below','density_required', 'symm_op','n_shells','shells','n_corr_shells','corr_shells','use_rotations','rot_mat', 'rot_mat_time_inv','n_reps','dim_reps','T','n_orbitals','proj_mat','bz_weights','hopping', 'n_inequiv_shells', 'corr_to_inequiv', 'inequiv_to_corr'] - for it in things_to_save: ar[self.lda_subgrp][it] = locals()[it] + for it in things_to_save: ar[self.dft_subgrp][it] = locals()[it] del ar # Symmetries are used, so now convert symmetry information for *correlated* orbitals: diff --git a/python/lattice_gf.py b/python/lattice_gf.py index dc0b998e..9060fd7f 100644 --- a/python/lattice_gf.py +++ b/python/lattice_gf.py @@ -1,5 +1,5 @@ def lattice_gf(self, ik, mu, iw_or_w="iw", beta=40, broadening, mesh=None, with_Sigma=True, with_dc=True): - """Calculates the lattice Green function from the LDA hopping and the self energy at k-point number ik + """Calculates the lattice Green function from the DFT hopping and the self energy at k-point number ik and chemical potential mu.""" ntoi = self.spin_names_to_ind[self.SO] diff --git a/python/sumk_lda.py b/python/sumk_dft.py similarity index 98% rename from python/sumk_lda.py rename to python/sumk_dft.py index fb8965bd..92fff5f8 100644 --- a/python/sumk_lda.py +++ b/python/sumk_dft.py @@ -28,13 +28,13 @@ import pytriqs.utility.mpi as mpi from pytriqs.archive import * from symmetry import * -class SumkLDA: +class SumkDFT: """This class provides a general SumK method for combining ab-initio code and pytriqs.""" - def __init__(self, hdf_file, mu = 0.0, h_field = 0.0, use_lda_blocks = False, - lda_data = 'lda_input', symmcorr_data = 'lda_symmcorr_input', parproj_data = 'lda_parproj_input', - symmpar_data = 'lda_symmpar_input', bands_data = 'lda_bands_input', lda_output = 'lda_output'): + def __init__(self, hdf_file, mu = 0.0, h_field = 0.0, use_dft_blocks = False, + dft_data = 'dft_input', symmcorr_data = 'dft_symmcorr_input', parproj_data = 'dft_parproj_input', + symmpar_data = 'dft_symmpar_input', bands_data = 'dft_bands_input', dft_output = 'dft_output'): """ Initialises the class from data previously stored into an HDF5 """ @@ -43,12 +43,12 @@ class SumkLDA: mpi.report("Give a string for the HDF5 filename to read the input!") else: self.hdf_file = hdf_file - self.lda_data = lda_data + self.dft_data = dft_data self.symmcorr_data = symmcorr_data self.parproj_data = parproj_data self.symmpar_data = symmpar_data self.bands_data = bands_data - self.lda_output = lda_output + self.dft_output = dft_output self.G_upfold = None self.h_field = h_field @@ -57,7 +57,7 @@ class SumkLDA: 'symm_op','n_shells','shells','n_corr_shells','corr_shells','use_rotations','rot_mat', 'rot_mat_time_inv','n_reps','dim_reps','T','n_orbitals','proj_mat','bz_weights','hopping', 'n_inequiv_shells', 'corr_to_inequiv', 'inequiv_to_corr'] - self.subgroup_present, self.value_read = self.read_input_from_hdf(subgrp = self.lda_data, things_to_read = things_to_read) + self.subgroup_present, self.value_read = self.read_input_from_hdf(subgrp = self.dft_data, things_to_read = things_to_read) if self.SO and (abs(self.h_field) > 0.000001): self.h_field = 0.0 @@ -79,7 +79,7 @@ class SumkLDA: #----- # If these quantities are not in HDF, set them up optional_things = ['gf_struct_solver','sumk_to_solver','solver_to_sumk','solver_to_sumk_block','chemical_potential','dc_imp','dc_energ','deg_shells'] - self.subgroup_present, self.value_read = self.read_input_from_hdf(subgrp = self.lda_output, things_to_read = [], + self.subgroup_present, self.value_read = self.read_input_from_hdf(subgrp = self.dft_output, things_to_read = [], optional_things = optional_things) if (not self.subgroup_present) or (not self.value_read['gf_struct_solver']): # No gf_struct was stored in HDF, so first set a standard one: @@ -112,7 +112,7 @@ class SumkLDA: self.symmcorr = Symmetry(hdf_file,subgroup=self.symmcorr_data) # Analyse the block structure and determine the smallest blocks, if desired - if use_lda_blocks: dm = self.analyse_block_structure() + if use_dft_blocks: dm = self.analyse_block_structure() # Now save new things to HDF5: # FIXME WHAT HAPPENS TO h_field? INPUT TO __INIT__? ADD TO OPTIONAL_THINGS? @@ -175,10 +175,10 @@ class SumkLDA: if not (mpi.is_master_node()): return # do nothing on nodes ar = HDFArchive(self.hdf_file,'a') - if not self.lda_output in ar: ar.create_group(self.lda_output) + if not self.dft_output in ar: ar.create_group(self.dft_output) for it in things_to_save: try: - ar[self.lda_output][it] = getattr(self,it) + ar[self.dft_output][it] = getattr(self,it) except: mpi.report("%s not found, and so not stored."%it) del ar @@ -243,7 +243,7 @@ class SumkLDA: def lattice_gf_matsubara(self,ik,mu,beta=40,with_Sigma=True): - """Calculates the lattice Green function from the LDA hopping and the self energy at k-point number ik + """Calculates the lattice Green function from the DFT hopping and the self energy at k-point number ik and chemical potential mu.""" ntoi = self.spin_names_to_ind[self.SO] @@ -617,9 +617,9 @@ class SumkLDA: def set_dc(self,dens_mat,U_interact,J_hund,orb=0,use_dc_formula=0,use_val=None): """Sets the double counting term for inequiv orbital orb: - use_dc_formula = 0: LDA+U FLL double counting, + use_dc_formula = 0: fully-localised limit (FLL), use_dc_formula = 1: Held's formula, - use_dc_formula = 2: AMF. + use_dc_formula = 2: around mean-field (AMF). Be sure that you are using the correct interaction Hamiltonian!""" for icrsh in range(self.n_corr_shells): diff --git a/python/sumk_lda_tools.py b/python/sumk_dft_tools.py similarity index 97% rename from python/sumk_lda_tools.py rename to python/sumk_dft_tools.py index 0816c2ea..d9cfaafa 100644 --- a/python/sumk_lda_tools.py +++ b/python/sumk_dft_tools.py @@ -26,18 +26,18 @@ import pytriqs.utility.dichotomy as dichotomy from pytriqs.gf.local import * import pytriqs.utility.mpi as mpi from symmetry import * -from sumk_lda import SumkLDA +from sumk_dft import SumkDFT -class SumkLDATools(SumkLDA): - """Extends the SumkLDA class with some tools for analysing the data.""" +class SumkDFTTools(SumkDFT): + """Extends the SumkDFT class with some tools for analysing the data.""" - def __init__(self, hdf_file, mu = 0.0, h_field = 0.0, use_lda_blocks = False, lda_data = 'lda_input', symmcorr_data = 'lda_symmcorr_input', - parproj_data = 'lda_parproj_input', symmpar_data = 'lda_symmpar_input', bands_data = 'lda_bands_input'): + def __init__(self, hdf_file, mu = 0.0, h_field = 0.0, use_dft_blocks = False, dft_data = 'dft_input', symmcorr_data = 'dft_symmcorr_input', + parproj_data = 'dft_parproj_input', symmpar_data = 'dft_symmpar_input', bands_data = 'dft_bands_input'): self.G_upfold_refreq = None - SumkLDA.__init__(self, hdf_file=hdf_file, mu=mu, h_field=h_field, use_lda_blocks=use_lda_blocks, - lda_data=lda_data, symmcorr_data=symmcorr_data, parproj_data=parproj_data, + SumkDFT.__init__(self, hdf_file=hdf_file, mu=mu, h_field=h_field, use_dft_blocks=use_dft_blocks, + dft_data=dft_data, symmcorr_data=symmcorr_data, parproj_data=parproj_data, symmpar_data=symmpar_data, bands_data=bands_data) diff --git a/python/trans_basis.py b/python/trans_basis.py index 8ae547fa..f81f4085 100644 --- a/python/trans_basis.py +++ b/python/trans_basis.py @@ -1,4 +1,4 @@ -from pytriqs.applications.dft.sumk_lda import * +from pytriqs.applications.dft.sumk_dft import * from pytriqs.applications.dft.converters import Wien2kConverter from pytriqs.gf.local.block_gf import BlockGf from pytriqs.gf.local.gf_imfreq import GfImFreq @@ -23,7 +23,7 @@ class TransBasis: Converter.convert_dmft_input() del Converter - self.SK = SumkLDA(hdf_file=hdf_datafile+'.h5',use_lda_blocks=False) + self.SK = SumkDFT(hdf_file=hdf_datafile+'.h5',use_dft_blocks=False) else: self.SK = SK diff --git a/python/update_archive.py b/python/update_archive.py index f1eee728..4c068aa5 100644 --- a/python/update_archive.py +++ b/python/update_archive.py @@ -40,8 +40,8 @@ filename = sys.argv[1] A = h5py.File(filename) # Rename groups -old_to_new = {'SumK_LDA':'lda_input', 'SumK_LDA_ParProj':'lda_parproj_input', - 'SymmCorr':'lda_symmcorr_input', 'SymmPar':'lda_symmpar_input', 'SumK_LDA_Bands':'lda_bands_input'} +old_to_new = {'SumK_LDA':'dft_input', 'SumK_LDA_ParProj':'dft_parproj_input', + 'SymmCorr':'dft_symmcorr_input', 'SymmPar':'dft_symmpar_input', 'SumK_LDA_Bands':'dft_bands_input'} for old, new in old_to_new.iteritems(): if old not in A.keys(): continue @@ -49,27 +49,27 @@ for old, new in old_to_new.iteritems(): A.copy(old,new) del(A[old]) -# Move output items from lda_input to lda_output +# Move output items from dft_input to dft_output move_to_output = ['gf_struct_solver','map_inv','map', 'chemical_potential','dc_imp','dc_energ','deg_shells', 'h_field'] for obj in move_to_output: - if obj in A['lda_input'].keys(): - if not 'lda_output' in A: A.create_group('lda_output') - print "Moving %s to lda_output ..."%obj - A.copy('lda_input/'+obj,'lda_output/'+obj) - del(A['lda_input'][obj]) + if obj in A['dft_input'].keys(): + if not 'dft_output' in A: A.create_group('dft_output') + print "Moving %s to dft_output ..."%obj + A.copy('dft_input/'+obj,'dft_output/'+obj) + del(A['dft_input'][obj]) # Add shell equivalency quantities -B = A['lda_input'] -corr_shells = HDFArchive(filename,'r')['lda_input']['corr_shells'] +B = A['dft_input'] +corr_shells = HDFArchive(filename,'r')['dft_input']['corr_shells'] equiv_shell_info = det_shell_equivalence(corr_shells) B['n_inequiv_shells'] = equiv_shell_info[0] B['corr_to_inequiv'] = equiv_shell_info[1] B['inequiv_to_corr'] = equiv_shell_info[2] # Rename variables -groups = ['lda_symmcorr_input','lda_symmpar_input'] +groups = ['dft_symmcorr_input','dft_symmpar_input'] for group in groups: if group not in A.keys(): continue diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt index b7425494..d17d861e 100644 --- a/test/CMakeLists.txt +++ b/test/CMakeLists.txt @@ -4,7 +4,7 @@ find_package(TriqsTest) FILE(COPY SrVO3.h5 SrVO3.ctqmcout SrVO3.symqmc SrVO3.sympar SrVO3.parproj hk_convert_hamiltonian.hk DESTINATION ${CMAKE_CURRENT_BINARY_DIR}) triqs_add_test_hdf(wien2k_convert " -p 1.e-6" ) triqs_add_test_hdf(hk_convert " -p 1.e-6" ) -triqs_add_test_hdf(sumklda_basic " -d 1.e-6" ) +triqs_add_test_hdf(sumkdft_basic " -d 1.e-6" ) triqs_add_test_hdf(srvo3_Gloc " -d 1.e-6" ) triqs_add_test_hdf(U_mat " -d 1.e-6" ) diff --git a/test/SrVO3.h5 b/test/SrVO3.h5 index 1a1a0239..c141e14f 100644 Binary files a/test/SrVO3.h5 and b/test/SrVO3.h5 differ diff --git a/test/hk_convert.output.h5 b/test/hk_convert.output.h5 index 34aea040..dd5bd4e3 100644 Binary files a/test/hk_convert.output.h5 and b/test/hk_convert.output.h5 differ diff --git a/test/srvo3_Gloc.py b/test/srvo3_Gloc.py index 01c4f550..a257d570 100644 --- a/test/srvo3_Gloc.py +++ b/test/srvo3_Gloc.py @@ -20,7 +20,7 @@ ################################################################################ from pytriqs.archive import * -from pytriqs.applications.dft.sumk_lda import * +from pytriqs.applications.dft.sumk_dft import * from pytriqs.applications.dft.converters.wien2k_converter import * from pytriqs.applications.impurity_solvers.cthyb import * from pytriqs.operators.hamiltonians import set_operator_structure @@ -29,7 +29,7 @@ from pytriqs.operators.hamiltonians import set_operator_structure beta = 40 # Init the SumK class -SK=SumkLDA(hdf_file='SrVO3.h5',use_lda_blocks=True) +SK=SumkDFT(hdf_file='SrVO3.h5',use_dft_blocks=True) num_orbitals = SK.corr_shells[0][3] l = SK.corr_shells[0][2] diff --git a/test/sumklda_basic.output.h5 b/test/sumkdft_basic.output.h5 similarity index 100% rename from test/sumklda_basic.output.h5 rename to test/sumkdft_basic.output.h5 diff --git a/test/sumklda_basic.py b/test/sumkdft_basic.py similarity index 87% rename from test/sumklda_basic.py rename to test/sumkdft_basic.py index dba3e916..e71e7b43 100644 --- a/test/sumklda_basic.py +++ b/test/sumkdft_basic.py @@ -21,15 +21,15 @@ ################################################################################ from pytriqs.archive import * -from pytriqs.applications.dft.sumk_lda_tools import SumkLDATools +from pytriqs.applications.dft.sumk_dft_tools import SumkDFTTools -SK = SumkLDATools(hdf_file = 'SrVO3.h5') +SK = SumkDFTTools(hdf_file = 'SrVO3.h5') dm = SK.density_matrix(method = 'using_gf', beta = 40) dm_pc = SK.partial_charges(40) -ar = HDFArchive('sumklda_basic.output.h5','w') +ar = HDFArchive('sumkdft_basic.output.h5','w') ar['dm'] = dm ar['dm_pc'] = dm_pc del ar diff --git a/test/wien2k_convert.output.h5 b/test/wien2k_convert.output.h5 index 78237ce2..7d24e52a 100644 Binary files a/test/wien2k_convert.output.h5 and b/test/wien2k_convert.output.h5 differ