Format of the BSE kernel file
Moderators: Davide Sangalli, andrea.ferretti, myrta gruning, andrea marini, Daniele Varsano, Conor Hogan, Nicola Spallanzani
-
- Posts: 21
- Joined: Fri Nov 29, 2013 1:30 pm
Format of the BSE kernel file
Dear Yambo team,
I need to know the value of specific element of the BSE kernel. How is this matrix orginazied, and in which file is it stored?
I plan to write a fortran program to read its elements, and for simplicity I disabled the use of netcdf library. But before that I have to know its structure.
I tried exploring the source code, only to get lost in the complex derived data types and subroutine calls.
Best,
Yunhai
I need to know the value of specific element of the BSE kernel. How is this matrix orginazied, and in which file is it stored?
I plan to write a fortran program to read its elements, and for simplicity I disabled the use of netcdf library. But before that I have to know its structure.
I tried exploring the source code, only to get lost in the complex derived data types and subroutine calls.
Best,
Yunhai
Yunhai Li
Department of Physics, Southeast University
Nanjing, Jiangsu, PRC
Department of Physics, Southeast University
Nanjing, Jiangsu, PRC
- Daniele Varsano
- Posts: 3835
- Joined: Tue Mar 17, 2009 2:23 pm
- Contact:
Re: Format of the BSE kernel file
Dear Yunhai,
the BSE matrix is sotred in ./SAVE/(n)db.BS_Q1
if the file is huge, it is automatically fragmented in multiple files.
If you use netcdf libraries, you can inspect it by using the ncdump command, otherwise it is a binary files.
If you want to have a look inside the code:
/bse/K.F
Here is when the BSE matrix is filled. icv1 and icv2 are generalized indexes of the electron-hole pairs.
The matrix is divided in blocks according with the k-point sampling. Try to follow the flux starting from this line:
and note:
H_res_x is the exchange part of the kernel
H_re_c is the direct term
ik2bz is the k-points in the Bz
iv1 valence bands
ic1 conduction bands
is1 symmetry operation
... the same for the index 2.
Hope it helps,
Daniele
the BSE matrix is sotred in ./SAVE/(n)db.BS_Q1
if the file is huge, it is automatically fragmented in multiple files.
If you use netcdf libraries, you can inspect it by using the ncdump command, otherwise it is a binary files.
If you want to have a look inside the code:
/bse/K.F
Code: Select all
539 BS_mat(icv1,icv2)=H_res_x*real(spin_occ)*Co-H_res_c
The matrix is divided in blocks according with the k-point sampling. Try to follow the flux starting from this line:
Code: Select all
356 call PP_redux_wait
357 do ik2=1,BS_columns
358 !
H_res_x is the exchange part of the kernel
H_re_c is the direct term
ik2bz is the k-points in the Bz
iv1 valence bands
ic1 conduction bands
is1 symmetry operation
... the same for the index 2.
Hope it helps,
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/
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/
-
- Posts: 21
- Joined: Fri Nov 29, 2013 1:30 pm
Re: Format of the BSE kernel file
Daniele,Daniele Varsano wrote:Dear Yunhai,
the BSE matrix is sotred in ./SAVE/(n)db.BS_Q1
if the file is huge, it is automatically fragmented in multiple files.
If you use netcdf libraries, you can inspect it by using the ncdump command, otherwise it is a binary files.
If you want to have a look inside the code:
/bse/K.F
Here is when the BSE matrix is filled. icv1 and icv2 are generalized indexes of the electron-hole pairs.Code: Select all
539 BS_mat(icv1,icv2)=H_res_x*real(spin_occ)*Co-H_res_c
The matrix is divided in blocks according with the k-point sampling. Try to follow the flux starting from this line:and note:Code: Select all
356 call PP_redux_wait 357 do ik2=1,BS_columns 358 !
H_res_x is the exchange part of the kernel
H_re_c is the direct term
ik2bz is the k-points in the Bz
iv1 valence bands
ic1 conduction bands
is1 symmetry operation
... the same for the index 2.
Hope it helps,
Daniele
Sorry for the late reply.
It seems that the elements of BSE kernel is evaluted via a four-fold loop.
Code: Select all
do ik2=1,BS_columns
................
do ik1=ik2,1,-1
.................
do icv1=1,BS_blk_dim(ik1)
...............................
do icv2=1,BS_blk_dim(ik2)
...............................
BS_mat(icv1,icv2)=H_res_x*real(spin_occ)*Co-H_res_c
...............................
end do
........................
end do
............................
end do
................................
end do
Code: Select all
do ik2=1,BS_columns
do ik1=ik2,1,-1
Code: Select all
do icv1=1,BS_blk_dim(ik1)
...............................
do icv2=1,BS_blk_dim(ik2)
Does it mean that Yambo uses the Hermitian nature of BSE kernel to reduce the computional effort?
Best,
Yunhai
Yunhai Li
Department of Physics, Southeast University
Nanjing, Jiangsu, PRC
Department of Physics, Southeast University
Nanjing, Jiangsu, PRC
- Daniele Varsano
- Posts: 3835
- Joined: Tue Mar 17, 2009 2:23 pm
- Contact:
Re: Format of the BSE kernel file
Dear Yunhai,
Best,
Daniele
Yes.Complex number of single precision?
Yes, for the resonant part of the BSE matrix. While if the coupling is included the coupling part of the matrix it is stored in a different vector named BS_cpl_mat.Does it mean that Yambo uses the Hermitian nature of BSE kernel to reduce the computional effort?
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/
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/
-
- Posts: 21
- Joined: Fri Nov 29, 2013 1:30 pm
Re: Format of the BSE kernel file
Dear Daniele.Daniele Varsano wrote:Dear Yunhai,
Yes.Complex number of single precision?
Yes, for the resonant part of the BSE matrix. While if the coupling is included the coupling part of the matrix it is stored in a different vector named BS_cpl_mat.Does it mean that Yambo uses the Hermitian nature of BSE kernel to reduce the computional effort?
Best,
Daniele
One more quesiton: how are the k-points and cv pairs ordered?
I may guess that the k-points are ordered as they appear in the section of "[03] Transferred momenta grid' in the report file, but not sure.
Best,
Yunhai
Yunhai Li
Department of Physics, Southeast University
Nanjing, Jiangsu, PRC
Department of Physics, Southeast University
Nanjing, Jiangsu, PRC
- Daniele Varsano
- Posts: 3835
- Joined: Tue Mar 17, 2009 2:23 pm
- Contact:
Re: Format of the BSE kernel file
Dear Yunhai,
yes, the k-points should as in the report. Careful: the transferred momenta grid are the q-points (k-k').
About the cv ordering, I suggest you to take a simple example and print out the index of the bands and k-points. They are ordered according a table:
in ./src/bse/K.F
The table are defined in ./src/bse/K_eh_setup.F
Best,
Daniele
yes, the k-points should as in the report. Careful: the transferred momenta grid are the q-points (k-k').
About the cv ordering, I suggest you to take a simple example and print out the index of the bands and k-points. They are ordered according a table:
in ./src/bse/K.F
Code: Select all
ik1bz=BS_eh_table(iBSE1,1)
iv1=BS_eh_table(iBSE1,2)
ic1=BS_eh_table(iBSE1,3)
...
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/
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/
-
- Posts: 21
- Joined: Fri Nov 29, 2013 1:30 pm
Re: Format of the BSE kernel file
Dear Daniele,Daniele Varsano wrote:Dear Yunhai,
yes, the k-points should as in the report. Careful: the transferred momenta grid are the q-points (k-k').
About the cv ordering, I suggest you to take a simple example and print out the index of the bands and k-points. They are ordered according a table:
in ./src/bse/K.FThe table are defined in ./src/bse/K_eh_setup.FCode: Select all
ik1bz=BS_eh_table(iBSE1,1) iv1=BS_eh_table(iBSE1,2) ic1=BS_eh_table(iBSE1,3) ...
Best,
Daniele
Thank you! I am very clear now.
Best,
Yunhai
Yunhai Li
Department of Physics, Southeast University
Nanjing, Jiangsu, PRC
Department of Physics, Southeast University
Nanjing, Jiangsu, PRC