Momentum matrix elements

Greeting to the developers and all users of Exciting,
I would like to obtain matrix elements of momentum operator between selected core state and all valence, conduction states to use it in my own further calculations.
As far as I understood, please, kindly correct me if I am wrong, I can implement XAS calculation for that as described here, for example, X-Ray Absorption Spectra Using BSE - exciting
Then in the intermediate step the array pmatc(3,ncg,nstfv or nstsv) is created, where ncg is the number of core state under consideration (ncg = 2 for 1s state, for example, cause there is two different relativistic quantum numbers) and nstfv = valence+nempty+1 so this dimension is defined by the number of valence states, conduction states from parameter nempty in the input file.
My question is why the last dimension is valence+nempty+1 and not just valence+nempty?
Was I right in my statements above or it makes no sense? And if it is true where matrix pmatc(3,ncg,nstfv or nstsv) is stored?
As it makes sense for me one needs to calculate momentum matrix elements between Kohn-Sham orbitals inside muffin-tin and core “Kohn-Sham orbitals” which is built from core electron major component, like here, for example: Phys. Rev. B 95, 155121 (2017) - Addressing electron-hole correlation in core excitations of solids: An all-electron many-body approach from first principles
However, I haven’t found in the subroutine genpmatcorxs.f90 any presence of summation over lattice vectors or is it somewhere else?
Looking forward to your answers and discussions=)

Dear Tatiaana,

What you are looking for is the routine writepmatasc.f90. You can triger it with the plan element in the xs-part of the input file:

   <doonly task="xsgeneigvec"/>
   <doonly task="writepmatasc"/>

Just leave the the rest as it is. This will produce the formatted file PMAT_XS_ASC.OUT.

1 Like

Thank you for the answer.
I have tried to execute it several times.
However, It gives signal SIGSEGV: Segmentation fault - invalid memory reference or similar.
Particular error message depends on the machine.
Do you know what it might be? Why does segmentation fault occur?