Commit bdf4397f authored by Christoph Friedrich's avatar Christoph Friedrich

Added JOB KS and other small changes.

parent 73876f19
......@@ -342,8 +342,8 @@ unmaintained.)
INTERPOL (WANNIER)
-------------------
The keyword INTERPOL has already been discussed in :numref:`INTERPOL_GW`. It is not related to the
The keyword ``INTERPOL`` has already been discussed in :numref:`INTERPOL_GW`. It is not related to the
Wannier construction, but we explain it here briefly for completeness.
When given, Spex performs a Wannier interpolation for the reference mean-field system (output to
the file "bands0") and of the calculated *GW* (HF, COSX, et cetera) quasiparticle energies
the file "bands0") and of the calculated *GW* (HF, COHSEX, et cetera) quasiparticle energies
(output to the file "bands1").
......@@ -29,9 +29,17 @@ Each Spex run needs a job definition, which defines what Spex should do, e.g., `
* ``DIELEC`` - Dielectric function
* ``SCREEN`` - Screened interaction
* ``SCREENW`` - Screened interaction projected onto Wannier basis
* ``KS`` - Single-particle energies (e.g., KS energies)
Details of these jobs are explained in subsequent sections. The job definition must not be omitted but may be empty: ``JOB``, in which case Spex will just read the wavefunctions and energies, perform some checks and some elemental calculations (e.g., Wannier interpolation), and stop. In principle, Spex supports multiple jobs such as ``JOB GW 1:(1-5) DIELEC 1:{0:1,0.01}``. This feature is, however, seldom used and is not guaranteed to work correctly in all versions.
Details of these jobs are explained in subsequent sections. The job definition must not be omitted but may be empty: ``JOB``,
in which case Spex will just read the wavefunctions and energies, perform some checks and some elemental calculations
(e.g., Wannier interpolation), and stop.
The job ``KS`` is included only for convenience. When given, Spex simply writes the single-particle energies (e.g., KS energies), read from the input data,
to the output in the *standard* format, similar to the output of *GW* or HF values.
In principle, Spex supports multiple jobs such as ``JOB GW 1:(1-5) DIELEC 1:{0:1,0.01}``.
This feature is, however, seldom used and is not guaranteed to work correctly in all versions.
.. list-table:: Examples
:widths: 95 100
......
......@@ -22,7 +22,7 @@ Thus, a typical procedure is
Of course, for subsequent Spex runs, steps 1-3 need not be repeated, unless the reference mean-field system is to be
recalculated with different parameters (e.g., different k-point set or different crystal structure).
For the first and third step consult the manual of your DFT program. (The `Fleur manual`_ is available online. As explained in more detail in
:numref:`SpexandFleur`, you must set ``gw=1`` and ``gw=2`` for the first and third step, respectively.)
:numref:`spex_and_fleur`, you must set ``gw=1`` and ``gw=2`` for the first and third step, respectively.)
For the second and fourth step you need to create an input file "spex.inp" for Spex. A very simple input file for a *GW* calculation of Si is this:
.. _Fleur manual: http://www.flapw.de/pm/index.php?n=User-Documentation.FLEUR
......
.. _SpexandFleur:
.. _spex_and_fleur:
===============
Spex and Fleur
......
......@@ -22,7 +22,9 @@ Installation
**I want to use my own DFT program instead of Fleur.**
.. highlights:: You will have to rewrite or modify the routines in ``read_write.f`` according to your output files and recompile the source. If you use a different mesh for radial integration than Fleur/Spex, you must either interpolate the values to the new mesh (recommended) or write new integration routines in ``numerics.f`` (``intgr, intgrf_init, intgrf, primitive, primitivef``).
.. highlights:: You will have to rewrite or modify the routines in ``read_write.f`` and ``Hwrapper.f`` according to
your output files and recompile the source. If you use a different radial mesh for the MT functions than Fleur/Spex,
it is recommendable to transform to the other mesh by interpolation.
**My compiler fails to compile the source.**
......@@ -35,10 +37,6 @@ Usage
.. highlights:: Try the options ``STOREIBZ`` and/or ``NOSTORE``. You can also reduce the maximally allowed memory storage with the keyword ``MEM``.
**The program stops with a segmentation fault.**
.. highlights:: If this is caused by a too high memory demand you should try the option ``STOREIBZ`` (and ``NOSTORE``) or reduce the maximally allowed storage with the keyword ``MEM``. With some compilers this can also happen, if the stack size is limited. In this case set the stack size to "unlimited" (e.g., ``limit stacksize unlimited`` in csh). However, this is not possible with Mac computers. In this case add "Wl,-stack_size,0x10000000,-stack_addr,0xc0000000" to LDFLAGS or "-heap-arrays" to FFLAGS in Makefile.
**Degenerate quasiparticle states have slightly different energies or I get slightly different results at equivalent k points**
.. highlights:: There are several possible reasons for this:
......@@ -69,11 +67,6 @@ This is not a complete list of errors. In many error messages a possible solutio
The program might also stop at places where this is not supposed to happen. Then, the error message starts with ``SPEX-BUG`` (see :numref:`spex.out`).
In this case you should contact the programmers. Error messages have the form ``SPEX-ERROR (source.f:0123) Error message``, where
"source.f" is the name of the source file and 0123 is the respective line where the error occurred. We shorten this to ``(source.f) Error message`` in this list.
**error while loading shared libraries: lib...: cannot open shared object file: No such file or directory**
.. highlights:: The library "lib..." is not found in standard directories. In this case, the location of the library has to be defined in the
environment variable ``LD_LIBRARY_PATH`` of the shell. (Consult your Unix or Linux manual.)
**(read_write.f) k-point sets inconsistent (check ...)**
......@@ -132,4 +125,34 @@ In this case you should contact the programmers. Error messages have the form ``
In the case of contour integration (``CONTOUR``), strong spectral structure in the self-energy can cause this problem. For example in metallic systems, a small
Drude frequency can give rise to a delta-like peak in the self-energy. A possible solution in this case is to use ``PLASMA METAL`` (:numref:`PLASMA`).
**(Hwrapper.f) Fatal HDF5 error.**
.. highlights:: An error in the HDF5 library has occurred. There will be more informative error messages issued by the library itself.
A possible reason could be that the HDF5 file misses a particular data set or attribute. In this case, make sure that the DFT program and Spex are called in
the proper order (:numref:`getting_started` and :numref:`spex_and_fleur`).
If this does not solve the problem, please report the error. (Note that the same error can also occur in the source files "read_write.f",
"correlation.f", and "correlation_wannier.f".)
The following error messages are displayed when the program run was terminated abnormally by the operating system.
**error while loading shared libraries: lib...: cannot open shared object file: No such file or directory**
.. highlights:: The library "lib..." is not found in standard directories. In this case, the location of the library has to be defined in the
environment variable ``LD_LIBRARY_PATH`` of the shell. (Consult your Unix or Linux manual.)
**Segmentation fault**
.. highlights:: A forbidden area of memory was accessed during the program run. First, you should make sure that the operating system
allows unlimited size of stack memory. You can set the stack size from the shell (BASH: ``ulimit -s unlimited``,
CSH: ``limit stacksize unlimited``). As an alternative, some compilers provide options to prevent the usage of stack memory
(e.g., ``-heap-arrays`` in the Intel Fortran Compiler).
If this does not solve the problem, it is likely that the error is caused by a real
bug in the Spex code. Please report such an error. You can help the developers by running the same calculation again with
a Spex executable that has been compiled with ``make ADD=-DCHECK`` (slower execution). Please send the resulting output.
.. .. highlights:: If this is caused by a too high memory demand you should try the option ``STOREIBZ`` (and ``NOSTORE``) or
reduce the maximally allowed storage with the keyword ``MEM``. With some compilers this can
also happen, if the stack size is limited. In this case set the stack size to "unlimited"
(e.g., ``limit stacksize unlimited`` in csh). However, this is not possible with Mac computers.
In this case add "Wl,-stack_size,0x10000000,-stack_addr,0xc0000000" to LDFLAGS or "-heap-arrays" to FFLAGS in Makefile.
......@@ -21,7 +21,7 @@ The following, equivalent input file is even more minimalistic.
It only contains the two essential keywords that any Spex input file must contain: ``BZ`` and ``JOB``, specifying, respectively,
the k mesh for the Brillouin-zone sampling and the requested type of calculation. Here, we calculate quasiparticle corrections
for the bands (1,2,5) of the first, (1,3,5) of the seventh, and (1,2,3,5) of the third k point. The band indices are defined
for the bands (1,2,5) at the first, (1,3,5) at the seventh, and (1,2,3,5) at the third k point. The band indices are defined
according to the ordering in the mean-field input data. In the example, we have left out some band indices because of energy
degeneracy. For example, bands 3 and 4 (of the first k point) are degenerate with band 2.
......@@ -29,6 +29,11 @@ In the case of a spin-polarized systems, the quasiparticle energies for both spi
Alternatively, one can choose the spin index by using u (spin up) or d (spin down), e.g., ``JOB GW 1:u(1,2,5) 1:d(1,2,5)``
is identical to ``JOB GW 1:(1,2,5)``.
The same definition of bands is used for the job types ``HF``, ``PBE0``, ``SX``, ``COSX``, ``GT``, ``GWT``, and ``KS``.
For example, ``JOB COSX 1:(1,2,5)`` would run a COHSEX calculation. Many of the keywords described in this section
work identically for the other job types, others can only be used for *GW* calculations. If a keyword is inapplicable to the
defined job, it is simply ignored by Spex (e.g., ``SPECTRAL`` for a PBE0 calculation).
.. _kpt:
KPT
......@@ -500,6 +505,14 @@ in this way, a quasiparticle band structure. Such a calculation can be performed
KPTPATH
--------
.. .. figure:: figures/band1.png (Figures are disabled because Sphinx does not place them correctly.)
:scale: 55%
:figwidth: 50%
:align: right
:alt: band structure Si (1)
Band structure for bulk silicon from DFT (solid line) and *GW* (symbols) calculated with ``JOB GW PATH:(1-12)``.
As an example, we want to plot a band structure for the path from L over :math:`\Gamma` to :math:`X` for our Si example.
In principle, we would have to identify all k-point indices along this path and set the job definition accordingly,
but Spex can do this for you. The k-point path can be defined with a line ``KPTPATH (L,1,X)``. In the job definition,
......@@ -558,6 +571,13 @@ The energy difference between the fourth state at :math:`\Gamma` and the fifth s
* - ``JOB GW +:(1-10)``
- Run *GW* calculation for the states 1-10 at the added q point.
.. .. figure:: figures/band2.png
:scale: 55%
:figwidth: 50%
:align: right
:alt: band structure Si (2)
Band structure for bulk silicon from DFT (magenta) and *GW* (green) calculated with multiple runs of Spex using the "spex.band" shell script.
The possibility of adding arbitrary q points enables the calculation of smooth band structures.
To this end, a *GW* run (together with the generation of the eigenstates with the DFT code)
has to be performed for each q point in a list of q points that make up a path in the Brillouin zone,
......@@ -572,6 +592,13 @@ in this order, Spex, Fleur, and Spex again. To simplify this task, there is a sh
This shell script performs all the necessary steps automatically. It uses the same environment variables as "spex.selfc" (:numref:`beyondpert`)
and produces, for each q point, one output file named "spex_NNN.out", where NNN is a three-digit counting index, or more digits if the index exceeds 999.
.. .. figure:: figures/band3.png
:scale: 55%
:figwidth: 50%
:align: right
:alt: band structure Si (3)
Band structure for bulk silicon from DFT (magenta) and *GW* (green) with lifetime broadening.
From these files the band-structure data is extracted with ``spex.extr g -b spex_???.out > bandstr``.
The data is written to the file ``bandstr``. The band structure can then be plotted with "xmgrace" or "gnuplot".
If you extract the band-structure data, instead, with ``spex.extr g -b -c spex_???.out > bandstr``,
......@@ -606,6 +633,13 @@ We have to modify and add some lines to ``spex.inp``:
INTERPOL
END
.. .. figure:: figures/band4.png
:scale: 60%
:figwidth: 55%
:align: right
:alt: band structure Si (4)
Band structure for bulk silicon from DFT (magenta) and *GW* (green) calculated with Wannier interpolation (only filled bands).
Please also remove the entry ``+=[0,0,0.75]`` from the ``KPT`` line. The first line lets SPEX calculate quasiparticle energies
in the whole irreducible Brillouin zone (IBZ). (The Wannier interpolation can be understood as a back-and-forth Fourier
transformation with a real-space truncation of matrix elements in-between.
......@@ -887,13 +921,13 @@ to the "renormalized polarization function" :math:`R` mentioned in :numref:`spec
The ACFDT method gives the following form of the correlation energy functional
.. math:: E_{\mathrm{c}}[n]=-\int_{0}^{1}d\lambda\iint d^{3}rd^{3}r'\frac{1}{|\vec{r}-\vec{r}'|}\times\left[\int_{0}^{\infty}\frac{du}{2\pi}\chi_{\lambda}(\vec{r},\vec{r}',iu)-\chi_{0}(\vec{r},\vec{r}',iu)\right]\,
.. math:: E_{\mathrm{c}}[n]=-\int_{0}^{1}d\lambda\iint d^{3}rd^{3}r'\frac{1}{|\mathbf{r}-\mathbf{r}'|}\times\left[\int_{0}^{\infty}\frac{du}{2\pi}\chi_{\lambda}(\mathbf{r},\mathbf{r}',iu)-\chi_{0}(\mathbf{r},\mathbf{r}',iu)\right]\,
:label: ACFDT
where :math:`\chi_0` corresponds to the (bare) polarization function [Eq. :eq:`eqP`] and :math:`\chi_\lambda` is a
partially renormalized response function (i.e., with a scaled electron-electron interaction) fulfilling
.. math:: \chi_{\lambda}(\vec{r},\vec{r}',\omega)=\chi_{\mathrm{0}}(\vec{r},\vec{r}',\omega)+\iint d^{3}r''d^{3}r'''\chi_{\mathrm{0}}(\vec{r},\vec{r}'',\omega)\\\hspace{0.8cm}\times\left[\frac{\lambda}{|\vec{r}''-\vec{r}'''|}+f_{\mathrm{xc,\lambda}}(\vec{r}'',\vec{r}''',\omega)\right]\chi_{\lambda}(\vec{r}''',\vec{r}',\omega)\,,
.. math:: \chi_{\lambda}(\mathbf{r},\mathbf{r}',\omega)=\chi_{\mathrm{0}}(\mathbf{r},\mathbf{r}',\omega)+\iint d^{3}r''d^{3}r'''\chi_{\mathrm{0}}(\mathbf{r},\mathbf{r}'',\omega)\\\hspace{0.8cm}\times\left[\frac{\lambda}{|\mathbf{r}''-\mathbf{r}'''|}+f_{\mathrm{xc,\lambda}}(\mathbf{r}'',\mathbf{r}''',\omega)\right]\chi_{\lambda}(\mathbf{r}''',\mathbf{r}',\omega)\,,
here written in the general form including the (scaled) exchange-correlation kernel :math:`f_{\mathrm{xc},\lambda}`.
For RPA, :math:`f_{\mathrm{xc},\lambda}=0`.
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment