BSE spectra considering momentum

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

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

Re: BSE spectra considering momentum

Post by Davide Sangalli » Fri Apr 30, 2021 10:26 am

Dear Pangrt,
I think the issue is then that the

Code: Select all

ndb.BS_diago
was produced with a version of yambo < 5.0.
Am I right?
What do you get if you do:

Code: Select all

ncdump -v HEAD_VERSION ndb.BS_diago_Q3
?
The variable PARS had size=5 with previous versions of yambo, while yambo 5.0 expects a variable of size 6

As a workaround you can open the file src/io/io_BSS_diago.F
and replace these lines

Code: Select all

   call io_elemental(ID,VAR="PARS",VAR_SZ=6,MENU=0)
   !
   call io_elemental(ID,VAR="[BSS] Eigenstates included",L0=BSS_write_eig_2_db,CHECK=.true.,OP=(/"=="/))
   if(iq==1) then
     call io_elemental(ID,VAR="[BSS] Field direction",R1=BSS_q0,CHECK=.true.,OP=(/"==","==","=="/))
     if (allocated(BSqpts)) BSqpts(:,iq)=BSS_q0
   endif
   call io_elemental(ID,VAR="[BSS] Eigenstates computed     ",I0=BSS_n_eig,CHECK=.true.,OP=(/"=="/))
   call io_elemental(ID,VAR="[BSS] Number of BSE matricies  ",I0=BS_mat_res_ares_dim,CHECK=.true.,OP=(/"=="/))
   call io_elemental(ID,VAR="",VAR_SZ=0,MENU=1)
with

Code: Select all

   call io_elemental(ID,VAR="PARS",VAR_SZ=5,MENU=0)
   !
   call io_elemental(ID,VAR="[BSS] Eigenstates included",L0=BSS_write_eig_2_db,CHECK=.true.,OP=(/"=="/))
   if(iq==1) then
     call io_elemental(ID,VAR="[BSS] Field direction",R1=BSS_q0,CHECK=.true.,OP=(/"==","==","=="/))
     if (allocated(BSqpts)) BSqpts(:,iq)=BSS_q0
   endif
   call io_elemental(ID,VAR="[BSS] Eigenstates computed     ",I0=BSS_n_eig,CHECK=.true.,OP=(/"=="/))
   !call io_elemental(ID,VAR="[BSS] Number of BSE matricies  ",I0=BS_mat_res_ares_dim,CHECK=.true.,OP=(/"=="/))
   call io_elemental(ID,VAR="",VAR_SZ=0,MENU=1)
and then recompile ypp. You can rename the newly compiled ypp

Code: Select all

mv ypp ypp_back_compatible
and then restore the file in ints original version.

In the future, we'll probably release a patch for automatic detection of the database version and back-compatibility.

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/

Fadil
Posts: 56
Joined: Sun May 24, 2020 1:56 pm

Re: BSE spectra considering momentum

Post by Fadil » Thu May 20, 2021 5:32 pm

Dear all,

As mentioned earlier in this post, dipole matrix elements are calculated only for q = 0.
Is it possible to extract \rho_nmk values for finite-q?

Best
Dr. Fadıl İYİKANAT
ICFO-The Institute of Photonic Sciences
Barcelona-SPAIN

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

Re: BSE spectra considering momentum

Post by Daniele Varsano » Thu May 20, 2021 6:12 pm

Dear Fadıl,
this elements are not stored. You should extract them from the code, e.g. in
./src/bse/K_IP.F

here you can find the indexes:

Code: Select all

216        BSE_scatt%is=(/ic,ik,isymm,i_sp_pol_c/)
217        BSE_scatt%os=(/iv,ok,osymm,i_sp_pol_v/)
218        BSE_scatt%qs=(/iGo,iq,1/)
and here they are computed:

Code: Select all

257          if(trim(global_gauge)=="length")   call scatter_Bamp(BSE_scatt)
The subroutine that calculate them is in:
src/wf_and_fft/scatter_Bamp.F

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/

