how to implement a new TDDFT kernel

Run-time issues concerning Yambo that are not covered in the above forums.

Moderators: myrta gruning, andrea marini, Daniele Varsano, Conor Hogan

hongtang2023
Posts: 45
Joined: Thu Mar 16, 2023 7:02 am

Re: how to implement a new TDDFT kernel

Post by hongtang2023 » Tue Apr 04, 2023 4:09 am

Dear Daniele,

Thanks so much!

I think I already got the point and I managed to compile the code successfully.

However, I have an important question needs your help. It is about the variable "bare_qpg" in the Yambo5.1.1 src/modules/mod_R_lattice.F . It is defined as " complex(SP),allocatable :: bare_qpg(:,:) ".

Could you please let me know what quantity the " bare_qpg " represents? Does " bare_qpg " get its value after " call WF_load(WF,nG,1,(/1,E%nbm/),(/1,k%nibz/),title='-Rho') " in the file " tddft_alda_g_space.F " if we use ALDA for optic calculation?

"bare_qpg" represents a complex number. Please let me know what its real and imaginary parts are.

I appreciate your help very much!

Best,
Hong

P. S. Please the attached mod_R_lattice.F file.
You do not have the required permissions to view the files attached to this post.
Dr. Hong Tang
Tulane University
New Orleans, LA
70118, USA

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

Re: how to implement a new TDDFT kernel

Post by Daniele Varsano » Tue Apr 04, 2023 7:37 am

Dear Hong,

the array bare_qpg(:,:) essentially defines the Coulomb interaction.
It is assigned in ./coulomb/col_driver.F

the argument are q and G, and it is defined as:
bare_qpg(iq,iG)=|q+G| such that the Coulomb interaction is:
Vcoul=1./qpg(iq.iG)^2

It is complex because for certain coulomb cutoff Vcoul can assume negative values, but if you do not use these particular Coulomb cutoff it will assume real value.

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/

hongtang2023
Posts: 45
Joined: Thu Mar 16, 2023 7:02 am

Re: how to implement a new TDDFT kernel

Post by hongtang2023 » Wed Apr 05, 2023 5:09 am

Dear Daniele,

Thanks so much! You are so helpful!
I am making progress to approach the goal.

I try to run the code with my implementation. However, I got errors.
When I run Yambo with -o c -k ALDA for tddft, the error is "
...
<---> [02.02] Symmetries
<---> [02.03] Reciprocal space
<---> [02.04] K-grid lattice
<---> Grid dimensions : 14 25 25
<---> [02.05] Energies & Occupations
<06s> [WARNING][X] Metallic system
<06s> [03] Transferred momenta grid and indexing
<08s> [04] Dipoles
<08s> [DIP] Checking dipoles header
<08s> [WARNING] [r,Vnl^pseudo] included in position and velocity dipoles.
<08s> [WARNING] In case H contains other non local terms, these are neglected
<08s> [05] Optics
<08s> [LA] SERIAL linear algebra
<09s> [FFT-Rho] Mesh size: 7 7 12
<16s> [xc] Functional : Perdew, Burke & Ernzerhof(X)+Perdew, Burke & Ernzerhof(C)
<16s> [xc] LIBXC used to calculate xc functional Hong
<16s> [xc] Hong in libxc_driver_mcp07
<16s> [xc] Hong 2
<16s> [xc] Hong 3Segmentation fault (core dumped) "

I inserted some " call msg( ... ) " in the subroutine tddft_alda_g_space, in order to find where the problem is. Currently, I found that when I call the tddft_alda_g_space(E, k, iq, wv) probably from either OPTICS_driver or X_dielectric_matrix , I added "iq" and "wv", since I saw that "iq" and "wv" are in the OPTICS_driver and X_dielectric_matrix . As I checked that it seems "wv" got some problems, since the run stop right before I want to use "wv". I want to use "wv%n_freqs" and "wv%p(iw)" . As I understand wv is the frequency, right?

