### External module functions drixs1 - used by mcdisp

Very similar to the inelastic neutron scattering (module function dmq1) the Resonant inelastic X-ray scattering cross sections in the program mcdisp can be done with module functions drixs1 and estates. The input of drixs1 has similar arguments as du1calc, but as additional argument an orientation of the scattering vector, output should be a corresponding vector . Here with are the 9 components of the RIXS scattering operator, see equ (65). drixs1 is called many times, for every scattering vector. In order to do an efficient calculation the eigenstates should be calculated only once, this is the task of function estates (see above).

The format to be used is:

extern "C" int drixs1(int & tn,double & th,double & ph,double J0,
double & J2, double & J4, double & J6,ComplexMatrix & est,double & T,
ComplexVector & rixs, float & maxE)


The meaning of the symbols is as follows:

on input
|tn|            transition-number
sign(tn)        >0 standard with printouts for user information,
<0 routine should omit any printout
th              polar angle theta of the scattering vector Q
(angle with the axb axis=c axis) in rad
ph              polar angle phi of the scattering vector Q
(angle with bx(axb)=a in the projection into
the  bx(axb),b plane = angle with a in the projection into
J0,J2,J4,J6     form factor functions <jn(Q)>
est             eigenstate matrix (as calculated by estates),
it should also contain population numbers of the states (row 0)
T               Temperature[K]
rixs(1)           ninit + i pinit (from mcdisp options  -ninit and -pinit)
maxE            maximum transition energy (from mcdisp option maxE)
on output
int             total number of transitions
rixs            vector rixs(alpha)=<-|Ralpha|+>sqrt(p- - p+)
with alpha=1,..9=xx, xy ,xz, yx, yy, yz, zx,zy, zz

Note on coordinate system:
x||bx(axb)
y||b
z||axb


The module function must perform the following tasks:

1. for the transition number tn the vector mq1 is to be filled with the 9-components of , i.e. for . IMPORTANT: the numbering scheme of transitions has to be the same for du1calc and all the corresponding d...1 functions for observables !
2. If the energy of this transition is zero, i.e. (diffuse scattering), the would be zero because vanishes (compare expression (195)). In this case the single ion module should calculate instead of .
3. if all quantities should be evaluated assuming that all Boltzmann probabilities are zero except for the state number , for which the probability .

Martin Rotter 2017-01-10