Excitonic wavefunctions in reciprocal space

Anything regarding the post-processing utility (e.g. excitonic wavefunction analysis) is dealt with in this forum.

Moderators: Davide Sangalli, andrea marini, Daniele Varsano

Post Reply
WangFuyou
Posts: 14
Joined: Thu Apr 18, 2024 5:14 am

Excitonic wavefunctions in reciprocal space

Post by WangFuyou » Sat Aug 24, 2024 6:38 am

Dear yambo developers,
I'm trying to plot the distribution of the wave function in k space and the weights of the wave function based on this website:https://www.yambo-code.eu/wiki/index.ph ... ption_(BN).
I found a script called excitiondb.py on github based on the site. I tried to modify and run the script, but I never got the correct result. I would like to ask the correct way to use this script. Or how do I get the image I want if I don't need a script. Here I enclose the results of my error.
I would be most grateful if my question could be answered.

Yours,
WangFuyou
You do not have the required permissions to view the files attached to this post.
北京航天航天大学

User avatar
palful
Posts: 75
Joined: Tue Jan 26, 2016 11:23 am
Location: Modena and Milan

Re: Excitonic wavefunctions in reciprocal space

Post by palful » Mon Sep 02, 2024 10:21 am

Dear Wang Fuyou,

It is not easy to understand what is happening without information about your system. Could you maybe post a minimal example including your modified script and the related databases?

Cheers,
Fulvio
Dr. Fulvio Paleari
S3-CNR Institute of Nanoscience and MaX Center
Modena, Italy

WangFuyou
Posts: 14
Joined: Thu Apr 18, 2024 5:14 am

Re: Excitonic wavefunctions in reciprocal space

Post by WangFuyou » Fri Sep 06, 2024 10:37 am

Dear Palful
Thank you for your reply. My script is as follows, and I want to know how to use it.

Yours,
WangFuyou
You do not have the required permissions to view the files attached to this post.
北京航天航天大学

User avatar
palful
Posts: 75
Joined: Tue Jan 26, 2016 11:23 am
Location: Modena and Milan

Re: Excitonic wavefunctions in reciprocal space

Post by palful » Mon Sep 09, 2024 10:04 am

Dear Wang Fuyou,

the file excitondb.py is part of the yambopy source code so, unless if you find bugs or want to add new features, it would be better not to modify it.

We already provide a script for the user to edit in order to make the plots you're interested in, which is in tutorial/databases_yambopy/exc_kspace_plot.py.
Instructions on how to use this script can be found in this tutorial: https://www.yambo-code.eu/wiki/index.ph ... _structure

I would suggest that you keep excitondb - the python class to read the yambo BSE databases - as it is, and work with exc_kspace_plot.py by using excitondb as a module. I must add that I don't see anything obviously wrong in the second plot that you posted (the one with the band structure), but of course I don't know your system. The first plot (on the 2D-BZ) probably must be adapted to the fact your system does not have an hexagonal lattice.

If you have more trouble, please post your modified version of exc_kspace_plot plus the files ns.db1 and ndb.BS_diago_Q1 from yambo.

Cheers,
Fulvio
Dr. Fulvio Paleari
S3-CNR Institute of Nanoscience and MaX Center
Modena, Italy

WangFuyou
Posts: 14
Joined: Thu Apr 18, 2024 5:14 am

Re: Excitonic wavefunctions in reciprocal space

Post by WangFuyou » Tue Sep 10, 2024 9:33 am

Dear Palful
Thank you for your reply. So should I now install yambopy on my server and enter the command excitondb exc_kspace_plot.py?Thank you for your reply. So should I now install yambopy on my server and enter the command excitondb exc_kspace_plot.py?

Yours,
WangFuyou
北京航天航天大学

WangFuyou
Posts: 14
Joined: Thu Apr 18, 2024 5:14 am

Re: Excitonic wavefunctions in reciprocal space

Post by WangFuyou » Wed Sep 18, 2024 4:05 pm

Dear Palful,
I modified the lattice into a square, but the result is still wrong, I attached my picture,and script. However, the ndb.BS diago Q1 file is too large to upload.

Yours,
WangFuyou
You do not have the required permissions to view the files attached to this post.
北京航天航天大学

User avatar
palful
Posts: 75
Joined: Tue Jan 26, 2016 11:23 am
Location: Modena and Milan

Re: Excitonic wavefunctions in reciprocal space

Post by palful » Mon Oct 07, 2024 2:52 pm

Dear Wang Fuyou,

As you are dealing with a 3D system, may it be possible that you are plotting all the kpoints with different z-coordinate on top of each other? This would explain why the band plot looks correct, but the 2D k-space plot looks fully dark.

The function "yexc.plot_exciton_2D_ax" assumes a 2D k-point grid like (k_x,k_y,0). If this you are in 3D space, my suggestion would be to do your own version of the same function, with the modification that it accepts slices of the kpoint coordinates. You can code the function on top of your script starting from the original one. In your plot function, instead of relying directly on the full kpoint grid read by yambopy, you could supply as input arguments a sublist of k-points at a certain value of k_z (such as k_z=0), along with the relative indices, in order to plot 2D sections of the full 3D BZ.

Best,
Fulvio
Dr. Fulvio Paleari
S3-CNR Institute of Nanoscience and MaX Center
Modena, Italy

Post Reply