Could you please let me know where "wv" or "Xw" get their values? Why I got error " Segmentation fault (core dumped) " right when I want to use "wv%n_freqs" or "wv%p(iw)" . iw is an integer.

I appreciate your help.


Best,
Hong
Dr. Hong Tang
Tulane University
New Orleans, LA
70118, USA

hongtang2023
Posts: 45
Joined: Thu Mar 16, 2023 7:02 am

Re: how to implement a new TDDFT kernel

Post by hongtang2023 » Thu Apr 06, 2023 6:04 pm

Dear Daniele,

I am continuing checking the coding. Please help me !

The latest test shows that wv%n_freqs is ok, please see below, which is 1301, it equals " %
ETStpsXd= 1301 # [Xd] Total Energy steps " which I set for this run.

However, the run stops right before " omega_iw=wv%p(iw) ", where "
complex(SP) :: omega_iw " is set in the variable definition.



"
...
...
<17s> [xc] Functional : Perdew, Burke & Ernzerhof(X)+Perdew, Burke & Ernzerhof(C)
<17s> [xc] LIBXC used to calculate xc functional Hong
<17s> [xc] Hong in libxc_driver_mcp07
<17s> [xc] Hong 2
<17s> [xc] Hong 3
<17s> [xc] Hong 3_3, n_spin : 1
<17s> [xc] Hong 4 iw=: 1
<17s> [xc] Hong 4 wv%n_freqs=: 1301Segmentation fault (core dumped)
...
...
"
Dr. Hong Tang
Tulane University
New Orleans, LA
70118, USA

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

Re: how to implement a new TDDFT kernel

Post by Daniele Varsano » Tue Apr 11, 2023 9:18 am

Dear Hong,

the wv frequencies are assigned in:
src/common/FREQUENCIES_setup.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/

hongtang2023
Posts: 45
Joined: Thu Mar 16, 2023 7:02 am

Re: how to implement a new TDDFT kernel

Post by hongtang2023 » Wed Apr 19, 2023 1:17 am

Dear Daniele,

Thanks for helping!
I temporarily solve the frequency thing.
However, one quick question, when Yambo5.1.1 calculates internally, what unit of frequency is used? I mean the frequency unit is the same as that of energy in Hartree atomic unit, it is Hartree.
What unit is used for frequency here in Yambo5.1.1? is it Hartree, eV, or Rydberg?

If I am coding myself, what unit system I should use in all the subroutines in Yambo 5.1.1?


Appreciate your help very much.

Best,
Hong
Dr. Hong Tang
Tulane University
New Orleans, LA
70118, USA

hongtang2023
Posts: 45
Joined: Thu Mar 16, 2023 7:02 am

Re: how to implement a new TDDFT kernel

Post by hongtang2023 » Wed Apr 19, 2023 7:02 pm

Dear Daniele,

Please confirm my questions below. Thank you very much!

When Yambo5.1.1 calculates internally, what unit of frequency is used? I mean the frequency unit is the same as that of energy in Hartree atomic unit, it is Hartree, right?
What unit is used for frequency here in Yambo5.1.1? is it Hartree, eV, or Rydberg?

If I am coding, what unit system I should use in all the subroutines, especially the subroutines TDDFT_ALDA_G_spaces and the following XC_potential_driver, XC_libxc_driver, etc. in Yambo 5.1.1?


Appreciate your help very much.
Dr. Hong Tang
Tulane University
New Orleans, LA
70118, USA

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

Re: how to implement a new TDDFT kernel

Post by Daniele Varsano » Mon Apr 24, 2023 11:03 am

Dear Hong Tang,

internal unit in Yambo is atomic units, frequencies are in Hartree.
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/

hongtang2023
Posts: 45
Joined: Thu Mar 16, 2023 7:02 am

Re: how to implement a new TDDFT kernel

Post by hongtang2023 » Mon Apr 24, 2023 6:36 pm

Dear Daniele,

Thank you so much for letting me know!
This is important information when coding in Yambo.
Since QE use Rydberg.

Best,
Hong
Dr. Hong Tang
Tulane University
New Orleans, LA
70118, USA

Post Reply