excitons on bands - 5% treshold

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
User avatar
malwi
Posts: 36
Joined: Mon Feb 29, 2016 1:00 pm

excitons on bands - 5% treshold

Post by malwi » Mon Feb 26, 2024 7:10 pm

Dear Developers,

I run the example of Yambopy (exciton intro 2)
https://www.yambo-code.eu/wiki/index.ph ... _databases
I do it for my case which is a multiexciton, namely the first bright exciton has a wide multipeak amplitude over almost whole k-points (molecular crystal case).
How can I decrease the treshold of 5% that is in in Yambopy?
I obtained grey bands and no red contribution.

Best regards,
Gosia
dr hab. Małgorzata Wierzbowska, Prof. IHPP PAS
Institute of High Pressure Physics Polish Academy of Sciences
Warsaw, Poland

rreho
Posts: 13
Joined: Mon Apr 26, 2021 3:39 pm

Re: excitons on bands - 5% treshold

Post by rreho » Tue Feb 27, 2024 9:15 am

Dear malwi,
You can play with the `size` in the call to `plot_ax(ax,c_bands='grey',c_weights='red',alpha_weights=0.5, size = 10)` to see if you have any "red contribution" at all.
I hope this is helpful.

If you have specific needs, you can try to return the `fig` and `ax` object in the`plot_ax` method, which is in `yambopy/plot/bandstructure.py`

Best,
Riccardo

User avatar
malwi
Posts: 36
Joined: Mon Feb 29, 2016 1:00 pm

Re: excitons on bands - 5% treshold

Post by malwi » Tue Feb 27, 2024 11:24 am

Dear Riccardo,

thank you very much for the reply, however the problem is deeper.
I played with the figure options, size, axes etc.....

However, it is still not present because of data passed from the ypp
- this is what I think.

When using ypp -e a to calculate amplitude of the first bright exciton,
I needed to set 0.001 to see the contributions (via option weights_treshold)
while the default is 0.05.

I think that this 5% treshold is present in yambopy.... somehow.... I do not know how....
I hope we can fix the change to lower because it is really needed.

Best regards,
Gosia
dr hab. Małgorzata Wierzbowska, Prof. IHPP PAS
Institute of High Pressure Physics Polish Academy of Sciences
Warsaw, Poland

User avatar
malwi
Posts: 36
Joined: Mon Feb 29, 2016 1:00 pm

Re: excitons on bands - 5% treshold

Post by malwi » Tue Feb 27, 2024 1:23 pm

Dear Riccardo,

please let me add more info:

My amp.in for ypp is:

excitons # [R] Excitonic properties
amplitude # [R] Amplitude
States= "2 - 2" # Index of the BS state(s)
BSQindex= 1 # Q-Index of the BS state(s)
Degen_Step= 0.010000 eV # Maximum energy separation of two degenerate states
Weight_treshold = 0.001 # treshold for contribution

In the result, I get 94 contributions with weights between 0.002 and 0.003
and 434 contributions between 0.002 and 0.001.

I set size = 1000 in

if Bands_Plot_Interpolate:
fig = plt.figure(figsize=(3.5,7.))
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=10,f=None,size=1000.0,verbose=True)
exc_on_bands.plot_ax(ax,c_bands='grey',c_weights='red',alpha_weights=1.0)

ax.set_ylim(-1.5,5.0)
plt.ylabel("Energy (eV)")
fig.savefig("/net/ascratch/people/plgmalwi/Cov/c/bands-exc-3.pdf", backend='pdf')

and still only grey lines, no trace of red signal.


Please help ;-)

Gosia
dr hab. Małgorzata Wierzbowska, Prof. IHPP PAS
Institute of High Pressure Physics Polish Academy of Sciences
Warsaw, Poland

rreho
Posts: 13
Joined: Mon Apr 26, 2021 3:39 pm

Re: excitons on bands - 5% treshold

Post by rreho » Wed Feb 28, 2024 9:20 am

Hi,
I see now what you want to do. However, to the best of my knowledge, there is a not a direct and easy way to tune this weight_threshold in yambopy.
I tried to add this line in the tutorial script:
```print(yexc.get_exciton_weights(states))```
and you can clearly see that you have all the weights that you want, regardless of any threshold.

Nevertheless, what I meant was to keep the size in the call to `interpolate` with a reasonable value like 0.5 or 1.0 and change the size in the call to `plot_ax`.
By changing the size in the call to 'plot_ax' I think you should also get the contribution with low weight.
Your script should look like this :
```
exc_on_bands = yexc.interpolate(yel,path,states,lpratio=10,f=None,size=0.5,verbose=True)
print(yexc.get_exciton_weights(states))
exc_on_bands.plot_ax(ax,color_bands='grey',c_weights='red',alpha_weights=0.5, size=100) # tune size here!
```
Let me know if that helps.

User avatar
malwi
Posts: 36
Joined: Mon Feb 29, 2016 1:00 pm

Re: excitons on bands - 5% treshold

Post by malwi » Wed Feb 28, 2024 11:03 am

Dear Riccardo,

Thank you very much, it works!

I attach the plot.

Have a nice day,
Gosia
bands-exc-3.pdf
You do not have the required permissions to view the files attached to this post.
dr hab. Małgorzata Wierzbowska, Prof. IHPP PAS
Institute of High Pressure Physics Polish Academy of Sciences
Warsaw, Poland

rreho
Posts: 13
Joined: Mon Apr 26, 2021 3:39 pm

Re: excitons on bands - 5% treshold

Post by rreho » Thu Feb 29, 2024 9:15 am

Hi,
Happy that it worked.
The plot looks reasonable to me.

Post Reply