-
Notifications
You must be signed in to change notification settings - Fork 23
Some progress in Phys excph #70
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: bug-fixes
Are you sure you want to change the base?
Conversation
Merged progress on exc-ph coupling
… Luminescence class
|
Hi Fulvio, Thank you very much for the review. Firstly, I think we should break this PR as this is too large to review. I will reopen my old #57 PR and we can first merge it and later slowly add exph after testing. I also like Riccardo's docs, but better to separate it out. Dependencies :
Degeneracy_finder
Exciton spin
Exciton wave functions in real space
Regarding the exph implementation, I never had enough time to check/test Riccardo's implementation. I was expecting that they will work as they were directly taken from my PhD scripts repo and modified to use the new yambopy functionality such as wfdb class, new exciton functions etc. Something is not done correctly in that class. I checked with my old PhDscripts, I get similar to yambo figure. Nevertheless, we can also implement the entire exph quickly with the barebones in few lines like the below. import numpy as np
from yambopy import YamboLatticeDB,YamboWFDB, \
LetzElphElectronPhononDB,YamboDipolesDB, YamboExcitonDB
from yambopy.bse.exciton_matrix_elements import exciton_X_matelem
from yambopy.bse.rotate_excitonwf import rotate_exc_wf
path = '.'
bands_range=[24,28]
bsepath = f'{path}/GW_BSE'
#bsepath = f'{path}/bse_q0bar_finiteqfull'
savepath = f'{path}/SAVE'
ns_db1 = f'{savepath}/ns.db1'
ns_wf = f'{path}/SAVE/ns.wf'
ndb_elph = f'{path}/ndb.elph_s' # k-q -> k
#ndb_elph = f'{path}/kpq_elph/ndb.elph' # k -> k+q
ndb_dipoles=f'{path}/ndb.dipoles'
# Read lattice
lattice = YamboLatticeDB.from_db_file(filename=ns_db1)
# Read electron-phonon
elph = LetzElphElectronPhononDB(ndb_elph,read_all=False)
# Read wave functions
wfcs = YamboWFDB(filename='ns.wf',save=savepath,latdb=lattice,bands_range=bands_range)
## load exe dbs
exdbs = []
for ik in range(wfcs.nkpoints):
filename = 'ndb.BS_diago_Q%d' % (ik+1)
excdb = YamboExcitonDB.from_db_file(lattice, filename=filename,
folder=bsepath,
Load_WF=True, neigs=10)
exdbs.append(excdb)
exph_mat = []
Dmats = wfcs.Dmat()
# compute ex-ph
for iq in range(elph.nq):
ph_eig, elph_mat = elph.read_iq(iq,convention='standard')
elph_mat = elph_mat.transpose(1,0,2,4,3)
#
idx_BZq = wfcs.kptBZidx(elph.qpoints[iq])
iq_isymm = lattice.symmetry_indexes[idx_BZq]
iq_iBZ = lattice.kpoints_indexes[idx_BZq]
trev = (iq_isymm >= len(lattice.sym_car) / (1 + int(np.rint(lattice.time_rev))))
symm_mat_red = lattice.lat@lattice.sym_car[iq_isymm]@np.linalg.inv(lattice.lat)
#
exe_iqvec = wfcs.kpts_iBZ[iq_iBZ]#exdbs[iq_iBZ].car_qpoint
#
Akq = rotate_exc_wf(exdbs[iq_iBZ].get_Akcv(),symm_mat_red,wfcs.kBZ,exe_iqvec,Dmats[iq_isymm],trev,wfcs.ktree)
#
tmp_exph = 0.5 * exciton_X_matelem(np.array([0,0,0]), elph.qpoints[iq], Akq, exdbs[0].get_Akcv(), elph_mat,
wfcs.kBZ, contribution='b', diagonal_only=False, ktree=wfcs.ktree)
## 0.5 for Ry to Ha.
exph_mat.append(tmp_exph)
exph_mat = np.array(exph_mat).transpose(0,1,3,2) #(q,nmmodes, initial (Gamma), final (Q))
np.save('Ex-ph.npy',exph_mat)The above code is consistant with PhD scripts and is gauge invariant. It also does not depend on what convention we use for letz code. Below is what you get from the above script.
So I suggest, we start adding things slowly. ps. I tried the yambo_ph input, but I got bad values, not sure why (I used lumen ex-ph branch). If possible Could you please see if the above scripts exactly same figure? Edit: for the above script to work, you need to use PR #57 |
|
Hi Murali, Thank you for your comments for reopening the old PR in a more digestible format. I will go ahead with that one for now and the we merge the exc-ph stuff in a subsequent PR (possibly this one). The branch exc-ph in lumen was recently merged by Davide starting from the one in my yambo fork. The latter is what I used for my tests. I will try to check this and understand what is going on. As for your test, it looks extremely similar to my yambo_ph test (scale and pattern are the same), although there may be some minor differences, to be checked. Now I go ahead with the other PR. |
I believe I fixed the bug relative to the k-space plot pointed out by @palful. Works both in the gamma only case or without. Passing by, I noted that the way I treat the various energy conversion in I still don't get why you include a 0.5 factor. I do not. Moreover, it appears that the absolute value displayed on the I would also like to emphasize that I made use of changes done in Anyway, whether this fixes the issue raised in the previous comment, I agree with you that we should first merge PR #57. In the meanwhile, I can clean this PR. |
|
Thank you Riccardo! Let me know when you finished the cleaning and please re-synchronize this with By the way: what do you mean when you say that there are discrepancies in energy conversion in the letzelphc db class? And which 0.5 factor are you referring to? |
|
The factor 0.5 has been solved, it was simply a energy conversion factor from Rydberg to Hartree that MN needed in his script. I cleaned the repo, I reproduce MN's plot and introduced a manager for abstract geometry class and IO. Before merging, we still have four problems:
|
|
regarding point 1)
|
|
Fixed shapes of eph_mat_iq with exciton_X_matelem. For testing, I had to reintroduced my own version of |
|
@palful I tested the latest version of |
|
Hi Riccardo, thanks a lot! Thanks also for your other comment on the lumen PR and checking the tutorial. I'm working on reconfiguring the IO of the dipoles part, I will let you know! |
|
Ok, so I updated In the process, I changed the class to use the Can you please try to merge this into the PR? Afterwards, I will check the rest! |
|
Impressive work @palful. I was expecting the dipoles to be a nightmare and it required several important decisions on the repo. Thanks! I merged, adapted my branch to your changes and tested (only) that I reproduce the excph plot above. I also add to change slightly the import orders bsekerneldb.py and dipolesdb.py which I believe was a bug present in Let me also state something that has never been mentioned in this PR. We have not included the direct term in the routines related to the computation of luminescence and we have only the phonon-assisted terms. |
|
I fixed the import bug you mention, I was using
instead of the better
No need to change the order in this way. For the PL comment, you're right. There are many things that could be added including cumulant expansion, calculation of the exciton renormalization factor, etc. For this PR let us focus on the satellites only, but we can add features later! |
|
I added the direct PL term following formula 17 here https://arxiv.org/pdf/2212.10407 (to be checked). |
|
Hi all, I decided to go with a lighter implementation for various reasons. First, I was still getting discrepancies in the excph matrix elements and luminescence as coded in this PR. So in the end I think the simpler the better. And also, with a large addition to the code, if stuff doesn't work, it's very difficult to understand what is going wrong. I have repurposed some of the old scripts by Murali. I will be putting up a different PR soon for you to review! |
|
Hi, I am surprised about those discrepancies, but I'll wait for the new PR to test there whether everything works. |



