* Routines tagged with "@type_name" are tightly connected to the definition of the data type.
Tightly connected means that the proper functioning of the implementation relies on the
assumption that the tagged procedure is consistent with the type declaration.
Every time a developer changes the structure "type_name" adding new entries, he/she has to make sure
that all the tightly connected routines are changed accordingly to accommodate the modification of the data type.
Typical examples of tightly connected routines are creation, destruction or reset methods.

m_paw_slater/paw_mkdijexc_core [ Functions ]

Driver routine to calculate the onsite matrix element of the Fock operator between two
all-electron partial waves.

INPUTS

ndij=Usually ndij=nspden, except for spin-orbit (where ndij=nspinor**2)
cplex_dij=1 if dijexc_core is real, 2 if they are complex
lmn2_size_max=Max Number of (klmn) channels over type of atoms.
Cryst<crystal_t>=Structure describing the crystal structure and its symmmetries.
Pawtab(ntypat)<pawtab_type>=paw tabulated starting data
Pawrad(ntypat)<pawrad_type>=paw radial mesh and related data
pawprtvol=Flags governing the verbosity of the output.
filpsp(ntypat)=names of the files containing the all-electron core WF

m_paw_slater/slatang_cshell_init [ Functions ]

l_max= max. value of ang. momentum l+1;
Gaunt coeffs up to [(2*l_max-1,m),(l_max,m),(l_max,m)] are computed
lc_max=Max Lc+1 for core states used to contrusct \Sigma_x^\core.
lm2_size=Number of symmetrix elements in the (l,m) basis set.
NB: lm2_size = (l_max**2)*(l_max**2+1)/2.
klm2lm(6,lm2_size)=Table giving il, jl ,im, jm, ilm and jlm for each klm=(ilm,jlm)
where ilm=(il,im) and ilm<=jlm. NB: klm2lm is an application and not a bijection.

Selection rules for F
1) mi = mj
2) In the case of closed shells, one sums for all possible mc"s values from -lc up to +lc.
In this particular case, one can use the symmetry properties of Clebsch-Gordan
coefficients to show that F is non null only if li==lj. In particular, F can be rewritten as:
$ F^{ilsl,ilc}_{klm} = \delta{li,lj}\delta{mi,mj} \times
\Gaunt^{lsl,0}_{lc,0;li,0} \sqrt{ \dfrac{(2*lc+1) (2*lsl+1)}{4\pi*(2*li+1)} } $

m_paw_slater/slatang_cshell_t [ Types ]

Object used to store:
$ F^{lsl,lc}_{li,lj,mi,mj} = sum_{msl mc} \<li mi|lsl msl;lc mc\> \<lsl msl;lc mc| lj mj\> $
This (less general) type of radial integral is needed to evaluate the Exchange term generated
by a closed-shell atom. In the equation, (lc,mc) are the set of angular quantum number associated
to (closed) core electrons while (lsl,msl) comes from the expansion of 1/|r1-r2|.
Since the F is invariant under exchange of i and j we use an array of structures indexed
by kln = (iln,jln) in packed form.

m_paw_slater/slatrad_cshell_t [ Types ]

Object used to store the set of radial integrals:
$ \dfrac{4\pi}{2L+1} \times
\int \phi_{\ni\li}(1) \phic_{\nc\lc}(1) \dfrac{r_<^L}{r_>^{L+1}} \phic_{\nc\lc}(2) \phi_{\nj\lj} d1d2 $
for given (in,il) and (jn,jl) as a function L = |il-jl|, |il-jl|+2, ..., |il+il| and ilnc = (lc,nc).
This (less general) type of radial integral is needed to evaluate the Exchange term generated
by a closed-shell atom. In the equation, (\nc,\lc) are the set of angular quantum number associated
to core electrons while (lsl,msl) comes from the expansion of 1/|r1-r2|.
Since the F is invariant under exchange of i and j we use an array of structures indexed
by kln = (iln,jln) in packed form.

Slater integrals S_ij are invariant under exchage of the indeces,
but the results reported by calc_slatradl are not due to numerical roundoff errors (err < 10^-9).
However this does not cause any problem since only the upper triangle of the S_ij matrix
is stored and used in the other routines.

Basic symmetry properties:
1) invariant under the exchange (i<-->j) and (k<-->l).
2) invariant under the exchange (i,j) <--> (k,l).
Memory saving is achieved by storing the upper triangle of the (ij) (kl) matrix
and, for each dimension, only the upper triangle of the two matrices (iln,jln) (kln,lln).
Some matrix elements will never contribute to <ij|1/|1-2||kl> due to selection rules
introduced by the integration of the angular part.