Page 1 of 2

screened Coulomb matrix elements in Yambo

Posted: Sat Feb 03, 2018 11:04 am
by damao4361556
Dear Yambo developers,

I am planning to extract the screened Coulomb (electron-hole type) interactions matrix from YAMBO output. I want to output the Coulomb matrix between the KS orbitals.

Could you please let me know which module or which part of the code should I look into?

Your answers could help me save lots of time, and avoid digging into the code too much.

thank you

Re: screened Coulomb matrix elements in Yambo

Posted: Sat Feb 03, 2018 12:27 pm
by Daniele Varsano
Dear Wei Li,

in src/bse/K.F

The W matrix elements are indicated as H_c

Before the lines:

Code: Select all

593        if (BS_blk(i_block)%mode=="R") BS_blk(i_block)%mat(i_Tk,i_Tp)=   sqrt_f_itk*(H_x*Co-H_c)*sqrt_f_itp
594        if (BS_blk(i_block)%mode=="A") BS_blk(i_block)%mat(i_Tk,i_Tp)=cI*sqrt_f_itk*(H_x*Co-H_c)*sqrt_f_itp
you can write the matrix elements as:

Code: Select all

write(unit,*) i_k_bz, i_v_k , i_c_k
write(unit,*) i_p_bz, i_v_p , i_c_p
write(unit,*) real(H_x*Co),aimag(H_x*Co),real(H_c),aimag(H_c)
Here you have real and imaginary part of the exchange part <cvk|V|c'v'k'> and real and imaginary part of the screened Coulomb <cvk|W|c'v'k'>
Please note that if you run in parallel, the output is CPU dependent and maybe you want to write them in different files (e.g unit+myid).
myid has to be defined by adding:
use parallel_m, ONLY:myid

Best,

Daniele

Re: screened Coulomb matrix elements in Yambo

Posted: Sat Feb 03, 2018 1:31 pm
by damao4361556
Dear Daniele,

thanks so much for your helps.

1. Could you please point out which command (or calculation) will call the module for outputting the Columb matrix?
2. If I want the screened electron-hole interaction matrix, H_c would be enough, right? Don't need exchange part, Co?
3. Is the Columb matrix k-point dependent? i.e., the code will output the Columb matrix between KS orbitals at every k-point, right? Actually I just need the Columb matrix at Gamma point right now.

thanks

Best
Wei

Re: screened Coulomb matrix elements in Yambo

Posted: Sat Feb 03, 2018 1:35 pm
by damao4361556
Dear Daniele,

by the way, what's the unit of the elements of Columb matrix, eV, or Ry, and or Ha?

Wei

Re: screened Coulomb matrix elements in Yambo

Posted: Sat Feb 03, 2018 1:40 pm
by damao4361556
Dear Daniele,

Also, can you explain the meaning of the variables, e.g., H_x, Co, H_c, i_p_bz, i_v_p , i_c_p?

There are many variables, just want to make sure the meaning of the most relevant variables that I will handle in the code in order output Columb matrix?

Re: screened Coulomb matrix elements in Yambo

Posted: Sat Feb 03, 2018 1:56 pm
by damao4361556
seems the code is a bit large, could you please point out the right way where I need to make the changes, and if possible, how to make the changes.

your help is greatly appreciated

thanks

Re: screened Coulomb matrix elements in Yambo

Posted: Sat Feb 03, 2018 2:23 pm
by Daniele Varsano
Dear Wei Li,
first of all, I suggest you have a look carefully to the theory behind the Bethe Salpeter equation.
1. Could you please point out which command (or calculation) will call the module for outputting the Columb matrix?
The build-up of the BSE. (yambo -b -o b -k SEX)
2. If I want the screened electron-hole interaction matrix, H_c would be enough, right? Don't need exchange part, Co?
Yes, H_c, I just indicated you how to write all the part of the BSE kernel (2V-W)
3. Is the Columb matrix k-point dependent? i.e., the code will output the Columb matrix between KS orbitals at every k-point, right? Actually, I just need the Columb matrix at Gamma point right now.
The code does not output anything, I indicated you how to output all the matrix elements. W depends on (cvk) and c'v'k', you can decide to print out what you need. I do not know what you mean at gamma point, you have two k indexes (k,k'), if you want only the diagonal part k=0 and k'=0 just insert and if condition for i_k_bz=0 and i_p_bz=0
what's the unit of the elements of Columb matrix, eV, or Ry, and or Ha?
It should be Ha.
H_x, Co, H_c, i_p_bz, i_v_p , i_c_p?
The kernel matrix element is defined as <cvk|H|c'v'k'> where H=2V-W, c stands for conduction bands, v for valence band.
H_x=<V>
H_c=<W>
i_p_bz=k'
i_v_p =v'
i_c_p=c'
Co is just a constant you need to get H_x in a proper way.
could you please point out the right way where I need to make the changes, and if possible, how to make the changes.
In my first answer, I indicated you where to insert the write commands (just before the line 593, see the line number on the left) and what to write.

Best,
Daniele

Re: screened Coulomb matrix elements in Yambo

Posted: Sat Feb 03, 2018 2:52 pm
by damao4361556
Dear Daniele,
I do not know what you mean at gamma point, you have two k indexes (k,k'), if you want only the diagonal part k=0 and k'=0 just insert and if condition for i_k_bz=0 and i_p_bz=0
What I understood is that one should use denser k-point with QE, then YAMBO read wavefunction from QE.
But I just need the Columb matrix at Gamma k-point from YAMBO output, we can do this right?

Just not sure if we could extract the Columb matrix between the KS orbitals at the interested k-point.

thanks greatly.

Wei

Re: screened Coulomb matrix elements in Yambo

Posted: Sat Feb 03, 2018 3:06 pm
by Daniele Varsano
Dear Wei Li,
But I just need the Columb matrix at Gamma k-point from YAMBO output, we can do this right?
Just not sure if we could extract the Columb matrix between the KS orbitals at the interested k-point.
I've already indicated you how to extract the matrix elements, what's your doubts?
The matrix element has 2 K indexes (k and k') correspondig to two vertical transitions
If you want <cvk|W|c'v'k'> for k=0 and k'=0 only just put an if statement:

Code: Select all

if (i_k_bz==1.and.i_p_bz==1) then 
write(unit,*)  i_v_k , i_c_k,  i_v_p , i_c_p, real(H_c),aimag(H_c)
endif
I really think I gave you all the useful information to extract what you need.
If something of the theory behind is not clear to you, I suggest you to discuss it with your supervisor or colleagues.

Best,
Daniele

Re: screened Coulomb matrix elements in Yambo

Posted: Sat Feb 03, 2018 3:11 pm
by damao4361556
Dear Daniele,

thanks so much for your useful information.

these help me a lot

Best wishes