Fadil
Posts: 56
Joined: Sun May 24, 2020 1:56 pm

Re: BSE spectra considering momentum

Post by Fadil » Thu May 20, 2021 9:46 pm

Dear Daniele,
Thank you for your quick reply.
So, basically, I need to print out 'BSE_scatt%is', 'BSE_scatt%os' and 'BSE_scatt%qs' values from the ./src/bse/K_IP.F file, right?
Can you briefly explain what are these indexes? Are they similar to the 'BS_mat(neh,i_l)' indexes calculated for q = 0?

Best
Dr. Fadıl İYİKANAT
ICFO-The Institute of Photonic Sciences
Barcelona-SPAIN

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

Re: BSE spectra considering momentum

Post by Daniele Varsano » Fri May 21, 2021 8:33 am

Dear Fadil,
if I have well understood you are seeking these matrix elements <vk-q|e^iqr|ck>

Here:
BSE_scatt%is --> ic,ik
BSE_scatt%os-->iv, ok where ok is the index for ik-iq
BSE_scatt%qs. --> iq

the matrix elements are in:
BSE_scatt%rhotw(1)


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/

Fadil
Posts: 56
Joined: Sun May 24, 2020 1:56 pm

Re: BSE spectra considering momentum

Post by Fadil » Tue May 25, 2021 5:47 pm

Thank you Daniele!
This is exactly what I'm looking for.
For RPA calculations (without BSE), how can I obtain the same matrix elements ?
i.e. from which folder, which matrix elements?

Best
Dr. Fadıl İYİKANAT
ICFO-The Institute of Photonic Sciences
Barcelona-SPAIN

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

Re: BSE spectra considering momentum

Post by Daniele Varsano » Wed May 26, 2021 9:16 am

Dear Fadil,

you can find them in:
./src/pol_function/X_irredux_residuals.F
with similar notation:

Code: Select all

  Xo_scatt%is=(/ic,ik,is,i_spin/)
  Xo_scatt%os=(/iv,ikp,isp,i_spin/)
  Xo_scatt%qs=(/qindx_X(iq,ikbz,2),iq,1/)
matrix elements in:

Code: Select all

Xo_scatt%rhotw

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/

Fadil
Posts: 56
Joined: Sun May 24, 2020 1:56 pm

Re: BSE spectra considering momentum

Post by Fadil » Tue Jun 01, 2021 3:27 pm

Dear Daniele,

Thank you in advance!
One last question, how can I obtain wave function coefficients (C_{nk}) and G vectors as in the following link;
http://www.yambo-code.org/wiki/index.ph ... sformation

Best
Dr. Fadıl İYİKANAT
ICFO-The Institute of Photonic Sciences
Barcelona-SPAIN

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

Re: BSE spectra considering momentum

Post by Daniele Varsano » Tue Jun 01, 2021 4:31 pm

Dear Fadil,

the G_nk(G) are stored in the ns.wf_fragments_* files in the SAVE directory, a single file for each k point.
The easiest way to read them is via a python script reading the netcdf format:

The dimensions are:
WF_COMPONENTS_@_SP_POL1_K1_BAND_GRP_1(D_0000000100, D_0000000001, D_0000001016, D_0000000002) ;

from left Re/Im, gvector, spin, nband

The gvectors g_vec(ig,3) are 2p*n_i/Li
can be found e.g. here:
./setup/G_shells_finder.F
search for
g_vec(ig_1,:).

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/

Fadil
Posts: 56
Joined: Sun May 24, 2020 1:56 pm

Re: BSE spectra considering momentum

Post by Fadil » Tue Jun 01, 2021 5:06 pm

Are there any yambopy script created to read the 'ns.wf_fragments_*' files ?

Best
Dr. Fadıl İYİKANAT
ICFO-The Institute of Photonic Sciences
Barcelona-SPAIN

Locked