Optical matrix elements

Deals with issues related to computation of optical spectra, in RPA (-o c) or by solving the Bethe-Salpeter equation (-o b). Includes local field effects, excitons, etc.

Moderators: Davide Sangalli, andrea marini, Conor Hogan, myrta gruning

Optical matrix elements

Postby amolina » Thu Feb 23, 2012 6:15 pm

Hi everybody,

I would like to know if we can get the optical matrix elements, <j|ep|i>, calculated (internally, I guess) by Yambo to obtain the dielectric function, where |j> is the unoccuppied state, |i> the occuppied state, and e the polarization of the electric field.

Thanks,

Alejandro.
Alejandro Molina-Sánchez
Physics and Materials Research Unit
Campus Limpertsberg
Université du Luxembourg
User avatar
amolina
 
Posts: 111
Joined: Fri Jul 15, 2011 11:23 am
Location: Luxembourg

Re: Optical matrix elements

Postby claudio » Fri Feb 24, 2012 12:42 am

Dear Alejandro

the optical matrix elements <i | p | j> and < i | r | j > are calculated in the subroutine

src/pol_function/Dipole_transverse.F

check the comments in the subroutine.

Notice that yambo does not recalculate the dipoles matrix elements every time,
if you want to force it to recalculate them remove the dipole database

SAVE/ndb.dipoles or SAVE/db.dipoles

best regards
Claudio

PS :arrow: inside the code everything is in atomic units, also the dipoles
Claudio Attaccalite
Institut Neel, CNRS/UJF ABINEEL group
25 rue des Martyrs BP 166, Bâtiment D
38042 Grenoble cedex 9 France
web site: http://www.attaccalite.com
Freely download scientific books from: http://www.freescience.info
User avatar
claudio
 
Posts: 215
Joined: Tue Mar 31, 2009 11:33 pm

Re: Optical matrix elements

Postby amolina » Fri Mar 02, 2012 6:50 pm

Dear Claudio,

I have read the subroutine. It prints the dipole matrix elements or I need to modify the code to write them?

Regards,

Alejandro.
Alejandro Molina-Sánchez
Physics and Materials Research Unit
Campus Limpertsberg
Université du Luxembourg
User avatar
amolina
 
Posts: 111
Joined: Fri Jul 15, 2011 11:23 am
Location: Luxembourg

Re: Optical matrix elements

Postby claudio » Mon Mar 05, 2012 11:02 am

Dear Alejandro

the subroutine just calculated the dipoles, in order to read them
you can add a line like this in the subroutine

write(100,'(3i4,6f16.8)') iv,ic,ik,rho(1:3)

and write them on a text file,
or you can use the python script in attachment (you need to compile yambo with netcdf)

Cla
You do not have the required permissions to view the files attached to this post.
Claudio Attaccalite
Institut Neel, CNRS/UJF ABINEEL group
25 rue des Martyrs BP 166, Bâtiment D
38042 Grenoble cedex 9 France
web site: http://www.attaccalite.com
Freely download scientific books from: http://www.freescience.info
User avatar
claudio
 
Posts: 215
Joined: Tue Mar 31, 2009 11:33 pm

Re: Optical matrix elements

Postby arlonne » Fri May 10, 2013 10:28 pm

Dear Claudio,

claudio wrote:Dear Alejandro

the subroutine just calculated the dipoles, in order to read them
you can add a line like this in the subroutine

write(100,'(3i4,6f16.8)') iv,ic,ik,rho(1:3)



I have tested your suggestion. It can work under serial calculation, but it failed under parallel calculations. it seems every cpu open and write this file. It is not easy to use the "of_close_open" and "msg" subroutine to handle a file. How can I write out this file use only one cpu in parallel model?

Thanks,
Longhua
arlonne
Department of Physics and Astronomy
Northwestern University, IL 60208
arlonne
 
Posts: 26
Joined: Thu Apr 18, 2013 4:50 pm

Re: Optical matrix elements

Postby claudio » Sat May 11, 2013 11:55 am

Dear Longhua

when you run yambo in parallel each processor calculate only a part of the dipoles,
then at the end of the subroutine you will find an instruction

call PP_redux_wait(DIP_iR(:,:,:,ik,i_spin))

can redistribute all the dipole among the different preocessors.

