Copyright (C) 2013-2018 ABINIT group (MT, FJ, BA, JWZ)
This file is distributed under the terms of the
GNU General Public License, see ~abinit/COPYING
or http://www.gnu.org/copyleft/gpl.txt .
For the initials of contributors, see ~abinit/doc/developers/contributors.txt.

NOTES

FOR DEVELOPPERS: in order to preserve the portability of libPAW library,
please consult ~abinit/src/??_libpaw/libpaw-coding-rules.txt

m_pawdij/pawdij [ Functions ]

Compute the pseudopotential strengths Dij of the PAW non local operator as sum of
several contributions. Can compute first-order strenghts Dij for RF calculations.
This routine is a driver calling, for each contribution to Dij, a specific
routines.
Within standard PAW formalism, Dij can be decomposd as follows:
Dij = Dij_atomic + Dij_Hartree + Dij_XC + Dij^hat
In case of additional approximations, several other terms can appear:
Dij_LDA+U, Dij_spin-orbit, Dij_local-exact-exchange, Dij_Fock...

m_pawdij/pawdij_print_ij [ Functions ]

Print out the content of a Dij matrix (total Dij) in a suitable format

INPUTS

dij(cplex_rf*cplex_dij*lmn2_size,ndij)= input matrix to be printed
cplex_dij=1 if Dij is real, 2 if Dij is complex
cplex_rf=1 if Dij contains no RF phase, 2 if it contains a exp(-iqr) RF phase
iatom=current atom
natom=total number of atoms in the system
nspden=number of spin density components
nsppol = number of spin polarizations
[Ha_or_eV]= 1: output in hartrees, 2: output in eV
[opt_prtvol]= >=0 if up to 12 components of _ij matrix have to be printed
<0 if all components of ij_ matrix have to be printed (optional)
[mode_paral]= parallel printing mode (optional, default='COLL')
[test_value]=(real number) if positive, print a warning when the magnitude of Dij is greater (optional)
[title_msg]=message to print as title (optional)
[unit]=the unit number for output (optional)

m_pawdij/pawdijexxc [ Functions ]

Compute the local Exact-Exchange contribution to the PAW pseudopotential strength Dij,
using a potential expressed as (l,m) spherical moments
(for one atom only; only for correlated electrons):
D_ij^EXXC= < Phi_i|alpha*(VFock(correlated)-Vxc(n1_correlated)|Phi_j>

m_pawdij/pawdijfr [ Functions ]

PAW, Response Function only:
Compute frozen part of psp strength Dij due to 1st-order compensation density
and first order local potential:
Dijfr =Int_R^3{vtrial*Sum_LM[Q_ij_q^LM^(1)] + Vloc^(1)*Sum_LM[Q_ij_q^LM]}
Depends on q wave vector but not on first-order wave-function.

m_pawdij/pawdiju_euijkl [ Functions ]

Compute the LDA+U contribution to the PAW pseudopotential strength Dij (for one atom only).
Alternative to pawdiju using the following property:
D_ij^pawu^{\sigma}_{mi,ni,mj,nj}=\sum_{k,l} [rho^{\sigma}_kl*e^U_ijkl]
The routine structure is very similar to the one of pawdijhartree.