em1s diagonal elements are not real

You can find here problems arising when using old releases of Yambo (< 5.0). Issues as parallelization strategy, performance issues and other technical aspects.

Moderators: Davide Sangalli, andrea.ferretti, myrta gruning, andrea marini, Daniele Varsano, Conor Hogan

Locked
wufeng
Posts: 24
Joined: Fri Dec 15, 2017 4:17 am

em1s diagonal elements are not real

Post by wufeng » Tue Feb 13, 2018 3:00 am

Dear all,
I recently tried to post-process the dielectric matrix, and found that the diagonal elements in .em1s database, which I assumed to be inverse dielectric matrix minus one, has a pretty large imaginary part, in the order of 1% of the real part. If inversed to get the dielectric matrix, the imaginary part is even larger, to 10% of the real part.
To my knowledge the diagonal elements could be real. Is there any transformation I am not aware of, or purely numerical error, or I misunderstood what is in the em1s? Thanks.

Best,
Feng
Feng Wu
Chemistry and Biochemistry department,
University of California, Santa Cruz
95064 CA, United States

User avatar
Daniele Varsano
Posts: 4231
Joined: Tue Mar 17, 2009 2:23 pm
Contact:

Re: em1s diagonal elements are not real

Post by Daniele Varsano » Wed Feb 14, 2018 10:45 am

Dear Feng,
.em1s database, which I assumed to be inverse dielectric matrix minus one,
Yes right, in the ndb.em1s it is contained the vX matrix element, so the eps^-1=1+vX.

The imaginary part in the diagonal element it is essentially due to the damping factor in Xo function (omega+DeltaE+i\eta) at the denominator: see Eq. 8 in the yambo paper.
If you reduce it in input file:

Code: Select all

% DmRngeXs
  0.10000 |  0.10000 | eV      # [Xs] Damping range
%
Reducing the damping value, it should reduce the imaginary part in the diagonal element.

Best,

Daniele
Dr. Daniele Varsano
S3-CNR Institute of Nanoscience and MaX Center, Italy
MaX - Materials design at the Exascale
http://www.nano.cnr.it
http://www.max-centre.eu/

wufeng
Posts: 24
Joined: Fri Dec 15, 2017 4:17 am

Re: em1s diagonal elements are not real

Post by wufeng » Fri Feb 16, 2018 8:27 am

Daniele Varsano wrote:Dear Feng,
.em1s database, which I assumed to be inverse dielectric matrix minus one,
Yes right, in the ndb.em1s it is contained the vX matrix element, so the eps^-1=1+vX.

The imaginary part in the diagonal element it is essentially due to the damping factor in Xo function (omega+DeltaE+i\eta) at the denominator: see Eq. 8 in the yambo paper.
If you reduce it in input file:

Code: Select all

% DmRngeXs
  0.10000 |  0.10000 | eV      # [Xs] Damping range
%
Reducing the damping value, it should reduce the imaginary part in the diagonal element.

Best,

Daniele

Thanks, reducing damping indeed reduces the imaginary part. With damping=0 the imaginary part is as small as 1e-10.
Feng Wu
Chemistry and Biochemistry department,
University of California, Santa Cruz
95064 CA, United States

wufeng
Posts: 24
Joined: Fri Dec 15, 2017 4:17 am

Re: em1s diagonal elements are not real

Post by wufeng » Fri Apr 06, 2018 3:22 am

Two additional questions:

1. Is the dielectric matrix stored symmetrized or not?

I found the upper and lower triangle are always the same (both real and imaginary part) so I wonder if the symmetrized dielectric matrix is stored or one of the half triangle is copied but not used.
From the code I think it is symmetrized but not sure.

2. What is the order of G vectors as the basis set of the dielectric matrix?

I though the basis set is exactly the same as k-point wavefunctions, but it is not always correct for q-points other than gamma point.
Seems there is a shift of all G-vectors, but not sure about it.

Thanks very much!
Feng Wu
Chemistry and Biochemistry department,
University of California, Santa Cruz
95064 CA, United States

User avatar
Daniele Varsano
Posts: 4231
Joined: Tue Mar 17, 2009 2:23 pm
Contact:

Re: em1s diagonal elements are not real

Post by Daniele Varsano » Sun Apr 08, 2018 4:35 pm

Dear Feng,
1. Is the dielectric matrix stored symmetrized or not?
Yes it is symmetrized.
What is the order of G vectors as the basis set of the dielectric matrix?
The order is the same as the wavefunctions. It is not very clear what you are observing, can you be more specific?
Best,
Daniele
Dr. Daniele Varsano
S3-CNR Institute of Nanoscience and MaX Center, Italy
MaX - Materials design at the Exascale
http://www.nano.cnr.it
http://www.max-centre.eu/

