em1s diagonal elements are not real
Moderators: Davide Sangalli, Daniele Varsano, andrea.ferretti, andrea marini, myrta gruning, Conor Hogan

 Posts: 24
 Joined: Fri Dec 15, 2017 4:17 am
em1s diagonal elements are not real
Dear all,
I recently tried to postprocess 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
I recently tried to postprocess 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
Chemistry and Biochemistry department,
University of California, Santa Cruz
95064 CA, United States
 Daniele Varsano
 Posts: 2322
 Joined: Tue Mar 17, 2009 2:23 pm
 Contact:
Re: em1s diagonal elements are not real
Dear Feng,
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:
Reducing the damping value, it should reduce the imaginary part in the diagonal element.
Best,
Daniele
Yes right, in the ndb.em1s it is contained the vX matrix element, so the eps^1=1+vX..em1s database, which I assumed to be inverse dielectric matrix minus one,
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
%
Best,
Daniele
Dr. Daniele Varsano
S3CNR Institute of Nanoscience and MaX Center, Italy
MaX  Materials design at the Exascale
http://www.nano.cnr.it
http://www.maxcentre.eu/
S3CNR Institute of Nanoscience and MaX Center, Italy
MaX  Materials design at the Exascale
http://www.nano.cnr.it
http://www.maxcentre.eu/

 Posts: 24
 Joined: Fri Dec 15, 2017 4:17 am
Re: em1s diagonal elements are not real
Daniele Varsano wrote:Dear Feng,
Yes right, in the ndb.em1s it is contained the vX matrix element, so the eps^1=1+vX..em1s database, which I assumed to be inverse dielectric matrix minus one,
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:Reducing the damping value, it should reduce the imaginary part in the diagonal element.Code: Select all
% DmRngeXs 0.10000  0.10000  eV # [Xs] Damping range %
Best,
Daniele
Thanks, reducing damping indeed reduces the imaginary part. With damping=0 the imaginary part is as small as 1e10.
Feng Wu
Chemistry and Biochemistry department,
University of California, Santa Cruz
95064 CA, United States
Chemistry and Biochemistry department,
University of California, Santa Cruz
95064 CA, United States

 Posts: 24
 Joined: Fri Dec 15, 2017 4:17 am
Re: em1s diagonal elements are not real
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 kpoint wavefunctions, but it is not always correct for qpoints other than gamma point.
Seems there is a shift of all Gvectors, but not sure about it.
Thanks very much!
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 kpoint wavefunctions, but it is not always correct for qpoints other than gamma point.
Seems there is a shift of all Gvectors, but not sure about it.
Thanks very much!
Feng Wu
Chemistry and Biochemistry department,
University of California, Santa Cruz
95064 CA, United States
Chemistry and Biochemistry department,
University of California, Santa Cruz
95064 CA, United States
 Daniele Varsano
 Posts: 2322
 Joined: Tue Mar 17, 2009 2:23 pm
 Contact:
Re: em1s diagonal elements are not real
Dear Feng,
Best,
Daniele
Yes it is symmetrized.1. Is the dielectric matrix stored symmetrized or not?
The order is the same as the wavefunctions. It is not very clear what you are observing, can you be more specific?What is the order of G vectors as the basis set of the dielectric matrix?
Best,
Daniele
Dr. Daniele Varsano
S3CNR Institute of Nanoscience and MaX Center, Italy
MaX  Materials design at the Exascale
http://www.nano.cnr.it
http://www.maxcentre.eu/
S3CNR Institute of Nanoscience and MaX Center, Italy
MaX  Materials design at the Exascale
http://www.nano.cnr.it
http://www.maxcentre.eu/

 Posts: 24
 Joined: Fri Dec 15, 2017 4:17 am
