Exciton residuals with yambopy

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
mrefiore
Posts: 8
Joined: Thu Sep 12, 2019 6:55 pm

Exciton residuals with yambopy

Post by mrefiore » Sat Feb 19, 2022 12:32 pm

Dear yambopy developers and users,

I would like to obtain the exciton Residuals values I get from ypp sort by using the methods in yambopy. For instance, in an E_sorted output file for a calculation on MoS2 monolayer, I read
# Maximum Residual Value = .10860E+00
#
# E [ev] Strength Index
#
1.9491466 0.28264236E-10 1.0000000
1.9498562 0.25957868E-10 2.0000000
1.97526753 0.198694035 3.00000000
so that, for example, the residual for exciton state 3 is Maximum Residual Value*Strength[3] = 0.02157817.

However, if I read the residuals in yambopy and apply all the prefactors as in the get_chi method in excitondb.py, i.e.
d3k_factor = yexc.lattice.rlat_vol/yexc.lattice.nkpoints
yexc.l_residual*yexc.r_residual*spin_degen/(2*np.pi)**3 * d3k_factor * (4*np.pi) / q0norm**2
where yexc is a YamboExcitonDB object, I get a very different value, 0.00186290.

I'm pretty sure I'm missing some factors, however I haven't been able to figure out what and where.
Could you please help me out? Thank you very very much for your attention!

Michele
---
Michele Re Fiorentin, PhD
Center for Sustainable Future Technology CSFT@PoliTo
Italian Institute of Technology

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

Re: Exciton residuals with yambopy

Post by palful » Mon Feb 21, 2022 5:46 pm

Ciao Michele,

In general the intensities in the "E_sorted" are just the residuals "squared" normalised by the maximum, i.e.,

Code: Select all

intensities = yexc.l_residual*yexc.r_residual
intensities = intensities/np.max(intensities)
In particular, this is calculated by the get_intensities method in YamboExcitonDB. The dimensional prefactors you mention are not used by ypp in determining the maximum value or writing the sorted file.

Within yambopy, you have two ways of reproducing exactly the ypp output. Either call directly the get_intensities method, or use the get_sorted method which already returns the two lists of sorted energies and sorted intensities.
Below you can see an example script (you can select at the beginning the Q point you want to analyse).

In case this does not solve your issue - e.g. you still find discrepancies - please let us know.

Cheers,
Fulvio

Code: Select all

from yambopy import *

# databases
ns_db1='SAVE/ns.db1'
exc_db='bse/ndb.BS_diago_Q'

# BSE Q
Q=1

# Create class objects
ylat = YamboLatticeDB.from_db_file(filename=ns_db1)
yexc = YamboExcitonDB.from_db_file(ylat,filename='%s%d'%(exc_db,Q))

# Method 1: use get_sorted
## exc_e is [(energies, index) ... ] sorted from lowest to highest
## exc_i is [(intensities, index) ...] sorted from highest to lowest
exc_e,exc_i = yexc.get_sorted()

# Method 2: reproduce ypp -e s "E_sorted" file
intensities = yexc.get_intensities()
for i in range(yexc.nexcitons): print('%f   %f   %d'%(yexc.eigenvalues[i].real,intensities[i].real,i+1))
Dr. Fulvio Paleari
S3-CNR Institute of Nanoscience and MaX Center
Modena, Italy

Post Reply