3
0
mirror of https://github.com/triqs/dft_tools synced 2024-12-22 04:13:47 +01:00

[doc] Restructuring doc II

* Committing missing files of last commit
    * Correcting typos
    * Modifications according to issue #56
This commit is contained in:
Manuel Zingl 2016-07-08 12:04:31 +02:00
parent 5c70f1bca0
commit 1c29776727
16 changed files with 299 additions and 402 deletions

View File

@ -14,14 +14,16 @@ Olivier Parcollet (CEA Saclay). A first step has been the definition of the
framework and the construction of the projective Wannier functions as input for framework and the construction of the projective Wannier functions as input for
the DMFT calculations [#dft_tools1]_. This has been followed by the introduction the DMFT calculations [#dft_tools1]_. This has been followed by the introduction
of full charge self-consistency [#dft_tools2]_, necessary for total energy of full charge self-consistency [#dft_tools2]_, necessary for total energy
calculations. calculations. The package at hand is fully implemented as an application
based on the TRIQS library [#dft_tools3]_.
**Developers**: M. Aichhorn, L. Pourovskii, V. Vildosola, C. Martins, P. Seth, M. Zingl **Developers**: M. Aichhorn, L. Pourovskii, P.Seth, V. Vildosola, M. Zingl, O. E. Peil, X. Deng, J. Mravlje, G. Kraberger, C. Martins, M. Ferrero, O. Parcollet
**Related papers**: **Related papers**:
.. [#dft_tools1] `M. Aichhorn, L. Pourovskii, V. Vildosola, M. Ferrero, O. Parcollet, T. Miyake, A. Georges, and S. Biermann, Phys. Rev. B 80, 085101 (2009) <http://link.aps.org/doi/10.1103/PhysRevB.80.085101>`_ (:download:`bibtex file <dft_tools1.bib>`) .. [#dft_tools1] `M. Aichhorn, L. Pourovskii, V. Vildosola, M. Ferrero, O. Parcollet, T. Miyake, A. Georges, and S. Biermann, Phys. Rev. B 80, 085101 (2009) <http://link.aps.org/doi/10.1103/PhysRevB.80.085101>`_ (:download:`bibtex file <dft_tools1.bib>`)
.. [#dft_tools2] `M. Aichhorn, L. Pourovskii, and A. Georges, Phys. Rev. B 84, 054529 (2011) <http://link.aps.org/doi/10.1103/PhysRevB.84.054529>`_ (:download:`bibtex file <dft_tools2.bib>`) .. [#dft_tools2] `M. Aichhorn, L. Pourovskii, and A. Georges, Phys. Rev. B 84, 054529 (2011) <http://link.aps.org/doi/10.1103/PhysRevB.84.054529>`_ (:download:`bibtex file <dft_tools2.bib>`)
.. [#dft_tools3] `M. Aichhorn, L. Pourovskii, P.Seth, V. Vildosola, M. Zingl, O. E. Peil, X. Deng, J. Marvlje, G. Kraberger, C. Martins, M. Ferrero, and O. Parcollet, Commt. Phys. Commun. 204, 200 (2016) <http://www.sciencedirect.com/science/article/pii/S0010465516300728>`_ (:download:`bibtex file <dft_tools3.bib>`)
This application is a part of our scientific work and we would appreciate if This application is a part of our scientific work and we would appreciate if
projects using it will include a citation to the above relevant papers. In projects using it will include a citation to the above relevant papers. In

View File

@ -1,3 +1,5 @@
.. _dftplusdmft:
Introduction to DFT+DMFT Introduction to DFT+DMFT
======================== ========================
@ -8,7 +10,7 @@ terms it states that electrons in a crystal form bands of allowed
states in momentum space. These states are then filled by the states in momentum space. These states are then filled by the
electrons according to Pauli's principle up the Fermi level. With this electrons according to Pauli's principle up the Fermi level. With this
simple picture one can explain the electronic band structure of simple simple picture one can explain the electronic band structure of simple
materials such as elementary copper or aluminium. materials such as elementary copper or aluminum.
Following this principle one can easily classify all existing Following this principle one can easily classify all existing
materials into metals and insulators, with semiconductors being materials into metals and insulators, with semiconductors being
@ -17,9 +19,8 @@ spectrum. Following this band theory, a system is a metal if there is
an odd number of electrons in the valence bands, since this leads to a an odd number of electrons in the valence bands, since this leads to a
partially filled band, cutting the Fermi energy and, thus, producing a partially filled band, cutting the Fermi energy and, thus, producing a
Fermi surface, i.e metallic behavior. On the other hand, an even Fermi surface, i.e metallic behavior. On the other hand, an even
number of electrons leads to number of electrons leads to completely filled bands with a finite
completely filled bands with a finite excitation gap to the conduction excitation gap to the conduction bands, i.e. insulating behavior.
bands, i.e. insulating behavior.
This classification works pretty well for a large class of This classification works pretty well for a large class of
materials, where the electronic band structures are reproduced by materials, where the electronic band structures are reproduced by
@ -41,7 +42,7 @@ current
because of the strong Coulomb repulsion between the electrons. With because of the strong Coulomb repulsion between the electrons. With
reference to Sir Nevill Mott, who contributed substantially to the reference to Sir Nevill Mott, who contributed substantially to the
explanation of this effect in the 1930's, these materials are in explanation of this effect in the 1930's, these materials are in
general reffered to as Mott insulators. general referred to as Mott insulators.
Density-functional theory in a (very small) nutshell Density-functional theory in a (very small) nutshell
---------------------------------------------------- ----------------------------------------------------
@ -63,7 +64,7 @@ that is discussed in the literature on DFT, let us just note that the
main result of DFT calculations are the Kohn-Sham energies main result of DFT calculations are the Kohn-Sham energies
:math:`\varepsilon_{\nu\mathbf{k}}` and the Kohn-Sham orbitals :math:`\psi_{\nu\mathbf{k}}(\mathbf{r})`. :math:`\varepsilon_{\nu\mathbf{k}}` and the Kohn-Sham orbitals :math:`\psi_{\nu\mathbf{k}}(\mathbf{r})`.
This set of equations is exact, however, the exchange correlation This set of equations is exact, however, the exchange correlation
potential :math:`V_{xc}(\mathbf{r})` is not known explicitely. In potential :math:`V_{xc}(\mathbf{r})` is not known explicitly. In
order to do actual calculations, it needs to be approximated in some order to do actual calculations, it needs to be approximated in some
way. The local density approximation is one of the most famous way. The local density approximation is one of the most famous
approximations used in this context. This approximation works well for approximations used in this context. This approximation works well for
@ -75,7 +76,7 @@ From DFT to DMFT
In order to extend our calculations to strong correlations, we need to In order to extend our calculations to strong correlations, we need to
go from a description by bands to a description in terms of go from a description by bands to a description in terms of
(localised) orbitals: Wannier functions. (localized) orbitals: Wannier functions.
In principle, Wannier functions :math:`\chi_{\mu\sigma}(\mathbf{r})` In principle, Wannier functions :math:`\chi_{\mu\sigma}(\mathbf{r})`
are nothing else than a Fourier transform of the Bloch basis set from are nothing else than a Fourier transform of the Bloch basis set from
@ -88,7 +89,7 @@ where we introduced also the spin degree of freedom :math:`\sigma`. The
unitary matrix :math:`U_{\mu\nu}` is not uniquely defined, but allows for a unitary matrix :math:`U_{\mu\nu}` is not uniquely defined, but allows for a
certain amount of freedom in the calculation of Wannier function. A certain amount of freedom in the calculation of Wannier function. A
very popular choice is the constraint that the resulting Wannier very popular choice is the constraint that the resulting Wannier
functions should be maximally localised in space. Another route, functions should be maximally localized in space. Another route,
computationally much lighter and more stable, are projective Wannier computationally much lighter and more stable, are projective Wannier
functions. This scheme is used for the Wien2k interface in this functions. This scheme is used for the Wien2k interface in this
package. package.
@ -98,7 +99,7 @@ A central quantity in this scheme is the projection operator
:math:`\nu` a Bloch band index. :math:`\nu` a Bloch band index.
Its definition and how it is calculated can be found in the original Its definition and how it is calculated can be found in the original
literature or in the extensive documentation of the literature or in the extensive documentation of the
:program:`dmftproj` program shipped with :program:`dft_tools`. :program:`dmftproj` program shipped with :program:`DFTTools`.
Using projective Wannier functions for DMFT Using projective Wannier functions for DMFT
------------------------------------------- -------------------------------------------
@ -121,7 +122,7 @@ with the DFT Green function
This non-interacting Green function :math:`G^0_{mn}(i\omega)` defines, This non-interacting Green function :math:`G^0_{mn}(i\omega)` defines,
together with the interaction Hamiltonian, the Anderson impurity together with the interaction Hamiltonian, the Anderson impurity
model. The DMFT self-consitency cycle can now be formulated as model. The DMFT self-consistency cycle can now be formulated as
follows: follows:
#. Take :math:`G^0_{mn}(i\omega)` and the interaction Hamiltonian and #. Take :math:`G^0_{mn}(i\omega)` and the interaction Hamiltonian and
@ -173,9 +174,9 @@ Full charge self-consistency
The feedback of the electronic correlations to the Kohn-Sham orbitals The feedback of the electronic correlations to the Kohn-Sham orbitals
is included by the interacting density matrix. With going into the is included by the interacting density matrix. With going into the
details, it basically consists of calculating the Kohn Sham density details, it basically consists of calculating the Kohn-Sham density
:math:`\rho(\mathbf{r})` in the presence of this interacting density :math:`\rho(\mathbf{r})` in the presence of this interacting density
matrix. This new density now defines a new Kohn Sham matrix. This new density now defines a new Kohn-Sham
exchange-correlation potential, which in turn leads to new exchange-correlation potential, which in turn leads to new
:math:`\varepsilon_{\nu\mathbf{k}}`, :math:`\varepsilon_{\nu\mathbf{k}}`,
:math:`\psi_{\nu\mathbf{k}}(\mathbf{r})`, and projectors :math:`\psi_{\nu\mathbf{k}}(\mathbf{r})`, and projectors
@ -186,4 +187,4 @@ step 3, before the local lattice Green
function is downfolded again into orbital space. function is downfolded again into orbital space.
How all these calculations can be done in practice with this How all these calculations can be done in practice with this
:program:`dft_tools` package is subject of the user guide in this documentation. :program:`DFTTools` package is subject of the user guide in this documentation.

View File

@ -1,18 +1,21 @@
Structure of DFT Tools .. _structure:
======================
Structure of :program:`DFTTools`
================================
.. image:: images/structure.png .. image:: images/structure.png
:width: 700 :width: 700
:align: center :align: center
The central part of :program:`dft_tools`, which is performing the The central part of :program:`DFTTools`, which is performing the
steps for the DMFT self-consistency cycle, is written following the steps for the DMFT self-consistency cycle, is written following the
same philosophy as the :ref:`TRIQS <triqslibs:welcome>` toolbox. At same philosophy as the :ref:`TRIQS <triqslibs:welcome>` toolbox. At
the user level, easy-to-use python modules are provided that allow to the user level, easy-to-use python modules are provided that allow to
write simple and short scripts performing the actual write simple and short scripts performing the actual calculation.
calculation. Here, we will describe the general structure of the The usage of those modules is presented in the user guide of this
package, for the details of how to use the modules, please consult the :ref:`documentation`. Before considering the user guide, we suggest
user guide of this :ref:`documentation`. to read the following introduction on the general structure of
the :program:`DFTTools` package.
The interface layer The interface layer
------------------- -------------------
@ -30,37 +33,37 @@ Wien2k interface
"""""""""""""""" """"""""""""""""
This interface layer consists of two parts. First, the output from Wien2k This interface layer consists of two parts. First, the output from Wien2k
is taken, and localised Wannier orbitals are constructed. This is done is taken, and localized Wannier orbitals are constructed. This is done
by the fortran program :program:`dmftproj`. The second part consist in by the FORTRAN program :program:`dmftproj`. The second part consist in
the conversion of the :program:`dmftproj` into the hdf5 file the conversion of the :program:`dmftproj` into the hdf5 file
format to be used for the DMFT calculation. This step is done by a format to be used for the DMFT calculation. This step is done by a
python routine called :class:`Wien2kConverter`, that reads the text output and python routine called :class:`Wien2kConverter`, that reads the text output and
creates the hdf5 input file with the necessary ingredients. Quite creates the hdf5 input file with the necessary ingredients. Quite
naturally, :program:`dft_tools` will adopt this converter concept also for future naturally, :program:`DFTTools` will adopt this converter concept also for future
developments for other DFT packages. developments for other DFT packages.
General interface General interface
""""""""""""""""" """""""""""""""""
In addition to the specialised Wien2k interface, :program:`dft_tools` In addition to the specialized Wien2k interface, :program:`DFTTools`
provides also a very light-weight general interface. It basically provides also a very light-weight general interface. It basically
consists of a very simple :class:`HkConverter`. As input it requires a consists of a very simple :class:`HkConverter`. As input it requires a
hamiltonian matrix :math:`H_{mn}(\mathbf{k})` written already in Hamiltonian matrix :math:`H_{mn}(\mathbf{k})` written already in
localised-orbital indices :math:`m,n`, on a :math:`\mathbf{k}`-point localized-orbital indices :math:`m,n`, on a :math:`\mathbf{k}`-point
grid covering the Brillouin zone, and just a few other informations grid covering the Brillouin zone, and just a few other informations
like total numer of electrons, how many correlated atoms in the unit like total number of electrons, how many correlated atoms in the unit
cell, and so on. It converts this hamiltonian into a hdf5 format and cell, and so on. It converts this Hamiltonian into a hdf5 format and
sets some variables to standard values, such that it can be used with sets some variables to standard values, such that it can be used with
the python modules performing the DMFT calculation. How the the python modules performing the DMFT calculation. How the
hamiltonian matrix :math:`H_{mn}(\mathbf{k})` is actually calculated, Hamiltonian matrix :math:`H_{mn}(\mathbf{k})` is actually calculated,
is **not** part of this interace. is **not** part of this interface.
The DMFT calculation The DMFT calculation
-------------------- --------------------
As mentioned above, there are a few python routines that allow to As mentioned above, there are a few python routines that allow to
perform the multi-band DMFT calculation in the context of real perform the multi-band DMFT calculation in the context of real
materials. The major part is contained inte module materials. The major part is contained in the module
:class:`SumkDFT`. It contains routines to :class:`SumkDFT`. It contains routines to
* calculate local Greens functions * calculate local Greens functions
@ -69,7 +72,7 @@ materials. The major part is contained inte module
* calculate the double-counting correction * calculate the double-counting correction
* calculate the chemical potential in order to get the electron count right * calculate the chemical potential in order to get the electron count right
* other things like determining the structure of the local * other things like determining the structure of the local
hamiltonian, rotating from local to global coordinate systems, etc. Hamiltonian, rotating from local to global coordinate systems, etc.
At the user level, all these routines can be used to construct At the user level, all these routines can be used to construct
situation- and problem-dependent DMFT calculations in a very efficient situation- and problem-dependent DMFT calculations in a very efficient
@ -90,8 +93,8 @@ Post-processing
The main result of DMFT calculation is the interacting Greens function The main result of DMFT calculation is the interacting Greens function
and the Self energy. However, one is normally interested in and the Self energy. However, one is normally interested in
quantitites like band structure, density of states, or transport quantities like band structure, density of states, or transport
properties. In order to calculate these things, :program:`dft_tools` properties. In order to calculate these things, :program:`DFTTools`
provides the post-processing modules :class:`SumkDFTTools`. It provides the post-processing modules :class:`SumkDFTTools`. It
contains routines to calculate contains routines to calculate
@ -102,11 +105,8 @@ contains routines to calculate
or thermopower. or thermopower.
.. warning:: .. warning::
At the moment neither :ref:`TRIQS<triqslibs:welcome>` nor :program:`dft_tools` At the moment neither :ref:`TRIQS<triqslibs:welcome>` nor :program:`DFTTools`
provides Maximum Entropy routines! You can use the Pade provides Maximum Entropy routines! You can use the Pade
approximants implemented in the TRIQS library, or you use your own approximation implemented in the :ref:`TRIQS <triqslibs:welcome>` library, or you use your own
home-made Maximum Entropy code to do the analytic continuation from home-made Maximum Entropy code to do the analytic continuation from
Matsubara to the real-frequency axis. Matsubara to the real-frequency axis.

View File

@ -17,7 +17,7 @@ extensions = ['sphinx.ext.autodoc',
source_suffix = '.rst' source_suffix = '.rst'
project = u'TRIQS_DFT Tools' project = u'TRIQS DFTTools'
copyright = u'2011-2013, M. Aichhorn, L. Pourovskii, V. Vildosola, C. Martins' copyright = u'2011-2013, M. Aichhorn, L. Pourovskii, V. Vildosola, C. Martins'
version = '@DFT_TOOLS_VERSION@' version = '@DFT_TOOLS_VERSION@'
release = '@DFT_TOOLS_RELEASE@' release = '@DFT_TOOLS_RELEASE@'
@ -28,16 +28,15 @@ templates_path = ['@CMAKE_SOURCE_DIR@/doc/_templates']
html_theme = 'triqs' html_theme = 'triqs'
html_theme_path = ['@TRIQS_THEMES_PATH@'] html_theme_path = ['@TRIQS_THEMES_PATH@']
html_show_sphinx = False html_show_sphinx = False
html_context = {'header_title': 'dft_tools', html_context = {'header_title': 'dft tools',
'header_subtitle': 'connecting <a class="triqs" style="font-size: 12px" href="http://ipht.cea.fr/triqs">TRIQS</a> to DFT packages', 'header_subtitle': 'connecting <a class="triqs" style="font-size: 12px" href="http://ipht.cea.fr/triqs">TRIQS</a> to DFT packages',
'header_links': [['Install', 'install'], 'header_links': [['Install', 'install'],
['Documentation', 'documentation'], ['Documentation', 'documentation'],
['Issues', 'issues'], ['Issues', 'issues'],
['About dft_tools', 'about']]} ['About DFTTools', 'about']]}
html_static_path = ['@CMAKE_SOURCE_DIR@/doc/_static'] html_static_path = ['@CMAKE_SOURCE_DIR@/doc/_static']
html_sidebars = {'index': ['sideb.html', 'searchbox.html']} 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://ipht.cea.fr/triqs', None), intersphinx_mapping = {'python': ('http://docs.python.org/2.7', None), 'triqslibs': ('http://ipht.cea.fr/triqs', None), 'triqscthyb': ('http://ipht.cea.fr/triqs/applications/cthyb', None)}
'triqscthyb': ('http://ipht.cea.fr/triqs/applications/cthyb', None)}

View File

@ -1,4 +1,4 @@
.. module:: pytriqs.applications.dft_tools .. module:: pytriqs.applications.dft
.. _documentation: .. _documentation:
@ -11,6 +11,7 @@ Basic notions
.. toctree:: .. toctree::
:maxdepth: 2 :maxdepth: 2
basicnotions/first
basicnotions/dft_dmft basicnotions/dft_dmft
basicnotions/structure basicnotions/structure
@ -23,6 +24,7 @@ User guide
guide/conversion guide/conversion
guide/dftdmft_singleshot guide/dftdmft_singleshot
guide/SrVO3
guide/dftdmft_selfcons guide/dftdmft_selfcons
guide/analysis guide/analysis
guide/full_tutorial guide/full_tutorial

View File

@ -55,20 +55,21 @@ And next, we can initialize the :class:`SumkDFT <dft.sumk_dft.SumkDFT>` class::
Initializing the solver Initializing the solver
----------------------- -----------------------
We also have to specify the :ref:`CTHYB solver <triqscthyb:welcome>` related settings. The We also have to specify the :ref:`CTHYB solver <triqscthyb:welcome>` related settings.
minimal parameters for a SrVO3 DMFT calculation on 16 cores are:: We assume that the DMFT script for SrVO3 is executed on 16 cores. A sufficient set
of parameters for a first guess is::
p = {} p = {}
# solver # solver
p["random_seed"] = 123 * mpi.rank + 567 p["random_seed"] = 123 * mpi.rank + 567
p["length_cycle"] = 200 p["length_cycle"] = 200
p["n_warmup_cycles"] = 50000 p["n_warmup_cycles"] = 100000
p["n_cycles"] = 500000 p["n_cycles"] = 1000000
# tail fit # tail fit
p["perform_tail_fit"] = True p["perform_tail_fit"] = True
p["fit_max_moment"] = 4 p["fit_max_moment"] = 4
p["fit_min_n"] = 60 p["fit_min_n"] = 30
p["fit_max_n"] = 140 p["fit_max_n"] = 60
Here we use a tail fit to deal with numerical noise of higher Matsubara frequencies. Here we use a tail fit to deal with numerical noise of higher Matsubara frequencies.
For other options and more details on the solver parameters, we refer the user to For other options and more details on the solver parameters, we refer the user to
@ -180,17 +181,26 @@ This is all we need for the DFT+DMFT calculation.
You can see in this code snippet, that all results of this calculation You can see in this code snippet, that all results of this calculation
will be stored in a separate subgroup in the hdf5 file, called `dmft_output`. will be stored in a separate subgroup in the hdf5 file, called `dmft_output`.
Note that this script performs 15 DMFT cycles, but does not check for Note that this script performs 15 DMFT cycles, but does not check for
convergence. Of course, it is possible to build in convergence criterias. convergence. Of course, it would be possible to build in convergence criteria.
A simple check for convergence can be also done if you store multiple quantities A simple check for convergence can be also done if you store multiple quantities
of each iteration and analyze the convergence by hand. In general, it is advisable of each iteration and analyze the convergence by hand. In general, it is advisable
to start with a lower statistics (less measurements), but then increase it at a to start with a lower statistics (less measurements), but then increase it at a
point close to converged results (e.g. after a few initial iterations). This helps point close to converged results (e.g. after a few initial iterations). This helps
to keep computational costs low during the first iterations. to keep computational costs low during the first iterations.
Using the Kanamori Hamiltonian and the parameters above (but on 16 cores),
your self energy after the **first iteration** should look like the
self energy shown below.
.. image:: images_scripts/SrVO3_Sigma_iw_it1.png
:width: 700
:align: center
.. _tailfit: .. _tailfit:
Tail fit paramters Tail fit parameters
------------------ -------------------
A good way to identify suitable tail fit parameters is by "human inspection". A good way to identify suitable tail fit parameters is by "human inspection".
Therefore disabled the tail fitting first:: Therefore disabled the tail fitting first::

View File

@ -7,13 +7,13 @@ 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: There are two practical tools for which a self energy on the real axis is not needed, namely:
* :meth:`dos_wannier_basis <pytriqs.applications.dft.sumk_dft_tools.SumkDFTTools.dos_wannier_basis>` for the density of states of the Wannier orbitals and * :meth:`dos_wannier_basis <dft.sumk_dft_tools.SumkDFTTools.dos_wannier_basis>` for the density of states of the Wannier orbitals and
* :meth:`partial_charges <pytriqs.applications.dft.sumk_dft_tools.SumkDFTTools.partial_charges>` for the partial charges according to the :program:`Wien2k` definition. * :meth:`partial_charges <dft.sumk_dft_tools.SumkDFTTools.partial_charges>` for the partial charges according to the :program:`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 <pytriqs.applications.dft.sumk_dft_tools.SumkDFTTools.dos_parproj_basis>` for the momentum-integrated spectral function including self energy effects and * :meth:`dos_parproj_basis <dft.sumk_dft_tools.SumkDFTTools.dos_parproj_basis>` for the momentum-integrated spectral function including self energy effects and
* :meth:`spaghettis <pytriqs.applications.dft.sumk_dft_tools.SumkDFTTools.spaghettis>` for the momentum-resolved spectral function (i.e. ARPES) * :meth:`spaghettis <dft.sumk_dft_tools.SumkDFTTools.spaghettis>` for the momentum-resolved spectral function (i.e. ARPES)
.. warning:: .. warning::
This package does NOT provide an explicit method to do an **analytic continuation** of the This package does NOT provide an explicit method to do an **analytic continuation** of the
@ -24,17 +24,17 @@ However, a real frequency self energy has to be provided by the user for the met
Initialisation Initialisation
-------------- --------------
All tools described below are collected in an extension of the :class:`SumkDFT <pytriqs.applications.dft.sumk_dft.SumkDFT>` class and are All tools described below are collected in an extension of the :class:`SumkDFT <dft.sumk_dft.SumkDFT>` class and are
loaded by importing the module :class:`SumkDFTTools <pytriqs.applications.dft.sumk_dft_tools.SumkDFTTools>`:: loaded by importing the module :class:`SumkDFTTools <dft.sumk_dft_tools.SumkDFTTools>`::
from pytriqs.applications.dft.sumk_dft_tools import * from pytriqs.applications.dft.sumk_dft_tools import *
The initialisation of the class is equivalent to that of the :class:`SumkDFT <pytriqs.applications.dft.sumk_dft.SumkDFT>` The initialisation of the class is equivalent to that of the :class:`SumkDFT <dft.sumk_dft.SumkDFT>`
class:: class::
SK = SumkDFTTools(hdf_file = filename + '.h5') SK = SumkDFTTools(hdf_file = filename + '.h5')
Note that all routines available in :class:`SumkDFT <pytriqs.applications.dft.sumk_dft.SumkDFT>` are also available here. Note that all routines available in :class:`SumkDFT <dft.sumk_dft.SumkDFT>` are also available here.
If required, we have to load and initialise the real frequency self energy. Most conveniently, 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 <pytriqs.gf.local.BlockGf>` object you have your self energy already stored as a real frequency :class:`BlockGf <pytriqs.gf.local.BlockGf>` object
@ -110,7 +110,7 @@ real frequency self energy for this purpose. The calculation is done by::
which calculates the partial charges using the self energy, double counting, and chemical potential as set in the 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 `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 :program:`Wien2k` converter routines and stored automatically
in the hdf5 archive. For the structure of `dm`, see also :meth:`reference manual <pytriqs.applications.dft.sumk_dft_tools.SumkDFTTools.partial_charges>`. in the hdf5 archive. For the structure of `dm`, see also :meth:`reference manual <dft.sumk_dft_tools.SumkDFTTools.partial_charges>`.
Correlated spectral function (with real frequency self energy) Correlated spectral function (with real frequency self energy)
-------------------------------------------------------------- --------------------------------------------------------------
@ -129,7 +129,7 @@ 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 Another quantity of interest is the momentum-resolved spectral function, which can directly be compared to ARPES
experiments. First we have to execute `lapw1`, `lapw2 -almd` and :program:`dmftproj` with the `-band` experiments. First we have to execute `lapw1`, `lapw2 -almd` and :program:`dmftproj` with the `-band`
option and use the :meth:`convert_bands_input <pytriqs.applications.dft.converters.wien2k_converter.Wien2kConverter.convert_bands_input>` option and use the :meth:`convert_bands_input <dft.converters.wien2k_converter.Wien2kConverter.convert_bands_input>`
routine, which converts the required files (for a more detailed description see :ref:`conversion`). The spectral function is then calculated by typing:: routine, which converts the required files (for a more detailed description see :ref:`conversion`). The spectral function is then calculated by typing::
SK.spaghettis(broadening=0.01,plot_shift=0.0,plot_range=None,ishell=None,save_to_file='Akw_') SK.spaghettis(broadening=0.01,plot_shift=0.0,plot_range=None,ishell=None,save_to_file='Akw_')

View File

@ -34,9 +34,9 @@ some files that we need for the Wannier orbital construction.
The orbital construction itself is done by the Fortran program The orbital construction itself is done by the Fortran program
:program:`dmftproj`. For an extensive manual to this program see :program:`dmftproj`. For an extensive manual to this program see
:download:`TutorialDmftproj.pdf <images_scripts/TutorialDmftproj.pdf>`. :download:`TutorialDmftproj.pdf <images_scripts/TutorialDmftproj.pdf>`.
Here we will only describe only the basic steps. Here we will only describe the basic steps.
Let us take the example of SrVO3, a commonly used Let us take the compound SrVO3, a commonly used
example for DFT+DMFT calculations. The input file for example for DFT+DMFT calculations. The input file for
:program:`dmftproj` looks like :program:`dmftproj` looks like
@ -56,9 +56,9 @@ following 3 to 5 lines:
harmonics). harmonics).
#. The four numbers refer to *s*, *p*, *d*, and *f* electrons, #. The four numbers refer to *s*, *p*, *d*, and *f* electrons,
resp. Putting 0 means doing nothing, putting 1 will calculate resp. Putting 0 means doing nothing, putting 1 will calculate
**unnormalised** projectors in compliance with the Wien2k **unnormalized** projectors in compliance with the Wien2k
definition. The important flag is 2, this means to include these definition. The important flag is 2, this means to include these
electrons as correlated electrons, and calculate normalised Wannier electrons as correlated electrons, and calculate normalized Wannier
functions for them. In the example above, you see that only for the functions for them. In the example above, you see that only for the
vanadium *d* we set the flag to 2. If you want to do simply a DMFT vanadium *d* we set the flag to 2. If you want to do simply a DMFT
calculation, then set everything to 0, except one flag 2 for the calculation, then set everything to 0, except one flag 2 for the
@ -100,12 +100,12 @@ directory name):
respectively. These files are needed for projected respectively. These files are needed for projected
density-of-states or spectral-function calculations in density-of-states or spectral-function calculations in
post-processing only. post-processing only.
* :file:`case.oubwin` needed for the charge desity recalculation in * :file:`case.oubwin` needed for the charge density recalculation in
the case of fully self-consistent DFT+DMFT run (see below). the case of fully self-consistent DFT+DMFT run (see below).
Now we convert these files into an hdf5 file that can be used for the Now we convert these files into an hdf5 file that can be used for the
DMFT calculations. For this purpose we DMFT calculations. For this purpose we
use the python module :class:`Wien2kConverter <pytriqs.applications.dft.converters.wien2k_converter.Wien2kConverter>`. It is initialised as:: use the python module :class:`Wien2kConverter <dft.converters.wien2k_converter.Wien2kConverter>`. It is initialized as::
from pytriqs.applications.dft.converters.wien2k_converter import * from pytriqs.applications.dft.converters.wien2k_converter import *
Converter = Wien2kConverter(filename = case) Converter = Wien2kConverter(filename = case)
@ -119,7 +119,7 @@ an hdf5 archive, named :file:`case.h5`, where all the data is
stored. For other parameters of the constructor please visit the stored. For other parameters of the constructor please visit the
:ref:`refconverters` section of the reference manual. :ref:`refconverters` section of the reference manual.
After initialising the interface module, we can now convert the input After initializing the interface module, we can now convert the input
text files to the hdf5 archive by:: text files to the hdf5 archive by::
Converter.convert_dft_input() Converter.convert_dft_input()
@ -133,18 +133,18 @@ After this step, all the necessary information for the DMFT loop is
stored in the hdf5 archive, where the string variable stored in the hdf5 archive, where the string variable
`Converter.hdf_filename` gives the file name of the archive. `Converter.hdf_filename` gives the file name of the archive.
At this point you should use the method :meth:`dos_wannier_basis <pytriqs.applications.dft.sumk_dft_tools.SumkDFTTools.dos_wannier_basis>` At this point you should use the method :meth:`dos_wannier_basis <dft.sumk_dft_tools.SumkDFTTools.dos_wannier_basis>`
contained in the module :class:`SumkDFTTools <pytriqs.applications.dft.sumk_dft_tools.SumkDFTTools>` to check the density of contained in the module :class:`SumkDFTTools <dft.sumk_dft_tools.SumkDFTTools>` to check the density of
states of the Wannier orbitals (see :ref:`analysis`). states of the Wannier orbitals (see :ref:`analysis`).
You have now everything for performing a DMFT calculation, and you can You have now everything for performing a DMFT calculation, and you can
proceed with :ref:`singleshot`. proceed with the section on :ref:`single-shot DFT+DMFT calculations <singleshot>`.
Data for post-processing Data for post-processing
"""""""""""""""""""""""" """"""""""""""""""""""""
In case you want to do post-processing of your data using the module In case you want to do post-processing of your data using the module
:class:`SumkDFTTools <pytriqs.applications.dft.sumk_dft_tools.SumkDFTTools>`, some more files :class:`SumkDFTTools <dft.sumk_dft_tools.SumkDFTTools>`, some more files
have to be converted to the hdf5 archive. For instance, for have to be converted to the hdf5 archive. For instance, for
calculating the partial density of states or partial charges 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 :program:`Wien2k`, you have to invoke::
@ -165,7 +165,7 @@ following. First, one has to do the Wien2k calculation on the given
Again, maybe with the optional additional extra flags according to Again, maybe with the optional additional extra flags according to
Wien2k. Now we use a routine of the converter module allows to read Wien2k. Now we use a routine of the converter module allows to read
and convert the input for :class:`SumkDFTTools <pytriqs.applications.dft.sumk_dft_tools.SumkDFTTools>`:: and convert the input for :class:`SumkDFTTools <dft.sumk_dft_tools.SumkDFTTools>`::
Converter.convert_bands_input() Converter.convert_bands_input()
@ -186,7 +186,7 @@ A general H(k)
-------------- --------------
In addition to the more complicated Wien2k converter, In addition to the more complicated Wien2k converter,
:program:`dft_tools` contains also a light converter. It takes only :program:`DFTTools` contains also a light converter. It takes only
one inputfile, and creates the necessary hdf outputfile for one inputfile, and creates the necessary hdf outputfile for
the DMFT calculation. The header of this input file has to have the the DMFT calculation. The header of this input file has to have the
following format: following format:
@ -204,15 +204,13 @@ The lines of this header define
#. The last line contains several numbers: the number of irreducible #. The last line contains several numbers: the number of irreducible
representations, and then the dimensions of the irreps. One representations, and then the dimensions of the irreps. One
possibility is as the example above, another one would be 2 possibility is as the example above, another one would be 2
2 3. Thiw would mean, 2 irreps (eg and t2g), of dimension 2 and 3, 2 3. This would mean, 2 irreps (eg and t2g), of dimension 2 and 3,
resp. resp.
After these header lines, the file has to contain the Hamiltonian After these header lines, the file has to contain the Hamiltonian
matrix in orbital space. The standard convention is that you give for matrix in orbital space. The standard convention is that you give for
each each :math:`\mathbf{k}`-point first the matrix of the real part, then the
:math:`\mathbf{k}`-point first the matrix of the real part, then the matrix of the imaginary part, and then move on to the next :math:`\mathbf{k}`-point.
matrix of the imaginary part, and then move on to the next
:math:`\mathbf{k}`-point.
The converter itself is used as:: The converter itself is used as::
@ -221,8 +219,7 @@ The converter itself is used as::
Converter.convert_dft_input() Converter.convert_dft_input()
where :file:`hkinputfile` is the name of the input file described where :file:`hkinputfile` is the name of the input file described
above. This produces the hdf file that you need, and you cna proceed above. This produces the hdf file that you need for a DMFT calculation.
with the
For more options of this converter, have a look at the For more options of this converter, have a look at the
:ref:`refconverters` section of the reference manual. :ref:`refconverters` section of the reference manual.
@ -232,10 +229,10 @@ Wannier90 Converter
------------------- -------------------
Using this converter it is possible to convert the output of Using this converter it is possible to convert the output of
:program:`Wannier90` (http://wannier.org) calculations of `wannier90 <http://wannier.org>`_
Maximally Localized Wannier Functions (MLWF) and create a HDF5 archive Maximally Localized Wannier Functions (MLWF) and create a HDF5 archive
suitable for one-shot DMFT calculations with the suitable for one-shot DMFT calculations with the
:class:`SumkDFT <pytriqs.applications.dft.sumk_dft.SumkDFT>` class. :class:`SumkDFT <dft.sumk_dft.SumkDFT>` class.
The user must supply two files in order to run the Wannier90 Converter: The user must supply two files in order to run the Wannier90 Converter:
@ -306,7 +303,7 @@ In our `Pnma`-LaVO\ :sub:`3` example, for instance, we could use::
where the ``x=-1,1,0`` option indicates that the V--O bonds in the octahedra are where the ``x=-1,1,0`` option indicates that the V--O bonds in the octahedra are
rotated by (approximatively) 45 degrees with respect to the axes of the `Pbnm` cell. rotated by (approximatively) 45 degrees with respect to the axes of the `Pbnm` cell.
The converter will analyse the matrix elements of the local hamiltonian The converter will analyze the matrix elements of the local Hamiltonian
to find the symmetry matrices `rot_mat` needed for the global-to-local to find the symmetry matrices `rot_mat` needed for the global-to-local
transformation of the basis set for correlated orbitals transformation of the basis set for correlated orbitals
(see section :ref:`hdfstructure`). (see section :ref:`hdfstructure`).
@ -331,7 +328,7 @@ The current implementation of the Wannier90 Converter has some limitations:
* Calculations with spin-orbit (``SO=1``) are not supported. * Calculations with spin-orbit (``SO=1``) are not supported.
* The spin-polarized case (``SP=1``) is not yet tested. * The spin-polarized case (``SP=1``) is not yet tested.
* The post-processing routines in the module * The post-processing routines in the module
:class:`SumkDFTTools <pytriqs.applications.dft.sumk_dft_tools.SumkDFTTools>` :class:`SumkDFTTools <dft.sumk_dft_tools.SumkDFTTools>`
were not tested with this converter. were not tested with this converter.
* ``proj_mat_all`` are not used, so there are no projectors onto the * ``proj_mat_all`` are not used, so there are no projectors onto the
uncorrelated orbitals for now. uncorrelated orbitals for now.
@ -344,8 +341,8 @@ The interface packages are written such that all the file operations
are done only on the master node. In general, the philosophy of the are done only on the master node. In general, the philosophy of the
package is that whenever you read in something from the archive package is that whenever you read in something from the archive
yourself, you have to *manually* broadcast it to the nodes. An yourself, you have to *manually* broadcast it to the nodes. An
exception to this rule is when you use routines from :class:`SumkDFT <pytriqs.applications.dft.sumk_dft.SumkDFT>` exception to this rule is when you use routines from :class:`SumkDFT <dft.sumk_dft.SumkDFT>`
or :class:`SumkDFTTools <pytriqs.applications.dft.sumk_dft_tools.SumkDFTTools>`, where the broadcasting is done for you. or :class:`SumkDFTTools <dft.sumk_dft_tools.SumkDFTTools>`, where the broadcasting is done for you.
Interfaces to other packages Interfaces to other packages
---------------------------- ----------------------------

View File

@ -5,16 +5,21 @@
Single-shot DFT+DMFT Single-shot DFT+DMFT
==================== ====================
After having set up the hdf5 archive, we can now proceed to our first DFT+DMFT calculation.
It consists of initialization steps, and the actual DMFT self-consistency loop,
With the code snippets below you can build your own script and target
it to your needs. Little examples on :ref:`mixing <mixing>` and on
:ref:`restarting from a previous calculation <restartcalc>` at the end of this page
should also demonstrate how simple you can modify your own DMFT script. A full working
calculation for SrVO3 is discussed in the :ref:`next section <SrVO3>`.
After having set up the hdf5 archive, we can now do our DFT+DMFT calculation. It consists of
initialization steps, and the actual DMFT self-consistency loop, as is
discussed below.
Initialisation of the calculation Initialization of the calculation
--------------------------------- ---------------------------------
Before doing the calculation, we have to intialize all the objects that we will need. The first thing is the Before doing the actual calculation, we have to initialize all needed objects.
:class:`SumkDFT <pytriqs.applications.dft.sumk_dft.SumkDFT>` class. It contains all basic routines that are necessary to perform a summation in k-space The first thing is the :class:`SumkDFT <dft.sumk_dft.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:: to get the local quantities used in DMFT. It is initialized by::
from pytriqs.applications.dft.sumk_dft import * from pytriqs.applications.dft.sumk_dft import *
@ -25,35 +30,34 @@ Setting up the impurity solver
------------------------------ ------------------------------
The next step is to setup an impurity solver. There are different The next step is to setup an impurity solver. There are different
solvers available within the :ref:`TRIQS <triqslibs:welcome>` framework. Below, we will discuss solvers available within the :ref:`TRIQS <triqslibs:welcome>` framework.
the example of the hybridisation E.g. for :ref:`SrVO3 <SrVO3>`, we will use the hybridization
expansion :ref:`CTHYB solver <triqscthyb:welcome>`. Later on, we will expansion :ref:`CTHYB solver <triqscthyb:welcome>`. Later on, we will
see also the example of the Hubbard-I solver. They all have in common, see also the example of the `Hubbard-I solver <http://ipht.cea.fr/triqs/applications/hubbardI>`_.
that they are called by a uniform command:: They all have in common, that they are called by an uniform command::
S.solve(params) S.solve(params)
where `params` are the solver parameters and depend on the actual where :emphasis:`params` are the solver parameters and depend on the actual
solver that is used. Before going into the details of the solver, let solver. Setting up the :ref:`CTHYB solver <triqscthyb:welcome>` for SrVO3 is
us discuss in the next section how to perform the DMFT loop using discussed on the :ref:`next page <SrVO3>`. Here, let us now perform the DMFT
the methods of :program:`dft_tools`, assuming that we have set up a loop using the methods of :program:`DFTTools`, assuming that we have already
working solver instance. set up a working solver instance.
Doing the DMFT loop Doing the DMFT loop
------------------- -------------------
Having initialized the SumK class and the Solver, we can proceed with the DMFT Having initialized the :class:`Sumk class <dft.sumk_dft.SumkDFT>`
loop itself. We have to set up the loop over DMFT and the solver, we can proceed with the actual DMFT part of the calculation.
iterations and the self-consistency condition:: We set up the loop over DMFT iterations and the self-consistency condition::
n_loops = 5 n_loops = 15
for iteration_number in range(n_loops) : # start the DMFT loop for iteration_number in range(n_loops) : # start the DMFT loop
SK.set_Sigma([ S.Sigma ]) # Put self energy to the SumK class SK.set_Sigma([ S.Sigma ]) # Put self energy to the SumK class
chemical_potential = SK.calc_mu() # calculate the chemical potential for the given density chemical_potential = SK.calc_mu() # calculate the chemical potential for the given density
S.G_iw << SK.extract_G_loc()[0] # extract the local Green function S.G_iw << SK.extract_G_loc()[0] # extract the local Green function
S.G0_iw << inverse(S.Sigma_iw + inverse(S.G_iw)) # finally get G0, the input for the Solver S.G0_iw << inverse(S.Sigma_iw + inverse(S.G_iw)) # finally get G0, the input for the solver
S.solve(h_int=h_int, **p) # now solve the impurity problem S.solve(h_int=h_int, **p) # now solve the impurity problem
@ -61,24 +65,18 @@ iterations and the self-consistency condition::
SK.calc_dc(dm, U_interact=U, J_hund=J, orb=0, use_dc_formula=1) # Set the double counting term SK.calc_dc(dm, U_interact=U, J_hund=J, orb=0, use_dc_formula=1) # Set the double counting term
SK.save(['chemical_potential','dc_imp','dc_energ']) # Save data in the hdf5 archive SK.save(['chemical_potential','dc_imp','dc_energ']) # Save data in the hdf5 archive
These basic steps are enough to set up the basic DMFT Loop. For a detailed These steps are enough for a basic DMFT Loop.
description of the :class:`SumkDFT <pytriqs.applications.dft.sumk_dft.SumkDFT>` routines, see the reference After the self-consistency steps, which lead to a new :math:`G^0(i\omega)`,
manual. the impurity solver is called. Different to model calculations, we have to do a few
After
the self-consistency steps (extracting a new :math:`G^0(i\omega)`),
the Anderson impurity problem is solved.
Different to model calculations, we have to do a few
more steps after this, because of the double-counting correction. We first more steps after this, because of the double-counting correction. We first
calculate the density of the impurity problem. Then, the routine `calc_dc` calculate the density of the impurity problem. Then, the routine :meth:`calc_dc <dft.sumk_dft.SumkDFT.calc_dc>`
takes as parameters this density matrix, the Coulomb interaction, Hund's rule takes as parameters this density matrix, the Coulomb interaction, Hund's rule
coupling, and the type of double-counting that should be used. Possible values coupling, and the type of double-counting that should be used. Possible values
for `use_dc_formula` are: for :emphasis:`use_dc_formula` are:
* `0`: Full-localised limit * `0`: Full-localised limit (FLL)
* `1`: DC formula as given in K. Held, Adv. Phys. 56, 829 (2007). * `1`: DC formula as given in K. Held, Adv. Phys. 56, 829 (2007).
* `2`: Around-mean-field * `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 Greens function and self energy into a file::
@ -89,65 +87,21 @@ At the end of the calculation, we can save the Greens function and self energy i
ar["G"] = S.G_iw ar["G"] = S.G_iw
ar["Sigma"] = S.Sigma_iw ar["Sigma"] = S.Sigma_iw
This is it! These are the essential steps necessary for a one-shot DFT+DMFT calculation.
For a detailed description of the :class:`SumkDFT <dft.sumk_dft.SumkDFT>`
routines, see the :ref:`reference manual <reference>`. To perform full charge self-consistent calculations, there
are some more things to consider, which we will see :ref:`later on <full_charge_selfcons>`.
These are the essential steps to do a one-shot DFT+DMFT calculation. .. _restartcalc:
For full charge-self consistent calculations, there are some more things
to consider, which we will see later on.
A full DFT+DMFT calculation Restarting a calculation
--------------------------- ------------------------
We will discuss now how to set up a full working calculation, Often only a few DMFT iterations are performed first, and thus, it is desirable to
including setting up the CTHYB solver, and specifying some more parameters carry out further iterations, e.g. to improve on the convergence. With a little modification
in order to make the calculation more efficient. Here, we at the initialization stage (before the DMFT loop) it is possible to detect if previous runs
will see a more advanced example, which is also suited for parallel are present, or if the calculation should start from scratch::
execution. For the convenience of the user, we provide also two
working python scripts in this documentation. One for a calculation
using Kanamori definitions (:download:`dft_dmft_cthyb.py
<images_scripts/dft_dmft_cthyb.py>`) and one with a
rotational-invariant Slater interaction Hamiltonian (:download:`dft_dmft_cthyb_slater.py
<images_scripts/dft_dmft_cthyb.py>`). The user has to adapt these
scripts to his own needs.
First, we load the necessary modules::
from pytriqs.applications.dft.sumk_dft import *
from pytriqs.gf.local import *
from pytriqs.archive import HDFArchive
from pytriqs.operators.util import *
from pytriqs.applications.impurity_solvers.cthyb import *
The last two lines load the modules for the construction of the CTHYB
solver.
Then we define some parameters::
dft_filename='SrVO3'
U = 4.0
J = 0.65
beta = 40
loops = 10 # Number of DMFT sc-loops
sigma_mix = 0.8 # Mixing factor of Sigma after solution of the AIM
dc_type = 1 # DC type: 0 FLL, 1 Held, 2 AMF
use_blocks = True # use bloc structure from DFT input
prec_mu = 0.0001
# Solver parameters
p = {}
p["length_cycle"] = 200
p["n_warmup_cycles"] = 2000
p["n_cycles"] = 20000
Most of these parameters are self-explanatory. The first,
`dft_filename`, gives the filename of the input files. For more
details on the solver parameters, we refer the user to
the :ref:`CTHYB solver <triqscthyb:welcome>` documentation.
We assume that the conversion to the hdf5 archive is already done. We
can check now in this archive, if previous runs are present, or if we have to start
from scratch::
previous_runs = 0 previous_runs = 0
previous_present = False previous_present = False
@ -165,127 +119,49 @@ from scratch::
previous_present = mpi.bcast(previous_present) previous_present = mpi.bcast(previous_present)
You can see in this code snippet, that all results of this calculation You can see from this code snippet, that removing the subgroup :emphasis:`dmft_results` from the
will be stored in a separate subgroup in the hdf5 file, called hdf file has the effect of reseting the calculation to the starting point. If there are previous
`dmft_output`. Removing this subgroup allows you to reset your runs stored in the hdf5 archive, we can now load the self energy, the chemical potential and
calculation to the starting point easily. double counting values of the last iteration::
Now we can use all this information to initialise the :class:`SumkDFT <pytriqs.applications.dft.sumk_dft.SumkDFT>` class::
SK = SumkDFT(hdf_file=dft_filename+'.h5',use_dft_blocks=use_blocks)
The next step is to initialise the :class:`Solver <pytriqs.applications.impurity_solvers.cthyb.Solver>` class. It consist
of two steps
#. Calculating the multi-band interaction matrix, and setting up the
interaction Hamiltonian
#. Setting up the solver class
The first step is done using methods of
the :ref:`TRIQS <triqslibs:welcome>` library::
n_orb = SK.corr_shells[0]['dim']
l = SK.corr_shells[0]['l']
spin_names = ["up","down"]
orb_names = [i for i in range(n_orb)]
# Use GF structure determined by DFT blocks:
gf_struct = SK.gf_struct_solver[0]
# Construct U matrix for density-density calculations:
Umat, Upmat = U_matrix_kanamori(n_orb=n_orb, U_int=U, J_hund=J)
We assumed here that we want to use an interaction matrix with
Kanamori definitions of :math:`U` and :math:`J`. For
other choices (Slater interaction matrix for instance), and other
parameters, we refer to the reference manual
of the :ref:`TRIQS <triqslibs:welcome>` library.
Next, we construct the Hamiltonian and the solver::
h_int = h_int_density(spin_names, orb_names, map_operator_structure=SK.sumk_to_solver[0], U=Umat, Uprime=Upmat)
S = Solver(beta=beta, gf_struct=gf_struct)
As you see, we take only density-density interactions into
account. Other choices for the Hamiltonian are
* h_int_kanamori
* h_int_slater
These two include full rotational invariant interactions. Again,
options can be found in the :ref:`TRIQS <triqslibs:welcome>` library
reference manual.
If there are previous runs stored in the hdf5 archive, we can now load the self energy
of the last iteration::
if previous_present: if previous_present:
if mpi.is_master_node(): if mpi.is_master_node():
ar = HDFArchive(dft_filename+'.h5','a') ar = HDFArchive(dft_filename+'.h5','a')
S.Sigma_iw << ar['dmft_output']['Sigma_iw'] S.Sigma_iw << ar['dmft_output']['Sigma_iw']
del ar del ar
chemical_potential,dc_imp,dc_energ = SK.load(['chemical_potential','dc_imp','dc_energ'])
S.Sigma_iw << mpi.bcast(S.Sigma_iw) S.Sigma_iw << mpi.bcast(S.Sigma_iw)
chemical_potential,dc_imp,dc_energ = SK.load(['chemical_potential','dc_imp','dc_energ'])
SK.set_mu(chemical_potential) SK.set_mu(chemical_potential)
SK.set_dc(dc_imp,dc_energ) SK.set_dc(dc_imp,dc_energ)
The self-energy is broadcast from the master node to the slave nodes. Also, the The data is loaded only on the master node, and therefore we broadcast it to the slave nodes.
last saved chemical potential and double counting values are read in and set. Be careful when storing the :emphasis:`iteration_number` as we also have to add the previous
iteration count::
Now we can go to the definition of the self-consistency step. It consists again ar['dmft_output']['iterations'] = iteration_number + previous_runs
of the basic steps discussed in the previous section, with some additional
refinements::
for iteration_number in range(1,loops+1): .. _mixing:
if mpi.is_master_node(): print "Iteration = ", iteration_number
SK.symm_deg_gf(S.Sigma_iw,orb=0) # symmetrise Sigma
SK.set_Sigma([ S.Sigma_iw ]) # put Sigma into the SumK class
chemical_potential = SK.calc_mu( precision = prec_mu ) # find the chemical potential for given density
S.G_iw << SK.extract_G_loc()[0] # calc the local Green function
mpi.report("Total charge of Gloc : %.6f"%S.G_iw.total_density())
# Init the DC term and the real part of Sigma, if no previous runs found: Mixing
if (iteration_number==1 and previous_present==False): ------
dm = S.G_iw.density()
SK.calc_dc(dm, U_interact = U, J_hund = J, orb = 0, use_dc_formula = dc_type)
S.Sigma_iw << SK.dc_imp[0]['up'][0,0]
# Calculate new G0_iw to input into the solver: In some cases a mixing of two consecutive self energies (or alternatively two hybridization
S.G0_iw << S.Sigma_iw + inverse(S.G_iw) functions) can be necessary in order to ensure convergence::
S.G0_iw << inverse(S.G0_iw)
# Solve the impurity problem: mix = 0.8 # mixing factor
S.solve(h_int=h_int, **p)
# Solved. Now do post-solution stuff:
mpi.report("Total charge of impurity problem : %.6f"%S.G_iw.total_density())
# Now mix Sigma and G with factor sigma_mix, if wanted:
if (iteration_number>1 or previous_present): if (iteration_number>1 or previous_present):
if mpi.is_master_node(): if mpi.is_master_node():
ar = HDFArchive(dft_filename+'.h5','a') ar = HDFArchive(dft_filename+'.h5','a')
mpi.report("Mixing Sigma and G with factor %s"%sigma_mix) mpi.report("Mixing Sigma and G with factor %s"%mix)
S.Sigma_iw << sigma_mix * S.Sigma_iw + (1.0-sigma_mix) * ar['dmft_output']['Sigma_iw'] S.Sigma_iw << mix * S.Sigma_iw + (1.0-mix) * ar['dmft_output']['Sigma_iw']
S.G_iw << sigma_mix * S.G_iw + (1.0-sigma_mix) * ar['dmft_output']['G_iw'] S.G_iw << mix * S.G_iw + (1.0-mix) * ar['dmft_output']['G_iw']
del ar del ar
S.G_iw << mpi.bcast(S.G_iw) S.G_iw << mpi.bcast(S.G_iw)
S.Sigma_iw << mpi.bcast(S.Sigma_iw) S.Sigma_iw << mpi.bcast(S.Sigma_iw)
# Write the final Sigma and G to the hdf5 archive: In this little piece of code, which should be placed after calling the solver, two consecutive
if mpi.is_master_node(): self energies are linearly mixed with the factor :emphasis:`mix`. Of course, it is possible
ar = HDFArchive(dft_filename+'.h5','a') to implement more advanced mixing schemes (e.g. Broyden's methods), however, in most cases
ar['dmft_output']['iterations'] = iteration_number + previous_runs simple linear mixing or even no mixing is sufficient for a reasonably fast convergence.
ar['dmft_output']['G_0'] = S.G0_iw
ar['dmft_output']['G_tau'] = S.G_tau
ar['dmft_output']['G_iw'] = S.G_iw
ar['dmft_output']['Sigma_iw'] = S.Sigma_iw
del ar
# Set the new double counting:
dm = S.G_iw.density() # compute the density matrix of the impurity problem
SK.calc_dc(dm, U_interact = U, J_hund = J, orb = 0, use_dc_formula = dc_type)
# Save stuff into the dft_output group of hdf5 archive in case of rerun:
SK.save(['chemical_potential','dc_imp','dc_energ'])
This is all we need for the DFT+DMFT calculation. At the end, all results are stored in the hdf5 output file.

View File

@ -89,7 +89,7 @@ however there are also some differences. First difference is that we import the
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. 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 We load and convert the :program:`dmftproj` output and initialize the
:class:`SumkDFT <pytriqs.applications.dft.sumk_dft.SumkDFT>` class as described in :ref:`conversion` and :class:`SumkDFT <dft.sumk_dft.SumkDFT>` class as described in :ref:`conversion` and
:ref:`singleshot` and then set up the Hubbard-I solver :: :ref:`singleshot` and then set up the Hubbard-I solver ::
S = Solver(beta = beta, l = l) S = Solver(beta = beta, l = l)
@ -206,7 +206,7 @@ symmetries::
Converter.convert_parpoj_input() Converter.convert_parpoj_input()
To get access to analysing tools we initialize the To get access to analysing tools we initialize the
:class:`SumkDFTTools <pytriqs.applications.dft.sumk_dft_tools.SumkDFTTools>` class :: :class:`SumkDFTTools <dft.sumk_dft_tools.SumkDFTTools>` class ::
SK = SumkDFTTools(hdf_file=dft_filename+'.h5', use_dft_blocks=False) SK = SumkDFTTools(hdf_file=dft_filename+'.h5', use_dft_blocks=False)

Binary file not shown.

After

Width:  |  Height:  |  Size: 46 KiB

View File

@ -6,10 +6,10 @@ from pytriqs.gf.local import *
from pytriqs.applications.dft.sumk_dft import * from pytriqs.applications.dft.sumk_dft import *
dft_filename='SrVO3' dft_filename='SrVO3'
U = U.0 U = 4.0
J = 0.65 J = 0.65
beta = 40 beta = 40
loops = 10 # Number of DMFT sc-loops loops = 15 # Number of DMFT sc-loops
sigma_mix = 1.0 # Mixing factor of Sigma after solution of the AIM 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 delta_mix = 1.0 # Mixing factor of Delta as input for the AIM
dc_type = 1 # DC type: 0 FLL, 1 Held, 2 AMF dc_type = 1 # DC type: 0 FLL, 1 Held, 2 AMF
@ -20,9 +20,14 @@ h_field = 0.0
# Solver parameters # Solver parameters
p = {} p = {}
p["max_time"] = -1 p["max_time"] = -1
p["length_cycle"] = 50 p["random_seed"] = 123 * mpi.rank + 567
p["n_warmup_cycles"] = 50 p["length_cycle"] = 200
p["n_cycles"] = 5000 p["n_warmup_cycles"] = 100000
p["n_cycles"] = 1000000
p["perfrom_tail_fit"] = True
p["fit_max_moments"] = 4
p["fit_min_n"] = 30
p["fit_max_n"] = 60
# If conversion step was not done, we could do it here. Uncomment the lines it you want to do this. # If conversion step was not done, we could do it here. Uncomment the lines it you want to do this.
#from pytriqs.applications.dft.converters.wien2k_converter import * #from pytriqs.applications.dft.converters.wien2k_converter import *
@ -141,6 +146,5 @@ for iteration_number in range(1,loops+1):
dm = S.G_iw.density() # compute the density matrix of the impurity problem dm = S.G_iw.density() # compute the density matrix of the impurity problem
SK.calc_dc(dm, U_interact = U, J_hund = J, orb = 0, use_dc_formula = dc_type) SK.calc_dc(dm, U_interact = U, J_hund = J, orb = 0, use_dc_formula = dc_type)
# Save stuff into the dft_output group of hdf5 archive in case of rerun: # Save stuff into the user_data group of hdf5 archive in case of rerun:
SK.save(['chemical_potential','dc_imp','dc_energ']) SK.save(['chemical_potential','dc_imp','dc_energ'])

View File

@ -6,7 +6,7 @@ from pytriqs.gf.local import *
from pytriqs.applications.dft.sumk_dft import * from pytriqs.applications.dft.sumk_dft import *
from pytriqs.applications.dft.converters.wien2k_converter import * from pytriqs.applications.dft.converters.wien2k_converter import *
dft_filename='Gd_fcc' dft_filename='SrVO3'
U = 9.6 U = 9.6
J = 0.8 J = 0.8
beta = 40 beta = 40
@ -21,9 +21,14 @@ h_field = 0.0
# Solver parameters # Solver parameters
p = {} p = {}
p["max_time"] = -1 p["max_time"] = -1
p["length_cycle"] = 50 p["random_seed"] = 123 * mpi.rank + 567
p["n_warmup_cycles"] = 50 p["length_cycle"] = 200
p["n_cycles"] = 5000 p["n_warmup_cycles"] = 100000
p["n_cycles"] = 1000000
p["perfrom_tail_fit"] = True
p["fit_max_moments"] = 4
p["fit_min_n"] = 30
p["fit_max_n"] = 60
# If conversion step was not done, we could do it here. Uncomment the lines it you want to do this. # If conversion step was not done, we could do it here. Uncomment the lines it you want to do this.
#from pytriqs.applications.dft.converters.wien2k_converter import * #from pytriqs.applications.dft.converters.wien2k_converter import *
@ -144,5 +149,3 @@ for iteration_number in range(1,loops+1):
# Save stuff into the dft_output group of hdf5 archive in case of rerun: # Save stuff into the dft_output group of hdf5 archive in case of rerun:
SK.save(['chemical_potential','dc_imp','dc_energ']) SK.save(['chemical_potential','dc_imp','dc_energ'])

View File

@ -1,6 +1,6 @@
.. _Transport: .. _Transport:
Transport calculations test Transport calculations
============================ ============================
Formalism Formalism
@ -44,13 +44,13 @@ real-frequency self energy by doing an analytic continuation.
it is crucial to perform the analytic continuation in such a way that the obtained real frequency self energy 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! 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 <pytriqs.applications.dft.converters.wien2k_converter.Wien2kConverter.convert_transport_input>`) are: Besides the self energy the Wien2k files read by the transport converter (:meth:`convert_transport_input <dft.converters.wien2k_converter.Wien2kConverter.convert_transport_input>`) are:
* :file:`.struct`: The lattice constants specified in the struct file are used to calculate the unit cell volume. * :file:`.struct`: The lattice constants specified in the struct file are used to calculate the unit cell volume.
* :file:`.outputs`: In this file the k-point symmetries are given. * :file:`.outputs`: In this file the k-point symmetries are given.
* :file:`.oubwin`: Contains the indices of the bands within the projected subspace (written by :program:`dmftproj`) for each k-point. * :file:`.oubwin`: Contains the indices of the bands within the projected subspace (written by :program:`dmftproj`) for each k-point.
* :file:`.pmat`: This file is the output of the Wien2k optics package and contains the velocity (momentum) matrix elements between all bands in the desired energy * :file:`.pmat`: This file is the output of the Wien2k optics package and contains the velocity (momentum) matrix elements between all bands in the desired energy
window for each k-point. How to use the optics package is described below. window for each k-point. How to use the optics package is described below.
* :file:`.h5`: The hdf5 archive has to be present and should contain the dft_input subgroup. Otherwise :meth:`convert_dft_input <pytriqs.applications.dft.converters.wien2k_converter.Wien2kConverter.convert_dft_input>` needs to be called before :meth:`convert_transport_input <pytriqs.applications.dft.converters.wien2k_converter.Wien2kConverter.convert_transport_input>`. * :file:`.h5`: The hdf5 archive has to be present and should contain the dft_input subgroup. Otherwise :meth:`convert_dft_input <dft.converters.wien2k_converter.Wien2kConverter.convert_dft_input>` needs to be called before :meth:`convert_transport_input <dft.converters.wien2k_converter.Wien2kConverter.convert_transport_input>`.
Wien2k optics package Wien2k optics package
@ -84,7 +84,7 @@ First we have to read the Wien2k files and store the relevant information in the
SK = SumkDFTTools(hdf_file='case.h5', use_dft_blocks=True) SK = SumkDFTTools(hdf_file='case.h5', use_dft_blocks=True)
The converter :meth:`convert_transport_input <pytriqs.applications.dft.converters.wien2k_converter.Wien2kConverter.convert_transport_input>` The converter :meth:`convert_transport_input <dft.converters.wien2k_converter.Wien2kConverter.convert_transport_input>`
reads the required data of the Wien2k output and stores it in the `dft_transp_input` subgroup of your hdf file. reads the required data of the Wien2k output and stores it in the `dft_transp_input` subgroup of your hdf file.
Additionally we need to read and set the self energy, the chemical potential and the double counting:: Additionally we need to read and set the self energy, the chemical potential and the double counting::
@ -104,7 +104,7 @@ Here the transport distribution is calculated in :math:`xx` direction for the fr
To use the previously obtained self energy we set with_Sigma to True and the broadening to :math:`0.0`. To use the previously obtained self energy we set with_Sigma to True and the broadening to :math:`0.0`.
As we also want to calculate the Seebeck coefficient we have to include :math:`\Omega=0.0` in the mesh. As we also want to calculate the Seebeck coefficient we have to include :math:`\Omega=0.0` in the mesh.
Note that the current version of the code repines the :math:`\Omega` values to the closest values on the self energy mesh. Note that the current version of the code repines the :math:`\Omega` values to the closest values on the self energy mesh.
For complete description of the input parameters see the :meth:`transport_distribution reference <pytriqs.applications.dft.sumk_dft_tools.SumkDFTTools.transport_distribution>`. For complete description of the input parameters see the :meth:`transport_distribution reference <dft.sumk_dft_tools.SumkDFTTools.transport_distribution>`.
The resulting transport distribution is not automatically saved, but this can be easily achieved with:: The resulting transport distribution is not automatically saved, but this can be easily achieved with::

View File

@ -2,10 +2,10 @@
.. module:: pytriqs.applications.dft .. module:: pytriqs.applications.dft
.. _dfttools: .. _dft:
DFTTools DFTTools
========= ========
This :ref:`TRIQS-based <triqslibs:welcome>`-based application is aimed This :ref:`TRIQS-based <triqslibs:welcome>`-based application is aimed
at ab-initio calculations for at ab-initio calculations for

View File

@ -1223,8 +1223,11 @@ class SumkDFT:
therefore calculated separately for each `k`-point. therefore calculated separately for each `k`-point.
Since in general n_orbitals depends on k, the calculation is done in the following order: Since in general n_orbitals depends on k, the calculation is done in the following order:
.. math:: n_{tot} = \sum_{k} n(k), .. math:: n_{tot} = \sum_{k} n(k),
with with
.. math:: n(k) = Tr G_{\nu\nu'}(k, i\omega_{n}). .. math:: n(k) = Tr G_{\nu\nu'}(k, i\omega_{n}).
The calculation is done in the global coordinate system, if distinction is made between local/global. The calculation is done in the global coordinate system, if distinction is made between local/global.