Page 1 of 1
Exciton weights
Posted: Fri Sep 13, 2024 11:33 am
by sdwang
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
Re: Exciton weights
Posted: Mon Oct 07, 2024 3:20 pm
by palful
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
Re: Exciton weights
Posted: Tue Oct 08, 2024 3:57 am
by sdwang
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
Re: Exciton weights
Posted: Wed Oct 09, 2024 11:48 am
by palful
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
Re: Exciton weights
Posted: Thu Oct 10, 2024 2:50 am
by sdwang
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
Re: Exciton weights
Posted: Fri Oct 11, 2024 1:40 pm
by palful
Dear SD,
I have just released an updated version of yambopy (v0.4). If you reinstall the new version, now the inclusion of YamboQPDB in the band plot should work properly. Please let me know if this isn't the case.
Best,
Fulvio