Merge remote-tracking branch 'trunk/beauty' into beauty

This commit is contained in:
Jordan Bieder 2021-01-12 13:49:02 +01:00
commit 8edb06860c
428 changed files with 227087 additions and 122638 deletions

View File

@ -5,7 +5,7 @@ at the time a version of ABINIT is released.
Note that bugs discovered later than the
release are NOT described here...
The present release ABINITv9.3.2 is for development
The present release ABINITv9.3.3 is for development
0. List of platforms
1. Batteries of tests
@ -14,7 +14,7 @@ The present release ABINITv9.3.2 is for development
================================================================
0. Platforms
For ABINITv9.3.2, list closed on 2020 12 10
For ABINITv9.3.3, list closed on 2021 01 05
after installation and successful tests for the standard set of platforms,
as mentioned on
https://bbportal.abinit.org/#/status

View File

@ -2592,7 +2592,7 @@ columns corresponds respectively to (the normalisation factor has been dropped)
* m=2, $x^{2}-y^{2}$
[[dmatpawu]] must always be given as a "spin-up" occupation matrix (and
eventually a "spin-down" matrix). Be aware that its physical meaning depends
if needed a "spin-down" matrix). Be aware that its physical meaning depends
on the magnetic properties imposed to the system (with [[nsppol]],
[[nspinor]], [[nspden]]):
@ -3830,7 +3830,7 @@ Variable(
mnemonics="ENergy UNITs",
added_in_version="before_v9",
text=r"""
Governs the units to be used for output of eigenvalues (and eventual phonon frequencies)
Governs the units to be used for output of eigenvalues (and if any, phonon frequencies)
* 0 --> print eigenvalues in hartree;
* 1 --> print eigenvalues in eV;
@ -4502,7 +4502,7 @@ algorithm, when the Fock operator is updated.
(it continues to use the previous potential/density pairs without worrying).
2. If [[fockoptmix]] == 1: the SCF algorithm is restarted (the previous potential/density pairs are discarded).
The second-to-last (dozen) digit governs the possible modification of the XC
The second-to-last (tens) digit governs the possible modification of the XC
functional inside the SCF loop to take into account the lack of update of the
Fock operator. Irrelevant when the unit digit is 0. If the value 1 is used
(so, e.g. [[fockoptmix]] == 11), an auxiliary xc functional is used inside the
@ -6733,7 +6733,7 @@ Variable(
added_in_version="before_v9",
text=r"""
Mixing coefficient for the unscreened Fock operator in case of hybrid
functionals. Hartree-Fock corresponds to 1.0, PBE0 to 0.25.
functionals. Hartree-Fock corresponds to 1.0, PBE0 to 0.25, and B3LYP to 0.2.
ABINIT knows the correct value from [[ixc]]. Experts might nevertheless tune this mixing coefficient.
""",
@ -6752,7 +6752,7 @@ Variable(
added_in_version="before_v9",
text=r"""
Mixing coefficient for the screened Fock operator in case of hybrid
functionals. HSE has 0.25, B3LYP has 0.2.
functionals. HSE has 0.25.
ABINIT knows the correct value from [[ixc]]. Experts might nevertheless tune
this mixing coefficient.
@ -7292,7 +7292,7 @@ Variable(
mnemonics="IONic MOVEs",
added_in_version="before_v9",
text=r"""
Choice of algorithm to control the displacements of ions, and eventually changes of cell shape and size (see [[optcell]]).
Choice of algorithm to control the displacements of ions, and possibly changes of cell shape and size (see [[optcell]]).
No meaning for RF calculations.
* 0 --> Do not move ions (**default behaviour**)
@ -7650,7 +7650,7 @@ Variable(
mnemonics="Integer that governs the ReaDing of _1WF files",
added_in_version="before_v9",
text=r"""
Indicates eventual starting wavefunctions. As alternative, one can use the
Indicates possible starting wavefunctions. As alternative, one can use the
input variables [[getwfk]], [[getwfq]], [[get1wf]] or [[getddk]].
Ground-state calculation:
@ -7763,7 +7763,7 @@ Variable(
mnemonics="Integer that governs the ReaDing of DDK wavefunctions, in _1WF files",
added_in_version="before_v9",
text=r"""
Indicates eventual starting wavefunctions. As alternative, one can use the
Indicates possible starting wavefunctions. As alternative, one can use the
input variables [[getwfk]], [[getwfq]], [[get1wf]] or [[getddk]].
Ground-state calculation:
@ -7945,7 +7945,7 @@ Variable(
mnemonics="Integer that governs the ReaDing of _WFK files",
added_in_version="before_v9",
text=r"""
Indicates eventual starting wavefunctions. As alternative, one can use the
Indicates possible starting wavefunctions. As alternative, one can use the
input variables [[getwfk]], [[getwfq]], [[get1wf]] or [[getddk]].
Ground-state calculation:
@ -7989,7 +7989,7 @@ Variable(
mnemonics="Integer that governs the ReaDing of the grid _WFK file on the FINE grid",
added_in_version="before_v9",
text=r"""
Indicates eventual starting wavefunctions. As alternative, one can use the input variables [[getwfkfine]].
Indicates possible starting wavefunctions. As alternative, one can use the input variables [[getwfkfine]].
Ground-state calculation:
@ -8028,7 +8028,7 @@ Variable(
mnemonics="Integer that governs the ReaDing of _WFQ files",
added_in_version="before_v9",
text=r"""
Indicates eventual starting wavefunctions. As alternative, one can use the
Indicates possible starting wavefunctions. As alternative, one can use the
input variables [[getwfk]], [[getwfq]], [[get1wf]] or [[getddk]].
Ground-state calculation:
@ -8141,8 +8141,8 @@ Other (**negative**) options:
rho(r) and then run **iscf** = -2 for the intended set of k-points and bands.
To prepare a run with **iscf** = -2, a density file can be produced using the
parameter [[prtden]] (see its description). When a self-consistent set of
wavefunctions is already available, abinit can be used with [[nstep]] = 0 (see
Test_v2/t47.in), and the adequate value of [[prtden]].
wavefunctions is already available, abinit can be used with [[nstep]] = 0
and the adequate value of [[prtden]], see tests/v2/Input/t47.abi .
* -3 --> like -2, but initialize [[occ]] and [[wtk]], directly or indirectly
(using [[ngkpt]] or [[kptrlatt]]) depending on the value of [[occopt]].
@ -8155,7 +8155,12 @@ Other (**negative**) options:
Note that the oscillator strength needs to be defined with respect to an origin of coordinate,
thanks to the input variable [[boxcenter]]. The maximal number of Kohn-Sham excitations to be used
to build the excited state TDDFT matrix can be defined by [[td_mexcit]], or indirectly
by the maximum Kohn-Sham excitation energy [[td_maxene]].
by the maximum Kohn-Sham excitation energy [[td_maxene]]. Only "LDA-like" XC kernels are implemented,
from native ABINIT XC functionals with specific values of [[ixc]]=[0,1,7,8,20,21,22]. In case you use a XC functional from the libxc,
corresponding to these values, there is no automatic translation, so that you have to specify explicitly
the [[ixc]] value among the above ones. As an example, if the [[ixc]] from your pseudopotentiel is -1012,
this corresponds to the same functional (LDA - Perdew Wang 1992) as [[ixc]]=7, and you should specify [[ixc]]=7.
""",
),
@ -8305,8 +8310,8 @@ used for debugging). A warning is issued if this is not the case.
Unfortunately, pseudopotential (or PAW) generators for hybrid functionals and
mGGA are currently under development, so that one usually uses GGA or LDA
pseudopotentials instead. The error should be limited when GGA or LDA
pseudopotentials with semi-core states are used. Still this is a non-
controlled error. Moreover, the choices [[ixc]] = 1, 2, 3 and 7 are fits to the
pseudopotentials with semi-core states are used.
Still this is a non-controlled error. Moreover, the choices [[ixc]] = 1, 2, 3 and 7 are fits to the
same data, from Ceperley-Alder, and are rather similar, at least for spin-unpolarized systems.
The choice between the non-spin-polarized and spin-polarized case is governed
by the value of [[nsppol]] (see below).
@ -8372,11 +8377,10 @@ that it comes from the LibXC). In the case of separate exchange functional
(let us represent its identifier by XXX) and correlation functional (let us
represent its identified by CCC), a six-digit number will have to be specified
for [[ixc]], by concatenation, be it XXXCCC or CCCXXX. As an example,
[[ixc]] = -020 gives access to the Teter93 LDA, while [[ixc]] = -101130 gives
access to the PBE GGA. In version 0.9 of LibXC (December 2008), there are 16
three-dimensional (S)LDA functionals (1 for X, 14 for C, 1 for combined XC),
and there are 41 three-dimensional GGA (23 for X, 8 for C, 10 for combined
XC). Note that for a meta-GGA, the kinetic energy density is needed.
[[ixc]] = -1012 gives the Perdew-Wang 1992 LDA ([[ixc]]=7 as well),
[[ixc]] = -020 gives the Teter93 LDA ([[ixc]]=1 as well),
while [[ixc]] = -101130 gives the PBE GGA ([[ixc]]=11 as well).
Note that for a meta-GGA, the kinetic energy density is needed.
This means having [[usekden]] = 1.
==(S)LDA functionals== (do not forget to add a minus sign, as discussed above)
@ -12570,7 +12574,7 @@ equal to 1 or 0 in each k-point (spin-polarized case). If [[nsppol]] = 2 and
k points may optionally have different numbers of bands and different
occupancies. [[nband]]([[nkpt]] * [[nsppol]]) is given explicitly as an array of
[[nkpt]] * [[nsppol]] elements. [[occ]]() is given explicitly for all bands at
each k point, and eventually for each spin -- the total number of elements is
each k point, and possibly for each spin -- the total number of elements is
the sum of [[nband]](ikpt) over all k points and spins. The k point weights
[[wtk]] ([[nkpt]]) are NOT automatically normalized under this option.
@ -12677,8 +12681,8 @@ Variable(
text=r"""
Allows one to optimize the unit cell shape and dimensions, when [[ionmov]] >= 2 or
3. The configuration for which the stress almost vanishes is iteratively
determined, by using the same algorithms as for the nuclei positions. Will
eventually modify [[acell]] and/or [[rprim]]. The ionic positions are ALWAYS
determined, by using the same algorithms as for the nuclei positions.
May modify [[acell]] and/or [[rprim]]. The ionic positions are ALWAYS
updated, according to the forces. A target stress tensor might be defined, see [[strtarget]].
* **optcell** = 0: modify nuclear positions, since [[ionmov]] = 2 or 3, but no cell shape and dimension optimisation.
@ -12933,7 +12937,7 @@ this case, [[npkpt]], [[npspinor]], [[npfft]] and [[npband]] are ignored.
Require compilation option --enable-mpi="yes".
**If paral_kgb = 1**, the parallelization over bands, FFTs, and k-point/spin-
components is activated (see [[npkpt]], [[npfft]] [[npband]] and eventually
components is activated (see [[npkpt]], [[npfft]] [[npband]] and possibly
[[npspinor]]). With this parallelization, the work load is split over four
levels of parallelization (three level of parallelisation (kpt-band-fft )+
spin) The different communications almost occur along one dimension only.
@ -12967,7 +12971,7 @@ can be done as well with a sequential as with a parallel version of the code.
The user can then choose the adequate number of processor on which he can run
his job. He must put again paral_kgb = 1 in the input file and put the
corresponding values for [[npkpt]], [[npfft]], [[npband]],[[bandpp]] and
eventually [[npspinor]] in the input file.
possibly [[npspinor]] in the input file.
""",
),
@ -16126,7 +16130,7 @@ of [[symrel]] are not used. This is to allow doing calculations with
[[nsym]] = 1, sometimes needed for T-dependent electronic structure, still
decreasing the number of q points in the case [[qptopt]] = 1 or [[qptopt]] = 3.
* 0 --> read directly [[qpt]], and its (eventual) renormalisation factor [[qptnrm]].
* 0 --> read directly [[qpt]], and its (possible) renormalisation factor [[qptnrm]].
* 1 --> Take fully into account the symmetry to generate the grid of q points in the Irreducible Brillouin Zone only.
(This is the usual mode for RF calculations)
@ -18178,6 +18182,11 @@ routine are timed in detail.
* If 4 --> close to [[timopt]] = 1, except that the different parts of the lobpcg
routine are timed in detail. A different splitting of lobpcg than for
[[timopt]] = -3 is provided.
* If 10 --> relevant only when the wavelet basis set is used (i.e. [[usewvl]] = 1).
When activated, a file named `wvl_timings.yaml`,
in [YAML format](https://en.wikipedia.org/wiki/YAML), is created.
It contains a time analysis of the _BigDFT_ wavelet routines.
See the [[tutorial:paral_gswvl|tutorial on parallelism using wavelets]]
* If -1 --> a full analysis of timings is delivered
* If -2 --> a full analysis of timings is delivered, except timing the timer
* If -3 --> a full analysis of timings is delivered, including the detailed

View File

@ -1407,16 +1407,17 @@ Enter any string to search in the database. Clicking without any request will gi
def dialog_from_filename(self, path, title=None, ret_btn_dialog=False):
"""Build customized jquery dialog to show the content of filepath `path`."""
abs_path = os.path.join(self.root, path)
# FIXME: This to faciliate migration to new scheme for file extensions
# It will be removed when the beautification is completed.
if path.endswith(".in") and not os.path.exists(path):
if path.endswith(".in") and not os.path.exists(abs_path):
print("Using old convention for file extension: `.in` instead of `.abi`.\n",
"Please change the md tutorial to use the .abi convention for", path)
root, _ = os.path.splitext(path)
path = root + ".abi"
if path.endswith(".out") and not os.path.exists(path):
if path.endswith(".out") and not os.path.exists(abs_path):
print("Using old convention for file extension: `.out` instead of `.abo`.\n",
"Please change the md tutorial to use the .abo convention for", path)
root, _ = os.path.splitext(path)
@ -1451,16 +1452,17 @@ Enter any string to search in the database. Clicking without any request will gi
def modal_from_filename(self, path, title=None):
"""Return HTML string with bootstrap modal and content taken from file `path`."""
abs_path = os.path.join(self.root, path)
# FIXME: This to faciliate migration to new scheme for file extensions
# It will be removed when the beautification is completed.
if path.endswith(".in") and not os.path.exists(path):
if path.endswith(".in") and not os.path.exists(abs_path):
print("Using old convention for file extension: `.in` instead of `.abi`.\n",
"Please change the md tutorial to use the .abi convention for:", path)
root, _ = os.path.splitext(path)
path = root + ".abi"
if path.endswith(".out") and not os.path.exists(path):
if path.endswith(".out") and not os.path.exists(abs_path):
print("Using old convention for file extension: `.out` instead of `.abo`.\n",
"Please change the md tutorial to use the .abo convention for:", path)
root, _ = os.path.splitext(path)

View File

@ -25,7 +25,7 @@
# Initialize Autoconf
AC_PREREQ(2.62)
AC_INIT([ABINIT-Bindings],[9.3.3],
AC_INIT([ABINIT-Bindings],[9.3.4],
[https://bugs.launchpad.net/abinit/],[abinit-bindings])
AC_REVISION([Autotools support for the ABINIT Bindings])
AC_CONFIG_AUX_DIR([config/gnu])

View File

@ -59,22 +59,22 @@ check-local:
# Set of internal tests
test_fast:
cp $(top_builddir)/src/98_main/abinit $(top_srcdir)/tests/built-in/Input/abinit && cd $(top_srcdir)/tests/built-in/Input && export ABI_PSPDIR="../../Psps_for_tests" && ./abinit testin_fast.in >& testin_fast.stdout && cat testin_fastt_STATUS && rm -f abinit *DDB *EIG *out* *nc *WFK *abo* *o_* *t_STATUS*
cp $(top_builddir)/src/98_main/abinit $(top_srcdir)/tests/built-in/Input/abinit && cd $(top_srcdir)/tests/built-in/Input && export ABI_PSPDIR="../../Psps_for_tests" && ./abinit testin_fast.abi >& testin_fast.stdout && cat testin_fastt_STATUS && rm -f abinit *DDB *EIG *out* *nc *WFK *abo* *o_* *t_STATUS*
test_v1:
cp $(top_builddir)/src/98_main/abinit $(top_srcdir)/tests/built-in/Input/abinit && cd $(top_srcdir)/tests/built-in/Input && export ABI_PSPDIR="../../Psps_for_tests" && ./abinit testin_v1.in >& testin_v1.stdout && cat testin_v1t_STATUS && rm -f abinit *DDB *EIG *out* *nc *WFK *abo* *o_* *t_STATUS*
cp $(top_builddir)/src/98_main/abinit $(top_srcdir)/tests/built-in/Input/abinit && cd $(top_srcdir)/tests/built-in/Input && export ABI_PSPDIR="../../Psps_for_tests" && ./abinit testin_v1.abi >& testin_v1.stdout && cat testin_v1t_STATUS && rm -f abinit *DDB *EIG *out* *nc *WFK *abo* *o_* *t_STATUS*
test_v5:
cp $(top_builddir)/src/98_main/abinit $(top_srcdir)/tests/built-in/Input/abinit && cd $(top_srcdir)/tests/built-in/Input && export ABI_PSPDIR="../../Psps_for_tests" && ./abinit testin_v5.in >& testin_v5.stdout && cat testin_v5t_STATUS && rm -f abinit *DDB *EIG *out* *nc *WFK *abo* *o_* *t_STATUS*
cp $(top_builddir)/src/98_main/abinit $(top_srcdir)/tests/built-in/Input/abinit && cd $(top_srcdir)/tests/built-in/Input && export ABI_PSPDIR="../../Psps_for_tests" && ./abinit testin_v5.abi >& testin_v5.stdout && cat testin_v5t_STATUS && rm -f abinit *DDB *EIG *out* *nc *WFK *abo* *o_* *t_STATUS*
test_bigdft:
cp $(top_builddir)/src/98_main/abinit $(top_srcdir)/tests/built-in/Input/abinit && cd $(top_srcdir)/tests/built-in/Input && export ABI_PSPDIR="../../Psps_for_tests" && ./abinit testin_bigdft.in >& testin_bigdft.stdout && cat testin_bigdftt_STATUS && rm -f abinit *DDB *EIG *out* *nc *WFK *abo* *o_* *t_STATUS*
cp $(top_builddir)/src/98_main/abinit $(top_srcdir)/tests/built-in/Input/abinit && cd $(top_srcdir)/tests/built-in/Input && export ABI_PSPDIR="../../Psps_for_tests" && ./abinit testin_bigdft.abi >& testin_bigdft.stdout && cat testin_bigdftt_STATUS && rm -f abinit *DDB *EIG *out* *nc *WFK *abo* *o_* *t_STATUS*
test_libxc:
cp $(top_builddir)/src/98_main/abinit $(top_srcdir)/tests/built-in/Input/abinit && cd $(top_srcdir)/tests/built-in/Input && export ABI_PSPDIR="../../Psps_for_tests" && ./abinit testin_libxc.in >& testin_libxc.stdout && cat testin_libxct_STATUS && rm -f abinit *DDB *EIG *out* *nc *WFK *abo* *o_* *t_STATUS*
cp $(top_builddir)/src/98_main/abinit $(top_srcdir)/tests/built-in/Input/abinit && cd $(top_srcdir)/tests/built-in/Input && export ABI_PSPDIR="../../Psps_for_tests" && ./abinit testin_libxc.abi >& testin_libxc.stdout && cat testin_libxct_STATUS && rm -f abinit *DDB *EIG *out* *nc *WFK *abo* *o_* *t_STATUS*
test_wannier90:
cp $(top_builddir)/src/98_main/abinit $(top_srcdir)/tests/built-in/Input/abinit && cd $(top_srcdir)/tests/built-in/Input && export ABI_PSPDIR="../../Psps_for_tests" && ./abinit testin_wannier90.in >& testin_wannier90.stdout && cat testin_wannier90t_STATUS && rm -f abinit *DDB *EIG *out* *nc *WFK *DEN *chk *eig *mmn *amn *abo* *o_* *t_STATUS*
cp $(top_builddir)/src/98_main/abinit $(top_srcdir)/tests/built-in/Input/abinit && cd $(top_srcdir)/tests/built-in/Input && export ABI_PSPDIR="../../Psps_for_tests" && ./abinit testin_wannier90.abi >& testin_wannier90.stdout && cat testin_wannier90t_STATUS && rm -f abinit *DDB *EIG *out* *nc *WFK *DEN *chk *eig *mmn *amn *abo* *o_* *t_STATUS*
tests_in:
$(MAKE) test_fast test_v1 test_v5 test_libxc test_wannier90
@ -93,7 +93,7 @@ help_dev dev_help dev:
# robodoc-html-x.x.x.tar contains all html files produced by ROBODOC
robodoc:
rm -rf tmp-robodoc robodoc-html && mkdir tmp-robodoc
cp -rf $(top_srcdir)/shared/common/src/[0-3]* tmp-robodoc
cp -rfL $(top_srcdir)/shared/common/src/[0-3]* tmp-robodoc
cp -rf $(top_srcdir)/src/[4-9]* tmp-robodoc
cp $(top_srcdir)/config/robodoc/robodoc-html.rc tmp-robodoc/robodoc.rc
cd tmp-robodoc && rm -f */*.in && rm -f */interfaces* && robodoc > ../robodoc.log 2> ../robodoc.err

View File

@ -224,6 +224,37 @@ with_netcdf_fortran = ${FALLBACKS_HOME}_FB_/${FB}/netcdf4_fortran/4.5.2
with_libxc = ${FALLBACKS_HOME}_FB_/${FB}/libxc/4.3.4
#
[alps_intel_19.1_elpa]
CPP = icc -E
FC_LIBS = -lstdc++ -ldl
enable_avx_safe_mode = no
enable_gw_dpc = yes
enable_python_invocation = yes
enable_netcdf_default = yes
with_mpi = ${MPI_HOME}
enable_mpi_io = yes
with_linalg_flavor = mkl+elpa
LINALG_CPPFLAGS = -I${MKLROOT}/include -I${ELPA_INC_DIR}
LINALG_FCFLAGS = -I${MKLROOT}/include -I${ELPA_INC_DIR} -I${ELPA_FC_INC}
LINALG_LIBS = -L${MKLROOT}/lib/intel64 -lmkl_scalapack_lp64 -lmkl_intel_lp64 -lmkl_sequential -lmkl_core -lmkl_blacs_intelmpi_lp64 -lpthread -lm -ldl -L${ELPA_LIB_DIR} -lelpa
with_fft_flavor = dfti
FFT_FCFLAGS = -I${MKLROOT}/include
with_hdf5 = ${FALLBACKS_HOME}_9.2/${FB}/hdf5/1.10.6
with_netcdf = ${FALLBACKS_HOME}_9.2/${FB}/netcdf4/4.6.3
with_netcdf_fortran = ${FALLBACKS_HOME}_9.2/${FB}/netcdf4_fortran/4.5.2
with_libpsml = ${FALLBACKS_HOME}_9.2/${FB}/libpsml/1.1.7
with_xmlf90 = ${FALLBACKS_HOME}_9.2/${FB}/xmlf90/1.5.3.1
with_libxc = ${FALLBACKS_HOME}_9.2/${FB}/libxc/4.3.4
with_wannier90 = ${FALLBACKS_HOME}_9.2/${FB}/wannier90/2.0.1.1
# END ALPS
##############################################
@ -633,6 +664,37 @@ with_xmlf90 = ${FALLBACKS_HOME}_FB_/${FB}/xmlf90/1.5.3.1
with_libxc = ${FALLBACKS_HOME}_FB_/${FB}/libxc/4.3.4
with_wannier90 = ${FALLBACKS_HOME}_FB_/${FB}/wannier90/2.0.1.1
BIGDFT_FCFLAGS = -I${FALLBACKS_HOME}_FB_/${FB}/bigdft/abinit-1.7.1.28/include
BIGDFT_LIBS = -L${FALLBACKS_HOME}_FB_/${FB}/bigdft/abinit-1.7.1.28/lib -lbigdft-1 -labinit -lpaw_bigdft -lyaml -lrt
#
[scope_gnu_10.2_s64]
enable_gw_dpc = yes
#enable_memory_profiling = yes
enable_netcdf_default = yes
with_mpi = ${MPI_HOME}
enable_mpi_io = yes
with_linalg_flavor = openblas
LINALG_LIBS = -L/usr/local/OpenBLAS-0.3.10_gcc10.2/lib -lopenblas -lpthread
with_fft_flavor = fftw3
FFTW3_CPPFLAGS = -I/usr/include
FFTW3_FCFLAGS = -I/usr/include
FFTW3_LIBS = -L/usr/lib/x86_64-linux-gnu -lfftw3 -lfftw3f
with_hdf5 = ${FALLBACKS_HOME}_FB_/${FB}/hdf5/1.10.6
with_netcdf = ${FALLBACKS_HOME}_FB_/${FB}/netcdf4/4.6.3
with_netcdf_fortran = ${FALLBACKS_HOME}_FB_/${FB}/netcdf4_fortran/4.5.2
with_libpsml = ${FALLBACKS_HOME}_FB_/${FB}/libpsml/1.1.7
with_xmlf90 = ${FALLBACKS_HOME}_FB_/${FB}/xmlf90/1.5.3.1
with_libxc = ${FALLBACKS_HOME}_FB_/${FB}/libxc/4.3.4
with_wannier90 = ${FALLBACKS_HOME}_FB_/${FB}/wannier90/2.0.1.1
#
[scope_gnu_7.5_dep]

View File

@ -38,7 +38,7 @@ https://github.com/abinit/abiconfig.
# Initialize Autoconf
AC_PREREQ(2.59)
AC_INIT([ABINIT],[9.3.3],[https://bugs.launchpad.net/abinit/],[abinit])
AC_INIT([ABINIT],[9.3.4],[https://bugs.launchpad.net/abinit/],[abinit])
AC_REVISION([Autotools support for ABINIT 9])
AC_CONFIG_AUX_DIR([config/gnu])
AC_CONFIG_MACRO_DIR([config/m4])

10
doc/.gitignore vendored
View File

@ -1,18 +1,16 @@
# The following md files have been copied from ~abinit and should be `git ignored`
INSTALL_Ubuntu.md
INSTALL_gpu.md
INSTALL_MacOS.md
INSTALL_EasyBuild.md
INSTALL_CentOS.md
INSTALL_MacOS.md
INSTALL_Ubuntu.md
# The following md files have been automatically generated and should be `git ignored`
developers/autoconf_examples.md
variables/index.md
variables/external_parameters.md
variables/anaddb.md
variables/multibinit.md
variables/aim.md
variables/atdep.md
variables/multibinit.md
variables/optic.md
variables/basic.md
variables/bse.md
variables/dev.md
@ -30,6 +28,8 @@ variables/paw.md
variables/rlx.md
variables/vdw.md
variables/w90.md
variables/optic.md
variables/anaddb.md
variables/varset_stats.md
topics/Abipy.md
topics/APPA.md

View File

@ -1465,6 +1465,21 @@ eprint = {https://doi.org/10.1063/1.2213970}
month = nov,
}
@article{Dorado2009,
title = {{DFT+U} calculations of the ground state and metastable states of uranium dioxide},
author = {Dorado, Boris and Amadon, Bernard and Freyss, Michel and Bertolus, Marjorie},
journal = {Phys. Rev. B},
volume = {79},
issue = {23},
pages = {235125},
numpages = {8},
year = {2009},
month = {Jun},
publisher = {American Physical Society},
doi = {10.1103/PhysRevB.79.235125},
url = {https://link.aps.org/doi/10.1103/PhysRevB.79.235125}
}
@article{Folegati2007,
author = {Folegati, P. and Makkonen, I. and Ferragut, R. and Puska, M. J.},
doi = {10.1103/physrevb.75.054201},
@ -2425,6 +2440,21 @@ year = {1998},
year = {2014},
}
@article{Jomard2008,
title = {Structural, thermodynamic, and electronic properties of plutonium oxides from first principles},
author = {Jomard, Gérald and Amadon, Bernard and Bottin, Francois and Torrent, Marc},
journal = {Phys. Rev. B},
volume = {78},
issue = {7},
pages = {075125},
numpages = {11},
year = {2008},
month = {Aug},
publisher = {American Physical Society},
doi = {10.1103/PhysRevB.78.075125},
url = {https://link.aps.org/doi/10.1103/PhysRevB.78.075125}
}
@article{Hybertsen1985,
author = {Hybertsen, Mark S. and Louie, Steven G.},
doi = {10.1103/physrevlett.55.1418},
@ -3159,7 +3189,7 @@ url = "http://www.sciencedirect.com/science/article/pii/S1574181809000664",
@article{Profeta2003,
author = {Profeta, Mickael and Mauri, Francesco and Pickard, Chris J.},
doi = {10.1021/ja027124r},
doi = {9.1021/ja027124r},
issn = {0002-7863, 1520-5126},
journal = {J. Am. Chem. Soc.},
month = jan,
@ -4309,12 +4339,22 @@ author = "Olivier Parcollet and Michel Ferrero and Thomas Ayral and Hartmut Hafe
pages = {155208},
}
@unpublished{Geneste2016,
author = {Geneste, G. and Amadon, B. and Torrent, M. and Dezanneau, G.},
title = {Unpublished},
year = {2016},
@article{Geneste2017,
title = {DFT+$U$ study of self-trapping, trapping, and mobility of oxygen-type hole polarons in barium stannate},
author = {Geneste, Gr\'egory and Amadon, Bernard and Torrent, Marc and Dezanneau, Guilhem},
journal = {Phys. Rev. B},
volume = {96},
issue = {13},
pages = {134123},
numpages = {13},
year = {2017},
month = {Oct},
publisher = {American Physical Society},
doi = {10.1103/PhysRevB.96.134123},
url = {https://link.aps.org/doi/10.1103/PhysRevB.96.134123}
}
@phdthesis{Moscaconte2007,
author = {Mosca Conte, A.},
title = {Quantum mechanical modeling of nano magnetism},
@ -8401,7 +8441,7 @@ year = {2013}
@article{Vansetten2018,
title={The PseudoDojo: Training and grading a 85 element optimized norm-conserving pseudopotential table},
author={Van Setten, M.~J. and Giantomassi, Matteo and Bousquet, Eric and Verstraete, Matthieu J and Hamann, Donald R and Gonze, Xavier and Rignanese, G-M},
journal={Comput.~Phys.~Commun.},
journal={Comput. Phys. Commun.},
volume={226},
pages={39--54},
year={2018},
@ -8651,3 +8691,47 @@ url = "http://www.sciencedirect.com/science/article/pii/S0010465518303436",
author = "Venkat Kapil and Mariana Rossi and Ondrej Marsalek and Riccardo Petraglia and Yair Litman and Thomas Spura and Bingqing Cheng and Alice Cuzzocrea and Robert H. Meißner and David M. Wilkins and Benjamin A. Helfrecht and Przemysław Juda and Sébastien P. Bienvenue and Wei Fang and Jan Kessler and Igor Poltavsky and Steven Vandenbrande and Jelle Wieme and Clemence Corminboeuf and Thomas D. Kühne and David E. Manolopoulos and Thomas E. Markland and Jeremy O. Richardson and Alexandre Tkatchenko and Gareth A. Tribello and Veronique {Van Speybroeck} and Michele Ceriotti",
keywords = "Accelerated sampling, Geometry optimizers, Path integral, Molecular dynamics, ",
}
@article{Zwanziger2016,
author = {Zwanziger, J.W.},
doi = {10.1016/j.ssnmr.2016.10.005},
pages = {14-18},
source = {Crossref},
url = {http://dx.doi.org/10.1016/j.ssnmr.2016.10.005},
volume = {80},
journal = {Solid State Nuclear Magnetic Resonance},
publisher = {Elsevier BV},
title = {Computation of NMR observables: Consequences of projector-augmented wave sphere overlap},
issn = {0926-2040},
year = {2016},
month = nov,
}
@book{Vanderbilt2018,
title={Berry Phases in Electronic Structure Theory:
Electric Polarization, Orbital Magnetization and Topological Insulators},
author={Vanderbilt, David},
year={2018},
publisher={Cambridge University Press}
}
@book{Boyd2020,
title={Nonlinear optics},
author={Boyd, Robert W},
year={2020},
publisher={Academic press}
}
@article{Caracas2006,
title={Theoretical determination of the Raman spectra of MgSiO$_3$ perovskite and post-perovskite at high pressure},
author={Caracas, Razvan and Cohen, Ronald E},
journal={Geophysical Research Letters},
volume={33},
number={12},
year={2006},
url={https://doi.org/10.1029/2006GL025736},
doi={doi.org/10.1029/2006GL025736},
publisher={Wiley Online Library}
}

View File

@ -25,7 +25,7 @@
# Initialize Autoconf
AC_PREREQ(2.62)
AC_INIT([ABINIT-Documentation],[9.3.3],
AC_INIT([ABINIT-Documentation],[9.3.4],
[https://bugs.launchpad.net/abinit/],[abinit-doc])
AC_REVISION([Autotools support for the ABINIT Documentation])
AC_CONFIG_AUX_DIR([config/gnu])

View File

@ -712,6 +712,8 @@ a modal window with tabs is produced
{% modal tests/v1/Input/t01.abi tests/v1/Input/t02.abi %}
Note however, that these extensions do not work when called within the input variable database files (abimkdocs/variables*.py files).
## MathJax
Formulas written in LaTeX are interpreted automatically (at visualization time) thanks to the

View File

@ -1257,12 +1257,15 @@ basis for a given set of atoms. Some atoms (notably those in the first row or
first transition series row) have relatively deep pseudopotentials which
require many planewaves for convergence. In contrast are atoms like Si for
which fewer planewaves are needed. A typical value of [[ecut]] for silicon
might be 5-10 Hartree for quite good convergence, while the value for oxygen
might be 25-35 Hartree or more depending on the convergence desired and the
design of the pseudo- potential.
with a norm-conserving pseudopotential
might be 10...15 Hartree for quite good convergence, while the value for oxygen
might be 35...40 Hartree or more depending on the convergence desired and the
design of the pseudo-potential. With PAW, the [[ecut]] to be used is usually
smaller, e.g. 17 Hartree for oxygen. The pseudo-dojo <http://www.pseudo-dojo.org/>
provides hints with the available pseudopotentials.
NOTE: It is necessary in every new problem to **TEST** the convergence by
**RAISING** [[ecut]] for a given calculation until the results being computed
NOTE: It is necessary in every new problem to **TEST** the convergence, by
**RAISING** [[ecut]] for a given calculation, until the results being computed
are constant to within some tolerance. This is up to the user and is very
important. For a given [[acell]] and [[rprim]], [[ecut]] is the parameter
which controls the number of planewaves. Of course if [[rprim]] or [[acell]]
@ -1273,14 +1276,12 @@ the convergence of _e.g._ the total energy within some range of planewave
number or [[ecut]]. It is appropriate to attempt to optimize this convergence,
especially for difficult atoms like oxygen or copper, as long as one does not
significantly compromise the quality or transferability of the
pseudopotential. There are many people working on new techniques for
optimizing convergence.
pseudopotential.
For information on extended norm conservation, see E. L. Shirley, D. C. Allan,
R. M. Martin, and J. D. Joannopoulos, Phys. Rev. B 40, 3652 (1989).
For information on optimizing the convergence of pseudopotentials, see A. M.
Rappe, K. M. Rabe, E. Kaxiras, and J. D. Joannopoulos, Phys. Rev. B 41, 1227 (1990).
For information on optimizing the convergence of pseudopotentials, see
[[cite:Rappe1990]]. For the generation of ONCVPSP pseudopotentials, see
[[cite:Hamann2013]]. For the pseudodojo, see [[cite:Vansetten2018]].
For the JTH table of PAW atomic data, see [[cite:Jollet2014]].
(2) In addition to achieving convergence in the number of planewaves in the
basis, one must ensure that the SCF iterations which solve the electronic

View File

@ -86,26 +86,26 @@ files, slightly different numerical results, or timing differences, e.g.:
```diff
2,3c2,3
< .Version 9.3.2 of ABINIT
< .Version 9.4.1 of ABINIT
< .(MPI version, prepared for a x86_64_darwin18.7.0_gnu9.3 computer)
---
> .Version 9.3.1 of ABINIT
> .Version 9.3.3 of ABINIT
> .(MPI version, prepared for a x86_64_linux_gnu9.3 computer)
17,18c17,18
< .Starting date : Mon 7 Dec 2020.
< .Starting date : Mon 25 Jan 2021.
< - ( at 21h07 )
---
> .Starting date : Tue 10 Nov 2020.
> - ( at 22h21 )
> .Starting date : Wed 30 Dec 2020.
> - ( at 19h15 )
20,21c20,21
< - input file -> tbase1_1.abi
< - output file -> tbase1_1.abo
---
> - input file -> /home/buildbot/ABINIT/alps_gnu_9.3_openmpi/trunk_beauty/tests/Test_suite/tutorial_tbase1_1/tbase1_1.abi
> - input file -> /home/buildbot/ABINIT/alps_gnu_9.3_serial/trunk_beauty/tests/TestBot_MPI1/tutorial_tbase1_1/tbase1_1.abi
> - output file -> tbase1_1.abo
117,118c117,118
< - pspini: atom type 1 psp file is /Users/gonze/_Research/ABINIT_git/beauty/tests//Psps_for_tests/Pseudodojo_nc_sr_04_pw_standard_psp8/H.psp8
< - pspatm: opening atomic psp file /Users/gonze/_Research/ABINIT_git/beauty/tests//Psps_for_tests/Pseudodojo_nc_sr_04_pw_standard_psp8/H.psp8
< - pspini: atom type 1 psp file is /Users/gonze/_Research/ABINIT_git/beauty/tests/Psps_for_tests/Pseudodojo_nc_sr_04_pw_standard_psp8/H.psp8
< - pspatm: opening atomic psp file /Users/gonze/_Research/ABINIT_git/beauty/tests/Psps_for_tests/Pseudodojo_nc_sr_04_pw_standard_psp8/H.psp8
---
> - pspini: atom type 1 psp file is /home/buildbot/ABINIT/alps_gnu_9.3_openmpi/trunk_beauty/tests/Psps_for_tests/Pseudodojo_nc_sr_04_pw_standard_psp8/H.psp8
> - pspatm: opening atomic psp file /home/buildbot/ABINIT/alps_gnu_9.3_openmpi/trunk_beauty/tests/Psps_for_tests/Pseudodojo_nc_sr_04_pw_standard_psp8/H.psp8
@ -749,13 +749,15 @@ These are:
* [[ecut]] (the plane-wave kinetic energy cut-off)
* [[acell]] (the supercell size)
* [[ixc]] (not even mentioned until now, this input variable specifies what kind of
exchange-correlation functional is to be used)
* the pseudopotential
* [[ixc]] (not even mentioned until now, this input variable specifies what kind of
exchange-correlation functional is to be used, and is by default deduced from the pseudopotential - a choice
of exchange-correlation functional is mandatory to produce a pseudopotential, and mixing different exchange-correlation
functionals for pseudopotentials generation and ABINIT calculations is bad practice)
We used 10 Ha as cut-off energy, a 10x10x10 Bohr^3 supercell, the local-density approximation
(as well as the local-spin-density approximation) in the
Teter parametrization, and a LDA pseudopotential from the pseudodojo <http://www.pseudo-dojo.org/>,
We used 10 Ha as cut-off energy, a 10x10x10 Bohr^3 supercell,
the LDA (=local-density approximation, as well as the local-spin-density approximation in the spin-polarized case) in the
Perdew-Wang parametrization ([[ixc]]=-1012), and a LDA pseudopotential from the pseudodojo <http://www.pseudo-dojo.org/>,
copied in the ABINIT directory $ABI_PSPDIR/Pseudodojo_nc_sr_04_pw_standard_psp8 . You might have a look at
the file $ABI_PSPDIR/Pseudodojo_nc_sr_04_pw_standard_psp8/README.md to learn more about pseudopotentials.

View File

@ -25,20 +25,20 @@ This tutorial should take about 1 hour.
We studied the H$_2$ molecule in a big box.
We used 10 Ha as cut-off energy, a 10x10x10 Bohr$^3$ supercell, the local-density approximation
(as well as the local-spin-density approximation) in the Teter parametrization ([[ixc]] = 1, the
default), and a pseudopotential from the Goedecker-Hutter-Teter table.
(as well as the local-spin-density approximation) in the Perdew-Wang parametrization ([[ixc]] = -1012)
and a pseudopotential from the pseudodojo <http://www.pseudo-dojo.org/>.
At this stage, we compared our results:
* bond length: 1.522 Bohr
* atomisation energy at that bond length: 0.1656 Ha = 4.506 eV
* bond length: 1.486 Bohr
* atomisation energy at that bond length: 0.1704 Ha = 4.635 eV
with the experimental data (as well as theoretical data using a much more accurate technique than DFT)
* bond length: 1.401 Bohr
* atomisation energy: 4.747 eV
The bond length is awful (nearly 10% off), and the atomisation energy is a bit too low, 5% off.
The bond length is rather bad (about 6% off), and the atomisation energy is a bit too low, 2.5% off.
## 2 The convergence in ecut (I)
@ -49,46 +49,39 @@ Why not Work2?*
Because we will compute many times the bond length and atomisation energy, it
is worth to make a single input file that will do all the associated operations.
You should try to use 2 datasets (try to combine *\$ABI_TESTS/tutorial/Input/tbase1_3.in* with *tbase1_5.in*).
You should try to use 2 datasets (try to combine *\$ABI_TESTS/tutorial/Input/tbase1_3.abi* with *tbase1_5.abi*).
Do not try to have the same position of the H atom as one of the H$_2$ atoms in the optimized geometry.
```sh
cd $ABI_TESTS/tutorial/Input
mkdir Work2
cd Work2
cp ../tbase2_x.files . # You will need to edit this file.
cp ../tbase2_1.in .
cp ../tbase2_1.abi .
```
The input file *tbase2_1.in* is an example of file that will do the job,
The input file *tbase2_1.abi* is an example of file that will do the job,
{% dialog tests/tutorial/Input/tbase2_1.in %}
{% dialog tests/tutorial/Input/tbase2_1.abi %}
while *tbase2_1.out* is an example of output file:
while *tbase2_1.abo* is an example of output file:
{% dialog tests/tutorial/Refs/tbase2_1.out %}
You might use *$ABI_TESTS/tutorial/Input/tbase2_x.files* as *files* file
(do not forget to modify it, like in [[lesson:base1|tutorial 1]],
although it does not differ from *tbase1_x.files*.
{% dialog tests/tutorial/Input/tbase2_x.files %}
{% dialog tests/tutorial/Refs/tbase2_1.abo %}
Execute the code with:
abinit < tbase2_x.files > log 2> err &
abinit tbase2_1.abi > log &
The run should take less than one minute.
You should obtain the values:
etotal1 -1.1058360644E+00
etotal2 -4.7010531489E-01
etotal1 -1.1182883137E+00
etotal2 -4.7393103688E-01
and
xcart1 -7.6091015760E-01 0.0000000000E+00 0.0000000000E+00
7.6091015760E-01 0.0000000000E+00 0.0000000000E+00
xcart1 -7.4307169181E-01 0.0000000000E+00 0.0000000000E+00
7.4307169181E-01 0.0000000000E+00 0.0000000000E+00
These are similar to those determined in [tutorial 1](base1),
although they have been obtained in one run.
@ -96,7 +89,7 @@ You can also check that the residual forces are lower than `5.0d-4`.
Convergence issues are discussed in [[help:abinit#numerical-quality|section 6]] of the abinit help file, on numerical quality.
You should read it.
By the way, you have read many parts of the abinit help file!
You are missing the sections [[help:abinit#2|2]], [[help:abinit#pseudopotential-files|5]], [[help:abinit#numerical-quality|6]].
You are missing the sections (or part of) [[help:abinit#2|2]], [[help:abinit#pseudopotential-files|5]], [[help:abinit#numerical-quality|6]].
You are also missing the description of many input variables.
We suggest that you finish reading entirely the abinit help file now, while
@ -112,7 +105,7 @@ focus only on [[ecut]] and [[acell]]. This is because
* there is no k point convergence study to be done for an isolated system in a big box:
no additional information is gained by adding a k-point beyond one
* the boxcut value is automatically chosen larger than 2 by ABINIT, see the determination of the
* the boxcut value (see [[boxcutmin]]) is automatically chosen larger than 2 by ABINIT, see the determination of the
input variable [[ngfft]] by preprocessing
* we are using [[ionmov]] = 2 for the determination of the geometry.
@ -120,8 +113,8 @@ focus only on [[ecut]] and [[acell]]. This is because
## 3 The convergence in ecut (II)
For the check of convergence with respect to [[ecut]], you have the choice
between doing different runs of the *tbase2_1.in* file with different values of
[[ecut]], or doing a double loop of datasets, as proposed in *$ABI_TESTS/tutorial/Input/tbase2_2.in*.
between doing different runs of the *tbase2_1.abi* file with different values of
[[ecut]], or doing a double loop of datasets, as proposed in *$ABI_TESTS/tutorial/Input/tbase2_2.abi*.
The values of [[ecut]] have been chosen between 10 Ha and 35 Ha, by step of 5 Ha.
If you want to make a double loop, you might benefit of reading again the
[[help:abinit#loop|double-loop section]] of the abinit_help file.
@ -131,51 +124,51 @@ calculation. You should also look at the increase of the memory needed to do
the calculation (go back to the beginning of the output file).
The output data are as follows:
etotal11 -1.1058360644E+00
etotal12 -4.7010531489E-01
etotal21 -1.1218716100E+00
etotal22 -4.7529731401E-01
etotal31 -1.1291943792E+00
etotal32 -4.7773586424E-01
etotal41 -1.1326879404E+00
etotal42 -4.7899908214E-01
etotal51 -1.1346739190E+00
etotal52 -4.7972721653E-01
etotal61 -1.1359660026E+00
etotal62 -4.8022016459E-01
etotal11 -1.1182883137E+00
etotal12 -4.7393103688E-01
etotal21 -1.1325211211E+00
etotal22 -4.7860857539E-01
etotal31 -1.1374371581E+00
etotal32 -4.8027186429E-01
etotal41 -1.1389569555E+00
etotal42 -4.8083335144E-01
etotal51 -1.1394234882E+00
etotal52 -4.8101478048E-01
etotal61 -1.1395511942E+00
etotal62 -4.8107063412E-01
xcart11 -7.6091015760E-01 0.0000000000E+00 0.0000000000E+00
7.6091015760E-01 0.0000000000E+00 0.0000000000E+00
xcart12 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00
xcart21 -7.5104912643E-01 0.0000000000E+00 0.0000000000E+00
7.5104912643E-01 0.0000000000E+00 0.0000000000E+00
xcart22 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00
xcart31 -7.3977108831E-01 0.0000000000E+00 0.0000000000E+00
7.3977108831E-01 0.0000000000E+00 0.0000000000E+00
xcart32 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00
xcart41 -7.3304273322E-01 0.0000000000E+00 0.0000000000E+00
7.3304273322E-01 0.0000000000E+00 0.0000000000E+00
xcart42 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00
xcart51 -7.3001570260E-01 0.0000000000E+00 0.0000000000E+00
7.3001570260E-01 0.0000000000E+00 0.0000000000E+00
xcart52 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00
xcart61 -7.2955902118E-01 0.0000000000E+00 0.0000000000E+00
7.2955902118E-01 0.0000000000E+00 0.0000000000E+00
xcart62 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00
xcart11 -7.4307169181E-01 0.0000000000E+00 0.0000000000E+00
7.4307169181E-01 0.0000000000E+00 0.0000000000E+00
xcart12 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00
xcart21 -7.3687974546E-01 0.0000000000E+00 0.0000000000E+00
7.3687974546E-01 0.0000000000E+00 0.0000000000E+00
xcart22 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00
xcart31 -7.3014665027E-01 0.0000000000E+00 0.0000000000E+00
7.3014665027E-01 0.0000000000E+00 0.0000000000E+00
xcart32 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00
xcart41 -7.2642579309E-01 0.0000000000E+00 0.0000000000E+00
7.2642579309E-01 0.0000000000E+00 0.0000000000E+00
xcart42 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00
xcart51 -7.2563260546E-01 0.0000000000E+00 0.0000000000E+00
7.2563260546E-01 0.0000000000E+00 0.0000000000E+00
xcart52 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00
xcart61 -7.2554339763E-01 0.0000000000E+00 0.0000000000E+00
7.2554339763E-01 0.0000000000E+00 0.0000000000E+00
xcart62 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00
The corresponding atomisation energies and interatomic distances are:
| ecut (Ha) | atomisation energy (Ha) | interatomic distance (Bohr)
| :-- | :-- | :--
10 | .1656 | 1.522
15 | .1713 | 1.502
20 | .1737 | 1.480
25 | .1747 | 1.466
30 | .1753 | 1.460
35 | .1756 | 1.459
10 | .1704 | 1.486
15 | .1753 | 1.474
20 | .1769 | 1.460
25 | .1773 | 1.453
30 | .1774 | 1.451
35 | .1774 | 1.451
In order to obtain 0.2% relative accuracy on the bond length or atomisation
energy, one should use a kinetic cut-off energy of 30 Ha.
energy, one should use a kinetic cut-off energy of 25 Ha.
We will keep in mind this value for the final run.
## 4 The convergence in acell
@ -185,62 +178,60 @@ We will explore [[acell]] starting from `8 8 8` to `18 18 18`, by step of `2 2 2
We keep [[ecut]] 10 for this study. Indeed, it is a rather general rule that there is
little cross-influence between the convergence of [[ecut]] and the convergence of [[acell]].
The file *$ABI_TESTS/tutorial/Input/tbase2_3.in* can be used as an example.
The file *$ABI_TESTS/tutorial/Input/tbase2_3.abi* can be used as an example.
{% dialog tests/tutorial/Input/tbase2_3.in %}
{% dialog tests/tutorial/Input/tbase2_3.abi %}
The output results in *$ABI_TESTS/tutorial/Refs/tbase2_3.out* are as follows:
The output results in *$ABI_TESTS/tutorial/Refs/tbase2_3.abo* are as follows:
etotal11 -1.1188124709E+00
etotal12 -4.8074164402E-01
etotal21 -1.1058360838E+00
etotal22 -4.7010531489E-01
etotal31 -1.1039109527E+00
etotal32 -4.6767804802E-01
etotal41 -1.1039012868E+00
etotal42 -4.6743724199E-01
etotal51 -1.1041439411E+00
etotal52 -4.6735895176E-01
etotal61 -1.1042058281E+00
etotal62 -4.6736729718E-01
etotal11 -1.1305202335E+00
etotal12 -4.8429570903E-01
etotal21 -1.1182883137E+00
etotal22 -4.7393103688E-01
etotal31 -1.1165450484E+00
etotal32 -4.7158917506E-01
etotal41 -1.1165327748E+00
etotal42 -4.7136118536E-01
etotal51 -1.1167740301E+00
etotal52 -4.7128698890E-01
etotal61 -1.1168374331E+00
etotal62 -4.7129589330E-01
xcart11 -7.8330751426E-01 0.0000000000E+00 0.0000000000E+00
7.8330751426E-01 0.0000000000E+00 0.0000000000E+00
xcart12 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00
xcart21 -7.6024281092E-01 0.0000000000E+00 0.0000000000E+00
7.6024281092E-01 0.0000000000E+00 0.0000000000E+00
xcart22 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00
xcart31 -7.5428234893E-01 0.0000000000E+00 0.0000000000E+00
7.5428234893E-01 0.0000000000E+00 0.0000000000E+00
xcart32 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00
xcart41 -7.5446921004E-01 0.0000000000E+00 0.0000000000E+00
7.5446921004E-01 0.0000000000E+00 0.0000000000E+00
xcart42 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00
xcart51 -7.5384974520E-01 0.0000000000E+00 0.0000000000E+00
7.5384974520E-01 0.0000000000E+00 0.0000000000E+00
xcart52 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00
xcart61 -7.5373336127E-01 0.0000000000E+00 0.0000000000E+00
7.5373336127E-01 0.0000000000E+00 0.0000000000E+00
xcart62 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00
xcart11 -7.6471149217E-01 0.0000000000E+00 0.0000000000E+00
7.6471149217E-01 0.0000000000E+00 0.0000000000E+00
xcart12 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00
xcart21 -7.4307169181E-01 0.0000000000E+00 0.0000000000E+00
7.4307169181E-01 0.0000000000E+00 0.0000000000E+00
xcart22 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00
xcart31 -7.3778405090E-01 0.0000000000E+00 0.0000000000E+00
7.3778405090E-01 0.0000000000E+00 0.0000000000E+00
xcart32 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00
xcart41 -7.3794243127E-01 0.0000000000E+00 0.0000000000E+00
7.3794243127E-01 0.0000000000E+00 0.0000000000E+00
xcart42 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00
xcart51 -7.3742475720E-01 0.0000000000E+00 0.0000000000E+00
7.3742475720E-01 0.0000000000E+00 0.0000000000E+00
xcart52 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00
xcart61 -7.3733248368E-01 0.0000000000E+00 0.0000000000E+00
7.3733248368E-01 0.0000000000E+00 0.0000000000E+00
xcart62 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00
The corresponding atomisation energies and interatomic distances are:
| acell (Bohr) | atomisation energy (Ha) | interatomic distance (Bohr)
| :-- | :-- | :--
8 | .1574 | 1.568
10 | .1656 | 1.522
12 | .1686 | 1.509
14 | .1691 | 1.510
16 | .1694 | 1.508
18 | .1695 | 1.508
8 | .1619 | 1.529
10 | .1704 | 1.486
12 | .1734 | 1.476
14 | .1738 | 1.478
16 | .1742 | 1.475
18 | .1742 | 1.475
In order to reach 0.2% convergence on the interatomic distance, one needs `acell 12 12 12`.
The atomisation energy needs `acell 14 14 14` to be converged at that level.
At `12 12 12`, the difference is .0009 Ha = 0.024 eV, which is sufficiently small for practical purposes.
We will use `acell 12 12 12` for the final run.
In order to reach 0.2% convergence on the atomisation energy and interatomic distance one needs `acell 16 16 16`.
We will use `acell 16 16 16` for the final run.
For most solids the size of the unit cell will be smaller than that.
We are treating a lot of vacuum in this supercell!
We are treating a lot of vacuum in this supercell !
So, the H$_2$ study, with this pseudopotential, turns out to be not really easy.
Of course, the number of states to be treated is minimal!
This allows to have reasonable CPU time still.
@ -248,17 +239,17 @@ This allows to have reasonable CPU time still.
## 5 The final calculation in Local (Spin) Density Approximation
We now use the correct values of both [[ecut]] and [[acell]].
Well, you should modify the *tbase2_3.in* file to make a calculation with `acell 12 12 12` and `ecut 30`.
Well, you should modify the *tbase2_3.abi* file to make a calculation with `acell 16 16 16` and `ecut 25`.
You can still use the double loop feature with `udtset 1 2`
(which reduces to a single loop), to minimize the modifications to the file.
The file *$ABI_TESTS/tutorial/Input/tbase2_4.in* can be taken as an example of input file:
The file *$ABI_TESTS/tutorial/Input/tbase2_4.abi* can be taken as an example of input file:
{% dialog tests/tutorial/Input/tbase2_4.in %}
{% dialog tests/tutorial/Input/tbase2_4.abi %}
while *$ABI_TESTS/tutorial/Refs/tbase2_4.out* is as an example of output file:
while *$ABI_TESTS/tutorial/Refs/tbase2_4.abo* is as an example of output file:
{% dialog tests/tutorial/Refs/tbase2_4.out %}
{% dialog tests/tutorial/Refs/tbase2_4.abo %}
Since we are doing the calculation at a single ([[ecut]], [[acell]]) pair, the
total CPU time is not as much as for the previous determinations of optimal
@ -267,33 +258,36 @@ However, the memory needs have still increased a bit.
The output data are:
etotal11 -1.1329369190E+00
etotal12 -4.7765320721E-01
etotal11 -1.1369766875E+00
etotal12 -4.7827555035E-01
xcart11 -7.2594741339E-01 0.0000000000E+00 0.0000000000E+00
7.2594741339E-01 0.0000000000E+00 0.0000000000E+00
xcart12 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00
xcart11 -7.2259811794E-01 0.0000000000E+00 0.0000000000E+00
7.2259811794E-01 0.0000000000E+00 0.0000000000E+00
xcart12 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00
* The corresponding atomisation energy is `0.1776 Ha = 4.833 eV`
* The interatomic distance is 1.452 Bohr.
* The corresponding atomisation energy is `0.1804 Ha = 4.910 eV`
* The interatomic distance is 1.445 Bohr.
* These are our final data for the local (spin) density approximation.
We have used [[ixc]] = 1.
Other expressions for the local (spin) density approximation [2, 3 ... 7] are possible.
Witou our choice of pseudopotential, the value of [[ixc]] was -1012, corresponding
to the Perdew-Wang [[cite:Perdew1992a]] parameterization of the LDA XC functional.
It is in principle the same as using [[ixc]] = 1.
Other expressions for the local (spin) density approximation [[ixc]]=[2, 3 ... 7] are possible.
The values 1, 2, 3 and 7 should give about the same results, since they all start
from the XC energy of the homogeneous electron gas, as determined by Quantum Monte Carlo calculations.
Other possibilities (*ixc* = 4, 5, 6) are older local density functionals, that could not rely on these data.
Other possibilities ([[ixc]] = 4, 5, 6) are older local density functionals, that could not rely on these data.
## 6 The use of the Generalized Gradient Approximation
We will use the Perdew-Burke-Ernzerhof functional proposed in [[cite:Perdew1996]]
In principle, for GGA, one should use another pseudopotential than for LDA.
For GGA, we use another pseudopotential than for LDA.
In principle we should redo the [[ecut]] convergence test, possibly coming to the conclusion
that another value of [[ecut]] should be use.
However, for the special case of Hydrogen, and in general pseudopotentials
with a very small core (including only the 1s orbital), pseudopotentials
issued from the LDA and from the GGA are very similar.
So, we will not change our pseudopotential.
This will save us lot of time, as we should not redo an [[ecut]] convergence test
So, we will not redo an [[ecut]] convergence test.
!!! important
@ -302,19 +296,19 @@ This will save us lot of time, as we should not redo an [[ecut]] convergence tes
Independently of the pseudopotential, an [[acell]] convergence test should not
be done again, since the vacuum is treated similarly in LDA or GGA.
So, our final values within GGA will be easily obtained by setting [[ixc]] to 11 in *tbase2_4.in*.
So, our final values within GGA will be easily obtained by changing the pseudopotential with respect to the one used in *tbase2_4.abi*.
{% dialog tests/tutorial/Input/tbase2_5.in %}
{% dialog tests/tutorial/Input/tbase2_5.abi %}
etotal11 -1.1621428376E+00
etotal12 -4.9869631917E-01
etotal11 -1.1658082573E+00
etotal12 -4.9940910146E-01
xcart11 -7.1190611804E-01 0.0000000000E+00 0.0000000000E+00
7.1190611804E-01 0.0000000000E+00 0.0000000000E+00
xcart12 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00
xcart11 -7.0870975055E-01 -2.3009273766E-32 -6.6702161522E-32
7.0870975055E-01 2.3009273766E-32 6.6702161522E-32
xcart12 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00
* The corresponding atomisation energy is 0.1648 Ha = 4.483 eV
* The interatomic distance is 1.424 Bohr.
* The corresponding atomisation energy is 0.1670 Ha = 4.544 eV
* The interatomic distance is 1.417 Bohr.
* These are our final data for the generalized gradient approximation.
Once more, here are the experimental data:
@ -323,8 +317,11 @@ Once more, here are the experimental data:
* atomisation energy: 4.747 eV
In GGA, we are within 2% of the experimental bond length, but 5% of the experimental atomisation energy.
In LDA, we were within 4% of the experimental bond length, and within 2% of the experimental atomisation energy.
In LDA, we were within 3% of the experimental bond length, and about 3.5% of the experimental atomisation energy.
!!! important
Do not forget that the typical accuracy of LDA and GGA varies with the class of materials studied.
Usually, LDA gives too small lattice parameters, by 1...3%, while GGA gives too large lattice parameters, by 1...3% as well,
but there might be classes of materials for which the deviation is larger.
See e.g. [[cite:Lejaeghere2014]].

View File

@ -8,9 +8,9 @@ authors: XG, RC
This tutorial aims at showing you how to get the following physical properties, for an insulator:
* the total energy
* the lattice parameter
* the band structure (actually, the Kohn-Sham band structure)
* the total energy,
* the lattice parameter,
* the band structure (actually, the Kohn-Sham band structure).
You will learn about the use of k-points, as well as the smearing of the plane-wave kinetic energy cut-off.
@ -28,22 +28,20 @@ This tutorial should take about 1 hour.
*Before beginning, you might consider working in a different subdirectory, as
for tutorial 1 or 2. Why not Work3?*
The file *tbase3_x.files* lists the file names and root names.
You can copy it in the *Work3* directory and change it as you did in the
The following commands will move you to your working directory, create the *Work3* directory, and move you into that directory as you did in the
[[lesson:base1|first]] and [[lesson:base2|second]] tutorials.
You can also copy the file *tbase3_1.in* inside the *Work3* directory with:
Then, we copy the file *tbase3_1.abi* inside the *Work3* directory. The commands are:
```sh
cd $ABI_TESTS/tutorial/Input
mkdir Work3
cd Work3
cp ../tbase3_x.files . # You will need to edit this file.
cp ../tbase3_1.in .
cp ../tbase3_1.abi .
```
This is your input file:
{% dialog tests/tutorial/Input/tbase3_1.in %}
{% dialog tests/tutorial/Input/tbase3_1.abi %}
You should edit it, read it carefully, have a look at the following **new input variables** and their explanation:
@ -52,18 +50,18 @@ You should edit it, read it carefully, have a look at the following **new input
* [[kptopt]], [[ngkpt]], [[nshiftk]], [[shiftk]], [[kptrlatt]] (not easy, take your time!)
* [[diemac]] (a different value is used for this variable compare to previous calculations where isolated molecules were considered).
Note also the following: you will work at fixed [[ecut]] (8Ha).
Note also the following: you will work at fixed [[ecut]] (12Ha).
It is implicit that in *real life*, you should do a convergence test with respect to *ecut*.
Here, a suitable *ecut* is given to you.
It will result in a lattice parameter that is 0.2% off of the experimental value.
Here, a suitable *ecut* is given to you; it corresponds to the suggested *ecut* for this pseudopotential according to the [PseudoDojo website](http://www.pseudo-dojo.org/) where the silicon pseudopotential was taken.
When we will relax the lattice parameter, it will result in a lattice parameter that is 0.2% off of the experimental value.
When you have read the input file, you can run the code, as usual:
abinit < tbase3_x.files > log 2> err &
abinit tbase3_1.abi > log 2> err &
Then, read the output file, and note the total energy:
etotal -8.8662238960E+00
etotal -8.5187390642E+00
## Starting the convergence study with respect to k-points
@ -88,32 +86,32 @@ You might nevertheless define an input [[nkpt]] value in the input file, in whic
its computed value (from the grid) with this input value.
We take this opportunity to examine the behaviour of abinit when a problem is detected.
Let us suppose that with *ngkpt1 4 4 4*, one mentions *nkpt1 2*.
The input file *tbase3_2.in* is an example:
Let us suppose that with *ngkpt 4 4 4*, one mentions *nkpt 2*.
The input file *tbase3_2.abi* is an example:
{% dialog tests/tutorial/Input/tbase3_2.in %}
{% dialog tests/tutorial/Input/tbase3_2.abi %}
Do not forget to change *tbase3_x.files*, if you are using that file name.
The message that you get a few dozen of lines before the end of the log file is:
```yaml
--- !BUG
src_file: m_kpts.F90
src_line: 1417
mpi_rank: 0
message: |
The argument nkpt= 2, does not match
the number of k-points generated by kptopt, kptrlatt, shiftk,
and the eventual symmetries, that is, nkpt= 10.
However, note that it might be due to the user,
if nkpt is explicitely defined in the input file.
In this case, please check your input file.
src_file: getkgrid.F90
src_line: 415
The argument nkpt = 2, does not match
the number of k points generated by kptopt, kptrlatt, shiftk,
and the eventual symmetries, that is, nkpt= 10.
However, note that it might be due to the user,
if nkpt is explicitely defined in the input file.
In this case, please check your input file.
...
Action : contact ABINIT group.
Action: contact ABINIT group (please attach the output of `abinit -b`)
```
This is a typical abinit error message.
It states what is the problem that causes the stop of the code, then suggests that it might be due to an error
It states what is the problem that causes the code to stop, then suggests that it might be due to an error
in the input file, namely, an erroneous value of [[nkpt]].
The expected value, [[nkpt]] 10 is mentioned before the notice that the input file might be erroneous.
Then, the file at which the problem occurred is mentioned, as well as the number of the line in that file.
@ -137,42 +135,41 @@ When one begins the study of a new material, it is strongly advised to examine f
and select (at least) three efficient ones, for the k-point convergence study.
Do not forget that the CPU time will be linearly proportional to the number of k-points to be treated:
using 10 k-points will take five more times than using 2 k-points. Even for a similar accuracy of the
Brillouin zone integration (about the same value of [[kptrlen]]), it might be easy to generate a grid
that will fold to 10 k-points in the irreducible Brillouin zone, as well as one that will fold to 2 k-points
using 10 k-points will take five times more than using 2 k-points. Even for a similar accuracy of the
Brillouin zone integration (that is to say for about the same value of [[kptrlen]]), there might be a grid that will reduce to 10 k-points in the irreducible Brillouin zone and another that will reduce to 2 k-points
in the irreducible Brillouin zone.
The latter is clearly to be preferred!
The latter is clearly to be preferred from a computational perspective!
## Convergence study with respect to k-points
In order to understand k-point grids, you should read [[cite:Monkhorst1976]].
Well, maybe not immediately. In the meantime, you can try the above-mentioned convergence study.
The input file *tbase3_3.in* is an example,
while *$ABI_TESTS/tutorial/Refs/tbase3_3.out* is a reference output file.
The input file *tbase3_3.abi* is an example,
while *$ABI_TESTS/tutorial/Refs/tbase3_3.abo* is a reference output file.
```sh
cd $ABI_TESTS/tutorial/Work3
cp ../tbase3_3.in .
cp ../tbase3_3.abi .
```
{% dialog tests/tutorial/Input/tbase3_3.in tests/tutorial/Refs/tbase3_3.out %}
{% dialog tests/tutorial/Input/tbase3_3.abi tests/tutorial/Refs/tbase3_3.abo %}
In this output file, you should have a look at the echo of input variables.
As you know, these are preprocessed, and, in particular, [[ngkpt]] and [[shiftk]]
are used to generate the list of k-points ([[kpt]]) and their weights ([[wtk]]).
You should read the information about [[kpt]] and [[wtk]].
From the output file, here is the evolution of total energy per unit cell:
From the output file, here is the evolution of total energy for the different k-point grids:
etotal1 -8.8662238960E+00
etotal2 -8.8724909739E+00
etotal3 -8.8726017432E+00
etotal4 -8.8726056405E+00
etotal1 -8.5187390642E+00
etotal2 -8.5250179735E+00
etotal3 -8.5251232908E+00
etotal4 -8.5251270559E+00
The difference between dataset 3 and dataset 4 is rather small.
Even the dataset 2 gives an accuracy of about 0.0001 Ha. So, our converged value for the total energy,
at fixed [[acell]], fixed [[ecut]], is -8.8726 Ha.
at fixed [[acell]], fixed [[ecut]], is -8.8251 Ha.
## Determination of the lattice parameters
@ -188,25 +185,25 @@ For the automatic optimisation of cell volume, use:
You should read the indications about [[dilatmx]] and [[ecutsm]].
Do not test all the k-point grids, only those with **nkpt** 2 and 10.
The input file *$ABI_TESTS/tutorial/Input/tbase3_4.in* is an example,
The input file *$ABI_TESTS/tutorial/Input/tbase3_4.abi* is an example,
{% dialog tests/tutorial/Input/tbase3_4.in %}
{% dialog tests/tutorial/Input/tbase3_4.abi %}
while *$ABI_TESTS/tutorial/Refs/tbase3_4.out* is a reference output file.
while *$ABI_TESTS/tutorial/Refs/tbase3_4.abo* is a reference output file.
{% dialog tests/tutorial/Refs/tbase3_4.out %}
{% dialog tests/tutorial/Refs/tbase3_4.abo %}
You should obtain the following evolution of the lattice parameters:
acell1 1.0233363682E+01 1.0233363682E+01 1.0233363682E+01 Bohr
acell2 1.0216447241E+01 1.0216447241E+01 1.0216447241E+01 Bohr
acell1 1.0208746777E+01 1.0208746777E+01 1.0208746777E+01 Bohr
acell2 1.0195482058E+01 1.0195482058E+01 1.0195482058E+01 Bohr
with the following very small residual stresses:
strten1 1.8591719160E-07 1.8591719160E-07 1.8591719160E-07
0.0000000000E+00 0.0000000000E+00 0.0000000000E+00
strten2 -2.8279720007E-08 -2.8279720007E-08 -2.8279720007E-08
0.0000000000E+00 0.0000000000E+00 0.0000000000E+00
strten1 -2.0279878345E-08 -2.0279878345E-08 -2.0279878345E-08
0.0000000000E+00 0.0000000000E+00 0.0000000000E+00
strten2 -9.2829783285E-08 -9.2829783286E-08 -9.2829783286E-08
0.0000000000E+00 0.0000000000E+00 0.0000000000E+00
The stress tensor is given in Hartree/Bohr<sup>3</sup>, and the order of the components is:
@ -214,15 +211,15 @@ The stress tensor is given in Hartree/Bohr<sup>3</sup>, and the order of the com
23 13 12
There is only a 0.13% relative difference between *acell1* and *acell2*.
So, our converged LDA value for Silicon, with the *14si.pspnc* pseudopotential (see the *tbase3_x.files* file)
is 10.216 Bohr (actually 10.21644), that is 5.406 Angstrom.
So, our converged LDA value for Silicon, with the *Si.psp8* pseudopotential of the [PseudoDojo website](http://www.pseudo-dojo.org/)
is 10.195 Bohr, that is 5.395 Angstrom.
The experimental value is *5.431* Angstrom at 25 degree Celsius,
see R.W.G. Wyckoff, Crystal structures Ed. Wiley and sons, New-York (1963)
or the [NIST database](https://physics.nist.gov/cgi-bin/cuu/Value?asil|search_for=silicon).
## Computing the band structure
We fix the parameters [[acell]] to the theoretical value of 3 * 10.216,
We fix the parameters [[acell]] to the theoretical value of 3 * 10.195,
and we fix also the grid of k-points (the 4x4x4 FCC grid, equivalent to a 8x8x8 Monkhorst-pack grid).
We will ask for 8 bands (4 valence and 4 conduction).
@ -255,41 +252,42 @@ Note:
So, you should set up in your input file, for the first dataset, a usual SCF calculation
in which you output the density ([[prtden]] 1), and, for the second dataset:
* fix [[iscf]] to -2, to make a non-self-consistent calculation;
* define [[getden]] -1, to take the output density of dataset 1;
* set [[nband]] to 8;
* fix [[iscf]] to -2, to make a non-self-consistent calculation,
* define [[getden]] -1, to take the output density of dataset 1,
* set [[nband]] to 8,
* set [[kptopt]] to -3, to define three segments in the brillouin Zone;
* set [[ndivsm]] to 10
* set [[ndivsm]] to 10,
* set [[kptbounds]] to
0.5 0.0 0.0 # L point
0.0 0.0 0.0 # Gamma point
0.0 0.5 0.5 # X point
1.0 1.0 1.0 # Gamma point in another cell.
1.0 1.0 1.0 # Gamma point in another cell
* set [[enunit]] to 1, in order to have eigenenergies in eV
* set [[enunit]] to 1, in order to have eigenenergies in eV,
* the only tolerance criterion admitted for non-self-consistent calculations is [[tolwfr]].
You should set it to 1.0d-10 (or so), and suppress [[toldfe]].
* The [[nstep]] parameter was set to 20 to make sure convergence can be reached.
The input file *$ABI_TESTS/tutorial/Input/tbase3_5.in* is an example,
The input file *$ABI_TESTS/tutorial/Input/tbase3_5.abi* is an example,
{% dialog tests/tutorial/Input/tbase3_5.in %}
{% dialog tests/tutorial/Input/tbase3_5.abi %}
while *$ABI_TESTS/tutorial/Refs/tbase3_5.out* is a reference output file.
while *$ABI_TESTS/tutorial/Refs/tbase3_5.abo* is a reference output file.
{% dialog tests/tutorial/Refs/tbase3_5.out %}
{% dialog tests/tutorial/Refs/tbase3_5.abo %}
You should find the band structure starting at (second dataset):
Eigenvalues ( eV ) for nkpt= 40 k points:
kpt# 1, nband= 8, wtk= 1.00000, kpt= 0.5000 0.0000 0.0000 (reduced coord)
-3.78815 -1.15872 4.69668 4.69668 7.38795 9.23867 9.23867 13.45707
kpt# 2, nband= 8, wtk= 1.00000, kpt= 0.4500 0.0000 0.0000 (reduced coord)
-3.92759 -0.95774 4.71292 4.71292 7.40692 9.25561 9.25561 13.48927
kpt# 3, nband= 8, wtk= 1.00000, kpt= 0.4000 0.0000 0.0000 (reduced coord)
-4.25432 -0.44393 4.76726 4.76726 7.46846 9.31193 9.31193 13.57737
kpt# 4, nband= 8, wtk= 1.00000, kpt= 0.3500 0.0000 0.0000 (reduced coord)
-4.64019 0.24941 4.85732 4.85732 7.56855 9.38323 9.38323 13.64601
Eigenvalues ( eV ) for nkpt= 39 k points:
kpt# 1, nband= 8, wtk= 1.00000, kpt= 0.5000 0.0000 0.0000 (reduced coord)
-4.83930 -2.21100 3.66138 3.66138 6.36920 8.18203 8.18203 12.44046
kpt# 2, nband= 8, wtk= 1.00000, kpt= 0.4500 0.0000 0.0000 (reduced coord)
-4.97880 -2.00874 3.67946 3.67946 6.39165 8.20580 8.20580 12.47444
kpt# 3, nband= 8, wtk= 1.00000, kpt= 0.4000 0.0000 0.0000 (reduced coord)
-5.30638 -1.49394 3.73328 3.73328 6.45364 8.26444 8.26444 12.56455
kpt# 4, nband= 8, wtk= 1.00000, kpt= 0.3500 0.0000 0.0000 (reduced coord)
-5.69306 -0.79729 3.82286 3.82286 6.55602 8.33970 8.33970 12.65080
....
One needs a graphical tool to represent all these data.
@ -298,25 +296,25 @@ In a separate file (*_EIG*), you will find the list of k-points and the eigenene
Even without a graphical tool we will have a quick look at the values at L, $\Gamma$, X and $\Gamma$ again:
kpt# 1, nband= 8, wtk= 1.00000, kpt= 0.5000 0.0000 0.0000 (reduced coord)
-3.78815 -1.15872 4.69668 4.69668 7.38795 9.23867 9.23867 13.45707
kpt# 1, nband= 8, wtk= 1.00000, kpt= 0.5000 0.0000 0.0000 (reduced coord)
-4.83930 -2.21100 3.66138 3.66138 6.36920 8.18203 8.18203 12.44046
kpt# 11, nband= 8, wtk= 1.00000, kpt= 0.0000 0.0000 0.0000 (reduced coord)
-6.17005 5.91814 5.91814 5.91814 8.44836 8.44836 8.44836 9.17755
kpt# 11, nband= 8, wtk= 1.00000, kpt= 0.0000 0.0000 0.0000 (reduced coord)
-7.22396 4.87519 4.87519 4.87519 7.42159 7.42159 7.42159 8.26902
kpt# 23, nband= 8, wtk= 1.00000, kpt= 0.0000 0.5000 0.5000 (reduced coord)
-1.96393 -1.96393 3.00569 3.00569 6.51173 6.51173 15.95524 15.95524
kpt# 23, nband= 8, wtk= 1.00000, kpt= 0.0000 0.5000 0.5000 (reduced coord)
-3.01262 -3.01262 1.97054 1.97054 5.46033 5.46033 15.02324 15.02382
kpt# 39, nband= 8, wtk= 1.00000, kpt= 1.0000 1.0000 1.0000 (reduced coord)
-6.17005 5.91814 5.91814 5.91814 8.44836 8.44836 8.44836 9.17755
kpt# 39, nband= 8, wtk= 1.00000, kpt= 1.0000 1.0000 1.0000 (reduced coord)
-7.22396 4.87519 4.87519 4.87519 7.42159 7.42159 7.42159 8.26902
The last $\Gamma$ is exactly equivalent to the first $\Gamma$.
It can be checked that the top of the valence band
is obtained at $\Gamma$ (=5.91814 eV). The width of the valence band is 12.09 eV, the lowest unoccupied state at X
is 0.594 eV higher than the top of the valence band, at $\Gamma$.
is obtained at $\Gamma$ (=4.87519 eV). The width of the valence band is 12.1 eV, the lowest unoccupied state at X
is 0.585 eV higher than the top of the valence band, at $\Gamma$.
The Si is described as an indirect band gap material (this is correct),
with a band-gap of about 0.594 eV (this is quantitatively quite wrong: the experimental value 1.17 eV is at 25 degree Celsius).
with a band-gap of about 0.585 eV (this is quantitatively quite wrong: the experimental value 1.17 eV is at 25 degree Celsius).
The minimum of the conduction band is even slightly displaced with respect to X, see kpt # 21.
This underestimation of the band gap is well-known (the famous DFT band-gap problem).
In order to obtain correct band gaps, you need to go beyond the Kohn-Sham Density Functional
@ -351,7 +349,7 @@ The high-symmetry k-path follows the conventions described in [[cite:Setyawan201
Let's try with:
```sh
abistruct.py kpath tbase3_5.in
abistruct.py kpath tbase3_5.abi
# Abinit Structure
natom 2

View File

@ -24,21 +24,20 @@ This tutorial should take about 1 hour and 30 minutes.
*Before beginning, you might consider to work in a different subdirectory, as for tutorials 1, 2 or 3.
Why not Work4?*
The file *tbase4_x.files* lists the file names and root names.
You can copy it in the *Work4* directory (and change it, as usual).
You can also copy the file *tbase4_1.in* in *Work4*.
The following commands will move you to your working directory, create the *Work4* directory, and move you into that directory as you did in the previous tutorials.
Then, we copy the file *tbase4_1.abi* inside the *Work4* directory. The commands are:
```sh
cd $ABI_TESTS/tutorial/Input
mkdir Work4
cd Work4
cp ../tbase4_x.files . # You will need to edit this file.
cp ../tbase4_1.in .
cp ../tbase4_1.abi .
```
*tbase4_1.in* is our input file. You should edit it and read it carefully,
*tbase4_1.abi* is our input file. You should edit it and read it carefully,
{% dialog tests/tutorial/Input/tbase4_x.files tests/tutorial/Input/tbase4_1.in %}
{% dialog tests/tutorial/Input/tbase4_1.abi %}
and then a look at the following new input variables:
@ -51,48 +50,46 @@ Note also the following:
you should do a convergence test with respect to *ecut*.
Here, a suitable *ecut* is given to you in order to save time.
It will give a lattice parameter that is 0.2% off of the experimental value.
Note that this is the *softer* pseudopotential of those that we have used until now: the *01h.pspgth* for H needed 30 Ha
(it was rather hard), the *14si.pspnc* for Si needed 8 Ha. Se the end of this page for a
Note that this is the *softest* pseudopotential of those that we have used until now: the *01h.pspgth* for H needed 30 Ha
(it was rather hard), the *Si.psp8* for Si needed 12 Ha. See the end of this page for a
discussion of *soft* and *hard* pseudopotentials.
2. The input variable [[diemac]] has been suppressed.
Aluminum is a metal, and the default is tailored for that case.
Aluminum is a metal, and the default value for this input variable is tailored for that case.
When you have read the input file, you can run the code, as usual (it will take a few seconds).
```sh
abinit < tbase4_x.files > log 2> err &
```
abinit tbase4_1.abi > log 2> err &
Then, read the output file quietly.
Then, give a quick look at the output file.
You should note that the Fermi energy and occupation numbers have been computed automatically:
Fermi (or HOMO) energy (hartree) = 0.26847 Average Vxc (hartree)= -0.34746
Eigenvalues (hartree) for nkpt= 2 k points:
kpt# 1, nband= 3, wtk= 0.75000, kpt= -0.2500 0.5000 0.0000 (reduced coord)
0.09425 0.25438 0.41909
occupation numbers for kpt# 1
2.00003 1.33307 0.00014
prteigrs : prtvol=0 or 1, do not print more k-points.
Fermi (or HOMO) energy (hartree) = 0.27151 Average Vxc (hartree)= -0.36713
Eigenvalues (hartree) for nkpt= 2 k points:
kpt# 1, nband= 3, wtk= 0.75000, kpt= -0.2500 0.5000 0.0000 (reduced coord)
0.09836 0.25743 0.42131
occupation numbers for kpt# 1
2.00003 1.33305 0.00015
prteigrs : prtvol=0 or 1, do not print more k-points.
You should also note that the components of the total energy include an entropy term:
Components of total free energy (in Hartree):
Kinetic energy = 8.70954971782498E-01
Hartree energy = 3.84986358590396E-03
XC energy = -8.08434339502224E-01
Ewald energy = -2.72948286712169E+00
PspCore energy = 3.78721653637092E-02
Loc. psp. energy= 8.26684645838168E-02
NL psp energy= 4.52588269933839E-01
>>>>> Internal E= -2.08998347137414E+00
-kT*entropy = -7.99729047978171E-03
>>>>>>>>> Etotal= -2.09798076185393E+00
Other information on the energy :
Total energy(eV)= -5.70889598417024E+01 ; Band energy (Ha)= 3.6059822203E-01
--- !EnergyTerms
iteration_state : {dtset: 1, itime: 3, icycle: 1, }
comment : Components of total free energy in Hartree
kinetic : 8.68009594268178E-01
hartree : 3.75144741427686E-03
xc : -1.11506134985146E+00
Ewald energy : -2.71387012800927E+00
psp_core : 1.56870175692757E-02
local_psp : 1.66222476058238E-01
non_local_psp : 4.25215770913582E-01
internal : -2.35004517163717E+00
'-kT*entropy' : -7.99850001032776E-03
total_energy : -2.35804367164750E+00
total_energy_eV : -6.41656315078440E+01
band_energy : 3.72511439902163E-01
...
## The convergence study with respect to k-points
@ -112,23 +109,23 @@ with the associated [[nkpt]]:
nkpt3 28
nkpt4 60
The input file *tbase4_2.in* is an example:
The input file *tbase4_2.abi* is an example:
{% dialog tests/tutorial/Input/tbase4_2.in %}
{% dialog tests/tutorial/Input/tbase4_2.abi %}
while *tbase4_2.out* is a reference output file:
while *tbase4_2.abo* is a reference output file:
{% dialog tests/tutorial/Refs/tbase4_2.out %}
{% dialog tests/tutorial/Refs/tbase4_2.abo %}
The run might take about thirty seconds on a PC 3 GHz.
The run might take a few seconds on a modern PC.
You will see that, **for the particular value** [[tsmear]] = 0.05 Ha, the lattice parameter
is already converged with [[nkpt]] = 10:
acell1 7.5588968086E+00 7.5588968086E+00 7.5588968086E+00 Bohr
acell2 7.5070431499E+00 7.5070431499E+00 7.5070431499E+00 Bohr
acell3 7.5016877756E+00 7.5016877756E+00 7.5016877756E+00 Bohr
acell4 7.4992662653E+00 7.4992662653E+00 7.4992662653E+00 Bohr
acell1 7.6023827082E+00 7.6023827082E+00 7.6023827082E+00 Bohr
acell2 7.5627822506E+00 7.5627822506E+00 7.5627822506E+00 Bohr
acell3 7.5543007304E+00 7.5543007304E+00 7.5543007304E+00 Bohr
acell4 7.5529744581E+00 7.5529744581E+00 7.5529744581E+00 Bohr
Note that there is usually a **strong** cross-convergence effect between the number of
k-points and the value of the broadening, [[tsmear]].
@ -149,28 +146,28 @@ Use the double-loop capability of the multi-dataset mode,
with the *tsmear* changes in the **inner** loop. This will saves CPU time, as the wavefunctions
of the previous dataset will be excellent (no transfer to different k-points).
The input file *tbase4_3.in* is an example:
The input file *tbase4_3.abi* is an example:
{% dialog tests/tutorial/Input/tbase4_3.in %}
{% dialog tests/tutorial/Input/tbase4_3.abi %}
while *tbase4_3.out* is thre reference output file.
while *tbase4_3.abo* is the reference output file.
{% dialog tests/tutorial/Refs/tbase4_3.out %}
{% dialog tests/tutorial/Refs/tbase4_3.abo %}
From the output file, here is the evolution of [[acell]]:
acell11 7.5587661702E+00 7.5587661702E+00 7.5587661702E+00 Bohr
acell12 7.5587696944E+00 7.5587696944E+00 7.5587696944E+00 Bohr
acell13 7.5587696871E+00 7.5587696871E+00 7.5587696871E+00 Bohr
acell14 7.5587710578E+00 7.5587710578E+00 7.5587710578E+00 Bohr
acell21 7.5055168997E+00 7.5055168997E+00 7.5055168997E+00 Bohr
acell22 7.5056781966E+00 7.5056781966E+00 7.5056781966E+00 Bohr
acell23 7.5018335937E+00 7.5018335937E+00 7.5018335937E+00 Bohr
acell24 7.5041510220E+00 7.5041510220E+00 7.5041510220E+00 Bohr
acell31 7.4963466654E+00 7.4963466654E+00 7.4963466654E+00 Bohr
acell32 7.4957099831E+00 7.4957099831E+00 7.4957099831E+00 Bohr
acell33 7.4969520318E+00 7.4969520318E+00 7.4969520318E+00 Bohr
acell34 7.4993529673E+00 7.4993529673E+00 7.4993529673E+00 Bohr
acell11 7.6022357792E+00 7.6022357792E+00 7.6022357792E+00 Bohr
acell12 7.6022341271E+00 7.6022341271E+00 7.6022341271E+00 Bohr
acell13 7.6022341214E+00 7.6022341214E+00 7.6022341214E+00 Bohr
acell14 7.6022357148E+00 7.6022357148E+00 7.6022357148E+00 Bohr
acell21 7.5604102145E+00 7.5604102145E+00 7.5604102145E+00 Bohr
acell22 7.5605496029E+00 7.5605496029E+00 7.5605496029E+00 Bohr
acell23 7.5565044147E+00 7.5565044147E+00 7.5565044147E+00 Bohr
acell24 7.5593333886E+00 7.5593333886E+00 7.5593333886E+00 Bohr
acell31 7.5483073963E+00 7.5483073963E+00 7.5483073963E+00 Bohr
acell32 7.5482393302E+00 7.5482393302E+00 7.5482393302E+00 Bohr
acell33 7.5497784006E+00 7.5497784006E+00 7.5497784006E+00 Bohr
acell34 7.5521340033E+00 7.5521340033E+00 7.5521340033E+00 Bohr
These data should be analyzed properly. For [[tsmear]] = 0.01, the converged value,
contained in *acell31*, must be compared to *acell11* and *acell21*:
@ -190,32 +187,25 @@ For that particular value of *tsmear*, one can use the second k-point grid, givi
In what follows, we will stick to these values of [[ecut]] and [[tsmear]] and try to use k-point grids with a similar resolution.
Our final value for the aluminum lattice parameter, in the LDA, using the *13al.981214.fhi* pseudopotential,
is thus 7.5041 Bohr.
!!! note
For historical reasons (consistency with older versions of the tutorial), we will work on the following,
with a slightly different value, of 7.5056 Bohr, that is 3.9718 Angstrom.
The experimental value at 25 degree Celsius is 4.04958 Angstrom.
Our final value for the aluminum lattice parameter, in the LDA, using the *Al.psp8* pseudopotential,
is thus 7.5593 Bohr, which corresponds to 4.0002 Angstrom. The experimental value at 25 Celsius is 4.04958 Angstrom, hence our theoretical value has an error of 1.2%. We caution that converged parameters should be used to properly assess the accuracy of a pseudopotential and functional.
The associated total energy and accuracy can be deduced from:
etotal11 -2.0916027819E+00
etotal12 -2.0931968906E+00
etotal13 -2.0947909992E+00
etotal14 -2.0963851177E+00
etotal21 -2.0969713557E+00
etotal22 -2.0975525285E+00
etotal23 -2.0978233733E+00
etotal24 -2.0979980153E+00
etotal31 -2.0983520905E+00
etotal32 -2.0983215368E+00
etotal33 -2.0983305960E+00
etotal34 -2.0984218116E+00
**etotal** 24 is -2.0979980153E+00 Ha, with an accuracy of 0.0005 Ha.
etotal11 -2.3516656074E+00
etotal12 -2.3532597160E+00
etotal13 -2.3548538247E+00
etotal14 -2.3564479440E+00
etotal21 -2.3568282638E+00
etotal22 -2.3574128355E+00
etotal23 -2.3576771874E+00
etotal24 -2.3578584768E+00
etotal31 -2.3582092001E+00
etotal32 -2.3581800122E+00
etotal33 -2.3581917663E+00
etotal34 -2.3582884106E+00
**etotal** 24 is -2.3578584768E+00 Ha, with an accuracy of 0.0005 Ha.
!!! tip
@ -245,16 +235,16 @@ There is no primitive cell of bulk aluminum based on these vectors, but a double
We will first compute the total energy associated with this doubled cell.
This is not strictly needed, but it is a valuable intermediate step towards the study of the surface.
You might start from *tbase4_3.in*. You have to change [[rprim]]. Still, try to keep [[acell]]
You might start from *tbase4_3.abi*. You have to change [[rprim]]. Still, try to keep [[acell]]
at the values of bulk aluminum that were determined previously.
But it is not all: the most difficult part in the passage to this doubled cell is the definition of the k-point grid.
Of course, one could just take a homogeneous simple cubic grid of k-points, but this will not
correspond exactly to the k-point grid used in the primitive cell in *tbase4_3.in*.
correspond exactly to the k-point grid used in the primitive cell in *tbase4_3.abi*.
This would not be a big problem, but you would miss some error cancellation.
The answer to this problem is given in the input file *$ABI_TESTS/tutorial/Input/tbase4_4.in*.
The answer to this problem is given in the input file *$ABI_TESTS/tutorial/Input/tbase4_4.abi*.
{% dialog tests/tutorial/Input/tbase4_4.in %}
{% dialog tests/tutorial/Input/tbase4_4.abi %}
The procedure to do the exact translation of the k-point grid will not be explained here (sorry for this).
If you do not see how to do it, just use homogeneous simple cubic grids, with about the same resolution
@ -267,12 +257,12 @@ The grids of k-points should not be too anisotropic for this rough estimation to
Note also the input variables [[rprim]] and [[chkprim]] in this input file.
Now run *tbase4_4.in* (the reference file is *$ABI_TESTS/tutorial/Refs/tbase4_4.out*).
Now run *tbase4_4.abi* (the reference file is *$ABI_TESTS/tutorial/Refs/tbase4_4.abo*).
You should find the following total energy:
etotal -4.1962972610E+00
etotal -4.7164794308E+00
It is not exactly twice the total energy for the primitive cell, mentioned above, but the difference is less than 0.0005 Ha.
It is not exactly twice the total energy for the primitive cell, mentioned above, but the difference is less than 0.001 Ha.
It is due to the different FFT grids used in the two runs, and affect the exchange-correlation energy.
These grids are always homogeneous primitive 3D grids, so that changing the orientation of the lattice
will give mutually incompatible lattices. Increasing the size of the FFT grid would improve the agreement.
@ -293,7 +283,7 @@ It is convenient to take the vacuum region as having a multiple of the width of
The supercell to use is the double of the previous cell (that had two layers of Aluminum atoms along the `[0 0 1]` direction).
Of course, the relaxation of the surface might give an important contribution to the total energy.
You should start from *tbase4_4.in*.
You should start from *tbase4_4.abi*.
You have to modify [[rprim]] (double the cell along `[0 0 1]`), the atomic positions, as well as the k-point mesh.
For the latter, it is supposed that the electrons cannot propagate from one slab to its image in the `[0 0 1]` direction,
so that the $k_z$ component of the special k-points can be taken 0: only one layer of k-points is needed along the z-direction.
@ -301,32 +291,32 @@ You should also allow the relaxation of atomic positions, but not the relaxation
(the lattice parameters along x or y must be considered fixed to the bulk value, while, for the z direction,
there is no interest to allow the vacuum region to collapse!
The input file *tbase4_5.in* is an example,
The input file *tbase4_5.abi* is an example,
{% dialog tests/tutorial/Input/tbase4_5.in %}
{% dialog tests/tutorial/Input/tbase4_5.abi %}
while *tbase4_5.out* is the reference output file.
while *tbase4_5.abo* is the reference output file.
{% dialog tests/tutorial/Refs/tbase4_5.out %}
{% dialog tests/tutorial/Refs/tbase4_5.abo %}
The run might last one minute.
The run will take a few second on a modern PC.
The total energy after the first SCF cycle, when the atomic positions are equal to their starting values, is:
ETOT 6 -6.2619738807344
ETOT 5 -7.0427135007667
The total energy of three aluminum atoms in the bulk,
(from section 4.3, etotal24 multiplied by three) is -6.293994 Ha.
(from section 4.3, etotal24 multiplied by three) is -7.0735754304 Ha.
Comparing the non-relaxed slab energy and the bulk energy, one obtains
the non-relaxed surface energy, per surface unit cell (there are two surfaces in our simulation cell!),
namely 0.016010 Ha = 0.436 eV.
namely 0.01543 Ha = 0.420 eV.
The total energy after the Broyden relaxation is:
etotal -6.2622251508E+00
etotal -7.0429806856E+00
The relaxed surface energy, per surface unit cell, is obtained by comparing the bulk energy and the
relaxed slab energy, and gives 0.015885 Ha = 0.432eV.
The relaxed surface energy, per surface unit cell, is obtained by comparing the bulk energy and the
relaxed slab energy, and gives 0.015297 Ha = 0.416 eV.
It seems that the relaxation energy is very small, compared to the surface energy, but we need to do the convergence studies.
## Surface energy: increasing the number of vacuum layers
@ -336,21 +326,21 @@ It is preferable to define atomic positions in Cartesian coordinates.
The same coordinates will work for both 2 and 3 vacuum layers, while this is not the case for reduced coordinates,
as the cell size increases.
The input file *tbase4_6.in* is an example input file,
The input file *tbase4_6.abi* is an example input file,
{% dialog tests/tutorial/Input/tbase4_6.in %}
{% dialog tests/tutorial/Input/tbase4_6.abi %}
while *tbase4_6.out* is the reference output file.
while *tbase4_6.abo* is the reference output file.
{% dialog tests/tutorial/Refs/tbase4_6.out %}
{% dialog tests/tutorial/Refs/tbase4_6.abo %}
The run is on the order of thirty seconds on a PC 3 GHz.
The run is on the order of of few seconds on a modern PC.
In the Broyden step 0 of the first dataset, you will notice the WARNING:
scprqt: WARNING -
nstep= 6 was not enough SCF cycles to converge;
maximum force difference= 5.493E-05 exceeds toldff= 5.000E-05
scprqt: WARNING -
nstep= 6 was not enough SCF cycles to converge;
maximum force difference= 6.859E-05 exceeds toldff= 5.000E-05
The input variable [[nstep]] was intentionally set to the rather low value of 6, to warn you about
possible convergence difficulties.
@ -362,14 +352,14 @@ was close of being fulfilled, but one should keep this in mind, as you will see.
For the 2 vacuum layer case, one has the non-relaxed total energy:
ETOT 6 -6.2539524271719
ETOT 6 -7.0350152828531
giving the unrelaxed surface energy 0.0200 Ha = 0.544 eV;
giving the unrelaxed surface energy 0.0193 Ha = 0.525 eV;
and for the relaxed case:
etotal1 -6.2547006435E+00
etotal1 -7.0358659542E+00
(this one is converged to the required level) giving the relaxed surface energy 0.0196 Ha = 0.533 eV
(this one is converged to the required level) giving the relaxed surface energy 0.0189 Ha = 0.514 eV
Note that the difference between unrelaxed and relaxed case is a bit larger than in the case of one vacuum layer.
This is because there was some interaction between slabs of different supercells.
@ -381,13 +371,13 @@ However, for the Broyden steps number 2 and beyond, because one takes advantage
a sufficient convergence is reached.
The total energy, in the relaxed case, is:
etotal2 -6.2559103620E+00
etotal2 -7.0371360761E+00
giving the relaxed surface energy `0.0190 Ha = 0.515 eV`.
There is a rather small 0.018 eV difference with the 2 vacuum layer case.
giving the relaxed surface energy `0.0182 Ha = 0.495 eV`.
There is a rather small 0.019 eV difference with the 2 vacuum layer case.
For the next run, we will keep the 2 vacuum layer case, and we know that the accuracy
of the coming calculation cannot be better than 0.016 eV. One might investigate the 4 vacuum layer case,
of the coming calculation cannot be better than 0.019 eV. One might investigate the 4 vacuum layer case,
but this is not worth, in the present tutorial.
## Surface energy: increasing the number of aluminum layers
@ -398,13 +388,13 @@ One could use an effective dielectric constant of about 3 or 5, with a rather sm
However, there is also another possibility, using an estimation of the dielectric matrix governed by [[iprcel]]=45.
For comparison with the previous treatment of SCF, one can recompute the result with 3 aluminum layers.
The input file *tbase4_7.in* is an example, while
The input file *tbase4_7.abi* is an example, while
{% dialog tests/tutorial/Input/tbase4_7.in %}
{% dialog tests/tutorial/Input/tbase4_7.abi %}
*tbase4_7.out* is a reference output file.
*tbase4_7.abo* is a reference output file.
{% dialog tests/tutorial/Refs/tbase4_7.out %}
{% dialog tests/tutorial/Refs/tbase4_7.abo %}
This run might take about one minute, and is the longest of the four basic tutorials. You should start it now.
@ -412,62 +402,62 @@ You will notice that the SCF convergence is rather satisfactory, for all the cas
For the 3 aluminum layer case, one has the non-relaxed total energy:
ETOT 6 -6.2539524363433
ETOT 6 -7.0350153035193
(this quantity is converged, unlike in test 4.6) giving the unrelaxed surface energy 0.0200 Ha = 0.544 eV;
(this quantity is converged, unlike in test 4.6) giving the unrelaxed surface energy 0.0193 Ha = 0.525 eV;
and for the relaxed case:
etotal1 -6.2547008127E+00
etotal1 -7.0358683757E+00
(by contrast the difference with test 4.6 is less than 1 microHa) giving
the relaxed surface energy 0.0196 Ha = 0.533 eV.
the relaxed surface energy 0.0189 Ha = 0.514 eV.
For the 4 aluminum layer case, one has the non-relaxed total energy:
ETOT 6 -8.3546873357119
ETOT 6 -9.3958299123967
giving the unrelaxed surface energy 0.0186Ha = 0.506 eV; and for the relaxed case:
giving the unrelaxed surface energy 0.0178 Ha = 0.484 eV; and for the relaxed case:
etotal2 -8.3565593186E+00
etotal2 -9.3978596458E+00
giving the relaxed surface energy 0.0183 Ha = 0.498 eV.
giving the relaxed surface energy 0.0168 Ha = 0.457 eV.
For the 5 aluminum layer case, one has the non-relaxed total energy:
ETOT 6 -10.453642176439
ETOT 6 -11.754755842794
giving the unrelaxed surface energy 0.0183Ha = 0.498 eV; and for the relaxed case:
giving the unrelaxed surface energy 0.0173 Ha = 0.471 eV; and for the relaxed case:
etotal3 -1.0454163186E+01
etotal3 -1.1755343136E+01
giving the relaxed surface energy 0.0180 Ha = 0.490 eV.
giving the relaxed surface energy 0.0170 Ha = 0.463 eV.
The relative difference in the surface energy of the 4 and 5 layer cases is on the order of 1.5%.
The relative difference in the surface energy of the 4 and 5 layer cases is on the order of 1.2%.
In the framework of this tutorial, we will not pursue this investigation, which is a simple application
of the concepts already explored.
Just for your information, and as an additional warning, when the work accomplished
until now is completed with 6 and 7 layers without relaxation
(see *\$ABI_TESTS/tutorial/Input/tbase4_8.in* and *\$ABI_TESTS/tutorial/Refs/tbase4_8.out* where 5, 6 and 7 layers are treated),
(see *\$ABI_TESTS/tutorial/Input/tbase4_8.abi* and *\$ABI_TESTS/tutorial/Refs/tbase4_8.abo* where 5, 6 and 7 layers are treated),
this non-relaxed energy surface energy behaves as follows:
number of aluminum layers | surface energy
--- | ---
3 | 0.544 eV
4 | 0.506 eV
5 | 0.498 eV
6 | 0.449 eV
7 | 0.463 eV
3 | 0.525 eV
4 | 0.484 eV
5 | 0.471 eV
6 | 0.419 eV
7 | 0.426 eV
So, the surface energy convergence is rather difficult to reach. Our values, with a `4x4x1` grid,
a smearing of 0.04 Ha, a kinetic energy cut-off of 6 Ha, the *13al.981214.fhi* pseudopotential,
still oscillate between 0.45 eV and 0.51 eV.
a smearing of 0.04 Ha, a kinetic energy cut-off of 6 Ha, the *Al.psp8* pseudopotential,
still oscillate between 0.42 eV and 0.53 eV.
Increasing the k-point sampling might decrease slightly the oscillations, but note that this effect
is intrinsic to the computation of properties of a metallic surface: the electrons are confined inside the slab potential,
with sub-bands in the direction normal to the surface, and the Fermi energy oscillates with the width of the slab.
This effect might be understood based on a comparison with the behaviour of a jellium slab.
An error on the order of 0.016 eV is due to the thin vacuum layer.
An error on the order of 0.019 eV is due to the thin vacuum layer.
Other sources of errors might have to be rechecked, seeing the kind of accuracy that is needed.
Experimental data give a surface energy around 0.55 eV (sorry, the reference is to be provided).

View File

@ -178,38 +178,31 @@ be given in the next sections.
*Before starting, you might consider working in a different subdirectory as
for the other tutorials. Why not Work_paral?*
Copy the `files` file and the input file from the *\$ABI_TESTS/tutorial*
directory to your work directory. They are named *tbasepar_1.files* and *tbasepar_1.in*.
First one needs to copy the input file from the *\$ABI_TESTS/tutorial*
directory to your work directory, namely *tbasepar_1.abi*.
```sh
cd $ABI_TESTS/tutorial/Input
mkdir Work_paral
cd Work_paral
cp ../tbasepar_1.files . # You might need to edit this file.
cp ../tbasepar_1.in .
cp ../tbasepar_1.abi .
```
You can start immediately a sequential run with
abinit < tbasepar_1.files > log 2> err
abinit tbasepar_1.abi >& log 2> err &
to have a reference CPU time.
On a Intel Xeon 20C 2.1 GHz, it runs in about 40 seconds.
Contrary to the sequential case, it is worth to have a look at the `files`
file. It might possibly be modified for parallel execution, as one should avoid
The input file (*.abi) might possibly be modified for parallel execution, as one should avoid
unnecessary network communications. Indeed, if every node has its own temporary or
scratch directory (so not in the multicore case), you can achieve this by providing a path to a local disk
for the temporary files in `abinit.files`. Supposing each processor has access
to a local temporary disk space named `/scratch/user`, then you might modify
the 5th line of the `files` file so that it becomes:
for the temporary files in the input file by using the [[tmpdata_prefix]] variable. Supposing each processor has access
to a local temporary disk space named `/scratch/user`, then you might add to the input *.abi file the following line
tmpdata_prefix="/scratch/user/tbasepar_1"
tbasepar_1.in
tbasepar_1.out
tbasepar_1i
tbasepar_1o
/scratch/user/tbasepar_1
../../Psps_for_tests/HGH/82pb.4.hgh
Note that determining ahead of time the precise resources you will need for
your run will save you a lot of time if you are using a batch queue system.
@ -228,7 +221,7 @@ On the contrary, you can create a *_NOLOG* file if you want to avoid all log fil
The most favorable case for a parallel run is to treat the k-points
concurrently, since most calculations can be done independently for each one of them.
Actually, *tbasepar_1.in* corresponds to the investigation of a *FCC* crystal of
Actually, *tbasepar_1.abi* corresponds to the investigation of a *FCC* crystal of
lead, which requires a large number of k-points if one wants to get an
accurate description of the ground state. Examine this file. Note that the
cut-off is realistic, as well as the grid of k-points (giving 182 k points in
@ -243,7 +236,7 @@ implementation, and mention the number of processors you want to use, as well
as the abinit command:
```bash
mpirun -n 2 abinit < tbasepar_1.files >& tbasepar_1.log &
mpirun -n 2 abinit tbasepar_1.abi >& tbasepar_1.log &
```
Depending on your particular machine, *mpirun* might have to be replaced by
@ -269,7 +262,7 @@ command and the file containing the CPU addresses.
On a PC bi-processor machine, this gives the following:
```bash
mpirun -np 2 -machinefile cluster ../../src/main/abinit < tbasepar_1.files >& tbasepar_1.log &
mpirun -np 2 -machinefile cluster ../../src/main/abinit tbasepar_1.abi >& tbasepar_1.log &
```
Now, examine the corresponding output file. If you have kept the output from
@ -330,17 +323,17 @@ once in a while that all processors are alive.
### Parallelism over the spins
The parallelization over the spins (up, down) is done along with the one over
the k-points, so it works exactly the same way. The files
*tbasepar_2.in* and *tbasepar_2.files* in *\$ABI_TESTS/tutorial* treat a spin-polarized system
the k-points, so it works exactly the same way. The file
*tbasepar_2.abi* in *\$ABI_TESTS/tutorial* treats a spin-polarized system
(distorted FCC Iron) with only one k-point in the Irreducible Brillouin Zone.
This is quite unphysical, and has the sole purpose to show the spin
parallelism with as few as two processors: the k-point parallelism has
precedence over the spin parallelism, so that with 2 processors, one ought
to have only one k-point to see the spin parallelism.
If needed, modify the _files_ file, to provide a local temporary disk space.
If needed, modify the input file, to provide a local temporary disk space.
Run this test case, in sequential, then in parallel.
While the jobs are running, read the input and files file. Then look closely
While the jobs are running, read the input. Then look closely
at the output and log files in the sequential and parallel cases. They are quite similar.
Actually, apart the mention of two processors and the speedup, there is no other
manifestation of the parallelism.

View File

@ -56,19 +56,19 @@ However, the two methods generally give similar results.
for the other tutorials. Why not Work_dftu?
In what follows, the names of files will be mentioned as if you were in this subdirectory.*
Copy the file *tdftu_1.in* from *\$ABI_TESTS/tutorial/Input* to your *Work_dftu* directory with:
Copy the file *tdftu_1.abi* from *\$ABI_TESTS/tutorial/Input* to your *Work_dftu* directory with:
```sh
cd $ABI_TESTS/tutorial/Input
mkdir Work_dftu
cd Work_dftu
cp ../tdftu_1.in .
cp ../tdftu_1.abi .
```
{% dialog tests/tutorial/Input/tdftu_1.in %}
{% dialog tests/tutorial/Input/tdftu_1.abi %}
Now run the code as usual.
The job should take less than 30 seconds on a PC 3 GHz. It calculates the LDA
The job should take less than 20 seconds on a laptop. It calculates the LDA
ground state of the NiO crystal. A low cutoff and a small number of k-points
are used in order to speed up the calculation. During this time you can take a
look at the input file.
@ -88,16 +88,16 @@ direction (of a conventional cubic cell).
If you take a look at the output file (tdftu_1.out), you can see the
integrated total density in the PAW spheres (see the [PAW1](paw1)
and [PAW2](paw2) tutorials on PAW formalism). This value roughly
estimate the magnetic moment of NiO:
estimates the magnetic moment of NiO:
Integrated electronic and magnetization densities in atomic spheres:
---------------------------------------------------------------------
Radius=ratsph(iatom), smearing ratsm= 0.0000. Diff(up-dn)=approximate z local magnetic moment.
Atom Radius up_density dn_density Total(up+dn) Diff(up-dn)
1 1.81432 8.564385 7.187993 15.752379 1.376392
2 1.81432 7.187993 8.564385 15.752379 -1.376392
3 1.41465 2.260909 2.260909 4.521817 0.000000
4 1.41465 2.260909 2.260909 4.521817 0.000000
1 1.81432 8.564383 7.188016 15.752398 1.376367
2 1.81432 7.188016 8.564383 15.752398 -1.376367
3 1.41465 2.260902 2.260902 4.521804 -0.000000
4 1.41465 2.260902 2.260902 4.521804 0.000000
The atoms in the output file, are listed as in the [[typat]] variable (the
@ -110,17 +110,18 @@ The magnetic moment (the difference between up and down spin on the nickel atom)
range around 1.6-1.9 according to experiments ([[cite:Cheetham1983]],[[cite:Neubeck1999]],[[cite:Sawatzky1984]],
[[cite:Hufner1984]])
Also, as the Fermi level is at 0.33748 Ha (see the *tdftu_1.abo* file), one
can see (in the *tdftu_1.o_EIG* file) that the band gap obtained between the last occupied (0.31537 Ha, at k
point 1) and the first unoccupied band (0.35671 Ha, at kpoint 3) is
can see (on the *tdftu_1.o_EIG* file that contains eigenvalues for the three k-point of this calculation) that the band gap obtained between the last (24th) occupied band (0.31537 Ha, at k
point 3) and the first (25th) unoccupied band (0.35671 Ha, at kpoint 3) is
approximately 1.1 eV which is lower than the measured value of 4.0-4.3 eV
(This value could be modified using well-converged parameters but would still
be much lower than what is expected).
be much lower than what is expected). A easier and graphical way to evaluate the gap would be to plot the density
of states (see last section of this tutorial).
Making abstraction of the effect of insufficiently convergence parameters, the
reason for the discrepancy between the DFT-LDA data and the experiments is
first the fact the DFT is a theory for the ground state and second, the lack
of correlation of the LDA. Alone, the homogeneous electron gas cannot
correctly represent the interactions among d electrons of the Ni atom. That is
correctly represent the interactions among $d$ electrons of the Ni atom. That is
why we want to improve our functional, and be able to manage the strong correlation in NiO.
## 2 DFT+U with the FLL double-counting
@ -140,23 +141,36 @@ the rotationally invariant interaction is used.
It is important to notice that in order to use DFT+U in Abinit, you must
employ PAW pseudopotentials.
You should run abinit with the *tdftu_2.in* input file. This calculation takes
less than 30 seconds on a PC 3.0 GHz
You should run abinit with the *tdftu_2.abi* input file. This calculation takes
also less than 20 seconds on a laptop.
During the calculation, you can take a look at the input file.
{% dialog tests/tutorial/Input/tdftu_2.in %}
{% dialog tests/tutorial/Input/tdftu_2.abi %}
Some variable describing the DFT+U parameters have been added to the previous file. All
other parameters were kept constant from the preceding calculation. First, you
must set the variable [[usepawu]] to one (for the FLL method) and two (for the
AMT method) in order to enable the DFT+U calculation. Then, with [[lpawu]] you
AMF method) in order to enable the DFT+U calculation. Then, with [[lpawu]] you
give for each atomic species ([[znucl]]) the values of angular momentum (l) for
which the DFT+U correction will be applied. The choices are 2 for d-orbitals
and 3 for *f*-orbitals. You cannot treat s and p orbitals with DFT+U in the
which the DFT+U correction will be applied. The choices are 1 for *p*-orbitals, 2 for *d*-orbitals
and 3 for *f*-orbitals. You cannot treat s orbitals with DFT+U in the
present version of ABINIT. Also, if you do not want to apply DFT+U correction
on a species, you can set the variable to -1. For the case of NiO, we put
[[lpawu]] to 2 for Ni and -1 for O.
!!! note
The current implementation applies DFT+U correction only inside atomic sphere. To check if this
approximation is realistic, relaunch the calculation with [[pawprtvol]] equal to three.
Then search for ph0phiint in the log file:
pawpuxinit: icount, ph0phiint(icount)= 1 0.90467
This line indicates that the norm of atomic wavefunctions inside atomic sphere is 0.90, rather close
to one. In the case of nickel, the approximation is thus realistic. The case where the norm is too small
(close to 0.5) is discussed in [[cite:Geneste2017]].
Finally, as described in the article cited above for FLL and AMF, we must
define the screened Coulomb interaction between electrons that are treated in
DFT+U, with the help of the variable [[upawu]] and the screened exchange
@ -170,15 +184,15 @@ NiO, we will use variables that are generally accepted for this type of compound
You can take a look at the result of the calculation. The magnetic moment is now:
Integrated total density in atomic spheres:
-------------------------------------------
Radius=ratsph(iatom), smearing ratsm= 0.0000. Diff(up-dn)=approximate z local magnetic moment.
Atom Radius up_density dn_density Total(up+dn) Diff(up-dn)
1 1.81432 8.749918 6.987372 15.737289 1.762546
2 1.81432 6.987372 8.749918 15.737289 -1.762546
3 1.41465 2.290407 2.290407 4.580814 0.000000
4 1.41465 2.290407 2.290407 4.580814 0.000000
Integrated electronic and magnetization densities in atomic spheres:
---------------------------------------------------------------------
Radius=ratsph(iatom), smearing ratsm= 0.0000. Diff(up-dn)=approximate z local magnetic moment.
Atom Radius up_density dn_density Total(up+dn) Diff(up-dn)
1 1.81432 8.749919 6.987384 15.737302 1.762535
2 1.81432 6.987384 8.749919 15.737302 -1.762535
3 1.41465 2.290397 2.290397 4.580793 -0.000000
4 1.41465 2.290397 2.290397 4.580793 -0.000000
NiO is found antiferromagnetic, with a moment that is in reasonable agreement
@ -192,7 +206,8 @@ one obtains the right physics.
A word of caution is in order here. It is NOT the case that one obtain
systematically a good result with the DFT+U method at the first trial. Indeed,
due to the nature of the modification of the energy functional, the landscape
of this energy functional might present numerous local minima.
of this energy functional might present numerous local minima (see for examples
[[cite:Jomard2008]] or [[cite:Dorado2009]]).
Unlike DFT+U, for the simple LDA (without U), in the non-spin-polarized case,
there is usually only one minimum, that is the global minimum. So, if it
@ -211,16 +226,25 @@ The fact that [[spinat]] works for NiO comes from the relative simplicity of thi
## 3 Initialization of the density matrix
*You should begin by running the tdftu_3.in file before continuing.*
*You should begin by running the tdftu_3.abi file before continuing.*
In order to help the DFT+U find the ground state, you can define the initial
density matrix for correlated orbitals with [[dmatpawu]] To enable this
density matrix for correlated orbitals with [[dmatpawu]]. For $d$ orbitals, this variable
must contains $5\times5$ square matrices. There should be one square matrix per nsppol and atom.
So in our case, there are 2 square matrices.
Also, to enable this
feature, [[usedmatpu]] must be set to a non-zero value (default is 0). When
positive, the density matrix is kept to the [[dmatpawu]] value for the
[[usedmatpu]] value steps. For our calculation(tdftu_3.in) , [[usedmatpu]] is 5,
[[usedmatpu]] value steps. For our calculation(tdftu_3.abi) , [[usedmatpu]] is 5,
thus the spin-density matrix is kept constant for 5 SCF steps.
Let's examinates the input dmatpawu
{% dialog tests/tutorial/Input/tdftu_3.in %}
{% dialog tests/tutorial/Input/tdftu_3.abi %}
To understand the density matrix used in the variable [[dmatpawu]] in this input file, have a look
to the section on this variable [[dmatpawu]]. This section show the order to orbitals in the density matrix. With
the help of this section, one can understand that the density matrix corresponds to all orbitals filled except
$e_g$ orbitals for one spin.
In the log file (not the usual output file), you will find for each step, the
calculated density matrix, followed by the imposed density matrix. After the
@ -272,27 +296,29 @@ Now we will use the other implementation for the double-counting term in DFT+U
electrons for each spin independently and the complete interactions $U(m_1,m_2,m_3,m_4)$ and $J(m_1,m_2,m_3,m_4)$.
As in the preceding run, we will start with a fixed density matrix for d
orbitals. You might now start your calculation, with the *tdftu_4.in*, or skip the calculation, and rely on the reference file
provided in the *\$ABI_TESTS/tutorial/Refs* directory. Examine the *tdftu_4.in* file.
orbitals. You might now start your calculation, with the *tdftu_4.abi*, or skip the calculation, and rely on the reference file
provided in the *\$ABI_TESTS/tutorial/Refs* directory. Examine the *tdftu_4.abi* file.
{% dialog tests/tutorial/Input/tdftu_4.in %}
{% dialog tests/tutorial/Input/tdftu_4.abi %}
The only difference in the input file compared to *tdftu_3.in* is the
The only difference in the input file compared to *tdftu_3.abi* is the
value of [[usepawu]] = 2. We obtain a band gap of 4.75 eV. The value of the
band gap with AMF and FLL is different. However, we have to remember that
these results are not well converged. By contrast, the magnetization,
Integrated electronic and magnetization densities in atomic spheres:
---------------------------------------------------------------------
Radius=ratsph(iatom), smearing ratsm= 0.0000. Diff(up-dn)=approximate z local magnetic moment.
Atom Radius up_density dn_density Total(up+dn) Diff(up-dn)
1 1.81432 8.675720 6.993816 15.669536 1.681904
2 1.81432 6.993816 8.675720 15.669536 -1.681904
3 1.41465 2.288685 2.288685 4.577371 -0.000000
4 1.41465 2.288685 2.288685 4.577371 -0.000000
1 1.81432 8.675718 6.993823 15.669541 1.681895
2 1.81432 6.993823 8.675718 15.669541 -1.681895
3 1.41465 2.288681 2.288681 4.577361 -0.000000
4 1.41465 2.288681 2.288681 4.577361 0.000000
is very similar to the DFT+U FLL. In fact, this system is not very complex.
But for other systems, the difference can be more important. FLL is designed
to work well for crystal with diagonal occupation matrix with 0 or 1 for each
is very similar to the DFT+U FLL.
For other systems, the difference can be more important. FLL is designed
to work well for systems in which occupations of orbitals are 0 or 1 for each
spin. The AMF should be used when orbital occupations are near the average occupancies.
## 5 Projected density of states in DFT+U

View File

@ -1,5 +1,5 @@
---
authors: BAmadon
authors: BAmadon, OGingras
---
# Tutorial on DFT+DMFT
@ -48,8 +48,6 @@ Several parameters (both physical and technical) needs to be discussed for a DFT
* The definition of the Coulomb and exchange interaction U and J are done as in DFT+_U_ through the variables [[upawu]] and [[jpawu]]. They could be computed with the cRPA method, also available in ABINIT. The value of U and J should in principle depend
on the definition of correlated orbitals. In this tutorial, U and J will be seen as parameters, as in the DFT+_U_ approach.
As in DFT+_U_, two double counting methods are available (see the [[dmft_dc]] input variable).
Note that in version 7.10.5 (but not in later versions) [[jpawu]] = 0 is required if the density matrix
in the correlated subspace is not diagonal.
* The choice of the double counting correction. The current default choice in ABINIT is ([[dmft_dc]] = 1)
which corresponds to the full localized limit.
@ -74,25 +72,24 @@ Several parameters (both physical and technical) needs to be discussed for a DFT
*You might create a subdirectory of the *\$ABI_TESTS/tutoparal* directory, and use it for the tutorial.
In what follows, the names of files will be mentioned as if you were in this subdirectory*
Copy the files *tdmft_1.in* and *dmft_x.files* from *\$ABI_TESTS/tutoparal* in your Work
Copy the file *tdmft_1.abi* from *\$ABI_TESTS/tutoparal* in your Work
directory,
```sh
cd $ABI_TESTS/tutoparal/Input
mkdir Work_dmft
cd Work_dmft
cp ../tdmft_x.files .
cp ../tdmft_1.in .
cp ../tdmft_1.abi .
```
{% dialog tests/tutoparal/Input/tdmft_x.files tests/tutoparal/Input/tdmft_1.in %}
{% dialog tests/tutoparal/Input/tdmft_1.abi %}
Then edit the *tdmft_x.files* and run ABINIT with:
Then run ABINIT with:
mpirun -n 32 abinit < tdmft_x.files > log_1 &
mpirun -n 24 abinit tdmft_1.abi > log_1 &
This run should take some time. It is recommended that you use at least 10
processors (and 32 should be fast). It calculates the LDA ground state of
processors (and 24 should be fast). It calculates the LDA ground state of
SrVO3 and compute the band structure in a second step.
The variable [[pawfatbnd]] allows to create files with "fatbands" (see description of the
@ -131,7 +128,7 @@ _p_. However, we clearly see an important hybridization. The Fermi level (at 0
eV) is in the middle of bands 21-23.
One can easily check that bands 21-23 are mainly _d-t 2g_ and bands 24-25 are
mainly _e<sub>g</sub>_: just use [[pawfatbnd]] = 2 in *tdmft_1.in* and relaunch the calculations.
mainly _e<sub>g</sub>_: just use [[pawfatbnd]] = 2 in *tdmft_1.abi* and relaunch the calculations.
Then the file *tdmft_1o_DS2_FATBANDS_at0001_V_is1_l2_m-2*,
*tdmft_1o_DS2_FATBANDS_at0001_V_is1_l2_m-1* and
*tdmft_1o_DS2_FATBANDS_at0001_V_is1_l2_m1* give you respectively the _xy_, _yz_ and
@ -165,19 +162,19 @@ orbitals. For this, we will use Wannier functions.
As we have seen in the orbitally resolved fatbands, the Kohn Sham wave
function contains a important weight of _t<sub>2g</sub>_ atomic orbitals mainly in _t
2g_-like bands but also in oxygen bands.
<sub>2g</sub>_-like bands but also in oxygen bands.
So, we can use only the _t<sub>2g</sub>_-like bands to define Wannier functions or also
both the _t<sub>2g</sub>_-like and _O-p_ -like bands.
The first case corresponds to the input file *tdmft_2.in*. In this case
The first case corresponds to the input file *tdmft_2.abi*. In this case
[[dmftbandi]] = 21 and [[dmftbandf]] = 23. As we only put the electron interaction
on _t<sub>2g</sub>_ orbitals, we have to use first [[lpawu]] = 2, but also the keyword
[[dmft_t2g]] = 1 in order to restrict the application of interaction on _t<sub>2g</sub>_ orbitals.
Notice also that before launching a DMFT calculation, the LDA should be
perfectly converged, including the empty states (check nline and nnsclo in the
input file). The input file *tdmft_2.in* thus contains two datasets: the first
input file). The input file *tdmft_2.abi* thus contains two datasets: the first
one is a well converged LDA calculation, and the second is the DFT+DMFT calculation.
Notice the other dmft variables used in the input file and check their meaning
@ -197,7 +194,7 @@ Let's now discuss the value of the effective Coulomb interaction U ([[upawu]])
and J ([[jpawu]]). The values of U and J used in ABINIT in DMFT use the same
convention as in DFT+_U_ calculations in ABINIT (cf [[cite:Amadon2008a]]). However,
calculations in Ref. [[cite:Amadon2008]] use for U and J the usual convention for
_t 2g _ systems as found in [[cite:Lechermann2006]], Eq. 26 (see also the appendix
_t<sub>2g</sub>_ systems as found in [[cite:Lechermann2006]], Eq. 26 (see also the appendix
in [[cite:Fresard1997]]). It corresponds to the Slater integral F4=0 and we can
show that U_abinit=U-4/3 J and J_abinit=7/6 J. So in order to use U = 4 eV and
J=0.65 eV with these latter conventions (as in [[cite:Amadon2008]]), we have to use
@ -205,12 +202,12 @@ in ABINIT: [[upawu]] = 3.13333 eV; [[jpawu]] = 0.75833 eV and [[f4of2_sla]] = 0.
Now, you can launch the calculation:
Copy the files *../Input/tdmft_2.in* and modify *tdmft_x.files* in your Work
Copy the file *../Input/tdmft_2.abi* in your Work
directory and run ABINIT:
mpirun -n 32 abinit < tdmft_x.files > log_2
mpirun -n 24 abinit tdmft_2.abi > log_2
{% dialog tests/tutoparal/Input/tdmft_2.in %}
{% dialog tests/tutoparal/Input/tdmft_2.abi %}
### 3.2. The DFT+DMFT calculation: the log file
@ -231,18 +228,18 @@ computed (Eq.(2.1) in [[cite:Amadon2012]]) and unnormalized orbitals are built
------ Symetrised Occupation
0.11142 -0.00000 -0.00000
-0.00000 0.11142 -0.00000
-0.00000 -0.00000 0.11142
0.10480 -0.00000 -0.00000
0.00000 0.10480 -0.00000
-0.00000 -0.00000 0.10480
and the Normalization of this orbital basis is
------ Symetrised Norm
0.65790 0.00000 0.00000
0.00000 0.65790 0.00000
0.00000 0.00000 0.65790
0.62039 0.00000 0.00000
0.00000 0.62039 0.00000
0.00000 0.00000 0.62039
Now, let's compare these numbers to other quantities. If the preceding LDA
calculation is converged, dmatpuopt=1 is used, and [[dmftbandi]]=1 and
@ -259,23 +256,23 @@ condition is not fulfilled. Concerning the norm if these orbitals, two factors p
* Secondly, the atomic orbitals used to do the projection are cut at the PAW radius.
As a consequence, even if we would use a complete set of KS wavefunctions and thus the closure relation,
the norm could not be one. In our case, it could be at most 0.86852, which is the norm of the
the norm could not be one. In our case, it could be at most 0.84179, which is the norm of the
truncated atomic function of _d_ orbitals of Vanadium used in this calculation.
This number can be found in the log file by searching for ph0phiint (grep "ph0phiint(icount)= 1" log_2).
(See also the discussion in Section B.3 of [[cite:Amadon2012]]).
Next the LDA Green's function is computed.
===== LDA Green Function Calculation
===== DFT Green Function Calculation
Then the Green's function is integrated to compute the occupation matrix.
Interestingly, the density matrix here must be equal to the density matrix
computed with the unnormalized correlated orbitals. If this is not the case,
it means that the frequency grid is not sufficiently large. In our case, we find:
0.11143 0.00000 0.00000
0.00000 0.11143 0.00000
0.00000 0.00000 0.11143
0.10481 -0.00000 -0.00000
-0.00000 0.10481 -0.00000
-0.00000 -0.00000 0.10481
So the error is very small (1.10E-5). As an exercise, you can decrease the
number of frequencies and see that the error becomes larger.
@ -283,13 +280,13 @@ number of frequencies and see that the error becomes larger.
Then the true orthonormal Wannier functions are built and the Green's function
is computed in this basis just after:
===== LDA Green Function Calculation with renormalized psichi
===== DFT Green Function Calculation with renormalized psichi
The occupation matrix is now:
0.16937 0.00000 -0.00000
0.00000 0.16937 0.00000
-0.00000 0.00000 0.16937
0.16893 0.00000 -0.00000
0.00000 0.16893 0.00000
-0.00000 0.00000 0.16893
We see that because of the orthonormalization of the orbitals necessary to
built Wannier functions, the occupation matrix logically increases.
@ -323,9 +320,9 @@ once before doing again the DFT Loop (cf Fig. 1 of [[cite:Amadon2012]]). At the
of the calculation, the occupation matrix is written and is:
-- polarization spin component 1
0.16843 0.00000 -0.00000
-0.00000 0.16843 -0.00000
-0.00000 0.00000 0.16843
0.16811 0.00000 -0.00000
0.00000 0.16811 -0.00000
-0.00000 -0.00000 0.16811
We can see that the total number of electron is very close to one and it does
not change much as a function of iterations. As an output of the calculation,
@ -456,34 +453,34 @@ hybridization, as a consequence, we will now built Wannier functions with a
large window, by including oxygen _p_ -like bands in the definition of Wannier
functions. Create a new input file:
cp tdmft_2.in tdmft_3.in
cp tdmft_2.abi tdmft_3.abi
and use [[dmftbandi]] = 12 in *tdmft_3.in*. Now the code will built Wannier
and use [[dmftbandi]] = 12 in *tdmft_3.abi*. Now the code will built Wannier
functions with a larger window, including _O-p_ -like bands, and thus much
more localized. Launch the calculation after having updated tdmft_x.files (if
more localized. Launch the calculation (if
the calculation is too long, you can decide to restart the second dataset
directly from a converged LDA calculation instead of redoing the LDA
calculation for each new DMFT calculation).
abinit < tdmft_x.files > log_3
abinit tdmft_3.abi > log_3
In this case, both the occupation and the norm are larger because more states
are taken into account: you have the occupation matrix which is
------ Symetrised Occupation
0.23573 -0.00000 -0.00000
-0.00000 0.23573 -0.00000
-0.00000 -0.00000 0.23573
0.22504 -0.00000 -0.00000
-0.00000 0.22504 -0.00000
-0.00000 -0.00000 0.22504
and the norm is:
------ Symetrised Norm
0.78223 0.00000 -0.00000
0.00000 0.78223 -0.00000
-0.00000 -0.00000 0.78223
0.73746 0.00000 -0.00000
0.00000 0.73746 -0.00000
-0.00000 -0.00000 0.73746
Let us now compare the total number of electron and the norm with the two energy window:
@ -492,9 +489,9 @@ Let us now compare the total number of electron and the norm with the two energy
Energy window: | _t<sub>2g</sub>_-like bands | _t<sub>2g</sub>_-like+ _O-p_ -like bands
-----------------------------------------|-------------------------------|---------------------------------------------------
[[dmftbandi]]/[[dmftbandf]]: | 21/23 | 12/23
Norm: | 0.66 | 0.78
LDA Number of electrons (before ⊥): | 0.66(=0.11*6) | 1.42(=0.235*6)
LDA Number of electrons (after ⊥): | 1.02 | 1.81
Norm: | 0.63 | 0.78
LDA Number of electrons (before ⊥): | 0.63(=0.105*6) | 1.35(=0.235*6)
LDA Number of electrons (after ⊥): | 1.00 | 1.77
</center>
@ -507,16 +504,13 @@ means that by selecting bands 12-23 in the calculation, we took into account
Sham bands. Moreover, after orthonormalization, you can check that the
difference between LDA numbers of electrons is still large (1.02 versus 1.81),
even if the orthonormalization effect is larger on the small windows case.
Note that in this particular case, with diagonal matrix, the number of
electrons before and after orthonormalization are simply linked by
n_before/Norm=n_after, i.e. 1.81 ≈1.42/0.78 and 1.02≈0.66/0.66
At the end of the DFT+DMFT calculation, the occupation matrix is written and is
-- polarization spin component 1
0.29450 0.00000 0.00000
0.00000 0.29450 0.00000
0.00000 0.00000 0.29450
0.29313 0.00000 0.00000
0.00000 0.29313 0.00000
0.00000 0.00000 0.29313
Similarly to the previous calculation, the spectral function can be plotted
using the Maximum Entropy code: we find a spectral function with an
@ -546,16 +540,16 @@ expressions are equals also in DFT+DMFT). So after gathering the data:
Iteration | Internal Energy (Ha)
-----------|--------------------------
1 | -1.51483736718814E+02
2 | -1.51480860837124E+02
3 | -1.51479980721122E+02
4 | -1.51479456233951E+02
5 | -1.51479511038784E+02
6 | -1.51479570943715E+02
7 | -1.51479487485907E+02
8 | -1.51479539558451E+02
9 | -1.51479457525225E+02
10 | -1.51479582334490E+02
1 | -1.51857850339126E+02
2 | -1.51986727402835E+02
3 | -1.51895311846530E+02
4 | -1.51906820876597E+02
5 | -1.51891956860157E+02
6 | -1.51891135879190E+02
7 | -1.51892587329592E+02
8 | -1.51891607809905E+02
9 | -1.51891447186423E+02
10 | -1.51892343918492E+02
</center>
@ -573,32 +567,30 @@ than the tolerance, the calculation will never converge. So if a given
precision on the total energy is expected, a practical solution is to increase
the number of Quantum Monte Carlo steps ([[dmftqmc_n]]) in order to lower the
statistical noise. Also another solution is to do an average over the last
values of the internal energy. Note that in version 7.10.5, only the Internal
energy has a physical meaning in DFT+DMFT and not Etotal or ETOT.
values of the internal energy.
## 6 Electronic Structure of SrVO3 in DFT+DMFT: Equilibrium volume
We focus now on the total energy. Create a new input file, *tdmft_4.in*:
We focus now on the total energy. Create a new input file, *tdmft_4.abi*:
cp tdmft_3.in tdmft_4.in
cp tdmft_3.abi tdmft_4.abi
And use [[acell]] = 7.1605 instead of 7.2605. Relaunch the calculation and note the
Internal energy (grep Internal tdmft_4.out).
internal energy (grep internal tdmft_4.abo).
Redo another calculation with [[acell]] = 7.00. Then extract the LDA Internal energy
and the DMFT Internal energy (grep Internal tdmft_5.out).
Redo another calculation with [[acell]] = 7.00. Plot DMFT energies as a function of acell.
<center>
acell | Internal energy LDA | Internal energy DMFT
-------|----------------------|-------------------------
7.0000 | -151.51517 | -151.4797
7.1605 | -151.52399 | -151.4877
7.2605 | -151.51515 | -151.4795
acell | Internal energy DMFT
-------|-------------------------
7.0000 | -151.8908
7.1605 | -151.8978
7.2605 | -151.8920
</center>
and then plot DMFT and LDA energies as a function of acell. You will notice
You will notice
that the equilibrium volume is very weakly modified by the strong correlations is this case.
## 7 Electronic Structure of SrVO3: k-resolved Spectral function
@ -606,13 +598,13 @@ that the equilibrium volume is very weakly modified by the strong correlations i
We are going to use OmegaMaxEnt to do the direct analytical continuation of the self-energy in Matsubara frequencies to real frequencies.
(A more precise way to do the analytical continuation uses an auxiliary Green's function as mentionned in e.g. endnote 55
of Ref. [[cite:Sakuma2013a]]).
First of all, we are going to relaunch a more converged calculation using tdmft_5.in
First of all, we are going to relaunch a more converged calculation using tdmft_5.abi
{% dialog tests/tutoparal/Input/tdmft_5.in%}
{% dialog tests/tutoparal/Input/tdmft_5.abi%}
Modify tdmft_x.files and launch the calculation, it might take some time. The calculation takes in few minutes with 4 processors.
Launch the calculation, it might take some time. The calculation takes in few minutes with 4 processors.
abinit < tdmft_x.files > log_5
abinit tdmft_5.abi > log_5
We are going to create a new directory for the analytical continuation.
@ -678,19 +670,19 @@ this matrix is just useless):
cp tdmft_5o_DS2.UnitaryMatrix_for_DiagLevel_iatom0001 tdmft_5i_DS3.UnitaryMatrix_for_DiagLevel_iatom0001
Copy the Self energy in imaginary frequency for restart also (dmft_nwlo should be the same in the input
file tdmft_5.in and tdmft_2.in)
file tdmft_5.abi and tdmft_2.abi)
cp tdmft_5o_DS2Self-omega_iatom0001_isppol1 tdmft_5o_DS3Self-omega_iatom0001_isppol1
Then modify tdmft_5.in with
Then modify tdmft_5.abi with
ndtset 1
jdtset 3
and relaunch the calculation.
abinit < tdmft_x.files > log_5_dataset3
abinit tdmft_5.abi > log_5_dataset3
Then the spectral function is obtained in file tdmft_5o_DS3_DFTDMFT_SpectralFunction_kresolved_from_realaxisself. You can copy

Binary file not shown.

Before

Width:  |  Height:  |  Size: 29 KiB

After

Width:  |  Height:  |  Size: 26 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 30 KiB

After

Width:  |  Height:  |  Size: 21 KiB

View File

@ -14,11 +14,16 @@ This tutorial demonstrates how to obtain the following physical properties, for
* the McMillan critical temperature
* the resistivity and electronic part of the thermal conductivity
Here you will learn to use the electron-phonon coupling part of the anaddb
Here you will learn to use the electron-phonon coupling part of the ANADDB
utility. This implies a preliminary calculation of the electron-phonon matrix
elements and phonon frequencies and eigenvectors, from a standard ABINIT
phonon calculation, which will be reviewed succinctly.
Note that this tutorial covers a legacy version of the electron-phonon calculation.
A new, more efficient workflow is presented in Tutorials [Introduction to the new EPH workflow](eph_intro).
The old workflow is still useful because it is compatible with spinors (spin orbit coupling), PAW, and
therefore also DFT+U, but it will be deprecated at some time in the future.
Visualisation tools are NOT covered in this tutorial.
Powerful visualisation procedures have been developed in the Abipy context,
relying on matplotlib. See the README of [Abipy](https://github.com/abinit/abipy)
@ -37,26 +42,25 @@ It is presumed that the user has already followed the Tutorials [RF1](rf1) and [
and understands the calculation of ground state and response (phonon using density-functional
perturbation theory (DFPT)) properties with ABINIT.
The file *teph_1.files* lists the file names and root names for the first run (GS+perturbations).
You can copy it to the working directory. You can also copy the file *teph_1.in* to your working directory.
Copy the file *teph_1.abi* to your working directory. It contains in particular file names and root names
for the first run (GS+perturbations).
```sh
cd $ABI_TESTS/tutorespfn/Input
mkdir Work_eph
cd Work_eph
cp ../teph_1.file .
cp ../teph_1.in .
cp ../teph_1.abi .
```
{% dialog tests/tutorespfn/Input/teph_1.in %}
{% dialog tests/tutorespfn/Input/teph_1.abi %}
You can immediately start this run - the input files will be examined later...
abinit < teph_1.files > log 2> err &
abinit teph_1.abi > log 2> err &
### Dataset Structure and Flow
The *teph_1.in* file contains a number of datasets (DS). These will perform the
The *teph_1.abi* file contains a number of datasets (DS). These will perform the
ground state (DS 1), then the phonon perturbations (DS 2-4), for a cell of FCC
aluminium. The DDK perturbation (DS 5) is also calculated, and will be used to
obtain the Fermi velocities for the transport calculations in Section 6.
@ -73,12 +77,12 @@ element calculation is new from version 7.6.
The important variable for electron-phonon coupling calculations is [[prtgkk]]
This prints out files suffixed GKK, which contain the electron-phonon matrix
elements. The matrix elements only depend on the self-consistent perturbed
elements, and are calculated by DS 7-9. The matrix elements only depend on the self-consistent perturbed
density (files suffixed 1DENx), which we get from DS 2-4 (linked by variable
[[get1den]]). These can therefore be calculated on arbitrarily dense k-point
meshes. Even better, only a single step is needed, since no self-consistency
[[get1den]]). The GKK can therefore be calculated on arbitrarily dense k-point
meshes chosen in DS 6. Even better, only a single SCF step is needed, since no self-consistency
is required. To enforce the calculation of all the matrix elements on all
k-points, symmetries are disabled when [[prtgkk]] is set to 1, so be sure not
k-points, symmetries are disabled when [[prtgkk]] is set to 1, so be sure *not*
to use it during the normal self-consistent phonon runs DS 2-4. Again this is
very different from versions before 7.6.
@ -90,21 +94,27 @@ will be completely unconverged, but by the end of the tutorial you should know
how to run a full electron phonon calculation, and be able to improve the
convergence on your own.
Edit the file *teph_1.in*. We now examine several variables. The kinetic energy
Edit the file *teph_1.abi*. We now examine several variables. The kinetic energy
cutoff [[ecut]] is a bit low, and the number of k-points (determined by
[[ngkpt]]) is much too low. Electron-phonon calculations require a very
precise determination of the Fermi surface of the metal. This implies a very
dense k-point mesh, and the convergence of the grid must be checked. In our
case, for Al, we will use a (non-shifted) 4x4x4 k-point grid, but a converged
case, for Al, we will use a (non-shifted) 6x6x6 k-point grid, but a converged
calculation needs more than 16x16x16 points. This will be re-considered in
section 5. The q-point grid will be 2x2x2. It must be a sub-grid of the full
k-point grid, and must contain the Γ point.
section 5. The q-point grid will be 2x2x2, and is selected by the [[ngqpt]],
qshift, nqshift, and [[qptopt]] variables. It must be a sub-grid of the full
k-point grid, and must contain the Γ point. For the phonon and GKK datasets,
the q-point is selected by the variable [[iqpt]]: this guarantees that there are
no errors in transcription of q coordinates, and simplifies workflows. The only
unknown ahead of time is the total number of q (and hence datasets) in the irreducible
wedge. One way to check this is to set iqpt to a very large value: the error message
gives you the size of the irreducible set.
The value of [[acell]] is fixed to a rounded value from experiment.
It, too, should be converged to get physical results (see [Tutorial 3](base3)).
Note that the value of 1.0E-14 for [[tolwfr]] is tight, and should be even
lower (down to 1.0E-20 or even 1.0E-22). This is because the wavefunctions
lower (down to 1.0E-20 or even 1.0E-22) for accurate results. This is because the wavefunctions
will be used later explicitly in the matrix elements for ANADDB, as opposed to
only energy values or densities, which are averages of the wavefunctions and
eigenenergies over k-points and bands. Electron-phonon quantities are delicate
@ -117,7 +127,7 @@ disk (you only need to keep the ground state wave functions, with prtwf1 1).
Run the first input (a few seconds on a recent PC), and you should obtain a value of
etotal -2.0828579336121 Ha
etotal -2.3076512079E+00 Ha
for the energy at the end of DATASET 1. The following datasets calculate the
second order energy variations under atomic displacement in the three reduced
@ -130,7 +140,7 @@ As an example, DATASET 3 calculates the perturbed
wavefunctions at k+q, for k in the ground state k-point mesh, and q=(1/2,0,0).
Then, DATASET 3 calculates
2DTE 0.80951882353353
2DTE 6.9410188336E-01 Ha
for the second-order energy variation for movement of the (unique) atom along
the first reduced direction for q=(1/2,0,0). The main differences with [Tutorial RF1](rf1)
@ -143,15 +153,16 @@ minimal number of 2DTE for different mixed second derivatives of the total
energy. In our case we use the first derivatives, and they must all be calculated explicitly.
You are now the proud owner of 9 first-order matrix element files (suffixed
_GKKx), corresponding to the three directional perturbations of the atom at
each of the three q-points. The _GKK files contain the matrix elements of the
\_GKKx, and corresponding copies in netcdf format \_GKKx.nc),
corresponding to the three directional perturbations of the atom at
each of the three q-points. The \_GKK files contain the matrix elements of the
electron-phonon interaction, which we will extract and use in the following.
Besides the _GKK files there are the _DDB files for each perturbation which
Besides the \_GKK files there are the \_DDB files for each perturbation which
contain the 2DTE for the different phonons wavevectors q.
## 2 Merging of the 2DTE DDB files using MRGDDB
You can copy the following content to a file *teph_2.in* within your working directory:
You can copy the following content to a file *teph_2.abi* within your working directory:
teph_2.ddb.out
Total ddb for Al FCC system
@ -162,16 +173,16 @@ You can copy the following content to a file *teph_2.in* within your working dir
or use
{% dialog tests/tutorespfn/Input/teph_2.in %}
{% dialog tests/tutorespfn/Input/teph_2.abi %}
This is your input file for the [[help:mrgddb|MRGDDB]] utility, which will
take the different _DDB files and merge them into a single one which ANADDB
will use to determine the phonon frequencies and eigenvectors. *teph_2.in*
take the different \_DDB files and merge them into a single one which ANADDB
will use to determine the phonon frequencies and eigenvectors. *teph_2.abi*
contains the name of the final file, a comment line, then the number of *_DDB*
files to be merged and their names.
*mrgddb* is run with the command
mrgddb < teph_2.in
mrgddb < teph_2.abi
It runs in a few seconds.
@ -179,7 +190,7 @@ It runs in a few seconds.
A merge similar to that in the last section must be carried out for the
electron-phonon matrix elements. This is done using the MRGGKK utility, and
its input file is *\$ABI_TESTS/tutorespfn/Input/teph_3.in*, shown below
its input file is *\$ABI_TESTS/tutorespfn/Input/teph_3.abi*, shown below
teph_3o_GKK.bin # Name of output file
0 # binary (0) or ascii (1) output
@ -191,17 +202,17 @@ its input file is *\$ABI_TESTS/tutorespfn/Input/teph_3.in*, shown below
or use
{% dialog tests/tutorespfn/Input/teph_3.in %}
{% dialog tests/tutorespfn/Input/teph_3.abi %}
The matrix element sections of all the _GKK files will be extracted and
The matrix element sections of all the \_GKK files will be extracted and
concatenated into one (binary) file, here named *teph_3o_GKK.bin*. The following
lines in *teph_3.in* give the output format (0 for binary or 1 for ascii), then
lines in *teph_3.abi* give the output format (0 for binary or 1 for ascii), then
the name of the ground state wavefunction file. The fourth line contains 3
integers, which give the number of _1WF files (which can also be used to
salvage the GKK), the number of _GKK files, and the number of perturbations in
the _GKK files. Thus, MRGGKK functions very much like [help:mrgddb|MRGDDB], and can merge _GKK
integers, which give the number of \_1WF files (which can also be used to
salvage the GKK), the number of \_GKK files, and the number of perturbations in
the \_GKK files. Thus, MRGGKK functions very much like [help:mrgddb|MRGDDB], and can merge \_GKK
files which already contain several perturbations (q-points or atomic
displacements). Finally, the names of the different _1WF and _GKK files are listed.
displacements). Finally, the names of the different \_1WF and \_GKK files are listed.
MRGGKK will run on this example in a few seconds. In more general cases, the
runtime will depend on the size of the system, and for a large number of bands
@ -214,15 +225,14 @@ superconductivity is reviewed in [[cite:Allen1983a|Theory of Superconducting Tc]
by P.B. Allen and B. Mitrovic.
The first implementations similar to that in ABINIT are those in [[cite:Savrasov1996]] and [[cite:Liu1996]].
File *\$ABI_TESTS/tutorespfn/Input/teph_4.in* contains the input needed by
File *\$ABI_TESTS/tutorespfn/Input/teph_4.abi* contains the input needed by
ANADDB to carry out the calculation of the electron-phonon quantities.
{% dialog tests/tutorespfn/Input/teph_4.in %}
{% dialog tests/tutorespfn/Input/teph_4.abi %}
ANADDB takes a files file, just like ABINIT, which tells it where to find the input,
ANADDB has file path variables, just like ABINIT, which tells it where to find the input,
ddb, and gkk files, and what to name the output, thermodynamical output, and
electron phonon output files. *\$ABI_TESTS/tutorespfn/Input/teph_4.files* is
your files file for ANADDB. You can edit it now.
electron phonon output files.
The new variables are at the head of the file:
@ -253,7 +263,10 @@ which are usually special points of high symmetry. The number of points is
given by [[anaddb:nqpath]]. Note that qpath can be used in normal phonon band
structure calculations as well, provided that [[anaddb:qph1l]] is omitted from
the input file (the latter overrides qpath). The phonon linewidths are printed
to a file suffixed _LWD.
to a file suffixed \_LWD. The phonon band structure is shown below, and is already
stable with a 6x6x6 k-point grid.
![Phonon band structure of Al](eph_assets/Al_phonon_BS.png)
The phonon linewidths are proportional to the electron phonon coupling, and
still depend on the phonon wavevector q. The other electron-phonon
@ -264,7 +277,7 @@ reciprocal space, but keeping the resolution in the phonon mode's energy, one
calculates the Eliashberg spectral function $\alpha^2F$. The $\alpha^2F$ function is similar
to the density of states of the phonons, but is weighted according to the
coupling of the phonons to the electrons. It is output to a file with suffix
_A2F, which is ready to be represented using any graphical software (Xmgr,
\_A2F, which is ready to be represented using any graphical software (Xmgrace,
matlab, OpenDX...). The first inverse moment of $\alpha^2F$ gives the global coupling
strength, or mass renormalization factor, $\lambda$. From $\lambda$, using the [[cite:McMillan1968|McMillan formula]]
as modified by [[cite:Allen1975|Allen and Dynes]]
@ -274,20 +287,23 @@ parameter $\mu^{\star}$ which approximates the effect of Coulomb interactions, a
given by the input variable [[anaddb:mustar]]. For Al with the k-point grid
given and a value of $\mu^{\star}$=0.136 the ANADDB output file shows the following values
mka2f: lambda <omega^2> = 8.891284E-07
mka2f: lambda <omega^3> = 7.757272E-10
mka2f: lambda <omega^4> = 8.715049E-13
mka2f: lambda <omega^5> = 1.108658E-15
mka2f: isotropic lambda = 8.337444E+00
mka2f: omegalog = 1.769558E-04 (Ha) 5.587816E+01 (Kelvin)
mka2f: lambda <omega^2> = 1.179090E-07
mka2f: lambda <omega^3> = 1.575413E-10
mka2f: lambda <omega^4> = 2.212559E-13
mka2f: lambda <omega^5> = 3.213830E-16
mka2f: isotropic lambda = 8.542685E-02
mka2f: omegalog = 1.038371E-03 (Ha) 3.278912E+02 (Kelvin)
mka2f: input mustar = 1.360000E-01
-mka2f: MacMillan Tc = 4.038730E-05 (Ha) 1.275329E+01 (Kelvin)
-mka2f: MacMillan Tc = 2.645390E+05 (Ha) 8.353470E+10 (Kelvin)
As expected, this is a fairly bad estimation of the experimental value of 1.2
K. The coupling strength is severely overestimated (experiment gives 0.44),
and the logarithmic average frequency is too low, but not nearly enough to
compensate $\lambda$. Aluminum is a good case in which things can be improved, easily
because its Fermi surface is isotropic and the coupling is weak.
As could be expected, this is a very bad estimation of the experimental value of 1.2
K. The coupling strength is severely underestimated (experiment gives 0.44),
and the logarithmic average frequency is a bit too high (converged value of 270 K in [[cite:Savrasov1996|Savrasov]]).
The resulting critical temperature from McMillan's formula is unphysical, and you
should always regard it critically: if $\lambda$ is close to or lower than the chosen value of
$\mu^{\star}$, $T_c$ will diverge.
Aluminum is a good case in which things can be improved easily,
because its Fermi surface is large and isotropic and the coupling is weak.
## 5 Convergence tests of the integration techniques
@ -309,14 +325,18 @@ does not affect results. Normally, the limit for a very small
[[anaddb:elphsmear]] and a very dense k-point grid is the same as the value
obtained with the tetrahedron method (which usually converges with a sparser k-point grid).
Edit input file *\$ABI_TESTS/tutorespfn/Input/teph_5.in* and you will see the
main difference with teph_4.in is the choice of the tetrahedron integration method.
Edit input file *\$ABI_TESTS/tutorespfn/Input/teph_5.abi* and you will see the
main difference with teph_4.abi is the choice of the tetrahedron integration method.
{% dialog tests/tutorespfn/Input/teph_5.in %}
{% dialog tests/tutorespfn/Input/teph_5.abi %}
If you are patient, save the output _LWD and _A2F files and run the
full tutorial again with a denser k-point grid (say, 6x6x6) and you will be able
to observe the differences in convergence.
Already at this level, you can see the increased accuracy: the isotropic $\lambda$
values (around 0.50) and the MacMillan $T_c$ (2.2 Kelvin) are much more realistic.
If you are patient, save the output \_LWD and \_A2F files and run the
full tutorial again with a denser k-point grid (say, 12x12x12) and you will be able
to observe the differences in convergence. For Al the $\alpha^2F$ function and related
quantities converge for a minimal k-point grid of about 16x16x16.
## 6 Transport quantities within Boltzmann theory
@ -331,7 +351,7 @@ resistivity, heat conductivity limited by electron-phonon coupling) is the
Fermi velocity, i.e. the group velocity of a wavepacket of electrons placed at
the Fermi surface. This is the "true" velocity the charge will move at, once
you have displaced the Fermi sphere a little bit in k space (see, e.g.
[[cite:Ashcroft1976|Ashcroft and Mermin]] as well). The velocity can be related simply to a
[[cite:Ashcroft1976|Ashcroft and Mermin]]). The velocity can be related simply to a
commutator of the position, which is also used for dielectric response, using
a DDK calculation (see [the first DFPT tutorial (DFPT1)](rf1).
The phonon calculation at Gamma need not include the electric field (this is a metal after all, so the effect on the
@ -339,64 +359,57 @@ phonons should be negligible), but we need an additional dataset to calculate
the 3 DDK files along the 3 primitive directions of the unit cell. To be more
precise, just as for the el-ph matrix elements, we do not need the perturbed
wavefunctions, only the perturbed eigenvalues. Calculating the DDK derivatives
with [[prtgkk]] set to 1 will output files named _GKKxx (xx=3*natom+1 to
3*natom+3) containing the matrix elements of the ddk perturbation (these are
with [[prtgkk]] set to 1 will output files named \_GKKxx (xx=3 *natom* + 1 to
3 *natom* + 3) containing the matrix elements of the ddk perturbation (these are
basically the first part of the normal DDK files for E field perturbation,
without the wave function coefficients).
The anaddb "files" file must specify where the ddk files are, so anaddb can
calculate the Fermi velocities. It actually reads:
teph_6.in
teph_6.out
teph_2.ddb.out
moldyn
teph_3o_GKK.bin
teph.ep
teph_6.ddk
where the last line is the name of a small file listing the 3 DDK files to be used:
The ANADDB input must specify where the ddk files are, so ANADDB can
calculate the Fermi velocities. The variable ddk_filepath points to a
small file listing the 3 DDK files to be used, whose contents in our case are:
teph_1_DS5_GKK4
teph_1_DS5_GKK5
teph_1_DS5_GKK6
The abinit input file teph_1.in already obtained the DDK files from the
additional dataset, DS5, with the following lines of teph_1.in:
The abinit input file *teph_1.abi* already obtained the DDK files from the
additional dataset, DS5, with the following lines of *teph_1.abi*:
tolwfr5 1.0d-14
qpt5 0 0 0
iqpt5 1
rfphon5 0
rfelfd5 2
prtwf5 0
Copy the additional .ddk file from the tests/tutorespfn/Inputs directory, and
run anaddb with the new "files" file. The input for teph_6 has added to *teph_5.in* the following 2 lines:
You can copy the additional .ddk file from the tests/tutorespfn/Inputs directory, and
run ANADDB. The input for *teph_6.abi* has added to *teph_5.abi* the following 2 lines:
ifltransport 1
ep_keepbands 1
see
{% dialog tests/tutorespfn/Input/teph_6.in %}
{% dialog tests/tutorespfn/Input/teph_6.abi %}
and has produced a number of additional files:
* *_A2F_TR* contain the equivalent Eliashberg spectral functions with Fermi speed factors (how many phonons do we have at a given energy, how much do they couple with the electrons, and how fast are these electrons going). Integrating with appropriate functions of the phonon energy, one gets:
* the resistivity as a function of temperature (teph_6.out_ep_RHO and figure) and
* the resistivity as a function of temperature (teph_6.out_ep_RHO and figure)
* the thermal conductivity as a function of temperature (teph_6.out_ep_WTH) but ONLY the electronic contribution. You are still missing the phonon-phonon interactions, which are the limiting factor in the thermal conductivity beyond a few 100 K. For metals at even higher temperature the electrons will often dominate again as they contain more degrees of freedom.
![Resistivity of Al as a function of T](eph_assets/teph_6_RHO.png)
The high T behavior is necessarily linear if you include only first order e-p
coupling and neglect the variation of the GKK off of the Fermi surface. The
inset shows the low T behavior, which is not a simple polynomial (with simple
models it should be T^3 or T^5 - see [[cite:Ashcroft1976|Ashcroft and Mermin]]). See the [[cite:Savrasov1996|Savrasov paper]]
above for reference values in simple metals using well converged k- and q- point grids.
inset shows the low T behavior, which is not a simple polynomial (with textbook
models it should be T$^3$ or T$^5$ - see [[cite:Ashcroft1976|Ashcroft and Mermin]]). See the [[cite:Savrasov1996|Savrasov paper]]
for reference values in simple metals using well converged k- and q- point grids, here we are missing a factor of 2, which is not
bad given how crude the grids are.
Finally, note that the _RHO and _WTH files contain a series of tensor
Finally, note that the \_RHO and \_WTH files contain a series of tensor
components, for the resistivity tensor (2 1 = y x or the current response
along y when you apply an electric field along x). In most systems the tensor
along y when you apply an electric field along x). In many systems the tensor
should be diagonal by symmetry, and the value of off-diagonal terms gives an
estimate of the numerical error.
estimate of the symmetrization error (tiny). Similarly the difference in the diagonal terms
is due to numerical convergence: here is is a few per-mil, visible in the figure
between green and red lines (yy and xx components).

File diff suppressed because it is too large Load Diff

Binary file not shown.

After

Width:  |  Height:  |  Size: 156 KiB

File diff suppressed because it is too large Load Diff

Binary file not shown.

Before

Width:  |  Height:  |  Size: 8.4 KiB

After

Width:  |  Height:  |  Size: 66 KiB

View File

@ -1,12 +1,12 @@
---
authors: PhG, MVeithen, XG
authors: JWZ, PhG, MVeithen, XG
---
# Tutorial on polarization and finite electric fields
## Polarization, and responses to finite electric fields for AlAs.
## Polarization, and responses to finite electric fields for AlP.
This tutorial aims at showing how to get the following physical properties, for an insulator:
This tutorial describes how to obtain the following physical properties, for an insulator:
* The polarization.
* The Born effective charge (by finite differences of polarization)
@ -14,25 +14,26 @@ This tutorial aims at showing how to get the following physical properties, for
* The dielectric constant
* The proper piezoelectric tensor (clamped and relaxed ions)
The case of the linear responses (Born effective charge, dielectric constant,
The case of the linear responses (for the Born effective charge, dielectric constant,
piezoelectric tensor) is treated independently in other tutorials
([tutorial Response-Function 1](rf1), [tutorial on Elastic properties](elastic)),
([Response-Function 1](rf1), [Elastic properties](elastic)),
using Density-Functional Perturbation Theory.
You will learn here how to get these quantities using the finite
You will learn here how to obtain these quantities using finite
difference techniques within ABINIT. To that end, we will describe how to
compute the polarization, in the Berry phase formulation, and how to perform
finite electric field calculations.
The basic theory for Berry phase computation of the polarization was proposed
The basic theory for the Berry phase computation of the polarization was proposed
by R. D. King-Smith and D. Vanderbilt in [[cite:Kingsmith1993]].
The longer (excellent) paper D. Vanderbilt and R. D. King-Smith ([[cite:Vanderbilt1993]])
clarifies many aspects of this theory (especially in view of application to AlAs, as in this tutorial).
One might benefit also from a reading of the review article [[cite:Resta1994]].
The longer excellent paper by D. Vanderbilt and R. D. King-Smith ([[cite:Vanderbilt1993]])
clarifies many aspects of this theory.
Good overviews of this subject may be found in the review article
[[cite:Resta1994]] and book [[cite:Vanderbilt2018]].
In order to gain the theoretical background needed to perform a calculation
with a finite electric field, you should consider reading the following papers:
[[cite:Souza2002]], [[cite:Nunes2001]] and
M. Veithen [PhD thesis](https://www.abinit.org/sites/default/files/PhD-M.Veithen.pdf)
[[https://www.abinit.org/sites/default/files/PhD-M.Veithen.pdf|M. Veithen PhD thesis]].
Finally, the extension to the PAW formalism specifically in ABINIT is
discussed in [[cite:Gonze2009]] and [[cite:Zwanziger2012]].
@ -40,95 +41,96 @@ This tutorial should take about 1 hour and 30 minutes.
[TUTORIAL_READMEV9]
## 1 Ground-state properties of AlAs and general parameters
## 1 Ground-state properties of AlP and general parameters
*Before beginning, you might consider working in a different subdirectory, as for the other tutorials.
Why not create Work_ffield in \$ABI_TESTS/tutorespfn/Input?*
For example, create Work_ffield in \$ABI_TESTS/tutorespfn/Input*
In this tutorial we will assume that the ground-state properties of AlAs have
In this tutorial we will assume that the ground-state properties of AlP have
been previously obtained, and that the corresponding convergence studies have been done.
We will adopt the following set of generic parameters:
```
acell 3*7.2728565836E+00
ecut 5
ecutsm 0.5
dilatmx 1.05
nband 4 (=number of occupied bands)
ngkpt 6 6 6
nshiftk 4
shiftk 0.5 0.5 0.5
0.5 0.0 0.0
0.0 0.5 0.0
0.0 0.0 0.5
acell 10.53
ixc 3
ecut 2.8 (results with ecut = 5 are also reported
in the discussion)
ecutsm 0.5
dilatmx 1.05
nband 4 (=number of occupied bands)
ngkpt 6 6 6
nshiftk 4
shiftk 0.5 0.5 0.5
0.5 0.0 0.0
0.0 0.5 0.0
0.0 0.0 0.5
pseudopotentials 13al.pspnc
33as.pspnc
pseudopotentials Pseudodojo_nc_sr_04_pw_standard_psp8/P.psp8
Pseudodojo_nc_sr_04_pw_standard_psp8/Al.psp8
```
In principle, the [[acell]] to be used should be the one corresponding to the
optimized structure at the [[ecut]], and [[ngkpt]] combined with [[nshiftk]]
and [[shiftk]], chosen for the calculations.
Unfortunately, for the purpose of this tutorial, in order to limit the duration of the runs,
we have to work at an unusually low cutoff of 2.8 Ha for which the optimized lattice constant is
equal to $7.45\times 2/\sqrt{2}=10.53~\mathrm{Bohr}$ (instead of the converged value of 10.64
Bohr). For comparison, results with [[ecut]]=5 are also reported and, in that
case, were obtained at the optimized lattice constant of 10.64 bohr. For those
who would like to try later, convergence tests and structural optimizations
can be done using the file [[tests/tutorespfn/Input/tnlo_1.abi]]. Before going
For the purpose of this tutorial, in order to limit the duration of the runs,
we are working at a low cutoff of 5 Ha, for which the optimized lattice constant is
equal to $7.27\times 2/\sqrt{2}=10.29~\mathrm{Bohr}$. Nonetheless this value is close to
that obtained with a highly converged geometry optimization, of 10.25~Bohr.
As always, if you adapt this tutorial to your own research, it is critical to perform
full convergence studies.
Before going
further, you might refresh your memory concerning the other variables:
[[ixc]], [[ecutsm]], [[dilatmx]].
[[ecutsm]], [[dilatmx]], [[ngkpt]], [[nshiftk]], and [[shiftk]].
Note as well that the pseudopotentials used here are freely available
from [[http://www.pseudo-dojo.org|Pseudo Dojo]]. The ones chosen here for P and Al
use the Perdew-Wang parameterization of the local density approximation (LDA); this is
done to facilitate comparison of the results of this tutorial with those of
[Non-linear properties](nlo).
## 2 Berry phase calculation of polarization in zero field
In this section, you will learn how to perform a Berry phase calculation of
the polarization. As a practical problem we will try to compute the Born
effective charges from finite difference of the polarization (under finite
atomic displacements), for AlAs.
You can now copy the file *tffield_1.abi* and *tffield_x.files* in *Work_ffield*,
and modify the latter as usual (for example, edit it so that the various file names it
contains refer to tffield_1 rather than tffield_x).
atomic displacements), for AlP.
You can now copy the file *tffield_1.abi* to *Work_ffield*,
```sh
cd $ABI_TESTS/tutorespfn/Input
mkdir Work_ffield
cd Work_ffield
cp ../tffield_1.files .
cp ../tffield_x.abi .
cp ../tffield_1.abi .
```
{% dialog tests/tutorespfn/Input/tffield_x.files tests/tutorespfn/Input/tffield_1.abi %}
{% dialog tests/tutorespfn/Input/tffield_1.abi %}
Note that two pseudopotentials are mentioned in this "files" file: one for the
aluminum atom, and one for the arsenic atom. The first to be mentioned, for
Al, will define the first type of atom. The second to be mentioned, for As,
will define the second type of atom. It might the first time that you
encounter this situation (more than one type of atoms) in the tutorials, at
variance with the four "basic" tutorials.
Because of the use of two types of atoms, have also a look at the following
input variables present, in the "input" file:
Note that two pseudopotentials are mentioned in this input file: one for the
phosphorus atom, and one for the aluminum atom. The first listed, for
P in this case, will define the first type of atom. The second listed, for Al,
will define the second type of atom. This might be the first time that you
encounter this situation (more than one type of atom) in the tutorials, in
contrast with the four "basic" tutorials. Because of the use of more than one
type of atom, the following input variables must be present:
* [[ntypat]]
* [[typat]]
You can start the calculation. It should take 90 seconds on a PC 3GHz.
Examine the *tffield_1.abi* file. It is made of three datasets corresponding to
the reference optimized structure ($\tau=0$) and to structure with the Al atom
displaced from 0.01 bohr right and left (referred to as $\tau = +0.01$ and
$\tau =-0.01$). This is typically the amplitude of atomic displacement to be
considered in this kind of computations. Notice also that the displacements
are given using [[xcart]], that is, explicitly in Cartesian directions, rather
than the primitive cell axes (using [[xred]]). This makes the correspondence
with the polarization output in Cartesian directions much simpler to understand.
You can start the calculation. It should take about 90 seconds on a typical
desktop machine. In the meantime, examine the *tffield_1.abi* file. It
includes three computations (see the section labelled as *atomic positions*)
corresponding to, first, the reference optimized structure ($\tau=0$), and then
to the structure with the Al atom displaced from 0.01 bohr to the right and to
the left (referred to as $\tau = +0.01$ and $\tau =-0.01$). These are typical
for the amplitude of atomic displacement in this kind of finite difference
computation. Notice also that the displacements are given using [[xcart]], that
is, explicitly in Cartesian directions in atomic units, rather than the
primitive cell axes (which would use [[xred]]). This makes the correspondence
with the polarization output in Cartesian directions much simpler to
understand.
There are two implementations of the Berry phase within ABINIT. One
corresponds to positive values of [[berryopt]] and was implemented by Na Sai.
The other one corresponds to negative values of [[berryopt]] and was implemented
by Marek Veithen. Both are suitable to compute the polarization. Here we will
is triggered by positive values of [[berryopt]] and was implemented by Na Sai.
The other one is triggered by negative values of [[berryopt]] and was implemented
by Marek Veithen. Both are suitable to compute the polarization, however, here we will
focus on the implementation of Marek Veithen for two reasons. First, the
results are directly provided in Cartesian coordinates at the end of the run
(while the implementation of Na Sai reports them in reduced coordinates).
@ -137,105 +139,90 @@ finite electric field calculation as described in the next section. Finally,
note also that Veithen's implementation works with [[kptopt]] = 1 or 2 while
Na Sai implementation is restricted to [[kptopt]] = 2, which is less convenient.
The file is the one of a usual self-consistent calculation. On top of the
The input file is typical for a self-consistent ground state calculation. In addition to the
usual variables, for the Berry phase calculation we simply need
to define [[berryopt]] and [[rfdir]]:
berryopt -1
rfdir 1 1 1
to include [[berryopt]] and [[rfdir]]:
```
berryopt -1
rfdir 1 1 1
```
Make the run, then open the output file and look for the occurrence "Berry".
The output reports values of the Berry phase for individual k-point strings.
Computing the polarization (Berry phase) for reciprocal vector:
0.16667 0.00000 0.00000 (in reduced coordinates)
-0.01583 0.01583 0.01583 (in cartesian coordinates - atomic units)
Number of strings: 144
Number of k points in string: 6
```
Computing the polarization (Berry phase) for reciprocal vector:
0.16667 0.00000 0.00000 (in reduced coordinates)
-0.01620 0.01620 0.01620 (in cartesian coordinates - atomic units)
Number of strings: 144
Number of k points in string: 6
Summary of the results
Electronic Berry phase 2.025856545E-03
Ionic phase -7.500000000E-01
Total phase -7.479741435E-01
Remapping in [-1,1] -7.479741435E-01
Polarization -1.557862799E-02 (a.u. of charge)/bohr^2
Polarization -8.913274846E-01 C/m^2
Summary of the results
Electronic Berry phase 2.206976733E-03
Ionic phase -7.500000000E-01
Total phase -7.477930233E-01
Remapping in [-1,1] -7.477930233E-01
Polarization -1.632453164E-02 (a.u. of charge)/bohr^2
Polarization -9.340041842E-01 C/m^2
```
The "Remapping in [-1,1]" is there to avoid the quantum of polarization. As
discussed in [[cite:Djani2012]], the indeterminacy of the quantum phase, directly
related to the quantum of polarization, can lead to spurious effects (see Fig.
2 of the above-mentioned paper). By remapping on the [-1,1] interval, any
indeterminacy is removed. However, removing such a quantum of polarization
between two calculations might give the false impression that one is on the
same polarization branch in the two calculations, while actually the branch is
made different by this remapping. Cross-checking the polarization results by
computing the Born effective charge, further multiplied by the displacements
between the two geometries is an excellent way to estimate the amplitude of the polarization.
discussed in [[cite:Djani2012]], the indeterminacy of the quantum phase,
directly related to the quantum of polarization, can lead to spurious effects
(see Fig. 2 of the above-mentioned paper). By remapping on the [-1,1]
interval, any indeterminacy is removed. However, removing such a quantum of
polarization between two calculations might give the false impression that one
is on the same polarization branch in the two calculations, while actually the
branch is made different by this remapping. Cross-checking the polarization
results by computing the Born effective charge, further multiplied by the
displacements between the two geometries is an excellent way to estimate the
amplitude of the polarization.
Other subtleties of Berry phases, explained in [[cite:Vanderbilt1993]], also apply.
First, note that neither the electronic Berry phase nor the ionic phase vanish in this highly
symmetric case, contrary to intuition. Even though AlAs does not have
inversion symmetry, it does have tetrahedral symmetry, which would be enough
to make an ordinary vector vanish. But a lattice-valued vector does not have
to vanish: the lattice just has to transform into itself under the tetrahedral
point group. The ionic phase corresponds actually to a lattice-valued vector
(-3/4 -3/4 -3/4). Concerning the electronic phase, it does not exactly vanish,
unless the sampling of k points becomes continuous. If you go further in the
file you will find the final results in cartesian coordinates. You can collect
them for the different values of $\tau$.
Other subtleties of Berry phases, explained in [[cite:Vanderbilt1993]], also
apply. First, note that neither the electronic Berry phase nor the ionic phase
vanish in this highly symmetric case, contrary to intuition. Even though AlP
does not have inversion symmetry, it does have tetrahedral symmetry, which
would be enough to make an ordinary vector vanish. But a lattice-valued vector
does not have to vanish: the lattice just has to transform into itself under
the tetrahedral point group. The ionic phase corresponds actually to a
lattice-valued vector (-3/4 -3/4 -3/4). Concerning the electronic phase, it
does not exactly vanish, unless the sampling of k points becomes continuous.
If you go further in the file you will find the final results in cartesian
coordinates. You can collect them for the different values of $\tau$.
$\tau = 0$
```
Polarization in cartesian coordinates (a.u.):
Total: -0.282749182E-01 -0.282749182E-01 -0.282749182E-01
Polarization in cartesian coordinates (a.u.):
(the sum of the electronic and ionic Berry phase has been folded into [-1, 1])
Electronic berry phase: 0.730822547E-04 0.730822547E-04 0.730822547E-04
Ionic: -0.270560574E-01 -0.270560574E-01 -0.270560574E-01
Total: -0.269829752E-01 -0.269829752E-01 -0.269829752E-01
Polarization in cartesian coordinates (C/m^2):
(the sum of the electronic and ionic Berry phase has been folded into [-1, 1])
Electronic berry phase: 0.418138377E-02 0.418138377E-02 0.418138377E-02
Ionic: -0.154800587E+01 -0.154800587E+01 -0.154800587E+01
Total: -0.154382449E+01 -0.154382449E+01 -0.154382449E+01
Polarization in cartesian coordinates (C/m^2):
Total: -0.161774270E+01 -0.161774270E+01 -0.161774270E+01
```
$\tau = +0.01$
```
Polarization in cartesian coordinates (a.u.):
Total: -0.281920467E-01 -0.282749119E-01 -0.282749119E-01
Polarization in cartesian coordinates (a.u.):
(the sum of the electronic and ionic Berry phase has been folded into [-1, 1])
Electronic berry phase: 0.410030549E-04 0.730924693E-04 0.730924693E-04
Ionic: -0.269532804E-01 -0.270560574E-01 -0.270560574E-01
Total: -0.269122773E-01 -0.269829650E-01 -0.269829650E-01
Polarization in cartesian coordinates (C/m^2):
(the sum of the electronic and ionic Berry phase has been folded into [-1, 1])
Electronic berry phase: 0.234598001E-02 0.418196820E-02 0.418196820E-02
Ionic: -0.154212551E+01 -0.154800587E+01 -0.154800587E+01
Total: -0.153977953E+01 -0.154382391E+01 -0.154382391E+01
Polarization in cartesian coordinates (C/m^2):
Total: -0.161300123E+01 -0.161774234E+01 -0.161774234E+01
```
$\tau = -0.01$
```
Polarization in cartesian coordinates (a.u.):
Total: -0.283577762E-01 -0.282749119E-01 -0.282749119E-01
Polarization in cartesian coordinates (a.u.):
(the sum of the electronic and ionic Berry phase has been folded into [-1, 1])
Electronic berry phase: 0.105181874E-03 0.730924694E-04 0.730924694E-04
Ionic: -0.271588345E-01 -0.270560574E-01 -0.270560574E-01
Total: -0.270536526E-01 -0.269829650E-01 -0.269829650E-01
Polarization in cartesian coordinates (C/m^2):
(the sum of the electronic and ionic Berry phase has been folded into [-1, 1])
Electronic berry phase: 0.601795583E-02 0.418196820E-02 0.418196820E-02
Ionic: -0.155388624E+01 -0.154800587E+01 -0.154800587E+01
Total: -0.154786828E+01 -0.154382391E+01 -0.154382391E+01
Polarization in cartesian coordinates (C/m^2):
Total: -0.162248340E+01 -0.161774234E+01 -0.161774234E+01
```
From the previous data, we can extract the Born effective charge of Al. Values
to be used are those in a.u., in order to find the charge in electron units. It
corresponds to (the volume of the primitive unit cell must be specified in atomic units too):
$$ Z^* = \Omega_0 \frac{P(\tau = +0.01) - P(\tau = -0.01)}{2\tau} $$
$$= 291.89 \frac{ (-2.6912\times 10^{-2}) - (-2.7054\times 10^{-2})}{0.02} $$
$$ = 2.06$$
$$= 272.02 \frac{ (-2.8192\times 10^{-2}) - (-2.8358\times 10^{-2})}{0.02} $$
$$ = 2.258$$
For comparison, the calculation using Density-Functional Perturbation Theory
For comparison, the same calculation using Density-Functional Perturbation Theory
(DFPT) can be done by using the file *\$ABI_TESTS/tutorespfn/Input/tffield_2.abi*.
{% dialog tests/tutorespfn/Input/tffield_2.abi %}
@ -243,109 +230,146 @@ For comparison, the calculation using Density-Functional Perturbation Theory
Actually, the file *tffield_2.abi*
not only leads to the computation of the Born effective charges, but also the
computation of the piezoelectric constants (see later).
You can review how to use DFPT in the
[tutorial Response-function 1](rf1) and
[tutorial Response-function 2](rf2) tutorials.
!!! note
An interesting feature of *tffield_2.abi* is the use of `berryopt2 -2` in
the second data set. This input variable causes the computation of the DDK
wavefunctions using a finite difference formula, rather than the DFPT approach
triggered by [[rfddk]]. Although not strictly required in the present DFPT calculation,
the finite difference approach is necessary in the various
Berry's phase computations of polarization, in order to maintain phase coherency
between wavefunctions at neighboring k points. Therefore in the present tutorial we use
the finite difference approach, in order to compare the results of the Berry's phase
computation to those of DFPT more accurately.
You can review how to use DFPT thanks to the [tutorial Response-function 1](rf1) and [tutorial Response-function 2](rf2)
tutorials. For now, go ahead and run the input file, and have a look at the
output file, to identify the place where the Born effective charge is written
(search for the phrase "Effective charges" in the output file). The value we
get from DFPT is 2.06, in agreement with the above-mentioned value of 2.06.
This level of agreement is fortuitous for unconverged calculations, though
both methods (finite-difference and DFPT) will tend to the same value for
better converged calculations.
!!! warning
The use of kpoint overlaps in Berry's phase calculations is necessary, but causes the
results to converge *much* more slowly with kpoint mesh density than other types of
calculations. It is critical in production work using Berry's phase methods to check
carefully the convergence with respect to kpoint mesh density.
The DDB generated by *\$ABI_TESTS/tutorespfn/Input/tffield_2.abi* can be used as input to
anaddb, thanks to the *tffield_3.abi* input file and the *tffield_3.files* file.
Go ahead and run the input file,
and have a look at the output file, to identify the
place where the Born effective charge is written (search for the phrase
"Effective charges"). The value we get from DFPT is 2.254,
in surprisingly good agreement with the above-mentioned value of 2.258. This
level of agreement is fortuitous for unconverged calculations. Both
methods (finite-difference and DFPT) will tend to the same value for better
converged calculations.
The DDB file generated by *\$ABI_TESTS/tutorespfn/Input/tffield_2.abi* can be used as input to
anaddb for further processing, using the input file *tffield_3.abi* and the *tffield_3.files* file.
{% dialog tests/tutorespfn/Input/tffield_3.files tests/tutorespfn/Input/tffield_3.abi %}
!!! note
While the `abinit` program itself takes its input file as an
argument, the `anaddb` post-processing program depends in general on multiple
input files, and therefore it is more convenient to pipe in a file whose
contents are just the names of the files that `anaddb` should ultimately use. In
the present case, the piped-in file *tffield_3.files* is written such that the
DDB file is named *tffield_2o_DS3_DDB* (this is defined in the third line of
*tffield_3.files*). In the event of a mismatch, you can either edit
*tffield_3.files* to match the DDB you have, or change the name of the DDB
file.
Note that *tffield_3.files* is expecting the DDB
to be named *tffield_2o_DS3_DDB*, so either adjust *tffield_x.files* before
running *tffield_2.abi* to match this, or else change the name of the DDB file
after generation.
The DFPT calculation yields the following
piezoelectric constants, as found in
*tffield_3.abo*:
```
Proper piezoelectric constants (clamped ion) (unit:c/m^2)
In any case, the DFPT calculation gives for the
piezoelectric constants (as well as the elastic constants), as found in
*tffield_3.out*, the following:
0.00000000 -0.00000000 0.00000000
0.00000000 0.00000000 0.00000000
-0.00000000 -0.00000000 -0.00000000
-0.64263948 0.00000000 0.00000000
0.00000000 -0.64263948 0.00000000
0.00000000 0.00000000 -0.64263948
....
Proper piezoelectric constants (relaxed ion) (unit:c/m^2)
Proper piezoelectric constants (clamped ion) (unit:c/m^2)
...
-0.64879283 0.00000000 0.00000000
...
Proper piezoelectric constants (relaxed ion) (unit:c/m^2)
...
0.04575010 0.00000000 0.00000000
0.00000000 0.00000000 -0.00000000
0.00000000 -0.00000000 -0.00000000
0.00000000 -0.00000000 -0.00000000
0.13114427 0.00000000 -0.00000000
0.00000000 0.13114427 -0.00000000
-0.00000000 -0.00000000 0.13114427
```
{% dialog tests/tutorespfn/Refs/tffield_3.abo %}
{% dialog tests/tutorespfn/Refs/tffield_3.out %}
The piezoelectric constants here are the change in polarization as a function
of strain [[cite:Wu2005]]. The rows are the strain directions using Voigt
notation (directions 1-6) while the columns are the polarization directions. In the
$\bar{4}3m$ crystal class of AlP, the only non-zero piezoelectric elements
are those associated with shear strain (Voigt notation strains $e_4$, $e_5$,
and $e_6$) [[cite:Nye1985]].
Restarting case ffield_2 and ffield_3 with [[ecut]]=5
(three minutes on a PC 3 GHz), one gets the following values
The relaxed ion values, where the ionic relaxation largely suppresses the electronic
piezoelectricity, will be more difficult to converge than the clamped ion result.
Proper piezoelectric constants (clamped ion) (unit:c/m^2)
...
-0.68377667 0.00000000 0.00000000
...
Proper piezoelectric constants (relaxed ion) (unit:c/m^2)
...
0.03384772 0.00000000 0.00000000
The latter value, where the ionic relaxation largely suppresses the electronic
piezoelectricity, will be much more difficult to converge than the clamped ion result.
Using the Berry phase approach it is also possible to compute the
piezoelectric constant from finite difference of polarization with respect to strains.
Because the Berry phase approach computes polarization, it can also be used to compute the
piezoelectric constants from finite difference of polarization with respect to strains.
This can be done considering clamped ions or relaxed ions configurations.
For this purpose, have a look at the files
*tffield_4.abi* (clamped ions) and *tffield_5.abi* (relaxed ions).
{% dialog tests/tutorespfn/Input/tffield_4.abi tests/tutorespfn/Input/tffield_5.abi %}
In these input files the finite strain is applied by multiplying the $e_4$ (Voigt notation)
strain tensor by the (dimensionless) unit cell vectors:
$$
\left[\begin{matrix}
1 & 0 & 0 \\\
0 & 1 & e_4/2 \\\
0 & e_4/2 & 1 \\\
\end{matrix}\right]
\left[\begin{matrix}
0 & 1/\sqrt{2} & 1/\sqrt{2} \\\
1/\sqrt{2} & 0 & 1/\sqrt{2} \\\
1/\sqrt{2} & 1/\sqrt{2} & 0 \\\
\end{matrix}\right]
=
\left[\begin{matrix}
0 & 1/\sqrt{2} & 1/\sqrt{2} \\\
(1+e_4/2)/\sqrt{2} & e_4/2\sqrt{2} & 1/\sqrt{2} \\\
(1+e_4/2)/\sqrt{2} & 1/\sqrt{2} & e_4/2\sqrt{2} \\\
\end{matrix}\right]
$$
Don't forget that in the input file, vectors are read in as rows of numbers, not columns!
Notice how in the relaxed ion case, the input file includes [[ionmov]] = 2 and [[optcell]] = 0, in
order to relax the ion positions at fixed cell geometry. These calculations
should give the following final results (obtained by taking finite difference
expressions of the strains for different electric fields)
expressions of the strains for different electric fields):
$-0.6427~C/m^2$ for the clamped ion case, and $0.1310~C/m^2$ for the relaxed ion case.
Proper piezoelectric constants(clamped ion)(Unit:c/m^2) = -0.6491
Proper piezoelectric constants(relaxed ion)(Unit:c/m^2) = 0.0430
For example, the clamped ion piezoelectric constant was obtained from *tffield_4.out*:
Polarization in cartesian coordinates (C/m^2):
(the sum of the electronic and ionic Berry phase has been folded into [-1, 1])
Electronic berry phase: -0.230210983E-02 0.421672896E-02 0.421672896E-02
Ionic: -0.154692152E+01 -0.155466099E+01 -0.155466099E+01
Total: -0.154922363E+01 -0.155044426E+01 -0.155044426E+01
and
Polarization in cartesian coordinates (C/m^2):
(the sum of the electronic and ionic Berry phase has been folded into [-1, 1])
Electronic berry phase: 0.106813038E-01 0.417466770E-02 0.417466770E-02
Ionic: -0.154692152E+01 -0.153919172E+01 -0.153919172E+01
Total: -0.153624022E+01 -0.153501706E+01 -0.153501706E+01
The difference between -0.154922363E+01 (x-strain is +0.01) and
-0.153624022E+01 (x-strain is -0.01) gives the finite difference -0.012983,
that, divided by 0.02 (the change of strain) gives -0.6491, announced above.
Using to [[ecut]] = 5 gives
Proper piezoelectric constants(clamped ion)(Unit:c/m^2) = -0.6841215
Proper piezoelectric constants(relaxed ion)(Unit:c/m^2) = 0.0313915
in excellent agreement with the above-mentioned DFPT values.
For example, the clamped ion piezoelectric constant was obtained from *tffield_4.abo*:
```
== DATASET 2 ==========================================================
....
Polarization in cartesian coordinates (C/m^2):
Total: -0.162420887E+01 -0.162587046E+01 -0.162587046E+01
....
== DATASET 3 ==========================================================
...
Polarization in cartesian coordinates (C/m^2):
Total: -0.161135421E+01 -0.160969264E+01 -0.160969264E+01
```
The difference between -0.162420887E+01 (obtained at strain +0.01) and
-0.161135421E+01 (obtained at train -0.01) gives the finite difference -0.0128546,
which, divided by 0.02 (the total change in strain) gives -0.6427, as noted above.
## 3 Finite electric field calculations
In this section, you will learn how to perform a calculation with a finite electric field.
You can now copy the file *\$ABI_TESTS/tutorespfn/Input/tffield_6.abi* in *Work_ffield*,
and modify the *tffield_x.files* accordingly.
You can now copy the file *\$ABI_TESTS/tutorespfn/Input/tffield_6.abi* to *Work_ffield*.
{% dialog tests/tutorespfn/Input/tffield_6.abi %}
You can start the run immediately, it will take one minute on a PC 3GHz.
You can start the run immediately.
It performs a finite field calculation at clamped atomic positions. You can look at this input file to
identify the features specific to the finite field calculation.
@ -356,7 +380,8 @@ As general parameters, one has to specify [[nband]], [[nbdbuf]] and [[kptopt]]:
kptopt 1
As a first step (dataset 11), the code must perform a Berry phase calculation
in zero field. For that purpose, it is necessary to set the values of [[berryopt]] and [[rfdir]]:
in zero electric field. For that purpose,
it is necessary to set the values of [[berryopt]] and [[rfdir]]:
berryopt11 -1
rfdir11 1 1 1
@ -366,9 +391,9 @@ in zero field. For that purpose, it is necessary to set the values of [[berryopt
You cannot use berryopt to +1 to initiate a finite field calculation.
You must begin with berryopt -1.
After that, there are different steps corresponding to various value of the
electric field, thanks to [[efield]]. For those steps, it is important to take
care of the following parameters, shown here for dataset 21:
After that, there are different steps corresponding to various values of the
electric field, as set by [[efield]]. For those steps, it is important to take
care of the following parameters, as shown here for example for dataset 21:
berryopt21 4
efield21 0.0001 0.0001 0.0001
@ -377,7 +402,7 @@ care of the following parameters, shown here for dataset 21:
The electric field is applied here along the [111] direction. It must be
incremented step by step (it is not possible to go to high field directly). At
each step, the wavefunctions of the previous step must be used. When the field
gets larger, it is important to check that it does not significantly exceed
gets large, it is important to check that it does not significantly exceed
the critical field for Zener breakthrough (the drop of potential over the
Born-von Karmann supercell must be smaller than the gap). In practice, the
number of k-point must be enlarged to reach convergence. However, at the same
@ -385,46 +410,46 @@ time, the critical field becomes smaller. In practice, reasonable fields can
still be reached for k-point grids providing a reasonable degree of
convergence. A compromise must however be found.
As these calculations are quite long, the input file has been limited to very
As these calculations are quite long, the input file has been limited to a small
number of
small fields. Three cases have been selected: $E = 0$, $E = +0.0001$ and $E = -0.0001$.
If you have time later, you can relax this constraint and perform a
more exhaustive calculations for a larger set of fields.
If you have time later, you can perform
more exhaustive calculations over a larger set of fields.
You can now start the run. Various quantities can be extracted from the finite
Various quantities can be extracted from the finite
field calculation at clamped ions using finite difference techniques: the Born
effective charge $Z^*$ can be extracted from the forces, the optical dielectric
constant can be deduced from the polarization, and the clamped ion
piezoelectric tensor can be deduced from the stress tensor. As an illustration
effective charge $Z^*$ can be extracted from the difference in forces at
different electric fields, the optical dielectric
constant can be deduced from the polarizations at different fields,
and the clamped ion
piezoelectric tensor can be deduced from the stress tensor at different fields.
As an illustration
we will focus here on the computation of $Z^*$.
You can look at your output file. For each field, the file contains various
Examine the output file. For each field, the file contains various
quantities that can be collected. For the present purpose, we can look at the
evolution of the forces with the field and extract the following results from
the output file:
$E=0$
cartesian forces (hartree/bohr) at end:
1 0.00000000000000 0.00000000000000 0.00000000000000
2 0.00000000000000 0.00000000000000 0.00000000000000
```
cartesian forces (hartree/bohr) at end:
1 -0.00000000000000 -0.00000000000000 -0.00000000000000
2 -0.00000000000000 -0.00000000000000 -0.00000000000000
```
$E = +0.0001$
cartesian forces (hartree/bohr) at end:
1 0.00020614766286 0.00020614766286 0.00020614766286
2 -0.00020614766286 -0.00020614766286 -0.00020614766286
```
cartesian forces (hartree/bohr) at end:
1 -0.00022532204220 -0.00022532204220 -0.00022532204220
2 0.00022532204220 0.00022532204220 0.00022532204220
```
$E = -0.0001$
cartesian forces (hartree/bohr) at end:
1 -0.00020651242444 -0.00020651242444 -0.00020651242444
2 0.00020651242444 0.00020651242444 0.00020651242444
```
cartesian forces (hartree/bohr) at end:
1 0.00022548273033 0.00022548273033 0.00022548273033
2 -0.00022548273033 -0.00022548273033 -0.00022548273033
```
In a finite electric field, the force on atom $A$ in direction $i$ can be written as:
$$
F_{A,i} = Z^*_{A,ii}E + \Omega_0 \frac{d\chi}{d\tau} E^2
$$
@ -434,97 +459,103 @@ that the quadratic term is almost negligible. This clearly appears in the
figure below where the field dependence of the force for a larger range of
electric fields is plotted.
![](nlo_assets/image001.gif)
![](ffield_assets/tffield_6_for.png)
We can therefore extract with a good accuracy the Born effective charge as:
We can therefore extract with good accuracy the Born effective charge as:
$$
Z^*_{\mathrm Al} = \frac{F_{\mathrm Al}(E=+0.0001) - F_{\mathrm Al}(E=-0.0001)}{2\times 0.0001}
= \frac{(2.0615\times 10^{-4}) - (-2.0651\times 10^{-4})}{0.0002}
= 2.06
= \frac{(2.2532\times 10^{-4}) - (-2.2548\times 10^{-4})}{0.0002}
= 2.254.
$$
This value is similar to the value reported from DFPT. If you do calculations
for more electric fields, fitting them with the general expression of the
force above (including the $E^2$ term), you can find the $d\chi/d\tau$ term. At
[[ecut]] = 5 you should get $d\chi/d\tau$ for Al = -0.06169. This will be useful
later for the [tutorial on static Non-linear properties](nlo).
force above (including the $E^2$ term), you can find the $d\chi/d\tau$ term.
From the given input file *tffield_6.abi*, using all the fields,
you should find $d\chi/d\tau$ for Al of = -0.0295.
Going back to the output file, you can also look at the evolution of the
polarization with the field.
$E = 0$
Polarization in cartesian coordinates (a.u.):
(the sum of the electronic and ionic Berry phase has been folded into [-1, 1])
Electronic: 0.730822547E-04 0.730822547E-04 0.730822547E-04
Ionic: -0.270560574E-01 -0.270560574E-01 -0.270560574E-01
Total: -0.269829752E-01 -0.269829752E-01 -0.269829752E-01
```
Polarization in cartesian coordinates (a.u.):
Total: -0.282749182E-01 -0.282749182E-01 -0.282749182E-01
```
$E = +0.0001$
Polarization in cartesian coordinates (a.u.):
(the sum of the electronic and ionic Berry phase has been folded into [-1, 1])
Electronic: 0.129869845E-03 0.129869845E-03 0.129869844E-03
Ionic: -0.270560574E-01 -0.270560574E-01 -0.270560574E-01
Total: -0.269261876E-01 -0.269261876E-01 -0.269261876E-01
```
Polarization in cartesian coordinates (a.u.):
Total: -0.282310128E-01 -0.282310128E-01 -0.282310128E-01
```
$E = -0.0001$
Polarization in cartesian coordinates (a.u.):
(the sum of the electronic and ionic Berry phase has been folded into [-1, 1])
Electronic: 0.163575018E-04 0.163575016E-04 0.163575014E-04
Ionic: -0.270560574E-01 -0.270560574E-01 -0.270560574E-01
Total: -0.270396999E-01 -0.270396999E-01 -0.270396999E-01
```
Polarization in cartesian coordinates (a.u.):
Total: -0.283187730E-01 -0.283187730E-01 -0.283187730E-01
```
In a finite electric field, the polarization in terms of the linear and
quadratic susceptibilities is:
quadratic susceptibilities is, in SI units,
$$
P_i = \chi^{(1)}_{ij} E_j + \chi^{(2)}_{ijk} E_jE_k
P_i = \epsilon_0\chi^{(1)}_{ij} E_j + \epsilon_0\chi^{(2)}_{ijk} E_jE_k
$$
or, in atomic units:
$$
P_i = \frac{1}{4\pi}\chi^{(1)}_{ij} E_j + \frac{1}{4\pi}\chi^{(2)}_{ijk} E_jE_k,
$$
as $4\pi\epsilon_0 = 1$ in atomic units.
The change of polarization for positive and negative fields above are nearly
the same, showing again that the quadratic term is almost negligible. This
clearly appears in the figure below where the field dependence of the
polarization for a larger range of electric fields is plotted.
![](ffield_assets/image004.gif)
![](ffield_assets/tffield_6_pol.png)
We can therefore extract with a good accuracy the linear optical dielectric susceptibility:
We can therefore extract the linear optical dielectric susceptibility:
$$
\chi_{11}^{(1)} = \frac{P_1(E=+0.0001) - P_1(E=-0.0001)}{2\times 0.0001}
= \frac{(-2.6926\times 10^{-2}) - (-2.70397\times 10^{-2})}{0.0002}
= 0.56756
\chi_{11}^{(1)} = 4\pi\frac{P_1(E=+0.0001) - P_1(E=-0.0001)}{2\times 0.0001}
= 4\pi\frac{(-2.82310\times 10^{-2}) - (-2.83188\times 10^{-2})}{0.0002}
= 5.5166.
$$
The optical dielectric constant is:
The relative permittivity, also known as the dielectric constant, is
$$
\epsilon_{11} = 1+ 4 \pi \chi^{(1)}_{11} = 8.13$$
\epsilon_{11}/\epsilon_0 = 1+ \chi^{(1)}_{11} = 6.5166.
$$
This value underestimates the value of 9.20 obtained by DFPT. The agreement is
not better at [[ecut]] = 5. Typically, finite field calculations converge with
This value is a bit over the value of 6.463 obtained by DFPT from *tffield_3.abi*.
Typically, finite field calculations converge with
the density of the k point grid more slowly than DFPT calculations.
If you do calculations for more electric fields, fitting them with the general
expression of the force above (including the $E^2$ term) you can find the non-
linear optical susceptibilities $\chi^{(2)}$. At [[ecut]]=5 you should get
$\chi^{(2)} = 29.769~\mathrm{pm/V}$.
This result will be also be useful for the [tutorial on static Non-linear properties](nlo).
expression of the polarization above (including the $E^2$ term) you can find the non-
linear optical susceptibility $\chi^{(2)}/4\pi$ (in atomic units).
For *tffield_6.abi* you should find $\chi^{(2)}/4\pi = 2.5427$, so
in SI units $\chi^{(2)} = 62.14~\mathrm{pm/V}$ and $d_{36} = 15.54~\mathrm{pm/V}$.
The relationship between the $\chi^{(2)}_{ijk}$ tensor and the $d_{ij}$ tensor (the
quantity reported by `abinit` in a nonlinear optics DFPT computation) involves
a variety of symmetries and is explained in detail in the book [[cite:Boyd2020]].
Looking at the evolution of the stress (see graphic below), you should also be
Looking at the evolution of the stress with electric field (see graphic below), you should also be
able to extract the piezoelectric constants. You can try to do it as an
exercise. As the calculation here was at clamped ions, you will get the
clamped ion proper piezoelectric constants. At [[ecut]] = 5, you should
obtain -0.69088 C/m$^2$.
clamped ion proper piezoelectric constants. You should
obtain -0.6365 C/m$^2$. The relationships between the various response functions under
conditions of strain, stress, field, and so forth are discussed in depth in
[[cite:Wu2005]].
![](ffield_assets/image007.gif)
![](ffield_assets/tffield_6_stress.png)
Redoing the same kind of finite field calculation when allowing the ions to
relax, one can access the relaxed ion proper piezoelectric constant.
At [[ecut]] = 5 the result is -0.03259 C/m$^2$.
You can modify the previous input file to perform a finite field
calculation combined with ion relaxation, similarly to how
*tffield_5.abi* was modified from *tffield_4.abi*, giving access to the
the relaxed ion proper piezoelectric constant.
From the output of this run, analyzing the results in the same way as before,
you should obtain 0.1311 C/m$^2$ for the relaxed ion piezoelectric constant.

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.7 KiB

View File

@ -87,31 +87,31 @@ In this tutorial, we will take as an example of a material without lattice insta
The file ~abinit/tests/tutomultibinit/Input/tmulti1_1.files lists the file names and root names.
You can copy it in the **Work_latticeModel** directory and look at this file content, you should see:
tutomulti1_1.in
tutomulti1_1.out
tutomulti1_1.abi
tutomulti1_1.abo
tmulti1_DDB
As mentioned in the guide of [[help:multibinit | MULTIBINIT]]:
* "tutomulti1_1.in" is the main input file
* "tutomulti1_1.out" is the main output
* "tutomulti1_1.abi" is the main input file
* "tutomulti1_1.abo" is the main output
* "tmulti1_DDB" is the DDB which contains the system definition and the list of the energy derivatives
It is now time to copy the file ~abinit/tests/tutomultibinit/Input/tmulti1_DDB and ~abinit/tests/tutomultibinit/Input/tmulti1_DDB in your **Work_latticeModel** directory.
You should read carefully the input file:
{% dialog tests/tutomultibinit/Input/tmulti1_1.in %}
{% dialog tests/tutomultibinit/Input/tmulti1_1.abi %}
You should now run (it would take less than a second):
multibinit < tmulti1_1.files > tmulti1_1_stdout
The resulting output file, tmulti1_1.out, should be similar to the one below.
{% dialog tests/tutomultibinit/Refs/tmulti1_1.out %}
The resulting output file, tmulti1_1.abo, should be similar to the one below.
{% dialog tests/tutomultibinit/Refs/tmulti1_1.abo %}
The run you performed was aimed at reading the DDB file, generating the short range interatomic force constants and extract all the other informations related to the harmonic part of the model.
You can find inside the output file, the Born effective charges, the clamped-ion elastic tensor and the internal strain coupling parameters. Take some time to open and read the tmulti1_1.out file.
You can find inside the output file, the Born effective charges, the clamped-ion elastic tensor and the internal strain coupling parameters. Take some time to open and read the tmulti1_1.abo file.
If the DDB file is complete, the generation of the XML file requires only few input variables:
* [[multibinit:prt_model]] = 1 $\Longrightarrow$ the generation of the XML file is activated, takes the time to read the possible options for [[multibinit:prt_model]].
@ -122,25 +122,25 @@ After this run, you should see in your directory tmulti1_1_model.xml, you can ta
Your XML file is now ready and you can use it as input for MULTIBINIT. To do that, copy now in your work directory the file ~abinit/tests/tutomultibinit/Input/tmulti1_2.files; you should see inside it:
tutomulti1_2.in
tutomulti1_2.out
tutomulti1_2.abi
tutomulti1_2.abo
tmulti1_1_model.xml
Here, the DDB file is replaced by the XML file. Do not forget to copy the ~abinit/tests/tutomultibinit/Input/tutomulti1_2.in in your directory before you run:
Here, the DDB file is replaced by the XML file. Do not forget to copy the ~abinit/tests/tutomultibinit/Input/tutomulti1_2.abi in your directory before you run:
multibinit < tmulti1_2.files > tmulti1_2_stdout
In tutomulti1_2.in, [[multibinit:prt_model]] is still set to one so multibinit will write again the model XML file, which is useless at this stage, being a copy of the one read as input. Set this input variable to 0 and, in this case, MULTIBINIT will just read (and not write) the XML file.
In tutomulti1_2.abi, [[multibinit:prt_model]] is still set to one so multibinit will write again the model XML file, which is useless at this stage, being a copy of the one read as input. Set this input variable to 0 and, in this case, MULTIBINIT will just read (and not write) the XML file.
With the two last examples, we have shown that MULTIBINIT is able to read either a DDB file or a XML as inputs for the system definition and the harmonic part of the potential.
We can now run our *first dynamics*: you can copy the files ~abinit/tests/tutomultibinit/Input/tutomulti1_3.* in your work directly and have a look them.
{% dialog tests/tutomultibinit/Input/tmulti1_3.in %}
{% dialog tests/tutomultibinit/Input/tmulti1_3.abi %}
The simulation starts from the DDB to correctly account for the dipole-dipole interactions. You can visualize your dynamics with the agate software:
agate tmulti1_3.out_HIST.nc
agate tmulti1_3.abo_HIST.nc
Also try to use the effective potential from the xml file instead, in which the dipole-dipole interactions were not corrected. What do you see when you visualize the track?

View File

@ -1,230 +1,246 @@
---
authors: PhG, MVeithen, XG, NAP
authors: JWZ, PhG, MVeithen, XG, NAP
---
# Tutorial on static non-linear properties
## Electronic non-linear susceptibility, non-resonant Raman tensor, electro-optic effect.
This tutorial aims at showing how to get the following non-linear physical properties, for an insulator:
This tutorial shows how to obtain the following non-linear physical properties, for an insulator:
* The non-linear optical susceptibilities
* The Raman tensor of TO and LO modes
* The electro-optic coefficients
We will work on AlAs. During the preliminary steps needed to compute
non-linear properties, one will also obtain several linear response properties:
We will study the compound AlP. During the preliminary steps needed to compute
non-linear properties, we will also obtain several linear response properties:
* The Born effective charges
* The dielectric constant
* The proper piezoelectric tensor (clamped and relaxed ions)
Finally, we will also compute the derivative of the susceptibility tensor with
respect to atomic positions (Raman tensor) thanks to finite differences.
respect to atomic positions (Raman tensor), using finite differences.
The user should have already passed through several advanced tutorials of the
tutorial: the [tutorial Response-Function 1](rf1), the [tutorial Response-Function 2](rf2),
the [tutorial on Polarization and finite electric field](ffield), and the
[tutorial on Elastic properties](elastic).
The user should have already completed several advanced tutorials, including:
[Response-Function 1](rf1), [Response-Function 2](rf2),
[Polarization and Finite electric fields](ffield), and the
[Elastic properties](elastic).
This tutorial should take about 1 hour and 30 minutes.
[TUTORIAL_READMEV9]
## 1 Ground-state properties of AlAs and general parameters
## 1 Ground-state properties of AlP and general parameters
*Before beginning, you might consider to work in a different subdirectory as for the other tutorials.
Why not create Work-NLO in \$ABI_TESTS/tutorespfn/Input?*
*Before beginning, you might consider working in a different subdirectory, as for the other tutorials.
For example, create Work_NLO in \$ABI_TESTS/tutorespfn/Input*.
In order to save some time, you might immediately start running a calculation.
Copy the file *tnlo_2.in* from *\$ABI_TESTS/tutorespfn/Input* to *Work-NLO*. Copy also
*tnlo_x.files* in *Work-NLO*, and modify it so that
all occurrences of tnlo_x are replaced by tnlo_2, then run abinit with these
data. This calculation might be one or two minutes on a PC 3GHz.
Copy the file *tnlo_2.abi* from *\$ABI_TESTS/tutorespfn/Input* to *Work_NLO*.
Run `abinit` on this file; it will take several minutes on a desktop PC.
In this tutorial we will assume that the ground-state properties of AlAs have
In this tutorial we will assume that the ground-state properties of AlP have
been previously obtained, and that the corresponding convergence studies have
been done. Let us emphasize that, from our experience, accurate and trustable
results for third order energy derivatives usually require a extremely high
level of convergence. So, even if it is not always very apparent here, careful
convergence studies must be explicitly performed in any practical study you
could start after this tutorial. As usual, convergence tests must be done on
the property of interest (i.e. it is wrong to determine parameters giving
proper convergence on the total energy, and to use them blindly for non-linear
properties)
attempt after this tutorial. As usual, convergence tests must be done on
the property of interest (thus it is insufficient to determine parameters giving
proper convergence only on the total energy, and to use them blindly for non-linear
properties).
We will adopt the following set of generic parameters (the same than in the
We will adopt the following set of generic parameters (quite similar to those
in the
[tutorial on Polarization and finite electric field](ffield)):
```
acell 3*7.1391127387E+00
rprim 0.0000000000E+00 7.0710678119E-01 7.0710678119E-01
7.0710678119E-01 0.0000000000E+00 7.0710678119E-01
7.0710678119E-01 7.0710678119E-01 0.0000000000E+00
ecut 2.8
ecutsm 0.5
dilatmx 1.05
nband 4 (=number of occupied bands)
ngkpt 6 6 6
nshiftk 4
shiftk 0.5 0.5 0.5
0.5 0.0 0.0
0.0 0.5 0.0
0.0 0.0 0.5
acell 10.53
ixc 3
ecut 2.8 (results with ecut = 5 are also reported
in the discussion)
ecutsm 0.5
dilatmx 1.05
nband 4 (=number of occupied bands)
nbdbuf 0
ngkpt 6 6 6
nshiftk 4
shiftk 0.5 0.5 0.5
0.5 0.0 0.0
0.0 0.5 0.0
0.0 0.0 0.5
pseudopotentials 13al.pspnc
33as.pspnc
pseudopotentials Pseudodojo_nc_sr_04_pw_standard_psp8/P.psp8
Pseudodojo_nc_sr_04_pw_standard_psp8/Al.psp8
```
In principle, the [[acell]] to be used should be the one corresponding to the
optimized structure at the [[ecut]], and [[ngkpt]] combined with [[nshiftk]]
and [[shiftk]], chosen for the calculations. Unfortunately, for the purpose of
this tutorial, in order to limit the duration of the runs, we have to work at
an unusually low cutoff of 2.8 Ha for which the optimized lattice constant is
unrealistic and equal to 7.45 Bohr (instead of the converged value of 10.64).
In what follows, the lattice constant has been arbitrarily fixed to 10.53
Bohr. For comparison, results with [[ecut]] = 5 are also reported and, in that
case, were obtained at the optimized lattice constant of 10.64 Bohr. For those
unrealistic and equal to 7.139 Bohr (instead of the converged value of 7.251).
In what follows, the lattice constant has been arbitrarily fixed to 7.139.
Bohr. For comparison, results with [[ecut]] = 5 and 30 are also reported and, in those
cases, were obtained at the optimized lattice constants of 7.273 and 7.251 Bohr. For those
who would like to try later, convergence tests and structural optimizations
can be done using the file *\$ABI_TESTS/tutorespfn/Input/tnlo_1.in*. Before
going further, you might refresh your mind concerning the other variables:
[[ixc]], [[ecutsm]], [[dilatmx]], [[nbdbuf]].
can be done using the file *\$ABI_TESTS/tutorespfn/Input/tnlo_1.abi*.
Before
going further, you might refresh your memory concerning the other variables:
[[ecutsm]], [[dilatmx]], and [[nbdbuf]].
## 2 Linear and non-linear responses from density functional perturbation theory (DFPT)
As a theoretical support to this section of the tutorial, you might consider
reading [[cite:Veithen2005]]:
reading [[cite:Veithen2005]].
In the first part of this tutorial, we will describe how to compute various
linear and non-linear responses directly connected to second-order and third-
order derivatives of the energy, using DFPT. From the (2n+1) theorem,
order derivatives of the energy, using DFPT. From the $(2n+1)$ theorem,
computation of energy derivatives up to third order only requires the
knowledge of the ground-state and first-order wavefunctions, see
[[cite:Gonze1989]] and [[cite:Gonze1995]].
Our study will therefore include the following steps : (i) resolution
of the ground-state problem, (ii) determination of the first-order
Our study will therefore include the following steps : (i) computation of the
ground-state wavefunctions and density; (ii) determination of the first-order
wavefunctions and construction of the related databases for second and third-
order energy derivatives, (iii) combination of the different databases and
analysis to get the physical properties of interest.
This is closely related to what was done for the dielectric and dynamical
These steps are closely related to what was done for the dielectric and dynamical
properties, except that an additional database for third-order energy
derivatives will now be set up during the run. Only selected third-order
derivatives are implemented at this stage and concern responses to electric
derivatives will now be computed during the run. Only selected third-order
derivatives are implemented at present in ABINIT, and concern responses to electric
field and atomic displacements:
* non-linear optical susceptibilities
(related to a third-order derivative of the energy with respect to electric fields at clamped nuclei positions)
(related to a third-order derivative of the energy
with respect to electric fields at clamped nuclei positions)
* Raman susceptibilities (mixed third-order derivative of the energy, twice with respect
to electric fields at clamped nuclei positions, and once with respect to atomic displacement)
* Electro-optic coefficients (related to a third-order derivative of the energy with respect to electric fields,
two of them being optical fields -clamped nuclei positions- and one of them being a static field -the ions are allowed to move-)
two of them being optical fields, that is, for clamped ionic positions, and one of them being a static field,
for which the ionic positions are allowed to relax)
Many different steps can be combined in one input file. For the sake of
clarity we have decomposed the calculation into individual inputs that are now described.
The various steps are combined into a single input file.
**Responses to electric fields and atomic displacements.**
Let us examine the file *tnlo_2.in*. Its purpose is to build databases for
second and third energy derivatives with respect to electric fields and atomic
displacements. You can edit it. It is made of 5 datasets. The first four data
sets are nearly the same as for a usual linear response calculation: (1)
self-consistent calculation in the IBZ; (2) non self-consistent calculations
to get the wave-functions over the full BZ; (3) ddk calculation, (4)
derivatives with respect to electric field and atomic displacements. Some
specific features must however be explicitly specified in order to prepare the
non-linear response step (dataset 5). First, from dataset 2 it is mandatory to specify:
nbdbuf 0
nband 4 (= number of valence bands)
**Responses to electric fields, atomic displacements, and strains.**
Let us examine the file *tnlo_2.abi*. Its purpose is to build databases for
second and third energy derivatives with respect to electric fields, atomic
displacements, and strains. You can edit it. It is made of 5 datasets. The first four data
sets are nearly the same as for a typical linear response calculation: (1)
a self-consistent calculation of the ground state in the irreducible Brillouin Zone;
(2) non self-consistent calculation of the ground state
to get the wavefunctions over the full Brillouin Zone; (3) Computation of the derivatives of the
wavefunctions with respect to k points, using DFPT; (4)
second derivatives of the energy and related first-order wavefunctions
with respect to electric field, atomic displacements, and strains; and
finally (5) the third derivative calculations. Some
specific features must however be explicitly specified in order to prepare for the
non-linear response step (dataset 5). First, in dataset 2 it is mandatory to specify:
```
nbdbuf 0
nband 4 (= number of valence bands)
```
so that only filled bands are treated.
Also, in dataset 4, it is required to impose [[prtden]], and [[prepanl]]
prtden4 1
prepanl4 1
The purpose for this is (i) to constrain [[kptopt]] = 2 even in the
```
prtden4 1
prepanl4 1
```
The purpose for [[prtden]] is to obtain the first order densities (in
addition to the first order wavefunctions). The purposes
of [[prepanl]] are (i) to constrain [[kptopt]] = 2 even in the
computation of phonons where ABINIT usually take advantages of symmetry
irrespective of kptopt and (ii) compute the electric field derivatives in the
3 directions of space, irrespective of the symmetry.
Note also that while the strain perturbation is not used in dataset 5, the information
it provides is necessary to obtain some of the relaxed ion properties that
will be examined later.
The input to dataset 5 trigger the various third-order derivatives to be
computed. This section includes the following:
```
getden5 1
get1den5 4
getwfk5 2
get1wf5 4
nband5 4
kptopt5 2
optdriver5 5
d3e_pert1_elfd5 1
d3e_pert1_phon5 1
d3e_pert1_atpol5 1 2
d3e_pert1_dir5 1 1 1
d3e_pert2_elfd5 1
d3e_pert2_dir5 1 1 1
d3e_pert3_elfd5 1
d3e_pert3_dir5 1 1 1
```
The first four lines retrieve the ground state and first-order densities and wavefunctions.
[[optdriver]] 5 triggers the 3rd-order energy calculation. Finally, the `d3e` input
variables determine the 3 perturbations of the 3rd order derivatives, and their
directions. Notice that we compute three derivatives with respect to electric field:
[[d3e_pert1_elfd]], [[d3e_pert2_elfd]], and [[d3e_pert3_elfd]]. These will be combined
to give the necessary data for the nonlinear optical susceptibility. We also
include [[d3e_pert1_phon]], for both atoms in the unit cell ([[d3e_pert1_atpol]]). When combined
later with the electric field perturbations 2 and 3, this will yield the necessary
information for the Raman tensor. Finally, for all three perturbation classes, we compute
the perturbations in all three spatial directions.
If it was not done at the beginning of this tutorial, you can now make the
run. You can have a quick look to the output file to verify that everything is
OK. It contains the values of second and third energy derivatives. It has
however no immediate interest since the information is not presented in a very
convenient format. The relevant information is in fact also stored in the
database files (DDB) generated independently for second and third energy
derivatives at the end of run steps 4 and 5. Keep these databases that will be
derivatives at the end of run steps 4 and 5. Keep these databases, as they will be
used later for a global and convenient analysis of the results using ANADDB.
**Responses to strain.** We combine the above-mentioned computation of the
response to electric field and atomic displacements with the response to
strain. This is not at all mandatory for the computation of the presently
accessible non-linear response coefficients. However, this was used in
[[cite:Veithen2005]], already mentioned,
to add corrections corresponding to
free boundary conditions, thanks to a further finite difference calculation on
top of linear response calculations. The DFPT implementation of the
computation of this correction is not available at present.
You can now copy the file *\$ABI_TESTS/tutorespfn/Input/tnlo_3.in* in *Work-NLO*,
and modify the *tnlo_x.files* accordingly (or create a file *tnlo_3.files* -
in any case, this new file should contain tnlo_3 instead of tnlo_x or tnlo_2).
You can launch the calculation, it might last about 1 minute on a PC 3 GHz.
The purpose of this run is to build databases for second energy derivatives
with respect to strains. You can edit tnlo_3.in . It is made of 4 datasets:
(1) self-consistent calculation in the IBZ; (2) non self-consistent
calculations to get the wave-functions over the full BZ; (3) ddk calculation;
(4) strain perturbation. The ddk calculations has been included in order to
access to the piezoelectric tensor.
You can have a quick look to the output *tnlo_3.out*, when it is ready. It
contains rigid ions elastic and piezoelectric constants as well as the
internal strain coupling parameters. This information is also stored in a
database file (DDB) for further convenient analysis with ANADDB.
**Merge of the DDB.**
At this stage, all the relevant energy derivatives have been obtained and are
stored in individual databases. These must be combined with the MRGDDB merge
utility in order to get a unique database *tnlo_4.ddb.out*. Explicitely, you
should merge the files *tnlo_2o_DS4_DDB*, *tnlo_3o_DS4_DDB*, and *tnlo_2o_DS5_DDB*.
You might have a look at the input file for MRGDDB named *tnlo_4.in*, and use
it to perform the merge. You already used MRGDDB previously. It might be
located in *\$ABI_HOME/src/98_main* or another (build) directory.
You might copy it, or make an alias.
stored in individual databases. These must be combined with the
[[help:mrgddb|MRGDDB]] merge
utility in order to get a complete database *tnlo_3.ddb.out*. Explicitly, you
should merge the files *tnlo_2o_DS4_DDB* and *tnlo_2o_DS5_DDB*.
An input file that can be piped into MRGDDB is provided as *tnlo_3.abi*. You
can use it to perform the merge via *\$ABI_HOME/src/98_main/mrgddb < tnlo_3.abi*.
**Analysis of the DDB.**
We are now ready for the analysis of the results using ANADDB. You can copy
the files *\$ABI_TESTS/tutorespfn/Input/tnlo_5.in* and
*\$ABI_TESTS/tutorespfn/Input/tnlo_5.files* in *Work-NLO*. You already used
ANADDB previously. It is located in the same directory as *abinit*.
We are now ready for the analysis of the results using [[help:anaddb|ANADDB]]. You can copy
the files *\$ABI_TESTS/tutorespfn/Input/tnlo_4.abi* and
*\$ABI_TESTS/tutorespfn/Input/tnlo_4.files* to *Work-NLO*. You already used
ANADDB previously. It is located in the same directory as *abinit* and *mrgddb*.
You might copy it, or make an alias. The present input is in
principle very similar to the one you have used for the analysis of dynamical
very similar to the one you have used for the analysis of dynamical
and dielectric responses except that some new flags need to be activated.
For the strain perturbation you need to specify [[anaddb:elaflag]], [[anaddb:piezoflag]], and [[anaddb:instrflag]]:
elaflag 3
piezoflag 3
instrflag 1
```
elaflag 3
piezoflag 3
instrflag 1
```
For the non-linear responses you need
nlflag 1
ramansr 1
alphon 1
prtmbm 1
```
nlflag 1
ramansr 1
alphon 1
prtmbm 1
```
[[anaddb:nlflag]]=1 activates the non-linear response.
[[anaddb:ramansr]] = 1 will impose the sum rule on the first-order change of the
electronic dielectric susceptibility under atomic displacement, hereafter
referred to as $\frac{d \chi}{d \tau}$. It is a condition of invariance of chi under
referred to as $\frac{d \chi}{d \tau}$. It is a condition of invariance of $\chi$ under
translation of the whole crystal, similar to the acoustic sum rules for
phonons at Gamma or the charge neutrality sum rule on Z*.
phonons at Gamma or the charge neutrality sum rule on the effective charge $Z^*$.
[[anaddb:prtmbm]]=1 will allow to get the mode by mode phonon contributions of
the ions to the electro-optic coefficients.
@ -235,235 +251,285 @@ input, the principal axis should always be aligned with z for a convenient
analysis of the results).
Finally, the second list of phonon, specified with [[anaddb:nph2l]] and
[[anaddb:qph2l]], must also be explicitely considered to obtain the Raman
[[anaddb:qph2l]], must also be explicitly considered to obtain the Raman
efficiencies of longitudinal modes (in a way similar to the computation of
frequencies of longitudinal mode frequencies at Gamma):
# Wave vector list no. 2
#***********************
nph2l 1
qph2l 1.0 0.0 0.0 0.0
You can now run the code ANADDB. The results are in the file tnlo_5.out.
```
# Wave vector list no. 2
#***********************
nph2l 1
qph2l 1.0 0.0 0.0 0.0
```
You can now run the code `anaddb` as
*\$ABI_HOME/src/98_main/anaddb < tnlo_4.files*.
The results are in the file tnlo_4.out.
Various interesting physical properties are now directly accessible in this
output in meaningful units. You can go through the file and look in order to
identify the results mention hereafter. Note that the order in which they are
output in meaningful units. You can go through the file and
identify the results mentioned below. Note that the order in which they are
given below is not the same than the order in which they appear in the
tnlo_5.out. You will have to jump between different sections of tnlo_5.out to find them.
tnlo_4.out. You will have to jump between different sections of tnlo_4.out to find them.
For comparison, we report in parenthesis (...) the values obtained with ecut =
5, and for nonlinear responses in brackets [...] the fully converged result as
reported in [[cite:Veithen2005]].
5, and for nonlinear responses in brackets [...] the results from [[cite:Veithen2005]].
* Born effective charge of Al:
Z*_Al = 2.043399E+00 (2.105999E+00)
```
Z*_Al = 2.207969 (2.233928)
```
* Optical phonon frequencies at Gamma :
w_TO (cm^-1) = 3.694366E+02 (3.602635E+02)
w_LO (cm^-1) = 4.031189E+02 (3.931598E+02)
```
w_TO (cm^-1) = 463.2713 (417.4934)
w_LO (cm^-1) = 534.6882 (493.4411)
```
* Linear optical dielectric constant :
Electronic dielectric tensor = 9.20199931 (9.94846084)
```
Electronic dielectric tensor = 6.12216718 (6.10643103)
```
* Static dielectric constant :
relaxed ion dielectric tensor = 10.95642097 (11.84823634)
Some other quantities, as the piezoelectric coefficients, are related to the
strain response as it is more extensively discussed in the tutorial on the strain perturbation.
```
Relaxed ion dielectric tensor = 8.15521897 (8.53019279)
```
Some other quantities, such as the piezoelectric coefficients, are related to the
strain response, and are more extensively discussed in the tutorial on the strain perturbation.
* Proper piezoelectric coefficients :
clamped ion (Unit:c/m^2) = -0.65029623 (-0.69401363)
relaxed ion (Unit:c/m^2) = 0.03754602 (-0.04228777)
```
clamped ion (C/m^2) = -0.58864089 (-0.58710170)
relaxed ion (C/m^2) = 0.26741085 ( 0.11459002)
```
Finally, different quantities are related to non-linear responses.
* Nonlinear optical susceptibility :
They are directly provided in the output in pm/V. As you can see the value
computed here is far from the well converged result as reported in
[[cite:Veithen2005]].
d_36 (pm/V) = 21.175523 (32.772254) [fully converged :35]
computed here at ecut = 2.8 is far from the well converged result.
```
d_36 (pm/V) = 8.934453 (10.174996) [21]
```
* Electro-optic coefficients:
As we asked for mode by mode decomposition the output provides individual
contributions. We report below a summary of the results. It concern the
contributions. We report below a summary of the results. They concern the
clamped r_63 coefficient.
Electronic EO constant (pm/V): -1.000298285 (-1.324507791) [-1.69]
Full Ionic EO constant (pm/V): 0.543837671 (0.533097548) [0.64]
Total EO constant (pm/V): -0.456460614 (-0.791410242) [-1.05]
```
Electronic EO constant (pm/V): -0.953493194 (-1.091488899)
Full Ionic EO constant (pm/V): 0.536131045 ( 0.662692165)
Total EO constant (pm/V): -0.417362150 (-0.428796933)
```
* Raman properties
The code directly report the Raman susceptibilities for both transverse (TO)
The code directly report the Raman susceptibilities $\alpha$ for both transverse (TO)
and longitudinal (LO) optic modes at Gamma:
```
alpha(TO) = 0.004315217 (0.004379774)
alpha(LO) = 0.006863765 (0.007243040)
```
alpha(TO) = -0.008489212 (-0.009114814)
alpha(LO) = -0.011466211 (-0.013439375)
The basic quantity to get the Raman susceptibilities are the $\frac{d \chi}{d \tau}$ that
The basic quantity to derive the Raman susceptibilities are the $\partial\chi/\partial\tau$ that
are also reported separately:
```
d chi_23/d tau_1 (Bohr^-1, Al) = -0.043617186 (-0.043054192)
```
dchi_23/dtau_1 (Bohr^-1) of Al = -0.094488281 (-0.099889084)
In cubic semiconductors, it is usual to report the Raman polarizability of
optical phonon modes at Gamma which is defined as
a = Omega_0 * dchi/dtau = Sqrt[mu * Omega_0] alpha
where Omega_0 is the primitive unit cell volume (i.e. one quarter of the cubic
unit cell volume, to be expressed here in Ang) and mu is the reduced mass of
the system (1/mu = 1/m_Al + 1/m_As). From the previous data, we get :
a(TO) (Unit: Ang^2)= -7.7233 (-8.4222112) [-8.48]
a(LO) (Unit: Ang^2)= -10.4317 (-12.418168) [-12.48]
In *cubic semiconductors* it is common to report the Raman polarizability of
optical phonon modes at Gamma by the following expression [[cite:Veithen2005]]:
$$
a = \Omega_0 \partial\chi/\partial\tau = \sqrt{\mu \Omega_0}\alpha
$$
where $\Omega_0$ is the primitive unit cell volume (reported as `ucvol` in for
example *tnlo_2.abo*),
$\mu$ the reduced mass of
the system, so here $1/\mu = 1/m_{Al} + 1/m_{P}$, and $\alpha$ the Raman susceptibility
tensor. The Raman polarizability $a$ has units of length$^2$. Using alpha(TO) and
alpha(LO) from above, along with $\mu$ and $\Omega_0$, all in atomic units, and then
converting length (Bohr) to Angstroms, we find:
```
a(TO) (Unit: Ang^2)= 3.1424 (3.2794) [4.30]
a(LO) (Unit: Ang^2)= 4.9983 (5.4234) [7.46]
```
## 3 Finite difference calculation of the Raman tensor
For comparison with the DPFT calculation, we can compute $\frac{d \chi}{d \tau}$ for the Al
For comparison with the DFPT calculation, we can compute $\frac{d \chi}{d \tau}$ for the Al
nucleus from finite differences. In practice, this is achieved by computing
the linear optical susceptibility for 3 different positions of the Al nucleus.
This is done with the file *\$ABI_TESTS/tutorespfn/Input/tnlo_6.in*, however
with the unrealistic cutoff of 2.8 Ha. The calculation is about 2 or 3 minutes
on a PC 3 GHz). For those who want to do it you anyway, you can copy
*\$ABI_TESTS/tutorespfn/Input/tnlo_6.in* in your working directory. If you
have time, you should modify the cutoff to [[ecut]] = 5 Ha, in order to obtain
realistic results. So, you might as well start the run after this modification
(the run is about two times more time-consuming than with 2.8 Ha).
This is done with the file *\$ABI_TESTS/tutorespfn/Input/tnlo_5.abi*. This file
uses again the unrealistically low cutoff energy [[ecut]] of 2.8 Ha.
The calculation takes about 2 or 3 minutes on a standard desktop PC.
To run this calculation, copy
*\$ABI_TESTS/tutorespfn/Input/tnlo_5.abi* to your working directory and run
with `abinit`. If you have time,
modify the cutoff to [[ecut]] = 5 Ha, in order to obtain
more realistic results. This run will take about twice as along as the
2.8 Ha version.
You can have a look at this input file. It contains 8 datasets. We need to
compute the linear optical susceptibility (4 datasets for SC calculation in
the IBZ, NSC calculation in the full BZ, ddk, ddE) for different atomic
positions. We will do this for 2 sets of atomic positions, the reference
symmetric structure (referred to as tau=0), and a distorted structure
(referred to as tau= +0.01), for which the Al atom has been displaced to the
right by 0.01 Bohr (look at xcart to identify the differences). In the first
case, the dielectric tensor must be diagonal, isotropic, while in the second
case, a off-diagonal yz component will appear, that is an odd function of the
Al atomic displacement.
The input file *tnlo_5.abi* contains 12 datasets, arranged in a double loop.
```
ndtset 12
udtset 3 4
```
Input variable [[ndtset]] indicates 12 total sets, as usual, while
the [[udtset]] variable indicates an outer loop of 3 sets, and for each
of these, an inner loop of four sets.
Supposing you are running the calculation, you have now time for a Belgian
Beer, why not a Gouyasse ?! ... Or you can look at the results as summarized below.
The outer loop is over three sets of atomic positions, set by [[xcart]].
The first is the equilibrium, and the second two have aluminum shifted by
+0.01 and -0.01 Bohr along x:
```
# tau = 0.0 equilibrium
xcart1? 2.5240575146E+00 2.5240575146E+00 2.5240575146E+00
0.0000000000E+00 0.0000000000E+00 0.0000000000E+00
# tau = 0.01: aluminum shifted along x by 0.01 Bohr
xcart2? 2.5240575146E+00 2.5240575146E+00 2.5240575146E+00
0.0100000000E+00 0.0000000000E+00 0.0000000000E+00
# tau = -0.01: aluminum shifted along x by -0.01 Bohr
xcart3? 2.5240575146E+00 2.5240575146E+00 2.5240575146E+00
-0.0100000000E+00 0.0000000000E+00 0.0000000000E+00
```
Then for each of three sets of positions, a standard four-set DFPT
calculation of the electric field response at clamped ion positions
is executed: (1) ground state wavefunctions in the irreducible Brillouin
zone; (2) ground state wavefunctions in the full Brillouin zone; (3)
response to change in k vectors; and (4) response to the electric field,
yielding the dielectric tensor.
After running the calculation, the following is available in the output
file *tnlo_5.abo*. Quoted here are the results at [[ecut]] of 2.8.
For tau = 0:
```
Dielectric tensor, in cartesian coordinates,
j1 j2 matrix element
dir pert dir pert real part imaginary part
Dielectric tensor, in cartesian coordinates,
j1 j2 matrix element
dir pert dir pert real part imaginary part
1 4 1 4 6.1221671827 -0.0000000000
1 4 2 4 -0.0000000000 -0.0000000000
1 4 3 4 -0.0000000000 -0.0000000000
1 4 1 4 9.2020015668 -0.0000000000
1 4 2 4 0.0000000000 -0.0000000000
1 4 3 4 0.0000000000 -0.0000000000
2 4 1 4 0.0000000000 -0.0000000000
2 4 2 4 9.2020015668 -0.0000000000
2 4 3 4 0.0000000000 -0.0000000000
3 4 1 4 0.0000000000 -0.0000000000
3 4 2 4 0.0000000000 -0.0000000000
3 4 3 4 9.2020015668 -0.0000000000
2 4 1 4 -0.0000000000 -0.0000000000
2 4 2 4 6.1221671827 -0.0000000000
2 4 3 4 -0.0000000000 -0.0000000000
3 4 1 4 -0.0000000000 -0.0000000000
3 4 2 4 -0.0000000000 -0.0000000000
3 4 3 4 6.1221671827 -0.0000000000
```
For tau = +0.01 :
```
Dielectric tensor, in cartesian coordinates,
j1 j2 matrix element
dir pert dir pert real part imaginary part
Dielectric tensor, in cartesian coordinates,
j1 j2 matrix element
dir pert dir pert real part imaginary part
1 4 1 4 6.1223310904 -0.0000000000
1 4 2 4 -0.0000000000 -0.0000000000
1 4 3 4 -0.0000000000 -0.0000000000
1 4 1 4 9.2023220436 -0.0000000000
1 4 2 4 -0.0000000000 -0.0000000000
1 4 3 4 -0.0000000000 -0.0000000000
2 4 1 4 -0.0000000000 -0.0000000000
2 4 2 4 6.1222249248 -0.0000000000
2 4 3 4 -0.0055063835 -0.0000000000
2 4 1 4 -0.0000000000 -0.0000000000
2 4 2 4 9.2021443491 -0.0000000000
2 4 3 4 -0.0123700617 -0.0000000000
3 4 1 4 -0.0000000000 -0.0000000000
3 4 2 4 -0.0055063835 -0.0000000000
3 4 3 4 6.1222249248 -0.0000000000
```
For tau = -0.01 :
```
Dielectric tensor, in cartesian coordinates,
j1 j2 matrix element
dir pert dir pert real part imaginary part
3 4 1 4 -0.0000000000 -0.0000000000
3 4 2 4 -0.0123700617 -0.0000000000
3 4 3 4 9.2021443491 -0.0000000000
1 4 1 4 6.1223310830 -0.0000000000
1 4 2 4 -0.0000000000 -0.0000000000
1 4 3 4 -0.0000000000 -0.0000000000
Note that the following results would have been obtained for tau = -0.01 (with
obvious even / odd behaviour with respect to tau of the different components,
and some very small numerical noise):
Dielectric tensor, in cartesian coordinates,
j1 j2 matrix element
dir pert dir pert real part imaginary part
1 4 1 4 9.2023220610 -0.0000000000
1 4 2 4 -0.0000000000 -0.0000000000
1 4 3 4 0.0000000000 -0.0000000000
2 4 1 4 0.0000000000 -0.0000000000
2 4 2 4 9.2021443663 -0.0000000000
2 4 3 4 0.0123700529 -0.0000000000
3 4 1 4 0.0000000000 -0.0000000000
3 4 2 4 0.0123700529 -0.0000000000
3 4 3 4 9.2021443663 -0.0000000000
2 4 1 4 -0.0000000000 -0.0000000000
2 4 2 4 6.1222249159 -0.0000000000
2 4 3 4 0.0055063810 -0.0000000000
3 4 1 4 -0.0000000000 -0.0000000000
3 4 2 4 0.0055063810 -0.0000000000
3 4 3 4 6.1222249159 -0.0000000000
```
You can extract the value of dchi_23/dtau_1 for Al from the dielectric tensor
(hereafter called eps) above using the following finite-difference formula [unit of bohr^-1] :
dchi_23/dtau_1= (1/4 pi) (eps_23[tau=+0.01] +eps_23[tau=0.00])/tau
= (1/4 pi) (-0.0123700 -0.0)/(0.01)
= -0.098437
This value is close to that obtained at [[ecut]]=5 from DFPT (-0.099889084).
```
dchi_23/dtau_1= (1/4 pi) (eps_23[tau=+0.01] - eps_23[tau=-0.01])/2*tau
= (1/4 pi) (-0.0055063835 - 0.0055063810)/(0.02)
= -0.0438184
```
This value is close to that obtained at [[ecut]]=2.8 from DFPT (-0.043617186).
When convergence is reached (beware, the k point convergence is extremely
slow, much slower than for other properties), both approaches allow to get the
right answer. You might therefore ask which approach is the most convenient
slow, much slower than for other properties), both approaches yield the same result.
You might therefore ask which approach is the most convenient
and should be used in practice.
As a guide, we can mention that the finite-difference approach give results
As a guide, we note that the finite-difference approach give results
very similar to the DFPT ones for a similar cutoff and k-point grid. It is
however more tedious because, individual atomic displacement must be
successively considered (heavy for complex crystals) and the results must then
however more tedious because individual atomic displacement must be
successively considered (which becomes cumbersome for complex crystals)
and the results must then
be converted into appropriate units with risk of error of manipulations.
The DFPT approach is the most convenient and avoid a lot of human work.
Everything is reported together (not only $\frac{d \chi}{d \tau}$ but also the full Raman
The DFPT approach is the most convenient and avoids considerable operator intervention.
Everything is reported together (not only $d\chi / d\tau$ but also the full Raman
polarizability tensors) and in appropriate units. It should therefore be
considered as the best choice (when available, as in ABINIT).
considered as the better choice.
## Calculation of the Raman Spectra
AFter an ANADDB calculation, one can visualize the Raman spectra using the post-processing script Raman_spec.py (The script can be found in the post-processing scripts repository ( ~/scripts/post_processing/)). Take a moment to explore the help menu (try Raman_spec.py --help) and maybe look at a typical input file (Raman_spec.py --input). When you are done with that, execute the calculation:
python Raman_spec.py "input file name"
The ouptut of an ANADDB analysis, for example *tnlo_4.abo* as performed here, can be
used to plot a simulated Raman spectrum, including both peak positions and intensities,
which can be compared to experiment. Many details of the process are outlined in [[cite:Caracas2006]].
On a normal computer, this calculation may take several minutes.
A post-processing script, written in Python, is available in the ABINIT system:
see *$ABI_HOME/scripts/post_processing/Raman_spec.py*. This program reads an input file
that sets the ANADDB file to read, the output file base name, and various processing
parameters. To continue, we suggest copying this script into your working directory, or making
a link to it.
This python script reads the output file generated by your ANADDB calculation, extracts the Raman tensor and phonon frequencies, and calculates the polarization dependent and powder-averaged Raman spectra. All the calculated intensities (the 6 polarization dependent spectra and the powder-average spectra) are printed to a file.
Running *python Raman_spec.py --help* gives an outline of the input file format,
but don't be afraid to open and read the Raman_spec.py file itself for further details on the
file input.
As a start, here is a minimal input file to Raman_spec.py for the tnlo_4.abo run:
```
# filename from anaddb run that created raman tensors
filename tnlo_4.abo
We can view the Raman spectra with
# base name for Raman_spec.py output files
outname AlP.out
xmgrace *_spec.out
# temperature in Kelvin for spectrum
temp 298.0
The resulting powder-average spectra, plotted here with Gnuplot, is shown below. For the cubic structure calculated here, the resulting spectra contains a single Raman mode corresponding to an XY polarization.
# number frequencies (default is 1000, units of cm^-1)
n_freq 400
!!! tip
# min and max frequencies (default is 0.95 and 1.05 of
# bands found
min_freq 200.0
max_freq 800.0
![](nlo_assets/ramanspec_tnlo5_spec.pdf)
# Lorentzian broadening to apply
spread 1.0
A typical input file for the Raman_spec script contains the following variables
* filename - name of the ANADDB output file
* outname - uses specified output file name
* temp - temperature
* laser_freq - laser frequency
* freq_unit - output frequency (default cm$^{-1}$
* spread - spread of the Lorentzian (same for all modes)
* n_freq - number of output frequencies (default: 1000)
* min_freq - minimum frequency (default: 0.95 times the lowest active mode)
* max_freq - maximum frequency (default) 1.05 times the highest active mode)
* relative_intensity - plots the relative intensity (if present)
* keep_file - keep the output file, any existing file is removed (if present)
# calculation type: 1 is powder
calctype 1
```
You can copy this into an editor and save as for example *AlP.input*. Then execute
```
python Raman_spec.py AlP.input
```
Once complete, examine the various output files produced, which will all be named starting with AlP.out. They are all human readable
ASCII files and well-documented. For example, to visualize the powder spectrum of the TO mode
predicted by your ANADDB run, plot the first two
columns of AlP.out_spec, which give the frequencies and intensities of the powder-averaged Raman spectrum.
Finally, if one includes a calculation of the frequency dependent dielectric tensor during the ANADDB calculation, then this program extracts that dielectric tensor and prints it to its own file.
The resulting powder-average spectra, plotted here with Gnuplot, is shown below. For the cubic structure calculated here,
the resulting spectra contains a single Raman TO mode corresponding to an XY polarization.
![](nlo_assets/AlP-Raman-ecut-2.8.png)
Finally, if one includes a calculation of the frequency dependent dielectric tensor during the ANADDB calculation
(see [[anaddb:dieflag]]),
this program extracts that dielectric tensor and prints it to its own file.

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.1 KiB

View File

@ -1 +0,0 @@
<xml xmlns:o="urn:schemas-microsoft-com:office:office"> <o:MainFile HRef="::ABINIT-Tutorial_NLO.htm"/> <o:File HRef="image001.gif"/> <o:File HRef="image002.pct"/> <o:File HRef="image003.gif"/> <o:File HRef="image004.gif"/> <o:File HRef="image005.pct"/> <o:File HRef="image006.gif"/> <o:File HRef="image007.gif"/> <o:File HRef="image008.pct"/> <o:File HRef="image009.gif"/> <o:File HRef="filelist.xml"/> </xml>

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.4 KiB

Binary file not shown.

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.3 KiB

Binary file not shown.

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.3 KiB

Binary file not shown.

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.2 KiB

View File

@ -36,16 +36,12 @@ especially is quite sensitive to the details of the distribution at short
range, and so it is necessary to use the PAW formalism to compute the gradient
accurately. For charge density $n({\mathbf r})$, the potential $V$ is given
by
$$ V({\mathbf r})=\int \frac{n({\mathbf r'})}{ |\mathbf{r}-\mathbf{r'}| } d{\mathbf r'} $$
and the electric field gradient is
$$V_{ij} = -\frac{\partial^2}{\partial x_i\partial x_j}V({\mathbf r}).$$
$$ V_{ij} = -\frac{\partial^2}{\partial x_i\partial x_j}V({\mathbf r}). $$
The gradient is computed at each nuclear site, for each source of charge arising
from the PAW decomposition (see [the tutorial PAW1](paw1) ).
This is done in the code as follows:
This is done in the code as follows [[cite:Profeta2003]],[[cite:Zwanziger2008]]:
* Valence space described by planewaves: expression for gradient is Fourier-transformed at each nuclear site.
* Ion cores: gradient is computed by an Ewald sum method
@ -61,7 +57,7 @@ variables, only two additional variables are added:
prtefg 2
quadmom 0.0 -0.02558
{% dialog tests/tutorial/Input/tnuc_1.in %}
{% dialog tests/tutorial/Input/tnuc_1.abi %}
The first variable instructs Abinit to compute and print the electric field
gradient, and the second gives the quadrupole moments of the nuclei, in
@ -71,82 +67,79 @@ Here we are considering silicon and oxygen, and in
particular Si-29, which has zero quadrupole moment, and O-17, the only stable
isotope of oxygen with a non-zero quadrupole moment.
After running the file *tnuc_1.in* through Abinit, you can find the following
After running the file *tnuc_1.abi* through Abinit, you can find the following
near the end of the output file:
Electric Field Gradient Calculation
Electric Field Gradient Calculation
Atom 1, typat 1: Cq = 0.000000 MHz eta = 0.000000
efg eigval : -0.165960
- eigvec : -0.000001 -0.000001 -1.000000
efg eigval : -0.042510
- eigvec : 0.707107 -0.707107 0.000000
efg eigval : 0.208470
- eigvec : 0.707107 0.707107 -0.000002
total efg : 0.082980 0.125490 -0.000000
total efg : 0.125490 0.082980 -0.000000
total efg : -0.000000 -0.000000 -0.165960
Atom 1, typat 1: Cq = 0.000000 MHz eta = 0.000000
efg eigval : -0.169360
- eigvec : 0.000000 0.000000 1.000000
efg eigval : -0.043909
- eigvec : -0.707107 0.707107 0.000000
efg eigval : 0.213270
- eigvec : 0.707107 0.707107 0.000000
total efg : 0.084680 0.128590 0.000000
total efg : 0.128590 0.084680 0.000000
total efg : 0.000000 0.000000 -0.169360
This fragment gives the gradient at the first atom, which was silicon. Note
that the gradient is not zero, but the coupling is---that's because the
quadrupole moment of Si-29 is zero, so although there's a gradient there's
nothing in the nucleus for it to couple to.
Atom 2 is an oxygen atom, and its entry in the output is:
Atom 3 is an oxygen atom, and its entry in the output is:
Atom 2, typat 2: Cq = 6.603688 MHz eta = 0.140953
efg eigval : -1.098710
- eigvec : -0.707107 0.707107 0.000000
efg eigval : 0.471922
- eigvec : -0.000270 -0.000270 1.000000
efg eigval : 0.626789
- eigvec : 0.707107 0.707107 0.000382
total efg : -0.235961 0.862750 0.000042
total efg : 0.862750 -0.235961 0.000042
total efg : 0.000042 0.000042 0.471922
efg_el : -0.044260 -0.065290 0.000042
efg_el : -0.065290 -0.044260 0.000042
efg_el : 0.000042 0.000042 0.088520
efg_ion : -0.017255 0.306132 -0.000000
efg_ion : 0.306132 -0.017255 -0.000000
efg_ion : -0.000000 -0.000000 0.034509
efg_paw : -0.174446 0.621908 0.000000
efg_paw : 0.621908 -0.174446 0.000000
efg_paw : 0.000000 0.000000 0.348892
Atom 3, typat 2: Cq = 6.686962 MHz eta = 0.144581
efg eigval : -1.112565
- eigvec : -0.707107 0.707107 0.000000
efg eigval : 0.475855
- eigvec : 0.000000 0.000000 1.000000
efg eigval : 0.636710
- eigvec : -0.707107 -0.707107 -0.000000
total efg : -0.237927 0.874638 0.000000
total efg : 0.874638 -0.237927 0.000000
total efg : 0.000000 0.000000 0.475855
efg_el : -0.061260 -0.008494 0.000000
efg_el : -0.008494 -0.061260 0.000000
efg_el : 0.000000 0.000000 0.122519
efg_ion : -0.017255 0.306132 0.000000
efg_ion : 0.306132 -0.017255 0.000000
efg_ion : 0.000000 0.000000 0.034509
efg_paw : -0.159413 0.577000 0.000000
efg_paw : 0.577000 -0.159413 0.000000
efg_paw : 0.000000 0.000000 0.318826
Now we see the electric field gradient coupling, in frequency units, along
with the asymmetry of the coupling tensor, and, finally, the three
contributions to the total. Note that the valence part, efg_el, is quite
small, while the ionic part and the on-site PAW part are larger. In fact, the
PAW part is largest -- this is why these calculations give very poor results
with norm-conserving pseudopotentials, and need the full accuracy of PAW.
PAW part is largest; this is why these calculations give very poor results
with norm-conserving pseudopotentials, and need the full accuracy of PAW to capture
the behavior near the nucleus.
Experimentally, the nuclear quadrupole coupling for O-17 in stishovite is
reported as $6.5\pm 0.1$ MHz, with asymmetry $0.125\pm 0.05$ [[cite:Xianyuxue1994]].
It is not uncommon for PAW-based EFG calculations to give coupling values a few percent
too large; often this can be improved by using PAW datasets with smaller PAW
radii, at the expense of more expensive calculations [[cite:Zwanziger2016]].
## Fermi contact interaction
The Fermi contact interaction arises from overlap of the electronic wavefunctions
with the atomic nucleus, and is an observable for example in
M&ouml;ssbauer spectroscopy [[cite:Greenwood1971]]. In M&ouml;ssbauer spectra,
the isomer shift $\delta$ is expressed in velocity units as
$$
\begin{equation}
\label{eq:mossbauershift}
\delta = \frac{c}{E_\gamma}\frac{2\pi Z e^2}{3}(|\Psi(R)_A|^2-|\Psi(R)_S|^2)\Delta\langle r^2\rangle ,
\end{equation}
$$
the isomer shift $\delta$ is expressed in (SI) velocity units as
$$ \delta = \frac{2\pi}{3}\frac{c}{E_\gamma}\frac{Z e^2}{ 4\pi\epsilon_0} ( |\Psi (R)_A|^2 - |\Psi (R)_S|^2 )\Delta\langle r^2\rangle $$
where $\Psi(R)$ is the electronic
wavefunction at nuclear site $R$, for the absorber (A) and source (S);
wavefunction at nuclear site $R$, for the absorber (A) and source (S) respectively;
$c$ is the speed of light, $E_\gamma$ is the nuclear transition energy, and $Z$ the atomic number;
and $\Delta\langle r^2\rangle$ the change in the nuclear size squared. All these quantities
are assumed known in the M&ouml;ssbauer spectrum of interest, except $|\Psi(R)|^2$, the
@ -163,25 +156,25 @@ variables, only one additional variable is needed:
prtfc 1
{% dialog tests/tutorial/Input/tnuc_2.in %}
{% dialog tests/tutorial/Input/tnuc_2.abi %}
After running this file, inspect the output and look for the phrase
"Fermi-contact Term Calculation". There you'll find the FC output for
each atom; in this case, the Sn atoms, [[typat]] 1, yield a contact term
of 72.2969 atomic units (charge per volume $e/a^3_0$).
of 71.6428 (density in atomic units, $a^{-3}_0$).
To interpret M&ouml;ssbauer spectra you need really both a source and
an absorber; in the tutorial we provide also a file for $\alpha$-Sn (grey
tin, which is non-metallic).
{% dialog tests/tutorial/Input/tnuc_3.in %}
{% dialog tests/tutorial/Input/tnuc_3.abi %}
If you run this file, you should find a contact term of 102.3008.
If you run this file, you should find a contact term of 102.0748.
To check your results, you can use experimental data for the isomer shift $\delta$
for known compounds to compute $\Delta\langle r^2\rangle$ in Eq.\ref{eq:mossbauershift}
for known compounds to compute $\Delta\langle r^2\rangle$ in the above equation
(see [[cite:Zwanziger2009]]). Using our results above together with standard
tin M&ouml;ssbauer parameters of $E_\gamma = 23.875$ keV and an experimental shift
of 2.2 mm/sec for $\alpha$-Sn relative to SnO$_2$, we find
$\Delta\langle r^2\rangle = 5.74\times 10^{-3}\mathrm{fm}^2$, in decent agreement
$\Delta\langle r^2\rangle = 5.67\times 10^{-3}\mathrm{fm}^2$, in decent agreement
with other calculations of 6--7$\times 10^{-3}\mathrm{fm}^2$ [[cite:Svane1987]], [[cite:Svane1997]].

View File

@ -1,5 +1,6 @@
---
authors: XG
plotly: true
---
# Parallelism in the DFPT formalism
@ -113,30 +114,36 @@ the computer you are using. This can be for instance: mpirun -np 16 abinit
## 2 Computation of one dynamical matrix (q =0.25 -0.125 0.125) for FCC aluminum
We start by treating the case of a small systems, namely FCC aluminum, for
which there is only one atom per unit cell. Of course, many k points are needed.
which there is only one atom per unit cell. Of course, many k points are needed, since this is a metal.
**2.1.** The first step is the pre-computation of the ground state
wavefunctions. This is driven by the files *tdfpt_01.files* (and *tdfpt_01.in*).
You should edit them and examine them.
wavefunctions. This is driven by the files *tdfpt_01.abi*.
You should edit it and examine it.
{% dialog tests/tutoparal/Input/tdfpt_01.files tests/tutoparal/Input/tdfpt_01.in %}
{% dialog tests/tutoparal/Input/tdfpt_01.abi %}
One relies on a k-point grid of 8x8x8 x 4 shifts (=2048 k points), and 5 bands.
The k-point grid sampling is well converged, actually.
For this ground-state calculation, symmetries can be used to reduce
drastically the number of k points: there are 60 k points in the irreducible
Brillouin zone (this cannot be deduced from the examination of the input file, though).
In order to treat properly the phonon calculation, the number of bands is larger than the
default value, that would have given [[nband]]=3. Indeed, several of the unoccupied bands
plays a role in the response calculations in the case of etallic occupations.
For example, the acoustic sum rule might be largely violated when too few unoccopied
bands are treated.
This calculation is very fast, actually.
You can launch it:
mpirun -n 4 abinit < tdfpt_01.files > tdfpt_01.log &
mpirun -n 4 abinit tdfpt_01.abi > log &
A reference output file is available in *\$ABI_TESTS/tutoparal/Refs*, under
the name *tdfpt_01.out*. It was obtained using 4 computing cores, and took a few seconds.
the name *tdfpt_01.abo*. It was obtained using 4 computing cores, and took a few seconds.
**2.2.** The second step is the DFPT calculation, for which the files are
*tdfpt_02.files* (and *tdfpt_02.in*).
**2.2.** The second step is the DFPT calculation, see the file *tdfpt_02.abi*
{% dialog tests/tutoparal/Input/tdfpt_02.files tests/tutoparal/Input/tdfpt_02.in %}
{% dialog tests/tutoparal/Input/tdfpt_02.abi %}
There are three perturbations (three atomic displacements). For the two first
perturbations, no symmetry can be used, while for the third, two symmetries
@ -145,206 +152,259 @@ scalable sections of the code, the maximum speed up is 5120 (=1024 k points *
5 bands), if you have access to 5120 computing cores. However, the sequential
parts of the code dominate at a much, much lower value. Indeed, the sequential
parts is actually a few percents of the code on one processor, depending on
the machine you run. The speed-up might saturate beyond 4 and 8 (depending on
the machine).
the machine you run. The speed-up might saturate beyond 8...16 (depending on
the machine). Note that the number of processors that you use for this second step
is independent of the number of processors that you used for the first step.
The only relevant information from the first step is the *_WFK file.
First copy the output of the ground-state calculation so that it can be used
as the input of the DFPT calculation:
cp tdfpt_01.o_WFK tdfpt_02.i_WFK
cp tdfpt_01.o_WFK tdfpt_02.i_WFQ
(A _WFQ file is not needed, as all GS wavefunctions at k+q are present in the GW wavefuction at k).
Then, you can launch the calculation:
mpirun -n 4 abinit < tdfpt_02.files > tdfpt_02.log &
mpirun -n 4 abinit tdfpt_02.abi > tdfpt_02.log &
A reference output file is given in *\$ABI_TESTS/tutoparal/Refs*, under the name
*tdfpt_02.out*. Edit it, and examine some information.
*tdfpt_02.abo*. Edit it, and examine some information.
The calculation has been made with four computing cores:
```
- nproc = 4
- mpi_nproc: 4, omp_nthreads: -1 (-1 if OMP is not activated)
```
The wall clock time is less than 50 seconds :
```
-
- Proc. 0 individual time (sec): cpu= 48.5 wall= 48.5
- Proc. 0 individual time (sec): cpu= 28.8 wall= 28.9
================================================================================
Calculation completed.
.Delivered 0 WARNINGs and 3 COMMENTs to log file.
+Overall time at end (sec) : cpu= 194.1 wall= 194.1
.Delivered 0 WARNINGs and 0 COMMENTs to log file.
+Overall time at end (sec) : cpu= 115.4 wall= 115.8
```
The major result is the phonon frequencies:
Phonon wavevector (reduced coordinates) : 0.25000 -0.12500 0.12500
Phonon energies in Hartree :
6.944980E-04 7.756637E-04 1.145943E-03
Phonon energies in meV :
- 1.889825E+01 2.110688E+01 3.118270E+01
6.521506E-04 7.483301E-04 1.099648E-03
Phonon frequencies in cm-1 :
- 1.524247E+02 1.702385E+02 2.515054E+02
Phonon frequencies in Thz :
- 4.569578E+00 5.103622E+00 7.539943E+00
Phonon energies in Kelvin :
- 2.193049E+02 2.449349E+02 3.618597E+02
- 1.431305E+02 1.642395E+02 2.413447E+02
**2.3.** Because this test case is quite fast, you should play a bit with it.
In particular, run it several times, with an increasing number of computing
cores (let's say, up to 32 computing cores, at which stage you should have
cores (let us say, up to 40 computing cores, at which stage you should have
obtained a saturation of the speed-up).
You should be able to obtain the following.
You should be able to obtain a decent speedup up to 8 processors, then the gain becomes more and more marginal.
Note however that the result is independent (to an exquisite accuracy) of the number of computing cores that is used
1. The result is independent (to an exquisite accuracy) of the number of computing cores that is used
2. The timing section reveals that the reading of the ground-state wavefunction file is the limiting step for the parallelisation
Concerning the latter, you will need to understand, in the output file, the
timing section. It is present a bit before the end of the output file:
Let us explain the timing section. It is present a bit before the end of the output file:
-
- For major independent code sections, cpu and wall times (sec),
- as well as % of the time and number of calls for node 0-
- routine cpu % wall % number of calls
- fourwf(pot) 19.834 10.2 19.794 10.2 187989
- inwffil 7.387 3.8 7.390 3.8 10
- fourwf(G->r) 6.721 3.5 6.869 3.5 116049
- cgwf3-O(npw) 2.226 1.1 2.228 1.1 -1
- vtorho3-kpt loop 2.181 1.1 2.163 1.1 33
- nonlop(forces) 1.924 1.0 1.947 1.0 90880
- projbd 1.775 0.9 1.734 0.9 318634
- nonlop(apply) 1.690 0.9 1.719 0.9 116309
- vtowfk3(contrib) 1.654 0.9 1.556 0.8 -1
- 61 others 2.819 1.5 2.803 1.4
-<BEGIN_TIMER mpi_nprocs = 4, omp_nthreads = 1, mpi_rank = 0>
- cpu_time = 28.8, wall_time = 28.9
-
- subtotal 48.211 24.8 48.203 24.8
- routine cpu % wall % number of calls Gflops Speedup Efficacity
- (-1=no count)
- fourwf%(pot) 14.392 12.5 14.443 12.5 170048 -1.00 1.00 1.00
- nonlop(apply) 2.787 2.4 2.802 2.4 125248 -1.00 0.99 0.99
- nonlop(forces) 2.609 2.3 2.620 2.3 64000 -1.00 1.00 1.00
- fourwf%(G->r) 2.044 1.8 2.052 1.8 47124 -1.00 1.00 1.00
- dfpt_vtorho-kpt loop 1.174 1.0 1.177 1.0 21 -1.00 1.00 1.00
- getgh1c_setup 1.111 1.0 1.114 1.0 8960 -1.00 1.00 1.00
- mkffnl 1.087 0.9 1.092 0.9 20992 -1.00 1.00 1.00
- projbd 1.023 0.9 1.036 0.9 286336 -1.00 0.99 0.99
- dfpt_vtowfk(contrib) 0.806 0.7 0.805 0.7 -1 -1.00 1.00 1.00
- others (120) -2.787 -2.4 -2.825 -2.4 -1 -1.00 0.99 0.99
-<END_TIMER>
-
- subtotal 24.246 21.0 24.317 21.0 1.00 1.00
- For major independent code sections, cpu and wall times (sec),
- as well as % of the total time and number of calls
- routine cpu % wall % number of calls
-<BEGIN_TIMER mpi_nprocs = 4, omp_nthreads = 1, mpi_rank = world>
- cpu_time = 115.3, wall_time = 115.6
-
- routine cpu % wall % number of calls Gflops Speedup Efficacity
- (-1=no count)
- fourwf(pot) 79.067 40.7 79.326 40.9 752230
- inwffil 29.548 15.2 29.560 15.2 40
- fourwf(G->r) 25.828 13.3 25.898 13.3 447552
- cgwf3-O(npw) 9.096 4.7 9.081 4.7 -4
- vtorho3-kpt loop 8.672 4.5 8.611 4.4 132
- nonlop(forces) 7.707 4.0 7.716 4.0 363520
- projbd 6.925 3.6 6.668 3.4 1275084
- nonlop(apply) 6.810 3.5 6.864 3.5 465510
- vtowfk3(contrib) 6.280 3.2 6.199 3.2 -4
- getghc-other 3.176 1.6 3.195 1.6 -4
- status 2.615 1.3 2.534 1.3 919162
- vtorho3:synchro 2.029 1.0 2.040 1.1 132
- 58 others 4.175 2.2 4.217 2.2
- fourwf%(pot) 51.717 44.8 51.909 44.9 679543 -1.00 1.00 1.00
- dfpt_vtorho:MPI 12.267 10.6 12.292 10.6 84 -1.00 1.00 1.00
- nonlop(apply) 10.092 8.8 10.149 8.8 500343 -1.00 0.99 0.99
- nonlop(forces) 9.520 8.3 9.562 8.3 256000 -1.00 1.00 1.00
- fourwf%(G->r) 7.367 6.4 7.398 6.4 187320 -1.00 1.00 1.00
- dfpt_vtorho-kpt loop 4.182 3.6 4.193 3.6 84 -1.00 1.00 1.00
- getgh1c_setup 3.955 3.4 3.967 3.4 35840 -1.00 1.00 1.00
- mkffnl 3.911 3.4 3.929 3.4 83968 -1.00 1.00 1.00
- projbd 3.735 3.2 3.780 3.3 1144046 -1.00 0.99 0.99
- dfpt_vtowfk(contrib) 2.754 2.4 2.748 2.4 -4 -1.00 1.00 1.00
- getghc-other 1.861 1.6 1.790 1.5 -4 -1.00 1.04 1.04
- pspini 0.861 0.7 0.865 0.7 4 -1.00 0.99 0.99
- newkpt(excl. rwwf ) 0.754 0.7 0.757 0.7 -4 -1.00 1.00 1.00
- others (116) -14.132 -12.3 -14.220 -12.3 -1 -1.00 0.99 0.99
-<END_TIMER>
- subtotal 191.928 98.9 191.909 98.9
- subtotal 98.845 85.7 99.120 85.7 1.00 1.00
It is made of two groups of data. The first one corresponds to the analysis of
the timing for the computing core (node) number 0. The second one is the sum
over all computing cores of the data of the first group. Note that there is a
factor of four between these two groups, reflecting that the load balance is good.
Let's examine the second group of data in more detail. It corresponds to a
Let us examine the second group of data in more detail. It corresponds to a
decomposition of the most time-consuming parts of the code. Note that the
subtotal is 98.9 percent, thus the statistics is quite good. Without going
into the detail of each routine, for the present purpose, the most significant
information is that among all the timed sections of the code, only "inwffil"
and "vtorho3:synchro" will not benefit from parallelism.
"inwffil" is a subroutine whose job is to read the ground-state wavefunctions
(you can find the source of the "inwffil" routine on [GitHub](https://github.com/abinit/abinit/tree/master/src/79_seqpar_mpi) or
[on the ABINIT Web site](https://www.abinit.org/sites/default/files/robodoc-html/masterindex.html)).
subtotal is 85.7 percent, thus the statistics is not very accurate, as it should be close to 100%.
Actually, as of ABINIT v9, there is must be a bug in the timing decomposition, since,
e.g. there is a negative time announced for the "others" subroutines.
As mentioned in the section 1, the reading of the ground-state wavefunctions is not done in parallel in the case
of the DFPT computations (note that the reading is actually parallelized for
e.g. ground-state calculations). In the output file provided as a reference
(with four computing cores), the "inwffil" wall clock time is 7.387 seconds,
on a total of 48.211 secs. By increasing the number of computing cores, it
will be possible to decrease the total time, but not below the value of 7.387
seconds in any case. You should observe a similar behaviour with your own tests.
Anyhow, several of the most time-consuming parts are directly related to application of the Hamiltonian to wavefunctions,
namely, fourwf%(pot) (application of the local potential, which implies two Fourier transforms), nonlop(apply)
(application of the non-local part of the Hamiltonian), nonlop(forces) (computation of the non-local part of the
interatomic forces), fourwf%(G->r) (fourier transform needed to build the first-order density). Also, quite noticeable
is dfpt_vtorho:MPI , synchronisation of the MPI parallelism.
A study of the speed-up brought by the k-point parallelism for this simple test case
gives the following behaviour, between 1 and 40 cores:
<div id="plotly_plot" style="width:90%;height:450px;"></div>
<script>
$(function() {
Plotly.newPlot(document.getElementById('plotly_plot'),
[{ x: [1, 2, 4, 6, 8, 12, 16, 24, 32, 40], y: [1, 2, 4, 6, 8, 12, 16, 24, 32, 40], name: 'Ideal'},
{ x: [1, 2, 4, 6, 8, 12, 16, 24, 32, 40], y: [1, 1.92, 3.75, 5.50, 7.17, 9.34, 11.1, 14.4, 17.8, 19.7], name: 'Observed' }],
{ title: "Parallel speed-up",
xaxis: {title:'Number of cores'} }
);
});
</script>
At 8 processors, one gets a speed-up of 7.17, which is quite decent (about 90% efficiency),
but 16 processors, the speed-up is only 11.1 (about 70% efficiency), and the efficiency is below 50% at 40 processors,
for a speed-up of 19.7 ..
## 3 Computation of one perturbation for a slab of 29 atoms of barium titanate
**3.1.** This test, with 29 atoms, is slower, but scales better than the Al
FCC case. It consists in the computation of one perturbation at qpt 0.0 0.25
**3.1.** This test, with 29 atoms, is slower, but highlights other aspects
of the DFPT parallelism than the Al FCC case.
It consists in the computation of one perturbation at [[qpt]] 0.0 0.25
0.0 for a 29 atom slab of barium titanate, artificially terminated by a double
TiO2 layer on each face, with a reasonable k-point sampling of the Brillouin zone.
TiO<sub>2</sub> layer on each face, with a reasonable k-point sampling of the Brillouin zone.
The symmetry of the system and perturbation will allow to decrease this
sampling to one quarter of the Brillouin zone. E.g. with the k-point sampling
ngkpt 4 4 1, there will be actually 4 k-points in the irreducible Brillouin
zone for the Ground state calculations. For the DFPT case, only one symmetry
[[ngkpt]] 4 4 1, there will be actually 4 k-points in the irreducible Brillouin
zone for the Ground state calculations. For the DFPT case, only one (binary) symmetry
will survive, so that, after the calculation of the frozen-wavefunction part
(for which no symmetry is used), the self-consistent part will be done with 8
k points in the corresponding irreducible Brillouin zone. With the sampling 8
8 1, there will be 32 k points in the irreducible Brillouin zone for the DFPT
case. There are 120 bands. Note that the value of [[ecut]] that is used in the
k points in the corresponding irreducible Brillouin zone. Beyond 8 cores, the parallelisation
will be done also on the bands. This will prove to be much more dependent
on the computer architecture than the (low-communication) parallelism over k-points.
With the sampling 8 8 1, there will be 32 k points in the irreducible Brillouin zone for the DFPT
case. This will allow potentially to use efficiently a larger number of processors, provided the
computer architecture and network is good enough.
There are 116 occupied bands. For the ground state calculation, 4 additional conduction
bands will be explicitly treated, which will allow better SCF stability thanks to [[iprcel]] 45.
Note that the value of [[ecut]] that is used in the
present tutorial is too low to obtain physical results (it should be around 40 Hartree).
Also, only one atomic displacement is considered, so that the phonon frequencies
delivered at the end of the run are meaningless.
As in the previous case, a preparatory ground-state calculation is needed.
We use the input variable [[autoparal]]=1 . It does not delivers the best repartition of
processors among [[npkpt]], [[npband]] and [[npfft]], but achieves a decent repartition, usually within a factor of two.
With 24 processors, it selects [[npkpt]]=4 (optimal), [[npband]]=3 and [[npfft]]=2, while [[npband]]=6 and [[npband]]=1 would do better.
For information, the speeup going from 24 cores to 64 cores is 1.76, not quite the increase of number of processor (2.76).
Anyhow, the topics of the tutorial is not the GS calculation.
The input files are provided, in the directory *\$ABI_TESTS/tutoparal/Input*.
The preparatory step is governed by *tdfpt_03.files* (and *tdfpt_03.in*). The real
(=DFPT) test case is governed by *tdfpt_04.files* (and *tdfpt_04.in*). The
The preparatory step is driven by *tdfpt_03.abi*. The real
(=DFPT) test case is driven by *tdfpt_04.abi*. The
reference output files are present in *\$ABI_TESTS/tutoparal/Refs*:
*tdfpt_0324.out* and *tdfpt_0432.out*. The naming convention is such that the
*tdfpt_03_MPI24.abo* and *tdfpt_04_MPI24.abo*. The naming convention is such that the
number of cores used to run them is added after the name of the test: the
*tdfpt_03.in* file was run with 24 cores, while the *tdfpt_04.in* was run with 32
cores. The preparatory step took about 5 minutes, and the DFPT step took about
5 minutes as well.
*tdfpt_03.abi* files are run with 24 cores.
The preparatory step takes about 3 minutes, and the DFPT step takes about
3 minutes as well.
{% dialog tests/tutoparal/Input/tdfpt_03.in tests/tutoparal/Input/tdfpt_04.in %}
{% dialog tests/tutoparal/Input/tdfpt_03.abi tests/tutoparal/Input/tdfpt_04.abi %}
You can run now these test cases. For tdfpt_03, you might
need to change the [[npband]] value (presently 6), if you are not using 24
processors. At variance, for tdfpt_04, no adaptation of the input file is
You can run now these test cases. For tdfpt_03, with [[autoparal]]=1,
you will be able to run on different numbers of processors compatible with [[nkpt]]=4,
[[nband]]=120 and [[ngfft]]=[30 30 192], detected by ABINIT. Alternatively, you might decide to explicitly
define [[npkpt]], [[npband]] and [[npfft]].
At variance, for tdfpt_04, no adaptation of the input file is
needed to be able to run on an arbitrary number of processors.
To launch the ground-state computation, type:
mpirun -n 24 abinit < tdfpt_03.files > tdfpt_03.log &
mpirun -n 24 abinit tdfpt_03.abi > log &
then copy the output of the ground-state calculation so that it can be used as
the input of the DFPT calculation:
cp tdfpt_03.o_WFK tdfpt_04.i_WFK
cp tdfpt_03.o_WFK tdfpt_04.i_WFQ
mv tdfpt_03o_WFK.nc tdfpt_04i_WFK.nc
and launch the calculation:
mpirun -n 24 abinit < tdfpt_04.files > tdfpt_04.log &
mpirun -n 24 abinit tdfpt_04.abi > log &
Now, examine the obtained output file for test 04, especially the timing.
In the reference file *\$ABI_TESTS/tutoparal/Refs/tdfpt_0432.out*,
with 32 computing cores, the timing section delivers:
In the reference file *\$ABI_TESTS/tutoparal/Refs/tdfpt_04_MPI24.abo*,
with 24 computing cores, the timing section delivers:
- For major independent code sections, cpu and wall times (sec),
- as well as % of the time and number of calls for node 0-
-<BEGIN_TIMER mpi_nprocs = 24, omp_nthreads = 1, mpi_rank = 0>
- cpu_time = 159.9, wall_time = 160.0
-
- routine cpu % wall % number of calls Gflops Speedup Efficacity
- (-1=no count)
- projbd 46.305 1.2 46.345 1.2 11520 -1.00 1.00 1.00
- nonlop(apply) 42.180 1.1 42.183 1.1 5760 -1.00 1.00 1.00
- dfpt_vtorho:MPI 25.087 0.7 25.085 0.7 30 -1.00 1.00 1.00
- fourwf%(pot) 22.435 0.6 22.436 0.6 6930 -1.00 1.00 1.00
- nonlop(forces) 5.485 0.1 5.486 0.1 4563 -1.00 1.00 1.00
- fourwf%(G->r) 4.445 0.1 4.446 0.1 2340 -1.00 1.00 1.00
- pspini 2.311 0.1 2.311 0.1 1 -1.00 1.00 1.00
<...>
- For major independent code sections, cpu and wall times (sec),
- as well as % of the total time and number of calls
- routine cpu % wall % number of calls
-<BEGIN_TIMER mpi_nprocs = 24, omp_nthreads = 1, mpi_rank = world>
- cpu_time = 3826.4, wall_time = 3828.0
-
- routine cpu % wall % number of calls Gflops Speedup Efficacity
- (-1=no count)
- projbd 3046.599 34.0 3065.259 34.0 171639
- fourwf%(pot) 2545.342 28.4 2561.313 28.4 103098
- nonlop(apply) 1059.279 11.8 1066.034 11.8 85818
- fourwf%(G->r) 531.322 5.9 534.929 5.9 50112
- vtorho3:synchro 444.450 5.0 448.598 5.0 576
- nonlop(forces) 195.017 2.2 195.487 2.2 100800
- newkpt(excl. rwwf ) 179.142 2.0 179.185 2.0 -32
- vtowfk3(contrib) 137.486 1.5 137.878 1.5 -32
- pspini 97.276 1.1 99.901 1.1 32
- projbd 1238.539 32.4 1239.573 32.4 278400 -1.00 1.00 1.00
- nonlop(apply) 1012.783 26.5 1012.982 26.5 139200 -1.00 1.00 1.00
- fourwf%(pot) 544.047 14.2 544.201 14.2 167040 -1.00 1.00 1.00
- dfpt_vtorho:MPI 450.196 11.8 450.170 11.8 720 -1.00 1.00 1.00
- nonlop(forces) 131.081 3.4 131.129 3.4 108576 -1.00 1.00 1.00
- fourwf%(G->r) 107.885 2.8 107.930 2.8 55680 -1.00 1.00 1.00
- pspini 54.945 1.4 54.943 1.4 24 -1.00 1.00 1.00
<...>
- 45 others 0.000 0.0 0.000 0.0
- others (99) -98.669 -2.6 -99.848 -2.6 -1 -1.00 0.99 0.99
-<END_TIMER>
- subtotal 8760.405 97.8 8811.874 97.8
- subtotal 3569.873 93.3 3570.325 93.3 1.00 1.00
You will notice that the sum of the major independent code sections is again
very close to 100%. You might now explore the behaviour of the CPU time for
different numbers of compute cores (consider values below and above 32
You will notice that the run took about 160 seconds (wall clock time)..
The sum of the major independent code sections is reasonably
close to 100%. You might now explore the behaviour of the CPU time for
different numbers of compute cores (consider values below and above 24
processors). Some time-consuming routines will benefit from the parallelism, some other will not.
The kpoint + band parallelism will efficiently work for many important sections
@ -354,22 +414,39 @@ perturbation) times nband is 8*120=960. Of course, the total speed-up will
saturate well below this value, as there are some non-parallelized sections of the code.
In the above-mentioned list, the kpoint+band parallelism cannot be exploited
(or is badly exploited) in several sections of the code : "vtorho3:synchro",
about 5 percents of the total time of the run on 32 processors, "newkpt(excl.rwwf)",
about 2 percents, vtowfk3(contrib), about 1.5 percent, "pspini", about
1 percent. This amounts to about 10% of the total, and, according to Amdahl's
law, the saturation will happen soon, with less than 100 processors.
(or is badly exploited) in several sections of the code : "dfpt_vtorho:MPI",
about 12 percents of the total time of the run on 24 processors, "pspini", about 1.4 percent.
This amounts to about 1/8 of the total.
However, the scalability of the band parallelisation is rather poor, and effective saturation
in this case already happens at 16 processor.
A study of the speed-up brought by the combined k-point and band parallelism for this test case
on a 2 AMD EPYC 7502 machine (2 CPUS, each with 32 cores)
gives the following behaviour, between 1 and 40 cores:
<div id="plotly_plot2" style="width:90%;height:450px;"></div>
<script>
$(function() {
Plotly.newPlot(document.getElementById('plotly_plot2'),
[{ x: [1, 2, 4, 6, 8, 12, 16, 24, 32, 40], y: [1, 2, 4, 6, 8, 12, 16, 24, 32, 40], name: 'Ideal'},
{ x: [1, 2, 4, 6, 8, 12, 16, 24, 32, 40], y: [1, 1.97, 3.93, 3.86, 7.67, 7.53, 14.77, 16.44, 15.47, 14.37], name: 'Observed' }],
{ title: "Parallel speed-up",
xaxis: {title:'Number of cores'} }
);
});
</script>
The additional band parallelism is very efficient when running with 16 cores, bringing 14.77 speed-up,
while using only the k point parallelism, with 6 cores, gives 7.67 speed-up. However, the behaviour
is disappointing beyond 16 cores, or even for a number of processors which is not a multiple of 8.
Such a behaviour might be different on your machine.
**3.2.** A better parallelism can be seen if the number of k-points is brought
back to a converged value (8x8x1).
back to a converged value (8x8x1). Again,
Try this if you have more than 100 processors at hand.
Set in your input file *tdfpt_03.in*:
ngkpt 8 8 1 ! This should replace ngkpt 4 4 1
npkpt 16 ! This should replace npkpt 4
Also, set in *tdfpt_04.in*:
Set in your input files *tdfpt_03.abi* and *tdfpt_04.abo* :
ngkpt 8 8 1 ! This should replace ngkpt 4 4 1
@ -377,14 +454,15 @@ and launch again the preliminary step, then the DFPT step. Then, you can
practice the DFPT calculation by varying the number of computing cores. For
the latter, you could even consider varying the number of self-consistent
iterations to see the initialisation effects (small value of nstep), or target
a value giving converged results (nstep 50 instead of nstep 18). The energy
cut-off might also be increased (e.g. ecut 40 Hartree gives a much better
a value giving converged results ([[nstep]] 50 instead of [[nstep]] 18). The energy
cut-off might also be increased (e.g. [[ecut]] 40 Hartree gives a much better
value). Indeed, with a large value of k points, and large value of nstep, you
should be able to obtain a speed-up of more than one hundred for the DFPT
might be able to obtain a speed-up of more than one hundred for the DFPT
calculation, when compared to a sequential run (see below). Keep track of the
time for each computing core number, to observe the scaling.
As a typical observation, the Wall clock timing decreases from
On a machine with a good communication network, the following results were observed in 2011.
The Wall clock timing decreases from
- Proc. 0 individual time (sec): cpu= 2977.3 wall= 2977.3
@ -400,10 +478,32 @@ number of computing cores (also, the efficiency of the calculation).
![Schema 1](paral_dfpt_assets/Speedup.jpeg)
Beyond 300 computing cores, the sequential parts of the code start to dominate.
With more realistic computing parameters (ecut 40), they dominate only beyond 600 processors.
With more realistic computing parameters ([[ecut]] 40), they dominate only beyond 600 processors.
This last example is the end of the present tutorial. You have been explained
the basics of the current implementation of the parallelism for the DFPT part
of ABINIT, then you have explored two test cases: one for a small cell
However, on the same (recent, but with slow connection beyond 32 cores) computer than for the [[ngkpt]] 4 4 1 case,
the saturation sets in already beyond 16 cores, with the following behaviour (the reference is taken with respect to the timing at 4 processors):
<div id="plotly_plot3" style="width:90%;height:450px;"></div>
<script>
$(function() {
Plotly.newPlot(document.getElementById('plotly_plot3'),
[{ x: [1,4, 8, 12, 16, 24, 32, 40], y: [1, 4, 8, 12, 16, 24, 32, 40], name: 'Ideal'},
{ x: [4, 8, 12, 16, 24, 32, 40], y: [4, 7.86, 10.46, 14.92, 13.82, 16.15, 15.27], name: 'Observed' }],
{ title: "Parallel speed-up",
xaxis: {title:'Number of cores'} }
);
});
</script>
Thus, it is very important that you gain some understanding of the scaling of your typical runs
for your particular computer, and that you know the parameters (especially [[nkpt]]) of your calculations.
Up to 4 or 8 cores, the ABINIT scaling will usually be very good, if
k-point parallelism is possible. In the range between 10 and 100 cores, the speed-up might still be good,
but this will depend on details.
This last example is the end of the present tutorial.
The basics of the current implementation of the parallelism for the DFPT part of ABINIT have been explained,
then you have explored two test cases: one for a small cell
materials, with lots of k points, and another one, medium-size, in which the k
point and band parallelism can be used efficiently even for more than one hundred computing cores.
point and band parallelism must be used. It might reveal efficient, but this will depend on the detail of your calculation
and your computer architecture.

View File

@ -1,5 +1,5 @@
---
authors: DC
authors: DC, MT
---
# Parallelism for the ground state using wavelets
@ -9,23 +9,33 @@ authors: DC
This tutorial explains how to run the calculation of an isolated system using a
wavelet basis-set on a parallel computer using MPI. You will learn the
different characteristics of a parallel run using the wavelet basis-set and
test the speed-up on a small boron cluster of 14 atoms followed by a test on a
bigger alkane molecule.
test the speed-up on a small **boron cluster of 14 atoms** followed by a test on a
bigger **alkane molecule**.
This tutorial should take about 90 minutes and requires you have several CPU
cores (up to 64).
cores (up to 64 if possible).
You are supposed to know already some basics of parallelism in ABINIT,
explained in the tutorial [A first introduction to ABINIT in parallel](basepar).
explained in the tutorial [A first introduction to ABINIT in parallel](basepar).
The tutorial will be more profitable if you have already performed calculations
using the wavelet formalism (see the [[topic:Wavelets|topic page on wavelets]]
and the [[usewvl]] keyword).
!!! Important
To use a wavelet basis set `ABINIT` should have been compiled with the `bigdft` library.
To do this, download the [bigdft fallback](https://www.abinit.org/fallbacks) and use
the `--with-bigdft`, `BIGDFT_LIBS`, `BIGDFT_FCFLAGS`, etc. flags during the
`configure` step.
[TUTORIAL_READMEV9]
## 1 Wavelets variables and parallelism
The parallelism with the wavelet formalism can be used for two purposes: to
reduce the memory load per node, or to reduce the overall computation time.
**reduce the memory** load per node, or to reduce the overall **computation time**.
The MPI parallelization in the wavelet mode relies on the orbital distribution
The MPI parallelization in the wavelet mode relies on the **orbital distribution**
scheme, in which the orbitals of the system under investigation are
distributed over the assigned MPI processes. This scheme reaches its limit
when the number of MPI processes is equal to the number of orbitals in the
@ -33,14 +43,14 @@ simulation. To distribute the orbitals uniformly, the number of processors
must be a factor (divisor) of the number of orbitals. If this is not the case,
the distribution is not optimal, but the code tries to balance the load over
the processors. For example, if we have 5 orbitals and 4 processors, the
orbitals will have the distribution: 2/1/1/1.
orbitals will have the distribution: `2/1/1/1`.
There are no specific input variables to use the parallelism in the wavelet
mode as the only parallelisation level is on orbitals. So running ABINIT with
an `mpirun` command is enough (this command differs according to the local MPI
implementation) such as:
mpirun -np Nproc abinit < infile > logfile
mpirun -n Nproc abinit < infile.abi >& logfile
For further understanding of the wavelet mode, or for citation purposes, one
may read [[cite:Genovese2008]]
@ -48,37 +58,56 @@ may read [[cite:Genovese2008]]
## 2 Speed-up calculation for a boron cluster
We propose here to determine the speed-up in the calculation of the total
energy of a cluster made of 14 boron atoms. Open the file `tgswvl_01.in`. It
energy of a cluster made of 14 boron atoms.
![Boron14](paral_gswvl_assets/boron.jpg){width=30%}
Open the file `tgswvl_1.abi`. It
contains first the definition of the wavelet basis-set. One may want to test
the precision of the calculation by varying the [[wvl_hgrid]] and
[[wvl_crmult]] variables. This is not the purpose of this tutorial, so we will
use the given values (0.45Bohr and 5).
use the given values (0.45 Bohr and 5).
{% dialog tests/tutoparal/Input/tgswvl_01.in %}
{% dialog tests/tutoparal/Input/tgswvl_1.abi %}
Run ABINIT with 3 processors. The overall time is printed at the end of the
output file (and of the log):
Proc. 0 individual time (sec): cpu= 172.6 wall= 172.6
Proc. 0 individual time (sec): cpu= 36.0 wall= 36.0
Read the output file to find the number of orbitals in the calculation (given
by the keyword [[nband]]). With the distribution scheme of the wavelet mode,
the best distribution over processors will be obtained for, 1, 3, 7 and 21
processors. Create four different directories (with the number of processors
for instance) and run four times ABINIT with the same input file, varying the
number of processors in {1, 3, 7, 21}. The speed-up is the ratio between the
time with one processor and the time of a run with N processors.
number of processors in {1, 3, 7, 21}.
abinit tgswvl_1.abi >& log
The speed-up is the ratio between the time with one processor and the
time of a run with N processors.
Assuming that the directories are called {01, 03, 07, 21}, one can grep the
over-all time of a run and plot it in gnuplot with:
over-all time of a run and plot it with the [gnuplot](http://www.gnuplot.info) graphical tool.
Just issue:
plot "< grep 'individual time' */log | tr '/' ' '" u 1:(ttt/$11) w lp t "Boron cluster", x t "Ideal speed-up"
gnuplot
where `ttt` represents the time on one processor. The efficiency (in percent)
of the parallelization process is the ratio between the speed-up and the
number of processors. One can plot it with:
and, in `gnuplot` command line, type:
plot "< grep 'individual time' */log | tr '/' ' '" u 1:(ttt/$11/$1*100) w lp t "Boron cluster"
plot "< grep 'individual time' */*.abo | tr '/' ' '" u 1:(ttt/$11) w lp t "Boron cluster", x t "Ideal speed-up"
where `ttt` represents the time on one processor (replace `ttt` by this time in the
command line above).
![Speedup for the Boron14 cluster](paral_gswvl_assets/speedup-B14.png){width=50%}
The efficiency (in percent) of the parallelization process is the ratio between the speed-up and the
number of processors. One can plot it (using [gnuplot](http://www.gnuplot.info)) with:
plot "< grep 'individual time' */*.abo | tr '/' ' '" u 1:(ttt/$11/$1*100) w lp t "Boron cluster"
![Efficiency for the Boron14 cluster](paral_gswvl_assets/efficiency-B14.png){width=50%}
The first conclusion is that the efficiency is not so good when one use one
orbital per processor. This is a general rule with the wavelet mode: due to
@ -92,61 +121,107 @@ how to focus on the calculation parts.
## 3 Time partition
The wavelet mode is generating a `time.prc` file at each run (warning: it will
erase any existing copy). This is a text file and can be read directly. There
are three sections, giving the time of the initialisation process (before
entering the SCF loop), the time of the SCF loop itself, and the time for the
post-processing. Let's have a closer look to the SCF section (the actual
figures will vary between runs and number of processors):
The wavelet mode is generating a `wvl_timings.yml` file at each run (warning: it will
erase any existing copy). This is a text file in [YAML format](https://en.wikipedia.org/wiki/YAML)
that can be read directly. There are three sections, giving the time of the initialisation
process (section`INITS`), the time of the SCF loop itself (section `WFN OPT`),
and the time for the post-processing (section `POSTPRC`).
CATEGORY mean TIME(sec) PERCENT
CrtLocPot 1.70E-01 0.018
ApplyLocPotKin 1.83E+02 19.865
ApplyProj 1.44E+00 0.156
Precondition 3.42E+02 37.055
Rho_comput 1.10E+02 11.926
Rho_commun 5.45E+00 0.591
Un-TransSwitch 5.37E+00 0.582
Un-TransComm 5.95E+00 0.645
GramS_comput 6.84E+01 7.417
GramS_commun 8.91E-02 0.010
LagrM_comput 1.36E+02 14.784
LagrM_commun 1.44E-01 0.016
Diis 1.41E+01 1.527
PSolv_comput 2.31E+01 2.508
PSolv_commun 3.31E+00 0.358
Exchangecorr 5.01E+00 0.543
----------------------------------------------------------------------
Total CPU time for category: WFN_OPT = 9.22E+02 Total categorized percent 98.0
!!! Note
The `wvl_timings.yaml` file is only created if [[timopt]]
is set to **10** in the input file.
Let's have a closer look to the SCF section. We can extract the following data
(the actual figures will vary between runs and number of processors):
With the total time of this SCF section, one can compute the speed-up and the
== WFN OPT:
# Class % , Time (s), Max, Min Load (relative)
Flib LowLevel : [ 6.8, 1.7, 1.16, 0.84]
Communications : [ 33.3, 8.1, 1.16, 0.85]
BLAS-LAPACK : [ 0.1, 3.63E-02, 1.09, 0.91]
PS Computation : [ 5.4, 1.3, 1.03, 0.89]
Potential : [ 7.3, 1.8, 1.17, 0.58]
Convolutions : [ 42.4, 10., 1.10, 0.88]
Linear Algebra : [ 0.1, 3.61E-02, 1.03, 0.98]
Other : [ 1.3, 0.33, 1.23, 0.77]
Initialization : [ 0.1, 2.64E-02, 1.35, 0.81]
Total : [ 96.9, 24., 1.00, 1.00]
# Category % , Time (s), Max, Min Load (relative)
Allreduce, Large Size: [ 22.7, 5.5, 1.23, 0.88]
Class : Communications, Allreduce operations
Rho_comput : [ 16.9, 4.1, 1.19, 0.79]
Class : Convolutions, OpenCL ported
Precondition : [ 13.0, 3.2, 1.01, 0.99]
Class : Convolutions, OpenCL ported
ApplyLocPotKin : [ 12.6, 3.1, 1.08, 0.89]
Class : Convolutions, OpenCL ported
Exchange-Correlation : [ 7.3, 1.8, 1.17, 0.58]
Class : Potential, construct local XC potential
PSolver Computation : [ 5.4, 1.3, 1.03, 0.89]
Class : PS Computation, 3D SG_FFT and related operations
Init to Zero : [ 4.1, 1.0, 1.17, 0.78]
Class : Flib LowLevel, Memset of storage space
Allreduce, Small Size: [ 3.4, 0.84, 1.89, 0.26]
Class : Communications, Allreduce operations
Pot_commun : [ 3.2, 0.79, 1.08, 0.93]
Class : Communications, AllGathrv grid
PSolver Communication: [ 2.4, 0.59, 1.21, 0.96]
Class : Communications, MPI_ALLTOALL and MPI_ALLGATHERV
Array allocations : [ 2.3, 0.55, 1.16, 0.89]
Class : Flib LowLevel, Heap storage allocation
Un-TransComm : [ 1.1, 0.27, 1.07, 0.92]
Class : Communications, ALLtoALLV
Diis : [ 0.7, 0.16, 1.24, 0.75]
Class : Other, Other
ApplyProj : [ 0.5, 0.11, 1.10, 0.89]
Class : Other, RMA pattern
Rho_commun : [ 0.4, 9.42E-02, 6.63, 0.02]
Class : Communications, AllReduce grid
Vector copy : [ 0.4, 8.59E-02, 1.56, 0.69]
Class : Flib LowLevel, Memory copy of arrays
Un-TransSwitch : [ 0.2, 5.99E-02, 1.65, 0.59]
Class : Other, RMA pattern
Blas GEMM : [ 0.1, 3.62E-02, 1.09, 0.91]
Class : BLAS-LAPACK, Matrix-Matrix multiplications
Chol_comput : [ 0.1, 3.58E-02, 1.03, 0.98]
Class : Linear Algebra, ALLReduce orbs
CrtLocPot : [ 0.1, 2.64E-02, 1.35, 0.81]
Class : Initialization, Miscellaneous
Routine Profiling : [ 0.1, 1.32E-02, 1.07, 0.90]
Class : Flib LowLevel, Profiling performances
With the total time of this `WFN OPT` section, one can compute the speed-up and the
efficiency of the wavelet mode more accurately:
N processors Speed-up Efficiency (%)
3 2.3 75.3
7 3.7 52.8
21 7.5 35.6
N processors Time (s) Speed-up Efficiency (%)
3 40. 2.1 69.2
7 24. 3.5 49.4
21 20. 4.2 19.8
With the percentages of the `time.prc` file, one can see that, for this
example, the time is mostly spent in the precondionner and the application of
the local part of the Hamiltonian on the wavefunctions. Let's categorise the
time information:
With the percentages of the `wvl_timings.yaml` file, one can see that, for this
example, the time is mostly spent in communications, the precondionner,
the computation of the density and the application of the local part of the Hamiltonian.
Let's categorise the time information:
* The communication time is the sum of all the `_commun` entries and the `Un-TransComm` one.
* The time spent doing convolutions is the sum of `Precondition, ApplyLocPotKin, Rho_comput`.
* The linear algebra part is the sum of `GramS_comput, LagrM_comput`.
* The other entries are in a miscellaneous category.
* The communication time (all entries of class `Communications`).
* The time spent doing convolutions (all entries of class `Convolutions`).
* The linear algebra part (all entries of class `Linear Algebra` and `BLAS-LAPACK`).
* The other entries are in miscellaneous categories.
By doing the summations, one can give the percentage per category during the SCF loop:
The summations are given in the file, on top of the section. One obtains the percentage
per category during the SCF loop:
CATEGORY mean TIME(sec) PERCENT
Communication 14.9 1.62
Convolutions 635.0 68.87
Linear algebra 204.4 21.17
Other 67.7 7.34
CLASS PERCENT TIME(sec)
Convolutions 42.4 10.0
Communications 33.3 8.1
Potential 7.3 1.8
Flib Lowlevel 6.8 1.7
PS Computation 5.4 1.3
Linear Algebra 0.2 0.1
Other 4.6 1.8
You can analyse all the time.prc that have been generated for the different
You can analyse all the `wvl_timings.yaml` that have been generated for the different
number of processors and see the evolution of the different categories.
## 4 Orbital parallelism and array parallelism
@ -158,44 +233,65 @@ distributes the scalar arrays like density and potentials by z-planes in real
space. So some parts of the code may become more efficient when used with a
bigger number of processors, like the Poisson Solver part for instance.
Run the boron example with {2, 4, 14, 15} processors and plot the speed-up.
One can also look at the standard output to the load balancing of the Poisson
Solver and the load balancing of orbitals (with 15 processors):
Run the boron example with {2, 4, 14, 15} processors and plot the speed-up.
[...]
Processes from 0 to 9 treat 2 orbitals
One can also look at the standard output to the **load balancing of orbitals**
and the **load balancing of the Poisson Solver** (with 15 processors):
With 15 processors the repartition of the 21 orbitals is the following:
Processes from 0 to 9 treat 2 orbitals
Processes from 10 to 10 treat 1 orbitals
Processes from 11 to 14 treat 0 orbitals
[...]
Load Balancing for Poisson Solver related operations:
LB_density : processors 0 - 13 work at 100%
processor 14 works at 40%
LB_kernel : processors 0 - 12 work at 100%
processor 13 works at 92%
processors 14 - 14 work at 0%
One can see that, as expected, the load balancing per orbital is bad (4
processors are doing nothing), but one can see also that the load balancing of
the scalar arrays is not so good since the last processor will have a reduced
array. It is thus useless to run this job at 15 processors, 14 will give the
same run time (since the load balancing will be better).
With 15 processors, we can read in `log` file:
[...]
Poisson Kernel Initialization:
MPI tasks : 15
Poisson Kernel Creation:
Boundary Conditions : Free
Memory Requirements per MPI task:
Density (MB) : 1.33
Kernel (MB) : 1.40
Full Grid Arrays (MB) : 18.18
Load Balancing of calculations:
Density:
MPI tasks 0- 14 : 100%
Kernel:
MPI tasks 0- 13 : 100%
MPI task 14 : 50%
Complete LB per task : 1/3 LB_density + 2/3 LB_kernel
[...]
As expected, one can see that:
* The load balancing per orbital is bad (4 processors are doing nothing)
* The load balancing of the scalar arrays distribution is not so good since
the last processor will have a reduced array.
It is thus useless to run this job at 15 processors;
14 will give the same run time (since the load balancing will be better).
## 5 Speed-up calculation on a 65-atom alkane
Let's do the same with a bigger molecule and a finer grid. Open the file
`tgswvl_02.in`. It contains the definition of an alkane chain of 65 atoms,
`tgswvl_2.abi`. It contains the definition of an alkane chain of 65 atoms,
providing 64 orbitals.
{% dialog tests/tutoparal/Input/tgswvl_02.in %}
![Boron14](paral_gswvl_assets/alkane.jpg){width=60%}
{% dialog tests/tutoparal/Input/tgswvl_2.abi %}
Run this input file with {1, 2, 4, 8, 16, 24, 32, 48, 64} processors.
The run with one processor should take less than one hour. If
the time is short, one can reduce [[wvl_hgrid]] in the input file to 0.45.
_Time measurements for a run over several processors of a $C_{21}H_{44}$ alkane chain_
![Speedup for the C21H44 alkane chain](paral_gswvl_assets/speedup-C21.png)
![Efficiency for the C21H44 alkane chain](paral_gswvl_assets/efficiency-C21.png)
![Time repartition for the C21H44 alkane chain](paral_gswvl_assets/time-C21.png)
_Time measurements for a run over several processors of a C 21H44 alkane chain_
As we obtained previously, the efficiency is generally lowered when the number
of processors is not a divisor of the number of orbitals (namely here 24 and 48).
@ -206,4 +302,4 @@ With the wavelet mode, it is possible to efficiently decrease the run time by
increasing the number of processors. The efficiency is limited by the increase
of amount of time spent in the communications. The efficiency increases with
the quality of the calculation: the more accurate the calculations are (finer
hgrid...), the more efficient the code parallelization will be.
_hgrid_...), the more efficient the code parallelization will be.

Binary file not shown.

After

Width:  |  Height:  |  Size: 44 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 45 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 15 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 15 KiB

View File

@ -2,14 +2,13 @@
authors: MT, FJ
---
# First tutorial on the Projector Augmented-Wave (PAW) technique
# First tutorial on the Projector Augmented-Wave (PAW) method
## Projector Augmented-Wave technique, how to use it?
## Projector Augmented-Wave approach, how to use it?
This tutorial aims at showing how to perform a calculation within the **Projector Augmented-Wave** (PAW) method.
You will learn how to launch a PAW calculation and what are the main input
variables that govern convergence and numerical efficiency.
You are supposed to know how to use ABINIT with _Norm-Conserving PseudoPotentials_ (NCPP).
@ -72,35 +71,31 @@ All the input files can be found in the `$ABI_TESTS/tutorial/Input` directory.*
`$ABI_TESTS/tutorial/Refs` and `$ABI_TESTS/tutorial/Refs/tpaw1_addons`
directories (for the present tutorial they are named `tpaw1_*.abo`).
The input file *tpaw1_1.in* is an example of a file to be used to compute
The input file *tpaw1_1.abi* is an example of a file to be used to compute
the total energy of diamond at the experimental volume (within the
_LDA exchange-correlation functional_). You might get
the corresponding output file (it is available in *$ABI_TESTS/tutorial/Refs/tpaw1_1.abo).
Copy the files *tpaw1_1.in* in your work directory,
_LDA exchange-correlation functional_). Copy the *tpaw1_1.abi* file in your work directory,
```sh
cd $ABI_TESTS/tutorial/Input
mkdir Work_paw1
cd Work_paw1
cp ../tpaw1_1.in .
cp ../tpaw1_1.abi .
```
!!! important
You may have to change the path to reach the Psps_for_tests repository. For this, modify the varaible `pp_dirpath` in the input file.
and execute ABINIT:
and execute:
abinit tpaw1_1.in > log 2> err &
abinit tpaw1_1.abi >& log
The code should run very quickly.
In the meantime, you can read the input file and see that there is no PAW input variable.
{% dialog tests/tutorial/Input/tpaw1_1.in %}
{% dialog tests/tutorial/Input/tpaw1_1.abi %}
Now, open the *tpaw1_1.in* file and change the line iwth pseudos information: replace the *PseudosTM_pwteter/6c.pspnc* file with *C.LDA_PW-JTH.xml*.
Now, open the *tpaw1_1.abi* file and change the line with pseudopotential information:
replace the *PseudosTM_pwteter/6c.pspnc* file with *Pseudodojo_paw_pw_standard/C.xml*.
Run the code again:
abinit tpaw1_1.in > log 2> err &
abinit tpaw1_1.abi >& log
Your run should stop almost immediately!
The input file, indeed, is missing the mandatory argument [[pawecutdg]]!!
@ -109,7 +104,7 @@ Add the line:
pawecutdg 50
to *tpaw1_1.in* and run it again. Now the code completes successfully.
to *tpaw1_1.abi* and run it again. Now the code completes successfully.
!!! note
@ -125,19 +120,20 @@ to *tpaw1_1.in* and run it again. Now the code completes successfully.
the cut-off needed for the Norm-Conserving PseudoPotential (see next section),
**a PAW calculation will actually require less CPU time**.
Let's open the output file (*tpaw1_1.abo*) and have a look inside.
Let's open the output file (*tpaw1_1.abo*) and have a look inside (remember:
you can compare with a reference file in *$ABI_TESTS/tutorial/Refs/*).
Compared to an output file for a Norm-Conserving PseudoPotential run, an
output file for PAW contains the following specific topics:
- At the beginning of the file,
some specific default PAW input variables ([[ngfftdg]], [[pawecutdg]], and
[[useylm]]), mentioned in the section:
* At the beginning of the file,
some specific default PAW input variables ([[ngfftdg]], [[pawecutdg]], and
[[useylm]]), mentioned in the section:
```
-outvars: echo values of preprocessed input variables --------
```
- The use of two FFT grids, mentioned in:
* The use of two FFT grids, mentioned in:
```
Coarse grid specifications (used for wave-functions):
@ -152,45 +148,51 @@ getcut: wavevector= 0.0000 0.0000 0.0000 ngfft= 32 32 32
```
- A specific description of the PAW dataset (you might follow the tutorial [PAW2](paw2),
* A specific description of the PAW dataset (you might follow the tutorial [PAW2](paw2),
devoted to the building of the PAW atomic data, for a complete understanding of the file):
```
Pseudopotential format is: paw10
--- Pseudopotential description ------------------------------------------------
- pspini: atom type 1 psp file is /Users/torrentm/WORK/ABINIT/GIT/beauty/tests//Psps_for_tests/Pseudodojo_paw_pw_standard/C.xml
- pspatm: opening atomic psp file /Users/torrentm/WORK/ABINIT/GIT/beauty/tests//Psps_for_tests/Pseudodojo_paw_pw_standard/C.xml
- pspatm : Reading pseudopotential header in XML form from /Users/torrentm/WORK/ABINIT/GIT/beauty/tests//Psps_for_tests/Pseudodojo_paw_pw_standard/C.xml
Pseudopotential format is: paw10
basis_size (lnmax)= 4 (lmn_size= 8), orbitals= 0 0 1 1
Spheres core radius: rc_sph= 1.50736703
1 radial meshes are used:
- mesh 1: r(i)=AA*[exp(BB*(i-1))-1], size= 500 , AA= 0.33742E-02 BB= 0.20146E-01
- mesh 1: r(i)=AA*[exp(BB*(i-1))-1], size=2001 , AA= 0.94549E-03 BB= 0.56729E-02
Shapefunction is SIN type: shapef(r)=[sin(pi*r/rshp)/(pi*r/rshp)]**2
Radius for shape functions = 1.28249356
mmax= 500
Radius for shape functions = 1.30052589
mmax= 2001
Radial grid used for partial waves is grid 1
Radial grid used for projectors is grid 1
Radial grid used for (t)core density is grid 1
Radial grid used for Vloc is grid 1
Radial grid used for LDA-1/2 potential is grid 1
Radial grid used for pseudo valence density is grid 1
Mesh size for Vloc has been set to 1756 to avoid numerical noise.
Compensation charge density is not taken into account in XC energy/potential
pspatm: atomic psp has been read and splines computed
```
- After the SCF cycle section:
The value of the integrated compensation charge evaluated by two different
numerical methodologies; 1- computed in the _augmentation regions_
on the "spherical" grid, 2- computed in the whole simulation cell on the
"FFT" grid...
A discussion on these two values will be done in a forthcoming section.
* After the SCF cycle section:
The value of the integrated compensation charge evaluated by two different
numerical methodologies:
1. computed in the _augmentation regions_
on the "spherical" grid,
2. computed in the whole simulation cell on the "FFT" grid...
A discussion on these two values will be done in a forthcoming section.
```
PAW TEST:
==== Compensation charge inside spheres ============
The following values must be close to each other ...
Compensation charge over spherical meshes = 0.263855884339479
Compensation charge over fine fft grid = 0.263852893893634
Compensation charge over spherical meshes = 0.263866295499286
Compensation charge over fine fft grid = 0.263862122639226
```
- Information concerning the non-local term (pseudopotential strength $D_{ij}$)
and the spherical density matrix (augmentation wave occupancies $\rho_{ij}$):
* Information related the non-local term (pseudopotential intensity $D_{ij}$)
and the spherical density matrix (augmentation wave occupancies $\rho_{ij}$):
```
==== Results concerning PAW augmentation regions ====
@ -208,45 +210,43 @@ Atom # 2
...
```
- At the end of the file we find the decomposition of the total energy both
by direct calculation and double counting calculation:
* At the end of the file we find the decomposition of the total energy both
by direct calculation and double counting calculation:
```
--- !EnergyTerms
iteration_state : {dtset: 1, }
comment : Components of total free energy in Hartree
kinetic : 6.90446929441886E+00
hartree : 9.63708091533161E-01
xc : -4.29580646918379E+00
kinetic : 6.90447470595323E+00
hartree : 9.62706609299964E-01
xc : -4.29580260772849E+00
Ewald energy : -1.27864121210521E+01
psp_core : 9.19865486989434E-01
local_psp : -4.67413594752577E+00
spherical_terms : 1.44220243759604E+00
total_energy : -1.15261092272241E+01
total_energy_eV : -3.13641382594284E+02
psp_core : 9.19814512188249E-01
local_psp : -4.66849481780168E+00
spherical_terms : 1.43754510318459E+00
total_energy : -1.15261686159562E+01
total_energy_eV : -3.13642998643870E+02
...
--- !EnergyTermsDC
iteration_state : {dtset: 1, }
comment : '"Double-counting" decomposition of free energy'
band_energy : 3.07962181105384E-01
band_energy : 3.08710945092562E-01
Ewald energy : -1.27864121210521E+01
psp_core : 9.19865486989434E-01
xc_dc : -7.39239833326780E-01
spherical_terms : 7.71714533951319E-01
total_energy_dc : -1.15261097523327E+01
total_energy_dc_eV : -3.13641396883215E+02
psp_core : 9.19814512188249E-01
xc_dc : -7.38241276339915E-01
spherical_terms : 7.69958781192718E-01
total_energy_dc : -1.15261691589185E+01
total_energy_dc_eV : -3.13643013418624E+02
...
```
!!! Note
The PAW total energy is not the equal to the one obtained in the Norm-Conserving PseudoPotential case:
in the Norm-Conserving PseudoPotential case, the energy reference has been arbitrarily
modified by the pseudopotential construction procedure.
Comparing total energies computed with different PAW potentials is more meaningful: most of
The PAW total energy is not the equal to the one obtained in the Norm-Conserving PseudoPotential case.
This is due to the arbitrary modification of the energy reference during the pseudopotential
construction.
In PAW, comparing total energies computed with different atomic datasets is more meaningful: most of
the parts of the energy are calculated exactly, and in general you should be
able to compare numbers for (valence) *energies* between different PAW potentials or different codes.
@ -255,52 +255,52 @@ total_energy_dc_eV : -3.13641396883215E+02
As in the usual Norm-Conserving PseudoPotential case, the critical convergence parameter is the cut-off
energy defining the size of the plane-wave basis.
###3.a. Convergence with respect to ecut in the Norm-Conserving PseudoPotential case##
###3.a. Norm-Conserving PseudoPotential case##
The input file *tpaw1_2.in* contains data to be used to compute the convergence in ecut
The input file *tpaw1_2.abi* contains data to be used to compute the convergence in [[ecut]]
for diamond (at experimental volume). There are 9 datasets, with increasing [[ecut]] values
from 8 Ha to 24 Ha.
You might use the *tpaw1_2.in* file (with a standard Norm-Conserving
You might use the *tpaw1_2.abi* file (with a standard Norm-Conserving
PseudoPotential), and run:
abinit tpaw1_2.in > log 2> err &
abinit tpaw1_1.abi >& log
You should obtain the following _total energy_ values (see *tpaw1_2.abo*):
etotal1 -1.1628880677E+01
etotal2 -1.1828052470E+01
etotal3 -1.1921833945E+01
etotal4 -1.1976374633E+01
etotal5 -1.2017601960E+01
etotal6 -1.2046855404E+01
etotal7 -1.2062173253E+01
etotal8 -1.2069642342E+01
etotal9 -1.2073328672E+01
etotal1 -1.1628880677E+01
etotal2 -1.1828052470E+01
etotal3 -1.1921833945E+01
etotal4 -1.1976374633E+01
etotal5 -1.2017601960E+01
etotal6 -1.2046855404E+01
etotal7 -1.2062173253E+01
etotal8 -1.2069642342E+01
etotal9 -1.2073328672E+01
You can check that the etotal convergence (at the 1 mHartree level) is not
achieved for ecut = 24 Hartree.
achieved for $e_{cut} = 14$ Hartree.
###3.b. Convergence with respect to ecut in the PAW case###
###3.b. Projector Augmented-Wave case###
Use the same input files as in section **1.a**.
Again, modify the last line of *tpaw1_2.in*, replacing the *PseudosTM_pwteter/6c.pspnc* file by *C.LDA_PW-JTH.xml*.
Run the code again and open the output file. You should obtain the values:
Use the same input file as in section **3.a**.
Again, modify the last line of *tpaw1_2.abi*, replacing the *PseudosTM_pwteter/6c.pspnc* file
by *Pseudodojo_paw_pw_standard/C.xml*.
Run the code again and open the ABINIT output file (_.abo_). You should obtain the values:
etotal1 -1.1404413200E+01
etotal2 -1.1496546303E+01
etotal3 -1.1518699851E+01
etotal4 -1.1524923431E+01
etotal5 -1.1526676260E+01
etotal6 -1.1526950267E+01
etotal7 -1.1526965855E+01
etotal8 -1.1527043191E+01
etotal9 -1.1527176114E+01
etotal1 -1.1404460615E+01
etotal2 -1.1496598029E+01
etotal3 -1.1518754947E+01
etotal4 -1.1524981521E+01
etotal5 -1.1526736707E+01
etotal6 -1.1527011746E+01
etotal7 -1.1527027274E+01
etotal8 -1.1527104066E+01
etotal9 -1.1527236307E+01
You can check that:
The _etotal_ convergence (at 1 mHartree) is achieved for _14 <= ecut <= 16 Hartree_
The _etotal_ convergence (at 1 mHartree) is achieved for _$14 \le e_{cut} \le 16$ Hartree_
(_etotal5_ is within 1 mHartree of the final value);
With the same input parameters, for diamond, **a PAW calculation needs a lower cutoff,
@ -311,39 +311,38 @@ compared to a calculation with NCPPs**.
In a NCPP calculation, the _plane wave_ density grid should be (at least) twice bigger
than the wavefunctions grid, in each direction.
In a PAW calculation, the _plane wave_ density grid is tunable
thanks to the input variable [[pawecutdg]] (PAW: ECUT for Double Grid). This
is mainly needed to allow the mapping of densities and potentials, located
in the augmentation regions (spheres), onto the global FFT grid.
thanks to the input variable [[pawecutdg]] (PAW: ECUT for Double Grid).
This is mainly needed to allow the mapping of densities and potentials, located
in the augmentation regions (spheres), onto the global FFT grid.
The number of points of the Fourier grid located in the spheres must be large
enough to preserve a minimal accuracy. It is determined from the cut-off energy
[[pawecutdg]]. An alternative is to use directly the input variable
[[ngfftdg]]. One of the most sensitive objects affected by this "grid
[[pawecutdg]].
One of the most sensitive objects affected by this "grid
transfer" is the compensation charge density; its integral over the
augmentation regions (on spherical grids) must cancel with its integral over
the whole simulation cell (on the FFT grid).
Use now the input file *tpaw1_3.in* .
The only difference with the *tpaw1_2.in* file is that [[ecut]] is fixed to 12
Use now the input file *tpaw1_3.abi*.
The only difference with the *tpaw1_2.abi* file is that [[ecut]] is fixed to 12
Ha, while [[pawecutdg]] runs from 12 to 39 Ha.
{% dialog tests/tutorial/Input/tpaw1_3.in %}
{% dialog tests/tutorial/Input/tpaw1_3.abi %}
Launch ABINIT with these files; you should obtain the values (file *tpaw1_3.abo*):
etotal1 -1.1518150865E+01
etotal2 -1.1518273022E+01
etotal3 -1.1518608846E+01
etotal4 -1.1518744552E+01
etotal5 -1.1518729256E+01
etotal6 -1.1518683931E+01
etotal7 -1.1518660738E+01
etotal8 -1.1518667056E+01
etotal9 -1.1518682154E+01
etotal10 -1.1518697442E+01
etotal1 -1.1518201683E+01
etotal2 -1.1518333032E+01
etotal3 -1.1518666700E+01
etotal4 -1.1518802859E+01
etotal5 -1.1518785111E+01
etotal6 -1.1518739739E+01
etotal7 -1.1518716669E+01
etotal8 -1.1518723268E+01
etotal9 -1.1518738376E+01
etotal10 -1.1518752752E+01
We see that the variation of the energy wit respect to the [[pawecutdg]] parameter is well
below the 1 mHa level.
We see that the variation of the energy with respect to the [[pawecutdg]] parameter is well
below the 1 mHa level.
In principle, it should be sufficient to choose
pawecutdg = 12 Ha in order to obtain an energy change lower than 1 mHa.
In practice, it is better to keep a security margin. Here, for pawecutdg = 24 Ha
@ -363,8 +362,8 @@ possible to check it in the output file, just after the SCF cycle by looking at:
PAW TEST:
==== Compensation charge inside spheres ============
The following values must be close to each other ...
Compensation charge over spherical meshes = 0.252496383260266
Compensation charge over fine fft grid = 0.252495562362116
Compensation charge over spherical meshes = 0.252499599273249
Compensation charge over fine fft grid = 0.252497392737764
```
The two values of the integrated compensation charge density must be close to each other.
@ -373,33 +372,21 @@ over a radial grid does not use the same scheme as integration over a FFT grid).
_Additional test_:
We want now to check the convergence with respect to [[ecut]] with a fixed value [[pawecutdg]] = 24 Ha.
Let's modify *tpaw1_2.in* file, setting pawecutdg to 24 Ha, and let's launch ABINIT again.
Let's modify *tpaw1_2.abi* file, setting pawecutdg to 24 Ha, and let's launch ABINIT again.
You should obtain the values:
etotal1 -1.1404443407E+01
etotal2 -1.1496575772E+01
etotal3 -1.1518729256E+01
etotal4 -1.1524953006E+01
etotal5 -1.1526706024E+01
etotal6 -1.1526980122E+01
etotal7 -1.1526995701E+01
etotal8 -1.1527072969E+01
etotal9 -1.1527205784E+01
etotal1 -1.1628880677E+01
etotal2 -1.1828052470E+01
etotal3 -1.1921833945E+01
etotal4 -1.1976374633E+01
etotal5 -1.2017601960E+01
etotal6 -1.2046855404E+01
etotal7 -1.2062173253E+01
etotal8 -1.2069642342E+01
etotal9 -1.2073328672E+01
You can check again that:
The _etotal_ convergence (at the 1 mHartree level) is achieved for 14 <= ecut <= 16 Hartree;
!!! Note
Associated with the input variable [[pawecutdg]] is the input variable
[[ngfftdg]]: it defines the size of the FFT grid associated with [[pawecutdg]].
Note that [[pawecutdg]] is only useful to define the FFT grid for the density
in a convenient way. You can therefore tune directly [[ngfftdg]] to define the
size of the FFT grid for the density.
You can check again that the _etotal_ convergence (at the 1 mHartree level)
is achieved for $14 \le e_{cut} \le 16$ Hartree.
!!! Note
@ -416,35 +403,39 @@ The _etotal_ convergence (at the 1 mHartree level) is achieved for 14 <= ecut <=
## 5. Plotting PAW contributions to the Density of States (DOS)
We now use the input file *tpaw1_4.in* file.
We now use the input file *tpaw1_4.abi* file.
ABINIT is used to compute the Density Of State (DOS)
(see the [[prtdos]] keyword in the input file).
Also note that more k-points are used in order to increase the accuracy of the DOS.
[[ecut]] is set to 12 Ha, while [[pawecutdg]] is 24 Ha.
{% dialog tests/tutorial/Input/tpaw1_4.in %}
{% dialog tests/tutorial/Input/tpaw1_4.abi %}
Launch the code with these files; you should obtain the *tpaw1_4.abo* and the DOS file (*tpaw1_4o_DOS*):
abinit tpaw1_4.in > log 2> err &
abinit tpaw1_4.abi >& log
You can plot the DOS file if you want; for this purpose, use a graphical tool
and plot column 3 with respect to column 2. If you use the |xmgrace| tool, launch:
You can plot the DOS file; for this purpose, use a graphical tool
and plot column 3 with respect to column 2.
Example: if you use the |xmgrace| tool, launch:
xmgrace -block tpaw1_4o_DOS -bxy 1:2
At this stage, you have a usual Density of State plot; nothing specific to PAW.
Now, edit the *tpaw1_4.in* file, comment the "prtdos 1" line, and uncomment (or add):
Now, edit the *tpaw1_4.abi* file, comment the "prtdos 1" line, and uncomment (or add):
prtdos 3 pawprtdos 1 natsph 1 iatsph 1 ratsph 1.51
prtdos 3
pawprtdos 1
natsph 1 iatsph 1
ratsph 1.51
[[prtdos]] 3 now requires the output of the projected DOS;
[[natsph]] 1 [[iatsph]] 1 [[ratsph]] 1.51 selects the first carbon atom as
the center of projection, and sets the radius of the projection area to 1.51
[[prtdos]]=3 requires the output of the projected DOS;
[[natsph]]=1, [[iatsph]]=1 select the first carbon atom as
the center of projection, and [[ratsph]]=1.51 sets the radius of the projection area to 1.51
atomic units (this is exactly the radius of the PAW augmentation regions:
generally the best choice).
The [[pawprtdos]] 1 is specific to PAW.
generally the best choice).
[[pawprtdos]]=1 is specific to PAW.
With this option, ABINIT should compute all the contributions to the projected DOS.
Let us remember that:
@ -460,11 +451,11 @@ Within PAW, the total projected DOS has 3 contributions:
2. The all-electron on-site (AE) contribution (from $\langle \tprj^a_i|\tPsi\rangle |\phi_i^a\rangle$),
3. The pseudo on-site (PS) contribution (from $\langle \tprj^a_i|\tPsi\rangle |\tphi_i^a\rangle$).
Launch ABINIT again (with the modified input file).
Execute ABINIT again (with the modified input file).
You get a new DOS file, named *tpaw1_4o_DOS_AT0001*.
You can edit it and look inside; it contains the 3 PAW contributions
(mentioned above) for each angular momentum. In the diamond case, only $l = 0$ and
$l = 1$ momenta are to be considered.
(mentioned above) for each angular momentum.
_In the diamond case, only $l = 0$ and $l = 1$ momenta are to be considered_.
Now, plot the file, using the 7th, 12th and 17th columns with respect to the
2nd one; it plots the 3 PAW contributions for $l = 0$ (the total DOS is the sum of
@ -478,8 +469,8 @@ You should get this:
![Projected DOS - 4 proj](paw1_assets/DOS-4proj.jpg)
As you can see, the smooth PW contribution and the PS on-site contribution are close. At basis completeness,
they should cancel; we could approximate the DOS by the AE on-site part taken alone.
That's exactly the purpose of the [[pawprtdos]] = 2 option; in that case, only the AE
they should cancel; we could approximate the DOS by the AE on-site part taken alone.
That's exactly the purpose of the [[pawprtdos]] = 2 option: in that case, only the AE
on-site contribution is computed and given as a good approximation of the
total projected DOS. The main advantage of this option is that the computing time is
greatly reduced (the DOS is instantaneously computed).
@ -496,25 +487,31 @@ _partial waves_ per angular momentum. It is generally the best compromise
between the completeness of the partial wave basis and the efficiency of the
PAW dataset (the more _partial waves_ you have, the longer the CPU time used by ABINIT is).
Let's have a look at the *$ABI_PSPDIR/C.LDA_PW-JTH.xml* file.
The tag "<valence_states" has 4 "<state" lines. This indicates the number of partial waves (4) and their $l$ angular momentum.
In the present file, there are `two l = 0 partial waves and two l = 1 partial waves`.
Let's have a look at the *<span style="color:green">\$ABI_PSPDIR/Pseudodojo_paw_pw_standard/C.xml</span>* file.
The tag <span style="color:green"><valence_states</span> has 4
<span style="color:green"><state</span> lines. This indicates the number of partial
waves (4) and their $l$ angular momentum. In the present file, there are two $l = 0$
partial waves and two $l = 1$ partial waves.
Now, let's open the *\$ABI_PSPDIR/C.LDA_PW-2proj-JTH.xml*
and *\$ABI_PSPDIR/C.LDA_PW-6proj-JTH.xml* files.
In the first file, only one _partial wave_ per $l$ is present; in the second one, 3 _partial
waves_ per $l$ are present.
The completeness of the partial wave basis increases when you use *C.LDA_PW-2proj-JTH.xml*,
*C.LDA_PW-JTH.xml* and *C.LDA_PW-6proj-JTH.xml*.
Now, let's open the *<span style="color:green">\$ABI_PSPDIR/C_paw_pw_2proj.xml</span>*
and *<span style="color:green">\$ABI_PSPDIR/C_paw_pw_6proj.xml</span>* PAW dataset files.
The first dataset is based on only **one** _partial wave_ per $l$; the second one is based on
**three** _partial waves_ per $l$.
The completeness of the partial wave basis increases when you use
*<span style="color:green">C_paw_pw_2proj.xml</span>*,
*<span style="color:green">Pseudodojo_paw_pw_standard/C.xml</span>*
and *<span style="color:green">C_paw_pw_6proj.xml</span>*.
Now, let us plot the DOS for the two new PAW datasets.
Now, let us plot the DOS using the two new PAW datasets.
1. Save the existing *tpaw1_4o_DOS_AT0001* file, naming it f.i. *tpaw1_4o_4proj_DOS_AT0001*.
2. Open the *tpaw1_4.in* file and modify it in order to use the *C.LDA_PW-2proj-JTH.xml* PAW dataset.
3. Launch ABINIT.
2. Open the *tpaw1_4.abi* file and modify it in order to use the
*<span style="color:green">C_paw_pw_2proj.xml</span>* PAW dataset.
3. Run ABINIT.
4. Save the new *tpaw1_4o_DOS_AT0001* file, naming it f.i. *tpaw1_4o_2proj_DOS_AT0001*.
5. Open the *tpaw1_4.in* file and modify it in order to use the *C.LDA_PW-6proj-JTH.xml* PAW dataset.
6. Launch ABINIT again.
5. Open the *tpaw1_4.abi* file and modify it in order to use the
*<span style="color:green">C_paw_pw_2proj.xml</span>* PAW dataset.
6. Run ABINIT again.
7. Save the new *tpaw1_4o_DOS_AT0001* file, naming it f.i. *tpaw1_4o_6proj_DOS_AT0001*.
Then, plot the contributions to the projected DOS for the two new DOS files.
@ -528,36 +525,40 @@ Adding the DOS obtained in the previous section to the comparison, you
immediately see that the superposition of the plane wave part DOS (PW) and the PS
on-site DOS depends on the completeness of the partial wave basis!
Now, you can have a look at the 3 output files (one for each PAW dataset)
for instance in a comparison tool.
Now, you can have a look at the 3 output files (one for each PAW dataset).
A way to estimate the completeness of the partial wave basis is to compare
derivatives of total energy; if you look at the stress tensor:
```
For the 2 `partial-wave` basis: 2.88568213E-04 2.88568213E-04 2.88568213E-04 0. 0. 0.
For the 4 `partial-wave` basis: 4.97807406E-04 4.97807406E-04 4.97807406E-04 0. 0. 0.
For the 6 `partial-wave` basis: 5.38983766E-04 5.38983766E-04 5.38983766E-04 0. 0. 0.
For the 2 `partial-wave` basis: 2.85307799E-04 2.85307799E-04 2.85307799E-04 0. 0. 0.
For the 4 `partial-wave` basis: 4.97872484E-04 4.97872484E-04 4.97872484E-04 0. 0. 0.
For the 6 `partial-wave` basis: 5.38392693E-04 5.38392693E-04 5.38392693E-04 0. 0. 0.
```
The 2 *partial-wave* basis is clearly not complete; the 4 partial-wave basis results are correct.
The *2 partial-wave* basis is clearly not complete; the *4 partial-wave basis* results are correct.
Such a test is useful to estimate the precision we can expect on the stress tensor
(at least due to the partial wave basis completeness).
You can compare other results in the 3 output files: total energy, eigenvalues, occupations...
Note: if you want to learn how to generate PAW datasets with different *partial wave* basis,
you might follow the [tutorial on generating PAW datasets(PAW2)](paw2).
!!! Note
The CPU time increases with the size of the partial wave basis. This is why it is
not recommended to use systematically high-precision PAW datasets.
If you want to learn how to generate PAW datasets with different *partial wave* basis,
you might follow the [tutorial on generating PAW datasets (PAW2)](paw2).
## 7. Checking the validity of PAW results
The validity of our computation has to be checked
by comparison, on known structures, with known results.
by comparison, on known structures, with known results.
In the case of diamond, lots of computations and experimental results exist.
Very important remark: the validity of PAW calculations (**completeness of plane wave basis and
partial wave basis**) should always be checked by comparison
with **all-electrons** computations or with other existing PAW results;
it should not be done by comparison with experimental results.
As the PAW method has the same accuracy than all-electron methods, results should be very close.
!!! important
The validity of PAW calculations (**completeness of plane wave basis and
partial wave basis**) should always be checked by comparison
with **all-electrons** computations or with other existing PAW results;
it should not be done by comparison with experimental results.
As the PAW method has the same accuracy than all-electron methods, results should be very close.
In the case of diamond, all-electron results can be found f.i. in [[cite:Holzwarth1997]].
All-electron equilibrium parameters for diamond (within _Local Density Approximation_) obtained
@ -572,19 +573,19 @@ Experiments give:
B = 443 GPa
Let's test with ABINIT.
We use now the input file *tpaw1_5.in* file and we run
ABINIT to compute values of _etotal- for several cell parameters
We use now the input file *tpaw1_5.abi* file and we run
ABINIT to compute values of _etotal_ for several cell parameters
around 3.54 angstrom, using the standard PAW dataset.
{% dialog tests/tutorial/Input/tpaw1_5.in %}
{% dialog tests/tutorial/Input/tpaw1_5.abi %}
abinit tpaw1_5.in > log 2> err &
abinit tpaw1_1.abi >& log
From the *tpaw1_5.abo* file, you can extract the 7 values of _acell_ and 7 values
of _etotal_, then put them into a file and plot it with a graphical tool.
You should get:
![diamond: etotal vs acell](paw1_assets/etotal-acell.jpg)
![diamond: etotal vs acell](paw1_assets/etotal-acell.png){ width=60% }
From this curve, you can extract the cell values of $a_0$ and $B$
(with the method of your choice, for example by a Birch-Murnhagan spline fit).
@ -615,26 +616,28 @@ The overlap check can even be by-passed with [[pawovlp]]=-1 (not recommended!).
is eventually printed.
Also note that you can control the compensation charge radius and shape
function while generating the PAW dataset (see [tutorial on generating PAW datasets(PAW2)](paw2)).
function while generating the PAW dataset (see [tutorial on generating PAW datasets (PAW2)](paw2)).
### 8.b. Mixing scheme for the Self-Consistent cycle; decomposition of the total energy###
The use of an efficient **mixing scheme** in the self-consistent loop is a crucial
point to minimize the number of steps to achieve convergence.
This mixing can be done on the potential or on the density. By default, in a
Norm-Conserving PseudoPotential calculation, the mixing is done on the potential;
This mixing can be done on the potential or on the density.
By default, in a Norm-Conserving PseudoPotential calculation, the mixing is done on the potential;
but, for technical reasons, this choice is not optimal for PAW calculations.
Thus, by default, the mixing is done on the density when PAW is activated.
Thus, by default, the mixing is done on the density when PAW is activated.
The mixing scheme can be controlled by the [[iscf]] variable (see the different options of this input variable).
To compare both schemes, you can edit the *tpaw1_1.in* file and try [[iscf]] = 7
To compare both schemes, you can edit the *tpaw1_1.abi* file and try [[iscf]] = 7
or 17 and compare the behaviour of the SC cycle in both cases; as you can see, the
final _total energy_ is the same but the way to reach it is completely different.
Now, have a look at the end of the file and focus on the `Components of total
free energy`; the total energy is decomposed according to two different schemes (`direct` and `double counting`);
at very high convergence of the SCF cycle the potential/density
residual is very small and these two values should be the same. But it has been observed that
residual is very small and these two values should be the same.
But it has been observed that
the converged value was reached more rapidly by the `direct` energy, when the
mixing is on the potential, and by the `double counting` energy when the mixing
is on the density. Thus, by default, in the output file is to print the direct
@ -661,6 +664,7 @@ computed; it is indeed a very good approximation.
Converging a _Self-Consistent Cycle_, or ensuring the global minimum is reached,
with PAW+U is sometimes difficult. Using [[usedmatpu]] and [[dmatpawu]] can help.
See [tutorial on DFT+U](dftu).
### 8.d. Printing volume for PAW###
@ -673,55 +677,10 @@ $D_{ij}$ or _partial waves occupancies_ $\rho_{ij}$.
Looking at the [[varset:paw|PAW variable set]], you can find the description
of additional input keywords related to PAW.
They are to be used when tuning the computation, in order to gain accuracy or save CPU time.
They are to be used when tuning the computation, in order to gain accuracy or save CPU time.
See also descriptions of these variables and input file examples in the [[topic:PAW|PAW topic]] page.
!!! Warning
In a standard computation, these variables should not be modified!
**Variables that can be used to gain accuracy (in ascending order of importance)**
[[pawxcdev]]
: Control of the accuracy of exchange-correlation on-site potentials
(try [[pawxcdev]] = 2 to increase accuracy).
[[mqgriddg]]
: Control of the accuracy of spline fits to transfer densities/potentials from FFT grid to spherical grid.
[[pawnzlm]]
: Control how the symmetries are applied to compute the moments of spherical densities.
**Variables that can be used to save memory (in ascending order of importance)**
[[pawstgylm]]
: Control of the storage of spherical harmonics around atoms.
[[pawmixdg]]
: Control the grid used to mix the potential/density during SCF cycles.
[[pawlcutd]]
: Control of the number of angular momenta taken into account in on-site densities.
[[pawlmix]]
: Control of the number of $\rho_{ij}$ components to be mixed during SCF cycle.
**Variables that can be used to save CPU time (in ascending order of importance)**
[[pawnhatxc]]
: Control of the numerical treatment of gradients in case of GGA.
[[pawstgylm]]
: Control of the storage of spherical harmonics around atoms.
[[pawlcutd]]
: Control of the number of angular momenta taken into account in on-site densities.
[[pawlmix]]
: Control of the number of $\rho_{ij}$ components to be mixed during SCF cycle.
[[bxctmindg]]
: Can be used to decrease the size of fine FFT grid for a given value of [[pawecutdg]].
!!! Note
The above list is not exhaustive.
Several other keywords can be used to tune ABINIT PAW calculations.

Binary file not shown.

Before

Width:  |  Height:  |  Size: 30 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 95 KiB

View File

@ -6,7 +6,7 @@ authors: MT
## Generation of PAW atomic datasets
This tutorial aims at showing how to compute atomic datasets for the Projector Augmented-Wave (PAW) method.
This tutorial aims at showing how to create your own atomic datasets for the Projector Augmented-Wave (PAW) method.
You will learn how to generate these atomic datasets and how to control their softness and transferability.
You already should know how to use ABINIT in the PAW case (see the tutorial [PAW1](paw1) ).
@ -21,7 +21,7 @@ The PAW method is based on the definition of spherical augmentation
regions of radius $r_c$ around the atoms of the system in which a basis of
atomic **partial-waves** $\phi_i$, of **pseudized partial-waves** $\tphi_i$, and of **projectors** $\tprj_i$
(dual to $\tphi_i$) have to be defined. This set of _partial-waves_ and _projectors_
functions (plus some additional atomic data) are stored in a so-called **PAW dataset**.
functions (and some additional atomic data) are stored in a so-called **PAW dataset**.
A PAW dataset has to be generated for each atomic species in order
to reproduce atomic behavior as accurate as possible while requiring minimal
CPU and memory resources in executing ABINIT for the crystal simulations.
@ -87,19 +87,37 @@ mkdir Work_paw2
cd Work_paw2
```
You have now to install the `ATOMPAW` code. Try to type in your browser:
You have now to install the `ATOMPAW` code. In your internet browser, enter the following URL:
https://users.wfu.edu/natalie/papers/pwpaw/atompaw-4.1.0.6.tar.gz
https://users.wfu.edu/natalie/papers/pwpaw/
Then, download the file, unzip and untar it.Go into the directory "doc", open the file "atompaw-usersguide.pdf". Go p.3 and follow the instructions to compile atompaw.
Then, download the last version of the `tar.gz` file, unzip and untar it.
Enter the `atompaw-4.x.y.z` and execute:
```sh
mkdir build
cd build
../configure
make
```
if all goes well, you get the `ATOMPAW` executable at
<span style="color:green">atompaw-4.x.y.z/build/src/atompaw</span>.
If not, Go into the directory <span style="color:green">doc</span>, open the file <span style="color:green">atompaw-usersguide.pdf</span>, go p.3 and follow the instructions.
!!! Note
On MacOS, you can use [[https://brew.sh|homebrew]] package manager and install `ATOMPAW` by typing:
```sh
brew install atompaw/repo/atompaw
```
!!! Note
In the following, we name *atompaw* the `ATOMPAW` executable.
**How to use `ATOMPAW`?**
The following process will be applied to Ni in the next paragraph:
The following process will be applied to **Nickel** in the next paragraph:
1. Edit an input file in a text editor (content of input explained [here](paw2_assets/atompaw-usersguide.pdf))
2. Run: *atompaw < inputfile*
@ -112,12 +130,12 @@ can be found in the `Atom_name` file (`Atom_name` is the first parameter of the
Resulting PAW dataset is contained in:
`Atom_name.XCfunc.xml` file
: Normalized XML file according to the
[PAW- XML specifications](https://esl.cecam.org/Paw-xml).
- `Atom_name.XCfunc.xml` file
Normalized XML file according to the
[PAW- XML specifications](https://esl.cecam.org/Paw-xml) (recommended).
`Atom_name.XCfunc-paw.abinit` file
: Proprietary legacy format for ABINIT
- `Atom_name.XCfunc-paw.abinit` file
Proprietary legacy format for ABINIT
## 3. First (and basic) PAW dataset for Nickel
@ -125,7 +143,7 @@ Resulting PAW dataset is contained in:
Our test case will be nickel; electronic configuration: $[1s^2 2s^2 2p^6 3s^2 3p^6 3d^8 4s^2 4p^0]$.
In a first stage, copy a simple input file for `ATOMPAW` in your working directory
(find it in *\$\ABI_HOME/doc/tutorial/paw2/paw2_assets/Ni.atompaw.input1*).
(find it in <span style="color:green">*\$ABI_HOME/doc/tutorial/paw2/paw2_assets/Ni.atompaw.input1*</span>).
Edit this file.
{% dialog tutorial/paw2_assets/Ni.atompaw.input1 %}
@ -204,15 +222,13 @@ means:
```
2
```
* A line with the <span style="color:green">$r_{PAW}$</span> radius.
_Select it to be slightly less than half the inter-atomic distance
in the solid (as a first choice). Here $r_{PAW}=2.3 a.u$.
If only one radius is input, all others pseudization radii will be equal
to $r_{PAW}$ ($r_c$, $r_{core}$, $r_{Vloc}$ and $r_{shape}$)._
* A line with the <span style="color:green">$r_{PAW}$</span> radius.
_Select it to be slightly less than half the inter-atomic distance
in the solid (as a first choice). Here $r_{PAW}=2.3\ a.u$._
```
2.3
```
* Next lines: add <span style="color:green">additional _partial-waves_</span> $\phi_i$ if needed.
* Next lines: add <span style="color:green">additional _partial-waves_</span> $\phi_i$ if needed.
Choose to have 2 partial-waves per angular momentum in the basis (this choice is not
necessarily optimal but this is the most common one; if $r_{PAW}$ is small enough,
1 partial-wave per $l$ may suffice).
@ -230,19 +246,19 @@ means:
0.5
n
```
means that an additional $s$\- partial-wave at $E_{ref}=0.5 Ry$ as been added,
means that an additional $s$\- partial-wave at $E_{ref}=0.5$ Ry as been added,
```
y
1.
n
```
means that an additional $p$\- partial-wave at $E_{ref}=1. Ry$ has been added,
means that an additional $p$\- partial-wave at $E_{ref}=1.$ Ry has been added,
```
y
1.
n
```
means that an additional $d$- partial-wave at $E_{ref}=1. Ry$ as been added.
means that an additional $d$- partial-wave at $E_{ref}=1.$ Ry as been added.
Finally, partial-waves basis contains two $s$\-, two $p$\- and two $d$\- partial-waves.
* Next line: definition of the <span style="color:green">generation scheme for pseudo partial
waves $\tphi_i$</span>, and of projectors $\tprj_i$.
@ -254,21 +270,21 @@ Finally, partial-waves basis contains two $s$\-, two $p$\- and two $d$\- partia
* Next line: <span style="color:green">generation scheme for local pseudopotential
$V_{loc}$</span>. In order to get PS partial-waves, the atomic potential has to be "pseudized"
using an arbitrary pseudization scheme.
*We choose here a "Troullier-Martins" using a wave equation at $l_{loc}=3$ and $E_{loc}=0. Ry$.
As a first draft, it is always recommended to put $l_{loc}=1+lmax$.*
*We choose here a "Troullier-Martins" using a wave equation at $l_{loc}=3$ and $E_{loc}=0.$ Ry.
As a first draft, it is always recommended to put $l_{loc}=1+l_{max}$.*
```
3 0. troulliermartins
```
* Next two lines: `ABINITOUT` makes `ATOMPAW` generate a PAW dataset for ABINIT;
* Next two lines: `XMLOUT` makes `ATOMPAW` generate a PAW dataset in XML format;
The next line contains options for this ABINIT file. "default" set all parameters to their default value.
```
XMLOUT
default
```
* A `0` (zero) to end the file.
* The `END` keyword ends the file.
```
0
END
```
At this stage, run `ATOMPAW`. For this purpose, simply enter:
@ -277,117 +293,117 @@ At this stage, run `ATOMPAW`. For this purpose, simply enter:
Lot of files are produced. We will examine some of them.
A summary of the PAW dataset generation process has been written in a file
named `Ni` (name extracted from first line of input file).
named `Ni`.
Open it. It should look like:
Completed calculations for Ni
Exchange-correlation type: GGA, Perdew-Burke-Ernzerhof
Radial integration grid is logarithmic
r0 = 2.2810899E-04 h = 6.3870518E-03 n = 2000 rmax = 8.0000000E+01
Scalar relativistic calculation
AEatom converged in 28 iterations
for nz = 28.00
delta = 4.0124038786859556E-017
All Electron Orbital energies:
n l occupancy energy
1 0 2.0000000E+00 -6.0358607E+02
2 0 2.0000000E+00 -7.2163318E+01
3 0 2.0000000E+00 -8.1627107E+00
4 0 2.0000000E+00 -4.1475541E-01
2 1 6.0000000E+00 -6.2083048E+01
3 1 6.0000000E+00 -5.2469208E+00
4 1 0.0000000E+00 -9.0035739E-02
3 2 8.0000000E+00 -6.5223644E-01
Completed calculations for Ni
Exchange-correlation type: GGA, Perdew-Burke-Ernzerhof
Radial integration grid is logarithmic
r0 = 2.2810899E-04 h = 6.3870518E-03 n = 2000 rmax = 8.0000000E+01
Scalar relativistic calculation
AEatom converged in 32 iterations
for nz = 28.00
delta = 9.5504321957145377E-017
All Electron Orbital energies:
n l occupancy energy
1 0 2.0000000E+00 -6.0358607E+02
2 0 2.0000000E+00 -7.2163318E+01
3 0 2.0000000E+00 -8.1627107E+00
4 0 2.0000000E+00 -4.1475541E-01
2 1 6.0000000E+00 -6.2083048E+01
3 1 6.0000000E+00 -5.2469208E+00
4 1 0.0000000E+00 -9.0035739E-02
3 2 8.0000000E+00 -6.5223644E-01
Total energy
Total : -3041.0743834043615
Completed calculations for Ni
Exchange-correlation type: GGA, Perdew-Burke-Ernzerhof
Radial integration grid is logarithmic
r0 = 2.2810899E-04 h = 6.3870518E-03 n = 2000 rmax = 8.0000000E+01
Scalar relativistic calculation
SCatom converged in 3 iterations
for nz = 28.00
delta = 3.0160553423681305E-018
Valence Electron Orbital energies:
n l occupancy energy
4 0 2.0000000E+00 -4.1475541E-01
4 1 0.0000000E+00 -9.0035739E-02
3 2 8.0000000E+00 -6.5223644E-01
Total energy
Total : -3041.0743834110435
Completed calculations for Ni
Exchange-correlation type: GGA, Perdew-Burke-Ernzerhof
Radial integration grid is logarithmic
r0 = 2.2810899E-04 h = 6.3870518E-03 n = 2000 rmax = 8.0000000E+01
Scalar relativistic calculation
SCatom converged in 1 iterations
for nz = 28.00
delta = 8.7786021384577619E-017
Valence Electron Orbital energies:
n l occupancy energy
4 0 2.0000000E+00 -4.1475541E-01
4 1 0.0000000E+00 -9.0035739E-02
3 2 8.0000000E+00 -6.5223644E-01
Total energy
Total : -3041.0743834044238
Valence : -185.18230020220784
paw parameters:
lmax = 2
rc = 2.3096984974114871
irc = 1445
Vloc: Norm-conserving Troullier-Martins with l= 3;e= 0.0000E+00
Projector type: Bloechl + Gram-Schmidt ortho.
Sinc^2 compensation charge shape zeroed at rc
Total energy
Total : -3041.0743834029249
Valence : -185.18230020196870
paw parameters:
lmax = 2
rc = 2.3096984974114871
irc = 1445
Vloc: Norm-conserving Troullier-Martins with l= 3;e= 0.0000E+00
Projector type: Bloechl + Gram-Schmidt ortho.
Sinc^2 compensation charge shape zeroed at rc
Number of basis functions 6
No. n l Energy Cp coeff Occ
1 4 0 -4.1475541E-01 -9.5091487E+00 2.0000000E+00
2 999 0 5.0000000E-01 3.2926948E+00 0.0000000E+00
3 4 1 -9.0035739E-02 -8.9594191E+00 0.0000000E+00
4 999 1 1.0000000E+00 1.0610645E+01 0.0000000E+00
5 3 2 -6.5223644E-01 9.1576184E+00 8.0000000E+00
6 999 2 0.0000000E+00 1.3369076E+01 0.0000000E+00
Completed diagonalization of ovlp with info = 0
Number of basis functions 6
No. n l Energy Cp coeff Occ
1 4 0 -4.1475541E-01 -9.5091487E+00 2.0000000E+00
2 999 0 5.0000000E-01 3.2926948E+00 0.0000000E+00
3 4 1 -9.0035739E-02 -8.9594191E+00 0.0000000E+00
4 999 1 1.0000000E+00 1.0610645E+01 0.0000000E+00
5 3 2 -6.5223644E-01 9.1576184E+00 8.0000000E+00
6 999 2 0.0000000E+00 1.3369076E+01 0.0000000E+00
Completed diagonalization of ovlp with info = 0
Eigenvalues of overlap operator (in the basis of projectors):
1 7.27257365E-03
2 2.25491432E-02
3 1.25237568E+00
4 1.87485118E+00
5 1.05720648E+01
6 2.00807906E+01
Summary of PAW energies
Total valence energy -185.18230536120760
Smooth energy 11.667559552612433
One center -196.84986491382003
Smooth kinetic 15.154868503980399
Vloc energy -2.8094614733964467
Smooth exch-corr -3.3767012052640886
One-center xc -123.07769380742522
Eigenvalues of overlap operator (in the basis of projectors):
1 7.27257366E-03
2 2.25491432E-02
3 1.25237568E+00
4 1.87485118E+00
5 1.05720648E+01
6 2.00807906E+01
Summary of PAW energies
Total valence energy -185.18230536144634
Smooth energy 11.667559551752486
One center -196.84986491319881
Smooth kinetic 15.154868504786746
Vloc energy -2.8094614747336673
Smooth exch-corr -3.3767012054581866
One-center xc -123.07769380744551
This generated PAW dataset (contained in *Ni.atomicdata*, *Ni.GGA-PBE-paw.abinit*
or *Ni.GGA-PBE.xml* file) is a first draft.
The generated PAW dataset (contained in <span style="color:green">Ni.GGA-PBE.xml</span> file) is a first draft.
Several parameters have to be adjusted, in order to get accurate results and efficient DFT calculations.
!!! Note
Only *Ni.GGA-PBE-paw.abinit* or *Ni.GGA-PBE-paw.xml* files are directly usable by ABINIT.
The <span style="color:green">Ni.GGA-PBE.xml</span> file is directly usable by ABINIT.
## 4. Checking the sensitivity of results to some parameters
## 4. Checking the sensitivity to some parameters
### 4.a. The radial grid
Try to select 700 points in the logarithmic grid and check if any noticeable
Let's try to select **700 points** in the logarithmic grid and check if any noticeable
difference in the results appears.
You just have to replace `2000` by `700` in the second line of *Ni.atompaw.input1* file.
You just have to replace `2000` by `700` in the second line of <span style="color:green">Ni.atompaw.input1</span> file.
Then run:
atompaw < Ni.atompaw.input1
again and look at the Ni file:
again and look at the `Ni` file:
Summary of PAW energies
Total valence energy -185.18230025525258
Smooth energy 11.634042250372509
One center -196.81634250562510
Smooth kinetic 15.117781978173387
Vloc energy -2.8024659321889955
Smooth exch-corr -3.3712015020489359
One-center xc -123.08319452733129
Summary of PAW energies
Total valence energy -185.18230027710337
Smooth energy 11.634042318422193
One center -196.81634259552555
Smooth kinetic 15.117782033814152
Vloc energy -2.8024659321861067
Smooth exch-corr -3.3712015132649102
One-center xc -123.08319475096027
As you see, results obtained with this new grid are very close to previous ones, expecially the `valence energy`.
We can keep the 700 points grid.
We can keep the **700 points** grid.
We could try to decrease the size of the grid.
Small grids give PAW dataset with small size (in kB) and run faster in ABINIT,
but accuracy can be affected.
!!! Note
We could try to decrease the size of the grid.
Small grids give PAW dataset with small size (in kB) and run faster in ABINIT,
but accuracy can be affected.
!!! Note
The final $r_{PAW}$ value (`rc = ...` in `Ni` file) changes with the
@ -403,18 +419,18 @@ If convergence cannot be reached, try a non-relativistic calculation (not recomm
!!! Note
For the following, note that you always should check the `Ni` file, especially
the values of 'valence energy'. You can find the valence energy
the values of `valence energy`. You can find the valence energy
computed for the exact atomic problem and the valence energy computed with the
PAW parameters. These two results should be in close agreement!
## 5. Adjusting partial-waves and projectors
Examine the AE partial-waves $\phi_i$, PS partial-waves $\tphi_i$ and projectors $\tprj_i$.
These are saved in files respectively named `wfni`, where `i` ranges over the number of partial-waves
These are saved in files named `wfni`, where `i` ranges over the number of partial-waves
used, so 6 in the present example.
Each file contains 4 columns: the radius $r$ in column 1,
the AE partial-wave $\phi_i(r)$ in column 2, the PS partial-wave $\tphi_i(r)$ in
column 3, and the projector $\tprj_i(r)$ in column 4.
column 3, and the projector $\tprj_i(r)$ in column 4.
Plot the 3 curves as a function of radius using a plotting tool of your choice.
Below the first $s$\- partial-wave /projector of the Ni example:
@ -439,11 +455,11 @@ Example: plot the `wfn6` file, related to the second $d$- partial-wave:
![2nd d partial-wave](paw2_assets/wfn6a.jpg)
This partial-wave has been generated at $E_{ref}=0~Ry$ and orthogonalized with the
first $d$\- partial-wave which has an eigenenergy equal to $-0.65~Ry$ (see `Ni` file).
This partial-wave has been generated at $E_{ref}=0$ Ry and orthogonalized with the
first $d$\- partial-wave which has an eigenenergy equal to $-0.65$ Ry (see `Ni` file).
These two energies are too close and orthogonalization process produces "high" partial-waves.
Try to replace the reference energy for the additional $d$\- partial-wave.
For example, put $E_{ref}=1.~Ry$ instead of $E_{ref}=0.~Ry$ (line 24 of `Ni.atompaw.input1` file).
For example, put $E_{ref}=1.$ Ry instead of $E_{ref}=0.$ Ry (line 24 of `Ni.atompaw.input1` file).
Run `ATOMPAW` again and plot `wfn6` file:
@ -463,8 +479,8 @@ $\frac{d(log(\Psi_l(E))}{dE}$ computed for the exact atomic problem and with the
They are printed in the `logderiv.l` files. Each `logderiv.l` file corresponds to an
angular momentum $l$ and contains five columns of data: the
energy, the logarithmic derivative of the $l$-state of the exact atomic problem,
the logarithmic derivative of the pseudized problem and two other colums that do not matter for this section. In the following, when you edit a loderiv file, only edit the three first columns.
In our Ni example, $l=0$, $1$ or $2$.
the logarithmic derivative of the pseudized problem (and two other colums not relevant for this section). In the following, when you edit a `logderiv` file, only edit the three first columns.
In our `Ni` example, $l=0$, $1$ or $2$.
The logarithmic derivatives should have the following properties:
@ -472,7 +488,7 @@ The logarithmic derivatives should have the following properties:
By construction, they are superimposed at the 2 energies corresponding to the 2 $l$ partial-waves.
If the superimposition is not good enough, the reference energy for the second $l$ partial-wave should be changed.
* Generally a discontinuity in the logarithmic derivative curve appears at $0~Ry<=E_0<=4~Ry$.
* Generally a discontinuity in the logarithmic derivative curve appears at $0$ Ry $\le E_0\le 4$ Ry.
A reasonable choice is to choose the 2 reference energies so that $E_0$ is in between.
* Too close reference energies produce "hard" projector functions
@ -487,17 +503,18 @@ Here are the three logarithmic derivative curves for the current dataset:
![l=2 logderivatives](paw2_assets/log2a.jpg)
As you can see, except for $l=2$, exact and PAW logarithmic derivatives do not match!
As you can see, except for $l=2$, exact and PAW logarithmic derivatives do not match!
According to the previous remarks, try other values for the references
energies of the $s$\- and $p$\- additional partial-waves.
First, edit again the `Ni.atompaw.input1` file and put $E_{ref}=3~Ry$ for the
energies of the $s$\- and $p$\- additional partial-waves.
First, edit again the <span style="color:green">Ni.atompaw.input1</span> file and put $E_{ref}=3$ Ry for the
additional $s$\- state (line 18); run `ATOMPAW` again. Plot the `logderiv.0` file.
You should get:
![l=0 log derivatives](paw2_assets/log0b.jpg)
Then put $E_{ref}=4~Ry$ for the second $p$\- state (line 21); run `ATOMPAW` again.
Plot again the `logderiv.1` file. You should get:
Then put $E_{ref}=4$ Ry for the second $p$\- state (line 21); run `ATOMPAW` again.
Plot again the `logderiv.1` file.
You should get:
![l=1 log derivatives](paw2_assets/log1b.jpg)
@ -506,14 +523,14 @@ Now, all PAW logarithmic derivatives match with the exact ones in a reasonable i
!!! Note
It is possible to change the interval of energies used to plot logarithmic
derivatives (default is $[-5;5]$) and also to compute them at more points
(default is 200). Just add the following keywords at the end of the SECOND
(default is $200$). Just add the following keywords at the end of the SECOND
LINE of the input file if you want `ATOMPAW` to output logarithmic derivatives
for energies in [-10;10] at 500 points:
````
logderivrange -10 10 500
````
**Additional information concerning logarithmic derivatives: ghost states**
**Additional information related to logarithmic derivatives: ghost states**
Another possible issue could be the presence of a discontinuity in the PAW
logarithmic derivative curve at an energy where the exact logarithmic derivative is continuous.
@ -539,83 +556,85 @@ This generally shows the presence of a _ghost state_.
In most cases (changing pseudopotential or matching radius), one has to restart the procedure from step 5.
To see an example of ghost state, use the
*\$ABI_HOME/doc/tutorial/paw2_assets/Ni.ghost.atompaw.input* file and run it with `ATOMPAW`.
<span style="color:green">\$ABI_HOME/doc/tutorial/paw2_assets/Ni.ghost.atompaw.input</span> file and run it with `ATOMPAW`.
{% dialog tutorial/paw2_assets/Ni.ghost.atompaw.input %}
Look at the $l=1$ logarithmic derivatives (`logderiv.1` file). They look like:
![Ni l=1 log derivatives](paw2_assets/log1c.jpg)
Now, edit the *Ni.ghost.atompaw.input* file and replace `troulliermartins` by
`ultrasoft`. Run `ATOMPAW` again... and look at `logderiv.1` file.
The ghost state has moved!
Now, edit the <span style="color:green">Ni.ghost.atompaw.input</span> file and replace `troulliermartins` by
`ultrasoft`.
Run `ATOMPAW` again... and look at `logderiv.1` file.
The ghost state has moved!
Edit again the file and replace `troulliermartins` by `bessel` (line 28); then change the 17th
line `2.0 2.0 2.0 2.0` by `2.0 2.0 1.8 2.0` (decreasing the $r_{Vloc}$ radius from $2.0$ to $1.8$).
line `2.0 2.0 2.0 2.0` by `2.0 2.0 1.8 2.0` (decreasing the $r_{Vloc}$ radius from $2.0$ to $1.8$).
Run `ATOMPAW`: the ghost state disappears!
Start from the original state of *Ni.ghost.atompaw.input* file and put `1.6` for
Start from the original state of <span style="color:green">Ni.ghost.atompaw.input</span> file and put `1.6` for
the matching radius of $p$\- states (put `1.6` on lines 31 and 32).
Run `ATOMPAW`: the ghost state disappears!
## 7. Testing the "efficiency" of a PAW dataset
Let's use again our *Ni.atompaw.input1* file for Nickel (with all our modifications).
You get a file *Ni.GGA-PBE-paw.xml* containing the PAW dataset designated for ABINIT.
Let's use again our <span style="color:green">Ni.atompaw.input1</span> file for Nickel (with all our modifications).
You get a file <span style="color:green">Ni.GGA-PBE-paw.xml</span> containing the PAW dataset designated for ABINIT.
To test the efficiency of the generated PAW dataset, we finally will use ABINIT!
You are about to run a DFT computation and determine the size of the _plane
wave basis_ needed to reach a given accuracy. If the _cut-off energy_ defining the
_plane waves basis_ is too high (higher than 20 Hartree),
some changes have to be made in the input file.
To test the efficiency of the generated PAW dataset, we finally will use `ABINIT`!
You are about to run a DFT computation and determine the size of the **plane
wave basis** needed to reach a given accuracy. If the **cut-off energy** defining the
plane waves basis is too high (higher than `20 Hartree`), some changes have to be made in the input file.
!!! important
Copy <span style="color:green">\$ABI_TESTS/tutorial/Input/tpaw2_1.abi</span> in your working directory.
Edit it, and activate the 8 datasets (uncomment the line `ndtset 8`).
You may have to change the path to reach the Psps_for_tests repository. For this, modify the varaible `pp_dirpath` in the input file.
{% dialog tests/tutorial/Input/tpaw2_1.abi %}
Copy *\$ABI_TESTS/tutorial/Input/tpaw2_1.in* in your working directory.
Edit *tpaw2_1.in*, and activate the 8 datasets.
Run ABINIT with them.
{% dialog tests/tutorial/Input/tpaw2_1.in %}
ABINIT computes the _total energy_ of ferromagnetic FCC Nickel for several values of [[ecut]].
Run 'ABINIT'. It computes the `total energy` of ferromagnetic FCC Nickel for several values of [[ecut]].
At the end of output file, you get this:
ecut1 8.00000000E+00 Hartree
ecut2 1.00000000E+01 Hartree
ecut3 1.20000000E+01 Hartree
ecut4 1.40000000E+01 Hartree
ecut5 1.60000000E+01 Hartree
ecut6 1.80000000E+01 Hartree
ecut7 2.00000000E+01 Hartree
ecut8 2.20000000E+01 Hartree
etotal1 -3.9299840066E+01
etotal2 -3.9503112955E+01
etotal3 -3.9582704516E+01
etotal4 -3.9613343901E+01
etotal5 -3.9622927015E+01
etotal6 -3.9626266739E+01
etotal7 -3.9627470087E+01
etotal8 -3.9627833090E+01
ecut1 8.00000000E+00 Hartree
ecut2 1.00000000E+01 Hartree
ecut3 1.20000000E+01 Hartree
ecut4 1.40000000E+01 Hartree
ecut5 1.60000000E+01 Hartree
ecut6 1.80000000E+01 Hartree
ecut7 2.00000000E+01 Hartree
ecut8 2.20000000E+01 Hartree
etotal1 -3.9299840066E+01
etotal2 -3.9503112955E+01
etotal3 -3.9582704516E+01
etotal4 -3.9613343901E+01
etotal5 -3.9622927015E+01
etotal6 -3.9626266739E+01
etotal7 -3.9627470087E+01
etotal8 -3.9627833090E+01
`etotal` convergence (at 1 mHartree) is achieve for 18<=$e_{cut}$<=20 Hartree
`etotal` convergence (at 0,1 mHartree) is achieve for $e_{cut}$>22 Hartree
`etotal` convergence (at 1 mHartree) is achieve for $18 \le e_{cut} \le 20$ Hartree.
`etotal` convergence (at 0,1 mHartree) is achieve for $e_{cut} \ge 22$ Hartree.
This is not a good result for a PAW dataset; let's try to optimize it.
* 1st possibility: use `vanderbilt` projectors instead of `bloechl` ones.
* 1st possibility: use `vanderbilt` **projectors** instead of `bloechl` ones.
Vanderbilt's projectors generally are more localized in reciprocal space than
Bloechl's ones .
Keyword `bloechl` has to be replaced by `vanderbilt` in the `ATOMPAW` input file
and $r_c$ values have to be added at the end of the file (one for each PS partial-wave).
See this input file: *\$ABI_HOME/doc/tutorial/paw2_assets/Ni.atompaw.input.vanderbilt*.
See this input file:
<span style="color:green">\$ABI_HOME/doc/tutorial/paw2_assets/Ni.atompaw.input.vanderbilt</span>.
* 2nd possibility: use `RRKJ` pseudization scheme for projectors.
Use this input file for `ATOMPAW`: *\$ABI_HOME/doc/tutorial/paw2_assets/Ni.atompaw.input2*.
{% dialog tutorial/paw2_assets/Ni.atompaw.input.vanderbilt %}
* 2nd possibility: use `RRKJ` **pseudization scheme** for projectors.
Use this input file for `ATOMPAW`:
<span style="color:green">\$ABI_HOME/doc/tutorial/paw2_assets/Ni.atompaw.input2</span>.
As you can see `bloechl` has been changed by `custom rrkj`
and 6 $r_c$ values have been added at the end of the file, each one
and six $r_c$ values have been added at the end of the file, each one
corresponding to the matching radius of one PS partial-wave.
Repeat the entire procedure (`ATOMPAW` \+ `ABINIT`)... and get a new ABINIT output file.
_Note: You have check again at log derivatives._
Repeat the entire procedure (`ATOMPAW` \+ `ABINIT`)... and get a new ABINIT output file.
_Note: You have check again log derivatives._
{% dialog tutorial/paw2_assets/Ni.atompaw.input2 %}
@ -636,27 +655,28 @@ This is not a good result for a PAW dataset; let's try to optimize it.
etotal7 -3.9628436662E+01
etotal8 -3.9628455467E+01
`etotal` convergence (at 1 mHartree) is achieve for 12 <= $e_{cut}$ <= 14 Hartree
`etotal` convergence (at 0,1 mHartree) is achieve for 16 <= $e_{cut}$ <= 18 Hartree
`etotal` convergence (at 1 mHartree) is achieve for $12 \le e_{cut} \le 14$ Hartree.
`etotal` convergence (at 0,1 mHartree) is achieve for $16 \le e_{cut} \le 18$ Hartree.
This is a reasonable result for a PAW dataset!
* 3rd possibility: use _enhanced polynomial_ pseudization scheme for projectors.
Edit *\$ABI_HOME/doc/tutorial/paw2_assets/Ni.atompaw.input2* and replace `custom rrkj`
by `custom polynom2 7 10`. It may sometimes improve the ecut convergence.
* 3rd possibility: use **enhanced polynomial** pseudization scheme for projectors.
Edit
<span style="color:green">Ni.atompaw.input2</span>
and replace `custom rrkj` by `custom polynom2 7 10`. It may sometimes improve the ecut convergence.
### Optional_exercise
### Optional exercise
Let's go back to Vanderbilt projectors.
Repeat the procedure (`ATOMPAW`\ + `ABINIT`) with the
*\$ABI_HOME/doc/tutorial/paw2_assets/Ni.atompaw.input.vanderbilt* file.
Let's go back to `Vanderbilt` projectors.
Repeat the procedure (`ATOMPAW`\ + `ABINIT`) with the previous
<span style="color:green">\Ni.atompaw.input.vanderbilt</span> file.
{% dialog tutorial/paw2_assets/Ni.atompaw.input.vanderbilt %}
Let's try to change the pseudization scheme for the local pseudopotential.
Let's try to change the pseudization scheme for the local pseudopotential.
Try to replace the `troulliermartins` keyword by `ultrasoft`.
Repeat the procedure (`ATOMPAW` \+ `ABINIT`).
Repeat the procedure (`ATOMPAW` \+ `ABINIT`).
ABINIT can now reach convergence!
Results are below:
@ -678,12 +698,11 @@ Results are below:
etotal7 -3.9623440787E+01
etotal8 -3.9623490997E+01
`etotal` convergence (at 1 mHartree) is achieved for 14 <= $e_{cut}$ <= 16 Hartree
`etotal` convergence (at 0,1 mHartree) is achieved for 20 <= $e_{cut}$ <= 22 Hartree
`etotal` convergence (at 1 mHartree) is achieve for $14 \le e_{cut} \le 16$ Hartree.
`etotal` convergence (at 0,1 mHartree) is achieve for $20 \le e_{cut} \le 22$ Hartree.
!!! note
You could have tried the `bessel` keyword instead of `ultrasoft` one.
**Summary of convergence results**
@ -711,18 +730,21 @@ Results are below:
The last step is to examine carefully the physical quantities obtained with our PAW dataset.
Copy *\$ABI_TESTS/tutorial/Input/tpaw2_2.in* in your working directory.
Edit it, activate the 7 datasets,
and use *\$ABI_HOME/doc/tutorial/paw2_assets/Ni.GGA-PBE-paw.rrkj.xml* psp file
(obtained from *Ni.atompaw.input2 file*).
Copy <span style="color:green">\$ABI_TESTS/tutorial/Input/tpaw2_2.abi</span> in your working directory.
Edit it, activate the 7 datasets (ubcomment the 'ndtset 7` line),
and use
<span style="color:green">\$ABI_HOME/doc/tutorial/paw2_assets/Ni.GGA-PBE-paw.rrkj.xml</span>
PAW dataset obtained from <span style="color:green">Ni.atompaw.input2 file</span>.
Run ABINIT (this may take a while...).
{% dialog tests/tutorial/Input/tpaw2_2.in %}
{% dialog tests/tutorial/Input/tpaw2_2.abi %}
{% dialog tutorial/paw2_assets/Ni.GGA-PBE-paw.rrkj.xml %}
ABINIT computes the converged ground state of ferromagnetic FCC Nickel for several volumes around equilibrium.
Plot the `etotal` vs `acell` curve:
![etotal vs acell](paw2_assets/acell-etotal.jpg)
![etotal vs acell](paw2_assets/acell-etotal.jpg){width=70%}
From this graph and output file, you can extract some physical quantities:
@ -755,8 +777,8 @@ Compare these results with published results:
B = 183 GPa
````
You should always compare results with all-electron ones (or other PAW computations),
not with experimental ones
You should always compare results with all-electron ones (or other PAW computations).
Not with experimental ones!
**Additional remark**:
It can be useful to test the sensitivity of results to some `ATOMPAW` input parameters
@ -775,24 +797,24 @@ dataset is used for non-standard solid structures or thermodynamical domains.
!!! Optional_exercise
Let's add 3s and 3p semi-core states in PAW dataset!
Repeat the procedure (`ATOMPAW` \+ `ABINIT`) with *\$ABI_HOME/doc/tutorial/paw2_assets/Ni.atompaw.input.semicore*
file. The execution time is a bit longer as more electrons have to be treated by ABINIT.
Look at $a_0$, $B$ or $\mu$ variation.
Let's add 3s and 3p semi-core states in PAW dataset!
Repeat the procedure (`ATOMPAW` \+ `ABINIT`) with
<span style="color:green">\$ABI_HOME/doc/tutorial/paw2_assets/Ni.atompaw.input.semicore</span>
file. The execution time is a bit longer as more electrons have to be treated by `ABINIT`.
Look at $a_0$, $B$ or $\mu$ variation.
Note: this new PAW dataset has a smaller $r_{PAW}$ radius (because semi-core states are localized).
````
a0 = 3.518 angstrom
B = 194 GPa
mu = 0.60
````
## 9 The Real Space Optimization (RSO) - experienced users
## 9 The Real Space Optimization (RSO) - for experienced users
In this section, an additional optimization of the atomic data is proposed
which can contribute, in some cases, to an acceleration of the convergence on ecut.
This optimization is not essential to produce efficient PAW datasets but can be useful.
We advise experienced users to try it.
In this section, an additional optimization of the atomic data is presented.
It can contribute, in some cases, to a speedup of the convergence on `ecut`.
This optimization is not essential to produce efficient PAW datasets but can be useful.
We advise experienced users to try it.
The idea is quite simple: when expressing the different atomic radial
functions ($\phi_i, \tphi_i, \tprj_i$) on the plane wave basis, the number of plane waves
@ -803,52 +825,58 @@ of projectors $\tprj_i$ is presented; the projectors expressed in reciprocal spa
are modified according to the following scheme:
The reciprocal space is divided in 3 regions:
* If $g < g_{max}$, $\tprj_i$(g) is unchanged
* If $g \lt g_{max}$, $\tprj_i(g)$ is unchanged
* If $g > \gamma$, $\tprj_i$(g) is set to zero
* If $g \gt \gamma$, $\tprj_i(g)$ is set to zero
* If $ g_{max} < g < \gamma$, $\tprj_i(g)$ is modified so that the contribution of $\tprj_i(r)$ is
conserved with an error $W$ (as small as possible).
* If $g_{max} \le g \le \gamma$, $\tprj_i(g)$ is modified so that
the contribution of $\tprj_i(r)$ is conserved
with an error $W$ (as small as possible).
![RSO](paw2_assets/RSO.png)
![RSO](paw2_assets/RSO.png){width=50%}
The above transformation of $\tprj_i(g)$ is only possible if $\tprj_i(r)$ is defined outside
the spherical augmentation region up to a radius $R_0$, with $R_0 > r_c$.
In practice we have to:
1. Impose an error $W$ ($W$ is the maximum error admitted on total energy)
2. Adjust $g_{max}$ according to $E_{cut}$ ($g_{max} <= E_{cut}$)
3. Choose $\gamma$ so that $2 g_{max} < \gamma < 3 g_{max}$
2. Adjust $g_{max}$ according to $E_{cut}$ ($g_{max} \le E_{cut}$)
3. Choose $\gamma$ so that $2 g_{max} \lt \gamma \lt 3 g_{max}$
and let the `ATOMPAW` code apply the transformation to $\tprj_i$ and deduce $R_0$ radius.
You can test it now.
In your working directory, re-use the dataset *\$ABI_HOME/doc/tutorial/paw2_assets/Ni.atompaw.input3*
In your working directory, use the dataset
<span style="color:green">\$ABI_HOME/doc/tutorial/paw2_assets/Ni.atompaw.input3</span>
(Bloechl's projectors).
Replace the ABINIT options (penultimate line):
{% dialog tutorial/paw2_assets/Ni.atompaw.input3 %}
Replace the `XML options` (penultimate line):
````
ABINITOUT
XMLOUT
default
````
with:
````
ABINITOUT
XMLOUT
rsoptim 8. 2 0.0001
````
8., 2 and 0.0001 are the values for $g_{max}$, $\frac{\gamma}{g_{max}}$ and $W$).
8., 2 and 0.0001 are the values for $g_{max}$,$\frac{\gamma}{g_{max}}$ and $W$.
Run ATOMPAW.
You get a new psp file for ABINIT.
Run ABINIT with it using the *$ABI_TESTS/tutorial/Input/tpaw2_1.in* file.
Compare the results with those obtained in section 7.
Run ATOMPAW.
You get a new PAW dataset file for `ABINIT`.
Run `ABINIT` with it using the <span style="color:green">tpaw2_1.abi</span> file.
Compare the results with those obtained in section 7.
You can try several values for $g_{max}$ (keeping $\frac{\gamma}{g_{max}}$ and $W$ constant) and
compare the efficiency of the atomic data; do not forget to test physical properties again.
You can try several values for $g_{max}$ (keeping $\frac{\gamma}{g_{max}}$
and $W$ constant) and compare the efficiency of the atomic data;
do not forget to test physical properties again.
![RSO comparison](paw2_assets/RSOcompa.jpg)
**How to choose the RSO parameters?**
$\frac{\gamma}{g_{max}} = 2$ and $0.0001 < W < 0.001$ is a good choice.
$g_{max}$ has to be adjusted. The lower $g_{max}$ the faster the convergence is
but too low $g_{max}$ can produce unphysical results.
!!! Note
**How to choose the RSO parameters?**
$\frac{\gamma}{g_{max}} = 2$ and $0.0001 \lt W \lt 0.001$ is a good choice.
$g_{max}$ has to be adjusted. The lower $g_{max}$ the faster the convergence is
but too low $g_{max}$ can produce unphysical results.

View File

@ -28,6 +28,6 @@ bessel ! Scheme for pseudopotential (l_loc=
1.7 ! r_c matching radius for second p partial wave
2.0 ! r_c matching radius for first d partial wave
2.0 ! r_c matching radius for second d partial wave
XMLOUT ! Option for ABINIT file creation
default ! All parameters set to default for ABINIT file
0 ! End of file
XMLOUT ! Option for XML dataset creation
default ! All parameters set to default for XML dataset
END ! End of file

View File

@ -31,6 +31,6 @@ vanderbilt ! Scheme for PS partial waves and pr
2.3 ! r_c matching radius for second p partial wave
2.3 ! r_c matching radius for first d partial wave
2.3 ! r_c matching radius for second d partial wave
XMLOUT ! Option for ABINIT file creation
default ! All parameters set to default for ABINIT file
0 ! End of file
XMLOUT ! Option for XML dataset creation
default ! All parameters set to default for XML dataset
END ! End of file

View File

@ -25,6 +25,6 @@ y ! Do we add an additional d partial
n ! Do we add an additional s partial wave ? no
bloechl ! Scheme for PS partial waves and projectors
3 0. troulliermartins ! Scheme for pseudopotential (l_loc=3, E_loc=0Ry)
XMLOUT ! Option for XML file creation
default ! All parameters set to default for ABINIT file
0 ! End of file
XMLOUT ! Option for XML dataset creation
default ! All parameters set to default for XML dataset
END ! End of file

View File

@ -31,6 +31,6 @@ custom rrkj ! Scheme for PS partial waves and pr
2.3 ! r_c matching radius for second p partial wave
2.3 ! r_c matching radius for first d partial wave
2.3 ! r_c matching radius for second d partial wave
XMLOUT ! Option for ABINIT file creation
default ! All parameters set to default for ABINIT file
0 ! End of file
XMLOUT ! Option for XML dataset creation
default ! All parameters set to default for XML dataset
END ! End of file

View File

@ -25,6 +25,6 @@ y ! Do we add an additional d partial
n ! Do we add an additional s partial wave ? no
bloechl ! Scheme for PS partial waves and projectors
3 0. troulliermartins ! Scheme for pseudopotential (l_loc=3, E_loc=0Ry)
XMLOUT ! Option for ABINIT file creation
default ! All parameters set to default for ABINIT file
0 ! End of file
XMLOUT ! Option for XML dataset creation
default ! All parameters set to default for XML dataset
END ! End of file

View File

@ -34,4 +34,4 @@ vanderbilt
2.0
XMLOUT
default
0
END

View File

@ -11,9 +11,9 @@ all-electron code. We will be comparing results with the open `Elk` FP-LAPW code
(a branch of the `EXCITING` code) available under GPLv3.
You will learn how to compare calculations of the _equilibrium lattice_
parameter, the _Bulk modulus_ and the _band structure_ between ABINIT PAW results
parameter, the _Bulk modulus_ and the _band structure_ between `ABINIT` PAW results
and those from the `Elk` code.
It is assumed you already know how to use ABINIT in the PAW case. The tutorial
It is assumed you already know how to use `ABINIT` in the PAW case. The tutorial
assumes no previous experience with the `Elk` code, but it is strongly advised
that the users familiarise themselves a bit with this code before attempting
to do similar comparisons with their own datasets.
@ -49,7 +49,7 @@ orbital energies, i.e. the band structure for a simple bulk system.
* Match the `Elk` muffin-tin radii and the PAW cutoff radii.
* Use a k-point grid of similar quality.
* Use a similar cutoff for the plane wave expansion.
* Freeze the core in the `Elk` code (whenever possible), to match the frozen PAW core in ABINIT.
* Freeze the core in the `Elk` code (whenever possible), to match the frozen PAW core in `ABINIT`.
* Use a similar atomic on-site radial grid.
We will use **Carbon**, in the **diamond structure**, as an example of a simple solid
@ -65,7 +65,7 @@ that one has already satisfied oneself that the datasets for Zn, Mg, and Mn in
their pure forms are good.
One could also compare results for molecules, and we encourage you to do this
if you have the time. However, doing this consistently in ABINIT requires a
if you have the time. However, doing this consistently in `ABINIT` requires a
supercell approach and would make this tutorial very long, so we shall not do
it here. We will now discuss the prerequisites for this tutorial.
@ -73,18 +73,20 @@ it here. We will now discuss the prerequisites for this tutorial.
It is assumed that you are already familiar with the contents and procedures
in tutorials [PAW1](paw1) and [PAW2](paw2), and so
have some familiarity with input files for atompaw, and the issues in creating
have some familiarity with input files for `ATOMPAW` , and the issues in creating
PAW datasets. To exactly reproduce the results in this tutorial, you will
need:
* The `ATOMPAW` code for generating PAW datasets.
You have now to install the `ATOMPAW` code. Try to type in your browser:
https://users.wfu.edu/natalie/papers/pwpaw/atompaw-4.1.0.6.tar.gz
Then, download the file, unzip and untar it.Go into the directory "doc", open the file "atompaw-usersguide.pdf". Go p.3 and follow the instructions to compile atompaw.
* The `ATOMPAW` code for generating PAW datasets (see tutorial [PAW2](paw2), section **2.**).
```sh
cd atompaw-4.x.y.z
mkdir build
cd build
../configure
make
```
* the `Elk` code (this tutorial was designed with v1.2.15),
available [here](https://sourceforge.net/projects/elk/files/).
We will use the `Elk` code itself, as well as its `eos` (equation-of-state) utility,
@ -94,7 +96,7 @@ Then, download the file, unzip and untar it.Go into the directory "doc", open th
*\$ABI_HOME/doc/tutorial/paw3_assets/scripts/*. For the `python` scripts, `python3` is required.
There are also various *gnuplot* scripts there.
You will of course also need a working copy of ABINIT. Please make sure that
You will of course also need a working copy of `ABINIT`. Please make sure that
the above components are downloaded and working on your system before
continuing this tutorial. The tutorial also makes extensive use of |gnuplot|, so
please also ensure that a recent and working version is installed on your system.
@ -111,8 +113,11 @@ please also ensure that a recent and working version is installed on your system
Make a _working directory_ for the `ATOMPAW` generation (you could call it
`C_atompaw`) and copy the file: [C_simple.input](paw3_assets/inputs/C_simple.input) to it.
{% dialog tutorial/paw3_assets/inputs/C_simple.input %}
Then go there and run `ATOMPAW` by typing (assuming that you have set things up so that you
can run atompaw by just typing atompaw):
can run atompaw by just typing `atompaw`):
atompaw < C_simple.input
@ -149,25 +154,7 @@ The inputs directory also contains scripts for plotting these graphs
individually, and you are encouraged to test and modify them. We can look
inside the `C_simple.input` file:
C 6 ! Atomic name and number
LDA-PW scalarrelativistic loggrid 801 logderivrange -10 40 1000 ! XC approx., SE type, gridtype, # pts, logderiv
2 2 0 0 0 0 ! maximum n for each l: 2s,2p,0d,0f..
2 1 2 ! Partially filled shell: 2p^2
0 0 0 ! Stop marker
c ! 1s - core
v ! 2s - valence
v ! 2p - valence
1 ! l_max treated = 1
1.3 ! core radius r_c
n ! no more unoccupied s-states
n ! no more unoccupied p-states
vanderbilt ! vanderbilt scheme for finding projectors
2 0 ! localisation scheme
1.3 ! Core radius for occ. 2s state
1.3 ! Core radius for occ. 2p state
XMLOUT ! Run atompaw2abinit converter
prtcorewf noxcnhat nospline noptim ! Abinit conversion options
0 ! Exit
{% dialog tutorial/paw3_assets/inputs/C_simple.input %}
Here we see that the current dataset is very simple, it has no basis states
beyond the $2s$ and $2p$ occupied valence states in carbon. It is thus not
@ -176,35 +163,40 @@ the PAW dataset. Note that the `scalarrelativistic` option is turned on. While
this is not strictly necessary for such a light atom, we must always ensure to
have this turned on if we intend to compare with results from the `Elk` code.
We will now run basic convergence tests in abinit for this dataset. The
dataset file for abinit has already been generated (it is the `C.LDA-PW-
paw.xml` file in the current directory). Make a new subdirectory for the
We will now run basic convergence tests in `ABINIT` for this dataset. The
dataset file for `ABINIT` has already been generated (it is the `C.LDA-PW-paw.xml`
file in the current directory). Make a new subdirectory for the
test in the current directory (you could call it `abinit_test` for instance), go
there and copy the file: [ab_C_test.in](paw3_assets/inputs/ab_C_test.in) into
it. This ABINIT input file contains several datasets which increment the `ecut`
there and copy the file: [ab_C_test.abi](paw3_assets/inputs/ab_C_test.abi) into
it. This `ABINIT` input file contains several datasets which increment the `ecut`
input variable, and perform ground state and band structure calculations for
each value of `ecut`. This is thus the internal abinit convergence study. Any
each value of `ecut`. This is thus the internal `ABINIT` convergence study. Any
dataset is expected to converge to a result sooner or later, but that does not
mean that the final result is accurate, unless the dataset is good. The goal
is of course to generate a dataset which both converges quickly and is very accurate.
The `ab_C_test.in` file contains:
is of course to generate a dataset which both converges quickly and is very accurate.
{% dialog tutorial/paw3_assets/inputs/ab_C_test.abi %}
The `ab_C_test.abi` file contains:
pseudos="C.LDA-PW-paw.xml"
pp_dirpath="../"
outdata_prefix="outputs/ab_C_test_o"
tmpdata_prefix="outputs/ab_C_test"
So it expects the newly generated dataset to be in the directory above.
Also, to keep things tidy, it assumes the outputs will be put in a subdirectory
called `outputs/`. Make sure to create it before you start the abinit run by writing:
called `outputs/`. Make sure to create it before you start the `ABINIT` run by writing:
mkdir outputs
!!! important
You may have to change the path to reach the Psps_for_tests repository. For this, modify the varaible `pp_dirpath` in the input file.
You can now run the abinit tests (maybe even in a separate new `xterm` window), by executing:
You can now run the `ABINIT` tests (maybe even in a separate new `xterm` window), by executing:
abinit ab_C_test.in >& log_C_test &
abinit ab_C_test.abi >& log_C_test
There are 18 double-index datasets in total, with the first index running from
1 to 9 and the second from 1 to 2. You can check on the progress of the
@ -214,7 +206,7 @@ might want to take a look in the input file. Note the lines pertaining to the
increment in `ecut` (around line 29):
...
# Cutoff variables
#Cutoff variables
ecut:? 5.0
ecut+? 5.0
`pawecutdg` 110.0
@ -243,7 +235,6 @@ This should give you an output similar to this (though not the text to the left)
etotal71 -1.1518427967E+01 - 0.23 mHa (35 Ha)
etotal81 -1.1518542165E+01 - 0.11 mHa (40 Ha)
etotal91 -1.1518570692E+01 - 0.03 mHa (45 Ha)
Your values might differ slightly in the last decimals. The calculation of
diamond with the current PAW Carbon dataset converged to a precision of the
@ -253,10 +244,10 @@ about 25 Ha, which is an indication of a) that the number of projectors per
angular momentum channel is low, and b) that other parameters apart from ecut
dominate convergence beyond this point.
If we turn to the ~band structure~, we can use the script
If we turn to the _band structure_, we can use the script
[comp_bands_abinit2abinit.py](paw3_assets/scripts/comp_bands_abinit2abinit.py)
to check the convergence of the band structure. Copy the script to the
directory where the ABINIT input file is and issue:
directory where the `ABINIT` input file is and issue:
python comp_bands_abinit2abinit.py outputs/ab_C_test_o_DS12_EIG outputs/ab_C_test_o_DS92_EIG eV
@ -268,7 +259,7 @@ This will print a long series of columns and at the end you will see:
# minimum diff: -4.437905 eV
# maximum diff: 1.089000 eV
#
# NOTE: Abinit values are read in fixed format with five decimal
# NOTE: `ABINIT` values are read in fixed format with five decimal
# places. For low values, four or three decimal figures
# may be the highest precision you can get.
@ -281,7 +272,7 @@ on average, because the band-structure of the first dataset is far from
converged. The columns output before the statistics are arranged so that if
you pipe the output to a data file:
python comp_bands_abinit2abinit.py outputs/ab_C_test_o_DS12_EIG outputs/ab_C_test_o_DS92_EIG eV > bands_5Ha_vs_45Ha.dat
python comp_bands_abinit2abinit.py outputs/ab_C_test_o_DS12_EIG outputs/ab_C_test_o_DS92_EIG eV > bands_5Ha_vs_45Ha.dat
you can plot the two band structures in `gnuplot` directly, by entering:
@ -326,15 +317,17 @@ calculation. To independently verify that the dataset is good, we need to
calculate the equilibrium lattice parameter (and the _Bulk modulus_) and compare
this and the band structure with an `Elk` calculation.
First, we will need to calculate the total energy of diamond in ABINIT for a
First, we will need to calculate the total energy of diamond in `ABINIT` for a
number of lattice parameters around the minimum of the total energy. There is
example input file for doing this at:
[ab_C_equi.in](paw3_assets/inputs/ab_C_equi.in).
[ab_C_equi.abi](paw3_assets/inputs/ab_C_equi.abi).
The new input file has ten datasets which increment the lattice parameter, alatt,
from 6.1 to 7.0 Bohr in steps of 0.1 Bohr. A look in the input file will tell
you that `ecut` is set to 25 Hartrees. Copy these to your abinit_test directory and run:
abinit ab_C_equi.in >& log_C_equi &
{% dialog tutorial/paw3_assets/inputs/ab_C_equi.abi %}
abinit ab_C_equi.abi >& log_C_equi
The run should be done fairly quickly, and when it's done we can check on the
volume and the total energy by using "grep"
@ -376,7 +369,7 @@ If we examine the `etotal` values, the total energy does indeed go to a
minimum, and we also see that given the magnitude of the variations of the
total energy, an `ecut` of 25 Ha should be more than sufficient. We will now
extract the equilibrium volume and bulk modulus by using the eos bundled with
elk. This requires us to put the above data in an eos.in file. Create such a
elk. This requires us to put the above data in an `eos.in` file. Create such a
file with your favorite editor and enter the following five lines and then the
data you just extracted:
@ -428,7 +421,7 @@ at equilibrium for this dataset.
In order to estimate whether these values are good or not, we need independent
verification, and this will be provided by the all-electron `Elk` code. There is
an `Elk` input file matching our abinit diamond calculation at
an `Elk` input file matching our `ABINIT` diamond calculation at
[elk_C_diamond.in](paw3_assets/inputs/elk_C_diamond.in). You need
to copy this file to a directory set up for the `Elk` run (why not call it
`C_elk`), and it needs to be renamed to `elk.in`, which is the required input
@ -464,6 +457,8 @@ If we take a look in the `elk.in` file, at the beginning we will see the lines:
2 1 2 1 : 2p m=2
...
{% dialog tutorial/paw3_assets/inputs/elk_C_diamond.in %}
Any text after an exclamation mark (or a colon on the lines defining data) is
a comment. The keyword `tasks` defines what the code should do. In this case
@ -544,41 +539,41 @@ valence for another atomic species, this value needs to be adjusted downwards or
The second thing we need to check is whether the number of grid points and the
_muffin-tin_ radius that we use in the `Elk` calculation is roughly equivalent to
the PAW one. If you have a look in the PAW dataset we generated before, i.e.
in the `C_LDA.pawps` file, there is the line:
in the `C.LDA-PW-paw.xml` file, there is the line:
...
<radial_grid eq="r=a*(exp(d*i)-1)" a=" 2.1888410558886799E-03" d=" 1.3133046335332079E-02" istart="0" iend=" 800" id="log1">
<values>
...
...
<radial_grid eq="r=a*(exp(d*i)-1)" a=" 2.1888410558886799E-03" d=" 1.3133046335332079E-02" istart="0" iend=" 800" id="log1">
<values>
...
These define the PAW grids used for wavefunctions, densities and potentials.
To approximately match the intensity of the grids, we should modify the fifth
line in the `C.in` file:
...
0.816497E-06 1.3000 38.0877 300 : sprmin, rmt, sprmax, nrmt
...
to:
...
0.816497E-06 1.3000 38.0877 500 : sprmin, rmt, sprmax, nrmt
...
...
0.816497E-06 1.3000 38.0877 300 : sprmin, rmt, sprmax, nrmt
...
to:
...
0.816497E-06 1.3000 38.0877 500 : sprmin, rmt, sprmax, nrmt
...
You now need to comment out the species generation input block in the `elk.in` file:
...
! Construct atomic species file 'C.in'
!species
! 6 : atomic number
! 'C'
! 'carbon'
! 21894.16673 : atomic mass
! 1.300000000 : muffin-tin radius
! 4 : number of occ. states
! 1 0 1 2 : 1s
! 2 0 1 2 : 2s
! 2 1 1 1 : 2p m=1
! 2 1 2 1 : 2p m=2
...
...
! Construct atomic species file 'C.in'
!species
! 6 : atomic number
! 'C'
! 'carbon'
! 21894.16673 : atomic mass
! 1.300000000 : muffin-tin radius
! 4 : number of occ. states
! 1 0 1 2 : 1s
! 2 0 1 2 : 2s
! 2 1 1 1 : 2p m=1
! 2 1 2 1 : 2p m=2
...
!!! Note
This is very important! If you do not comment these lines the species
@ -620,7 +615,7 @@ and plot it in `gnuplot` with:
You should get a graph like this:
![Comparison of abinit and elk bands without shift](paw3_assets/images/band_abinit_elk_I.png)
![Comparison of `ABINIT` and elk bands without shift](paw3_assets/images/band_abinit_elk_I.png)
As you can see, the band structures look alike but differ by an absolute
shift, which is normal, because in a periodic system there is no unique vacuum
@ -661,14 +656,14 @@ the end of the output:
we can tell that this is not true for the rest of the points. Since the script
assumes alignment at the VBM, it now separates its statistics for occupied and
unoccupied bands. The uppermost unoccupied bands can fit badly, depending on
what precision was asked of abinit (especially, if `nbdbuf` is used).
what precision was asked of `ABINIT` (especially, if `nbdbuf` is used).
The fit is quite bad in general, an average of about 0.025 eV difference for
occupied states, and about 0.05 eV difference for unoccupied states. If you
plot the ouput as before, by piping the above to a `bands.dat` file and
executing the same `gnuplot` command, you should get the plot below.
![Comparison of abinit and elk bands with shift](paw3_assets/images/band_abinit_elk_II.png)
![Comparison of `ABINIT` and elk bands with shift](paw3_assets/images/band_abinit_elk_II.png)
On the scale of the band plot there is a small - but visible - difference
between the two. Note that the deviations are usually larger away from the
@ -681,9 +676,9 @@ precision can be expected.
As we are now creating our "gold standard" with an `Elk` calculation, we also
need to calculate the equilibrium lattice parameter and Bulk modulus of
diamond with the `Elk` code. Unfortunately, `Elk` does not use datasets, so the
various lattice parameters we used in our abinit structural search will have
various lattice parameters we used in our `ABINIT` structural search will have
to be put in one by one by hand and the code run for each. The lattice
parameters in the abinit run were from 6.1 to 7.0 in increments of 0.1, so
parameters in the `ABINIT` run were from 6.1 to 7.0 in increments of 0.1, so
that makes ten runs in total. To perform the first, simply edit the `elk.in`
file and change the keyword (at line 57):
@ -761,7 +756,7 @@ your system.) By running the `eos` utility as before we get:
alatt = (4*74.47144624)^(1/3) = 6.6785 Bohr (3.5341 Å)
So we see that the initial, primitive, abinit dataset is about 9 GPa off for
So we see that the initial, primitive, `ABINIT` dataset is about 9 GPa off for
the _Bulk modulus_ and about 0.035 Bohr away from the correct value for the
lattice parameter. In principle, these should be about an order of magnitude
better, so let us see if we can make it so.
@ -808,7 +803,7 @@ and bands for the input file below:
1.3 ! Core radius for occ. 2p state
1.3 ! Core radius for unocc. 2p state
XMLOUT ! Run atompaw2abinit converter
prtcorewf noxcnhat nospline noptim ! Abinit conversion options
prtcorewf noxcnhat nospline noptim ! `ABINIT` conversion options
0 ! Stop marker
Generate an atomic data file from this (you can replace the items in the old
@ -826,8 +821,8 @@ Note the much better fit of the logarithmic derivatives, and the change in the
shape of the projector functions (in blue in the `wfn` plots), due to the more
complicated scheme used to optimise them.
Generate the dataset like before and run the abinit `ecut` testing datasets in
the `ab_C_test.in` abinit input file again. You should get an `etotal`
Generate the dataset like before and run the `ABINIT` `ecut` testing datasets in
the `ab_C_test.abi` `ABINIT` input file again. You should get an `etotal`
convergence like this (again, the values to the left are just there to help):
etotal (ecut)
@ -854,8 +849,8 @@ datasets 32 and 92 gives:
...
Which also shows a much faster convergence than before. Is the dataset
accurate enough? Well, if you run the abinit equilibrium parameter input file
in `ab_C_equi.in`, you should get data for an `eos.in` file:
accurate enough? Well, if you run the `ABINIT` equilibrium parameter input file
in `ab_C_equi.abi`, you should get data for an `eos.in` file:
"C - Diamond (second PAW dataset)" : cname - name of material
2 : natoms - number of atoms
@ -885,8 +880,8 @@ For comparison, we list all previous values again:
Equilibrium Bulk modulus lattice
volume, V0 B0 parameter
75.5073 460.37 3.5505 Å (first primitive PAW dataset)
74.7110 465.79 3.5379 Å (second better PAW dataset)
75.5073 460.37 3.5505 Å (1st primitive PAW dataset)
74.7110 465.79 3.5379 Å (2nd better PAW dataset)
74.4714 469.70 3.5341 Å (Elk all-electron)
It is obvious that the second dataset is much better than the first one.
@ -938,14 +933,14 @@ this parameter depends on the k-point grid used. As the k-point grid becomes
denser, the optimum spread becomes smaller, and all values converge toward
their ideal counterparts in the limit of no smearing and an infinitely dense grid.
The problem is that, in ABINIT, finding the optimum smearing parameter takes a
The problem is that, in `ABINIT`, finding the optimum smearing parameter takes a
(potentially time consuming) convergence study. However, we are in luck. The
elk code has an option for automatically determining the smearing parameter.
`Elk` code has an option for automatically determining the smearing parameter.
Thus we should use the `Elk` code first, set a relatively dense k-mesh, and
calculate the equilibrium bulk modulus, lattice parameter and band structure.
Then we make sure to match the automatically determined smearing width, and
most importantly, make sure that we match the smearing function used between
the `Elk` and the abinit calculation.
the `Elk` and the `ABINIT` calculation.
### 4.1. Magnesium - The all-electron calculation
@ -953,6 +948,9 @@ There is an `Elk` input file prepared at: [elk_Mg_band.in](paw3_assets/inputs/el
we suggest you copy it into a subdirectory dedicated to the Mg `Elk` calculation (why not `Mg_elk`?), rename
it to `elk.in` and take a look inside the input file.
{% dialog tutorial/paw3_assets/inputs/elk_Mg_band.in %}
There will be sections familiar from before, defining the lattice vectors,
structure, etc. (Mg has a 2-atom hexagonal unit cell.) Then there are a couple
of new lines for the metallic case:
@ -995,7 +993,7 @@ this should furnish you with a list:
where the last value is the one we seek, i.e. the smearing at convergence.
Since this `Elk` file will also calculate the band structure, you will have a
`BAND.OUT` file at the end of this calculation to compare your ABINIT band
`BAND.OUT` file at the end of this calculation to compare your `ABINIT` band
structure to. There is one more thing we need to check, and that is the Fermi energy:
grep 'Fermi ' INFO.OUT
@ -1023,6 +1021,9 @@ we compare band structures to align the band plots at the Fermi energy.
Now it's time to calculate the equilibrium lattice parameters. There is a
prepared file at: [elk_Mg_equi.in](paw3_assets/inputs/elk_Mg_equi.in).
{% dialog tutorial/paw3_assets/inputs/elk_Mg_equi.in %}
As before copy this to your directory rename it to `elk.in`. The layout of this file looks pretty much
like the one before, except the band structure keywords are missing, and now
switdth is fixed to the value we extracted before:
@ -1109,44 +1110,21 @@ with this scale factor, we have that:
volume, V0 B0 parameters
291.6029 40.1437 a = b = 3.1323 Å c = 5.0854 Å
Now we have all the information needed to proceed with the abinit calculation.
Now we have all the information needed to proceed with the `ABINIT` calculation.
### 4.2. Magnesium - The abinit calculation
### 4.2. Magnesium - The `ABINIT` calculation
As usual, it's best to prepare a separate subdirectory for the atomic data and
the ABINIT test. We will assume that the subdirectories have been created as:
the `ABINIT` test. We will assume that the subdirectories have been created as:
mkdir Mg_atompaw
mkdir Mg_atompaw/abinit_test
mkdir Mg_atompaw/abinit_test/outputs
and that your current directory is `./Mg_atompaw`. For the Mg `ATOMPAW` input,
create a file `Mg.input` with the following content:
Mg 12
LDA-PW scalarrelativistic loggrid 801 40. logderivrange -10 40 1000
3 3 0 0 0 0
3 1 0
0 0 0
c
v
v
v
v
1
1.9
n
n
custom polynom2 7 11 vanderbiltortho sincshape
2 0 ultrasoft
1.9
1.9
1.9
1.9
XMLOUT
prtcorewf noxcnhat nospline noptim
0
use the file [Mg.input](paw3_assets/inputs/Mg.input).
{% dialog tutorial/paw3_assets/inputs/Mg.input %}
Note that there are not really many projectors in this dataset, only two
per angular momentum channel. It should be possible to make this much better
@ -1154,13 +1132,16 @@ adding extra projectors, and maybe even unoccupied $d$-states. If you run
atompaw with this, you can have a look with the bundled `plot_MG_all.p` file
and others like it to get a feel for the quality of this dataset.
Generate the abinit dataset file, and make sure it's given as:
`./Mg_atompaw/Mg_LDA-PW-paw.xml`, then go to the subdirectory for the ABINIT test,
and copy these files to it: [ab_Mg_test.in](paw3_assets/inputs/ab_Mg_test.in),
and [ab_Mg_equi.in](paw3_assets/inputs/ab_Mg_equi.in).
Generate the `ABINIT` dataset file, and make sure it's given as:
`./Mg_atompaw/Mg_LDA-PW-paw.xml`, then go to the subdirectory for the `ABINIT` test,
and copy these files to it: [ab_Mg_test.abi](paw3_assets/inputs/ab_Mg_test.abi),
and [ab_Mg_equi.abi](paw3_assets/inputs/ab_Mg_equi.abi).
The file for testing the convergence has already been set up so that the smearing
strategy is equivalent to the `Elk` one, as evidenced by the lines:
{% dialog tutorial/paw3_assets/inputs/ab_Mg_test.abi %}
{% dialog tutorial/paw3_assets/inputs/ab_Mg_equi.abi %}
...
# Parameters for metals
tsmear 0.4109804423E-02
@ -1174,14 +1155,14 @@ possibilities compare the entries for the keyword `stype` in the `Elk` manual
and the entries for `occopt` in ABINIT).
Now run the test input file (if your computer has several cores, you might
want to take advantage of that and run abinit in parallel). The test suite can
want to take advantage of that and run `ABINIT` in parallel). The test suite can
take some time to complete, because of the dense _k-point mesh sampling_. Make
sure you pipe the screen to a log file: `log_Mg_test`
When the run is finished, we can check the convergence properties as before,
and we that an `ecut` of 15 Ha is definitely enough. The interesting thing will
now be to compare the band structures. First we need to check the Fermi energy
of the abinit calculation, if you do a `grep`:
of the `ABINIT` calculation, if you do a `grep`:
grep ' Fermi' log_Mg_test
@ -1194,14 +1175,14 @@ converging towards one number:
newocc : new Fermi energy is 0.137605 , with nelect= 20.000000
The last one of these is the final _Fermi energy_ of the ABINIT calculation. The
The last one of these is the final _Fermi energy_ of the `ABINIT` calculation. The
`abinit2elk` band comparison _script_ can now be given the _Fermi energies_ of the
two different calculations and align band structures there. Copy the
`BAND.OUT` file from the `Elk` calculation to the current directory, as well as
the band comparison script `comp_bands_abinit2elk.py`. This script can also be
used to align the bands at different Fermi energies. However, in the
`BAND.OUT` file from `Elk`, the bands are already shifted so that the Fermi
energy is at zero, so it is only the alignment of the abinit file that is required:
energy is at zero, so it is only the alignment of the `ABINIT` file that is required:
python comp_bands_abinit2elk.py ./outputs/ab_Mg_test_o_DS32_EIG BAND.OUT Fermi 0.137605 0.0 eV
@ -1221,10 +1202,10 @@ output to a file `bands_abinit_elk.dat`, and go into gnuplot and use the script
You should get a plot that looks something like this:
![Comparison of Mg abinit and Elk bands alignet at Fermi level](paw3_assets/images/band_abinit_elk_III.png)
![Comparison of Mg `ABINIT` and Elk bands alignet at Fermi level](paw3_assets/images/band_abinit_elk_III.png)
As we can see, the bands should fit quite well. Finally, for the structural, a
run of the `ab_Mg_equi.in` file gives us all the information we need for the
run of the `ab_Mg_equi.abi` file gives us all the information we need for the
creation of an `eos.in` file:
"Mg - bulk metallic (ABINIT)"

View File

@ -15,5 +15,5 @@ vanderbilt ! vanderbilt scheme for finding proj
1.3 ! Core radius for occ. 2s state
1.3 ! Core radius for occ. 2p state
XMLOUT ! Run atompaw2abinit converter
prtcorewf noxcnhat nospline noptim ! Abinit conversion options
0 ! Exit
prtcorewf noxcnhat nospline noptim ! XML conversion options
END ! Exit

View File

@ -0,0 +1,24 @@
Mg 12
LDA-PW scalarrelativistic loggrid 801 40. logderivrange -10 40 1000
3 3 0 0 0 0
3 1 0
0 0 0
c
v
v
v
v
1
1.9
n
n
custom polynom2 7 11 vanderbiltortho sincshape
2 0 ultrasoft
1.9
1.9
1.9
1.9
XMLOUT
prtcorewf noxcnhat nospline noptim
END

View File

@ -0,0 +1,67 @@
# Input for PAW3 tutorial
# C - diamond structure
#-------------------------------------------------------------------------------
#Directories and files
pseudos="C.LDA-PW-paw.xml"
pp_dirpath="../"
outdata_prefix="outputs/ab_C_equi_o"
tmpdata_prefix="outputs/ab_C_equi"
#-------------------------------------------------------------------------------
#Define the different datasets
ndtset 10 # 10 datasets
acell: 3*6.1 Bohr # The starting values of the cell parameters
acell+ 3*0.1 Bohr # The increment of acell from one dataset to the other
#-------------------------------------------------------------------------------
#Convergence parameters
#Cutoff variables
ecut 25.0
pawecutdg 110.0
ecutsm 0.5
#Definition of the k-point grid
chksymbreak 0
kptopt 1
nshiftk 1
shiftk 0.5 0.5 0.5
ngkpt 10 10 10
#Bands and occupations
nband 8
nbdbuf 4
#SCF cycle parameters
tolvrs 1.0d-10
nstep 150
#-------------------------------------------------------------------------------
#Definition of the Unit cell
#Definition of the unit cell
acell 3*6.7403
rprim
0.5 0.5 0.0
0.0 0.5 0.5
0.5 0.0 0.5
#Definition of the atom types
ntypat 1 # One tom type
znucl 6 # Carbon
#Definition of the atoms
natom 2 # 2 atoms per cell
typat 1 1 # each of type carbon
xred # This keyword indicates that the location of the atoms
# will follow, one triplet of number for each atom
0.125 0.125 0.125
-0.125 -0.125 -0.125

View File

@ -1,45 +0,0 @@
# C - diamond structure
ndtset 10
#Definition of the unit cell
acell: 3*6.1 Bohr
acell+ 3*0.1 Bohr
rprim
0.5 0.5 0.0
0.0 0.5 0.5
0.5 0.0 0.5
#Definition of the atom types
ntypat 1 #
znucl 6 # The pseudopotential(s)
# mentioned in the "files" file must correspond
# to the type(s) of atom.
#Definition of the atoms
natom 2 # 2 atoms per cell
typat 1 1
xred # This keyword indicates that the location of the atoms
# will follow, one triplet of number for each atom
0.125 0.125 0.125 # Triplets giving the cartesian coordinates of atom 1:
-0.125 -0.125 -0.125
ecut 25.0
pawecutdg 110.0
ecutsm 0.5
chksymbreak 0
kptopt 1
nshiftk 1
shiftk 0.5 0.5 0.5
ngkpt 10 10 10
tolvrs 1.0d-10
nstep 150
nbdbuf 4
nband 8
pseudos="C.LDA-PW-paw.xml"
pp_dirpath="../"
outdata_prefix="outputs/ab_C_equi_o"
tmpdata_prefix="outputs/ab_C_equi"

View File

@ -1,39 +1,30 @@
# Input for PAW3 tutorial
# C - diamond structure
ndtset 18
udtset 9 2
# GS convergence fix
istwfk *1
#-------------------------------------------------------------------------------
#Directories and files
#Definition of the unit cell
acell 3*6.7403
rprim
0.5 0.5 0.0
0.0 0.5 0.5
0.5 0.0 0.5
pseudos="C.LDA-PW-paw.xml"
#Definition of the atom types
ntypat 1 #
znucl 6 # The pseudopotential(s)
# mentioned in the "files" file must correspond
# to the type(s) of atom.
pp_dirpath="../"
outdata_prefix="outputs/ab_C_test_o"
tmpdata_prefix="outputs/ab_C_test"
#Definition of the atoms
natom 2 # 2 atoms per cell
typat 1 1
xred # This keyword indicates that the location of the atoms
# will follow, one triplet of number for each atom
0.125 0.125 0.125
-0.125 -0.125 -0.125
#-------------------------------------------------------------------------------
#Define the different datasets
ndtset 18 # 18 double-index datasets
udtset 9 2 # 1st index running from 1 to 9 and the 2nd from 1 to 2
#Cutoff variables
ecut:? 5.0
ecut+? 5.0
pawecutdg 110.0
ecutsm 0.5
# Dataset 1
# Ground-state run
#Dataset 1
#Ground-state run
chksymbreak 0
kptopt?1 1
nshiftk?1 1
@ -52,9 +43,9 @@ getwfk91 81
nbdbuf?1 4
nband?1 8
# Dataset 2
# Definition of the k-point grid
# the band structure
#Dataset 2
#Definition of the k-point grid
#the band structure
iscf?2 -2
getden?2 -1
kptopt?2 -4
@ -72,13 +63,32 @@ tolwfr?2 1.0d-18
enunit?2 0 # Will output the eigenenergies in Ha
nstep?2 150
pseudos="C.LDA-PW-paw.xml"
pp_dirpath="../"
outdata_prefix="outputs/ab_C_test_o"
tmpdata_prefix="outputs/ab_C_test"
#-------------------------------------------------------------------------------
#Definition of the Unit cell
#Definition of the unit cell
acell 3*6.7403
rprim
0.5 0.5 0.0
0.0 0.5 0.5
0.5 0.0 0.5
#Definition of the atom types
ntypat 1 # One tom type
znucl 6 # Carbon
#Definition of the atoms
natom 2 # 2 atoms per cell
typat 1 1 # each of type carbon
xred # This keyword indicates that the location of the atoms
# will follow, one triplet of number for each atom
0.125 0.125 0.125
-0.125 -0.125 -0.125
#-------------------------------------------------------------------------------
#Miscelaneous
#GS convergence fix
istwfk *1

View File

@ -0,0 +1,70 @@
# Input for PAW3 tutorial
# Mg - hexagonal structure - metallic bulk
#-------------------------------------------------------------------------------
#Directories and files
pseudos="Mg.LDA-PW-paw.xml"
pp_dirpath="../"
outdata_prefix="outputs/ab_Mg_equi_o"
tmpdata_prefix="outputs/ab_Mg_equi"
#-------------------------------------------------------------------------------
#Define the different datasets
ndtset 7 # 7 datasets
acell: 3*0.94 Bohr # The starting values of the cell parameters
acell+ 3*0.02 Bohr # The increment of acell from one dataset to the other
#-------------------------------------------------------------------------------
#Convergence parameters
#Cutoff variables
ecut 15.0
pawecutdg 110.0
ecutsm 0.5
#Definition of the k-point grid
chksymbreak 0
kptopt 1
nshiftk 1
shiftk 0.0 0.0 0.5
ngkpt 10 10 10
#Bands and occupations
nband 25
nbdbuf 5
#Parameters for metals
tsmear 0.4109804423E-02
occopt 7
#SCF cycle parameters
tolvrs 1.0d-14
nstep 150
#-------------------------------------------------------------------------------
#Definition of the Unit cell
#Definition of the unit cell
acell 3*1.
rprim
6.0646414 0.0000000 0.0000000
3.0323207 5.2521335 0.0000000
0.0000000 0.0000000 9.8460968
#Definition of the atom types
ntypat 1 # One tom type
znucl 12 # Magnesium
#Definition of the atoms
natom 2 # 2 atoms per cell
typat 1 1 # each of type carbon
xred # This keyword indicates that the location of the atoms
# will follow, one triplet of number for each atom
1/3 1/3 1/4
2/3 2/3 3/4

View File

@ -1,51 +0,0 @@
# Mg - metallic bulk
ndtset 7
#Definition of the unit cell
acell: 3*0.94 Bohr
acell+ 3*0.02
getwfk -1
rprim
6.0646414 0.0000000 0.0000000
3.0323207 5.2521335 0.0000000
0.0000000 0.0000000 9.8460968
#Definition of the atom types
ntypat 1 #
znucl 12 # The pseudopotential(s)
# mentioned in the "files" file must correspond
# to the type(s) of atom.
#Definition of the atoms
natom 2 # 2 atoms per cell
typat 1 1
xred # This keyword indicates that the location of the atoms
# will follow, one triplet of number for each atom
1/3 1/3 1/4
2/3 2/3 3/4
ecut 15.0
pawecutdg 110.0
ecutsm 0.5
# Parameters for metals
tsmear 0.4109804423E-02
occopt 7
# Dataset 1
# Ground-state run
kptopt 1
nshiftk 1
shiftk 0.0 0.0 0.5
ngkpt 10 10 10
tolvrs 1.0d-14
nstep 150
nbdbuf 5
nband 25
pseudos="Mg.LDA-PW-paw.xml"
pp_dirpath="../"
outdata_prefix="outputs/ab_Mg_equi_o"
tmpdata_prefix="outputs/ab_Mg_equi"

View File

@ -1,39 +1,30 @@
# C - diamond structure
ndtset 18
udtset 9 2
# Input for PAW3 tutorial
# Mg - hexagonal structure
# GS convergence fix
istwfk *1
#-------------------------------------------------------------------------------
#Directories and files
#Definition of the unit cell
acell 2*3.20927 5.21033 angstrom
angdeg 90 90 60
pseudos="Mg.LDA-PW-paw.xml"
#Definition of the atom types
ntypat 1 #
znucl 12 # The pseudopotential(s)
# mentioned in the "files" file must correspond
# to the type(s) of atom.
pp_dirpath="../"
outdata_prefix="outputs/ab_Mg_test_o"
tmpdata_prefix="outputs/ab_Mg_test"
#Definition of the atoms
natom 2 # 2 atoms per cell
typat 1 1
xred # This keyword indicates that the location of the atoms
# will follow, one triplet of number for each atom
1/3 1/3 1/4
2/3 2/3 3/4
#-------------------------------------------------------------------------------
#Define the different datasets
ndtset 18 # 18 double-index datasets
udtset 9 2 # 1st index running from 1 to 9 and the 2nd from 1 to 2
#Cutoff variables
ecut:? 5.0
ecut+? 5.0
pawecutdg 110.0
ecutsm 0.5
# Parameters for metals
tsmear 0.4109804423E-02
occopt 7
# Dataset 1
# Ground-state run
#Dataset 1
#Ground-state run
kptopt?1 1
nshiftk?1 1
shiftk?1 0.0 0.0 0.5
@ -51,9 +42,9 @@ getwfk91 81
nbdbuf?1 5
nband?1 25
# Dataset 2
# Definition of the k-point grid
# the band structure
#Dataset 2
#Definition of the k-point grid
#the band structure
iscf?2 -2
getden?2 -1
kptopt?2 -7
@ -74,8 +65,34 @@ tolwfr?2 1.0d-18
enunit?2 0 # Will output the eigenenergies in Ha
nstep?2 150
pseudos="Mg.LDA-PW-paw.xml"
pp_dirpath="../"
outdata_prefix="outputs/ab_Mg_test_o"
tmpdata_prefix="outputs/ab_Mg_test"
#-------------------------------------------------------------------------------
#Definition of the Unit cell
#Definition of the unit cell (hexagonal)
acell 2*3.20927 5.21033 angstrom
angdeg 90 90 60
#Definition of the atom types
ntypat 1 # One tom type
znucl 12 # Magnesium
#Definition of the atoms
natom 2 # 2 atoms per cell
typat 1 1 # each of type carbon
xred # This keyword indicates that the location of the atoms
# will follow, one triplet of number for each atom
1/3 1/3 1/4
2/3 2/3 3/4
#Parameters for metals
tsmear 0.4109804423E-02
occopt 7
#-------------------------------------------------------------------------------
#Miscelaneous
#GS convergence fix
istwfk *1

View File

@ -14,9 +14,9 @@ physical properties:
* the lifetime of a positron localized in a vacancy,
* the electron-positron momentum distribution.
For the description of the implementation of TCDFT in ABINIT see [[cite:Wiktor2015]].
For the description of the implementation of TCDFT in `ABINIT` see [[cite:Wiktor2015]].
The user should be familiar with the four basic tutorials of ABINIT and the [first PAW tutorial](paw1).
The user should be familiar with the four basic tutorials of `ABINIT` and the [first PAW tutorial](paw1).
This tutorial should take about 2 hours.
@ -25,14 +25,13 @@ This tutorial should take about 2 hours.
## Computing the positron lifetime in Si lattice
*Before beginning, you might consider to work in a different subdirectory as
for the other tutorials. Why not Work_positron?*
for the other tutorials. Why not* `Work_positron`*?*
```sh
cd $ABI_TESTS/tutorial/Input
mkdir Work_positron
cd Work_positron
cp ../tpositron_x.files . # You will need to edit this file.
cp ../tpositron_1.in .
cp ../tpositron_1.abi .
```
The tutorial begins with a calculation of the positron lifetime in a silicon lattice.
@ -48,48 +47,49 @@ proportional to the inverse of the overlap of the electron and positron
densities. This 2-step calculation, considering the _zero-positron density
limit_, corresponds to the conventional scheme (CONV).
In the `tpositron_1.in` file, you will find two datasets.
In the `tpositron_1.abi` file, you will find two datasets.
{% dialog tests/tutorial/Input/tpositron_1.in %}
{% dialog tests/tutorial/Input/tpositron_1.abi %}
The first dataset is a standard ground-state calculation. The second one introduces a positron into
the system. You can see that in this case we set:
positron2 1 ! Dataset 2 is a positronic GS calculation
getden2 1 ! in presence of the previous electronic density
kptopt2 0 ! Use only k=gamma point
positron2 1 # Dataset 2 is a positronic GS calculation
getden2 1 # in presence of the previous electronic density
ixcpositron2 1 ! We are using the Boronski and Nieminen parametrization
kptopt2 0 # Use only k=gamma point
ixcpositron2 1 # We are using the Boronski and Nieminen parametrization
Here we set [[positron]]=1, which corresponds to a positronic ground-state
calculation, considering that the electrons are not perturbed by the presence
of the positron (_zero-positron density limit_). The electron density is read from the file resulting from
dataset 1. As we consider the positron to be completely delocalized, we only
consider the &Gamma; point in the _Brillouin_ zone. The keyword [[ixcpositron]] selects the electron-
positron correlation functional and enhancement factor. In this calculation we
use the functional parametrized by Boronski and Nieminen [[cite:Boronski1986]], using the data provided by Arponen and Pajanne [[cite:Arponen1979]].
consider the &Gamma; point in the _Brillouin_ zone. The keyword [[ixcpositron]]
selects the **electron-positron correlation functional** and **enhancement factor**.
In this calculation we use the functional parametrized by Boronski and Nieminen
[[cite:Boronski1986]], using the data provided by Arponen and Pajanne [[cite:Arponen1979]].
We can now run the calculation. In the directory
`~abinit/tests/tutorial/Input/Work_positron`, copy the files
`~abinit/tests/tutorial/Input/tpositron_x.files` and `tpositron_1.in`.
We can now run the calculation. In the working directory
`Work_positron`, copy the file `tpositron_1.abi`.
Then, issue:
abinit < tpositron_x.files > log 2> err &
abinit tpositron_1.abi >& log
This calculation should only take a few seconds.
You can look at the *tpositron_1.out* file.
You can look at the `tpositron_1.abo` file.
We find the positron lifetime calculated in the RPA limit:
########## Lifetime computation 2
########## Lifetime computation 2
# Zero-positron density limit of Arponen and Pajanne provided by Boronski & Nieminen
Ref.: Boronski and R.M. Nieminen, Phys. Rev. B 34, 3820 (1986)
# Enhancement factor of Boronski & Nieminen IN THE RPA LIMIT
Ref.: Boronski and R.M. Nieminen, Phys. Rev. B 34, 3820 (1986)
# Zero-positron density limit of Arponen and Pajanne provided by Boronski & Nieminen
Ref.: Boronski and R.M. Nieminen, Phys. Rev. B 34, 3820 (1986)
# Enhancement factor of Boronski & Nieminen IN THE RPA LIMIT
Ref.: Boronski and R.M. Nieminen, Phys. Rev. B 34, 3820 (1986)
Positron lifetime (ps) = 2.22891945E+02
Positron lifetime (ps) = 2.22879743E+02
The lifetime of 223 ps agrees well with the value of 225 ps calculated with
the same number of valence electrons in [[cite:Wiktor2015]] and
@ -111,61 +111,60 @@ with the experimental value of about 219 ps [[cite:Panda1997]].
We will now perform a positron lifetime calculation for a monovacancy in
silicon in the conventional scheme (which we applied to the perfect lattice
previously). Note that when the positron localizes inside a vacancy, the _zero-
positron density limit_ does not apply anymore. However, in some cases, the
previously). Note that when the positron localizes inside a vacancy, the
_zero-positron density limit_ does not apply anymore. However, in some cases, the
conventional scheme proved to yield results in agreement with experiments.
For the purpose of this tutorial, we generate a defect in a cell containing
only 16 atoms. This supercell is too small to get converged results, but the
calculation is relatively fast.
{% dialog tests/tutorial/Input/tpositron_2.in %}
{% dialog tests/tutorial/Input/tpositron_2.abi %}
You can now, issue (after having replaced *tpositron_1* by *tpositron_2* in the
*tpositron_x.files* file):
You can now, issue:
abinit < tpositron_x.files > log 2> err &
abinit tpositron_2.abi >& log
Once the calculation is finished, look at the *tpositron_2.out* file.
Once the calculation is finished, look at the `tpositron_2.abo` file.
Again, we look at the reported lifetime:
########## Lifetime computation 2
########## Lifetime computation 2
# Zero-positron density limit of Arponen and Pajanne provided by Boronski & Nieminen
Ref.: Boronski and R.M. Nieminen, Phys. Rev. B 34, 3820 (1986)
# Enhancement factor of Boronski & Nieminen IN THE RPA LIMIT
Ref.: Boronski and R.M. Nieminen, Phys. Rev. B 34, 3820 (1986)
# Zero-positron density limit of Arponen and Pajanne provided by Boronski & Nieminen
Ref.: Boronski and R.M. Nieminen, Phys. Rev. B 34, 3820 (1986)
# Enhancement factor of Boronski & Nieminen IN THE RPA LIMIT
Ref.: Boronski and R.M. Nieminen, Phys. Rev. B 34, 3820 (1986)
Positron lifetime (ps) = 2.46936401E+02
Positron lifetime (ps) = 2.46923233E+02
We observe that when the positron localizes inside the vacancy, its lifetime
increases from 223 to 247 ps. This is because now the majority of the positron
density is localized in the vacancy region, where the electron density is
small. The overlap of the electron and positron densities is reduced, and the lifetime increased.
In the *Work_positron* directory, you will also find a *tpositron_2o_DS2_DEN_POSITRON*
In the `Work_positron` directory, you will also find a `tpositron_2o_DS2_DEN_POSITRON`
file, containing the positron density. Visualizing this file (using e.g.
_cut3d_ and _XcrysDen_ or _VMD_ ) you can see that the positron is localized
_cut3d_ and _XcrysDen_ or _VMD_) you can see that the positron is localized
inside the vacancy. You can see below how the positron (in red, isodensity at
30% of the maximum density) localized the silicon monovacancy looks like:
![](positron_assets/posdensity.png)
![](positron_assets/posdensity.png){width=80%}
## Performing a self-consistent electron-positron calculation for a Si vacancy
We will now perform a self-consistent calculation of the positron and electron
densities. As this calculation will take a few minutes, you can already issue
(putting *tpositron_3.in* in *tpositron_x.files*):
densities. As this calculation will take a few minutes, you can already issue, using
the `tpositron_3.abi` input file:
abinit < tpositron_x.files > log 2> err &
abinit tpositron_3.abi >& log
{% dialog tests/tutorial/Input/tpositron_3.in %}
{% dialog tests/tutorial/Input/tpositron_3.abi %}
This calculation is significantly longer than the previous one, because the
electron and positron steps will be repeated until the convergence criterion is reached.
In *tpositron_3.in* we only have one dataset and we set
In `tpositron_3.abi` we only have one dataset and we set
[[positron]] = -10 to perform an automatic calculation of electrons and positron
densities. The convergence is controlled by [[postoldfe]] = 1d-5. This means
that we will repeat the electron and positron steps until the energy
@ -173,16 +172,16 @@ difference between them is lower than 1d-5 Ha. This value should always be
larger than [[toldfe]]. In this calculation we still use [[ixcpositron]] = 1,
which means that we are using the GGGC scheme (see [[cite:Gilgien1994]] and [[cite:Wiktor2015]]
Once the calculation is finished, look at the positron lifetime in *tpositron_3.out*.
Once the calculation is finished, look at the positron lifetime in `tpositron_3.abo`.
########## Lifetime computation 2
########## Lifetime computation 2
# Zero-positron density limit of Arponen and Pajanne provided by Boronski & Nieminen
Ref.: Boronski and R.M. Nieminen, Phys. Rev. B 34, 3820 (1986)
# Enhancement factor of Boronski & Nieminen IN THE RPA LIMIT
Ref.: Boronski and R.M. Nieminen, Phys. Rev. B 34, 3820 (1986)
# Zero-positron density limit of Arponen and Pajanne provided by Boronski & Nieminen
Ref.: Boronski and R.M. Nieminen, Phys. Rev. B 34, 3820 (1986)
# Enhancement factor of Boronski & Nieminen IN THE RPA LIMIT
Ref.: Boronski and R.M. Nieminen, Phys. Rev. B 34, 3820 (1986)
Positron lifetime (ps) = 2.55617112E+02
Positron lifetime (ps) = 2.55612619E+02
Including the self-consistency increases the positron lifetime, because its
localization inside the vacancy becomes stronger when the positron and the
@ -193,42 +192,38 @@ electron densities are allowed to relax.
In addition to the self-consistency, the lifetime of a positron inside a
vacancy can be strongly affected by the relaxation of the atoms due to the
forces coming from both the electrons and the positron. You can already start
the relaxation of the vacancy by issuing:
the relaxation (with the `tpositron_4.abi` input file) of the vacancy by issuing:
abinit < tpositron_4.files > log 2> err &
!!! important
Don't forget to put *tpositron_4.in* in *tpositron_x.files*.
abinit tpositron_4.abi >& log
In this calculation we switched on the atomic relaxation by setting
[[ionmov]] = 2. We need to calculate forces to be able to move the atoms, so we
set [[optforces]] = 1. In the provided *tpositron_4.in* file, we only perform 4
set [[optforces]] = 1. In the provided `tpositron_4.abi` file, we only perform 4
relaxation steps ([[ntime]] = 4) to save time, but more steps would be needed to
converge the positron lifetime.
{% dialog tests/tutorial/Input/tpositron_3.in %}
{% dialog tests/tutorial/Input/tpositron_4.abi %}
Look at the positron lifetime in the RPA limit after each ionic step:
Positron lifetime (ps) = 2.55617112E+02
Positron lifetime (ps) = 2.56981105E+02
Positron lifetime (ps) = 2.81986785E+02
Positron lifetime (ps) = 2.82826327E+02
Positron lifetime (ps) = 2.55612619E+02
Positron lifetime (ps) = 2.56978378E+02
Positron lifetime (ps) = 2.82166606E+02
Positron lifetime (ps) = 2.82878399E+02
As the vacancy relaxes outwards, the positron lifetime increases. 4 steps were
not enough to relax the defect completely, as the lifetime still changes.
Indeed, setting [[ntime]] to 10 delivers:
Positron lifetime (ps) = 2.55617112E+02
Positron lifetime (ps) = 2.56981106E+02
Positron lifetime (ps) = 2.81986782E+02
Positron lifetime (ps) = 2.82826326E+02
Positron lifetime (ps) = 2.86660064E+02
Positron lifetime (ps) = 2.87040831E+02
Positron lifetime (ps) = 2.87284438E+02
Positron lifetime (ps) = 2.87360829E+02
Positron lifetime (ps) = 2.87302206E+02
Positron lifetime (ps) = 2.55612619E+02
Positron lifetime (ps) = 2.56978379E+02
Positron lifetime (ps) = 2.82166601E+02
Positron lifetime (ps) = 2.82878398E+02
Positron lifetime (ps) = 2.86515373E+02
Positron lifetime (ps) = 2.86983434E+02
Positron lifetime (ps) = 2.87266489E+02
Positron lifetime (ps) = 2.87359897E+02
Positron lifetime (ps) = 2.87313132E+02
Although the results at ionic steps 3 and 4 differ from each other by less
than one percent, they differ by more from the final result. The one percent
@ -246,13 +241,13 @@ scheme. This type of calculation is much more time and memory consuming than
the _lifetime_ calculation, as it is using the electron and positron
_wavefunctions_ (not only _densities_).
You can already issue (putting *tpositron_5.in* in *tpositron_x.files*):
You can already issue:
abinit < tpositron_5.files > log 2> err &
abinit tpositron_5.abi >& log
Now take a look at the input file *tpositron_5.in*.
Now take a look at the input file `tpositron_5.abi`.
{% dialog tests/tutorial/Input/tpositron_5.in %}
{% dialog tests/tutorial/Input/tpositron_5.abi %}
The momentum distribution calculation is activated by [[posdoppler]] = 1. You can also notice that instead
of having two datasets as in the first part of this tutorial, we now use the
@ -261,18 +256,18 @@ we need to have the full electron and positron wavefunctions in memory, which
is only the case when [[positron]] <= -10. Additionally, the momentum
distribution calculations require using a full k-point grid. In the input file we set:
kptopt 0
istwfk *1
nkpt 8 # This corresponds to a 2x2x2 grid, denser grids may be needed to get converged spectra
kpt
0 0 0
0 0 0.5
0 0.5 0
0.5 0 0
0 0.5 0.5
0.5 0 0.5
0.5 0.5 0
0.5 0.5 0.5
kptopt 0 # Option for manual setting of k-points
istwfk *1 # No time-reversal symmetry optimization
nkpt 8 # Corresponds to a 2x2x2 grid
kpt # K-point coordinates in reciprocal space:
0 0 0
0 0 0.5
0 0.5 0
0.5 0 0
0 0.5 0.5
0.5 0 0.5
0.5 0.5 0
0.5 0.5 0.5
This grid is used in both electron and positron calculations, but only the
positron _wavefunction_ at the first point is taken in the momentum distribution
@ -281,16 +276,21 @@ calculation, so the $\Gamma$ point should always be given first.
In the calculation of the momentum distribution, we need to include both _core_
and _valence_ electrons. The _wavefunctions_ of the core electrons are read from a
file (one per atom type), which needs to be provided. This _core WF file_ should
be named `<psp_file_name>.corewf` (where `<psp_file_name>` is the name of the
pseudo-potential (or PAW) file) or `corewf.abinit<ityp>` (where `<ityp>` is the
index of the atom type). _Core WF files_ can be obtained with the `atompaw` tool
be named <span style="color:green">&#60;psp_file_name&#62;.corewf.xml</span>
(where `<psp_file_name>` is the name of the PAW atomic dataset file, without `.xml` suffix).
_Core WF files_ can be obtained with the `atompaw` tool
(see [the tutorial on generating PAW datasets (PAW2)](paw2) ) by the use of the
`prtcorewf` keyword. You will find the core wavefunction file used in this calculation in
*$ABI_PSPDIR/Si.LDA-PW-paw.abinit.corewf*.
`$ABI_PSPDIR/Si.LDA-PW-paw.abinit.corewf`.
Once the calculation is complete, you can find a *tpositron_5o_DOPPLER* file
!!! Note
If you use a PAW dataset in _ABINIT legacy proprietary format_ (with the `.abinit` suffix),
the core wavefunction file has to be named `<psp_file_name>.corewf.abinit`.
It also can be obtained with the `atompaw` tool by the use of the `prtcorewf` keyword.
Once the calculation is complete, you can find a `tpositron_5o_DOPPLER` file
containing the _momentum distribution_ on the FFT grid. You can use the
*~abinit/scripts/post_processing/posdopspectra.F90* tool to generate 1D
`$ABI_HOME/scripts/post_processing/posdopspectra.F90` tool to generate 1D
projections (_Doppler spectra_) in (001), (011) and (111) directions and to
calculate the low- and high-momentum contributions to the
momentum distribution (so called `S` and `W` parameters, see [[cite:Wiktor2015]]).
@ -308,25 +308,39 @@ The simplest way to make the **PAW
dataset** more complete is to include `semicore electrons`. It is also possible to
add the `partial waves` corresponding to the `semicore electrons` in the basis
used only for the positron wave function description, while keeping the
initial number of valence electrons (as done in [[cite:Wiktor2015]]). However, this second method is less straightforward.
initial number of valence electrons (as done in [[cite:Wiktor2015]]).
However, this second method is less straightforward.
The previous calculations were done with only **4 valence electrons** (`3s` and `3p`).
We will now see what happens if we include the `2s` and `2p` states in the **PAW dataset**.
In *tpositron_12el_x.files* we have replaced the *Si.LDA-PW-paw.abinit*
dataset with *Si.12el.LDA-PW-paw.abinit*. We can now rerun the lifetime calculation:
We use the `Si_paw_pw_12el.xml` PAW dataset which includes 8 additional valence electrons.
abinit < tpositron_12el_x.files > log 2> err
!!!Tip
To generate the new dataset we use the `atompaw` tool.
To add `semicore states`, the input file is modified
as follows:
- Replace `c` by `v` for the selected orbitals in the _electronic configuration_ section
- Decrease the PAW augmentation radius (because semicore states are more localized)
Don't forget to add `prtcorewf` keyword to create the core orbital file.
We can now rerun the lifetime calculation with the new atomic dataset:
{% dialog tests/tutorial/Input/tpositron_6.abi %}
abinit tpositron_6.abi >& log
We now find the positron lifetime calculated in the RPA limit:
########## Lifetime computation 2
########## Lifetime computation 2
# Zero-positron density limit of Arponen and Pajanne provided by Boronski & Nieminen
Ref.: Boronski and R.M. Nieminen, Phys. Rev. B 34, 3820 (1986)
# Enhancement factor of Boronski & Nieminen IN THE RPA LIMIT
Ref.: Boronski and R.M. Nieminen, Phys. Rev. B 34, 3820 (1986)
# Zero-positron density limit of Arponen and Pajanne provided by Boronski & Nieminen
Ref.: Boronski and R.M. Nieminen, Phys. Rev. B 34, 3820 (1986)
# Enhancement factor of Boronski & Nieminen IN THE RPA LIMIT
Ref.: Boronski and R.M. Nieminen, Phys. Rev. B 34, 3820 (1986)
Positron lifetime (ps) = 2.11481560E+02
Positron lifetime (ps) = 2.11470610E+02
This value is significantly lower than 223 ps achieved with 4 valence
electrons in the first step. **It is, therefore, very important to always test
@ -334,21 +348,24 @@ the PAW dataset completeness for positron calculations**.
The PAW dataset completeness is even more important in the _Doppler spectra_
calculations. We will now recalculate the momentum distribution including 12
_valence electrons_ (using *tpositron_7.in* in *tpositron_12el_x.files*):
_valence electrons_ using `tpositron_7.abi`:
abinit < tpositron_12el_x.files > log 2> err
{% dialog tests/tutorial/Input/tpositron_7.abi %}
Before processing the new *tpositron_7o_DOPPLER file*, you should copy files
abinit tpositron_7.abi >& log
Before processing the new `tpositron_7o_DOPPLER file`, you should copy files
`rho_001`, `rho_011`, `rho_111` from the fifth step to for instance `si4el_001`, `si4el_011` and `si4el_111`.
By plotting the _Doppler spectra_ in the (001) direction calculated with 4 and
12 valence electrons, you should obtain a figure like this:
![](positron_assets/doppler.png)
![](positron_assets/doppler.png){width=60%}
The dataset with 4 valence electrons is **not complete enough** to describe the
positron `wavefunction` around the nucleus. This is reflected in the
positron **wavefunction** around the nucleus. This is reflected in the
unphysically high probability at high momenta in the spectrum.
Further explanation of the influence of the PAW dataset on the _Doppler spectra_
can be found in [[cite:Wiktor2015]]. In case you need to generate
your own dataset for momentum distribution calculations, you can follow the [tutorial on generating PAW datasets (PAW2)](paw2).
your own dataset for momentum distribution calculations,
you can follow the [tutorial on generating PAW datasets (PAW2)](paw2).

View File

@ -31,8 +31,7 @@ Why not create Work_rf1 in \$ABI_TESTS/tutorespfn/Input?*
cd $ABI_TESTS/tutorespfn/Input
mkdir Work_rf1
cd Work_rf1
cp ../trf1_x.files . # You will need to edit this file.
cp ../trf1_1.in .
cp ../trf1_1.abi .
```
!!! important
@ -42,24 +41,19 @@ cp ../trf1_1.in .
specialized, non-DFPT ones), but `$ABI_TESTS/tutorespfn`.
This will be the case for all the DFPT based part of the tutorial.
The file *trf1_x.files* lists the file names and root names.
{% dialog tests/tutorespfn/Input/trf1_x.files %}
You can copy it in the *Work_rf1* directory and, as usual, change its name to *trf1_1.files*
and replace the occurrences of `trf1_x` by `trf1_1`.
Note that two pseudopotentials are mentioned in this *files* file: one
Note that two pseudopotentials are mentioned in the input file: one
for the Aluminum atom, and one for the Arsenic atom.
The first listed in *trf1_x.files* (for Al) will define the first type of atom of the input file
(see input variables [[typat]] and [[ntypat]]) and the second (for As) will define the second type of atom.
The first listed in *trf1_1.abi* (for Al) will define the first type of atom of the input file
(see input variables [[typat]] and [[ntypat]]) and the second (for As) will define the second type of atom.
It might be the first time that you encounter this situation (more than one type of atoms) in the
tutorials, at variance with the first four basic tutorials.
!!! warning
To access the pseudopotential, the input file expect you to define the variable ABI_PSPDIR in your environment.
You can also copy the file *\$ABI_TESTS/tutorespfn/Input/trf1_1.in* in *Work_rf1*.
You can copy the file *\$ABI_TESTS/tutorespfn/Input/trf1_1.abi* in *Work_rf1*.
This is your input file. You should read it carefully.
{% dialog tests/tutorespfn/Input/trf1_1.in %}
{% dialog tests/tutorespfn/Input/trf1_1.abi %}
It drives a single self-consistent calculation of the total energy of AlAs to generate the corresponding
self-consistent charge density and wavefunctions, that will be used for the DFPT calculations.
@ -67,14 +61,7 @@ self-consistent charge density and wavefunctions, that will be used for the DFPT
Note that the value of [[tolvrs]] is rather stringent.
This is because the wavefunctions determined by the present run will be used later as starting
point of the DFPT calculation.
However, the number of steps, [[nstep]], in this example file has been set to 15, and
you will see that this is not enough to reach the target [[tolvrs]].
In production runs, you should choose a large enough value of [[nstep]] to reach your [[tolvrs]] target.
In the present tutorial, due to portability concerns related to automatic testing, we could
not allow a larger [[nstep]].
This minor problem with some tutorial examples was mentioned briefly in
a side note to the answer to question 1 of tutorial 1 - just before
[this section](base1#computation-of-the-interatomic-distance-method-1).
The number of steps, [[nstep]], in this example file has been set to 25. You should always choose a large enough value of [[nstep]] to reach your [[tolvrs]] target.
!!! danger
@ -89,11 +76,11 @@ They give acceptable but not very accurate results such that the running time is
You should make the run (a few seconds):
abinit < trf1_1.files > log 2> err
abinit trf1_1.abi > log 2> err
The resulting main output file, *trf1_1.out*, should be similar to the one below:
The resulting main output file, *trf1_1.abo*, should be similar to the one below:
{% dialog tests/tutorespfn/Refs/trf1_1.out %}
{% dialog tests/tutorespfn/Refs/trf1_1.abo %}
This output file is not very long, so you can quickly read it entirely.
Note that one obtains the following value for the energy, in the final echo section:
@ -110,14 +97,7 @@ The output file also mentions that the forces on both atoms vanish.
The run that you just made will be considered as defining a ground-state
configuration, on top of which responses to perturbations will be computed.
The main output of this ground-state run is the wavefunction file *trf1_1o_WFK*,
that you can already rename as *trf1_1i_WFK* to use it as input wave function for the next runs.
!!! warning
So, in the corresponding *files* file for all the following runs, at third line,
pay attention **to keep** "trf1_1i". By contrast, for the second run, you
should change the first line from "trf1_1" to "trf1_2", and do similarly for the second,
fourth and fifth lines of this file.
that you can already rename as *trf1_2i_WFK* to use it as input wave function for the next runs.
## 2 Frozen-phonon calculation of a second derivative of the total energy
@ -132,25 +112,27 @@ For the time being, in order to be able to perform a direct comparison with the
a DFPT calculation, we choose as a perturbation the displacement of the Al
atom along the first axis of the reduced coordinates.
You can copy the file *\$ABI_TESTS/tutorespfn/Input/trf1_2.in* in *Work_rf1*.
You can copy the file *\$ABI_TESTS/tutorespfn/Input/trf1_2.abi* in *Work_rf1*.
This is your input file. You should open it and briefly look at the two
changes with respect to *trf1_1.in*:
the change of [[xred]], and the reading of the wavefunction file, using the [[irdwfk]] input variable.
changes with respect to *trf1_1.abi*:
the change of [[xred]], and the reading of the wavefunction file, using the [[irdwfk]] input variable.
!!! warning
You need to copy trf1_1.o_WFK to trf1_2.i_WFK so Abinit can find the wavefunction during the calculation.
Then, you can make the run, following the same command as before, with a different files file, referring to *trf1_2.in*.
Then, you can make the run, following the same command as before, with a different files file, referring to *trf1_2.abi*.
The symmetry is lowered with respect to the ground-state geometry, so that the number of k-points
increases a lot, and of course, the CPU time.
{% dialog tests/tutorespfn/Input/trf1_2.in tests/tutorespfn/Refs/trf1_2.out %}
{% dialog tests/tutorespfn/Input/trf1_2.abi tests/tutorespfn/Refs/trf1_2.abo %}
From this run, it is possible to get the values of the total energy, and the
value of the gradient of the total energy (dE) with respect to change of reduced coordinate (dt):
rms dE/dt= 3.5517E-03; max dE/dt= 5.0079E-03; dE/dt below (all hartree)
1 0.005007937776 0.002526310510 0.002526310510
2 -0.005007879256 -0.002526283046 -0.002526283046
...
>>>>>>>>> Etotal= -9.76268124105767E+00
rms dE/dt= 3.5517E-03; max dE/dt= 5.0079E-03; dE/dt below (all hartree)
1 0.005007937776 0.002526310510 0.002526310510
2 -0.005007879256 -0.002526283046 -0.002526283046
...
total_energy : -9.76268124105730E+00
The change of reduced coordinate ([[xred]]) of the Al atom along the first axis was
rather small (1/1000 = 0.001), and we can make an estimate of the second derivative of
@ -233,9 +215,9 @@ case, taking a finer XC grid will allow one to reduce this effect.
We now compute the second derivative of the total energy with respect to the
same atomic displacement through the DFPT capabilities of ABINIT.
You can copy the file *\$ABI_TESTS/tutorespfn/Input/trf1_3.in* in *Work_rf1*.
You can copy the file *\$ABI_TESTS/tutorespfn/Input/trf1_3.abi* in *Work_rf1*.
This is your input file. You should examine it. The changes with respect to
*trf1_1.in* are all gathered in the first part of this file, before
*trf1_1.abi* are all gathered in the first part of this file, before
```
#######################################################################
@ -246,7 +228,11 @@ Accordingly, you should get familiarized with the new input variables:
[[rfphon]], [[rfatpol]], [[rfdir]]. Then, pay attention to the special use of
the [[kptopt]] input variable. It will be explained in more detail later.
{% dialog tests/tutorespfn/Input/trf1_3.in %}
!!! warning
You need to copy trf1_2.o_WFK to trf1_3.i_WFK so Abinit can find the wavefunction during the calculation.
{% dialog tests/tutorespfn/Input/trf1_3.abi %}
When you have understood the purpose of the input variable values specified
before the "Common input variables" section, you can make the code run, as usual.
@ -258,7 +244,7 @@ Read it quickly, as we will come back to the most important points hereafter.
ABINIT has created several different files:
* *trf1_3.log* (the log file)
* *trf1_3.out* (the output file), possibly also trf1_3o_OUT.nc, an abridged netCDF version
* *trf1_3.abo* (the output file), possibly also trf1_3o_OUT.nc, an abridged netCDF version
* *trf1_3o_1WF1* (the 1st-order wavefunction file)
* *trf1_3o_DEN1* (the 1st-order density file)
* *trf1_3o_POT1* (the 1st-order potential file)
@ -267,7 +253,7 @@ ABINIT has created several different files:
Let us have a look at the output file. You can follow the description provided
in the [[help:respfn#output|section 6.2]] of the respfn help file.
{% dialog tests/tutorespfn/Refs/trf1_3.out %}
{% dialog tests/tutorespfn/Refs/trf1_3.abo %}
You should be able to find the place where the iterations
for the minimisation (with respect to the unique perturbation) take place:
@ -299,29 +285,32 @@ DFPT approach calls for some accuracy considerations. These can be found in
With |AbiPy|, one can easily visualize the convergence of the DFPT cycle with the |abiopen| script
and the syntax:
abiopen.py trf1_3.out --expose -sns=talk
abiopen.py trf1_3.abo --expose -sns=talk
![](rf1_assets/abiopen_trf1_3.out.png)
## 4 DFPT calculation of the dynamical matrix at $\Gamma$
We are now in the position to compute the full dynamical matrix at the $\Gamma$ point (q=0).
You can copy the file *\$ABI_TESTS/tutorespfn/Input/trf1_4.in* in *Work_rf1*.
You can copy the file *\$ABI_TESTS/tutorespfn/Input/trf1_4.abi* in *Work_rf1*.
This is your input file.
As for test rf1_3, the changes with respect to *trf1_1.in* are
As for test rf1_3, the changes with respect to *trf1_1.abi* are
all gathered in the first part of this file. Moreover, the changes with
respect to *trf1_3.in* concern only the input variables [[rfatpol]], and [[rfdir]].
respect to *trf1_3.abi* concern only the input variables [[rfatpol]], and [[rfdir]].
Namely, all the atoms will be displaced, in all the directions.
{% dialog tests/tutorespfn/Input/trf1_4.in%}
!!! warning
You need to copy trf1_2.o_WFK to trf1_4.i_WFK so Abinit can find the wavefunction during the calculation.
{% dialog tests/tutorespfn/Input/trf1_4.abi%}
There are six perturbations to consider.
So, one might think that the CPU time will raise accordingly.
This is not true, as ABINIT is able to determine which perturbations are the symmetric of another perturbation,
see [[help:respfn#symmetries|section 3]] of the respfn help file.
Now, you can make the run. You open the file *trf1_4.out*, and notice that the
Now, you can make the run. You open the file *trf1_4.abo*, and notice that the
response to two perturbations were computed explicitly, while the response to
the other four could be deduced from the two first by using the symmetries.
@ -398,12 +387,12 @@ section of the present tutorial. The sections to be read are:
You are now in the position to compute the full dynamical matrix at $\Gamma$ (q=0),
including the coupling with an homogeneous electric field.
You can copy *\$ABI_TESTS/tutorespfn/Input/trf1_5.in* in *Work_rf1*.
You can copy *\$ABI_TESTS/tutorespfn/Input/trf1_5.abi* in *Work_rf1*.
This is your input file.
{% dialog tests/tutorespfn/Input/trf1_5.in tests/tutorespfn/Refs/trf1_5.out %}
{% dialog tests/tutorespfn/Input/trf1_5.abi tests/tutorespfn/Refs/trf1_5.abo %}
As for the other DFPT tests, the changes with respect to the *trf1_1.in* are all gathered
As for the other DFPT tests, the changes with respect to the *trf1_1.abi* are all gathered
in the first part of this file.
Unlike the other tests, however, the multi-dataset mode was used, computing from scratch
the ground-state properties, then computing the effect of the ddk perturbation, then the effect of all
@ -550,8 +539,10 @@ Still, the agreement of our calculation with the theoretical result is not very
[[ecut]] = 3 Hartree, we have 9.76. Changing it to 6 Hartree gives 10.40 . A
better k point sampling (8x8x8), with [[ecut]] = 6 Hartree, reduces the value to 9.89.
Changing pseudopotentials finally improves the agreement: with the
much harder *13al.pspgth* and *33as.psphgh* pseudopotentials with adequate
[[ecut]] = 16 Hartree and 8x8x8 Monkhorst-Pack sampling, we reach a value of 9.37.
much harder *al.psp8* and *as.psp8* pseudopotentials with adequate
[[ecut]] = 20 Hartree and 8x8x8 Monkhorst-Pack sampling, we reach a value of 9.30.
Note that we need to change [[ixc]]=-1012 and consider [[nband]]=9, since there is 3 electrons for Al and 15 electrons for As moving in these pseudopotential.
This information can be found by searching zion in the .abo of any file using the pseudopotentials.
This illustrates that the dielectric tensor is a much more sensitive quantity than the others.
## 6 DFPT calculation of phonon frequencies at non-zero q
@ -563,16 +554,16 @@ In any case, the computation within the reciprocal space DFPT formalism is more
efficient than the real space frozen-phonon technique since the use of supercells is
completely avoided with DFPT. For an explanation of this fact, see for example section IV of [[cite:Gonze1997]].
You can copy the file *\$ABI_TESTS/tutorespfn/Input/trf1_6.in* in *Work_rf1*.
You can copy the file *\$ABI_TESTS/tutorespfn/Input/trf1_6.abi* in *Work_rf1*.
This is your input file.
{% dialog tests/tutorespfn/Input/trf1_6.in tests/tutorespfn/Refs/trf1_6.out %}
{% dialog tests/tutorespfn/Input/trf1_6.abi tests/tutorespfn/Refs/trf1_6.abo %}
As for the other RF tests, the changes with respect to *trf1_1.in* are
As for the other RF tests, the changes with respect to *trf1_1.abi* are
all gathered in the first part of this file.
The multi-dataset mode is used, computing from scratch the ground-state wave functions, then computing different
dynamical matrices with DFPT.
The run is about 1...2 minutes on a 2.8 GHz machine.
The run is about 1 minutes on a 2.8 GHz machine.
In the mean time, you might read more of the ABINIT documentation
(why not the [[help:mrgddb|mrgddb_help]] and the [[help:anaddb|anaddb_help]]).

View File

@ -27,22 +27,21 @@ This tutorial should take about 1 hour.
*Before beginning, you might consider to work in a different subdirectory as
for the other tutorials. Why not create Work_rf2 in \$ABI_TESTS/tutorespfn/Input?*
Then copy the files *trf2_1.files* and *trf2_1.in* from \$ABI_TESTS/tutorespfn/Input* to *Work_rf2*:
Then copy the file *trf2_1.abi* from \$ABI_TESTS/tutorespfn/Input* to *Work_rf2*:
```sh
cd $ABI_TESTS/tutorespfn/Input
mkdir Work_rf2
cd Work_rf2
cp ../trf2_1_x.files .
cp ../trf2_1.in .
cp ../trf2_1.abi .
```
This tutorial starts by the generation of a database, that might be quite time-consuming.
We suggest you to start immediately this computation with
abinit < trf2_1.files >& log &
abinit trf2_1.abi >& log &
It takes about 3-5 minutes to be completed on a PC 2.8 GHz.
It takes about 1-2 minutes to be completed on a PC 2.8 GHz.
In order to do interatomic force constant (IFC) calculations, and to compute
associated phonon band structure and thermodynamical properties, you should
@ -61,9 +60,9 @@ dynamical matrix in the IBZ and post-process the results with anaddb is given be
![](rf2_assets/ph_dde_workflow.png)
Let us have a look at the input file *trf2_1.in*.
Let us have a look at the input file *trf2_1.abi*.
{% dialog tests/tutorespfn/Input/trf2_1.in %}
{% dialog tests/tutorespfn/Input/trf2_1.abi %}
The calculation is done for AlAs, the same crystalline material as for the first tutorial on DFPT.
Many input parameters are also quite similar, both at the level of the description
@ -97,7 +96,7 @@ gamma) and taking the output kpt set file as this qpt set. One might set
[[nstep]] = 1 and [[nline]] = 1, so only one iteration runs, or even
[[nstep]] = 0 and [[prtvol]] = -1, so no real DFT calculation is done.
The input file *\$ABI_TESTS/tutorespfn/Input/trf2_2.in* is precisely an input
The input file *\$ABI_TESTS/tutorespfn/Input/trf2_2.abi* is precisely an input
file that can be used to generate such a set of k points.
Copy it in the present *Work_rf2* directly, as well as the accompanying *trf2_2.files*.
Examine these files, then run this calculation (it is very rapid - it won't hurt the trf2_1 job).
@ -112,7 +111,7 @@ The following k point set is obtained:
5.00000000E-01 5.00000000E-01 0.00000000E+00
-2.50000000E-01 5.00000000E-01 2.50000000E-01
It is, as promised, the same as the q point set in the *trf2_1.in file*.
It is, as promised, the same as the q point set in the *trf2_1.abi file*.
Now, it might be worth to examine in some detail one of the Derivative
Database that has been created by the trf2_1 run.
@ -150,14 +149,15 @@ and Born effective charges). Name the new DDB *trf2_3.ddb.out*.
(it contains the forces and stresses), but is not needed for the computation
of phonon band structure, interatomic force constants, and thermodynamical properties.
File *\$ABI_TESTS/tutorespfn/Input/trf2_3.in* is an example of input file for MRGDDB.
File *\$ABI_TESTS/tutorespfn/Input/trf2_3.abi* is an example of input file for MRGDDB.
{% dialog tests/tutorespfn/Input/trf2_3.in %}
{% dialog tests/tutorespfn/Input/trf2_3.abi %}
You can copy it in the *Work_rf2* directory, and run the merge as follows:
mrgddb < trf2_3.in
mrgddb < trf2_3.abi
Note the chevron in the call.
## 3 Analysis of the derivative databases
An introduction to the use of the ANADDB utility is described in its [[help:anaddb|help file]].
@ -185,10 +185,10 @@ In this tutorial, we will focus on the flags [[anaddb:ifcflag]] and [[anaddb:thm
## 4 The computation of interatomic force constants
You can copy the files *trf2_4.in* and *trf2_4.files* from *\$ABI_TESTS/tutorespfn/Input* to the *Work_rf2* directory.
Open the file *trf2_4.in*. Note that [[anaddb:ifcflag]] is activated.
You can copy the files *trf2_4.abi* and *trf2_4.files* from *\$ABI_TESTS/tutorespfn/Input* to the *Work_rf2* directory.
Open the file *trf2_4.abi*. Note that anaddb use the old format to start calculations which means it needs a files file. Also note that [[anaddb:ifcflag]] is activated.
{% dialog tests/tutorespfn/Input/trf2_4.files tests/tutorespfn/Input/trf2_4.in %}
{% dialog tests/tutorespfn/Input/trf2_4.files tests/tutorespfn/Input/trf2_4.abi %}
Related input variables can be split in three groups.
The first group of variables define the grid of q wavevectors:
@ -227,9 +227,9 @@ Now, you should issue:
It will last only a few seconds.
The file *trf2_4.out* contains the list of interatomic force constants, as well as some analysis.
The file *trf2_4.abo* contains the list of interatomic force constants, as well as some analysis.
{% dialog tests/tutorespfn/Refs/trf2_4.out %}
{% dialog tests/tutorespfn/Refs/trf2_4.abo %}
Open this file and find the following paragraph:
@ -258,10 +258,10 @@ longitudinal and a transverse component.
## 5 Computation of phonon band structures with efficient interpolation
You can copy the files *trf2_5.in* and *trf2_5.files* from *\$ABI_TESTS/tutorespfn/Input* to the *Work_rf2* directory.
Then open *trf2_5.in*.
You can copy the files trf2_5.abi and trf2_5.files from $ABI_TESTS/tutorespfn/Input to the Work_rf2 directory.
Then open *trf2_5.abi*.
{% dialog tests/tutorespfn/Input/trf2_5.files tests/tutorespfn/Input/trf2_5.in %}
{% dialog tests/tutorespfn/Input/trf2_5.files tests/tutorespfn/Input/trf2_5.abi %}
Note that [[anaddb:ifcflag]] is again activated.
Indeed, in order to compute a phonon band structure using the Fourier
@ -283,22 +283,22 @@ Now, you should issue:
It will last only a few seconds.
The file *trf2_5.out* contains the list of eigenvalues, for all the needed
The file *trf2_5.abo* contains the list of eigenvalues, for all the needed
q-wavevectors. You can iopen it, and have a look at the different sections of
the file. Note that the interatomic force constants are computed (they are
needed for the Fourier interpolation), but not printed.
{% dialog tests/tutorespfn/Refs/trf2_5.out %}
{% dialog tests/tutorespfn/Refs/trf2_5.abo %}
Please, open also the other output file, named *trf2_5_B2EPS.out.freq*.
It contains the frequencies, in a format suitable for graphical output, using the program
*band2eps* (the latter should be more documented, and will not be described in the present tutorial).
You can copy the files *trf2_6.in* and *trf2_6.files* to the *Work_rf2* directory, then issue
You can copy the files *trf2_6.abi* and *trf2_6.files* to the *Work_rf2* directory. Note that, like anaddb, band2eps use the old format using the files file. Then, issue
band2eps < trf2_6.files > trf2_6.log
{% dialog tests/tutorespfn/Input/trf2_6.files tests/tutorespfn/Input/trf2_6.in %}
{% dialog tests/tutorespfn/Input/trf2_6.files tests/tutorespfn/Input/trf2_6.abi %}
The file *trf2_6.out.eps* has been produced. It is an .eps file (eps stand for
Encapsulated PostScript). You can use the program ghostview to vizualize it.
@ -323,7 +323,7 @@ first columns give the k point coordinates), that is, at lines 1 and 31:
0.000000D+00 0.000000D+00 0.000000D+00 0.156855D-02 0.156855D-02 0.156855D-02
Replace these values (sixth column, line 1 and 31) by the correct value,
including the LO-TO splitting, that you can find in the file *trf2_5.out*, at
including the LO-TO splitting, that you can find in the file *trf2_5.abo*, at
the end, second list of vector. That is, the lines 1 and 31 should now read:
0.000000D+00 0.000000D+00 0.000000D+00 0.156855D-02 0.156855D-02 1.730353E-03
@ -377,7 +377,7 @@ Of course, one could use the materials project web interface but we can also do
from the shell by just passing our Abinit input file to the |abistruct| script:
```shell
abistruct.py mp_match trf2_1.in
abistruct.py mp_match trf2_1.abi
# Found 1 structures in Materials Project database (use `verbose` to get further info)
@ -431,11 +431,11 @@ farthest from a clean, stable, usage. By exploring the input variables, the
user should be able to produce figures and data like the ones for SiO2 quartz
and stishovite, published in [[cite:Lee1995]].
You can copy the files *trf2_7.in* and *trf2_7.files* from *\$ABI_TESTS/tutorespfn/Input* to *Work_rf2*
You can copy the files *trf2_7.abi* from *\$ABI_TESTS/tutorespfn/Input* to *Work_rf2*
and have a look at them.
The same DDB as for trf2_4 and trf2_5 is used, namely *trf2_3.ddb.out*.
{% dialog tests/tutorespfn/Input/trf2_7.files tests/tutorespfn/Input/trf2_7.in %}
{% dialog tests/tutorespfn/Input/trf2_7.files tests/tutorespfn/Input/trf2_7.abi %}
The following additional input variables are present:

View File

@ -8,11 +8,11 @@ authors: GZ, MT, EB, MJV
This tutorial aims at showing how to get the following physical properties:
* the total magnetization of a ferromagnetic material
* the magnetization of an antiferromagnetic material
* the total magnetization of a ferromagnetic (or ferrimagnetic) material
* the estimation of the atom magnetic moment
* analyse the total density of states per spin direction
* analyse the density of states per atom and per spin direction
* look at the effect of spin-orbit coupling for a non magnetic system
* effect of spin-orbit coupling for a non magnetic system
* non-collinear magnetism (not yet)
* spin-orbit coupling and magnetocristalline anisotropy (not yet)
@ -27,136 +27,151 @@ This tutorial should take about 1.5 hour.
*Before beginning, you might consider to work in a different subdirectory, as
for the other tutorials. Why not Work_spin?*
The file *tspin_x.files* in *\$ABI_TESTS/tutorial/Input* lists the file names and root names.
while *tspin_1.in* is our input file.
You can copy these two files in the *Work_spin* directory with:
The file *tspin_x.abi* in *\$ABI_TESTS/tutorial/Input* lists the input files for the spin tutorials.
You can copy the first one in the *Work_spin* directory with:
```sh
cd $ABI_TESTS/tutorial/Input
mkdir Work_spin
cd Work_spin
cp ../tspin_x.files . # Change it, when needed, as usual.
cp ../tspin_1.in .
cp ../tspin_1.abi .
```
{% dialog tests/tutorial/Input/tspin_x.files tests/tutorial/Input/tspin_1.in %}
{% dialog tests/tutorial/Input/tspin_1.abi %}
You can now run the calculation with:
```sh
abinit < tspin_x.files > log 2> err &
abinit tspin_1.abi > log > err &
```
then you should edit the input file, and read it carefully.
Because we are going to perform magnetic calculations, there a two new types of variables:
In the mean time the calculation is done, have a look at the input file, and read it carefully.
Because we are going to perform magnetic calculations, there are two new types of variables related to magnetism:
* [[nsppol]]
* [[spinat]]
You can read their description in the help file. You will work at fixed
[[ecut]] (=18Ha) and k-point grid, defined by [[ngkpt]] (the 4x4x4
Monkhorst-Pack grid). It is implicit that in *real life*, you should do a
convergence test with respect to both convergence parameters (NB: one needs a
minimal cut-off to exhibit magnetic effects).
This run takes about 12 seconds on a modern PC.
You will work with a low [[ecut]] (=18Ha) and a small k-point grid (defined by [[ngkpt]]) of 4x4x4
Monkhorst-Pack grid. It is implicit that in *real life*, you should do a
convergence test with respect to both [[ecut]] and [[ngkpt]] parameters and this is even more
important with magnetism that involves low energy differences and small magnetization density values.
We will compare the output with and without magnetization. (Hence, there are two datasets in the run)
We now look at the output file:
In the magnetic case, the electronic density is split into two parts,
This basic first example will compare two cases,
one that do not take into account magnetism and one that take into account it
(done through two datasets in the input, the dataset 1 does not include magnetism and dataset 2 includes it).
We now look at the output file.
In the magnetic case (dataset 2), the electronic density is split into two parts,
the "Spin-up" and the "Spin-down" parts to which correspond different Kohn-Sham
potentials and different sets of eigenvalues whose occupations are given by the
Fermi-Dirac function (without the ubiquitous factor 2)
Fermi-Dirac function (without the ubiquitous factor 2).
For the first k-point, for instance, we get:
```
(no magnetization)
occ 2.00000 1.99989 1.99989 1.22915 1.22915 0.28676 0.00000 0.00000
(no magnetism)
2.00000 2.00000 2.00000 2.00000 2.00000 1.99999 1.99999 1.28101 1.28101 0.35284
(magnetic case)
occ 1.00000 0.99999 0.99999 0.98396 0.98396 0.69467 0.00000 0.00000 (spin-up)
1.00000 0.99730 0.99730 0.00898 0.00898 0.00224 0.00000 0.00000 (spin-down)
(SPIN UP)
1.00000 1.00000 1.00000 1.00000 1.00000 1.00000 1.00000 0.97826 0.97826 0.68642
(SPIN DOWN)
1.00000 1.00000 1.00000 1.00000 1.00000 0.99995 0.99995 0.05851 0.05851 0.01699
```
We note that the occupations are very different for up and down spins, which
means that the eigenvalues are shifted, which is in turn due to a shift of the
exchange-correlation potential, and therefore of the effective potential.
You can indeed have a look at the output file to compare spin-up and down eigenvalues:
We note that the occupations of the magnetic case are different for up and down spin channels, which
means that the eigenvalues are shifted
(which is in turn due to a shift of the exchange-correlation potential and therefore of the effective potential).
You can have a look at the output file to compare spin-up and down eigenvalues:
-0.48411 -0.38615 -0.38615 -0.30587 -0.30587 -0.27293 0.33747 0.33747 (up, kpt#1)
-0.46638 -0.32383 -0.32383 -0.21767 -0.21767 -0.20371 0.36261 0.36261 (dn, kpt#1)
```
(up channel:)
-3.09143 -1.74675 -1.74675 -1.74418 0.25777 0.36032 0.36032 0.46350 0.46350 0.49374
(dn channel:)
-3.04218 -1.69171 -1.69171 -1.68906 0.27331 0.40348 0.40348 0.52935 0.52935 0.54215
```
The magnetization density (in unit of $\mu_B$ - Bohr's magneton) is the
difference between the up and down densities. The magnetization density,
divided by the total density, is denoted "zeta".
This quantity "zeta" can vary between -1 and 1. It is zero everywhere in the non-magnetic case.
In the magnetic case, we can read for instance its minimal and maximal values in the output file provided
that [[prtvol]] is set to 2 in the input file:
Now you can move down in the output file and look at the following section:
````
Integrated electronic and magnetization densities in atomic spheres:
---------------------------------------------------------------------
Radius=ratsph(iatom), smearing ratsm= 0.0000. Diff(up-dn)=approximate z local magnetic moment.
Atom Radius up_density dn_density Total(up+dn) Diff(up-dn)
1 2.00000 7.658786 6.158329 13.817115 1.500458
---------------------------------------------------------------------
Sum: 7.658786 6.158329 13.817115 1.500458
Total magnetization (from the atomic spheres): 1.500458
Total magnetization (exact up - dn): 1.571040
======================================================================
````
Min spin pol zeta= -4.8326E-02 at reduced coord. 0.7222 0.5000 0.2222
next min= -4.8326E-02 at reduced coord. 0.5000 0.7222 0.2222
Max spin pol zeta= 5.7306E-01 at reduced coord. 0.0000 0.8889 0.8889
next max= 5.7306E-01 at reduced coord. 0.8889 0.0000 0.8889
In the last line, it is reported the total magnetization of the whole unit cell
(in unit of $\mu_B$ - Bohr's magneton), which correponds to the difference between the
integrated up and down densities, here we have 1.571040 $\mu_B$.
It is also reported the same difference but as integrated into spheres around each atom
(here we have only one atom), which gives here 1.500458 $\mu_B$ on iron atom.
The integrated magnetization in atomic spheres is an approximation, one should always check
that the sum of the integrated atomic magnetization "from the atomic sphere" is very close to the
exact up-dn unit cell magnetization.
In the case of dataset 1 without magnetism, only the integrated electronic density is reported since there is
no distinction between up and down spin channels.
The total magnetization, i.e. the integrated in the unit cell, is now:
You can look at the total energy of dataset 1 and 2:
Magnetization (Bohr magneton)= 1.96743463E+00
Total spin up = 4.98371731E+00 Total spin down = 3.01628269E+00
```
etotal1 -1.2342819713E+02
etotal2 -1.2343141307E+02
```
We observe that the total density (up + down) yields 8.000 as expected.
The energy of the magnetic calculation is lower than the non-magnetic one,
which is expected for a magnetic crystal (the system gains energy through the extra degrees of freedom given by the spins).
Finally, you can also remark that the stress tensor is affected by the presence of magnetism.
This would also be true for the forces, but we don't remark it here because we are in high symmetry symmetry structure (all the forces are zeroed by symmetry), however this would be apparent for a less symmetric material.
The magnetization density is not the only changed quantity.
The energy is changed too, and we get:
etotal1 -2.4661707268E+01 (no magnetization)
etotal2 -2.4670792868E+01 (with magnetization)
The energy of the magnetized system is the lowest and therefore energetically
favoured, as expected since bcc iron is a ferromagnet.
Finally, one also notes that the stress tensor is affected by the
magnetization. This would also be true for the forces, for a less symmetric material.
It is interesting to consider in more detail the distribution of eigenvalues
for each direction of magnetization, which is best done by looking at the
respective densities of state.
To this end we have set [[prtdos]] = 1 in the input file, in order to obtain
the density of states corresponding to spin-up and spin-down electrons (as soon as [[nsppol]] = 2).
The values of the DOS are in the files *tspin_1o_DS1_DOS* and *tspin_1o_DS2_DOS*
for the magnetic and non-magnetic cases respectively. We can extract the values
for use in a plotting software.
Traditionally, in order to enhance visibility, one plots
the DOS of minority spin electrons using negative values.
If we compare the DOS of the magnetized system
for each spin channel, which is best done by looking at the respective densities of state (DOS).
To this end we have set [[prtdos]] = 1 in the input file that will print the up and down DOS (as soon as [[nsppol]] = 2).
The DOS data can be found in the files *tspin_1o_DS1_DOS* and *tspin_1o_DS2_DOS*
for the non-magnetic and the magnetic cases respectively, which can be used with a plotting software.
Traditionally, in order to enhance visibility, the DOS of minority spin electrons is done using negative values.
If we compare the DOS of the magnetized system (the Fermi energy is highlighted by a vertical dashed line):
![](spin_assets/bccfe_mag_dos2.jpg)
and the non-magnetized system
and the non-magnetized system:
![](spin_assets/bccfe_nonmag_dos2.jpg)
we observe that the up and down DOS have been "shifted" with respect each other.
The integrated density of states yields the number of electrons for each spin
direction, and we see the magnetization which arises from the fact that there
are more up than down electrons at the Fermi level.
We observe that the up and down DOS channels have been "shifted" with respect to each other, which is a footprint of the presence of non-zero total magnetization in the crystal (either ferro- or ferri-magnetic).
The integrated DOS yields the number of electrons for each spin direction,
and we see that the magnetization arises from the fact that there are more up than down electrons at the Fermi level.
That the magnetization points upwards is fortuitous, and we can get it
pointing downwards by changing the sign of the initial [[spinat]].
Indeed, in the absence of spin-orbit coupling, there is no relation between
the direction of magnetization and the crystal axes.
If we start with a [[spinat]] of 0, the magnetization remains 0. [[spinat]]
serves two purposes: it is a way to initially break the spin symmetry (up/down), and also
to start with a reasonable magnetic moment, close enough to the final one (in spin DFT,
as opposed to the original flavor, there can be several local minima for the total energy).
The magnetization is from the up channels because we initialized [[spinat]] with positive values.
We could initialize it to a negative value to have negative magnetization.
[[spinat]] serves two purposes: it is a way to initially break the spin symmetry (up/down),
and also to start with an initial magnetic moment,
ideally close enough to the final DFT one but sometimes a final non-zero magnetic moment on the atoms is obtained by initializing [[spinat]] to larger values than the formal one
(in spin DFT there can be several local minima for the total energy and depending on your starting point you can end up in different local minima).
Note that [[spinat]] has three components (i.e. for x, y and z directions) for each atom
but in the absence of spin-orbit coupling (collinear calculation)
there is no relation between the direction of magnetization and the crystal axes.
In these collinear magnetism calculations, only the z component of the spins is read to define the amplitude of the atomic magnetic moment
(treated as a scalar value, i.e. only sign and amplitude matter).
The self-consistent loop is affecting both the density (like in the non-magnetic case) as
well as the spin-magnetization. For this reason, it might be more difficult to reach
than in the non-magnetic case.
Not only starting with a reasonable magnetic moment might help in this respect, but also,
modified (tighter) calculation parameters might be needed. For example, in the case of
Cobalt, in order to obtain the correct (non-zero) magnetic moment, a rather
dense sampling of wavevectors in the Brillouin zone must be used (e.g.e 16x16x16), with a
rather small value of [[tsmear]]. The solution of the Kohn-Sham equation
will benefit of using a smaller value of [[tolrde]] (e.g. 0.001 instead of the default 0.005),
and a larger value of [[nline]] (e.g. 6 instead of the default 4).
well as the spin-magnetization.
For this reason, it might be more difficult to reach convergence in the magnetic cases than in
the non-magnetic cases.
Not only starting with a large enough magnetic moment might help to converge toward the correct
magnetic ground sate,
but also modified (tighter) convergence parameters might be needed.
For example, in the case of Cobalt, in order to obtain the correct (non-zero) magnetic moment,
a rather dense k-point sampling in the Brillouin zone must be used (e.g. 16x16x16), with a
rather small value of [[tsmear]].
The convergence of a magnetic calculation a smaller value of [[tolrde]] (e.g. 0.001 instead of the default 0.005),
a larger value of [[nline]] (e.g. 6 to 12 instead of the default 4)
and/or reducing the mixing parameters diemix and mostly diemixmag.
## 2 An antiferromagnetic example: *fcc* Fe
@ -165,7 +180,7 @@ Well sort of....
Actually, fcc Fe, displays many complicated structures, in particular spin spirals.
A spiral is characterized by a direction along an axis, an angle of
the magnetization with respect to this axis and a step after which the magnetization comes full circle.
the magnetization with respect to this axis and a step after which the magnetization comes full circled.
A very simple particular case is when the angle is 90°, the axis is <100> and
the step is the unit cell side: spin directions alternate between
planes perpendicular to the <100> axis yielding a "spiral stairway":
@ -176,83 +191,79 @@ For instance, if the atom at [x,y,0] possesses an "up" magnetization, the atom
at [x+1/2,y,1/2] would possess a down magnetization etc...
To describe such a structure, a unit cell with two atoms is sufficient, [0,0,0] and
[1/2,0,1/2].
The atoms will be given opposite magnetization with the help of the variable [[spinat]].
The two atoms will be given opposite magnetization with the help of the variable [[spinat]].
Copy the file *$ABI_TESTS/tutorial/Input/tspin_2.in* in *Work_spin*.
Copy the file *$ABI_TESTS/tutorial/Input/tspin_2.abi* in *Work_spin*.
{% dialog tests/tutorial/Input/tspin_2.in %}
{% dialog tests/tutorial/Input/tspin_2.abi %}
This is your input file. Modify the *tspin_x.files* file accordingly.
This is your input file.
You can run the calculation, then you should edit the *tspin_2.in* file, and briefly
look at the two changes with respect to the file *tspin_1.in*: the
look at the two changes with respect to the file *tspin_1.abi*: the
unit cell basis vectors [[rprim]], and the new [[spinat]].
Note also we use now [[nsppol]] = 1 and [[nspden]] = 2: this combination of values
is only valid when performing a strictly antiferromagnetic calculation: nspden = 2 means
that we have 2 independent components for the charge density while nsppol = 1
means that we have 1 independent component for the wave-functions.
Note also that we use now [[nsppol]] = 1 and [[nspden]] = 2: this combination of values
is only valid when performing a strictly antiferromagnetic (AFM) calculation:
nspden = 2 means that we have 2 independent components for the charge density
while nsppol = 1 means that we have 1 independent component for the wave-functions.
In that case, ABINIT uses the so-called Shubnikov symmetries, to perform
calculations twice faster than with [[nsppol]] = 2 and [[nspden]] = 2. The
symmetry of the crystal is not the full fcc symmetry anymore, since the
symmetry must now preserve the magnetization of each atom. ABINIT is
nevertheless able to detect such symmetry belonging to the Shubnikov groups
calculations twice faster than with [[nsppol]] = 2 and [[nspden]] = 2
(spin up and down channels are equivalent by symmetry in the case of perfect AFM cases).
The symmetry of the crystal is not the full fcc symmetry anymore, since the
symmetry must now preserve the magnetization of each atom.
ABINIT is nevertheless able to detect such symmetry belonging to the Shubnikov groups
and correctly finds that the cell is primitive, which would not be the case
if we had the same vector [[spinat]] on each atom.
if we had the same vector [[spinat]] on each atom (FM case).
If we now run the calculation again, this total computation time is
approximately 30 seconds on a recent CPU.
If we now run this AFM calculation, its computation time is
approximately 10-20 seconds on a recent CPU.
If we look at the eigenvalues and occupations, they are again filled with a
factor 2, which comes from the symmetry considerations alluded to above, and
factor 2, which comes from the symmetry considerations aforementioned, and
not from the "usual" spin degeneracy: the potential for spin-up is equal to
the potential for spin-down, shifted by the antiferromagnetic translation
vector. Eigenenergies are identical for spin-up and spin-down, but
wavefunctions are shifted one with respect to the other.
```
kpt# 1, nband= 16, wtk= 0.05556, kpt= 0.0833 0.0833 0.1250 (reduced coord)
-0.60539 -0.47491 -0.42613 -0.39022 -0.35974 -0.34377 -0.28895 -0.28828
-0.25314 -0.24042 -0.22943 -0.14218 0.20264 0.26203 0.26641 0.62158
occupation numbers for kpt# 1
2.00000 2.00000 2.00000 1.99997 1.99945 1.99728 1.50632 1.48106
0.15660 0.04652 0.01574 0.00000 0.00000 0.00000 0.00000 0.00000
kpt# 1, nband= 20, wtk= 0.25000, kpt= 0.1250 0.1250 0.2500 (reduced coord)
-2.75606 -2.71227 -1.51270 -1.50656 -1.50211 -1.46164 -1.45614 -1.45485
0.25613 0.34136 0.38202 0.41368 0.41915 0.46180 0.48400 0.50628
0.52100 0.54004 0.56337 0.64500
occupation numbers for kpt# 1
2.00000 2.00000 2.00000 2.00000 2.00000 2.00000 2.00000 2.00000
2.00000 2.00000 2.00000 2.00000 2.00000 2.00000 2.00000 2.00000
1.95186 0.00000 0.00000 0.00000
```
How do we know we have magnetic order?
The density of states used for bcc Fe will not be useful since the net
magnetization is zero and we have as many up and down electrons.
The magnetization is reflected in the existence of distinct up and down
electronic densities, whose sum is the total density and whose difference yields
the net magnetization density at each point in real space.
The total magnetization being zero we can question how do we know we have magnetic order?
Indeed, the DOS will not be useful since we have as many up and down electrons.
In particular, the integral of the magnetization around each atom will give an
indication of the magnetic moment carried by this particular atom. A first
estimation is printed out by ABINIT. You can read:
We can however look at the integrated magnetization around each atom to have an
indication of the magnetic moment carried by each atom:
```
Integrated electronic and magnetization densities in atomic spheres:
---------------------------------------------------------------------
Radius=ratsph(iatom), smearing ratsm= 0.0000. Diff(up-dn)=approximate z local magnetic moment.
Atom Radius up_density dn_density Total(up+dn) Diff(up-dn)
1 2.00000 3.327892 2.990936 6.318828 0.336956
2 2.00000 2.986707 3.323643 6.310350 -0.336936
1 2.00000 7.748236 6.575029 14.323265 1.173206
2 2.00000 6.575029 7.748236 14.323265 -1.173206
---------------------------------------------------------------------
Sum: 6.314599 6.314579 12.629179 0.000020
Total magnetization (from the atomic spheres): 0.000020
Sum: 14.323265 14.323265 28.646531 -0.000000
Total magnetization (from the atomic spheres): -0.000000
Total magnetization (exact up - dn): -0.000000
================================================================================
```
and obtain a rough estimation of the magnetic moment of each atom
(strongly dependent on the radius used to project the charge density):
which gives (dependent on the radius used to project the charge density):
magnetization of atom 1= 0.33696
magnetization of atom 2=-0.33693
magnetization of atom 1= 1.173206
magnetization of atom 2=-1.173206
But here we want more precise results...
To perform the integration, we will use the utility *cut3d* which yields an
interpolation of the magnetization at any point in space. *cut3d* is one of the
executables of the ABINIT package and is installed together with abinit.
Another way to get integrated atom magnetization can be done by using the utility
*cut3d* which yields an interpolation of the magnetization at any point in space.
*cut3d* is one of the executables of the ABINIT package and is installed together with abinit.
For the moment cut3d is interactive, and we will use it through a very primitive script
(written in Python) to perform a rough estimate of the magnetization on each atom.
You can have a look at the [magnetization.py program](spin_assets/magnetization.py), and note
@ -268,37 +279,36 @@ python magnetization.py
you will see the result:
For atom 0 magnetic moment 0.3568281445920086
For atom 1 magnetic moment -0.3567450343127074
```
For atom 0 magnetic moment 1.2336144871839712
For atom 1 magnetic moment -1.2336216848949257
```
which shows that the magnetizations of the two atoms are really opposite.
With the next input file *tspin_3.in*, we will consider this same problem, but
in a different way. We note, for future reference, that the total energy is:
Etotal=-4.92489592898935E+01
which also show that the magnetizations of the two atoms are opposite.
The values of the atom magnetization is a bit different than the ones from the
ABINIT output because it uses a slightly different integration paramters.
## 3 Another look at *fcc* Fe
Instead of treating fcc Fe directly as an antiferromagnetic material, we will
Instead of treating fcc Fe directly as an AFM material, we will
not make any hypotheses on its magnetic structure, and run the calculation
like the one for bcc Fe, anticipating only that the two spin directions are going to be different.
We will not even assume that the initial spins are of the same magnitude.
You can copy the file *$ABI_TESTS/tutorial/Input/tspin_3.in* to *Work_spin*.
You can copy the file *$ABI_TESTS/tutorial/Input/tspin_3.abi* to *Work_spin*.
{% dialog tests/tutorial/Input/tspin_3.in %}
{% dialog tests/tutorial/Input/tspin_3.abi %}
This is your input file. You can modify the file *tspin_x.files* and immediately
start running the calculation. Then, you should edit it to understand its contents.
You can run the calculation with this is input file and look at it to understand its contents.
Note the values of [[spinat]]. In this job, we wish again to characterize the magnetic structure.
We are not going to use zeta as in the preceding calculation, but we will here
use another feature of abinit: atom and angular momentum projected densities of state.
These are densities of states weighted by the projection of the wave functions
on angular momentum channels (that is spherical harmonics) centered on each atom of the system.
Note the values of [[spinat]]. In this job, we will again characterize the magnetic structure.
We are going to use atom and angular momentum projected densities of state.
These are DOS weighted by the projection of the wave functions
on angular momentum channels (i.e. the spherical harmonics) centered on each atom of the system.
Note that these DOS are computed with the tetrahedron method, which is rather
time consuming and produces more accurate but less smooth DOS than the smearing method. The time
is strongly dependent on the number of k-points, and we use here only a reduced set.
(This will take about 1.5 minutes on a modern computer)
time consuming and produces more accurate but less smooth DOS than the smearing method.
The CPU time is strongly dependent on the number of k-points, and we use here only a reduced set.
(This will take about 40 seconds on a modern computer)
To specify this calculation we need new variables, in addition to [[prtdos]] set now to 3:
@ -309,8 +319,8 @@ To specify this calculation we need new variables, in addition to [[prtdos]] set
This will specify the atoms around which the calculation will be performed, and the radius of the sphere.
We specifically select a new dataset for each atom, a non self-consistent
calculation being run to generate the projected density of states.
First, we note that the value of the energy is: Etotal=-4.92489557316370E+01,
which shows that we have attained essentially the same state as above.
First, we note that the value of the total energy is -2.4972993185E+02 Ha,
which shows that we have attained essentially the same state as in tspin2 (etotal=-2.4972993198E+02).
The density of states will be in the files *tspin_3o_DS2_DOS_AT0001* for the
first atom, and *tspin_3o_DS3_DOS_AT0002* for the second atom.
@ -319,7 +329,7 @@ moment and whose integral up to the Fermi level will yield an estimate of the
magnetization on each atom.
We note the Fermi level (echoed in the file *tspin_3o_DS1_DOS*):
Fermi energy : -0.28270392
Fermi energy : 0.52472131
If we have a look at the integrated site-projected density of states, we can
compute the total moment on each atom. To this end, one can open the file
@ -330,43 +340,43 @@ file is self-documented, and describes the line content, for spin up and spin do
# energy(Ha) l=0 l=1 l=2 l=3 l=4 (integral=>) l=0 l=1 l=2 l=3 l=4
```
If we look for the lines containing an energy of "-0.28250", we find
If we look for the lines containing an energy of "0.52450", we find
up -0.28250 0.8026 2.6082 23.3966 0.7727 0.1687 0.30 0.34 <font color="red">3.42</font> 0.04 0.01
dn -0.28250 0.3381 1.8716 24.0456 0.3104 0.1116 0.30 0.33 <font color="red">2.74</font> 0.04 0.01
up :
0.52450 0.3714 1.0151 13.6555 0.1144 0.0683 1.29 3.30 <font color="red">2.49</font> 0.05 0.02
There are apparently changes in the densities of states for all the channels,
but besides the d-channels, these are indeed fluctuations. This is confirmed
by looking at the integrated density of states which is different only for the
d-channel. The difference between up and down is 0.68, in rough agreement
down :
0.52450 0.1597 1.6758 9.8137 0.0872 0.0750 1.29 3.32 <font color="red">3.69</font> 0.04 0.01
There are apparently changes in the DOS for all projected orbitals,
but only the d orbital projection has sizeable differences.
This is confirmed by looking at the integrated DOS which is different only for the
d-channel.
The difference between up and down is 1.20, in rough agreement
(regarding our very crude methods of integration) with the previous
calculation. Using a calculation with the same number of k-points for the
projected DOS, we can plot the up-down integrated dos difference for the d-channel.
calculation.
Using a calculation with the same number of k-points for the
projected DOS, we can plot the up-down integrated dos difference for the d-channel of each atom:
![](spin_assets/energy_diff_fccfe.jpg)
Note that there is some scatter in this graph, due to the finite number of digits (2 decimal
places) of the integrated dos given in the file *tspin_3o_DS3_DOS_AT0002*.
Note that there is some scatter in this graph, due to the finite number of digits
of the integrated DOS given in the file *tspin_3o_DS3_DOS_AT0001* and *tspin_3o_DS3_DOS_AT0002*.
If we now look at the up and down DOS for each atom, we can see that the
corner atom and the face atom possess opposite magnetizations, which roughly
cancel each other. The density of states computed with the tetrahedron method
is not as smooth as by the smearing method, and a running average allows for a better view.
As mentioned earlier, the solution of the Kohn-Sham equation
might benefit of using a smaller value of [[tolrde]] (e.g. 0.001 instead of the default 0.005),
and a larger value of [[nline]] (e.g. 6 instead of the default 4).
cancel each other.
The DOS computed with the tetrahedron method is not as smooth as by the smearing method,
and a running average allows for a better view.
## 4 Ferrimagnetic (not yet)
Some materials can display a particular form of ferromagnetism, which also can
be viewed as non compensated antiferromagnetism, called ferrimagnetism.
Some atoms possess up spin and other possess down spin, but the total spin magnetization is non zero.
This happens generally for system with different type of atoms, and sometimes
This happens generally for system with different type of atoms with different magnetic moment, and sometimes
in rather complicated structures such as magnetite.
## 5 The spin-orbit coupling
## 5 The spin-orbit coupling (SOC)
For heavy atoms a relativistic description of the electronic structure becomes
necessary, and this can be accomplished through the relativistic DFT approach.
@ -378,25 +388,19 @@ degeneracy is lifted according to the eigenvalues of the $L+S$ operator
(l+1/2 and l-1/2 of degeneracy 2l+2 and 2l).
After pseudization, the associated wave functions can be recovered by adding to usual pseudo-potential projectors a
spin-orbit term of the generic form $v(r).|l,s\rangle L.S \langle l,s|$.
Not all potentials include this additional term, but the HGH type pseudopotentials do systematically.
Not all potentials include this additional term, if you use the pseudopotentials from pseudodojo, you have
to choose those generated in a fully relativistic option (with "FR" in the name, "SR" means semi-relativistic).
In a plane wave calculation, the wavefunctions will be two-component
spinors, that is they will have a spin-up and a spin-down component, and these
components will be coupled. This means the size of the Hamiltonian matrix is quadrupled.
components will be coupled.
This means the size of the Hamiltonian matrix is quadrupled and the CPU time will be enlarged.
We will consider here a heavier atom than Iron: *Tantalum*.
You will have to change the "files" file accordingly, as we want to use the
potential: *73ta.hghsc*. It is a HGH pseudopotential, with semicore states.
Replace the last line of the tspin_x.files by
../../../Psps_for_tests/73ta.hghsc
You can copy the file *$ABI_TESTS/tutorial/Input/tspin_5.abi* in *Work_spin* and run the calculation.
You can copy the file *$ABI_TESTS/tutorial/Input/tspin_5.in* in *Work_spin*.
{% dialog tests/tutorial/Input/tspin_5.in %}
Change accordingly the file names in *tspin_x.files*, then run the calculation.
It takes about 20 secs on a recent computer.
{% dialog tests/tutorial/Input/tspin_5.abi %}
The input file contains one new variable:
@ -404,54 +408,50 @@ The input file contains one new variable:
Have a look at it. You should also look at [[so_psp]]; it is not set explicitly here,
because the SO information is directly read from the pseudopotential file.
One could force a non-SO calculation by setting [[so_psp]] to 0.
One could force a non-SO calculation by setting [[so_psp]] to 0 even if the pseudo is "FR".
In this run, we check that we recover the splitting of the atomic levels by
performing a calculation in a big box. Two calculations are launched with and
without spin-orbit.
performing a calculation in a big box.
Two calculations are launched with and without SOC.
We can easily follow the symmetry of the different levels of the non spin orbit calculation:
```
kpt# 1, nband= 26, wtk= 1.00000, kpt= 0.0000 0.0000 0.0000 (reduced coord)
-2.44760
-1.46437 -1.46437 -1.46437
-0.17045
-0.10852 -0.10852 -0.10852 -0.10740 -0.10740
```
That is, the symmetry: s, p, s, d
After application of the spin-orbit coupling, we now have to consider twice as many levels:
We can easily follow the symmetry of the different levels of the non-SOC calculation:
```
kpt# 1, nband= 26, wtk= 1.00000, kpt= 0.0000 0.0000 0.0000 (reduced coord)
-2.43258 -2.43258
-1.67294 -1.67294 -1.35468 -1.35468 -1.35468 -1.35468
-0.16788 -0.16788
-0.11629 -0.11629 -0.11629 -0.11629 -0.09221 -0.09221 -0.09120 -0.09120 -0.09120 -0.09120
-2.60792 -1.43380 -1.43380 -1.43380 -0.14851 -0.09142 -0.09142 -0.09142
-0.09033 -0.09033 0.02657 0.02657 0.02657 0.05604 0.14930 0.14930
0.14930 0.15321 0.15321 0.15321 0.16211 0.16211 0.27952 0.27952
0.27952 0.31238
```
That is, the symmetry: s, p, s, d
After application of the SOC, we now have to consider twice as many levels:
```
kpt# 1, nband= 26, wtk= 1.00000, kpt= 0.0000 0.0000 0.0000 (reduced coord)
-2.59704 -2.59704 -1.65268 -1.65268 -1.32544 -1.32544 -1.32544 -1.32544
-0.14663 -0.14663 -0.09760 -0.09760 -0.09760 -0.09760 -0.07881 -0.07881
-0.07805 -0.07805 -0.07805 -0.07805 0.01044 0.01044 0.03597 0.03597
0.03597 0.03597
```
The levels are not perfectly degenerate, due to the finite size of the simulation box,
and in particular the cubic shape, which gives a small crystal field splitting of the d orbitals
between $e_g$ and $t_{2g}$ states.
We can nevetheless compute the splitting of the levels, and we obtain, for e.g. the p-channel: 1.67294-1.35468=0.31826 Ha
We can nevetheless compute the splitting of the levels, and we obtain, for e.g. the p-channel: 1.65268-1.32544=0.32724 Ha
If we now consider the
[NIST table](https://www.nist.gov/pml/atomic-reference-data-electronic-structure-calculations-tantalum)
of atomic data, we obtain:
5p splitting, table: 1.681344-1.359740=0.321604 Ha
5d splitting, table: .153395-.131684=0.021711 Ha
5p splitting, table: 1.681344-1.359740 = 0.321604 Ha
5d splitting, table: 0.153395-0.131684 = 0.021711 Ha
We obtain a reasonable agreement.
A more converged (and more expensive calculation) would yield:
5p splitting, abinit: 1.64582-1.32141=0.32441 Ha
5d splitting, abinit: .09084-.11180=0.02096 Ha
We obtain a reasonable agreement. A better agreement could be obtained by improving the convergence parameters.
### 5.2 Projector Augmented-Wave
Within the Projector Augmented-Wave method, the usual (pseudo-)Hamiltonian can be expressed as:
Within the Projector Augmented-Wave (PAW) method, the usual (pseudo-)Hamiltonian can be expressed as:
$$
H = K + V_{eff} + \Sigma_{ij} D_{ij} |p_i \rangle \langle p_j|
@ -470,9 +470,9 @@ H \simeq K + V_{eff} + \Sigma (D_{ij}+D^{SO}_{ij}) |p_i \rangle \langle p_j|
$$
where $D^{SO}_{ij}$ is the projection of the ($L.S$) operator into the PAW augmentation regions.
As an immediate consequence , we thus have the possibility to use the standard $p_i$ PAW projectors;
As an immediate consequence, we have the possibility to use the standard $p_i$ PAW projectors;
in other words, it is possible to use the standard PAW datasets (pseudopotentials) to perform
calculations including spin-orbit coupling.
calculations including SOC.
But, of course, it is still necessary to express the wave-functions as two
components spinors (spin-up and a spin-down components).
Let's have a look at the following keyword:
@ -482,61 +482,82 @@ Let's have a look at the following keyword:
This activates the spin-orbit coupling within PAW (forcing [[nspinor]]=2).
Now the practice:
We consider Bismuth.
You will have to change the "files" file accordingly, to use the new
potential *83bi.paw*. This is a PAW dataset with 5d, 6s and 6p electrons in the valence.
Replace the last line of the tspin_x.files by:
We consider Bismuth, the PAW dataset file contains the 5d, 6s and 6p electrons in the valence.
../../../Psps_for_tests/83bi.paw
You can copy the file *$ABI_TESTS/tutorial/Input/tspin_6.abi* in *Work_spin*
(one Bismuth atom in a large cell) and run the calculation.
It takes about 10 seconds on a recent computer.
You can copy the file *$ABI_TESTS/tutorial/Input/tspin_6.in* in *Work_spin*
(one Bismuth atom in a large cell). Change the file names in
*tspin_x.files* accordingly, then run the calculation. It takes about 10 seconds on a recent computer.
{% dialog tests/tutorial/Input/tspin_6.abi %}
{% dialog tests/tutorial/Input/tspin_6.in %}
Two datasets are executed: the first without spin-orbit coupling, the second one using [[pawspnorb]]=1.
Two datasets are executed: the first without SOC, the second one using [[pawspnorb]]=1.
The resulting eigenvalues are:
Without SOC:
```
Eigenvalues (hartree) for nkpt= 1 k points:
kpt# 1, nband= 24, wtk= 1.00000, kpt= 0.0000 0.0000 0.0000 (reduced
coord)
5d -0.93353 -0.93353 -0.93353 -0.93353 -0.82304 -0.82304 -0.82304
-0.82304 -0.82291 -0.82291
6s -0.42972 -0.42972
6p -0.11089 -0.11089 -0.03810 -0.03810 -0.03810 -0.03810
kpt# 1, nband= 12, wtk= 1.00000, kpt= 0.0000 0.0000 0.0000 (reduced coord)
5d -0.86985 -0.86985 -0.86879 -0.86879 -0.86879
6s -0.43169
6p -0.05487 -0.05486 -0.05486
...
```
With SOC:
```
kpt# 1, nband= 24, wtk= 1.00000, kpt= 0.0000 0.0000 0.0000 (reduced coord)
5d -0.91133 -0.91133 -0.91133 -0.91133 -0.80022 -0.80022 -0.80022 -0.80022 -0.79954 -0.79954
6s -0.41639 -0.41639
6p -0.09817 -0.09817 -0.02546 -0.02546 -0.02546 -0.02546
...
```
Again, the levels are not perfectly degenerate, due to the finite size and non spherical
shape of the simulation box.
We can compute the splitting of the levels, and we obtain:
5d-channel: 0.93353-0.82304=0.11048 Ha
6p-channel: 0.11089-0.03810=0.07289 Ha
5d-channel: 0.91133-0.80022 = 0.11111 Ha
6p-channel: 0.09817-0.02546 = 0.07271 Ha
If we now consider the
[NIST table](https://www.nist.gov/pml/atomic-reference-data-electronic-structure-calculations-bismuth)
of atomic data, we obtain:
5d-channel: 1.063136-0.952668=0.11047 Ha
6p-channel: 0.228107-0.156444=0.07166 Ha
5d-channel: 1.063136-0.952668 = 0.11047 Ha
6p-channel: 0.228107-0.156444 = 0.07166 Ha
A perfect agreement even with a small simulation cell and very small values of plane-wave cut-offs.
This comes from the generation of the PAW dataset, where the SOC is calculated very accurately
and for an atomic reference. The exchange correlation functional has little impact on large SOC
and for an atomic reference.
The exchange correlation functional has little impact on large SOC
splittings, which are mainly a kinetic energy effect.
## 6 Rotation of the magnetization and spin-orbit coupling
## 6 Rotation of the magnetization and spin-orbit coupling (coming soon)
The most spectacular manifestation of the spin-orbit coupling is the energy
associated with a rotation of the magnetisation with respect with the crystal axis.
It is at the origin of the magneto crystalline anisotropy of paramount technological importance.
The most spectacular manifestation of the SOC is the energy
associated with a rotation of the magnetisation with respect to the crystal axis.
It is at the origin of the magneto crystalline anisotropy (MCA) of paramount technological importance.
## 7 Summary
The table below can help to know how to handle the different magnetic calculation cases in ABINIT:
| case | msppol | nspinor | nspden |
| ------------- | ------ | ------- | ------ |
| non-magnetic | 1 | 1 | 1 |
| collinear FM | 2 | 1 | 2 |
| collinear AFM | 1 | 1 | 2 |
| non-collinear | 1 | 2 | 4 |
Note that non-collinear magnetism can be done with or without SOC.
With SOC do not use time reversal symmetry ([[kptopt]] = 4), however as the symmetries
in the presence of SOC it is not (yet fully) implemented please remove all symmetries when running
non-collinear magnetism with SOC (i.e. [[kptopt]]=3 and [[nsym]]=1).
The non-collinear magnetism + SOC cases can be much more difficult to converge (SCF) and might require
to strongly reduce the [[diemix]] and mostly the [[diemixmag]] mixing flags; you might have to increase [[nline]] and play with negative values of [[nnsclo]].
DFT+U correction is also necessary in most of the magnetic calculations if you use regular LDA and GGA functionals (i.e. not hybrid fucntionals).
As mentioned earlier, the solution of the Kohn-Sham equation
might benefit of using a smaller value of [[tolrde]] (e.g. 0.001 instead of the default 0.005),
and a larger value of [[nline]] (e.g. 6 instead of the default 4).
* * *
GZ would like to thank B. Siberchicot for useful comments.

Binary file not shown.

Before

Width:  |  Height:  |  Size: 46 KiB

After

Width:  |  Height:  |  Size: 206 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 38 KiB

After

Width:  |  Height:  |  Size: 164 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 31 KiB

After

Width:  |  Height:  |  Size: 153 KiB

View File

@ -16,7 +16,9 @@ With this lesson, you will learn to:
* Determine the critical temperature for a magnetic phase transition
* Calculate spin canting angles for systems with Dzyaloshinskii-Moriya interaction
The TB2J python package, which can be used to generate a spin model, can be found on the ABINIT gitlab website at https://gitlab.abinit.org/xuhe/TB2J. This package will be included in the ABINIT package in the future.
The TB2J python package, which can be used to generate a spin model, can be found on the website at [https://github.com/mailhexu/TB2J](https://github.com/mailhexu/TB2J). The online documenation can be found at [https://tb2j.readthedocs.io](https://tb2j.readthedocs.io/en/latest/) .
*Before beginning, you might consider to work in a subdirectory for this tutorial. Why not Work_spindyn?*
@ -62,9 +64,9 @@ where $m_i$ denotes the magnetic moment of site $i$, and $\vec{H}$ is the magnet
## 2. Build spin model file
One way to calculate the Heisenberg model parameters is to use the spin force theorem (see [[cite:Liechtenstein1983]], [[cite:Katsnelson2000]]), for which one perturbs the system by rotating localized spins. In ABINIT, the Hamiltonian uses plane waves as a basis set, thus the localized spin is not directly accessible. We can construct localized Wannier functions and rewrite the Hamiltonian in the Wannier basis. Then, the exchange parameters can be calculated from this Hamiltonian ( [[cite:Korotin2015]] ).
One way to calculate the Heisenberg model parameters is to use the spin force theorem (see [[cite:Liechtenstein1983]], [[cite:Katsnelson2000]]), for which one perturbs the system by rotating localized spins. In ABINIT, the Hamiltonian uses plane waves as a basis set, thus the localized spin is not directly accessible. We can construct localized Wannier functions and rewrite the Hamiltonian in the Wannier basis. Then, the exchange parameters can be calculated from this Hamiltonian ( [[cite:Korotin2015]] ).
For building the Wannier function Hamiltonian from ABINIT, see the tutorial [wannier90](wannier90). Other DFT codes interfaced with [Wannier90](http://www.wannier.org) can also be used. Then, the [TB2J](https://gitlab.abinit.org/xuhe/TB2J) package can be used to calculate the Heisenberg model parameters and generate the input model for MULTIBINIT. The data will be stored in a xml (.xml) or a netcdf (.nc) file which is used as input for the MULTIBINIT calculation. For the tutorial, this file is provided. Please read the [TB2J tutorial](https://gitlab.abinit.org/xuhe/TB2J/blob/master/README.md) to see how to create your own xml/netcdf file.
For building the Wannier function Hamiltonian from ABINIT, see the tutorial [wannier90](wannier90). Other DFT codes interfaced with [Wannier90](http://www.wannier.org) , can also be used. Then, the [TB2J](https://github.com/mailhexu/TB2J) package can be used to calculate the Heisenberg model parameters and generate the input model for MULTIBINIT. The data will be stored in a xml (.xml) or a netcdf (.nc) file which is used as input for the MULTIBINIT calculation. For the tutorial, this file is provided. Please read the [TB2J tutorial](https://tb2j.readthedocs.io/en/latest/) to see how to create your own xml/netcdf file.
## 3. Run spin dynamics
### Basic: how to use MULTIBINIT to run spin dynamics
@ -72,7 +74,7 @@ For building the Wannier function Hamiltonian from ABINIT, see the tutorial [wan
Once we have the spin model xml file, we can run a spin dynamics calculation with MULTIBINIT. Example input files can be found at ~abinit/tests/tutomultibinit/Input/tmulti5_1.* . There are three files:
* "tmulti5_1.files" is the "files" file, which gives the names of the input and output files for MULTIBINIT.
* "tmulti5_1.in" is the main input file containing the parameters for the spin dynamics simulation.
* "tmulti5_1.abi" is the main input file containing the parameters for the spin dynamics simulation.
* "tmulti5_1.xml" is the file containing the Heisenberg model parameters.
You can copy these three files into a directory (e.g. Work_spindyn).
@ -80,14 +82,14 @@ You can copy these three files into a directory (e.g. Work_spindyn).
In tmulti5_1.files, three file names are given:
```
tmulti5_1.in
tmulti5_1.out
tmulti5_1.abi
tmulti5_1.abo
tmulti5_1.xml
```
which gives the input, output and xml file names. The file tmulti5_1.xml contains the $J_{ij}$ values for a simple toy system which has a cubic lattice and one atom per unit cell. Its critical temperature is around 600K.
In tmulti5_1.in, the variables for running a spin dynamics calculation are given:
In tmulti5_1.abi, the variables for running a spin dynamics calculation are given:
```
prt_model = 0
@ -112,12 +114,25 @@ To run spin dynamics with MULTIBINIT
```
cd Work_spindyn
multibinit < tmulti5_1.files > tmulti5_1.txt
multibinit --F03 < tmulti5_1.files > tmulti5_1.txt
```
After the calculation is done, you will find an output file named tmulti5_1.out and a netcdf file tmulti5_1.out_spinhist.nc.
Note that the .files file will be deprecated in the next version of ABINIT and MULTIBINIT. Then only two files are required. The following variables in the input file can be used to specify the spin potential file and the prefix of the output files.
In the .out file, you can find the lines below, which give a overview of the evolution of the system with time:
```
spin_pot_fname = "tmulti5_1.xml"
outdata_prefix = "tmulti5_1.abo"
```
To run the spin dynamics without using the files file,
```
multibinit tmulti5_1.abi --F03 > tmulti5_1.txt
```
After the calculation is done, you will find an output file named tmulti5_1.abo and a netcdf file tmulti5_1.abo_spinhist.nc.
In the .abo file, you can find the lines below, which give a overview of the evolution of the system with time:
```
Beginning spin dynamic steps :
@ -125,14 +140,14 @@ Beginning spin dynamic steps :
Iteration time(s) Avg_Mst/Ms ETOT(Ha/uc)
------------------------------------------------------------------
Thermalization run:
- 100 9.90000E-15 6.50748E-01 -2.20454E-03
- 200 1.99000E-14 5.57558E-01 -1.89219E-03
- 300 2.99000E-14 5.28279E-01 -1.85341E-03
- 100 9.90000E-15 6.52530E-01 -2.13916E-03
- 200 1.99000E-14 5.58122E-01 -1.82158E-03
- 300 2.99000E-14 5.28037E-01 -1.78953E-03
.....
Measurement run:
- 100 9.90000E-15 4.58081E-01 -1.79152E-03
- 200 1.99000E-14 4.30639E-01 -1.74361E-03
- 300 2.99000E-14 4.07684E-01 -1.66528E-03
- 100 9.90000E-15 4.45356E-01 -1.70973E-03
- 200 1.99000E-14 4.23270E-01 -1.68122E-03
- 300 2.99000E-14 4.07006E-01 -1.61948E-03
.....
```
@ -190,7 +205,7 @@ The following observables are printed, which are:
In the netcdf file, the trajectories of the spins can be found. They can be further analyzed using post-processing tools.
We are now coming back to the values chosen for the input variables in the tmulti5_1.in file. It is essential to choose these values such that the results of the calculation are meaningful. Therefore, we recommend a convergence study concerning the following parameters:
We are now coming back to the values chosen for the input variables in the tmulti5_1.abi file. It is essential to choose these values such that the results of the calculation are meaningful. Therefore, we recommend a convergence study concerning the following parameters:
* time step ([[multibinit: spin_dt]]):
@ -224,8 +239,8 @@ By setting [[multibinit:spin_var_temperature]] to 1 and specifying the starting
dynamics = 0 ! Disable molecular dynamics
ncell = 6 6 6 ! Size of supercell (Is this too small?)
spin_dynamics=1 ! Run spin dynamics
spin_ntime_pre = 1000 ! Thermolization steps (Is this enough?)
spin_ntime = 20000 ! Measurement steps. (Is this enough?)
spin_ntime_pre = 10000 ! Thermolization steps (Is this enough?)
spin_ntime = 10000 ! Measurement steps. (Is this enough?)
spin_nctime = 100 ! Number of time steps between two writes
! into netcdf
spin_dt = 1e-16 s ! Time step (Is this too large?)
@ -236,6 +251,13 @@ spin_var_temperature = 1 ! Variable temperature calculation
spin_temperature_start = 0 ! Starting temperature
spin_temperature_end = 500 ! Final temperature (Smaller than Neel temp.?)
spin_temperature_nstep = 6 ! Number of temperature steps (Is this enough?)
spin_sia_add = 1 ! add a single ion anistropy (SIA) term?
spin_sia_k1amp = 1e-6 ! amplitude of SIA (in Ha), how large should be used?
spin_sia_k1dir = 0.0 0.0 1.0 ! direction of SIA
spin_calc_thermo_obs = 1 ! calculate thermodynamics related observables
```
Note that you are now running several calculations for different temperatures, so this might take a minute or two. After the run, the trajectories for each temperature will be written into the \*\_T0001_spin_hist.nc to \*\_T0006_spin_hist.nc files if spin_temperature_step=6.
@ -309,9 +331,7 @@ It shows that the the spins have anti-parallel alignment along the easy axis (x)
## 5. Postprocessing
<!-- TODO: agate -->
### Tips:
@ -322,9 +342,7 @@ It shows that the the spins have anti-parallel alignment along the easy axis (x)
```
spin_projection_qpoint = 0.5 0.5 0.5
```
#####

View File

@ -99,7 +99,7 @@ to see if it suits your needs, and read the recent literature ...
## A first computation of electronic excitation energies and oscillator strengths, for N$_2$
We will now compute and analyse the excitation energies of the diatomic molecule N$_2$.
This is a rather simple s.ystem, with cylindrical symmetry,
This is a rather simple system, with cylindrical symmetry,
allowing interesting understanding. Although we will suppose that you are
familiarized with quantum numbers for diatomic molecules, this should not play
an important role in the understanding of the way to use Abinit
@ -107,24 +107,23 @@ implementation of Casida's formalism.
*Before beginning, you might consider to work in a different subdirectory as
for the other tutorials. Why not Work_tddft?*
Copy the files *ttddft_x.files* and *ttddft_1.in* in *Work_tddft*:
Copy the file *ttddft_1.abi* in *Work_tddft*:
```sh
cd $ABI_TESTS/tutorial/Input
mkdir Work_tddft
cd Work_tddft
cp ../ttddft_x.files .
cp ../ttddft_1.in .
cp ../ttddft_1.abi .
```
So, issue now:
abinit < ttddft_x.files > log 2> err &
abinit ttddft_1.abi > log &
The computation is quite fast: about 15 secs on a 2.8 GHz PC.
Let's examine the input file *ttddft_1.in*.
The computation is quite fast: about 3 secs on a 2.8 GHz PC.
Let's examine the input file *ttddft_1.abi*.
{% dialog tests/tutorial/Input/ttddft_1.in %}
{% dialog tests/tutorial/Input/ttddft_1.abi %}
There are two datasets: the first one corresponds to a typical ground-state
calculation, with only occupied bands. The density and wavefunctions are
@ -142,12 +141,13 @@ You will note that we have 5 occupied bands (defined for dataset 1), and that
we add 7 unoccupied bands in the dataset 2, to obtain a total of 12 bands. The
box is not very large (6x5x5 Angstrom), the cutoff is quite reasonable, 25
Hartree), and as requested for the Casida's formalism, only one k point is
used. We have chosen the Perdew-Wang 92 LDA functional for both the self-
consistent and non-self-consistent calculations ([[ixc]] = 7).
used. We are using the Perdew-Wang 92 LDA functional for both the self-
consistent and non-self-consistent calculations ([[ixc]] = -1012), as deduced
by abinit by looking at the pseudopotential file..
We can now examine the output file *ttddft_1.out.*
We can now examine the output file *ttddft_1.abo.*
{% dialog tests/tutorial/Refs/ttddft_1.out %}
{% dialog tests/tutorial/Refs/ttddft_1.abo %}
One can jump to the second dataset section, and skip a few non-interesting
information, in order to reach the following information:
@ -173,21 +173,22 @@ eigenfunctions in this simulation have the following characteristics:
Combining states 3,4 and 5 with 6, 7 and 8, give the first nine Kohn-Sham energy differences:
Transition (Ha) and (eV) Tot. Ene. (Ha) Aver XX YY ZZ
5-> 6 3.10888E-01 8.45969E+00 -1.92741E+01 0.0000E+00 0.00E+00 0.00E+00 0.00E+00
5-> 7 3.10888E-01 8.45969E+00 -1.92741E+01 0.0000E+00 0.00E+00 0.00E+00 0.00E+00
5-> 8 3.44036E-01 9.36171E+00 -1.92409E+01 0.0000E+00 0.00E+00 0.00E+00 0.00E+00
4-> 6 3.64203E-01 9.91046E+00 -1.92207E+01 1.4463E-01 4.34E-01 0.00E+00 0.00E+00
3-> 6 3.64203E-01 9.91046E+00 -1.92207E+01 4.2299E-01 1.27E+00 0.00E+00 0.00E+00
4-> 7 3.64203E-01 9.91046E+00 -1.92207E+01 4.2299E-01 1.27E+00 0.00E+00 0.00E+00
3-> 7 3.64203E-01 9.91046E+00 -1.92207E+01 1.4463E-01 4.34E-01 0.00E+00 0.00E+00
4-> 8 3.97351E-01 1.08125E+01 -1.91876E+01 4.0028E-02 0.00E+00 1.20E-01 0.00E+00
3-> 8 3.97351E-01 1.08125E+01 -1.91876E+01 4.0028E-02 0.00E+00 0.00E+00 1.20E-01
5-> 6 3.06494E-01 8.34013E+00 -2.03684E+01 0.0000E+00 0.00E+00 0.00E+00 0.00E+00
5-> 7 3.06494E-01 8.34013E+00 -2.03684E+01 0.0000E+00 0.00E+00 0.00E+00 0.00E+00
5-> 8 3.50400E-01 9.53488E+00 -2.03245E+01 0.0000E+00 0.00E+00 0.00E+00 0.00E+00
4-> 6 3.60026E-01 9.79682E+00 -2.03149E+01 5.5534E-01 1.67E+00 0.00E+00 0.00E+00
3-> 6 3.60026E-01 9.79682E+00 -2.03149E+01 3.7821E-03 1.13E-02 0.00E+00 0.00E+00
4-> 7 3.60026E-01 9.79682E+00 -2.03149E+01 3.7822E-03 1.13E-02 0.00E+00 0.00E+00
3-> 7 3.60026E-01 9.79682E+00 -2.03149E+01 5.5534E-01 1.67E+00 0.00E+00 0.00E+00
4-> 8 4.03933E-01 1.09916E+01 -2.02710E+01 3.7976E-02 0.00E+00 1.14E-01 0.00E+00
3-> 8 4.03933E-01 1.09916E+01 -2.02710E+01 3.7976E-02 0.00E+00 0.00E+00 1.14E-01
Without the coupling matrix, these would be the excitation energies, for both
the spin-singlet and spin-triplet states. The coupling matrix modifies the
eigenenergies, by mixing different electronic excitations, and also lift some
degeneracies, e.g. the quadruplet formed by the combination of the degenerate
states 3-4 and 6-7 that gives the excitation energies with 3.64203E-01 Ha in the above table.
states 3-4 and 6-7 that gives the (four-fold degenerate) excitation energies
with 3.60026E-01 Ha in the above table.
Indeed, concerning the spin-singlet, the following excitation energies are
obtained (see the next section of the output file):
@ -195,15 +196,15 @@ obtained (see the next section of the output file):
TDDFT singlet excitation energies (at most 20 of them are printed),
and corresponding total energies.
Excit# (Ha) and (eV) total energy (Ha) major contributions
1 3.47952E-01 9.46826E+00 -1.923699E+01 0.83( 5-> 6) 0.17( 5-> 7)
2 3.48006E-01 9.46971E+00 -1.923693E+01 0.83( 5-> 7) 0.17( 5-> 6)
3 3.62425E-01 9.86208E+00 -1.922251E+01 0.99( 5-> 8) 0.00( 2-> 10)
4 3.64202E-01 9.91043E+00 -1.922074E+01 0.37( 3-> 7) 0.37( 4-> 6)
5 3.84223E-01 1.04553E+01 -1.920072E+01 0.37( 4-> 6) 0.37( 3-> 7)
6 3.84236E-01 1.04556E+01 -1.920070E+01 0.37( 4-> 7) 0.37( 3-> 6)
7 3.96699E-01 1.07947E+01 -1.918824E+01 0.99( 3-> 8) 0.01( 4-> 8)
8 3.96723E-01 1.07954E+01 -1.918822E+01 0.99( 4-> 8) 0.01( 3-> 8)
9 4.54145E-01 1.23579E+01 -1.913079E+01 1.00( 5-> 9) 0.00( 3-> 12)
1 3.45362E-01 9.39779E+00 -2.032952E+01 1.00( 5-> 7) 0.00( 1-> 7)
2 3.45434E-01 9.39975E+00 -2.032945E+01 1.00( 5-> 6) 0.00( 1-> 6)
3 3.60026E-01 9.79681E+00 -2.031486E+01 0.50( 3-> 6) 0.50( 4-> 7)
4 3.68693E-01 1.00326E+01 -2.030619E+01 0.99( 5-> 8) 0.00( 2-> 10)
5 3.83765E-01 1.04428E+01 -2.029112E+01 0.50( 4-> 7) 0.50( 3-> 6)
6 3.83798E-01 1.04437E+01 -2.029108E+01 0.50( 4-> 6) 0.50( 3-> 7)
7 4.03285E-01 1.09740E+01 -2.027160E+01 0.99( 3-> 8) 0.01( 4-> 8)
8 4.03304E-01 1.09745E+01 -2.027158E+01 0.99( 4-> 8) 0.01( 3-> 8)
9 4.59051E-01 1.24914E+01 -2.021583E+01 0.91( 2-> 8) 0.04( 3-> 7)
...
The excitation energies are numbered according to increasing energies, in Ha
@ -214,27 +215,27 @@ of these excitations are mentioned (size of the contribution then identification
It is seen that the first and second excitations are degenerate (numerical
inaccuracies accounts for the meV difference), and mainly comes from the first
and second Kohn-Sham energy differences (between occupied state 5 and
unoccupied states 6 and 7). This is also true for the third excitation, that
unoccupied states 6 and 7). This is also true for the fourth excitation, that
comes from the third Kohn-Sham energy difference (between occupied state 5 and
unoccupied state 8). The quadruplet of Kohn-Sham energy differences, that was
observed at 3.64203E-01 Ha, has been split into one doublet and two singlets,
with numbers 4 (the lowest singlet), 5-6 (the doublet) while the last singlet
observed at 3.60026E-01 Ha, has been split into one doublet and two singlets,
with numbers 3 (the lowest singlet), 5-6 (the doublet) while the last singlet
is not present in the 20 lowest excitations.
The list of oscillator strength is then provided.
Oscillator strengths : (elements smaller than 1.e-6 are set to zero)
Excit# (Ha) Average XX YY ZZ XY XZ YZ
1 3.47952E-01 0.000E+00 0.000E+00 0.000E+00 0.000E+00 0.00E+00 0.00E+00 0.00E+00
2 3.48006E-01 0.000E+00 0.000E+00 0.000E+00 0.000E+00 0.00E+00 0.00E+00 0.00E+00
3 3.62425E-01 0.000E+00 0.000E+00 0.000E+00 0.000E+00 0.00E+00 0.00E+00 0.00E+00
4 3.64202E-01 0.000E+00 0.000E+00 0.000E+00 0.000E+00 0.00E+00 0.00E+00 0.00E+00
5 3.84223E-01 0.000E+00 0.000E+00 0.000E+00 0.000E+00 0.00E+00 0.00E+00 0.00E+00
6 3.84236E-01 0.000E+00 0.000E+00 0.000E+00 0.000E+00 0.00E+00 0.00E+00 0.00E+00
7 3.96699E-01 5.759E-02 0.000E+00 1.928E-03 1.709E-01 0.00E+00 0.00E+00 -1.82E-02
8 3.96723E-01 5.544E-02 0.000E+00 1.645E-01 1.855E-03 0.00E+00 0.00E+00 1.75E-02
9 4.54145E-01 0.000E+00 0.000E+00 0.000E+00 0.000E+00 0.00E+00 0.00E+00 0.00E+00
10 4.60223E-01 9.496E-02 2.849E-01 0.000E+00 0.000E+00 0.00E+00 0.00E+00 0.00E+00
1 3.45362E-01 0.000E+00 0.000E+00 0.000E+00 0.000E+00 0.00E+00 0.00E+00 0.00E+00
2 3.45434E-01 0.000E+00 0.000E+00 0.000E+00 0.000E+00 0.00E+00 0.00E+00 0.00E+00
3 3.60026E-01 0.000E+00 0.000E+00 0.000E+00 0.000E+00 0.00E+00 0.00E+00 0.00E+00
4 3.68693E-01 0.000E+00 0.000E+00 0.000E+00 0.000E+00 0.00E+00 0.00E+00 0.00E+00
5 3.83765E-01 0.000E+00 0.000E+00 0.000E+00 0.000E+00 0.00E+00 0.00E+00 0.00E+00
6 3.83798E-01 0.000E+00 0.000E+00 0.000E+00 0.000E+00 0.00E+00 0.00E+00 0.00E+00
7 4.03285E-01 5.881E-02 0.000E+00 1.409E-03 1.750E-01 0.00E+00 0.00E+00 -1.57E-02
8 4.03304E-01 5.685E-02 0.000E+00 1.692E-01 1.361E-03 0.00E+00 0.00E+00 1.52E-02
9 4.59051E-01 8.613E-02 2.584E-01 0.000E+00 0.000E+00 0.00E+00 0.00E+00 0.00E+00
10 4.61447E-01 0.000E+00 0.000E+00 0.000E+00 0.000E+00 0.00E+00 0.00E+00 0.00E+00
...
The first six transitions are forbidden, with zero oscillator strength. The
@ -245,15 +246,15 @@ Next, one finds the excitation energies for the spin-triplet states:
TDDFT triplet excitation energies (at most 20 of them are printed),
and corresponding total energies.
Excit# (Ha) and (eV) total energy (Ha) major contributions
1 2.88423E-01 7.84838E+00 -1.929652E+01 0.82( 5-> 6) 0.18( 5-> 7)
2 2.88424E-01 7.84842E+00 -1.929652E+01 0.82( 5-> 7) 0.18( 5-> 6)
3 2.99762E-01 8.15693E+00 -1.928518E+01 0.37( 3-> 6) 0.37( 4-> 7)
4 3.33749E-01 9.08177E+00 -1.925119E+01 0.37( 4-> 6) 0.37( 3-> 7)
5 3.33809E-01 9.08339E+00 -1.925113E+01 0.37( 4-> 7) 0.37( 3-> 6)
6 3.36922E-01 9.16812E+00 -1.924802E+01 1.00( 5-> 8) 0.00( 2-> 10)
7 3.64202E-01 9.91045E+00 -1.922074E+01 0.37( 3-> 7) 0.37( 4-> 6)
8 3.90779E-01 1.06336E+01 -1.919416E+01 0.67( 3-> 8) 0.27( 2-> 6)
9 3.90834E-01 1.06351E+01 -1.919411E+01 0.67( 4-> 8) 0.27( 2-> 7)
1 2.84779E-01 7.74923E+00 -2.039010E+01 1.00( 5-> 7) 0.00( 5-> 6)
2 2.84781E-01 7.74928E+00 -2.039010E+01 1.00( 5-> 6) 0.00( 5-> 7)
3 2.97188E-01 8.08689E+00 -2.037770E+01 0.50( 3-> 7) 0.50( 4-> 6)
4 3.30296E-01 8.98780E+00 -2.034459E+01 0.50( 4-> 7) 0.50( 3-> 6)
5 3.30344E-01 8.98913E+00 -2.034454E+01 0.50( 4-> 6) 0.50( 3-> 7)
6 3.43692E-01 9.35234E+00 -2.033119E+01 1.00( 5-> 8) 0.00( 2-> 10)
7 3.60026E-01 9.79681E+00 -2.031486E+01 0.50( 3-> 6) 0.50( 4-> 7)
8 3.85278E-01 1.04839E+01 -2.028961E+01 0.91( 2-> 7) 0.09( 3-> 8)
9 3.85310E-01 1.04848E+01 -2.028957E+01 0.91( 2-> 6) 0.08( 4-> 8)
...
Spin-triplet energies are markedly lower than the corresponding spin-singlet
@ -266,20 +267,20 @@ To summarize our results, we obtain the following five lowest-lying spin-
singlet excitation energies, with corresponding quantum numbers (that we
derive from the knowledge of the Kohn-Sham states quantum numbers):
9.47 eV m=+1,-1 even parity (Pi_g state)
9.86 eV m=0 even parity (Sigma_g state)
9.91 eV m=0 odd parity (Sigma_u state)
10.46 eV m=+2,-2 odd parity (Delta_u state)
10.79 eV m=+1,-1 odd parity (Pi_u state)
9.40 eV m=+1,-1 even parity (Pi_g state)
9.80 eV m=0 odd parity (Sigma_u state)
10.03 eV m=0 even parity (Sigma_g state)
10.44 eV m=+2,-2 odd parity (Delta_u state)
10.97 eV m=+1,-1 odd parity (Pi_u state)
and the following five lowest-lying spin-triplet excitations energies, with
corresponding quantum numbers:
7.85 eV m=+1,-1 even parity (Pi_g state)
8.16 eV m=0 odd parity (Sigma_u state)
9.08 eV m=+2,-2 odd parity (Delta_u state)
9.16 eV m=0 even parity (Sigma_g state)
9.91 eV m=0 odd parity (Sigma_u state)
7.75 eV m=+1,-1 even parity (Pi_g state)
8.09 eV m=0 odd parity (Sigma_u state)
8.99 eV m=+2,-2 odd parity (Delta_u state)
9.35 eV m=0 even parity (Sigma_g state)
9.80 eV m=0 odd parity (Sigma_u state)
The quantum number related to the effect of a mirror plane, needed for $\Sigma$
states, could not be attributed on the sole basis of the knowledge of Kohn-
@ -302,18 +303,18 @@ and the lowest-lying experimental spin-triplet excitations energies are:
In several cases, the agreement is quite satisfactory, on the order of 0.1-0.2
eV. However, there are also noticeable discrepancies. Indeed, we have to understand, in our simulation:
* The appearance of the spin-singlet $^1\Sigma_g$ state at 9.86 eV (Spin-singlet state 2)
* The appearance of the spin-singlet $^1\Sigma_g$ state at 10.03 eV (Spin-singlet state 3)
* The inversion between the spin-triplet $^3\Pi_g$ and $^3\Sigma_u$ states (Spin-triplet states 1 and 2)
* The appearance of the spin-triplet $^3\Sigma_g$ state at 9.16 eV (Spin-triplet state 4)
* The appearance of the spin-triplet $^3\Sigma_g$ state at 9.35 eV (Spin-triplet state 4)
Still, the agreement between these TDDFT values and the experimental values is
much better than anything that can be done on the sole basis of Kohn-Sham
energy differences, that are (for spin-singlet and -triplet):
8.46 eV m=+1,-1 even parity (Pi_g state)
9.36 eV m=0 odd parity (Sigma_u state)
9.91 eV m=0(twice),+2,-2 odd parity (Sigma_u and Delta_u states)
10.81 eV m=+1,-1 odd parity (Pi_u state)
8.34 eV m=+1,-1 even parity (Pi_g state)
9.53 eV m=0 odd parity (Sigma_u state)
9.80 eV m=0(twice),+2,-2 odd parity (Sigma_u and Delta_u states)
10.99 eV m=+1,-1 odd parity (Pi_u state)
## Convergence studies
@ -324,22 +325,22 @@ We will start with the number of unoccupied states. The only input parameter
to be changed in the input file is the value of nband2. The following results
are obtained, for nband2 = 12, 30, 60, 100 and 150 (Energies given in eV):
Singlet 1 : 9.47 9.44 9.39 9.36 9.35
Singlet 2 : 9.86 9.74 9.68 9.66 9.66
Singlet 3 : 9.91 9.91 9.91 9.91 9.91
Singlet 4 : 10.46 10.45 10.44 10.44 10.43
Singlet 5 : 10.79 10.79 10.79 10.79 10.79
Triplet 1 : 7.85 7.84 7.83 7.82 7.82
Triplet 2 : 8.16 8.08 8.03 8.00 8.00
Triplet 3 : 9.08 9.07 9.05 9.05 9.04
Triplet 4 : 9.16 9.16 9.15 9.15 9.15
Triplet 5 : 9.91 9.91 9.91 9.91 9.91
Singlet 1 : 9.40 9.37 9.33 9.30 9.28
Singlet 2 : 9.80 9.80 9.80 9.79 9.80
Singlet 3 : 10.03 9.91 9.85 9.83 9.83
Singlet 4 : 10.44 10.43 10.43 10.42 10.42
Singlet 5 : 10.97 10.97 10.97 10.97 10.97
Triplet 1 : 7.75 7.75 7.73 7.73 7.72
Triplet 2 : 8.06 8.02 7.98 7.96 7.95
Triplet 3 : 8.99 8.97 8.96 8.96 8.95
Triplet 4 : 9.35 9.34 9.34 9.34 9.34
Triplet 5 : 9.80 9.80 9.80 9.80 9.80
You might try to obtain one of these...
The computation with nband2 = 100 takes
about 7 minutes on a 2.8 GHz PC, and gives a result likely converged within
0.01 eV. Let's have a look at these data. Unfortunately, none of the above-
The computation with nband2 = 100 takes a bit more than 1 minute,
and gives a result likely converged within 0.01 eV.
Let us have a look at these data. Unfortunately, none of the above-
mentioned discrepancies with experimental data is resolved, although the
difference between the first and second spin-triplet states decreases
significantly. Although we see that at least 60 bands are needed to obtain
@ -348,49 +349,49 @@ to understand the most important discrepancies, while keeping the CPU time to a
We next try to increase the cut-off energy. Again, this is fairly easy. One
can e.g. set up a double dataset loop. The following results are obtained, for
ecut = 25, 35, 45, 55, 65, and 75 Ha:
ecut = 25, 30, 35 and 45 Ha:
Singlet 1 : 9.47 9.41 9.39 9.36 9.36
Singlet 2 : 9.86 9.83 9.78 9.76 9.76
Singlet 3 : 9.91 9.97 10.01 10.02 10.03
Singlet 4 : 10.46 10.37 10.32 10.30 10.29
Singlet 5 : 10.79 10.87 10.90 10.91 10.92
Triplet 1 : 7.85 7.79 7.76 7.74 7.73
Triplet 2 : 8.16 8.02 7.94 7.92 7.91
Triplet 3 : 9.08 8.98 8.92 8.90 8.89
Triplet 4 : 9.16 9.28 9.33 9.34 9.34
Triplet 5 : 9.91 9.83 9.78 9.77 9.76
Singlet 1 : 9.40 9.37 9.36 9.36
Singlet 2 : 9.80 9.78 9.77 9.77
Singlet 3 : 10.03 10.03 10.04 10.04
Singlet 4 : 10.46 10.37 10.32 10.30
Singlet 5 : 10.97 10.98 10.98 10.98
Triplet 1 : 7.75 7.72 7.72 7.72
Triplet 2 : 8.09 8.06 8.06 8.06
Triplet 3 : 8.99 8.97 8.96 8.96
Triplet 4 : 9.35 9.35 9.35 9.35
Triplet 5 : 9.80 9.78 9.77 9.77
You might try to obtain one of these...
The computation with ecut=75 takes
about 90 secs on a 2.8 GHz PC, and gives a result likely converged within 0.01
eV. Let us have a look at these data. Concerning the discrepancies with the
experimental results, we see that the position of the second spin-singlet
state has even worsened, the difference between the first and second spin-
triplet states decreases, so that, together with an increase of nband, their
order might become the correct one, and the fourth spin-triplet state energy
has increased, but not enough.
The computation with ecut=30 takes a couple of seconds
and gives a result likely converged within 0.01 eV.
The modifications with respect to the results with ecut=25 Ha are quite small.
We finally examine the effect of the cell size. Again, this is fairly easy.
e keep 12 bands, but stick to ecut=30 Ha.
One can e.g. set up a double dataset loop. The following results are obtained,
for acell = (6 5 5), (7 6 6), (8 7 7), (9 8 8), (10 9 9) and (12 11 11):
for acell = (6 5 5), (8 7 7), (10 9 9), (12 11 11), (14 13 13), (16 15 15) and (20 19 19):
Singlet 1 : 9.47 9.37 9.33 9.33 9.33 9.33
Singlet 2 : 9.86 9.78 9.84 9.91 9.96 10.03
Singlet 3 : 9.91 9.88 9.85 9.85 9.85 9.85
Singlet 4 : 10.46 10.41 10.38 10.37 10.37 10.37
Singlet 5 : 10.79 10.98 11.14 11.27 11.19 11.04
Triplet 1 : 7.85 7.75 7.72 7.71 7.72 7.72
Triplet 2 : 8.16 8.18 8.18 8.18 8.19 8.20
Triplet 3 : 9.08 9.07 9.06 9.06 9.06 9.06
Triplet 4 : 9.16 9.36 9.55 9.68 9.78 9.90
Triplet 5 : 9.91 9.88 9.85 9.85 9.85 9.85
Singlet 1 : 9.37 9.25 9.24 9.24 9.25 9.25 9.25
Singlet 2 : 9.78 9.73 9.72 9.72 9.72 9.72 9.72
Singlet 3 : 10.03 10.04 10.18 10.26 10.29 10.32 10.34
Singlet 4 : 10.42 10.35 10.34 10.34 10.34 10.34 10.35
Singlet 5 : 10.98 11.34 11.40 11.12 10.95 10.84 10.70
Triplet 1 : 7.72 7.60 7.60 7.60 7.60 7.60 7.60
Triplet 2 : 8.06 8.07 8.07 8.08 8.08 8.08 8.08
Triplet 3 : 8.97 8.94 8.94 8.94 8.94 8.94 8.94
Triplet 4 : 9.35 9.73 9.72 9.72 9.72 9.72 9.72
Triplet 5 : 9.78 9.75 10.00 10.12 10.18 10.22 10.27
Obviously, the cell size plays an important role in the spurious appearance of
the states, that was remarked when comparing against experimental data.
Indeed, the singlet 2 and triplet 4 states energy increases strongly with the
Indeed, the singlet 3 and triplet 4 states energy increases strongly with the
cell size, while all other states quickly stabilize (except the still higher singlet 5 state).
Actually, the singlet 3 and 4 switch between (16 15 15) and (20 19 19),
and the triplet 4 and 5 switch between (6 5 5) and (8 7 7) ...
The presence of the singlet 3 state (Sigma_g) in the three lowest ones,
an the triplet 4 state (Sigma_g) were two of our discrepancies.
There is one lesson to be learned from that convergence study: the
convergence of different states can be quite different. Usually, converging
@ -398,37 +399,39 @@ the lower excited states do not require too much effort, while it is quite
difficult, especially concerning the supercell size, to converge higher states.
At this stage, we will simply stop this convergence study, and give the
results of an ABINIT calculation using ecut 45 Hartree, acell 12 11 11, and 30
bands (not fully converged, though!), then compare the results with other
results of an ABINIT calculation using ecut 30 Hartree, acell 10 9 9, and 100
bands, focusing only on those states already converged, then compare the results with other
LDA/TDLDA results (from [[cite:Casida1998]]) and experimental results:
present Casida experimental
Singlet Pi_g : 9.25 9.05 9.31
present Casida experimental
Singlet Pi_g : 9.20 9.05 9.31
Singlet Sigma_u- : 9.72 9.63 9.92
Singlet Delta_u : 10.22 10.22 10.27
Triplet Sigma_u+ : 7.95 7.85 7.75
Triplet Pi_g : 7.64 7.54 8.04
Triplet Delta_u : 8.89 8.82 8.88
Singlet Delta_u : 10.33 10.22 10.27
Triplet Sigma_u+ : 7.99 7.85 7.75
Triplet Pi_g : 7.59 7.54 8.04
Triplet Delta_u : 8.92 8.82 8.88
Triplet Sigma_u- : 9.72 9.63 9.67
Our calculation is based on pseudopotentials, while Casida's calculation is an
all-electron one. This fact might account for the 0.1-0.2 eV discrepancy
between both calculations (it is of course the user's responsibility to test
all-electron one. This fact might account for the discrepancy
between both calculations (maximal 0.15 eV - it is of course the user's responsibility to test
the influence of different pseudopotentials on his/her calculations). The
agreement with experimental data is on the order of 0.2 eV, with the exception
of the $^3\Pi_g$ state (0.4 eV). In particular, we note that LDA/TDLDA is
not able to get the correct ordering of the lower two triplet states ... One
of the $^3\Pi_g$ state (0.45 eV). In particular, we note that LDA/TDLDA is
not able to get the correct ordering of the lowest two triplet states ... One
of our problems was intrinsic to the LDA/TDLDA approximation ...
## The choice of the exchange-correlation potential
## The choice of the exchange-correlation potential and kernel
As emphasized in [[cite:Casida1998]], choosing a different functional for the self-consistent part
(XC potential) and the generation of the coupling matrix (XC
kernel) can give a better description of the higher-lying states. Indeed, a
potential with a -1/r tail (unlike the LDA or GGA) like the van Leeuwen-Baerends one [[cite:VanLeeuwen1994]],
(XC potential) and the generation of the coupling matrix (XC kernel)
can give a better description of the higher-lying states.
Indeed, a potential with a -1/r tail (unlike the LDA or GGA) like the van Leeuwen-Baerends one [[cite:VanLeeuwen1994]],
can reproduce fairly well the ionisation energy, giving a much
better description of the Rydberg states. Still, the LDA kernel works pretty well.
In order to activate this procedure, set the value of [[ixc]] in dataset 1 to the
SCF functional, and the value of ixc in dataset 2 to the XC functional to be
used for the kernel. Use pseudopotentials that agree with the SCF functional.
used for the kernel. Use pseudopotentials that agree with the SCF functional in dataset 1.
As of writing (end of 2020), the ABINIT implementation has a strong restriction on the XC kernels that can be used. They
must be of LDA-type. See the list of allowed [[ixc]] values in the description of [[iscf]]=-1.

View File

@ -19,13 +19,14 @@ It should take about 1 hour.
For the theory related to the temperature-dependent calculations, please read
the following papers: [[cite:Ponce2015]], [[cite:Ponce2014]] and [[cite:Ponce2014a]].
There are two ways to compute the temperature dependence with Abinit:
There are three ways to compute the temperature dependence with Abinit:
* **Using Anaddb**: historically the first implementation. This option does not require Netcdf.
* **Using Anaddb**: historically the first implementation.
* **Using post-processing python scripts**: this is the recommended approach as it provides more options
and is more efficient (less disk space, less memory demanding). This option
**requires Netcdf** (both in Abinit and python). In this tutorial, we only focus on the netCDF-based approach.
* **Using post-processing python scripts**: This way provides more options and is more efficient (less disk space, less memory demanding).
This option **requires Netcdf** (both in Abinit and python). In this tutorial, we only focus on this approach.
* **Using an interpolation of the perturbed potential**: This new way is covered in the [ZPR and T-dependent band structures](eph4zpr) tutorial.
!!! important
@ -44,31 +45,6 @@ There are two ways to compute the temperature dependence with Abinit:
pip install scipy
pip install netcdf4
Abinit must be configured with: `configure --with-config-file=myconf.ac`
where the configuration file must contain at least:
with_trio_flavor="netcdf+other-options"
# To link against an external libs, use
#with_netcdf_incs="-I${HOME}/local/include"
# if (netcdf4 + hdf5):
#with_netcdf_libs="-L/usr/local/lib -lnetcdff -lnetcdf -L${HOME}/local/lib -lhdf5_hl -lhdf5"
# else if netcdf3:
#with_netcdf_libs="-L${HOME}/local/lib/ -lnetcdff -lnetcdf"
For example, with MPI you might use the following basic myconf.ac file
with_trio_flavor="netcdf"
with_mpi_prefix='/home/XXXXX/local/openmpi1.10/'
enable_mpi="yes"
enable_mpi_io="yes"
enable_openmp="no"
prefix='/home/XXXX/abinit/build/'
A list of configuration files for clusters is available in the
[abiconfig repository](https://github.com/abinit/abiconfig)
@ -79,15 +55,16 @@ There are two ways to compute the temperature dependence with Abinit:
to get the list of libraries/options activated in the build.
You should see netcdf in the `TRIO flavor` section:
=== Connectors / Fallbacks ===
Connectors on : yes
Fallbacks on : yes
DFT flavor : libxc-fallback
FFT flavor : none
LINALG flavor : netlib-fallback
MATH flavor : none
TIMER flavor : abinit
TRIO flavor : netcdf
=== Connectors / Fallbacks ===
LINALG flavor : netlib
FFT flavor : goedecker
HDF5 : yes
NetCDF : yes
NetCDF Fortran : yes
LibXC : yes
Wannier90 : no
[TUTORIAL_READMEV9]
Visualisation tools are NOT covered in this tutorial.
Powerful visualisation procedures have been developed in the Abipy context,
@ -122,10 +99,6 @@ This induces the creation of the Derivative DataBase file tdepes_1o_DS3_DDB.
The electron-phonon matrix elements are produced because of [[ieig2rf]]3=5 ,
this option generating the needed netCDF files tdepes_1o_DS3_EIGR2D.nc and tdepes_1o_DS3_GKK.nc .
We will use [[tests/tutorespfn/Input/tdepes_1.files]], with minor modifications -see below-, to execute abinit.
{% dialog tests/tutorespfn/Input/tdepes_1.files %}
In order to run abinit, we suggest that you create a working directory, why not call it `Work`,
as subdirectory of ~abinit/tests/tutorespfn/Input, then
copy/modify the relevant files. Explicitly:
@ -133,26 +106,15 @@ copy/modify the relevant files. Explicitly:
cd ~abinit/tests/tutorespfn/Input
mkdir Work
cd Work
cp ../tdepes*in ../tdepes*files .
cp ../tdepes*in .
Then, edit the [[tests/tutorespfn/Input/tdepes_1.files]] to modify location of the pseudopotential file
(from the Work subdirectory, the location is ../../../Psps_for_tests/PseudosTM_pwteter/6c.pspnc, although you might as well copy the
file 6c.pspnc in the Work directory, in which case the location is simply 6c.pspnc).
Finally, issue
abinit < tdepes_1.files > tdepes_1.stdout
abinit tdepes_1.abi
(where `abinit` might have to be replaced by the proper location of the abinit executable, or by ./abinit if you have
copied abinit in the Work directory).
<!--
### If Abinit is compiled with Netcdf...
-->
If you have compiled the code with Netcdf, the calculation will produce
several _EIG.nc,
_DDB, EIGR2D.nc and EIGI2D.nc files, that contain respectively the eigenvalues (GS or
perturbed), the second-order derivative of the total energy with respect to
The calculation will produce several _EIG.nc, _DDB, EIGR2D.nc and EIGI2D.nc files,
that contain respectively the eigenvalues (GS or perturbed),
the second-order derivative of the total energy with respect to
two atomic displacements, the electron-phonon matrix elements used to compute
the renormalization of the eigenenergies and the electron-phonon matrix
elements used to compute the lifetime of the electronic states.
@ -176,7 +138,7 @@ into the directory where you did the calculations.
You can then simply run the python script with the following command:
./temperature_final.py
python temperature_final.py
and enter the information asked by the script, typically the following
(data contained in ~abinit/tests/tutorespfn/Input/tdepes_1_temperature.in):
@ -199,13 +161,13 @@ tdepes_1o_DS1_EIG.nc # Name of the unperturbed EIG.nc file with Eigenvalue
Alternatively, copy this example file in the Work directory if not yet done, and then run
./temperature_final.py < tdepes_1_temperature.in
python temperature_final.py < tdepes_1_temperature.in
{% dialog tests/tutorespfn/Input/tdepes_1_temperature.in %}
!!! warning
Remember to use py2.7 and install the libraries required by the script before running.
Remember to install the libraries required by the script before running.
For pip, use:
@ -221,18 +183,18 @@ Alternatively, copy this example file in the Work directory if not yet done, and
You should see on the screen an output similar to:
```shell
Start on 15/3/2018 at 13h29
Start on 21/12/2020 at 15h21
____ ____ _ _
| _ \| _ \ | |_ ___ _ __ ___ _ __ ___ _ __ __ _| |_ _ _ _ __ ___
| |_) | |_) |____| __/ _ \ '_ ` _ \| '_ \ / _ \ '__/ _` | __| | | | '__/ _ \
| __/| __/_____| || __/ | | | | | |_) | __/ | | (_| | |_| |_| | | | __/
|_| |_| \__\___|_| |_| |_| .__/ \___|_| \__,_|\__|\__,_|_| \___|
|_| Version 1.3
This script compute the static/dynamic zero-point motion
____ ____ _ _
| _ \| _ \ | |_ ___ _ __ ___ _ __ ___ _ __ __ _| |_ _ _ _ __ ___
| |_) | |_) |____| __/ _ \ '_ ` _ \| '_ \ / _ \ '__/ _` | __| | | | '__/ _ \
| __/| __/_____| || __/ | | | | | |_) | __/ | | (_| | |_| |_| | | | __/
|_| |_| \__\___|_| |_| |_| .__/ \___|_| \__,_|\__|\__,_|_| \___|
|_| Version 1.5
This script compute the static/dynamic zero-point motion
and the temperature dependence of eigenenergies due to electron-phonon interaction.
The electronic lifetime can also be computed.
The electronic lifetime can also be computed.
WARNING: The first Q-point MUST be the Gamma point.
@ -245,7 +207,7 @@ Define the type of calculation you want to perform. Type:
Enter name of the output file
Enter value of the smearing parameter for AHC (in eV)
Enter value of the Gaussian broadening for the Eliashberg function and PDOS (in eV)
Enter the energy range for the PDOS and Eliashberg calculations (in eV): [e.g. 0 0.5]
Enter the energy range for the PDOS and Eliashberg calculations (in eV): [e.g. 0 0.5]
Introduce the min temperature, the max temperature and the temperature steps. e.g. 0 200 50 for (0,50,100,150)
Enter the number of Q-points you have
Enter the name of the 0 DDB file
@ -253,10 +215,12 @@ Enter the name of the 0 eigq file
Enter the name of the 0 EIGR2D file
Enter the name of the 0 GKK file
Enter the name of the unperturbed EIG.nc file at Gamma
Q-point: 0 with wtq = 1.0 and reduced coord. [ 0. 0. 0.]
Inside the dynamic_zpm_temp def
Q-point: 0 with wtq = 1.0 and reduced coord. [0. 0. 0.]
WARNING: An eigenvalue is negative with value: -2.8630004909173537e-10 ... but proceed with value 0.0
Now compute active space ...
Now compute generalized g2F Eliashberg electron-phonon spectral function ...
End on 15/3/2018 at 13 h 29
End on 21/12/2020 at 15 h 21
Runtime: 0 seconds (or 0.0 minutes)
```
@ -278,30 +242,18 @@ The python code has generated the following files:
at each k-point for each band. It also contains the evolution of each band with temperature at k=$\Gamma$.
-->
We can for example visualize the temperature dependence at k=$\Gamma$ of the HOMO bands
(`Band: 3` section in the **temperature_1.txt** file, that you can examine)
We can for example visualize the temperature dependence at k=$\Gamma$ of the LUMO bands
(`Band: 4` section in the **temperature_1.txt** file, that you can examine)
with the contribution of only q=$\Gamma$.
<!--
![](tdepes_assets/plot1.png)
Here you can see that the HOMO correction goes down with temperature. This is
due to the use of underconvergence parameters. If you increase [[ecut]] from
5 to 10, you get the following plot.
-->
![](tdepes_assets/plot2.png)
The HOMO eigenenergies correction goes up with temperature... You can
also plot the LUMO corrections and see that they go down. The
ZPR correction as well as their temperature dependence usually closes the gap
As you can see, the LUMO correction goes down with temperature.
If the calculations were converged, the HOMO eigenenergies correction should go up with temperature.
In general, the ZPR correction as well as their temperature dependence usually closes the gap
of semiconductors.
As usual, checking whether the input parameters give converged values is of course important.
The run used [[ecut]]=10. With the severely underestimated [[ecut]]=5, the HOMO correction goes down with temperature.
<!-- OBSOLETE
@ -311,11 +263,9 @@ The run used [[ecut]]=10. With the severely underestimated [[ecut]]=5, the HOMO
In this case, we should first use [[help:mrgddb|mrgddb]] to merge the _DDB and _EIGR2D/_EIGI2D
but since we only have one q-point we do not have to perform this step.
The static temperature dependence and the G2F can be computed thanks to anaddb
with the files file [[tests/tutorespfn/Input/tdepes_2.files]] and the input
with the files file tdepes_2.files and the input
file [[tests/tutorespfn/Input/tdepes_2.abi]].
{% dialog tests/tutorespfn/Input/tdepes_2.files %}
The information contained in the files file can be understood by looking at the echo
if its reading in the standard output:
@ -343,7 +293,7 @@ As concern the anaddb input file, note that the electron-phonon analysis is trig
Launch anaddb by the command
anaddb < tdepes_2.files > tdepes_2.stdout
anaddb tdepes_2.abi
(where `anaddb` might have to be replaced by the proper location of the anaddb executable).
@ -353,9 +303,6 @@ The run will generate 3 files:
: This g2F spectral function represents the contribution of the phononic modes of energy E
to the change of electronic eigenenergies according to the equation
![](tdepes_assets/Eq1.png)
**tdepes_2.out_ep_PDS**
: This file contains the phonon density of states
@ -371,9 +318,6 @@ END OF OBSOLETE
## 2 Converging the calculation with respect to the grid of phonon wavevectors
Convergence studies with respect to most of the parameters will rely on obvious modifications
@ -386,7 +330,7 @@ From now on we will only describe the approach with Abinit **compiled with Netcd
The approach with Anaddb is similar to what we described in the previous sections.
Note, however, that Anaddb only supports integration with homogenous q-point grids.
-->
The netCDF version can perform the q-wavevector integration either with random q-points or
The code can perform the q-wavevector integration either with random q-points or
homogenous Monkhorst-Pack meshes.
Both grids have been used in the Ref. [[cite:Ponce2014]], see e.g. Fig. 3 of this paper.
@ -396,10 +340,10 @@ calculations at these points, gather the results and analyze them.
The temperature_final.py script will detect that you used random
integration thanks to the weight of the q-point stored in the _EIGR2D.nc file
and perform the integration accordingly.
The random integration converges slowly but in a consistent manner.
The random integration converges slowly but in a smooth manner.
However, since this method is a little bit less user-friendly than the one based on homogeneous grids,
we will focus on this homogenous integration. Even simpler, it is not trivial.
we will focus on this homogenous integration.
In this case, the user must specify in the ABINIT input file the homogeneous q-point grid,
using input variables like
[[ngqpt]], [[qptopt]], [[shiftq]], [[nshiftq]], ..., i.e. variables whose names
@ -450,9 +394,9 @@ Then, the k-point grid is
specified thanks to [[ngkpt]], [[nshiftk]], [[shiftk]], replacing the corresponding input variables for the q-point
grid. The use of symmetries has been reenabled thanks to [[nsym]]=0.
After possibly modifying [[tests/tutorespfn/Input/tdepes_2.files]] to account for the location of the pseudopotential file, as above, issue:
To run it, issue:
abinit < tdepes_2.files > tdepes_2.stdout
abinit tdepes_2.abi
Now, the number of points can be seen in the output file :
@ -511,36 +455,31 @@ that translates into
allowing to perform calculations for three datasets at each q-point.
After possibly modifying [[tests/tutorespfn/Input/tdepes_3.files]] to account for the location of the pseudopotential file, as above, issue:
Then issue:
abinit < tdepes_3.files > tdepes_3.stdout
abinit tdepes_3.abi
This is a significantly longer ABINIT run (still less than one minute), also producing many files.
This is a significantly longer ABINIT run (still less than two minutes), also producing many files.
When the run is finished, copy the file [[tests/tutorespfn/Input/tdepes_3_temperature.in]] in the
working directory (if not yet done) and launch the python script with:
./temperature_final.py < tdepes_3_temperature.in
{% dialog tests/tutorespfn/Input/tdepes_3.files %}
{% dialog tests/tutorespfn/Input/tdepes_3_temperature.in %}
Examination of the same HOMO band at k=$\Gamma$ for a 4x4x4 q-point grid gives a very different result
than previously. Indeed, for the ZPR, one finds (in eV)
Examination of the same HOMO and LUMO bands at k=$\Gamma$ for a 4x4x4 q-point grid gives a very different result
than previously.
The zero-point renormalization (ZPR) is the change of the bandgap at 0 K and was (band 4 - band 3):
-0.012507 - 0.017727 = -0.030234 eV
Band: 3
0.0 0.154686616316
and is now:
instead of
-0.351528 - 0.095900 = -0.447428 eV
Band: 3
0.0 0.0464876236664
that, is, the ZPR is now about three times larger, and similary for the temperature dependence.
<!--
![](tdepes_assets/plot3.png)
-->
This means that the bandgap was closing by 30 meV at 0 K and is now closing by 447 meV at 0 K.
For comparison, the converged direct bandgap ZPR of diamond is 438.6 meV from Ref. [[cite:Ponce2015]].
As a matter of fact, diamond requires an extremely dense q-point grid (40x40x40) to be converged.
On the bright side, each q-point calculation is independent and thus the parallel scaling is ideal.
@ -553,22 +492,17 @@ coupling along high-symmetry lines requires the use of 6 datasets per q-point.
Moreover, the choice of an arbitrary k-wavevector breaks all symmetries of the crystal.
Different datasets are required to compute the following quantites:
$\Psi^{(0)}_{kHom}$
: The ground-state wavefunctions on the Homogeneous k-point sampling.
$\Psi^{(0)}_{kHom}$ : The ground-state wavefunctions on the Homogeneous k-point sampling.
$\Psi^{(0)}_{kBS}$
: The ground-state wavefunctions computed along the bandstructure k-point sampling.
$\Psi^{(0)}_{kBS}$ : The ground-state wavefunctions computed along the bandstructure k-point sampling.
$\Psi^{(0)}_{kHom+q}$
: The ground-state wavefunctions on the shifted Homogeneous k+q-point sampling.
$\Psi^{(0)}_{kHom+q}$ : The ground-state wavefunctions on the shifted Homogeneous k+q-point sampling.
$n^{(1)}$
: The perturbed density integrated over the homogeneous k+q grid.
$n^{(1)}$ : The perturbed density integrated over the homogeneous k+q grid.
$\Psi^{(0)}_{kBS+q}$
: The ground-state wavefunctions obtained from reading the perturbed density of the previous dataset.
$\Psi^{(0)}_{kBS+q}$ : The ground-state wavefunctions obtained from reading the perturbed density of the previous dataset.
Reading the previous quantity we obtain the el-ph matrix elements along the BS with all physical
Reading the previous quantity we obtain the el-ph matrix elements along the bandstructure with all physical
quantities integrated over a homogeneous grid.
We will use the [[tests/tutorespfn/Input/tdepes_4.abi]] input file
@ -580,11 +514,11 @@ Note the use of the usual input variables to define a path in the Brillouin Zone
is thus very easy to determine, as being the product of [[ngqpt]] values times [[nshiftq]]. Here a very rough 2*2*2 grid has been chosen,
even less dense than the one for section 2.
After possibly modifying [[tests/tutorespfn/Input/tdepes_4.files]] to account for the location of the pseudopotential file, as above, issue:
Then issue:
abinit < tdepes_4.files > tdepes_4.stdout
abinit tdepes_4.abi
This is a significantly longer ABINIT run (2-3 minutes), also producing many files.
This is a significantly longer ABINIT run (5-10 minutes), also producing many files.
then use [[tests/tutorespfn/Input/tdepes_4_temperature.in]] for the python script.
@ -597,9 +531,7 @@ with the usual syntax:
<!-- THIS SECTION DOES NOT SEEM CORRECT : there is no other k point computed in section 2 ...
Of course, the high symmetry points computed in section 2 have the same value here.
It is a good idea to check it by running the script with the file [[tests/tutorespfn/Input/tdepes_3bis.files]].
{% dialog tests/tutorespfn/Input/tdepes_3bis.files %}
It is a good idea to check it by running the script with the file tdepes_3bis.files.
-->
@ -687,8 +619,3 @@ accurate values of the ZPR at 0K you can look at the table above.
if the material is polar and if the state we are considering is a band extrema or not.
More information can be found in Ref. [[cite:Ponce2015]]

Binary file not shown.

Before

Width:  |  Height:  |  Size: 11 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 82 KiB

After

Width:  |  Height:  |  Size: 52 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 560 KiB

After

Width:  |  Height:  |  Size: 119 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 688 KiB

View File

@ -60,7 +60,7 @@ Several parameters (both physical and technical) are important for the cRPA calc
the more localized is the radial part of the Wannier orbital. Finally, note that Wannier orbitals
are used in DMFT and cRPA implementations but this is not the most usual choice of correlated orbitals
in the DFT+_U_ implementation in particular in ABINIT (see [[cite:Amadon2008a]]).
The relation between the two expressions is briefly discussed in [[cite:Geneste2016]].
The relation between the two expressions is briefly discussed in [[cite:Geneste2017]].
* **The constrained polarization calculation.** As we will discuss in section
2, there are different ways to define the constrained polarizability, by suppressing in the polarization,
@ -87,19 +87,18 @@ for the other tutorials. Why not Work_crpa?
In what follows, the name of files are mentioned as if you were in this subdirectory.
All the input files can be found in the `$ABI_TESTS/tutoparal/Input` directory.*
Copy the files *tucrpa_1.in* and *tucrpa_1.files* from *ABI_TESTS/tutoparal/Input* to *Work_crpa* with:
Copy the files *tucrpa_1.abi* from *ABI_TESTS/tutoparal/Input* to *Work_crpa* with:
```sh
cd $ABI_TESTS/tutoparal/Input
mkdir Work_crpa
cd Work_crpa
cp ../tucrpa_1.files .
cp ../tucrpa_1.in .
cp ../tucrpa_1.abi .
```
and run the code with:
mpirun -n 32 abinit < tucrpa_1.files > log_1 &
mpirun -n 32 abinit tucrpa_1.abi > log_1 &
This run should take some time. It is recommended that you use at least 10
processors (and 32 should be fast). It calculates the LDA ground state of
@ -139,7 +138,7 @@ However, we clearly see an important hybridization. The Fermi level (at 0 eV)
is in the middle of bands 21-23.
One can easily check that bands 21-23 are mainly _d-t<sub>2g</sub>_ and bands 24-25 are
mainly _e<sub>g</sub>_: just use [[pawfatbnd]] = 2 in *tucrpa_1.in* and relaunch the
mainly _e<sub>g</sub>_: just use [[pawfatbnd]] = 2 in *tucrpa_1.abi* and relaunch the
calculations. Then the file *tucrpa_O_DS2_FATBANDS_at0001_V_is1_l2_m-2*,
*tucrpa_O_DS2_FATBANDS_at0001_V_is1_l2_m-1* and
*tucrpa_O_DS2_FATBANDS_at0001_V_is1_l2_m1* give you respectively the _xy_, _yz_ and
@ -186,7 +185,7 @@ interactions is carried out, the choice of models is discussed in [[cite:Amadon2
In this section, we will present the input variables and discuss how to
extract useful information in the log file in the case of the _d-d_ model. The
input file for a typical cRPA calculation (*tucrpa_2.in*) contains four datasets
input file for a typical cRPA calculation (*tucrpa_2.abi*) contains four datasets
(as usual _GW_ calculations, see the [GW tutorial](gw1.md#1a)): the
first one is a well converged LDA calculation, the second is non self-consistent calculation
to compute accurately full and empty states, the third
@ -194,19 +193,18 @@ computes the constrained non interacting polarizability, and the fourth
computes effective interaction parameters _U_ and _J_. We discuss these four
datasets in the next four subsections.
Copy the files in your *Work_crpa* directory with:
Copy the file in your *Work_crpa* directory with:
```sh
cp ../tucrpa_2.in .
cp ../tucrpa_2.files
cp ../tucrpa_2.abi .
```
The input file *tucrpa_2.in* contains standard data to perform a LDA
The input file *tucrpa_2.abi* contains standard data to perform a LDA
calculation on SrVO<sub>3</sub>. We focus in the next subsections on some peculiar input
variables related to the fact that we perform a cRPA calculation. Before
reading the following section, launch the abinit calculation:
abinit < tucrpa_2.files > log_2
abinit tucrpa_2.abi > log_2
##### 3.2.1. The first DATASET: A converged LDA calculation
@ -220,7 +218,7 @@ the full interaction matrix described in section 3.2.4 will not be correct.
Before presenting the input variables for this dataset, we discuss two
important physical parameters relevant to this dataset.
* Diagonalization of Kohn-Sham Hamiltonian: As in the case of DFT+DMFT or _GW_ calculation, a cRPA calculation requires that the LDA is perfectly converged and the Kohn Sham eigenstates are precisely determined, including the empty states. Indeed these empty states are necessary both to build Wannier functions and to compute the polarizability. For this reason we choose a very low value of [[tolwfr]] in the input file tucrpa_1.in.
* Diagonalization of Kohn-Sham Hamiltonian: As in the case of DFT+DMFT or _GW_ calculation, a cRPA calculation requires that the LDA is perfectly converged and the Kohn Sham eigenstates are precisely determined, including the empty states. Indeed these empty states are necessary both to build Wannier functions and to compute the polarizability. For this reason we choose a very low value of [[tolwfr]] in the input file tucrpa_1.abi.
* Wannier functions: Once the calculation is converged, we compute Wannier functions, as in a DFT+DMFT calculation. To do this, we only precise that we are using the DFT+DMFT implementation (usedmft=0), but only with the Wannier keywords ([[dmftbandi]] and [[dmftbandf]]). We emphasize that with respect to the discussion on models on section 3.1, [[dmftbandi]] and [[dmftbandf]] are used to define the so called A bands. We will see in dataset 2 how B bands are defined. In our case, as we are in the _d-d_ model, we choose only the _d_ -like bands as a starting point and [[dmftbandi]] and [[dmftbandf]] are thus equal to the first and last _d_ -like bands, namely 21 and 25.
@ -457,7 +455,7 @@ interaction computed on Wannier orbitals.
We give here the results of some convergence studies, than can be made by the
readers. Some are computationally expensive. It is recommanded to use at least
32 processors. Input files are provided in *tucrpa_3.in* and *tucrpa_3.files* for the first case.
32 processors. Input file is provided in *tucrpa_3.abi* for the first case.
### 4.1 Cutoff in energy for the polarisability [[ecuteps]]
@ -571,8 +569,8 @@ agreement (within 0.1 or 0.2 eV) with results obtained in Table V of
[[cite:Amadon2014]] and references cited in this table.
To obtain the results with only the _t<sub>2g</sub>_ orbitals, one must use a specific
input file, which is tucrpa_4.in, which uses specific keywords, peculiar to
this case (compare it with tucrpa_2.in). In this peculiar case, the most
input file, which is tucrpa_4.abi, which uses specific keywords, peculiar to
this case (compare it with tucrpa_2.abi). In this peculiar case, the most
common definition of J has to be deduced by direct calculation from the
interaction matrices using the Slater Kanamori expression (see e.g.
[[cite:Lechermann2006]] or [[cite:Vaugier2012]]) and not using the value of _J_ computed in the code).
@ -616,7 +614,7 @@ decrease the computational cost.
freqspmax4 30 eV
freqspmin4 0 eV
An example of input file can be found in *tucrpa_5.in*. Note that we have
An example of input file can be found in *tucrpa_5.abi*. Note that we have
decreased some parameters to speed-up the calculations. Importantly, however,
we have increased the number of Kohn Sham bands, because calculation of
screening at high frequency involves high energy transitions which requires

View File

@ -23,9 +23,9 @@ The linear response method has been introduced by several authors
[[cite:Cococcioni2002]], [[cite:Cococcioni2005]],[[cite:Dederichs1984]],[[cite:Hybertsen1989]],
[[cite:Anisimov1991]],[[cite:Pickett1998]].
It is based on the fact that *U* corresponds to the energy to localize an additional
electron on the same site: *U=E[n+1]+E[n-1]-2E[n]* [[cite:Hybertsen1989]]. This can be reformulated
electron on the same site: $U=E[n+1]+E[n-1]-2E[n]$ [[cite:Hybertsen1989]]. This can be reformulated
as the response to an infinitesimal change of of occupation of the orbital by
the electrons dn. Then *U* is the second derivative of the energy with respect
the electrons $dn$. Then *U* is the second derivative of the energy with respect
to the occupation $U=\frac{\delta^2 E}{\delta^2 n}$. The first method fixed the occupation by
cutting the hopping terms of localized orbitals. Later propositions
constrained the occupation through Lagrange multipliers [[cite:Dederichs1984]],[[cite:Anisimov1991]]. The Lagrange
@ -72,27 +72,27 @@ for the other tutorials. Why not Work_udet?*
You can compare your results with reference output files located in
$ABI_TESTS/tutorial/Refs directory (for the present tutorial they are named tudet*.abo).
The input file *tudet_1.in* is an example of a file to prepare a wave function
The input file *tudet_1.abi* is an example of a file to prepare a wave function
for further processing. The corresponding output file is ../Refs/tudet_1.abo).
Copy the files *tudet_1.in* in your work directory, and run ABINIT:
Copy the files *tudet_1.abi* in your work directory, and run ABINIT:
```sh
cd $ABI_TESTS/tutorial/Input
mkdir Work_udet
cd Work_udet
cp ../tudet_1.in .
cp ../tudet_1.abi .
abinit tudet_1.in > log 2> err &
abinit tudet_1.abi > log 2> err &
```
In the meantime, you can read the input file and see that this is a usual
DFT+U calculation, with *U*=0.
{% dialog tests/tutorial/Input/tudet_1.in %}
{% dialog tests/tutorial/Input/tudet_1.abi %}
This setting allows us to read the occupations of
the Fe 3d orbitals ([[lpawu]] 2). The cell contains 2 atoms. This is the
the Fe $3d$ orbitals ([[lpawu]] 2). The cell contains 2 atoms. This is the
minimum to get reasonable response matrices. We converge the electronic
structure to a high accuracy ([[tolvrs]] 10d-12), which usually allows one to
determine occupations with a precision of 10d-10. The [[ecut]] is chosen very low,
@ -101,14 +101,14 @@ We do not suppress the writing of the *WFK* file, because this is the input for
the calculations of U.
Once this calculation has finished, run the second one:
Copy the file *tudet_2.in* in your work directory, and run ABINIT:
Copy the file *tudet_2.abi* in your work directory, and run ABINIT:
abinit tudet_2.in > tudet_2.log
abinit tudet_2.abi > tudet_2.log
{% dialog tests/tutorial/Input/tudet_2.in %}
{% dialog tests/tutorial/Input/tudet_2.abi %}
As you can see from the *tudet_2.in* file, this run uses the *tudet_1o_WFK* as
an input (as indata_prefix = "tudet_1.o"). In the *tudet_2.in* all the symmetry relations are specified
As you can see from the *tudet_2.abi* file, this run uses the *tudet_1o_WFK* as
an input (as indata_prefix = "tudet_1.o"). In the *tudet_2.abi* all the symmetry relations are specified
explicitly. In the *tudet_2.log* you can verify that none of the symmetries
connects atoms 1 with atom 2:
@ -131,7 +131,7 @@ You can generate these symmetries, in a separate run, where you specify the
atom where the perturbation is done as a different species. From the output
you read the number of symmetries ([[nsym]]), the symmetry operations
([[symrel]]) and the non-symmorphic vectors ([[tnons]]). This is already
done here and inserted in the *tudet_2.in* file. Note that you can alternatively
done here and inserted in the *tudet_2.abi* file. Note that you can alternatively
disable all symmetries with [[nsym]] = 1, or break specific symmetries by
displacing the impurity atom in the preliminary run. However, for the
determination of *U*, the positions should be the ideal positions and only the
@ -158,18 +158,24 @@ Self-consistency was reached twice: Once for a positive shift, once for the nega
The lines starting with URES
URES ii nat r_max U(J)[eV] U_ASA[eV] U_inf[eV]
URES 1 2 4.69390 3.86230 3.10778 2.71714
URES 2 16 9.38770 7.28001 5.85781 5.12150
URES 3 54 14.08160 7.60740 6.12125 5.35182
URES 4 128 18.77540 7.67626 6.17665 5.40026
URES 5 250 23.46930 7.69849 6.19454 5.41590
URES 1 2 4.69390 3.86321 3.10851 2.71778
URES 2 16 9.38770 7.28015 5.85793 5.12160
URES 3 54 14.08160 7.60761 6.12142 5.35197
URES 4 128 18.77540 7.67652 6.17686 5.40045
URES 5 250 23.46930 7.69879 6.19478 5.41611
contain *U* for different supercells. The column "nat" indicates how many atoms
were involved in the supercell, r_max indicates the maximal distance of the
contain *U* for different supercells. These values of $U$ are computed using the extrapolation
procedure proposed in [[cite:Cococcioni2005]]. In this work, it is shown that using a two atom supercell for the DFT calculation
and an extrapolation procedure allows a estimation of the value of $U$. More precise values can be obtained
using a larger supercell for the DFT calculation and an extrapolation. For simplicity, in this tutorial, we restrict to
the two atoms supercell for the DFT calculation.
The column "nat" indicates how many atoms
were involved in the extrapolated supercell, r_max indicates the maximal distance of the
impurity atoms in that supercell. The column *U* indicates the actual *U* you
calculated and should use in your further calculations. U_ASA is an estimate
of *U* for more extended projectors and U_\inf is the estimate for a projector
of *U* for more extended projectors and U_inf is the estimate for a projector
extended even further.
Although it is enough to set [[macro_uj]] 1, you can further tune your runs.
@ -211,12 +217,12 @@ to specify the maximum total number of atoms in the supercell. Then, run *ujdet*
grep URES ujdet.out
URES ii nat r_max U(J)[eV] U_ASA[eV] U_inf[eV]
URES 1 2 4.69390 3.86230 3.10778 2.71714
URES 2 16 9.38770 7.28001 5.85781 5.12150
URES 3 54 14.08160 7.60740 6.12125 5.35182
URES 4 128 18.77540 7.67626 6.17665 5.40026
URES 5 250 23.46930 7.69849 6.19454 5.41590
URES 6 432 28.16310 7.70781 6.20204 5.42246
URES 1 2 4.69390 3.86321 3.10851 2.71778
URES 2 16 9.38770 7.28015 5.85793 5.12160
URES 3 54 14.08160 7.60761 6.12142 5.35197
URES 4 128 18.77540 7.67652 6.17686 5.40045
URES 5 250 23.46930 7.69879 6.19478 5.41611
URES 6 432 28.16310 7.70813 6.20230 5.42268
As you can see, *U* has now been extrapolated to a supercell containing 432 atoms.

View File

@ -52,23 +52,16 @@ Before starting make sure that you compiled abinit enabling Wannier90.
You may have to recompile the code with
```
configure --with-config-file=myconf.ac
configure --with-config-file=myconf.ac9
```
where *myconf.ac* defines:
where *myconf.ac9* defines:
```sh
# Flavor of the DFT library to use (default is atompaw+bigdft+libxc+wannier90)
#Install prefix of the PSML I/O library (e.g.
# /usr/local).
with_wannier90="/usr/local"
with_dft_flavor="wannier90"
# Include flags for the Wannier90 library (default is unset)
#
#with_wannier90_incs="-I/usr/local/include/wannier90"
# Link flags for the Wannier90 library (default is unset)
#
#with_wannier90_libs="-L${HOME}/lib/wannier90 -lwannier90"
```
Now we will compute a set of MLWFs for silicon.
@ -76,14 +69,13 @@ We are going to extract the Wannier functions corresponding to the four valence
*Before beginning, you might consider to work in a different sub-directory as
for the other tutorials. Why not Work_w90?*
Then copy the files file *tw90_1.files*, *tw90_1.in* and *wannier90.win* from
Then copy the files *tw90_1.abi* and *wannier90.win* from
the *$ABI_TESTS/tutoplugs/Input* directory to *Work_w90*:
cd $ABI_TESTS/tutoplugs/Input
mkdir Work_w90
cd Work_w90
cp ../tw90_1.files .
cp ../tw90_1.in .
cp ../tw90_1.abi .
Wannier90 also uses a secondary input file called *wannier90.win*.
Therefore, you must include this file in the folder:
@ -92,11 +84,11 @@ Therefore, you must include this file in the folder:
Now you are ready to run abinit. Please type in:
abinit < tw90_1.files > log 2> err &
abinit tw90_1.abi > log 2> err &
Let's examine the input file *tw90_1.in*, while the calculation is running.
Let's examine the input file *tw90_1.abi*, while the calculation is running.
{% dialog tests/tutoplugs/Input/tw90_1.in %}
{% dialog tests/tutoplugs/Input/tw90_1.abi %}
The input file should look familiar to you. It is indeed the primitive cell of silicon.
It has two data sets: first a SCF calculation and then a NSCF calculation which
@ -166,8 +158,9 @@ You will obtain a table of the following form:
+--------------------------------------------------------------------+<-- CONV
| Iter Delta Spread RMS Gradient Spread (Ang^2) Time |<-- CONV
+--------------------------------------------------------------------+<-- CONV
0 0.492E+02 0.0000000000 49.1838608828 0.09 <-- CONV
1 -0.947E+01 22.7791321117 39.7138163954 0.09 <-- CONV
0 0.438E+02 0.0000000000 43.7939618280 0.08 <-- CONV
1 -0.946E+01 10.5484513508 34.3387915333 0.09 <-- CONV
You can verify that the final spread you get is around 4.0 Å$^2$.
@ -234,15 +227,14 @@ Before starting it is assumed that you have already completed the tutorials [PAW
For silicon, we just have to add the variable [[pawecutdg]] and the PAW Atomic Data is included in the pseudopotential file.
An example has already been prepared.
Just copy the files *tw90_2.files* and *tw90_2.in* into *Work_w90*:
Just copy the file *tw90_2.abi* into *Work_w90*:
cp ../tw90_2.files .
cp ../tw90_2.in .
cp ../tw90_2.abi .
We are going to reuse the wannier90.win of the previous example.
Now, just run abinit again
abinit < tw90_2.files > log 2> err &
abinit tw90_2.abi > log 2> err &
As it is expected, the results should be similar than those of the PW case.
@ -262,18 +254,17 @@ a very accurate starting guess to get the MLWF.
We are going to extract the $sp^3$ hybrid orbitals of Silane SiH$_4$. You can start
by copying from the tests/tutoplugs directory the following files:
cp ../tw90_3.files .
cp ../tw90_3.in .
cp ../tw90_3.abi .
cp ../tw90_3o_DS2_w90.win .
Now run abinit
abinit < tw90_3.files > log 2> err &
abinit tw90_3.abi > log 2> err &
While it is running, we can start to examine the input files.
Open the main input file *tw90_3.in*. The file is divided into three datasets.
Open the main input file *tw90_3.abi*. The file is divided into three datasets.
{% dialog tests/tutoplugs/Input/tw90_3.in %}
{% dialog tests/tutoplugs/Input/tw90_3.abi %}
First a SCF calculation is done. What follows is a NSCF calculation including
more bands. Finally, in the third dataset we just read the wavefunction from
@ -307,9 +298,9 @@ Now we will redo the silicon case but defining different initial projections.
This calculation will be more time consuming, so you can start by running the
calculation while reading:
cp ../tw90_4.in .
cp ../tw90_4.files .
cp ../tw90_4.abi .
cp ../tw90_4o_DS3_w90.win .
abinit tw90_4.abi > log 2> err &
**Initial projections:**
@ -325,13 +316,11 @@ the .amn file will be reduced.
**Interpolated band structure**
We are going to run Wannier90 in standalone mode. Just comment out the first
two lines of the **.win** file:
We are going to run Wannier90 in standalone mode. Just comment out the following
lines of the **.win** file:
postproc_setup = .true. !used to write .nnkp file at first run
num_iter = 100
wannier_plot = .true.
wannier_plot_supercell = 3
And uncomment the following two lines:

Binary file not shown.

Before

Width:  |  Height:  |  Size: 162 KiB

After

Width:  |  Height:  |  Size: 69 KiB

View File

@ -328,7 +328,7 @@ copyright: Copyright &copy; 2020-2021 The Abinit Group
google_analytics: ['UA-116681470-1', 'docs.abinit.org']
extra:
version: 9.3.3
version: 9.3.4
previous_published_versions: [] #8.2.0
social:
- type: github-alt

View File

@ -11,10 +11,12 @@ version = '1.3'
# : defined a second angletol to distinguish between specialkpt detection and segment construction
#===================================
# ********* no longer used or maintained *******
#=====================================================================================================================================================================
#IMPORTS
import os
import re
import sys
import time
from numpy import *
@ -811,6 +813,7 @@ if ctrl.filetype == 'out':
#------------------------------
parser_template = '{}\d?\s?=?\s*([\d.E+]+)'
#compute k-points and energy eigenvalues for each dataset
starter = ctrl.filedata[:ctrl.datasetlocation[0][2]-1]
for d in range(len(ctrl.useddataset)):
@ -825,7 +828,8 @@ if ctrl.filetype == 'out':
datasetkey.append(['ecut:'])
for i in range(len(starter)):
if starter[i].split()[0] == 'ecut%s' %n or starter[i].split()[0] == 'ecut':
datasetkey[-1].append(float(starter[i].split()[1]))
value = float(re.search(parser_template.format('ecut'), starter[i]).group(1))
datasetkey[-1].append(value)
if len(datasetkey[-1]) == 1:
datasetkey[-1].append('notfound')
@ -833,10 +837,8 @@ if ctrl.filetype == 'out':
datasetkey.append(['natom:'])
for i in range(len(starter)):
if starter[i].split()[0] == 'natom%s' %n or starter[i].split()[0] == 'natom':
if starter[i].split()[1] == '=':
datasetkey[-1].append(float(starter[i].split()[2]))
else:
datasetkey[-1].append(float(starter[i].split()[1]))
value = float(re.search(parser_template.format('natom'), starter[i]).group(1))
datasetkey[-1].append(value)
if len(datasetkey[-1]) == 1:
datasetkey[-1].append(float(1)) #default
@ -844,7 +846,8 @@ if ctrl.filetype == 'out':
datasetkey.append(['nband:'])
for i in range(len(starter)):
if starter[i].split()[0] == 'nband%s' %n or starter[i].split()[0] == 'nband':
datasetkey[-1].append(float(starter[i].split()[1]))
value = float(re.search(parser_template.format('nband'), starter[i]).group(1))
datasetkey[-1].append(value)
if len(datasetkey[-1]) == 1:
datasetkey[-1].append(float(1)) #default
@ -852,7 +855,8 @@ if ctrl.filetype == 'out':
datasetkey.append(['occopt:'])
for i in range(len(starter)):
if starter[i].split()[0] == 'occopt%s' %n or starter[i].split()[0] == 'occopt':
datasetkey[-1].append(float(starter[i].split()[1]))
value = float(re.search(parser_template.format('occopt'), starter[i]).group(1))
datasetkey[-1].append(value)
if len(datasetkey[-1]) == 1:
datasetkey[-1].append(float(1)) #default

Some files were not shown because too many files have changed in this diff Show More