This PR builds upon the work initiated by @muralidhar-nalabothula in #57, and introduces several new features and improvements related to exciton-phonon interactions and phonon-assisted photoluminescence.
Summary of Changes
New post-processing module: Added a dedicated folder and object for computing phonon-assisted photoluminescence (PL) based on optical property outputs.
Exciton-phonon coupling: Implemented optimized routines to compute exciton-phonon coupling within yambopy.
I/O improvements: Fixed data-type inconsistencies and improved reading/writing for several existing classes, notably LetzElPhCode and excitonDB, ensuring precision consistency across modules.
Documentation:
A draft tutorial notebook,
exciton_phonon.ipynb, showcasing the new functionality is available.This notebook can be built as part of the Qurex-Book using make book inside the docs folder (see PR #46).
The book is a work in progress but already includes this new example on phonon-assisted PL for hBN.
AUTHORS.md: Updated my affiliation.Next Steps Before Merging
I would like to:
Discuss potential improvements to the structure of folders and classes in yambopy, aiming for cleaner modularity and long-term maintainability.
Perform additional testing with users and various datasets.
Add features related to exciton symmetries.
Improve the
exciton_phonon.ipynbtutorial, which is currently a preliminary draft.Note!!!!
fix-eps2should be merged, then this one.-The interface to Wannier90 is not yet included in this PR. I am holding off on pushing it until further development, but I hope to integrate it in the near future.