Davide Sangalli wrote:The matrix stored includes also the non-analytical term if I'm not mistaken, at least if you compute X at the RPA level or beyond.

I think the non-analytical contribution maybe avoided commenting line 238 in src/pol_function/X_dielectric_matrix.F

But I'm not 100% sure, I should check ...

The G vectors are shared among all q.

The code has a big gamma centered sphere (the one which is used for example for the density in QE) and smaller (i.e. with lower cut-off, factor 4) k-centered spheres for the WFs.

When computing X_{G,G'} convolutions in G space are done between WFs centered at different k (i.e. at k and at k-q) so the bigger gamma centered shell is used in practice for both G and G'. The latter contains both the shell at k and the (convoluted) shell at k-q for all k.

The cut-off is imposed on the biggest shell. The WFs are used in real-sapce, so instead of a convolution in practice a product in real-space is done and, after that, and FFT in the big shell. I think this should respect all the symmetries.

D.

Thanks very much. So I figured out what the issue is:

The dielectric matrix element and its symmetry, mainly relies on |q+G|, while the biggest shell is in the order of |G| and has cutoff. In general, sorting by |q+G| and by |G| give different orders. So after cutoff, if given two lists of the same number of G vectors, one in order of |q+G| and another in |G|, to write down the dielectric matrix, the first will have full symmetry but the second will miss some G-vectors in outer shell that breaks the symmetry.

But the outer shell affect least to the final result, so if converged then this symmetry breaking has no effect at all.

The calculation of matrix elements itself always respect all symmetries and there is no issues here.

Best,

Feng