All about Programming External Single Ion Modules

Single ion properties can be described in a very flexible way by user programmed single ion module functions, which are loaded at runtime.

The first line in such a single ion property file must contain the filename of the loadable module, in the following example the file ./1ion_mod/kramer.so:

#!./1ion_mod/kramer.so
#<!--mcphas.sipf-->
# single ion parameter file for CeCu2
# there follow some module parameters (up to 9) which are 
# loaded at initialisation of the module
nof_electrons=1
MODPAR1=1.6
MODPAR2=0.58333
MODPAR3=1.1

...

If the first line refers not to an internal module, but to a loadable module file, the single ion properties are calculated using functions in this module file.

In the following sections the different functions are presented which need to be present in the loadable module in order to run the programs. All functions have to be present, but only formally. If a function is not implemented please just let print out a message and exit. The corresponding programs will not work then. Table 4 lists all functions which can be implemented in a loadable module. There are two groups of functions: (i) basic module functions, which provide the information about the interaction operators $\hat \mathbf I$ and their transition matrix elements. These are used to solve the meanfield Hamiltonian and calculate the excitation energies (using the DMD method). (ii) module functions for observables - these are used to generate output for different observables, such as neutron cross sections, magnetic moments, chargedensities etc.


Table 4: External Single ion module functions in the context of the McPhase programs.
Module - Function obligatory for optional for description
Basic Functions      
void Icalc mcphas   calculates $\langle \hat \mathbf I \rangle$
  singleion    
Icalc_parameter_storage_matrix_init   mcphas parameter storage for Icalc,mcalc etc
(void)   mcdiff  
    singleion  
    spins  
    densplt  
int du1calc mcdisp   calculates $\langle -\vert\hat \mathbf I\vert+\rangle\sqrt{(p_--p_+)}$
    singleion  
void estates   mcdiff parameter storage for du1calc,dm1,dS1,...
    singleion  
    mcdisp  
Observables      
void mcalc   mcdiff magnetic moment $\langle\hat \mathbf M\rangle$
    mcphase  
int dm1   mcdisp $\langle-\vert \hat\mathbf M\vert+\rangle\sqrt{(p_--p_+)}$
void Lcalc   mcdiff orbital ang. momentum $\langle \hat \mathbf L\rangle$
    mcphase  
int dL1   mcdisp $\langle-\vert \hat\mathbf L\vert+\rangle\sqrt{(p_--p_+)}$
void Scalc   mcdiff spin $\langle \hat\mathbf S\rangle$
    mcphase  
int dS1   mcdisp $\langle-\vert\hat \mathbf S\vert+\rangle\sqrt{(p_--p_+)}$
void mqcalc   mcdiff FT of magnetic moment $\langle\hat \mathbf M(\mathbf Q)\rangle$
int dmq1   mcdisp $\langle-\vert\hat \mathbf M(\mathbf Q)\vert+\rangle\sqrt{(p_--p_+)}$
int drixs1   mcdisp RIXS transition operator $\hat \mathbf R$,eq. (65)
void pcalc   mcphas phononic displacement $\langle \hat \mathbf P\rangle$
nt dP1   mcdisp phonon displacement (Å) $\langle-\vert\hat \mathbf P\vert+\rangle\sqrt{(p_--p_+)}$
void chargedensity_coeff densplt -c   coeff of $-\vert e\vert Z_l^m(\Omega)R^2(r)$ in equ.(210)
  spins -c   i.e. $\langle\sum_i Z_l^m(\Omega_i)\rangle$
  display_density c    
  display_densities -c    
int dchargedensity_coeff1   mcdisp $\langle-\vert\sum_i Z_l^m(\Omega_i)\vert+\rangle\sqrt{(p_--p_+)}$
void spindensity_coeff -”- -s   coeff of $Z_l^m(\Omega)R^2(r)$
int dspindensity_coeff1   mcdisp  
void orbmomdensity_coeff -”- -m$\vert$-o$\vert$-j   coeff of $Z_l^m(\Omega)F(r)$
int dorbmomdensity_coeff1   mcdisp  
double ro_calc   densplt -c chargedensity (instead of expansion coeff)
    spins -c - will always be used if present
    display_density c  
    display_densities -c  

Note, in case of non-orthogonal axes the convention for the components of the external applied field $\mathbf H$, the mean field, the magnetic moment components, the polarisation vectors etc. to be adopted in programming a single ion module is $H_2\vert\vert\vec b$, $H_3\vert\vert(\vec a \times \vec b)$ and $H_1$ perpendicular to $H_2$ and $H_3$ (here $\vec a$,$\vec b$,$\vec c$ denote the lattice vectors of the crystal structure as specified by the lattice constants $a,b,c$ and the angles $\alpha,\beta,\gamma$ in mcphas.j).



Subsections