Transferred momenta and different LongDrXd orientation

Deals with issues related to computation of optical spectra in reciprocal space: RPA, TDDFT, local field effects.

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

zmar
Posts: 10
Joined: Mon May 09, 2022 2:48 pm

Transferred momenta and different LongDrXd orientation

Post by zmar » Tue Oct 04, 2022 5:25 pm

Dear Yambo developers and more experienced users,

we have calculated alpha (which should represent EELS) for a monolayer graphene.
We intend to calculate at q-points outside of the 1st BZ (Brillouin zone) and also separately calculate both q-parallel (in-plane) and q-perpendicular incidence.

We experimented with increasing number of q-points with different q_z coordinates (real-space z-axis is perpendicular to the graphene sheet).

1) Negative alpha outside of the 1st BZ:
Strangely enough, our results with interaction (local field effects), column 2 ('ALPHA-Im[2]'), contain negative values.
Some of the files have only few such values (less than 10) but one of them has all but one negative values, see the plot below.
2022-10-04_alpha-out-of-1stBZ.png
Column no. 4 ('ALPHA_o-Im[4]', non-interacting picture) contains some but few negative values as well.

Comment: the column number present in labels of the plot corresponds to Python indexing starting with 0, hence shifted by '-1' meaning the column with 'ALPHA-Im[2]' is plotted.

The fact that it is negative is a sign of something very fishy going on.
The question is what did we do in a wrong way?

The details of our calculations are in the Yambo run file attached, the most significant parameters are:
Qdirection = 0 0 1
QShiftOrder = "less than 3"

Also, we are not quite sure what is the exact meaning of value of 'QShiftOrder'.
Does the integer value relate to the Nth BZ, coefficients of linear combination of base Q-vectors or something else completely?

2) Insignificant 'LongDrXd' effects:

We did not find significant, if any, dependence on changing (direction of) intensity the electric field, paremeter 'LongDrXd' from (1, 0, 0) to (0, 0, 1).
See the below plot comparing fairly equivalent q-points, i.e. "q31" in the case of out-of-plane (perpendicular) LongDrXd on a grid 46x46x18 (with the input file attached) and "q7" for an in-plane LongDrXd on a grid 90x90x1.
2022-10-04_LongDrXd.png
First, we believed that it might be due to single q-point (calculations not presented here) in the z-direction but this occurs also in the case of multiple q_z coordinates (namely the 46x46x18).

According to the variables explained
https://www.yambo-code.eu/wiki/index.ph ... s#LongDrXd
one should take LongDrXd lie in-plane/axis of the system if a non-3D material is considered.

On the other hand, according to the following tutorial,
https://www.yambo-code.eu/wiki/index.ph ... _direction,
changing the direction to out-of-plane seems to be a common practice.

We expect the polarisation to play more significant role.

Kind regards,

Martin and Ales
You do not have the required permissions to view the files attached to this post.
Martin Zouhar
(Institute of Scientific Instruments of the CAS, v. v. i.)

zmar
Posts: 10
Joined: Mon May 09, 2022 2:48 pm

Re: Transferred momenta and different LongDrXd orientation

Post by zmar » Tue Oct 04, 2022 5:31 pm

For some reasons, I was unable to post more than 3 files in a single post, hence this dummy post.
You do not have the required permissions to view the files attached to this post.
Martin Zouhar
(Institute of Scientific Instruments of the CAS, v. v. i.)

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

Re: Transferred momenta and different LongDrXd orientation

Post by Daniele Varsano » Tue Oct 04, 2022 5:36 pm

Dear Martin,

thanks for reporting and we will have a look at what is happening for the calculation of alpha outside the 1st BZ.

Regarding the role of LongDrXd, please note that this assign a direction for the q-->0 limit (ie optics). When dealing with finite momentum, the perturbation
is longitudinal along the chosen q vector, so the variable LongDrXd in this case does not play any role.

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/

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

Re: Transferred momenta and different LongDrXd orientation

Post by Davide Sangalli » Tue Dec 20, 2022 3:08 pm

Dear Martin,
the response outside the first bz is not a maintained feature at the moment.

I'll try to test it and see if there are issues.
I do not promise anything...

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/

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

Re: Transferred momenta and different LongDrXd orientation

Post by Davide Sangalli » Mon Dec 26, 2022 8:57 pm

I did some tests.
There was a bug for runs in parallel distributing over the G-vectors.

Can you try the following patch:

Code: Select all

diff --git a/src/pol_function/OPTICS_driver.F b/src/pol_function/OPTICS_driver.F
index 2f1a5e2f7..da3e02315 100644
--- a/src/pol_function/OPTICS_driver.F
+++ b/src/pol_function/OPTICS_driver.F
@@ -40,7 +40,7 @@ subroutine OPTICS_driver(Xen,Xk,q,wv,X,Dip)
 &                        X_DbGd_nkpt_at_q,X_DbGd_nkpt_at_q_table
  use parallel_int,  ONLY:PP_redux_wait,PARALLEL_global_indexes,PARALLEL_WF_index,PARALLEL_WF_distribute
  use parallel_m,    ONLY:PAR_IND_Q_ibz,PAR_COM_Q_A2A,PAR_IND_CON_BANDS_X,&
-&                        PAR_IND_Xk_ibz,PAR_IND_VAL_BANDS_X,master_cpu
+&                        PAR_COM_RL_INDEX,PAR_IND_Xk_ibz,PAR_IND_VAL_BANDS_X,master_cpu
  use wave_func,     ONLY:WF,WF_buffer,WF_buffered_IO
  use TDDFT,         ONLY:FXC_desc,FXC_type,&
 &                        F_xc_gspace,FXC_K_diagonal,FXC_n_g_corr
