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

No way to plot bands written by save_bands #1052

Open
Technici4n opened this issue Jan 29, 2025 · 4 comments
Open

No way to plot bands written by save_bands #1052

Technici4n opened this issue Jan 29, 2025 · 4 comments

Comments

@Technici4n
Copy link
Contributor

I am trying to save bands to a jld2 file with save_bands, however if I do that I can't seem to easily load them for plotting with DFTK later? 😄

@mfherbst
Copy link
Member

Yeah that's currently not possible. Feel free to suggest something. May involve finally changing from named tuples to something else for holding scf results and bands.

@Technici4n
Copy link
Contributor Author

The biggest problem seems to be that the basis is not saved. I'm sure we can continue without a dedicated struct for a while if we want to. 😄

@niklasschmitz
Copy link
Collaborator

niklasschmitz commented Jan 31, 2025

I also ran into this today. A load_bands being a stripped down version of load_scfres sounds useful. The basis can be reconstructed from the current format with load_basis from the JLD2Ext. What currently seems to work:

band_data = compute_bands(scfres)
save_bands("bands.jld2", band_data)
jld = jldopen("bands.jld2")
basis = Base.get_extension(DFTK, :DFTKJLD2Ext).load_basis(jld) 

@mfherbst
Copy link
Member

We can certainly hack something, but in principle I dont see why plotting the bands needs a basis if the bands eigenvalues are already computed.

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