wufeng
Posts: 24
Joined: Fri Dec 15, 2017 4:17 am

Re: em1s diagonal elements are not real

Post by wufeng » Mon Apr 09, 2018 11:03 am

Daniele Varsano wrote:Dear Feng,
1. Is the dielectric matrix stored symmetrized or not?
Yes it is symmetrized.
What is the order of G vectors as the basis set of the dielectric matrix?
The order is the same as the wavefunctions. It is not very clear what you are observing, can you be more specific?
Best,
Daniele
I printed the dielectric matrix. The first 10 diagonal elements looks like this:

-0.471 -0.407 -0.407 -0.284 -0.284 -0.183 -0.183 -0.12 -0.12 -0.17 -0.471 -0.061 -0.163 -0.04 -0.058 -0.158 -0.158 -0.407 -0.407

However, according to QE wavefunctions, the first 2 G-vectors are symmetric, and then next 4. So the diagonal elements should have the same degeneracy.
And the G-vectors are sorted with norm so dielectric matrix diagonal should also be sorted approximately.
So it should be like:
-0.471 -0.471 -0.407 -0.407 -0.407 -0.407 ....

I thought R_lattice::g_vec is the G-vectors used for different k/q points, and compared QE gkvector and g_vec, but the order does not follow above even if mapping g_vec to QE gkvectors.

Thanks very much!

Best,
Feng
Feng Wu
Chemistry and Biochemistry department,
University of California, Santa Cruz
95064 CA, United States

User avatar
Davide Sangalli
Posts: 643
Joined: Tue May 29, 2012 4:49 pm
Location: Via Salaria Km 29.3, CP 10, 00016, Monterotondo Stazione, Italy
Contact:

Re: em1s diagonal elements are not real

Post by Davide Sangalli » Mon Apr 09, 2018 12:04 pm

Dear Feng,
it is just a guess, but did you consider that the dielectric matrix is computed along a specific q direction.
Even at q=0 there is a non analytical contribution which depends on the q-direction.
Thus the resulting matrix may not respect the symmetries of the lattice (?)

Also the io_X subroutine writes the G-vectors in the ndb.em1s file. (X_RL_vecs variable)
First the x-component of each vector is written then the y-components and finally the z-components.
Maybe it helps.

Best,
D.
Davide Sangalli, PhD
CNR-ISM, Division of Ultrafast Processes in Materials (FLASHit) and MaX Centre
https://sites.google.com/view/davidesangalli
http://www.max-centre.eu/

wufeng
Posts: 24
Joined: Fri Dec 15, 2017 4:17 am

Re: em1s diagonal elements are not real

Post by wufeng » Wed Apr 11, 2018 3:27 am

Davide Sangalli wrote:Dear Feng,
it is just a guess, but did you consider that the dielectric matrix is computed along a specific q direction.
Even at q=0 there is a non analytical contribution which depends on the q-direction.
Thus the resulting matrix may not respect the symmetries of the lattice (?)

Also the io_X subroutine writes the G-vectors in the ndb.em1s file. (X_RL_vecs variable)
First the x-component of each vector is written then the y-components and finally the z-components.
Maybe it helps.

Best,
D.

Dear Davide,
The electric field does not affect analytical part I think: the number of degenerate g-vectors agree with the symmetry, at least for small G-vectors.

Thanks for this information about X_RL_vecs. Is this X_RL_vecs shared between all q-points?
The order seems follows |G|, if it is shared across all q-points it means when q!=0 , shells of |q+G| are only partially included, then there may be missing G-vectors in a shell which breaks the degeneracy / symmetry of G-vectors.


Best,
Feng
Feng Wu
Chemistry and Biochemistry department,
University of California, Santa Cruz
95064 CA, United States

User avatar
Davide Sangalli
Posts: 643
Joined: Tue May 29, 2012 4:49 pm
Location: Via Salaria Km 29.3, CP 10, 00016, Monterotondo Stazione, Italy
Contact:

Re: em1s diagonal elements are not real

Post by Davide Sangalli » Wed Apr 11, 2018 1:46 pm

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.
Davide Sangalli, PhD
CNR-ISM, Division of Ultrafast Processes in Materials (FLASHit) and MaX Centre
https://sites.google.com/view/davidesangalli
http://www.max-centre.eu/

wufeng
Posts: 24
Joined: Fri Dec 15, 2017 4:17 am

Re: em1s diagonal elements are not real

Post by wufeng » Fri Apr 13, 2018 12:29 am

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
Feng Wu
Chemistry and Biochemistry department,
University of California, Santa Cruz
95064 CA, United States

Locked