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

DOS plot from DOSCAR(.lobster) #237

Open
joerivan opened this issue Mar 18, 2024 · 5 comments
Open

DOS plot from DOSCAR(.lobster) #237

joerivan opened this issue Mar 18, 2024 · 5 comments

Comments

@joerivan
Copy link

The projections built into VASP are not always ideal, there can be significant charge spilling. Codes like lobster (cohp.de) are known to have less spilling because of more specialized projections.

My feature suggestion is thus for sumo to be able to read DOSCAR (or DOSCAR.lobster) files for the sumo-dosplot.

Currently, sumo can only read in vasprun.xml(.gz) but the DOSCAR file should contain the same information needed for the DOS plot.

With lobster you can specify a larger set of atomic orbital basis functions meaning that the projection is not just s,p,d but also has principle quantum numbers. This would mean that the dosplot would need to account for this.

The compatibility with lobster is not that important but having the ability to read DOSCAR files would in my opinion improve sumo.

@ajjackson
Copy link
Member

I'm not sure I follow what information is in DOSCAR but not in the vasprun.xml? If the reason is to support import of non-standard DOSCAR files then it is difficult to support/test it reliably. In custom cases users may as well write a few lines of python to load the data with np.genfromtxt and plot with Matplotlib. Sumo-compatible styling can be managed by stealing the Sumo style sheets (see below!)

In the specific case of LOBSTER functionality, I would prefer that people use the Lobsterpy package which is intended for this, and raise Issues there if something is not working nicely https://github.com/JaGeo/LobsterPy

It uses the same matplotlib style sheet system as Sumo, so for consistent-looking results you can use the --style argument and point it at some of the Sumo style files.
(They are found in the Sumo package under sumo/plotting, or you could directly download the mplstyle files from https://github.com/SMTG-Bham/sumo/tree/master/sumo/plotting.)

https://jageo.github.io/LobsterPy/reference/cli_subcommands/plot.html

@joerivan
Copy link
Author

I was not aware of the Lobsterpy package, thanks for help.

My main reason for suggesting it was that reading the DOSCAR file makes sumo more versatile and gives the user more choice.

Additionally (but I didn't state that before) the DOSCAR files are way smaller than vasprun.xml. When running a lot of jobs one can then save the smaller DOSCAR files and free up some space.

Regardless, because of your answer for me it has been cleared up and this issue can be closed.

@ajjackson
Copy link
Member

The trade-off between user choice and maintainability can be a difficult one! A couple of useful principles are to avoid redundancy and make use of existing tools where appropriate. But it is not always so clear-cut...

Re: disk space, I think it is possible to read gzipped files (e.g. vasprun.xml.gz) which may help.

@utf utf reopened this Mar 18, 2024
@utf
Copy link
Member

utf commented Mar 18, 2024

I might reopen this. There is tight integration with lobsterpy and pymatgen, so it might be easier to add lobster support than we think.

I'll have a play around with this if I get some time.

@ajjackson
Copy link
Member

ajjackson commented Mar 18, 2024

I don't see what Sumo would bring to the table: lobsterpy already does the orbital analysis and has a styleable CLI for plotting. If there are some tweaks to make it prettier or more user-friendly I'd rather see them go there.

(Additional context: I implemented the sumo-like styled plotting for lobsterpy, and tested it with Sumo stylesheets...)

If we would like to have a generic "plot whatever columns are in the DOSCAR" feature, I propose that it is not sumo-dosplot, but some separate sumo-generic-plot that has a simple interface, and basically plots anything that can be read with np.genfromtxt with minimal intelligence. That could be a handy general tool.

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