@@ -220,10 +220,16 @@ subroutine OPTICS_driver(Xen,Xk,q,wv,X,Dip)
    ! Without LF eps
    !
    if (Macroscopic_CPU) Alpha(:,1)=-X_par(1)%blc(i_G_shift,i_G_shift,:)*4.0_SP*pi/Q_plus_G_sq_modulus
+   call PP_redux_wait(Alpha(:,1),COMM=PAR_COM_RL_INDEX%COMM)
+   Epsilon_ii(:,1)=1._SP+Alpha(:,1)
    !
    ! X Dyson equation solver
    !
    if (.not.l_rpa_IP) call X_redux(iq,"X",X_par(1),wv,X)
+   !
+   ! X_redux can change the matrix distribution. Need to recheck who is Macroscopic CPU
+   Macroscopic_CPU=X_par(1)%rows(1)<=i_G_shift.and.i_G_shift<=X_par(1)%rows(2).and.&
+&                  X_par(1)%cols(1)<=i_G_shift.and.i_G_shift<=X_par(1)%cols(2)
    !
    if (Macroscopic_CPU) then
      !
@@ -234,10 +240,10 @@ subroutine OPTICS_driver(Xen,Xk,q,wv,X,Dip)
        ! Here I assume X_par is small and I use 1/(1+x)~1-x 
        if(      l_col_cut .and. iq==0) Alpha(:,2)=-X_par(1)%blc(i_G_shift,i_G_shift,:)
      endif
-     !
-     Epsilon_ii(:,1:2)=1._SP+Alpha(:,1:2)
-     !
    endif
+   call PP_redux_wait(Alpha(:,2),COMM=PAR_COM_RL_INDEX%COMM)
+   !
+   Epsilon_ii(:,2)=1._SP+Alpha(:,2)
    !
    if (l_pf_fxc) then
      call TDDFT_PF_coefficient(Xen,Xk,a_xc,b_xc)
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/

zmar
Posts: 10
Joined: Mon May 09, 2022 2:48 pm

Re: Transferred momenta and different LongDrXd orientation

Post by zmar » Wed Jan 04, 2023 11:03 am

Hello David,

thank you for the suggested patch!
Both of us were already enjoying the leave of absence on December 26th, hence we noticed the reply yesterday.
We have prepared a patched file for a maintainer of the computational resources we use.
The intention is to apply it to Yambo 5.1.1 (I tested that the affected unpatched file 'OPTICS_driver.F' is the same in both 5.1.0, we have used in our calculations, and in 5.1.1).
We will report the new results when available.

All the best in 2023 to you and Yambo community as well,

Martin
Martin Zouhar
(Institute of Scientific Instruments of the CAS, v. v. i.)

zmar
Posts: 10
Joined: Mon May 09, 2022 2:48 pm

Re: Transferred momenta and different LongDrXd orientation

Post by zmar » Tue Jan 24, 2023 1:14 pm

Dear David,

we have tested the patch on Yambo 5.1, see the plot of "q=3, G=3" with original and patched version of Yambo.
CompareAlpha.png
Unfortunately, the patch - as we have applied it, please see the attached file - seems to have no effect, only the output-file headers differ.
Also, additional file "q=4, G=3" contains negative values in the 2nd column as well.

We welcome any other suggestions or help you or someone else may be able to provide.
E.g. could anyone please verify our input file (provided in the previous posts) does not contain any conflicting setting?

Kind regards,

Martin
You do not have the required permissions to view the files attached to this post.
Martin Zouhar
(Institute of Scientific Instruments of the CAS, v. v. i.)

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

Re: Transferred momenta and different LongDrXd orientation

Post by Davide Sangalli » Thu Jan 26, 2023 9:26 am

Ok, it was a try.
I'll let you know if I figure out anything else...

It would be great to have a minimal test (with pseudos and input files) to reproduce this issue...

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/

zmar
Posts: 10
Joined: Mon May 09, 2022 2:48 pm

Re: Transferred momenta and different LongDrXd orientation

Post by zmar » Tue Jan 31, 2023 12:46 pm

Dear Davide,

please find the example attached.
There are two files:
Archive with pseudopotential, both QE and Yambo input files and yambopy scripts.
README file with description of the content of the archive.

The yambopy scripts are provided as reference (some parts may be commented out because of e.g. fine-tuning NSCF parameters while keeping SCF ones the same).

The input files correspond to reduced converged values, they are too low for sufficiently converged results and most likely too high for quick testing.
If you wish, we can lower the parameters and re-upload.

Kind regards,

Martin
You do not have the required permissions to view the files attached to this post.
Martin Zouhar
(Institute of Scientific Instruments of the CAS, v. v. i.)

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

Re: Transferred momenta and different LongDrXd orientation

Post by Davide Sangalli » Sun Feb 05, 2023 10:03 am

I've been able to reproduce the negative spectra with reduced parameters.
After some testing my conclusion (to be confirmed) is that this is not due to issues in the implementation, but rather in the coulomb interaction obtained from the "box z" Coulomb cut-off.
Indeed removing the cutoff or using the "slab z" Coulomb cut-off the spectra goes back to positive.

My test were done at very low convergence.
Please try "slab z" at convergence an let me know.

Two comments:
a) "slab z" is the suggested Coulomb cutoff technique in my opinion for 2D materials. Daniele can probably better comment on this.

b) keep in mind that simulations with q outside the BZ is not a maintained feature at the moment.

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/

Post Reply