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

In order to calculate the chargedensity, the expansion coefficients have to be evaluated and the following function has to be present in the module file *.so:

extern "C" void chargedensity_coeff(Vector & cd,double * T, Vector & Hxc, Vector & Hext,
                      double * gJ, Vector & MODPAR,
                      char ** sipffilename, ComplexMatrix & Icalc_parstorage);

it works exactly as mcalc with the only modification that the vector cd has 28 components, therefore we do not give more details here.

The module function must perform the following task:

  1. calculate the coefficients of $-\vert e\vert Z_l^m R^2(r)$ in the expansion of the charge density in equation (175). The output Vector cd(1,...,28) should contain coefficients (i.e. $\langle\sum_i Z_l^m(\Omega_i)\rangle$) in the following order (lm): 00, 2-2, 2-1,20,21,22, 4-4, 4-3,..,44,6-6,6-5 ...,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$.

Martin Rotter 2017-01-10