After this instruction you can make one processor writes all of them doing:

load the preocessor number

Code: Select all
 use parallel_m,              ONLY : myid


make the preocessor number 0 writes all the dipoles

Code: Select all
if (myid==0) then
  do i_spin=1,n_spin
  do ik=1,Xk%nibz
     do ic=ic_min,X%ib(2)
        do iv=X%ib(1),iv_max
            write(100,'(3i4,6f16.8)') iv,ic,ik,DIP_iR(:,iv,ic,ik,i_spin)
       enddo
     enddo
  enddo
  enddo
endif


anyway I advise you to use the python script and read the dipole database at the end of the run:

http://www.yambo-code.org/doc/scripts.php

regards
Claudio
Claudio Attaccalite
Institut Neel, CNRS/UJF ABINEEL group
25 rue des Martyrs BP 166, Bâtiment D
38042 Grenoble cedex 9 France
web site: http://www.attaccalite.com
Freely download scientific books from: http://www.freescience.info
User avatar
claudio
 
Posts: 215
Joined: Tue Mar 31, 2009 11:33 pm

Re: Optical matrix elements

Postby arlonne » Sun May 12, 2013 2:29 am

Dear Claudio,

Thanks for your reply. I, actually, tried this method before. it didn't work. This is what I am confusing.
May be I should use the python script.

Best,
Longhua
arlonne
Department of Physics and Astronomy
Northwestern University, IL 60208
arlonne
 
Posts: 26
Joined: Thu Apr 18, 2013 4:50 pm

Re: Optical matrix elements

Postby Zahra Taghipour » Mon Nov 19, 2018 9:46 pm

Hello Claudio,

I have a question regarding the extraction of the oscillators matrix elements.
I tried to use the script provided in "http://www.yambo-code.org/doc/scripts.php/read_dipoles.py" to read the dipole elements, however, it asks for "ndb.dipoles" which I do not have among my outputs.
Currently, I am using Yambo 4.1.3 version. Are "ndb.dip_iR_and_P" files the same as "ndb.dipoles" file. Could you please help me find out how to save the oscillators matrix elements as txt file.

Zahra Taghipour
Researcher
The Ohio State University
Zahra Taghipour
 
Posts: 23
Joined: Mon Aug 17, 2015 5:56 am

Re: Optical matrix elements

Postby Daniele Varsano » Mon Nov 19, 2018 10:12 pm

Dear Zahar,
I strongly advise you to switch to a more recent release of Yambo, you are using a quite old version and many things chanced since then, and also many bugs have been fixed.
a) "ndb.dip_iR_and_P, yes they contains the dipoles.
b) probably you can use the yambo-py interface for reading the databases, but I'm not familiar with that, you may ask in the yambopy subforum.,
otherwise, you can just print the matrix elements when they are calculated (note that if they have been calculated once they are not recalculated).
You can use the piece of the code indicated in the post above by Claudio.
They are calculated in the subroutine Dipole_transverse, that is found in ./src/pol_function/DIPOLE_transverse.F and you can
add the writing lines in ./src/pol_function/DIPOLE_driver.F after the call:
Code: Select all
   call DIPOLES_ppredux_and_symmetrize()


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
Daniele Varsano
 
Posts: 1973
Joined: Tue Mar 17, 2009 2:23 pm

Re: Optical matrix elements

Postby Zahra Taghipour » Tue Nov 20, 2018 1:34 am

Dear Daniele,

Thank you for your recommendation. Unfortunately, this version was the only version I could install and run without the problem.
I still do not understand why the code does not output "ndb.dipoles"!

I added the following lines in ./src/pol_function/DIPOLE_driver.F after the call

open(unit=1,file="dipoles_out")
write(100,'(3i4,6f16.8)') iv,ic,ik,rho(1:3)
close(1)

But, the code does not write the matrix elements. I wonder what am I missing?
I should mention I tried the above code without line #1 and #3, as well, with no difference.

In the meanwhile, I will look into Yambopy to see if they have this included in their code to extract the dipole matrix.

Thanks, and Regards
Zahra T.
Zahra Taghipour
 
Posts: 23
Joined: Mon Aug 17, 2015 5:56 am

Next

Return to Linear Response

Who is online

Users browsing this forum: No registered users and 1 guest

cron