plot of |A(v,c,k)| on the electronic band structure

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
widad
Posts: 2
Joined: Wed Oct 12, 2022 11:05 am

plot of |A(v,c,k)| on the electronic band structure

Post by widad » Fri Mar 28, 2025 2:08 am

Dear developers,

I am trying to plot of |A(v,c,k)| on the electronic band structure for exciton state of a WSe₂ monolayer using the plot-exciton.py script. However, I am encountering an issue where a spot extends vertically towards the bands instead of following the expected band shape.

Could you please help me understand what might be causing this and how to resolve it?

Best regards,

User avatar
Daniele Varsano
Posts: 4198
Joined: Tue Mar 17, 2009 2:23 pm
Contact:

Re: plot of |A(v,c,k)| on the electronic band structure

Post by Daniele Varsano » Fri Mar 28, 2025 9:25 am

Dear Widad,

please sign your post with your complete name and affiliation, this is a rule of the forum and you can do once for all by filling your signature in the suer profile.

Can you please post an example so that we can better understand the problem? From what you write it seems a problem of symbol size in the plot, and you can adjust it by changing/adding the size in exc_kspace_plot.py script, or maybe you need to activate the interpolation.

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/

widad
Posts: 2
Joined: Wed Oct 12, 2022 11:05 am

Re: plot of |A(v,c,k)| on the electronic band structure

Post by widad » Fri Mar 28, 2025 12:41 pm

Dear Dr. Varsano ,

Thank you very much for your reply , please find the attached example of WSe2 monolayre image , Could you please explain which parameter I have to adjust?
This is my script "plot-exciton.py"

---------------------------------------------------------------------------------------------------------------------------
# Load databases

# Electron energies database
elec = YamboElectronsDB.from_db_file(folder='')

# Lattice information
lat = YamboLatticeDB.from_db_file(filename='ns.db1')

# Exciton database read from db file
if os.path.isfile('BSE/ndb.BS_diago_Q01'):
yexc = YamboExcitonDB.from_db_file(lat,filename='ndb.BS_diago_Q01',folder='BSE')
if os.path.isfile('BSE/ndb.BS_diago_Q1'):
yexc = YamboExcitonDB.from_db_file(lat,filename='ndb.BS_diago_Q1',folder='BSE')

print("Ground state energy: %lf" % yexc.eigenvalues[0].real )
print("Intensity: %lf" % (yexc.get_intensities()[0].real+yexc.get_intensities()[1].real) )
print("1st-excited state energy: %lf" % yexc.eigenvalues[2].real )
print("Intensity: %lf" % (yexc.get_intensities()[2].real+yexc.get_intensities()[3].real) )

# List of states to be merged
states = [1,2]

# 1. Plot exciton weights in band structure NOT interpolated

exc_bands = yexc.get_exciton_bs(elec,path,states,size=1.0)
exc_bands.plot_ax(ax,c_bands='grey',c_weights='red')
plt.savefig('plot1.png')
plt.show()

# 2. Plot exciton weights in band structure INTERPOLATED

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_bands_inter = yexc.interpolate(elec,path,states,lpratio=10,f=None,size=10,verbose=True)

exc_bands_inter.plot_ax(ax,c_bands='black',c_weights='red',alpha_weights=0.5,c_label='$X_1$')
ax.set_ylim(-3.0,3.0)
plt.savefig('plot2.png')
plt.show()


# 3. Plot exciton weights in a 2D map of the BZ

fig = plt.figure(figsize=(4,4))
ax = fig.add_axes( [ 0.15, 0.15, 0.80, 0.80 ])

#yexc.plot_exciton_2D_ax(ax,states,mode='hexagon',limfactor=0.8,scale= 600)
yexc.plot_exciton_2D_ax(ax,states,limfactor=0.8,scale= 600)
plt.savefig('plot3.png')
plt.show()
------------------------------------------------------------------------------------------------------------------------------------------



Best wishes
Widad
You do not have the required permissions to view the files attached to this post.

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

Re: plot of |A(v,c,k)| on the electronic band structure

Post by palful » Fri Mar 28, 2025 4:15 pm

Dear Widad,

in exc_bands_inter.plot_ax() you can add a parameter called `size` (default is 1) to control the height of the weights.

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

Post Reply