3
0
mirror of https://github.com/triqs/dft_tools synced 2024-06-29 16:34:53 +02:00

First part of revamping the VASP interface documentation. Rewrote the interface with VASP guid. Removed the unused doc/vasp/* files. Start for SVO VASP tutorial as ipynb

This commit is contained in:
Alexander Hampel 2019-12-03 19:29:09 -05:00
parent 4b8a284a98
commit 4d50e41135
22 changed files with 580 additions and 1246 deletions

View File

@ -14,7 +14,11 @@ extensions = ['sphinx.ext.autodoc',
'sphinx.ext.todo',
'sphinx.ext.viewcode',
'sphinx.ext.autosummary',
'numpydoc']
'nbsphinx',
'numpydoc',
'sphinx.ext.githubpages',
'IPython.sphinxext.ipython_console_highlighting'
]
source_suffix = '.rst'

View File

@ -1,46 +1,63 @@
.. _convVASP:
===================
Interface with VASP
===================
.. warning::
The VASP interface is in the alpha-version. The documentation may, thus, be subject to changes before the final release.
The VASP interface relies on new options introduced since version 5.4.x In
particular, a new INCAR-option `LOCPROJ
<https://cms.mpi.univie.ac.at/wiki/index.php/LOCPROJ>`_, the new `LORBIT` modes
13 and 14 have been added, and the new `ICHARG` mode 5 for charge
self-consistent DFT+DMFT calculations have been added.
*Limitations of the alpha-version:*
The VASP interface methodologically builds on the so called projection on
localized orbitals (PLO) scheme, where the resulting KS states from DFT are
projected on localized orbitals, which defines a basis for setting up a
Hubbard-like model Hamiltonian. Resulting in lattice object stored in `SumkDFT`.
The implementation is presented in `M. Schüler et al. 2018 J. Phys.: Condens.
Matter 30 475901 <https://doi.org/10.1088/1361-648X/aae80a>`_.
* The interface works correctly only if the k-point symmetries
are turned off during the VASP run (ISYM=-1).
The interface consists of two parts, :ref:`PLOVASP<refPLOVASP>`, a collection of
python classes and functions converting the raw VASP output to proper projector
functions, and the python based :ref:`VaspConverter<refVASPconverter>`, which
creates a h5 archive from the :ref:`PLOVASP<refPLOVASP>` output readable by
`SumkDFT`. Therefore, the conversion consist always of two steps.
* Generation of projectors for k-point lines (option `Lines` in KPOINTS)
needed for Bloch spectral function calculations is not possible at the moment.
Here, we will present a guide how the interface `can` be used to create input for a DMFT calculation, using SrVO3 as an example. Full examples can be found in the :ref:`tutorial section of DFTTools<tutorials>`.
* The interface currently supports only collinear-magnetism calculation
(this implis no spin-orbit coupling) and
spin-polarized projectors have not been tested.
|
Limitations of the interface
============================
A detailed description of the VASP converter tool PLOVasp can be found
in the :ref:`PLOVasp User's Guide <plovasp>`. Here, a quick-start guide is presented.
* The interface works correctly only if the k-point symmetries
are turned off during the VASP run (ISYM=-1).
* Generation of projectors for k-point lines (option `Lines` in KPOINTS)
needed for Bloch spectral function calculations is not possible at the moment.
* The interface currently supports only collinear-magnetism calculation
(this implies no spin-orbit coupling) and spin-polarized projectors have not
been tested.
The VASP interface relies on new options introduced since version
5.4.x. In particular, a new INCAR-option `LOCPROJ`
and new `LORBIT` modes 13 and 14 have been added as well as the new ICHARG
mode 5 for charge self-consistent calculations
|
VASP: generating raw projectors
===============================
Option `LOCPROJ` selects a set of localized projectors that will
be written to file `LOCPROJ` after a successful VASP run.
A projector set is specified by site indices,
labels of the target local states, and projector type:
The VASP **INCAR** option `LOCPROJ` selects a set of localized projectors that
will be written to the file **LOCPROJ** after a successful VASP run. A projector set is specified by site indices, labels of the target local states, and projector type:
| `LOCPROJ = <sites> : <shells> : <projector type>`
where `<sites>` represents a list of site indices separated by spaces,
with the indices corresponding to the site position in the POSCAR file;
`<shells>` specifies local states (see below);
`<projector type>` chooses a particular type of the local basis function.
The recommended projector type is `Pr 2`. The formalism for this type
of projectors is presented in
`M. Schüler et al. 2018 J. Phys.: Condens. Matter 30 475901 <https://doi.org/10.1088/1361-648X/aae80a>`_. For details on `LOCPROJ` also have a look in the `VASP wiki <https://cms.mpi.univie.ac.at/wiki/index.php/LOCPROJ>`_
where `<sites>` represents a list of site indices separated by spaces, with the
indices corresponding to the site position in the **POSCAR** file; `<shells>`
specifies local states (see below); `<projector type>` chooses a particular type
of the local basis function. The recommended projector type is `Pr 2`. This will
perform a projection of the Kohn-Sham states onto the VASP PAW projector
functions. The number specified behind `Pr` is selecting a specific PAW channel,
see the `VASP wiki page <https://cms.mpi.univie.ac.at/wiki/index.php/LOCPROJ>`_
for more information. The formalism for this type of projectors is presented in
`M. Schüler et al. 2018 J. Phys.: Condens. Matter 30 475901
<https://doi.org/10.1088/1361-648X/aae80a>`_. For further details on the
`LOCPROJ` flag also have a look in the `VASP wiki
<https://cms.mpi.univie.ac.at/wiki/index.php/LOCPROJ>`_.
The allowed labels of the local states defined in terms of cubic
harmonics are:
@ -54,16 +71,25 @@ harmonics are:
* `f`-states: `fy(3x2-y2)`, `fxyz`, `fyz2`, `fz3`,
`fxz2`, `fz(x2-y2)`, `fx(x2-3y2)`.
For projector type `Pr 2`, one should also set `LORBIT = 14` in the INCAR file
and provide parameters `EMIN`, `EMAX`, defining, in this case, an
energy range (energy window) corresponding to the valence states.
Note that, as in the case
of a DOS calculation, the position of the valence states depends on the
Fermi level, which can usually be found at the end of the OUTCAR file.
For projector type `Pr`, one should ideally also set `LORBIT = 14` in the
INCAR file and provide parameters `EMIN`, `EMAX`, defining, in this case, an
energy range (energy window) corresponding to the valence states. Note that,
as in the case of a DOS calculation, the position of the valence states
depends on the Fermi level, which can usually be found at the end of the
OUTCAR file. Setting `LORBIT=14` will perform an automatic optimization of
the PAW projector channel as described in `M. Schüler et al. 2018 J. Phys.:
Condens. Matter 30 475901 <https://doi.org/10.1088/1361-648X/aae80a>`_, by
using a linear combination of the PAW channels, to maximize the overlap in
the chosen energy window between the projector and the Kohn-Sham state.
Therefore, setting `LORBIT=14` will let VASP ignore the channel specified
after `Pr`. This optimization is only performed for the projector type `Pr`,
not for `Ps` and obviously not for `Hy`. We recommend to specify the PAW
channel anyway, in case one forgets to set `LORBIT=14`.
For example, in case of SrVO3 one may first want to perform a self-consistent
calculation, then set `ICHARGE = 1` and add the following additional
lines into INCAR (provided that V is the second ion in POSCAR):
In case of SrVO3 one may first want to perform a self-consistent
calculation to know the Fermi level and the rough position of the target states.
In the next step one sets `ICHARGE = 1` and adds the following additional lines
into INCAR (provided that V is the second ion in POSCAR):
| `EMIN = 3.0`
| `EMAX = 8.0`
@ -71,73 +97,283 @@ lines into INCAR (provided that V is the second ion in POSCAR):
| `LOCPROJ = 2 : d : Pr 2`
The energy range does not have to be precise. Important is that it has a large
overlap with valence bands and no overlap with semi-core or high unoccupied states.
overlap with valence bands and no overlap with semi-core or high unoccupied
states. This **INCAR** will calculate and write-out projections for all five d-orbitals.
VASP input-output
-----------------
The calculated projections :math:`\langle \chi_L | \Psi_\mu \rangle` are written
into files **PROJCAR** and **LOCPROJ**. The difference between these two files
is that **LOCPROJ** contains raw matrices without any reference to
sites/orbitals, while **PROJCAR** is more detailed. In particular, the
information that can be obtained for each projector from **PROJCAR** is the
following:
* site (and species) index
* for each `k`-point and band: a set of complex numbers for labeled orbitals
At the same time, **LOCPROJ** contains the total number of projectors (as well
as the number of `k`-points, bands, and spin channels) in the first line, which
can be used to allocate the arrays before parsing.
|
Conversion for the DMFT self-consistency cycle
----------------------------------------------
==============================================
The projectors generated by VASP require certain post-processing before
they can be used for DMFT calculations. The most important step is to normalize
The projectors generated by VASP require certain post-processing before they can
be used for DMFT calculations. The most important step is to (ortho-)normalize
them within an energy window that selects band states relevant for the impurity
problem. Note that this energy window is different from the one described above
and it must be chosen independently of the energy
range given by `EMIN, EMAX` in INCAR.
problem. This will create proper Wannier functions of the initial projections
produced by VASP. Note that this energy window is different from the one
described above and it must be chosen independently of the energy range given by
`EMIN, EMAX` in the **INCAR** VASP input file. This part is done in `PLOVASP`.
Post-processing of `LOCPROJ` data is generally done as follows:
#. Prepare an input file `<name>.cfg` (e.g., `plo.cfg`) that describes the definition
of your impurity problem (more details below).
PLOVASP: converting VASP output
--------------------------------
#. Extract the value of the Fermi level from OUTCAR and paste it at the end of
the first line of LOCPROJ.
:ref:`PLOVASP<refPLOVASP>` is a collection of python functions and classes, post-processing the raw VASP `LOCPROJ` output creating proper projector functions.
#. Run :program:`plovasp` with the input file as an argument, e.g.:
The following VASP files are used by PLOVASP:
* PROJCAR, LOCPROJ: raw projectors generated by VASP-PLO interface
* EIGENVAL: Kohn-Sham eigenvalues as well as `k`-points with weights and Fermi weights
* IBZKPT: `k`-point data (:math:`\Gamma`)
* POSCAR: crystal structure data
| `plovasp plo.cfg`
To run `PLOVASP`, one first prepares an input file `<name>.cfg` (default name `plo.cfg`) that describes the definition of the correlated subspace. For SrVO3 this input file would look like this:
This requires that the TRIQS paths are set correctly (see Installation
of TRIQS).
.. literalinclude:: ../tutorials/svo_vasp/plo.cfg
If everything goes right one gets files `<name>.ctrl` and `<name>.pg1`.
These files are needed for the converter that will be invoked in your
DMFT script.
In the [section] general, the `DOSMESH` defines an energy window and number of
data points, which lets the converter calculate the density of states of the
created projector functions in a given energy window. Each projector shell is
defined by a section `[Shell 1]` where the number can be arbitrary and used only
for user convenience. Several parameters are required
The format of input file `<name>.cfg` is described in details in
the :ref:`User's Guide <plovasp>`. Here we just consider a simple example for the case
of SrVO3:
.. literalinclude:: images_scripts/srvo3.cfg
A projector shell is defined by a section `[Shell 1]` where the number
can be arbitrary and used only for user convenience. Several
parameters are required
- **IONS**: list of site indices which must be a subset of indices
given earlier in `LOCPROJ`.
- **IONS**: list of site indices which must be a subset of indices given earlier
in the VASP INCAR `LOCPROJ` flag. Note: If projections are performed for
multiple sites one can specify symmetry equivalent sites with brackets: `[2
3]`. Here the projector are generated for ions 2 and 3, but they will be
marked as symmetry equivalent later in 'SumkDFT'.
- **LSHELL**: :math:`l`-quantum number of the projector shell; the corresponding
orbitals must be present in `LOCPROJ`.
- **EWINDOW**: energy window in which the projectors are normalized;
note that the energies are defined with respect to the Fermi level.
Option **TRANSFORM** is optional but here, it is specified to extract
only three :math:`t_{2g}` orbitals out of five `d` orbitals given by
:math:`l = 2`.
The Option **TRANSFORM** is optional here, and it is specified to extract
only the three :math:`t_{2g}` orbitals out of the five `d` orbitals given by
:math:`l = 2`. A detailed explanation of all input parameters can be found
further below `PLOVASP guide`_.
The conversion to a h5-file is performed in the same way as for Wien2TRIQS::
Next, the converter is executed. This can be done by calling :program:`PLOVASP` directly in the command line with the input file as an argument, e.g.:
| `plovasp plo.cfg`
or embedded in a python script as::
import triqs_dft_tools.converters.plovasp.converter as plo_converter
# Generate and store PLOs
plo_converter.generate_and_output_as_text('plo.cfg', vasp_dir='./')
This will create the xml files `vasp.ctrl` and `vasp.pg1` containing the orthonormalized projector functions readable by the :ref:`VaspConverter<refVASPconverter>`. Moreover, `PLOVASP` will output important information of the orthonormalization process, such as the density matrix of the correlated shell and the local Hamiltonian.
Running the VASP converter
-------------------------------------
The actual conversion to a h5-file is performed with the orthonormalized projector functions readable by the :ref:`VaspConverter<refVASPconverter>` in the same fashion as with the other `DFTTools` converters::
from triqs_dft_tools.converters.vasp_converter import *
Converter = VaspConverter(filename = filename)
Converter = VaspConverter(filename = 'vasp')
Converter.convert_dft_input()
As usual, the resulting h5-file can then be used with the SumkDFT class.
As usual, the resulting h5-file can then be used with the SumkDFT class::
sk = SumkDFTTools(hdf_file='vasp.h5')
Note that the automatic detection of the correct block structure might
fail for VASP inputs.
This can be circumvented by setting a bigger value of the threshold in
:class:`SumkDFT <dft.sumk_dft.SumkDFT>`, e.g.::
Note that the automatic detection of the correct block structure might fail for
VASP inputs. This can be circumvented by setting a bigger value of the threshold
in :class:`SumkDFT <dft.sumk_dft.SumkDFT>`, e.g.::
SK.analyse_block_structure(threshold = 1e-4)
However, do this only after a careful study of the density matrix and
the projected DOS in the localized basis.
However, this should only be done after a careful study of the density matrix and the projected DOS in the localized basis. For the complete process for SrVO3 see the tutorial for the VASP interface `here <../tutorials/svo_vasp/svo_notebook.html>`_.
|
PLOVASP detailed guide
======================
The general purpose of the PLOVASP tool is to transform raw, non-normalized
projectors generated by VASP into normalized projectors corresponding to
user-defined projected localized orbitals (PLO). To enhance the performance
parsing the raw VASP output files, the parser is implemented in plain C. The
idea is that the python part of the parser first reads the first line of
**LOCPROJ** and then calls the C-routine with necessary parameters to parse
**PROJCAR**. The resulting PLOs can then be used for DFT+DMFT calculations with
or without charge self-consistency. PLOVASP also provides some utilities for
basic analysis of the generated projectors, such as outputting density matrices,
local Hamiltonians, and projected density of states.
PLOs are determined by the energy window in which the raw projectors are
normalized. This allows to define either atomic-like strongly localized Wannier
functions (large energy window) or extended Wannier functions focusing on
selected low-energy states (small energy window).
In PLOVASP, all projectors sharing the same energy window are combined into a
`projector group`. This allows one in principal to define several groups with
different energy windows for the same set of raw projectors. Note: multiple groups are not yet implemented.
A set of projectors defined on sites related to each other either by symmetry
or by an atomic sort, along with a set of :math:`l`, :math:`m` quantum numbers,
forms a `projector shell`. There could be several projectors shells in a
projector group, implying that they will be normalized within the same energy
window.
Projector shells and groups are specified by a user-defined input file whose
format is described below. Additionally, each shell can be marked correlated or non-correlated, to tell `SumkDFT` whether or not these should be treated in the DMFT impurity problem.
Input file format
-----------------
The input file is written in the standard config-file format.
Parameters (or 'options') are grouped into sections specified as
`[Section name]`. All parameters must be defined inside some section.
A PLOVASP input file can contain three types of sections:
#. **[General]**: includes parameters that are independent
of a particular projector set, such as the Fermi level, additional
output (e.g. the density of states), etc.
#. **[Group <Ng>]**: describes projector groups, i.e. a set of
projectors sharing the same energy window and normalization type.
At the moment, DFTtools support only one projector group, therefore
there should be no more than one projector group.
#. **[Shell <Ns>]**: contains parameters of a projector shell labelled
with `<Ns>`. If there is only one group section and one shell section,
the group section can be omitted but in this case, the group required
parameters must be provided inside the shell section.
Section [General]
"""""""""""""""""
The entire section is optional and it contains four parameters:
* **BASENAME** (string): provides a base name for output files.
Default filenames are :file:`vasp.*`.
* **DOSMESH** ([float float] integer): if this parameter is given,
the projected density of states for each projected orbital will be
evaluated and stored to files :file:`pdos_<s>_<n>.dat`, where `s` is the
shell index and `n` the ion index. The energy mesh is defined by three
numbers: `EMIN` `EMAX` `NPOINTS`. The first two
can be omitted in which case they are taken to be equal to the projector
energy window. **Important note**: at the moment this option works
only if the tetrahedron integration method (`ISMEAR = -4` or `-5`)
is used in VASP to produce `LOCPROJ`.
* **EFERMI** (float): provides the Fermi level. This value overrides
the one extracted from VASP output files.
* **HK** (True/False): If True, the projectors are applied the the Kohn-Sham
eigenvalues which results in a Hamitlonian H(k) in orbital basis. The H(k)
is written for each group to a file :file:`Basename.hk<Ng>`. It is recommended
to also set `COMPLEMENT = True` (see below). Default is False.
There are no required parameters in this section.
Section [Shell]
"""""""""""""""
This section specifies a projector shell. Each `[Shell]` section must be
labeled by an index, e.g. `[Shell 1]`. These indices can then be referenced
in a `[Group]` section.
In each `[Shell]` section two parameters are required:
* **IONS** (list of integer): indices of sites included in the shell.
The sites can be given either by a list of integers `IONS = 5 6 7 8`
or by a range `IONS = 5..8`. The site indices must be compatible with
the POSCAR file.
* **LSHELL** (integer): :math:`l` quantum number of the desired local states.
It is important that a given combination of site indices and local states
given by `LSHELL` must be present in the LOCPROJ file.
There are additional optional parameters that allow one to transform
the local states:
* **CORR** (True/False): Determines if shell is correlated or not. At least one
shell has to be correlated. Default is True.
* **TRANSFORM** (matrix): local transformation matrix applied to all states
in the projector shell. The matrix is defined by a (multiline) block
of floats, with each line corresponding to a row. The number of columns
must be equal to :math:`2 l + 1`, with :math:`l` given by `LSHELL`. Only real matrices
are allowed. This parameter can be useful to select certain subset of
orbitals or perform a simple global rotation.
* **TRANSFILE** (string): name of the file containing transformation
matrices for each site. This option allows for a full-fledged functionality
when it comes to local state transformations. The format of this file
is described :ref:`below <transformation_file>`.
Section [Group]
"""""""""""""""
Each defined projector shell must be part of a projector group. In the current
implementation of DFTtools only a single group (labelled by any integer, e.g. `[Group 1]`)
is supported. This implies that all projector shells
must be included in this group.
Required parameters for any group are the following:
* **SHELLS** (list of integers): indices of projector shells included in the group.
All defined shells must be grouped.
* **EWINDOW** (float float): the energy window specified by two floats: bottom
and top. All projectors in the current group are going to be normalized within
this window. *Note*: This option must be specified inside the `[Shell]` section
if only one shell is defined and the `[Group]` section is omitted.
Optional group parameters:
* **NORMALIZE** (True/False): specifies whether projectors in the group are
to be normalized. The default value is **True**.
* **NORMION** (True/False): specifies whether projectors are normalized on
a per-site (per-ion) basis. That is, if `NORMION = True`, the orthogonality
condition will be enforced on each site separately but the Wannier functions
on different sites will not be orthogonal. If `NORMION = False`, the Wannier functions
on different sites included in the group will be orthogonal to each other. The default value is **True**
* **BANDS** (int int): the energy window specified by two ints: band index of
lowest band and band index of highest band. Using this overrides the selection
in `EWINDOW`.
* **COMPLEMENT** (True/False). If True, the orthogonal complement is calculated
resulting in unitary (quadratic) projectors, i.e., the same number of orbitals
as bands. It is required to have an equal number of bands in the energy window
at each k-point. Default is False.
.. _transformation_file:
File of transformation matrices
"""""""""""""""""""""""""""""""
.. warning::
The description below applies only to collinear cases (i.e., without spin-orbit
coupling). In this case, the matrices are spin-independent.
The file specified by option `TRANSFILE` contains transformation matrices
for each ion. Each line must contain a series of floats whose number is either equal to
the number of orbitals :math:`N_{orb}` (in this case the transformation matrices
are assumed to be real) or to :math:`2 N_{orb}` (for the complex transformation matrices).
The total number of lines :math:`N` must be a multiple of the number of ions :math:`N_{ion}`
and the ratio :math:`N / N_{ion}`, then, gives the dimension of the transformed
orbital space. The lines with floats can be separated by any number of empty or
comment lines (starting from `#`), which are ignored.
A very simple example is a transformation matrix that selects the :math:`t_{2g}` manifold.
For two correlated sites, one can define the file as follows:
::
# Site 1
1.0 0.0 0.0 0.0 0.0
0.0 1.0 0.0 0.0 0.0
0.0 0.0 0.0 1.0 0.0
# Site 2
1.0 0.0 0.0 0.0 0.0
0.0 1.0 0.0 0.0 0.0
0.0 0.0 0.0 1.0 0.0

View File

@ -1,6 +1,6 @@
.. _conversion:
Supported interfaces
Supported interfaces
====================
The first step for a DMFT calculation is to provide the necessary
@ -9,12 +9,12 @@ calculation here in this documentation, but refer the user to the
documentation and tutorials that come with the actual DFT
package. At the moment, there are two full charge self consistent interfaces, for the
Wien2k and the VASP DFT packages, resp. In addition, there is an interface to Wannier90, as well
as a light-weight general-purpose interface. In the following, we will describe the usage of these
as a light-weight general-purpose interface. In the following, we will describe the usage of these
conversion tools.
.. toctree::
:maxdepth: 2
:maxdepth: 3
conv_wien2k
conv_vasp
conv_W90

View File

@ -1,180 +0,0 @@
.. _plovasp:
PLOVasp
=======
The general purpose of the PLOVasp tool is to transform raw, non-normalized
projectors generated by VASP into normalized projectors corresponding to
user-defined projected localized orbitals (PLO). The PLOs can then be used for
DFT+DMFT calculations with or without charge self-consistency. PLOVasp also
provides some utilities for basic analysis of the generated projectors, such as
outputting density matrices, local Hamiltonians, and projected density of
states.
PLOs are determined by the energy window in which the raw projectors are
normalized. This allows to define either atomic-like strongly localized Wannier
functions (large energy window) or extended Wannier functions focusing on
selected low-energy states (small energy window).
In PLOVasp, all projectors sharing the same energy window are combined into a
`projector group`. Technically, this allows one to define several groups with
different energy windows for the same set of raw projectors. Note, however,
that DFTtools does not support projector groups at the moment but this feature
might appear in future releases.
A set of projectors defined on sites related to each other either by symmetry
or by an atomic sort, along with a set of :math:`l`, :math:`m` quantum numbers,
forms a `projector shell`. There could be several projectors shells in a
projector group, implying that they will be normalized within the same energy
window.
Projector shells and groups are specified by a user-defined input file whose
format is described below.
Input file format
-----------------
The input file is written in the standard config-file format.
Parameters (or 'options') are grouped into sections specified as
`[Section name]`. All parameters must be defined inside some section.
A PLOVasp input file can contain three types of sections:
#. **[General]**: includes parameters that are independent
of a particular projector set, such as the Fermi level, additional
output (e.g. the density of states), etc.
#. **[Group <Ng>]**: describes projector groups, i.e. a set of
projectors sharing the same energy window and normalization type.
At the moment, DFTtools support only one projector group, therefore
there should be no more than one projector group.
#. **[Shell <Ns>]**: contains parameters of a projector shell labelled
with `<Ns>`. If there is only one group section and one shell section,
the group section can be omitted but in this case, the group required
parameters must be provided inside the shell section.
Section [General]
"""""""""""""""""
The entire section is optional and it contains four parameters:
* **BASENAME** (string): provides a base name for output files.
Default filenames are :file:`vasp.*`.
* **DOSMESH** ([float float] integer): if this parameter is given,
the projected density of states for each projected orbital will be
evaluated and stored to files :file:`pdos_<s>_<n>.dat`, where `s` is the
shell index and `n` the ion index. The energy mesh is defined by three
numbers: `EMIN` `EMAX` `NPOINTS`. The first two
can be omitted in which case they are taken to be equal to the projector
energy window. **Important note**: at the moment this option works
only if the tetrahedron integration method (`ISMEAR = -4` or `-5`)
is used in VASP to produce `LOCPROJ`.
* **EFERMI** (float): provides the Fermi level. This value overrides
the one extracted from VASP output files.
* **HK** (True/False): If True, the projectors are applied the the Kohn-Sham
eigenvalues which results in a Hamitlonian H(k) in orbital basis. The H(k)
is written for each group to a file :file:`Basename.hk<Ng>`. It is recommended
to also set `COMPLEMENT = True` (see below). Default is False.
There are no required parameters in this section.
Section [Shell]
"""""""""""""""
This section specifies a projector shell. Each `[Shell]` section must be
labeled by an index, e.g. `[Shell 1]`. These indices can then be referenced
in a `[Group]` section.
In each `[Shell]` section two parameters are required:
* **IONS** (list of integer): indices of sites included in the shell.
The sites can be given either by a list of integers `IONS = 5 6 7 8`
or by a range `IONS = 5..8`. The site indices must be compatible with
the POSCAR file.
* **LSHELL** (integer): :math:`l` quantum number of the desired local states.
It is important that a given combination of site indices and local states
given by `LSHELL` must be present in the LOCPROJ file.
There are additional optional parameters that allow one to transform
the local states:
* **CORR** (True/False): Determines if shell is correlated or not. At least one
shell has to be correlated. Default is True.
* **TRANSFORM** (matrix): local transformation matrix applied to all states
in the projector shell. The matrix is defined by a (multiline) block
of floats, with each line corresponding to a row. The number of columns
must be equal to :math:`2 l + 1`, with :math:`l` given by `LSHELL`. Only real matrices
are allowed. This parameter can be useful to select certain subset of
orbitals or perform a simple global rotation.
* **TRANSFILE** (string): name of the file containing transformation
matrices for each site. This option allows for a full-fledged functionality
when it comes to local state transformations. The format of this file
is described :ref:`below <transformation_file>`.
Section [Group]
"""""""""""""""
Each defined projector shell must be part of a projector group. In the current
implementation of DFTtools only a single group (labelled by any integer, e.g. `[Group 1]`)
is supported. This implies that all projector shells
must be included in this group.
Required parameters for any group are the following:
* **SHELLS** (list of integers): indices of projector shells included in the group.
All defined shells must be grouped.
* **EWINDOW** (float float): the energy window specified by two floats: bottom
and top. All projectors in the current group are going to be normalized within
this window. *Note*: This option must be specified inside the `[Shell]` section
if only one shell is defined and the `[Group]` section is omitted.
Optional group parameters:
* **NORMALIZE** (True/False): specifies whether projectors in the group are
to be normalized. The default value is **True**.
* **NORMION** (True/False): specifies whether projectors are normalized on
a per-site (per-ion) basis. That is, if `NORMION = True`, the orthogonality
condition will be enforced on each site separately but the Wannier functions
on different sites will not be orthogonal. If `NORMION = False`, the Wannier functions
on different sites included in the group will be orthogonal to each other.
* **BANDS** (int int): the energy window specified by two ints: band index of
lowest band and band index of highest band. Using this overrides the selection
in `EWINDOW`.
* **COMPLEMENT** (True/False). If True, the orthogonal complement is calculated
resulting in unitary (quadratic) projectors, i.e., the same number of orbitals
as bands. It is required to have an equal number of bands in the energy window
at each k-point. Default is False.
.. _transformation_file:
File of transformation matrices
"""""""""""""""""""""""""""""""
.. warning::
The description below applies only to collinear cases (i.e., without spin-orbit
coupling). In this case, the matrices are spin-independent.
The file specified by option `TRANSFILE` contains transformation matrices
for each ion. Each line must contain a series of floats whose number is either equal to
the number of orbitals :math:`N_{orb}` (in this case the transformation matrices
are assumed to be real) or to :math:`2 N_{orb}` (for the complex transformation matrices).
The total number of lines :math:`N` must be a multiple of the number of ions :math:`N_{ion}`
and the ratio :math:`N / N_{ion}`, then, gives the dimension of the transformed
orbital space. The lines with floats can be separated by any number of empty or
comment lines (starting from `#`), which are ignored.
A very simple example is a transformation matrix that selects the :math:`t_{2g}` manifold.
For two correlated sites, one can define the file as follows:
::
# Site 1
1.0 0.0 0.0 0.0 0.0
0.0 1.0 0.0 0.0 0.0
0.0 0.0 0.0 1.0 0.0
# Site 2
1.0 0.0 0.0 0.0 0.0
0.0 1.0 0.0 0.0 0.0
0.0 0.0 0.0 1.0 0.0

View File

@ -23,12 +23,22 @@ Full charge self consistency with Wien2k: :math:`\gamma`-Ce
tutorials/ce-gamma-fscs_wien2k
A full example with VASP: NiO
-----------------------------------------------------------
VASP interface examples
-----------------------
Simple example: SrVO3
"""""""""""""""""""""
.. toctree::
:maxdepth: 2
tutorials/svo_vasp/svo_notebook
Complex example: NiO
"""""""""""""""""""""""""""""
.. toctree::
:maxdepth: 2
tutorials/nio_csc

View File

@ -0,0 +1,30 @@
SYSTEM = SrVO3
ENCUT = 450
ICHARG=2 ! 5 for fcsc calculations (communication with python)
! switch off symmetries
ISYM=-1
EDIFF = 1.E-10
!! DOS energy window
NEDOS = 2001
!! Smearing procedure
ISMEAR = -5
!! real/reci projection scheme
LREAL = .FALSE.
NCORE = 4
LMAXMIX=6
LORBIT=14
EMIN = 3.9
EMAX = 7.1
LOCPROJ = 2 : d : Pr
!! write WAVECAR, CHGCAR
LWAVE = .FALSE.
LCHARG = .FALSE.

View File

@ -1,7 +1,10 @@
[General]
DOSMESH = -3.0 3.0 2001
[Shell 1]
LSHELL = 2
IONS = 2
EWINDOW = -1.45 1.8
EWINDOW = -1.4 2.0
TRANSFORM = 1.0 0.0 0.0 0.0 0.0
0.0 1.0 0.0 0.0 0.0

View File

@ -0,0 +1,208 @@
{
"cells": [
{
"cell_type": "code",
"execution_count": 14,
"metadata": {
"nbsphinx": "hidden"
},
"outputs": [],
"source": [
"import matplotlib\n",
"matplotlib.use(\"Pdf\")\n",
"import matplotlib.pyplot as plt\n",
"%matplotlib inline\n",
"%config InlineBackend.figure_format = 'svg'\n",
"\n",
"# set matplotlib parameters\n",
"params = {'backend': 'ps',\n",
" 'axes.labelsize': 13,\n",
" 'font.size': 13,\n",
" 'legend.fontsize': 13,\n",
" 'xtick.labelsize': 13,\n",
" 'ytick.labelsize': 13,\n",
" 'text.usetex': False,\n",
" 'text.latex.preamble': \"\\\\usepackage{mathpazo}, \\\\usepackage{amsmath}\",\n",
" 'font.family': 'sans-serif',\n",
" 'font.sans-serif': ['Computer Modern Sans serif']}\n",
"plt.rcParams.update(params)\n",
"\n",
"import warnings \n",
"warnings.filterwarnings(\"ignore\") #ignore some matplotlib warnings\n",
"\n",
"# numpy\n",
"import numpy as np\n",
"\n",
"# .. _svonotebook:"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"# DFT and projections"
]
},
{
"cell_type": "code",
"execution_count": 1,
"metadata": {},
"outputs": [],
"source": [
"from pytriqs.archive import HDFArchive"
]
},
{
"cell_type": "code",
"execution_count": 11,
"metadata": {},
"outputs": [],
"source": [
"# import plovasp converter\n",
"import triqs_dft_tools.converters.plovasp.converter as plo_converter\n",
"# import VASPconverter\n",
"from triqs_dft_tools.converters.vasp_converter import *\n",
"# SumK\n",
"from triqs_dft_tools.sumk_dft_tools import SumkDFTTools"
]
},
{
"cell_type": "code",
"execution_count": 7,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"Read parameters:\n",
"0 -> {'m': 0, 'l': 2, 'isite': 2, 'label': 'dxy'}\n",
"1 -> {'m': 1, 'l': 2, 'isite': 2, 'label': 'dyz'}\n",
"2 -> {'m': 2, 'l': 2, 'isite': 2, 'label': 'dz2'}\n",
"3 -> {'m': 3, 'l': 2, 'isite': 2, 'label': 'dxz'}\n",
"4 -> {'m': 4, 'l': 2, 'isite': 2, 'label': 'dx2-y2'}\n",
" Found POSCAR, title line: SrVO3\n",
" Total number of ions: 5\n",
" Number of types: 3\n",
" Number of ions for each type: [1, 1, 3]\n",
"\n",
" Total number of k-points: 729\n",
" Total number of tetrahedra: 4374\n",
"eigvals from LOCPROJ\n",
"\n",
" Spin: 1\n",
" Site: 2\n",
" Density matrix Overlap\n",
" 0.5878638 0.0015655 -0.0003729 0.0016028 -0.0000013 0.9294189 -0.0000079 -0.0000080 -0.0000079 0.0000001\n",
" 0.0015655 0.5878216 -0.0001853 -0.0015606 0.0003205 -0.0000079 0.9294189 -0.0000041 0.0000080 0.0000068\n",
" -0.0003729 -0.0001853 0.5820729 -0.0001876 0.0000001 -0.0000080 -0.0000041 0.9715784 -0.0000036 -0.0000002\n",
" 0.0016028 -0.0015606 -0.0001876 0.5878590 -0.0003219 -0.0000079 0.0000080 -0.0000036 0.9294189 -0.0000070\n",
" -0.0000013 0.0003205 0.0000001 -0.0003219 0.5820728 0.0000001 0.0000068 -0.0000002 -0.0000070 0.9715787\n",
"\n",
" Generating 1 shell...\n",
"\n",
" Shell : 1\n",
" Orbital l : 2\n",
" Number of ions: 1\n",
" Dimension : 3\n",
"Density matrix:\n",
" Site 1\n",
" 0.3333155 0.0021688 0.0022148\n",
" 0.0021688 0.3332635 -0.0021629\n",
" 0.0022148 -0.0021629 0.3333096\n",
" trace: 0.999888560089083\n",
"\n",
" Impurity density: 0.999888560089083\n",
"\n",
"Overlap:\n",
" Site 1\n",
"[[ 1. 0. -0.]\n",
" [ 0. 1. 0.]\n",
" [-0. 0. 1.]]\n",
"\n",
"Local Hamiltonian:\n",
" Site 1\n",
" 0.5635031 0.0007530 0.0007528\n",
" 0.0007530 0.5635034 -0.0007530\n",
" 0.0007528 -0.0007530 0.5635032\n",
"\n",
"Evaluating DOS...\n",
" Total number of states: [[[1.99711439 1.99526935 1.99688248]]]\n",
" Storing ctrl-file...\n",
" Storing PLO-group file 'vasp.pg1'...\n",
" Density within window: 0.9999735861893001\n"
]
}
],
"source": [
"# Generate and store PLOs\n",
"plo_converter.generate_and_output_as_text('plo.cfg', vasp_dir='./')"
]
},
{
"cell_type": "code",
"execution_count": 10,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"Reading input from vasp.ctrl...\n",
"{\n",
" \"ngroups\": 1,\n",
" \"nk\": 729,\n",
" \"ns\": 1,\n",
" \"nc_flag\": 0\n",
"}\n",
"\n",
" No. of inequivalent shells: 1\n"
]
}
],
"source": [
"# create Converter\n",
"Converter = VaspConverter(filename = 'vasp')\n",
"# run the converter\n",
"Converter.convert_dft_input()"
]
},
{
"cell_type": "code",
"execution_count": 12,
"metadata": {},
"outputs": [],
"source": [
"sk = SumkDFTTools(hdf_file='vasp.h5')"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": []
}
],
"metadata": {
"kernelspec": {
"display_name": "Python 2",
"language": "python",
"name": "python2"
},
"language_info": {
"codemirror_mode": {
"name": "ipython",
"version": 2
},
"file_extension": ".py",
"mimetype": "text/x-python",
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython2",
"version": "2.7.15+"
}
},
"nbformat": 4,
"nbformat_minor": 2
}

View File

@ -1,153 +0,0 @@
# Makefile for Sphinx documentation
#
# You can set these variables from the command line.
SPHINXOPTS =
SPHINXBUILD = sphinx-build
PAPER =
BUILDDIR = build
# Internal variables.
PAPEROPT_a4 = -D latex_paper_size=a4
PAPEROPT_letter = -D latex_paper_size=letter
ALLSPHINXOPTS = -d $(BUILDDIR)/doctrees $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) source
# the i18n builder cannot share the environment and doctrees with the others
I18NSPHINXOPTS = $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) source
.PHONY: help clean html dirhtml singlehtml pickle json htmlhelp qthelp devhelp epub latex latexpdf text man changes linkcheck doctest gettext
help:
@echo "Please use \`make <target>' where <target> is one of"
@echo " html to make standalone HTML files"
@echo " dirhtml to make HTML files named index.html in directories"
@echo " singlehtml to make a single large HTML file"
@echo " pickle to make pickle files"
@echo " json to make JSON files"
@echo " htmlhelp to make HTML files and a HTML help project"
@echo " qthelp to make HTML files and a qthelp project"
@echo " devhelp to make HTML files and a Devhelp project"
@echo " epub to make an epub"
@echo " latex to make LaTeX files, you can set PAPER=a4 or PAPER=letter"
@echo " latexpdf to make LaTeX files and run them through pdflatex"
@echo " text to make text files"
@echo " man to make manual pages"
@echo " texinfo to make Texinfo files"
@echo " info to make Texinfo files and run them through makeinfo"
@echo " gettext to make PO message catalogs"
@echo " changes to make an overview of all changed/added/deprecated items"
@echo " linkcheck to check all external links for integrity"
@echo " doctest to run all doctests embedded in the documentation (if enabled)"
clean:
-rm -rf $(BUILDDIR)/*
html:
$(SPHINXBUILD) -b html $(ALLSPHINXOPTS) $(BUILDDIR)/html
@echo
@echo "Build finished. The HTML pages are in $(BUILDDIR)/html."
dirhtml:
$(SPHINXBUILD) -b dirhtml $(ALLSPHINXOPTS) $(BUILDDIR)/dirhtml
@echo
@echo "Build finished. The HTML pages are in $(BUILDDIR)/dirhtml."
singlehtml:
$(SPHINXBUILD) -b singlehtml $(ALLSPHINXOPTS) $(BUILDDIR)/singlehtml
@echo
@echo "Build finished. The HTML page is in $(BUILDDIR)/singlehtml."
pickle:
$(SPHINXBUILD) -b pickle $(ALLSPHINXOPTS) $(BUILDDIR)/pickle
@echo
@echo "Build finished; now you can process the pickle files."
json:
$(SPHINXBUILD) -b json $(ALLSPHINXOPTS) $(BUILDDIR)/json
@echo
@echo "Build finished; now you can process the JSON files."
htmlhelp:
$(SPHINXBUILD) -b htmlhelp $(ALLSPHINXOPTS) $(BUILDDIR)/htmlhelp
@echo
@echo "Build finished; now you can run HTML Help Workshop with the" \
".hhp project file in $(BUILDDIR)/htmlhelp."
qthelp:
$(SPHINXBUILD) -b qthelp $(ALLSPHINXOPTS) $(BUILDDIR)/qthelp
@echo
@echo "Build finished; now you can run "qcollectiongenerator" with the" \
".qhcp project file in $(BUILDDIR)/qthelp, like this:"
@echo "# qcollectiongenerator $(BUILDDIR)/qthelp/plotools.qhcp"
@echo "To view the help file:"
@echo "# assistant -collectionFile $(BUILDDIR)/qthelp/plotools.qhc"
devhelp:
$(SPHINXBUILD) -b devhelp $(ALLSPHINXOPTS) $(BUILDDIR)/devhelp
@echo
@echo "Build finished."
@echo "To view the help file:"
@echo "# mkdir -p $$HOME/.local/share/devhelp/plotools"
@echo "# ln -s $(BUILDDIR)/devhelp $$HOME/.local/share/devhelp/plotools"
@echo "# devhelp"
epub:
$(SPHINXBUILD) -b epub $(ALLSPHINXOPTS) $(BUILDDIR)/epub
@echo
@echo "Build finished. The epub file is in $(BUILDDIR)/epub."
latex:
$(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex
@echo
@echo "Build finished; the LaTeX files are in $(BUILDDIR)/latex."
@echo "Run \`make' in that directory to run these through (pdf)latex" \
"(use \`make latexpdf' here to do that automatically)."
latexpdf:
$(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex
@echo "Running LaTeX files through pdflatex..."
$(MAKE) -C $(BUILDDIR)/latex all-pdf
@echo "pdflatex finished; the PDF files are in $(BUILDDIR)/latex."
text:
$(SPHINXBUILD) -b text $(ALLSPHINXOPTS) $(BUILDDIR)/text
@echo
@echo "Build finished. The text files are in $(BUILDDIR)/text."
man:
$(SPHINXBUILD) -b man $(ALLSPHINXOPTS) $(BUILDDIR)/man
@echo
@echo "Build finished. The manual pages are in $(BUILDDIR)/man."
texinfo:
$(SPHINXBUILD) -b texinfo $(ALLSPHINXOPTS) $(BUILDDIR)/texinfo
@echo
@echo "Build finished. The Texinfo files are in $(BUILDDIR)/texinfo."
@echo "Run \`make' in that directory to run these through makeinfo" \
"(use \`make info' here to do that automatically)."
info:
$(SPHINXBUILD) -b texinfo $(ALLSPHINXOPTS) $(BUILDDIR)/texinfo
@echo "Running Texinfo files through makeinfo..."
make -C $(BUILDDIR)/texinfo info
@echo "makeinfo finished; the Info files are in $(BUILDDIR)/texinfo."
gettext:
$(SPHINXBUILD) -b gettext $(I18NSPHINXOPTS) $(BUILDDIR)/locale
@echo
@echo "Build finished. The message catalogs are in $(BUILDDIR)/locale."
changes:
$(SPHINXBUILD) -b changes $(ALLSPHINXOPTS) $(BUILDDIR)/changes
@echo
@echo "The overview file is in $(BUILDDIR)/changes."
linkcheck:
$(SPHINXBUILD) -b linkcheck $(ALLSPHINXOPTS) $(BUILDDIR)/linkcheck
@echo
@echo "Link check complete; look for any errors in the above output " \
"or in $(BUILDDIR)/linkcheck/output.txt."
doctest:
$(SPHINXBUILD) -b doctest $(ALLSPHINXOPTS) $(BUILDDIR)/doctest
@echo "Testing of doctests in the sources finished, look at the " \
"results in $(BUILDDIR)/doctest/output.txt."

View File

@ -1,2 +0,0 @@
*
!/.gitignore

View File

@ -1,19 +0,0 @@
[General]
EFERMI = -0.6
[Group 1]
SHELLS = 1 2
EWINDOW = -7.6 2.7
[Shell 1]
# Ni shell
IONS = 5 6 7 8
LSHELL = 2
TRANSFORM =
0.0 0.0 0.0 0.0 1.0
0.0 0.0 1.0 0.0 0.0
[Shell 2]
# Oxygen shell
IONS = 9..20
LSHELL = 1

View File

@ -1,43 +0,0 @@
.. highlight:: python
#######################
Charge self-consistency
#######################
Introduction
************
Running a DFT+DMFT calculation in the charge self-consistent mode
requires additional process management whereby the control is given
to the VASP and to the TRIQS code in an alternating manner.
It is implemented by a lock system. A VASP process is launched in
the background and a self-consistency (SC) script in the foreground.
Once VASP reaches the point where the projectors are generated
it creates a lock file `vasp.lock` and waits until the lock file is
removed. The SC script, in turn, waits for the VASP process and once
the lock file is created it starts a DMFT iteration. The DMFT iteration
must finish by generating a Kohn-Sham (KS) density matrix (file `GAMMA`)
and removing the lock file. The VASP process then reads in `GAMMA`
and proceeds with the next iteration.
The DMFT iteration is performed using a user-defined script.
However, the control part is maintained by two universal scripts:
`sc_dmft.sh` and `sc_dmft.py`.
The first script, `sc_dmft.sh`, launches the VASP process
in the background mode, takes its pid, and launches `sc_dmft.py`
in the foreground mode.
Both processes are run within an MPI environment with an appropriate
number of MPI nodes.
The second script, `sc_dmft.py`, is responsible for the charge self-consitency
logic described in the first paragraph. It also combines the total
energy contributions coming from the DFT and DMFT parts.
The script imports a user-defined DMFT script `dmft_cycle.py` which
must produce KS density-matrix file `GAMMA` for the next DFT iteration
and also must return the correlation (including the double counting) energy
of the impurity model as well as a correlation correction to the
DFT band energy (resulting from the difference between the bare
and DMFT density matrices).

View File

@ -1,26 +0,0 @@
Code Structure
##############
.. toctree::
vaspio
plotools
converter
charge_selfcons
The program consists of three main parts:
* :doc:`Import of data from VASP files </vaspio>`
* Processing of projectors according to an input config-file
* Conversion of the DFT data to TRIQS h5-file
Import of data from VASP files is implemented in `vaspio.py`. The data
is read from VASP files and then stored in objects in raw format
(i.e. practically no processing is done at this stage).
These objects are then combined into a dictionary which can be easily
passed to other routines.
The basic workflow is prescribed as follows:
* raw data is read from VASP files and passed to the main part
* in the main part the input config-file is read and the projectors are selected and process accordingly
* the processed data is stored into output text-files
* when the TRIQS-converter is requested the data is read from text-files and written into a h5-file in an appropriate format

View File

@ -1,244 +0,0 @@
# -*- coding: utf-8 -*-
#
# plotools documentation build configuration file, created by
# sphinx-quickstart on Tue Feb 3 20:25:36 2015.
#
# This file is execfile()d with the current directory set to its containing dir.
#
# Note that not all possible configuration values are present in this
# autogenerated file.
#
# All configuration values have a default; values that are commented out
# serve to show the default.
import sys, os
# If extensions (or modules to document with autodoc) are in another directory,
# add these directories to sys.path here. If the directory is relative to the
# documentation root, use os.path.abspath to make it absolute, like shown here.
sys.path.insert(0, os.path.abspath('../../../python/vasp'))
sys.path.insert(0, os.path.abspath('../../../c'))
# -- General configuration -----------------------------------------------------
# If your documentation needs a minimal Sphinx version, state it here.
#needs_sphinx = '1.0'
# Add any Sphinx extension module names here, as strings. They can be extensions
# coming with Sphinx (named 'sphinx.ext.*') or your custom ones.
extensions = ['sphinx.ext.autodoc', 'sphinx.ext.doctest', 'sphinx.ext.pngmath', 'sphinx.ext.mathjax']
mathjax_path = 'http://cdn.mathjax.org/mathjax/latest/MathJax.js'
# Add any paths that contain templates here, relative to this directory.
templates_path = ['_templates']
# The suffix of source filenames.
source_suffix = '.rst'
# The encoding of source files.
#source_encoding = 'utf-8-sig'
# The master toctree document.
master_doc = 'index'
# General information about the project.
project = u'PLOVasp'
copyright = u'2015, Oleg E. Peil'
# The version info for the project you're documenting, acts as replacement for
# |version| and |release|, also used in various other places throughout the
# built documents.
#
# The short X.Y version.
version = '0.1'
# The full version, including alpha/beta/rc tags.
release = '0.1'
# The language for content autogenerated by Sphinx. Refer to documentation
# for a list of supported languages.
#language = None
# There are two options for replacing |today|: either, you set today to some
# non-false value, then it is used:
#today = ''
# Else, today_fmt is used as the format for a strftime call.
#today_fmt = '%B %d, %Y'
# List of patterns, relative to source directory, that match files and
# directories to ignore when looking for source files.
exclude_patterns = []
# The reST default role (used for this markup: `text`) to use for all documents.
#default_role = None
# If true, '()' will be appended to :func: etc. cross-reference text.
#add_function_parentheses = True
# If true, the current module name will be prepended to all description
# unit titles (such as .. function::).
#add_module_names = True
# If true, sectionauthor and moduleauthor directives will be shown in the
# output. They are ignored by default.
#show_authors = False
# The name of the Pygments (syntax highlighting) style to use.
pygments_style = 'sphinx'
# A list of ignored prefixes for module index sorting.
#modindex_common_prefix = []
# -- Options for HTML output ---------------------------------------------------
# The theme to use for HTML and HTML Help pages. See the documentation for
# a list of builtin themes.
html_theme = 'default'
# Theme options are theme-specific and customize the look and feel of a theme
# further. For a list of options available for each theme, see the
# documentation.
#html_theme_options = {}
# Add any paths that contain custom themes here, relative to this directory.
#html_theme_path = []
# The name for this set of Sphinx documents. If None, it defaults to
# "<project> v<release> documentation".
#html_title = None
# A shorter title for the navigation bar. Default is the same as html_title.
#html_short_title = None
# The name of an image file (relative to this directory) to place at the top
# of the sidebar.
#html_logo = None
# The name of an image file (within the static path) to use as favicon of the
# docs. This file should be a Windows icon file (.ico) being 16x16 or 32x32
# pixels large.
#html_favicon = None
# Add any paths that contain custom static files (such as style sheets) here,
# relative to this directory. They are copied after the builtin static files,
# so a file named "default.css" will overwrite the builtin "default.css".
html_static_path = ['_static']
# If not '', a 'Last updated on:' timestamp is inserted at every page bottom,
# using the given strftime format.
#html_last_updated_fmt = '%b %d, %Y'
# If true, SmartyPants will be used to convert quotes and dashes to
# typographically correct entities.
#html_use_smartypants = True
# Custom sidebar templates, maps document names to template names.
#html_sidebars = {}
# Additional templates that should be rendered to pages, maps page names to
# template names.
#html_additional_pages = {}
# If false, no module index is generated.
#html_domain_indices = True
# If false, no index is generated.
#html_use_index = True
# If true, the index is split into individual pages for each letter.
#html_split_index = False
# If true, links to the reST sources are added to the pages.
#html_show_sourcelink = True
# If true, "Created using Sphinx" is shown in the HTML footer. Default is True.
#html_show_sphinx = True
# If true, "(C) Copyright ..." is shown in the HTML footer. Default is True.
#html_show_copyright = True
# If true, an OpenSearch description file will be output, and all pages will
# contain a <link> tag referring to it. The value of this option must be the
# base URL from which the finished HTML is served.
#html_use_opensearch = ''
# This is the file name suffix for HTML files (e.g. ".xhtml").
#html_file_suffix = None
# Output file base name for HTML help builder.
htmlhelp_basename = 'plotoolsdoc'
# -- Options for LaTeX output --------------------------------------------------
latex_elements = {
# The paper size ('letterpaper' or 'a4paper').
#'papersize': 'letterpaper',
# The font size ('10pt', '11pt' or '12pt').
#'pointsize': '10pt',
# Additional stuff for the LaTeX preamble.
#'preamble': '',
}
# Grouping the document tree into LaTeX files. List of tuples
# (source start file, target name, title, author, documentclass [howto/manual]).
latex_documents = [
('index', 'plotools.tex', u'plotools Documentation',
u'Oleg E. Peil', 'manual'),
]
# The name of an image file (relative to this directory) to place at the top of
# the title page.
#latex_logo = None
# For "manual" documents, if this is true, then toplevel headings are parts,
# not chapters.
#latex_use_parts = False
# If true, show page references after internal links.
#latex_show_pagerefs = False
# If true, show URL addresses after external links.
#latex_show_urls = False
# Documents to append as an appendix to all manuals.
#latex_appendices = []
# If false, no module index is generated.
#latex_domain_indices = True
# -- Options for manual page output --------------------------------------------
# One entry per manual page. List of tuples
# (source start file, name, description, authors, manual section).
man_pages = [
('index', 'plotools', u'plotools Documentation',
[u'Oleg E. Peil'], 1)
]
# If true, show URL addresses after external links.
#man_show_urls = False
# -- Options for Texinfo output ------------------------------------------------
# Grouping the document tree into Texinfo files. List of tuples
# (source start file, target name, title, author,
# dir menu entry, description, category)
texinfo_documents = [
('index', 'plotools', u'plotools Documentation',
u'Oleg E. Peil', 'plotools', 'One line description of project.',
'Miscellaneous'),
]
# Documents to append as an appendix to all manuals.
#texinfo_appendices = []
# If false, no module index is generated.
#texinfo_domain_indices = True
# How to display URL addresses: 'footnote', 'no', or 'inline'.
#texinfo_show_urls = 'footnote'

View File

@ -1,124 +0,0 @@
Input Config-file
=================
A config-file describes subsets of PLOs that are to be generated.
The PLOs are defined in terms of `shells` determined uniquely by an orbital
number `l` and a set of ions (nomrmally, of the same sort).
The shells are further combined into `groups` such that PLO in each group
are orthogonalized together. This, for instance, allows to create a group of several
mutually orthogonal subsets of PLOs.
A group is characterized by a single projection energy window.
A config-file contains three types of sections:
- **[General]** : providing information applicable to all projected shells
(e.g. Fermi level)
- **[Shell <Ns>]** : each section like this describes a PLO shell, with the index
`Ns` used for referencing
- **[Group <tag>]** : describes shell groups
The format requirements are relatively flexible. A config-file must contain
at least one `[Shell]` section. If there is only one shell defined, it is possible
to specify the energy window by providing parameters `EMIN`, `EMAX` (see below)
right in this section, in which case a group
will be created automatically and the `[Group]` section can be omitted.
If, nevertheless, a group referencing the single shell is explicitly given
the energy window parameters provided in the `[Group]` have higher priority
and in case of conflict with `[Shell]` section a warning is issued.
An example of a config-file:
.. literalinclude:: adv_example.cfg
Here two shells, one corresponding to `d` states on ions 5-8, another to `p`
states of ions 9-20, are created. They form a single group that, by default, will be
orthogonalized within a window `[-7.6, 2.7]` eV. Also Fermi level is explicitly
specified, which might be necessary sometimes, e.g., for non-self-consistent calcuation
of the band structure.
Below, the sections and their parameters are described.
All parameter names are case-insensitive.
Section [General]
-----------------
**Required parameters:**
In principle, there are unconditionally required parameters in this section.
However, if VASP data file do not contain a meaningful value of the Fermi level
it must be given here using parameter *EFERMI*. Note that if this parameter
is given it will override a value that might have been read from VASP files.
**Optional parameters:**
- *BASENAME* (string): a basename for output files. The filenames will be
of the form '<basename>.*'.
- *DOSMESH* (float, float, int): if this parameter is provided the projected
DOS for each projected shell will be generated, with the energy mesh parameters
given by the energy range (two floats) and the number of points (int). It is also
possible to omit the energy range, in which case it will be set to the energy window
of the corresponding projector group.
Section [Shell <Ns>]
--------------------
Defines a projected shell with an integer index `<Ns>`. Ideally, the indices should
run uniformly starting from 1. However, since they are used only to reference
shells in group sections, their values are not important. One should only
make sure that there are no sections with the same name, in which case one
of them will be ignored by config parser.
**Required parameters:**
- *IONS* ([int]): provides a list of ions. The list can be either given
by a explicit enumeration of ion indices or by a range `N1..N2` (ions `N1` and `N2`
will be included).
- *LSHELL* (int): orbital number `l` of the shell (`l = 0,1,2,3` for `s,p,d,f`, respectively).
**Optional parameters:**
- *TRANSFORM* (matrix of floats): transformation matrices
(real or complex) that are applied to projectors before orthogonalization.
The number of columns `Nc` must be consistent with the number of orbitals
(`Nc = 2l+1` for real matrices and `Nc = 2(2l+1)` for complex ones).
The dimension of the resulting orbital subspace is determined by the number of rows.
- *TRANSFILE* (str): file containing transformation matrices for individual ions.
The file must contain rows of floats. Empty lines and lines starting with '#' are ignored.
The data is interpreted as follows:
* The number of rows is divided by the number of ions to give the number
of rows per ion, `Nr`.
* The number of columns is divided by `Nm = 2 * l + 1` to give `nsize`.
There are, then, three options:
#. if `nc_flag = 0`, i.e. a calculation is collinear (no spin-orbit coupling),
and `nsize = 1` the matrices are considered to be real;
#. if `nc_flag = 0` and `nsize = 2` the matrices are considered to be complex;
#. if `nc_flag = 1`, i.e. a calculation is non-collinear, it is expected
that `nsize = 4`, and the matrices are considered to be complex and
spin-dependent.
* The subspace dimension is determined simply as `Ndim = Nr / nsize`.
In all cases when a division is performed the result must be integer. Otherwise,
the matrices are considered to be inconsistent.
- *EWINDOW* (float, float): energy window. Should be given only if no excplicit groups
is specified. Otherwise, the values are overriden by group parameters.
Section [Group <tag>]
---------------------
Defines a group of shells. Note that the group tag can be any string without whitespaces.
It will be used to tag intermediate output files.
**Required parameters:**
- *SHELLS* ([int]): indices refering to shells forming the group.
- *EWINDOW* (float, float): the bottom and top of the energy window with respect to the Fermi level.
**Optional parameters:**
- NORMALIZE (True/False): if True, orthogonalizetion is performed (default behavior).
- *NORMION* (True/False): if True, orthogonalization is performed on each site
separately; if False, all projectors of the group are orthogonalized together.

View File

@ -1,4 +0,0 @@
TRIQS Converter
###############
The converter provides an interface between a DFT code and TRIQS solvers.

View File

@ -1,12 +0,0 @@
[General]
[PLO Group 1]
IONS = 5 6 7 8
EMIN = -0.6
EMAX = 2.7
LSHELL = 2
RTRANSFORM =
0.0 0.0 0.0 0.0 1.0
0.0 0.0 1.0 0.0 0.0

View File

@ -1,27 +0,0 @@
.. plotools documentation master file, created by
sphinx-quickstart on Tue Feb 3 20:25:36 2015.
You can adapt this file completely to your liking, but it should at least
contain the root `toctree` directive.
Welcome to PLOVasp's documentation!
====================================
PLOVasp documentation.
Contents:
.. toctree::
:maxdepth: 1
users_guide
code_struct
Indices and tables
==================
* :ref:`genindex`
* :ref:`modindex`
* :ref:`search`

View File

@ -1,64 +0,0 @@
Processing tools for PLOs generated by VASP.
The main purpose of this set of tools is to process raw data
generated by VASP and to convert data to the TRIQS format. The raw data
is read from files:
POSCAR (atomic positions)
EIGVAL (eignevalues)
PLOCAR (non-orthogonalized PLOs and Fermi-weights)
IBZKPT (k-points and tetrahedra)
An appropriate set of orthogonalized projectors is defined by
parameters defined in the config file (config-like syntax).
The config-file allows to define several groups of projectors.
Structure of PLOtools:
vaspio.py: reading of VASP-generated files
vaspio.py:
All VASP data are represented by objects which contain data read
from corresponding files. These objects will subsequently be used to
handle the data and convert it into a more functional internal representation.
Functions
read_lines(filename): generator yielding lines from a file <filename>
Classes:
Plocar: raw PLO data from PLOCAR file;
the data itself is read using an auxiliary C-routine 'read_plocar'
Poscar: structure data from POSCAR file
Kpoints: k-point data from IBZKPT file
note that k-point data is also contained in EIGENVAL file;
the two k-point sets will be checked for consistency.
Eigenval: Kohn-Sham eigenvalues as well as k-points with weights
Symmcar: symmetry operations stored by VASP into SYMMCAR file
ploortho.py (or projectors.py)
Set of routines for processing projectors. The functionality includes:
-- selecting a proper subset of non-orthogonalized projectors from the raw VASP input
-- transforming and orthogonalizing projectors
-- calculating DFT density matrix and local Hamiltonian
General design:
Input data: conf_pars (output of 'parse_input()'), VASP file descriptors (Eigenval, Plocar, etc.)
* A projector for a given k-point is described by class 'Projector'
PLOs project on a set or orbitals and a set of ions.
* Projector set is a container of 'Projector' objects.
Out of optimization purposes the projectors are stored in a multi-dimensional
array. A view in terms of Projector objects is, however, possible.

View File

@ -1,191 +0,0 @@
.. highlight:: python
#########
PLO tools
#########
Introduction
************
This set of tools is intended for processing of raw projectors read
from VASP. One of the main tasks is to generate an orthonormalized subset
of PLOs constructed according to the :doc:`config-file </config>`.
To produce the final output the following steps are undertaken:
* Parse input config-file
* Input raw VASP data
* Convert the raw VASP data into an internal representaion and check it for consistency.
* Generate a set of projector shells according to the parameters of the config-file
* Create a set of projector groups
* Perform necessary group operations (such as :ref:`orthogonalization<ortho>`) on the constituing shells
* Calculate and output some useful quantities (bare density matrix, DOS, etc.)
Initial Processing
******************
The raw data from VASP files is initially read in simple objects (containers).
Then these objects are combined in an another object containing all necessary
electronic structure data. At this stage simple consistency checks are performed:
* the basic dimensions, such as the number of bands, number of `k`-points, etc.,
are consistent for all data
* the `k`-point mesh are read both the IBZKPT and EIGENVAL and it is worth checking
that both sets are coinciding
* in case tetrahedron data is read from IBZKPT, the tetrahedron volume must be related
to the total volume of the unit cell as derived from POSCAR
All electronic structure from VASP is stored in a class ElectronicStructure:
.. autoclass:: triqs_dft_tools.converters.plovasp.elstruct.ElectronicStructure
:members:
Consistency with parameters
* parameters in the config-file should pass trivial checks such as that the ion
list does not contain non-existing ions (boundary check for ion indices)
.. function:: check_vasp_data_consistency(conf_pars, vasp_data)
**Parameters**:
- *conf_pars* (dict) : dictionary of input parameters from conf-file
- *vasp_data* (dict) : dictionary containing all VASP data
**Returns**:
*None*
**Raises**:
A meaningful exception indicating an inconsistency in the input data
Selecting projector subsets
===========================
The first step of PLO processing is to select subsets of projectors
corresponding to PLO groups. Each group contains a set of shells.
Each projector shell is represented by an object 'ProjectorShell'
that contains an array of projectors and information on the shell itself
(orbital number, ions, etc.). 'ProjectorShell's are contained in
both a list of shells (according to the original list as read
from config-file) and in a 'ProjectorGroup' object, the latter
also providing information about the energy window.
`[In fact, shell container can be a simple dictionary.]`
Order of operations:
- transform projectors (all bands) in each shell
- select transformed shell projectors for a given group within the window
- orthogonalize if necessary projectors within a group by performing
the following operations for each k-point:
* combine all projector shells into a single array
* orthogonalize the array
* distribute back the arrays assuming that the order is preserved
.. autoclass:: triqs_dft_tools.converters.plovasp.proj_shell.ProjectorShell
:members:
The class is using a helper function `select_bands()` for selecting a subset of bands.
.. function:: select_bands(eigvals, emin, emax)
**Parameters**:
- *eigvals* (numpy.array) : array of eigenvalues
- *emin*, *emax* (float) : energy window
**Returns**:
*ib_win*, *nb_min*, *nb_max* (numpy.array[int], int, int) :
lowest and highest indices of the selected bands
.. _ortho:
Orthogonalization
-----------------
At the second stage the selected projectors are orthogonalized (orthonormalized).
Orthogonalization can be performed in different ways if projection is made
on several ions or if several correlated shells per ion are considered.
In the case of several correlated ions per unit cell (and one correlated shell per ion)
at least two options can be considered:
#. Projectors are normalized for each ion separetely. In this case, corresponding
Wannier functions for different ions are generally not orthogonal.
#. Projectors are normalized for all ions in the unit cell simultaneously. This
ensures that the Wannier functions for different ions are mutually orthogonal.
The way the normalization of a PLO group is done is controlled by two group parameters:
- *NORMALIZE* (True/False) : indicates whether the PLO group is normalized (True by default)
- *NORMION* (True/False) : indicates whether the PLO group is normalized on a per-ion basis
(False by default)
Storing generated projectors
****************************
After the PLOs are generated they are stored to text files which can be subsequently
converted to TRIQS h5-files (using the converter). The general format of the file
is a JSON-header containing all necessary parameters followed by a set of arrays.
There is always one (control) file containing general information (`k`-kpoints, lattice vectors etc.)
and `at least` one file containing correlated groups (one file for each group).
Control file format
===================
Filename '<namebase>.ctrl'. Contains the data shared between all shells.
The JSON-header consists of the following elements:
* *nk*: number of `k`-points
* *ns*: number of spin channels
* *nc_flag*: collinear/noncollinear case (False/True)
* *ng*: number of projector groups
* Symmetry information (list of symmetry operations)
* *efermi*: Fermi level (optional)
* Lattice information
Projector-group file format
===========================
Projector-group files have names '<namebase>.plog<Ng>'.
They essentially contain serialized objects of class 'ProjectorGroup'.
The JSON-header has, thus, the following elements:
* *shells*: list of shells
* each shell is a dictionary:
- *lshell*: orbital number `l`
- *nion*: number of ions
- *ndim*: number of orbitals/ion
- *nbmax*: maxmimum number of bands (needed for array allocations)
* *emin*, *emax*: energy window

View File

@ -1,29 +0,0 @@
User's Guide
############
.. toctree::
config
PLOVasp is a set of tools for performing DFT+DMFT calculations within
the fromalism of projected localized orbitals (PLO) using
VASP in combination with the TRIQS package.
It relies on projectors implemented in VASP >= 5.4.1 and generated with
the option LOCPROJ in INCAR. The main goal of PLOVasp is to use these raw
projectors generated by VASP to produce PLOs and to convert them to the standard
format of DFTTools, which allows a user to use the same DMFT scripts
as for Wien2TRIQS interface, with only the converter class being replaced.
Currently PLOVasp supports only one-shot DFT+DMFT calculations, with
the full charge self-consistency being in the process of implementation.
PLOVasp package consists of two main parts:
* A set of tools for processing VASP-generated projectors
* A converter class VaspConverter that prepares an HDF5 file for DFTTools
A typical one-shot DFT+DMFT calculation is generally performed as follows:
* Run VASP with LOCPROJ option to generate raw projectors
* Write an input file and run PLOVasp to produce data required by DFTTools
* Run a DMFT script based on DFTTools with VaspConverter class used as a converter
The format of the input file is described in section :doc:`Input Config-file <config>`.

View File

@ -1,39 +0,0 @@
.. _vaspio:
VASP input-output
#################
The following VASP files are used by PLOtools:
* PROJCAR, LOCPROJ: raw projectors generated by VASP-PLO interface (VASP version >= 5.4.1)
* EIGENVAL: Kohn-Sham eigenvalues as well as `k`-points with weights and Fermi weights
* IBZKPT: `k`-point data (:math:`\Gamma`)
* POSCAR: crystal structure data
Starting from version 5.4.1 VASP now supports an official output of various types of
projectors that are requested in INCAR by specifying a set of sites, orbitals and types
of projectors. The calculated projectors are output into files **PROJCAR** and **LOCPROJ**.
The difference between these two files is that **LOCPROJ** contains raw matrices without
any reference to sites/orbitals, while **PROJCAR** is more detailed on that.
In particular, the information that can be obtained for each projector from **PROJCAR** is the following:
* site (and species) index
* for each `k`-point and band: a set of complex numbers for labeled orbitals
At the same time, **LOCPROJ** contains the total number of projectors (as well as the
number of `k`-points, bands, and spin channels) in the first line,
which can be used to allocate the arrays before parsing.
To enhance the performance of the parser, it is implemented in plain C. The idea is
that the python part of the parser first reads the first line of **LOCPROJ** and
then calls the C-routine with necessary parameters to parse **PROJCAR**.
The projectors are read in and stored in class `Plocar`. Two major data structures are stored:
* complex array `plo = nd.array((nproj, nspin, nk, nband))`
* list of projector descriptors `proj_params` containing the information on
the character of projectors
When a ProjectorShell is initialized it copies a subset of projectors corresponding
to selected sites/orbitals. This can be done by looping all shell sites/orbitals and
searching for the corresponding projector using the descriptor list `proj_params`.