Exciton weights

Post here any question you encounter when running the scripts of the yambo-py suite. Post here problem strictly to the python interface as problem coming from the yambo runs should go in the appropriate subforum.

Moderators: palful, amolina, mbonacci

Post Reply
sdwang
Posts: 297
Joined: Fri Apr 09, 2010 12:30 pm

Exciton weights

Post by sdwang » Fri Sep 13, 2024 11:33 am

Dear all,
I used yambopy to plot the exciton weights on the bands, and the weights seems very small as attached.
The script related to the exciton weifghts as:
...
## [3.B] Interpolate the values
if Bands_Plot_Interpolate:
fig = plt.figure(figsize=(4,6))
ax = fig.add_axes( [ 0.15, 0.15, 0.80, 0.80 ])
# In case of problems with the interpolation, try to increase lpratio
exc_on_bands = yexc.interpolate(yel,path,states,lpratio=20,f=None,size=1.0,verbose=True)
exc_on_bands.plot_ax(ax,color_bands='grey',c_weights='red',alpha_weights=1.0)
I increased 'size' but it does not work. If I reduced lpratio, the weights are bigger, but the bands are crossed heavily.
How to solve the problem?
Thanks!
SD
You do not have the required permissions to view the files attached to this post.
S. D. Wang
IMU,HOHHOT,CHINA
E-mail: sdwang@imu.edu.cn

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

Re: Exciton weights

Post by palful » Mon Oct 07, 2024 3:20 pm

Dear S. D. Wang,

You are right. There is a slight inconsistency in the tutorial script: the "size" parameter should be given as argument to the "plot_ax" function (method of the bandstructure object "exc_on_bands") and not to the "interpolate" function (method of the excitondb object "yexc").

If you add the "size" argument to "exc_on_bands.plot_ax(...,size=4.,...)", you will see that now the plot will work as intended. Thanks for noticing. The wiki and the script should probably be updated to clarify this point.

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

sdwang
Posts: 297
Joined: Fri Apr 09, 2010 12:30 pm

Re: Exciton weights

Post by sdwang » Tue Oct 08, 2024 3:57 am

Dear Fulvio,
I have successfully produced the PBE bands with right weights. How could we import the QP corrections in the 'exc_kspace_plot.py' to obtain the weight on the QP band?
Thanks!

SD
S. D. Wang
IMU,HOHHOT,CHINA
E-mail: sdwang@imu.edu.cn

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

Re: Exciton weights

Post by palful » Wed Oct 09, 2024 11:48 am

Dear SD,

You could just read the quasiparticle database instead of the Kohn-Sham energies, replacing the call to YamboElectronsDB with YamboQPDB such as:

Code: Select all

yqp  = YamboQPDB.from_db(filename='ndb.QP',folder='location/of/database')
and then providing the yqp object to the yexc.interpolate function.

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

sdwang
Posts: 297
Joined: Fri Apr 09, 2010 12:30 pm

Re: Exciton weights

Post by sdwang » Thu Oct 10, 2024 2:50 am

Dear Palful,
I revised the python script as:
...
exc_on_bands = yexc.interpolate(yqp,path,states,lpratio=55,f=None,size=50,verbose=True)
exc_on_bands.plot_ax(ax,c_bands='black',c_weights='red',size=20,alpha_weights=1.0,linewidths=500,s=300)
...
but it does not work and interpolation stops as:
...
exc_on_bands = yexc.interpolate(yqp,path,states,lpratio=55,f=None,size=50,verbose=True)
File "/home/hipeson/intel/oneapi/intelpython/latest/lib/python3.9/site-packages/yambopy/dbs/excitondb.py", line 1122, in interpolate
k1,k2,k3 = energies.expand_kpts()
AttributeError: 'YamboQPDB' object has no attribute 'expand_kpts'
...

Thanks!

Best

SD
S. D. Wang
IMU,HOHHOT,CHINA
E-mail: sdwang@imu.edu.cn

Post Reply