DFTK.jl icon indicating copy to clipboard operation
DFTK.jl copied to clipboard

Refactor `plot_bandstructure` interface

Open mfherbst opened this issue 4 years ago • 5 comments

I've become a little unhappy about the plot_bandstructure interface, especially the fact that the kline_density has so strange units. When Brillouin.jl is used this should be refactored.

mfherbst avatar Jul 23 '21 19:07 mfherbst

When you have Brillouin.jl as a dependency, its plotting facilities might be relevant to this issue (if nothing else, maybe inspiration).

The design idea there was to keep the k-path as a structure and then use that to dispatch on to generate nice band structure plots. There's currently only one backend though (PlotlyJS.jl, accessed via Requires.jl).

thchr avatar Oct 12 '21 16:10 thchr

Yes I have seen that, thanks. For sure the kpath and BZ plot might be very nice to expose. Perhaps also to integrate with you closer for the band structure plots.

I'm not sure if you are aware @thchr, but there currently is a bit of motion to build unified interfaces for materials modelling in Julia (e.g. see https://github.com/JuliaMolSim/AtomsBase.jl). This is all very much work in progress, but I think once that interface is a bit more settled it would be worth to revisit also ways to interface better between Brillouin and DFTK. I would definitely not mind to externalise some of our plotting ;).

mfherbst avatar Oct 13 '21 07:10 mfherbst

Yeah, I had just briefly seen it the other day: cool effort, definitely!

One thing that came to mind when I was browsing the code of AtomsBase.jl was that it might be nice for various crystallography-related packages to settle on some standard "back-bone" for how to specify and transform direct and reciprocal lattices. The motivation would be to reduce the setting-related uncertainty that we also discussed in #496. The implementations in Bravais might be suitable in that regard (e.g., in place of Box).

thchr avatar Oct 13 '21 19:10 thchr

The implementations in Bravais might be suitable in that regard (e.g., in place of Box).

Feel free to raise that aspect in AtomsBase.jl. Since AtomsBase is meant to be a bit more general (i.e. including molecular systems) I suppose it Bravais might not yet fit at the most general level, but I could imagine it to make sense to have a slightly more specialised implementation just for periodic problems ... and at that level Bravais could fit well, I agree.

mfherbst avatar Oct 14 '21 07:10 mfherbst

See the code in https://github.com/thchr/Brillouin.jl/blob/master/src/requires/plotlyjs_dispersion.jl

mfherbst avatar Jan 20 '22 07:01 mfherbst