Skip to content
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

use ypp or yambopy to plot BSE spectra? #263

Open
mikibonacci opened this issue Dec 19, 2024 · 6 comments
Open

use ypp or yambopy to plot BSE spectra? #263

mikibonacci opened this issue Dec 19, 2024 · 6 comments
Assignees

Comments

@mikibonacci
Copy link
Member

mikibonacci commented Dec 19, 2024

should be yambopy, as then we can play with parameters without submitting any other job (that's the main point of using yambopy).

the issue is that in yambopy I get peak intensities which are not in agreement with what I obtain in o-eps... seems we miss the dipole strengths

@mikibonacci mikibonacci self-assigned this Dec 19, 2024
@sangallidavide
Copy link
Member

Ciao Miki, a comment on this point.

I totally agree that for plotting the absorption spectrum (or other derived quantities) yambopy is the best tool, at lest when the yambo solver provides eigenvalues and eigenvectors (not in the Haydock case for example).

We discussed this also with @palful in the past. Note, he recently fixed an issue with the peak intensities, not sure if it is the same you are mentioning here.

@palful
Copy link
Member

palful commented Dec 19, 2024

Ciao Miki,

Yeah unfortunately we were always plagued by prefactor inconsistencies with the yambo output.
As of now, in principle for the BSE case (both 2D and 3D) and for the IP case (only 3D) the spectra between yambo and yambopy should be in agreement... while we still have an unsolved issue for the IP-2D case. This was the situation after the last related issue, now closed, here: yambo-code/yambopy#24

If you instead find something different, can you post the related test?

Now the IP and BSE spectra plots are handled internally by YamboDipolesDB and YamboExcitonDB by separate methods that prepare the specific input arguments, including dimensional prefactors, and then construct the spectra.

However, I am planning to remove this and rely instead on a more general spectra / DOS plotting function valid for anything, from DOS to BSE absorption to phonon Eliashberg functions, etc. This is already coded here: https://github.com/yambo-code/yambopy/blob/master/yambopy/plot/spectra.py

EDIT for @sangallidavide : it would be nice to have clear, practical notes on how alpha_2D is computed in yambo for 2D systems, and its relation with eps_2D so that it can be added as a yambopy (default) option. Also, this is a really frequently asked question by confused users. Now in yambopy we are computing eps_2D.

@mikibonacci
Copy link
Member Author

Ciao @sangallidavide and @palful,

thanks a lot for the comments. The situation I am studying is very simple, just absorption in bulk Silicon.
The plotting code is the following:

# directly yambo: 
eps = np.loadtxt(main_dir+'/o-aiida.out.eps_q1_diago_bse')

# with yambopy:
lattice = YamboLatticeDB.from_db_file(filename=main_dir+'/SAVE/ns.db1')
bse = YamboExcitonDB.from_db_file(
    lattice,
    filename='ndb.BS_diago_Q1',
    folder=main_dir+'/aiida.out',
)

# compute the chi - the imag should be Abs
E, chi = bse.get_chi(broad=0.1)

and the resulting plot is (after having multiplied the yambopy result x10):

output

It can be that I am doing some dummy error in the yambopy part. I am looking into this. However, I see that the information on the eigenvectors is never used. I mean, we use the l_residuals and r_residuals, but it seems not reproduce the right peak intensities. Or at least what I expect to.
I am using yambopy master branch and yambo 5.1.0

@palful
Copy link
Member

palful commented Dec 19, 2024

Ok this is quite strange. The residuals are already the dipoles rotated in the excitonic basis, so the eigenvector information is already inside.

@mikibonacci mikibonacci reopened this Dec 19, 2024
@sangallidavide
Copy link
Member

Can you write:

  • the yambo version
  • the equations used by yambopy to reconstruct the spectrum

@mikibonacci
Copy link
Member Author

Thanks a lot both for looking into this.
As I said here, yambo is 5.1.0, yambopy is master branch, i.e. the equations are here. It is not really an urgent issue (I was basically opening the issue to have a reminder for myself - I am restructuring aiida-yambo), yet quite puzzling. For the near future I will use yambo to obtain spectra, and try to understand what is going on.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants