External module function orbmomdensity_coeff - used by densplt, spins, display_density,display_densities

In order to calculate orbital moment densities the following function has to be present in the module file *.so:

extern "C" void orbmomdensity_coeff(Vector &aLlm, int & xyz, double *T,Vector &Hxc, 
   Vector & Hext,double *gJ,Vector &MODPAR,char **sipffilename,ComplexMatrix & Icalc_parstorage);

Note for windows users with MINGW the declaration should be extern "C" __declspec(dllexport) void orbmomdensity_coeff(...).

The meaning of the symbols is as follows:

  on input
    xyz         direction index 1,2,3 = x,y,z (component for the spindensity vector to be calculated)
    T           temperature[K]
    Hxc         vector of exchange field [meV] (can be n-dimensional, for a set of n operators)
    Hext        external magnetic field [T]
    gJ          Lande factor
    MODPAR      Vector with Parameters  read in single ion property file
    sipffilename    file name of the single ion parameter file
    Icalc_parstorage parameter matrix (initialized by Icalc_parameter_storage_matrix_init)
                   it should/may contain any information, e.g. population numbers of the
				   states (imaginary part of row 0)
                   and eigenvalues (real part of row 0) with values set by the most recent call
                   for this ion (use of this matrix is optional)
  on output
    aLlm         Output single ion moments =expectation values of
                coefficients of Zlm F(r) at a given temperature T and
                effective field H

The module function must perform the following tasks:

  1. calculate the coefficients of $Z_l^m F(r)$ in the expansion of the orbital moment density vector $M^L_{x,y,z}=\sum_{l,m} a^{x,y,z}_{L,lm} Z_l^m F(r)$ The output Vector alm(1,...,49) should contain $a^{x,y,z}_{L,lm}$ in the following order (lm): 00,1-1, 10,11, 2-2, 2-1,20,21,22, 3-3, 3-2, ...,65,66
  2. if $T<0$ all quantities should be evaluated assuming that all Boltzmann probabilities $p_i$ are zero except for the state number $n=(-T)$, for which the probability $p_n=1$.

Note the definition of $F(r)$ in terms of the radial wave function $R(r)$ is


\begin{displaymath}
F(r)=\frac{1}{r}\int_r^{\infty} R^2(\xi)d\xi
\end{displaymath} (76)

Martin Rotter 2017-01-10