Re: em1s diagonal elements are not real
I printed the dielectric matrix. The first 10 diagonal elements looks like this:Daniele Varsano wrote:Dear Feng,
Yes it is symmetrized.1. Is the dielectric matrix stored symmetrized or not?
The order is the same as the wavefunctions. It is not very clear what you are observing, can you be more specific?What is the order of G vectors as the basis set of the dielectric matrix?
Best,
Daniele
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 Gvectors are symmetric, and then next 4. So the diagonal elements should have the same degeneracy.
And the Gvectors 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 Gvectors 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
Chemistry and Biochemistry department,
University of California, Santa Cruz
95064 CA, United States
 Davide Sangalli
 Posts: 339
 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
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 qdirection.
Thus the resulting matrix may not respect the symmetries of the lattice (?)
Also the io_X subroutine writes the Gvectors in the ndb.em1s file. (X_RL_vecs variable)
First the xcomponent of each vector is written then the ycomponents and finally the zcomponents.
Maybe it helps.
Best,
D.
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 qdirection.
Thus the resulting matrix may not respect the symmetries of the lattice (?)
Also the io_X subroutine writes the Gvectors in the ndb.em1s file. (X_RL_vecs variable)
First the xcomponent of each vector is written then the ycomponents and finally the zcomponents.
Maybe it helps.
Best,
D.
Davide Sangalli, PhD
CNRISM, Division of Ultrafast Processes in Materials (FLASHit) and MaX Centre
http://www.ism.cnr.it/en/davidesangallicv/
http://www.maxcentre.eu/
CNRISM, Division of Ultrafast Processes in Materials (FLASHit) and MaX Centre
http://www.ism.cnr.it/en/davidesangallicv/
http://www.maxcentre.eu/

 Posts: 24
 Joined: Fri Dec 15, 2017 4:17 am
Re: em1s diagonal elements are not real
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 qdirection.
Thus the resulting matrix may not respect the symmetries of the lattice (?)
Also the io_X subroutine writes the Gvectors in the ndb.em1s file. (X_RL_vecs variable)
First the xcomponent of each vector is written then the ycomponents and finally the zcomponents.
Maybe it helps.
Best,
D.
Dear Davide,
The electric field does not affect analytical part I think: the number of degenerate gvectors agree with the symmetry, at least for small Gvectors.
Thanks for this information about X_RL_vecs. Is this X_RL_vecs shared between all qpoints?
The order seems follows G, if it is shared across all qpoints it means when q!=0 , shells of q+G are only partially included, then there may be missing Gvectors in a shell which breaks the degeneracy / symmetry of Gvectors.
Best,
Feng
Feng Wu
Chemistry and Biochemistry department,
University of California, Santa Cruz
95064 CA, United States
Chemistry and Biochemistry department,
University of California, Santa Cruz
95064 CA, United States
 Davide Sangalli
 Posts: 339
 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
The matrix stored includes also the nonanalytical term if I'm not mistaken, at least if you compute X at the RPA level or beyond.
I think the nonanalytical 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 cutoff, factor 4) kcentered 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 kq) 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 kq for all k.
The cutoff is imposed on the biggest shell. The WFs are used in realsapce, so instead of a convolution in practice a product in realspace is done and, after that, and FFT in the big shell. I think this should respect all the symmetries.
D.
I think the nonanalytical 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 cutoff, factor 4) kcentered 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 kq) 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 kq for all k.
The cutoff is imposed on the biggest shell. The WFs are used in realsapce, so instead of a convolution in practice a product in realspace is done and, after that, and FFT in the big shell. I think this should respect all the symmetries.
D.
Davide Sangalli, PhD
CNRISM, Division of Ultrafast Processes in Materials (FLASHit) and MaX Centre
http://www.ism.cnr.it/en/davidesangallicv/
http://www.maxcentre.eu/
CNRISM, Division of Ultrafast Processes in Materials (FLASHit) and MaX Centre
http://www.ism.cnr.it/en/davidesangallicv/
http://www.maxcentre.eu/

 Posts: 24
 Joined: Fri Dec 15, 2017 4:17 am
Re: em1s diagonal elements are not real
Thanks very much. So I figured out what the issue is:Davide Sangalli wrote:The matrix stored includes also the nonanalytical term if I'm not mistaken, at least if you compute X at the RPA level or beyond.
I think the nonanalytical 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 cutoff, factor 4) kcentered 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 kq) 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 kq for all k.
The cutoff is imposed on the biggest shell. The WFs are used in realsapce, so instead of a convolution in practice a product in realspace is done and, after that, and FFT in the big shell. I think this should respect all the symmetries.
D.
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 Gvectors 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
Chemistry and Biochemistry department,
University of California, Santa Cruz
95064 CA, United States