From dfa10dffdaedf3b268b95b63abd9d354cfc9a131 Mon Sep 17 00:00:00 2001 From: Manuel Date: Thu, 20 Sep 2018 00:32:33 -0400 Subject: [PATCH] [doc] Modifications and corrections * Adapt the AC parts to the new TRIQS/maxent package * Restructure the explaination on how to run the scripts * Corrections of many typos and pytriqs occurences. --- doc/basicnotions/dft_dmft.rst | 6 +- doc/basicnotions/first.rst | 23 ++-- doc/basicnotions/structure.rst | 43 ++++-- doc/changelog.rst | 2 +- doc/conf.py.in | 2 +- doc/faqs/faqs.rst | 7 + doc/guide/SrVO3.rst | 4 +- doc/guide/analysis.rst | 34 ++--- doc/guide/conversion.rst | 4 +- doc/guide/dftdmft_selfcons.rst | 44 +++--- doc/guide/dftdmft_singleshot.rst | 2 +- doc/guide/full_tutorial.rst | 216 ++++++++++++++++-------------- doc/guide/transport.rst | 16 +-- doc/index.rst | 6 +- doc/install.rst | 19 ++- doc/reference/block_structure.rst | 2 +- 16 files changed, 235 insertions(+), 195 deletions(-) diff --git a/doc/basicnotions/dft_dmft.rst b/doc/basicnotions/dft_dmft.rst index 6671d161..0185fd15 100644 --- a/doc/basicnotions/dft_dmft.rst +++ b/doc/basicnotions/dft_dmft.rst @@ -126,7 +126,7 @@ model. The DMFT self-consistency cycle can now be formulated as follows: #. Take :math:`G^0_{mn}(i\omega)` and the interaction Hamiltonian and - solve the impurity problem, to get the interacting Greens function + solve the impurity problem, to get the interacting Green function :math:`G_{mn}(i\omega)` and the self energy :math:`\Sigma_{mn}(i\omega)`. For the details of how to do this in practice, we refer to the documentation of one of the @@ -147,7 +147,7 @@ follows: G^{latt}_{\nu\nu'}(\mathbf{k},i\omega) = \frac{1}{i\omega+\mu -\varepsilon_{\nu\mathbf{k}}-\Sigma_{\nu\nu'}(\mathbf{k},i\omega)} -#. Calculate from that the local downfolded Greens function in orbital space: +#. Calculate from that the local downfolded Green function in orbital space: .. math:: G^{loc}_{mn}(i\omega) = \sum_{\mathbf{k}}\sum_{\nu\nu'}P_{m\nu}(\mathbf{k})G^{latt}_{\nu\nu'}(\mathbf{k},i\omega)P^*_{\nu' @@ -166,7 +166,7 @@ follows: This is the basic scheme for one-shot DFT+DMFT calculations. Of course, one has to make sure, that the chemical potential :math:`\mu` is set such that the electron density is correct. This can be achieved -by adjusting it for the lattice Greens function such that the electron +by adjusting it for the lattice Green function such that the electron count is fulfilled. Full charge self-consistency diff --git a/doc/basicnotions/first.rst b/doc/basicnotions/first.rst index c06771f1..878b2755 100644 --- a/doc/basicnotions/first.rst +++ b/doc/basicnotions/first.rst @@ -59,14 +59,19 @@ hybridization-expansion solver. In general, those tutorials will take at least a Afterwards you can continue with the :ref:`DFTTools user guide `. +.. _ac: -Maximum Entropy (MaxEnt) ------------------------- +Analytic Continuation +--------------------- -Analytic continuation is needed for many :ref:`post-processing tools `, e.g. to -calculate the spectral function, the correlated band structure (:math:`A(k,\omega)`) -and to perform :ref:`transport calculations `. -You can use the Pade approximation available in the :ref:`TRIQS ` library, however, -it turns out to be very unstable for noisy numerical data. Most of the time, the MaxEnt method -is used to obtain data on the real-frequency axis. At the moment neither :ref:`TRIQS ` nor -:program:`DFTTools` provide such routines. +Often impurity solvers working on the Matsubra axis are used within the +DFT+DMFT framework. However, many :ref:`post-processing tools `, +require a self energy on the real-frequency axis, e.g. to calculate the spectral +function :math:`A(k,\omega)` or to perform :ref:`transport calculations `. +The ill-posed nature of the analytic continuation has lead to a plethora of methods, +and conversely, computer codes. :program:`DFTTools` itself does not provide functions to perform analytic +continuations. Within the TRIQS environment the following options are available: + +* Pade: Implemented in the :ref:`TRIQS` library +* Stochastic Optimization Method (Mishchenko): `SOM `_ package by Igor Krivenko +* Maximum Entropy Method: `TRIQS/maxent `_ package diff --git a/doc/basicnotions/structure.rst b/doc/basicnotions/structure.rst index 26660747..05103ea7 100644 --- a/doc/basicnotions/structure.rst +++ b/doc/basicnotions/structure.rst @@ -66,7 +66,7 @@ perform the multi-band DMFT calculation in the context of real materials. The major part is contained in the module :class:`SumkDFT`. It contains routines to -* calculate local Greens functions +* calculate local Green functions * do the upfolding and downfolding from Bloch bands to Wannier orbitals * calculate the double-counting correction @@ -91,12 +91,12 @@ self-consistent one is only a couple of additional lines in the code! Post-processing --------------- -The main result of DMFT calculation is the interacting Greens function -and the Self energy. However, one is normally interested in +The main result of DMFT calculation is the interacting Green function +and the self energy. However, one is normally interested in quantities like band structure, density of states, or transport -properties. In order to calculate these things, :program:`DFTTools` -provides the post-processing modules :class:`SumkDFTTools`. It -contains routines to calculate +properties. In order to calculate these, :program:`DFTTools` +provides the post-processing modules :class:`SumkDFTTools`. +It contains routines to calculate * (projected) density of states * partial charges @@ -104,9 +104,28 @@ contains routines to calculate * transport properties such as optical conductivity, resistivity, or thermopower. -.. warning:: - At the moment neither :ref:`TRIQS` nor :program:`DFTTools` - provides Maximum Entropy routines! You can use the Pade - approximation implemented in the :ref:`TRIQS ` library, or you use your own - home-made Maximum Entropy code to do the analytic continuation from - Matsubara to the real-frequency axis. +Note that most of these post-processing tools need a real-frequency +self energy, and should you be using a CT-QMC impurity solver this +comes with the necessity of performing an :ref:`analytic continuation`. + +.. _runpy: + +Executing your python scripts +----------------------------- + +After having prepared your own python script you may run +it on one core with + + `python MyScript.py` + +or in parallel mode + + `mpirun -np 64 python MyScript.py` + +where :program:`mpirun` launches the calculation in parallel mode on 64 cores. +The exact form of this command will, of course, depend on the +mpi-launcher installed, but the form above works on most systems. + +How to run full charge self-consistent DFT+DMFT calculations (in combination with Wien2k) +is described in the :ref:`full charge self-consistency tutorial` and +the :ref:`Ce tutorial`, as such calculations need to be launched in a different way. diff --git a/doc/changelog.rst b/doc/changelog.rst index d86f11e5..b1e75038 100644 --- a/doc/changelog.rst +++ b/doc/changelog.rst @@ -3,6 +3,6 @@ Changelog ========= -This document describes the main changes in DftTools. +This document describes the main changes in DFTTools. .. include:: ChangeLog.md diff --git a/doc/conf.py.in b/doc/conf.py.in index 28bd6796..482b845f 100644 --- a/doc/conf.py.in +++ b/doc/conf.py.in @@ -36,6 +36,6 @@ html_context = {'header_title': 'dft tools', html_static_path = ['@CMAKE_SOURCE_DIR@/doc/_static'] html_sidebars = {'index': ['sideb.html', 'searchbox.html']} -htmlhelp_basename = 'TRIQSDftToolsdoc' +htmlhelp_basename = 'TRIQSDFTToolsdoc' intersphinx_mapping = {'python': ('http://docs.python.org/2.7', None), 'triqslibs': ('http://triqs.github.io/triqs/master', None), 'triqscthyb': ('https://triqs.github.io/cthyb/master', None)} diff --git a/doc/faqs/faqs.rst b/doc/faqs/faqs.rst index ffe3b2fc..ac8cc163 100644 --- a/doc/faqs/faqs.rst +++ b/doc/faqs/faqs.rst @@ -27,3 +27,10 @@ x optic does not write a case.pmat file Make sure that you set line 6 to "ON" and put a "1" to the following line. The "1" is undocumented in Wien2k, but needed to have `case.pmat` written. However, we are working on reading directly the `case.mommat2` file. + +How do I get real-frequency quantities? +--------------------------------------- + +:program:`DFTTools` does not provide functions to perform analytic +continuations. However, within the TRIQS environment there are +different :ref:`tools` available. diff --git a/doc/guide/SrVO3.rst b/doc/guide/SrVO3.rst index 30afb7b9..64adb23b 100644 --- a/doc/guide/SrVO3.rst +++ b/doc/guide/SrVO3.rst @@ -16,7 +16,7 @@ using Kanamori definitions (:download:`dft_dmft_cthyb.py `) and one with a rotational-invariant Slater interaction Hamiltonian (:download:`dft_dmft_cthyb_slater.py `). The user has to adapt these -scripts to his own needs. +scripts to his own needs. How to execute your script is described :ref:`here`. Loading modules --------------- @@ -28,6 +28,7 @@ First, we load the necessary modules:: from pytriqs.archive import HDFArchive from pytriqs.operators.util import * from triqs_cthyb import * + import pytriqs.utility.mpi as mpi The last two lines load the modules for the construction of the :ref:`CTHYB solver `. @@ -196,7 +197,6 @@ self energy shown below. :width: 700 :align: center - .. _tailfit: Tail fit parameters diff --git a/doc/guide/analysis.rst b/doc/guide/analysis.rst index 7563e287..004d22aa 100644 --- a/doc/guide/analysis.rst +++ b/doc/guide/analysis.rst @@ -8,17 +8,17 @@ This section explains how to use some tools of the package in order to analyse t There are two practical tools for which a self energy on the real axis is not needed, namely: * :meth:`dos_wannier_basis ` for the density of states of the Wannier orbitals and - * :meth:`partial_charges ` for the partial charges according to the :program:`Wien2k` definition. + * :meth:`partial_charges ` for the partial charges according to the Wien2k definition. -However, a real frequency self energy has to be provided by the user for the methods: +However, a real-frequency self energy has to be provided by the user for the methods: * :meth:`dos_parproj_basis ` for the momentum-integrated spectral function including self energy effects and * :meth:`spaghettis ` for the momentum-resolved spectral function (i.e. ARPES) -.. warning:: - This package does NOT provide an explicit method to do an **analytic continuation** of the - self energies and Green functions from Matsubara frequencies to the real frequency axis! - There are methods included e.g. in the :program:`ALPS` package, which can be used for these purposes. +.. note:: + This package does NOT provide an explicit method to do an **analytic continuation** of + self energies and Green functions from Matsubara frequencies to the real-frequency axis, + but a list of options available within the TRIQS framework is given :ref:`here `. Keep in mind that all these methods have to be used very carefully! Initialisation @@ -36,16 +36,16 @@ class:: Note that all routines available in :class:`SumkDFT ` are also available here. -If required, we have to load and initialise the real frequency self energy. Most conveniently, -you have your self energy already stored as a real frequency :class:`BlockGf ` object +If required, we have to load and initialise the real-frequency self energy. Most conveniently, +you have your self energy already stored as a real-frequency :class:`BlockGf ` object in a hdf5 file:: ar = HDFArchive('case.h5', 'a') SigmaReFreq = ar['dmft_output']['Sigma_w'] You may also have your self energy stored in text files. For this case the :ref:`TRIQS ` library offers -the function :meth:`read_gf_from_txt`, which is able to load the data from text files of one Greens function block -into a real frequency :class:`ReFreqGf ` object. Loading each block separately and +the function :meth:`read_gf_from_txt`, which is able to load the data from text files of one Green function block +into a real-frequency :class:`ReFreqGf ` object. Loading each block separately and building up a :class:´BlockGf ´ is done with:: from pytriqs.gf.tools import * @@ -61,7 +61,7 @@ where: * `block_txtfiles` is a rank 2 square np.array(str) or list[list[str]] holding the file names of one block and * `block_name` is the name of the block. -It is important that each data file has to contain three columns: the real frequency mesh, the real part and the imaginary part +It is important that each data file has to contain three columns: the real-frequency mesh, the real part and the imaginary part of the self energy - exactly in this order! The mesh should be the same for all files read in and non-uniform meshes are not supported. Finally, we set the self energy into the `SK` object:: @@ -101,18 +101,18 @@ otherwise, the output is returned by the function for a further usage in :progra Partial charges --------------- -Since we can calculate the partial charges directly from the Matsubara Green's functions, we also do not need a -real frequency self energy for this purpose. The calculation is done by:: +Since we can calculate the partial charges directly from the Matsubara Green functions, we also do not need a +real-frequency self energy for this purpose. The calculation is done by:: SK.set_Sigma(SigmaImFreq) dm = SK.partial_charges(beta=40.0, with_Sigma=True, with_dc=True) which calculates the partial charges using the self energy, double counting, and chemical potential as set in the `SK` object. On return, `dm` is a list, where the list items correspond to the density matrices of all shells -defined in the list `SK.shells`. This list is constructed by the :program:`Wien2k` converter routines and stored automatically +defined in the list `SK.shells`. This list is constructed by the Wien2k converter routines and stored automatically in the hdf5 archive. For the structure of `dm`, see also :meth:`reference manual `. -Correlated spectral function (with real frequency self energy) +Correlated spectral function (with real-frequency self energy) -------------------------------------------------------------- To produce both the momentum-integrated (total density of states or DOS) and orbitally-resolved (partial/projected DOS) spectral functions @@ -124,7 +124,7 @@ The variable `broadening` is an additional Lorentzian broadening (default: `0.01 The output is written in the same way as described above for the :ref:`Wannier density of states `, but with filenames `DOS_parproj_*` instead. -Momentum resolved spectral function (with real frequency self energy) +Momentum resolved spectral function (with real-frequency self energy) --------------------------------------------------------------------- Another quantity of interest is the momentum-resolved spectral function, which can directly be compared to ARPES @@ -141,7 +141,7 @@ Here, optional parameters are * `plotrange`: A list with two entries, :math:`\omega_{min}` and :math:`\omega_{max}`, which set the plot range for the output. The default value is `None`, in which case the full momentum range as given in the self energy is used. * `ishell`: An integer denoting the orbital index `ishell` onto which the spectral function is projected. The resulting function is saved in - the files. The default value is `None`. Note for experts: The spectra are not rotated to the local coordinate system used in :program:`Wien2k`. + the files. The default value is `None`. Note for experts: The spectra are not rotated to the local coordinate system used in Wien2k. The output is written as the 3-column files ``Akw(sp).dat``, where `(sp)` is defined as above. The output format is `k`, :math:`\omega`, `value`. diff --git a/doc/guide/conversion.rst b/doc/guide/conversion.rst index c9d2c5c4..40771090 100644 --- a/doc/guide/conversion.rst +++ b/doc/guide/conversion.rst @@ -112,7 +112,7 @@ use the python module :class:`Wien2kConverter `, some more files have to be converted to the hdf5 archive. For instance, for calculating the partial density of states or partial charges -consistent with the definition of :program:`Wien2k`, you have to invoke:: +consistent with the definition of Wien2k, you have to invoke:: Converter.convert_parproj_input() diff --git a/doc/guide/dftdmft_selfcons.rst b/doc/guide/dftdmft_selfcons.rst index 83572ed0..b7f22e7f 100644 --- a/doc/guide/dftdmft_selfcons.rst +++ b/doc/guide/dftdmft_selfcons.rst @@ -14,35 +14,34 @@ Wien2k + dmftproj .. warning:: - Before using this tool, you should be familiar with the band-structure package :program:`Wien2k`, since - the calculation is controlled by the :program:`Wien2k` scripts! Be + Before using this tool, you should be familiar with the band-structure package Wien2k, since + the calculation is controlled by the Wien2k scripts! Be sure that you also understand how :program:`dmftproj` is used to construct the Wannier functions. For this step, see either sections :ref:`conversion`, or the extensive :download:`dmftproj manual`. -In the following, we discuss how to use the -:ref:`TRIQS ` tools in combination with the :program:`Wien2k` program. +In the following, we discuss how to use the +:ref:`TRIQS ` tools in combination with the Wien2k program. We can use the DMFT script as introduced in section :ref:`singleshot`, -with just a few simple -modifications. First, in order to be compatible with the :program:`Wien2k` standards, the DMFT script has to be -named :file:`case.py`, where `case` is the place holder name of the :program:`Wien2k` calculation, see the section -:ref:`conversion` for details. We can then set the variable `dft_filename` dynamically:: +with just a few simple modifications. First, in order to be compatible with the Wien2k standards, +the DMFT script has to be named :file:`case.py`, where `case` is the place holder name of the Wien2k +calculation, see the section :ref:`conversion` for details. We can then set the variable `dft_filename` dynamically:: import os dft_filename = os.getcwd().rpartition('/')[2] This sets the `dft_filename` to the name of the current directory. The -remaining part of the script is identical to +remaining part of the script is identical to that for one-shot calculations. Only at the very end 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 +and store it in a format such that 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:: SK.symm_deg_gf(S.Sigma,orb=0) S.G_iw << inverse(S.G0_iw) - S.Sigma_iw S.G_iw.invert() -These steps are not necessary, but can help to reduce fluctuations in the total energy. +These steps are not necessary, but can help to reduce fluctuations in the total energy. Now we calculate the modified charge density:: # find exact chemical potential @@ -51,9 +50,9 @@ Now we calculate the modified charge density:: dN, d = SK.calc_density_correction(filename = dft_filename+'.qdmft') SK.save(['chemical_potential','dc_imp','dc_energ']) -First we find the chemical potential with high precision, and after that the routine +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 `dft_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 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:: @@ -79,17 +78,16 @@ The above steps are valid for a calculation with only one correlated atom in the where you will apply this method. That is the reason why we give the index `0` in the list `SK.dc_energ`. If you have more than one correlated atom in the unit cell, but all of them are equivalent atoms, you have to multiply the `correnerg` by their multiplicity before writing it to the file. -The multiplicity is easily found in the main input file of the :program:`Wien2k` package, i.e. `case.struct`. In case of +The multiplicity is easily found in the main input file of the Wien2k package, i.e. `case.struct`. In case of non-equivalent atoms, the correlation energy has to be calculated for all of them separately and summed up. -As mentioned above, the calculation is controlled by the :program:`Wien2k` scripts and not by :program:`python` -routines. You should think of replacing the lapw2 part of the -:program:`Wien2k` self-consistency cycle by +As mentioned above, the calculation is controlled by the Wien2k scripts and not by :program:`python` +routines. You should think of replacing the lapw2 part of the Wien2k self-consistency cycle by | `lapw2 -almd` | `dmftproj` - | `pytriqs case.py` + | `python case.py` | `lapw2 -qdmft` In other words, for the calculation of the density matrix in lapw2, we @@ -98,7 +96,7 @@ Therefore, at the command line, you start your calculation for instance by: `me@home $ run -qdmft 1 -i 10` -The flag `-qdmft` tells the :program:`Wien2k` script that the density +The flag `-qdmft` tells the Wien2k script that the density matrix including correlation effects is to be read in from the `case.qdmft` file, and that you want the code to run on one computing core only. Moreover, we ask for 10 self-consistency iterations are to be @@ -110,15 +108,15 @@ number of nodes to be used: In that case, you will run on 64 computing cores. As standard setting, we use `mpirun` as the proper MPI execution statement. If you happen to have a different, non-standard MPI setup, you have to give the -proper MPI execution statement, in the `run_lapw` script (see the -corresponding :program:`Wien2k` documentation). +proper MPI execution statement, in the `run_lapw` script (see the +corresponding Wien2k documentation). -In many cases it is advisable to start from a converged one-shot +In many cases it is advisable to start from a converged one-shot calculation. For practical purposes, you keep the number of DMFT loops within one DFT cycle low, or even to `loops=1`. If you encounter unstable convergence, you have to adjust the parameters such as the number of DMFT loops, or some mixing of the self energy to improve -the convergence. +the convergence. In the section :ref:`DFTDMFTtutorial` we will see in a detailed example how such a self-consistent calculation is performed from scratch. diff --git a/doc/guide/dftdmft_singleshot.rst b/doc/guide/dftdmft_singleshot.rst index 07408c7a..16d9e75e 100644 --- a/doc/guide/dftdmft_singleshot.rst +++ b/doc/guide/dftdmft_singleshot.rst @@ -78,7 +78,7 @@ for :emphasis:`use_dc_formula` are: * `1`: DC formula as given in K. Held, Adv. Phys. 56, 829 (2007). * `2`: Around-mean-field (AMF) -At the end of the calculation, we can save the Greens function and self energy into a file:: +At the end of the calculation, we can save the Green function and self energy into a file:: from pytriqs.archive import HDFArchive import pytriqs.utility.mpi as mpi diff --git a/doc/guide/full_tutorial.rst b/doc/guide/full_tutorial.rst index 15c8f6f3..5ee73992 100644 --- a/doc/guide/full_tutorial.rst +++ b/doc/guide/full_tutorial.rst @@ -3,169 +3,176 @@ DFT+DMFT tutorial: Ce with Hubbard-I approximation ================================================== -In this tutorial we will perform DFT+DMFT :program:`Wien2k` +In this tutorial we will perform DFT+DMFT Wien2k calculations from scratch, including all steps described in the previous sections. As example, we take the high-temperature :math:`\gamma`-phase of Ce employing the Hubbard-I approximation for -its localized *4f* shell. +its localized *4f* shell. Wien2k setup ------------ -First we create the Wien2k :file:`Ce-gamma.struct` file as described in the `Wien2k manual `_ +First we create the Wien2k :file:`Ce-gamma.struct` file as described in the +`Wien2k manual `_ for the :math:`\gamma`-Ce fcc structure with lattice parameter of 9.75 a.u. .. literalinclude:: images_scripts/Ce-gamma.struct -We initalize non-magnetic :program:`Wien2k` calculations using the :program:`init` script as described in the same manual. -For this example we specify 3000 :math:`\mathbf{k}`-points in the full Brillouin zone -and LDA exchange-correlation potential (*vxc=5*), other parameters are defaults. -The Ce *4f* electrons are treated as valence states. +We initalize non-magnetic Wien2k calculations using the :program:`init` script as +described in the same manual. For this example we specify 3000 :math:`\mathbf{k}`-points +in the full Brillouin zone and LDA exchange-correlation potential (*vxc=5*), other +parameters are defaults. The Ce *4f* electrons are treated as valence states. Hence, the initialization script is executed as follows :: - init -b -vxc 5 -numk 3000 + init -b -vxc 5 -numk 3000 -and then LDA calculations of non-magnetic :math:`\gamma`-Ce are performed by launching the :program:`Wien2k` :program:`run` script. -These self-consistent LDA calculations will typically take a couple of minutes. +and then LDA calculations of non-magnetic :math:`\gamma`-Ce are performed by launching +the Wien2k :program:`run` script. These self-consistent LDA calculations will typically +take a couple of minutes. Wannier orbitals: dmftproj -------------------------- -Then we create the :file:`Ce-gamma.indmftpr` file specifying parameters for construction of Wannier orbitals representing *4f* states: +Then we create the :file:`Ce-gamma.indmftpr` file specifying parameters for construction +of Wannier orbitals representing *4f* states: .. literalinclude:: images_scripts/Ce-gamma.indmftpr As we learned in the section :ref:`conversion`, the first three lines give the number of inequivalent sites, their multiplicity (to be in accordance with the *struct* file) and the maximum orbital quantum -number :math:`l_{max}`. -The following four lines describe the treatment of Ce *spdf* orbitals by the :program:`dmftproj` program:: +number :math:`l_{max}`. The following four lines describe the treatment of +Ce *spdf* orbitals by the :program:`dmftproj` program:: complex 1 1 1 2 ! l included for each sort 0 0 0 0 ! l included for each sort 0 -where `complex` is the choice for the angular basis to be used (spherical complex harmonics), in the next line we specify, for each orbital -quantum number, whether it is treated as correlated ('2') and, hence, the corresponding Wannier orbitals will be generated, or uncorrelated ('1'). -In the latter case the :program:`dmftproj` program will generate projectors to be used in calculations of corresponding partial densities of states (see below). -In the present case we choose the fourth (i. e. *f*) orbitals as correlated. -The next line specify the number of irreducible representations into which a given correlated shell should be split (or -'0' if no splitting is desired, as in the present case). The fourth line specifies whether the spin-orbit interaction should be switched on ('1') or off ('0', as in the present case). +where `complex` is the choice for the angular basis to be used (spherical complex harmonics), +in the next line we specify, for each orbital quantum number, whether it is treated as correlated ('2') +and, hence, the corresponding Wannier orbitals will be generated, or uncorrelated ('1'). In the latter +case the :program:`dmftproj` program will generate projectors to be used in calculations of +corresponding partial densities of states (see below). In the present case we choose the fourth +(i. e. *f*) orbitals as correlated. The next line specify the number of irreducible representations +into which a given correlated shell should be split (or '0' if no splitting is desired, as in the +present case). The fourth line specifies whether the spin-orbit interaction should be switched +on ('1') or off ('0', as in the present case). Finally, the last line of the file :: -.40 0.40 ! Energy window relative to E_f specifies the energy window for Wannier functions' construction. For a -more complete description of :program:`dmftproj` options see its -manual. +more complete description of :program:`dmftproj` options see its manual. To prepare input data for :program:`dmftproj` we execute lapw2 with the `-almd` option :: - - x lapw2 -almd -Then :program:`dmftproj` is executed in its default mode (i.e. without spin-polarization or spin-orbit included) :: + x lapw2 -almd - dmftproj +Then :program:`dmftproj` is executed in its default mode (i.e. without +spin-polarization or spin-orbit included) :: + + dmftproj 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 density recalculation in the case of fully self-consistent DFT+DMFT run (see below). + * :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 density recalculation in the case of a fully + self-consistent DFT+DMFT run (see below). -Now we have all necessary input from :program:`Wien2k` for running DMFT calculations. +Now we have all necessary input from Wien2k for running DMFT calculations. 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:`singleshot`), -however there are also some differences. First difference is that we import the Hubbard-I solver by:: +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:`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 -The Hubbard-I solver is very fast and we do not need to take into account the DFT block structure or use any approximation for the *U*-matrix. -We load and convert the :program:`dmftproj` output and initialize the -:class:`SumkDFT ` class as described in :ref:`conversion` and -:ref:`singleshot` and then set up the Hubbard-I solver :: - +The Hubbard-I solver is very fast and we do not need to take into account the DFT block structure +or use any approximation for the *U*-matrix. We load and convert the :program:`dmftproj` output +and initialize the :class:`SumkDFT ` class as described in :ref:`conversion` and +:ref:`singleshot` and then set up the Hubbard-I solver :: + S = Solver(beta = beta, l = l) -where the solver is initialized with the value of `beta`, and the orbital quantum number `l` (equal to 3 in our case). +where the solver is initialized with the value of `beta`, and the orbital quantum +number `l` (equal to 3 in our case). 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 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`. - * `Nmoments`: the number of moments used to describe high-frequency tails of the Hubbard-I Green's function and self-energy. By default `Nmoments = 5` + * `use_spin_orbit`: if set 'True' the solver is run with spin-orbit coupling included. + To perform actual DFT+DMFT calculations with spin-orbit one should also run Wien2k and + :program:`dmftproj` in spin-polarized mode and with spin-orbit included. By default, + `use_spin_orbit=False`. + * `Nmoments`: the number of moments used to describe high-frequency tails of the Hubbard-I + Green function and self energy. By default `Nmoments = 5` -The `Solver.solve(U_int, J_hund)` statement has two necessary parameters, the Hubbard U parameter `U_int` and Hund's rule coupling `J_hund`. Notice that the solver constructs the full 4-index `U`-matrix by default, and the `U_int` parameter is in fact the Slater `F0` integral. Other optional parameters are: +The `Solver.solve(U_int, J_hund)` statement has two necessary parameters, the Hubbard U +parameter `U_int` and Hund's rule coupling `J_hund`. Notice that the solver constructs the +full 4-index `U`-matrix by default, and the `U_int` parameter is in fact the Slater `F0` integral. +Other optional parameters are: - * `T`: matrix that transforms the interaction matrix from complex spherical harmonics to a symmetry adapted basis. By default, the complex spherical harmonics basis is used and `T=None`. - * `verbosity`: tunes output from the solver. If `verbosity=0` only basic information is printed, if `verbosity=1` the ground state atomic occupancy and its energy are printed, if `verbosity=2` additional information is printed for all occupancies that were diagonalized. By default, `verbosity=0`. + * `T`: matrix that transforms the interaction matrix from complex spherical harmonics to a symmetry + adapted basis. By default, the complex spherical harmonics basis is used and `T=None`. + * `verbosity`: tunes output from the solver. If `verbosity=0` only basic information is printed, + if `verbosity=1` the ground state atomic occupancy and its energy are printed, if `verbosity=2` + additional information is printed for all occupancies that were diagonalized. By default, `verbosity=0`. + * `Iteration_Number`: the iteration number of the DMFT loop. Used only for printing. By default `Iteration_Number=1` + * `Test_Convergence`: convergence criterion. Once the self energy is converged below `Test_Convergence` + the Hubbard-I solver is not called anymore. By default `Test_Convergence=0.0001`. - * `Iteration_Number`: the iteration number of the DMFT loop. Used only for printing. By default `Iteration_Number=1` - * `Test_Convergence`: convergence criterion. Once the self-energy is converged below `Test_Convergence` the Hubbard-I solver is not called anymore. By default `Test_Convergence=0.0001`. - -We need also to introduce some changes in the DMFT loop with respect that used for CT-QMC calculations in :ref:`singleshot`. -The hybridization function is neglected in the Hubbard-I approximation, and only non-interacting level -positions (:math:`\hat{\epsilon}=-\mu+\langle H^{ff} \rangle - \Sigma_{DC}`) are required. -Hence, instead of computing `S.G0` as in :ref:`singleshot` we set the level positions:: +We need also to introduce some changes in the DMFT loop with respect that used for CT-QMC calculations +in :ref:`singleshot`. The hybridization function is neglected in the Hubbard-I approximation, and only +non-interacting level positions (:math:`\hat{\epsilon}=-\mu+\langle H^{ff} \rangle - \Sigma_{DC}`) are +required. Hence, instead of computing `S.G0` as in :ref:`singleshot` we set the level positions:: # set atomic levels: eal = SK.eff_atomic_levels()[0] S.set_atomic_levels( eal = eal ) -The part after the solution of the impurity problem remains essentially the same: we mix the self-energy and local -Green's function and then save them in the hdf5 file . +The part after the solution of the impurity problem remains essentially the same: we mix the self energy and local +Green 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 +Finally, we compute the modified charge density and save it as well as correlation correction to the total energy in :file:`Ce-gamma.qdmft` file, which is then read by lapw2 in the case of self-consistent DFT+DMFT calculations. +You should try to run your script before setting up the fully charge self-consistent calculation +(see :ref:`this` page). -Running single-shot DFT+DMFT calculations ------------------------------------------- +Fully charge self-consistent DFT+DMFT calculation +------------------------------------------------- -After having prepared the script one may run one-shot DMFT calculations by -executing :ref:`Ce-gamma_script` with :program:`pytriqs` on a single processor: - - `pytriqs Ce-gamma.py` - -or in parallel mode: - - `mpirun -np 64 pytriqs Ce-gamma.py` - -where :program:`mpirun` launches these calculations in parallel mode and -enables MPI. The exact form of this command will, of course, depend on -mpi-launcher installed in your system, but the form above applies to -99% of the system setups. - - -Running self-consistent DFT+DMFT calculations ---------------------------------------------- - -Instead of doing a one-shot run one may also perform fully self-consistent -DFT+DMFT calculations, as we will do now. We launch these -calculations as follows : +Instead of doing only one-shot runs we perform in this tutorial a fully +self-consistent DFT+DMFT calculations. We launch such a calculations with `run -qdmft 1` -where `-qdmft` flag turns on DFT+DMFT calculations with -:program:`Wien2k`, and one computing core. We -use here the default convergence criterion in :program:`Wien2k` (convergence to -0.1 mRy in energy). +where `-qdmft` flag turns on DFT+DMFT calculations with Wien2k, +and one computing core. We use here the default convergence criterion +in Wien2k (convergence to 0.1 mRy in energy). After calculations are done we may check the value of correlation ('Hubbard') energy correction to the total energy:: - + >grep HUBBARD Ce-gamma.scf|tail -n 1 HUBBARD ENERGY(included in SUM OF EIGENVALUES): -0.012866 -In the case of Ce, with the correlated shell occupancy close to 1 the Hubbard energy is close to 0, while the DC correction to energy is about J/4 in accordance with the fully-localized-limit formula, hence, giving the total correction :math:`\Delta E_{HUB}=E_{HUB}-E_{DC} \approx -J/4`, which is in our case is equal to -0.175 eV :math:`\approx`-0.013 Ry. +In the case of Ce, with the correlated shell occupancy close to 1 the Hubbard energy is close to 0, while the +DC correction to energy is about J/4 in accordance with the fully-localized-limit formula, hence, giving the +total correction :math:`\Delta E_{HUB}=E_{HUB}-E_{DC} \approx -J/4`, which is in our case is equal +to -0.175 eV :math:`\approx`-0.013 Ry. The band ("kinetic") energy with DMFT correction is :: @@ -173,7 +180,7 @@ The band ("kinetic") energy with DMFT correction is :: KINETIC ENERGY with DMFT correction: -5.370632 One may also check the convergence in total energy:: - + >grep :ENE Ce-gamma.scf |tail -n 5 :ENE : ********** TOTAL ENERGY IN Ry = -17717.56318334 :ENE : ********** TOTAL ENERGY IN Ry = -17717.56342250 @@ -185,16 +192,15 @@ One may also check the convergence in total energy:: Post-processing and data analysis --------------------------------- -Within Hubbard-I one may also easily obtain the angle-resolved spectral function (band -structure) and integrated spectral function (density of states or DOS). In -difference with the CT-QMC approach one does not need to do an -analytic continuations to get the -real-frequency self-energy, as it can be calculated directly -in the Hubbard-I solver. +Within Hubbard-I one may also easily obtain the angle-resolved spectral function +(band structure) and integrated spectral function (density of states or DOS). +In difference with the CT-QMC approach one does not need to do an +analytic continuations to get the real-frequency self energy, as it can be +calculated directly in the Hubbard-I solver. The corresponding script :ref:`Ce-gamma_DOS_script` contains several new parameters :: - ommin=-4.0 # bottom of the energy range for DOS calculations + ommin=-4.0 # bottom of the energy range for DOS calculations ommax=6.0 # top of the energy range for DOS calculations N_om=2001 # number of points on the real-energy axis mesh broadening = 0.02 # broadening (the imaginary shift of the real-energy mesh) @@ -204,7 +210,7 @@ corresponding projected densities of states, as well as corresponding symmetries:: Converter.convert_parpoj_input() - + To get access to analysing tools we initialize the :class:`SumkDFTTools ` class :: @@ -212,29 +218,35 @@ To get access to analysing tools we initialize the After the solver initialization, we load the previously calculated chemical potential and double-counting correction. Having set up -atomic levels we then compute the atomic Green's function and -self-energy on the real axis:: +atomic levels we then compute the atomic Green function and +self energy on the real axis:: - S.set_atomic_levels( eal = eal ) - S.GF_realomega(ommin=ommin, ommax = ommax, N_om=N_om,U_int=U_int,J_hund=J_hund) + S.set_atomic_levels(eal=eal) + S.GF_realomega(ommin=ommin, ommax=ommax, N_om=N_om, U_int=U_int, J_hund=J_hund) put it into SK class and then calculated the actual DOS:: SK.dos_parproj_basis(broadening=broadening) -We may first increase the number of **k**-points in BZ to 10000 by executing :program:`Wien2k` program :program:`kgen` :: - +We may first increase the number of **k**-points in BZ to 10000 by executing the Wien2k +program :program:`kgen` :: + x kgen -and then by executing :ref:`Ce-gamma_DOS_script` with :program:`pytriqs`:: +and then by executing the :ref:`Ce-gamma_DOS_script` with :program:`python`:: - pytriqs Ce-gamma_DOS.py + python Ce-gamma_DOS.py -In result we get the total DOS for spins `up` and `down` (identical in our paramagnetic case) in :file:`DOScorrup.dat` and :file:`DOScorrdown.dat` files, respectively, as well as projected DOSs written in the corresponding files as described in :ref:`analysis`. -In our case, for example, the files :file:`DOScorrup.dat` and :file:`DOScorrup_proj3.dat` contain the total DOS for spin *up* and the corresponding projected DOS for Ce *4f* orbital, respectively. They are plotted below. +In result we get the total DOS for spins `up` and `down` (identical in our paramagnetic case) +in :file:`DOScorrup.dat` and :file:`DOScorrdown.dat` files, respectively, as well as the projected DOS +written in the corresponding files as described in :ref:`analysis`. In our case, for example, the files +:file:`DOScorrup.dat` and :file:`DOScorrup_proj3.dat` contain the total DOS for spin *up* and the +corresponding projected DOS for Ce *4f* orbital, respectively. They are plotted below. .. image:: images_scripts/Ce_DOS.png :width: 700 :align: center -As one may clearly see, the Ce *4f* band is split by the local Coulomb interaction into the filled lower Hubbard band and empty upper Hubbard band (the latter is additionally split into several peaks due to the Hund's rule coupling and multiplet effects). +As one may clearly see, the Ce *4f* band is split by the local Coulomb interaction into the filled lower +Hubbard band and empty upper Hubbard band (the latter is additionally split into several peaks due to the +Hund's rule coupling and multiplet effects). diff --git a/doc/guide/transport.rst b/doc/guide/transport.rst index e185a412..3f48bbbb 100644 --- a/doc/guide/transport.rst +++ b/doc/guide/transport.rst @@ -42,15 +42,15 @@ 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. +real-frequency self energy. -.. warning:: - This package does NOT provide an explicit method to do an **analytic continuation** of - self energies and Green functions from Matsubara frequencies to the real frequency axis! - There are methods included e.g. in the :program:`ALPS` package, which can be used for these purposes. - Keep in mind that all these methods have to be used very carefully. Especially for optics calculations - it is crucial to perform the analytic continuation in such a way that the obtained real frequency self energy - is accurate around the Fermi energy as low energy features strongly influence the final results! +.. note:: + If you use a CT-QMC impurity solver you need to perform an **analytic continuation** of + self energies and Green functions from Matsubara frequencies to the real-frequency axis! + This packages does NOT provide methods to do this, but a list of options available within the TRIQS framework + is given :ref:`here `. Keep in mind that all these methods have to be used very carefully. Especially for optics calculations + it is crucial to perform the analytic continuation in such a way that the real-frequency self energy + is accurate around the Fermi energy as low-energy features strongly influence the final results. Besides the self energy the Wien2k files read by the transport converter (:meth:`convert_transport_input `) are: * :file:`.struct`: The lattice constants specified in the struct file are used to calculate the unit cell volume. diff --git a/doc/index.rst b/doc/index.rst index 3523ad2a..3f3ab7fa 100644 --- a/doc/index.rst +++ b/doc/index.rst @@ -7,10 +7,10 @@ DFTTools ======== -.. sidebar:: DftTools 1.5 +.. sidebar:: DFTTools 1.5 - This is the homepage DftTools Version 1.5 - For the changes in DftTools, Cf :ref:`changelog page ` + This is the homepage DFTTools Version 1.5 + For the changes in DFTTools, Cf :ref:`changelog page ` This :ref:`TRIQS-based `-based application is aimed at ab-initio calculations for diff --git a/doc/install.rst b/doc/install.rst index 1b8c447e..0db1fc0e 100644 --- a/doc/install.rst +++ b/doc/install.rst @@ -3,17 +3,17 @@ .. _install: -Packaged Versions of DftTools +Packaged Versions of DFTTools ============================= -A Docker image including the latest version of DftTools is available `here `_. For more information, please see the page on :ref:`TRIQS Docker `. +A Docker image including the latest version of DFTTools is available `here `_. For more information, please see the page on :ref:`TRIQS Docker `. -We further provide a Debian package for the Ubuntu LTS Versions 16.04 (xenial) and 18.04 (bionic), which can be installed by following the steps outlined :ref:`here `, and the subsequent command:: +We further provide a Debian package for the Ubuntu LTS Versions 16.04 (xenial) and 18.04 (bionic), which can be installed by following the steps outlined :ref:`here `, and the subsequent command:: sudo apt-get install -y dft_tools -Compiling DftTools from source +Compiling DFTTools from source ============================== Prerequisites @@ -85,21 +85,20 @@ fully self-consistent calculations. These files should be copied to $ chmod +x run*_triqs -You will also need to insert manually a correct call of :file:`pytriqs` into +You will also need to insert manually a correct call of :file:`python` into these scripts using an appropriate for your system MPI wrapper (mpirun, -mpprun, etc.), if needed. Search for *pytriqs* within the scripts to locate the -appropriate place for inserting the :file:`pytriqs` call. +mpprun, etc.), if needed. Finally, you will have to change the calls to :program:`python_with_DMFT` to -:program:`pytriqs` in the Wien2k :file:`path_to_Wien2k/run*` files. +your :program:`python` installation in the Wien2k :file:`path_to_Wien2k/run*` files. Version compatibility --------------------- -Be careful that the version of the TRIQS library and of the dft tools must be +Be careful that the version of the TRIQS library and of the :program:`DFTTools` must be compatible (more information on the :ref:`TRIQS website `. -If you want to use a version of the dft tools that is not the latest one, go +If you want to use a version of the :program:`DFTTools` that is not the latest one, go into the directory with the sources and look at all available versions:: $ cd src && git tag diff --git a/doc/reference/block_structure.rst b/doc/reference/block_structure.rst index ad44eb2c..ad4004c8 100644 --- a/doc/reference/block_structure.rst +++ b/doc/reference/block_structure.rst @@ -2,7 +2,7 @@ Block Structure =============== The `BlockStructure` class allows to change and manipulate -Green's functions structures and mappings from sumk to solver. +Green functions structures and mappings from sumk to solver. The block structure can also be written to and read from HDF files.