-
Notifications
You must be signed in to change notification settings - Fork 891
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
Add support for vaspout.h5, improvements to potcar handling #3680
Conversation
…tcar class, standardize potcar checking
Signed-off-by: Aaron Kaplan <[email protected]>
there's going to be a new |
Signed-off-by: Aaron Kaplan <[email protected]>
Important Auto Review SkippedDraft detected. Please check the settings in the CodeRabbit UI or the To trigger a single review, invoke the Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (invoked as PR comments)
Additionally, you can add CodeRabbit Configration File (
|
This isn't super urgent for release. What I'd like to do is ensure that this works across a wider variety of vaspout's, and make sure that all fields currently included in the vaspout are being mapped correctly to the PMG object Rn, it doesn't seems like vaspout.h5 has the same level of detail as vasprun.xml so figuring out a way to handle that would also be good |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Following features can be included to extract information from one-shot band-structure calculation.
pymatgen/io/vasp/outputs.py
Outdated
|
||
|
||
@requires(h5py is not None, "h5py must be installed to read vaspout.h5") | ||
class Vaspout(Vasprun): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You can add following parameter and attributes to the class.
dos_kpoints_opt
eigenvalues_kpoints_opt
projectors_kpoints_opt
It will be useful in case of one-shot calculation of bandstructure. Particularly, it is useful while doing HSE calculations (ref), which requires adding the kpoints with fake weights for hartree-fock calculations(ref). One-shot calculations reduces the two step calculations to one-step with two kpoints file, i.e.,KPOINTS
andKPOINTS_OPT
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah I'll get on this next, will also bring the PR up to date with #3509
Thanks for this PR @esoteric-ephemera. Do you happen to know if magnetic moments are now stored in the vaspout.h5? Previously these were not available in the vasprun.xml, although perhaps they have since been added and we haven't noticed. I do see a |
Hi @mkhorton, yes both the magnetic moments and charges are stored in vaspout.h5, and thankfully to normal floating point precision I need to revisit this PR soon - will try to this week or next |
e3fbc67
to
41e6d99
Compare
Saw this is stale, that's no problem but wondered if you were expecting any updates to this. I saw VASP 6.5 is out with some further hdf5 support. More generally, given there is now first-party support for parsing from the VASP developers in |
Sorry @mkhorton, I'll try to get this synced up tomorrow to merge. The only thing I wanted to add was KPOINTS_OPT parsing, which I think I have enough test files for In general, I don't think we can nor want to chase VASP's support for their own schemas but that's a discussion worth having with the p4vasp team |
Hey @mkhorton @shyuep - I think this is ready for review. Some features are missing to bring Either way, I think it's best we have a template to add to / modify as |
Thanks. I will merge and release. I think we can do the usual approach of release first then iterate as necessary. It is a format still in flux but no reason why we cannot support it now first. |
Summary
The vaspout.h5 file appears to be a replacement for / supplement to the vasprun.xml file, and has been available in certain VASP versions >= 6. This PR aims to add support for parsing this file.
However the vaspout.h5 file appears to be still in development. For example, no electronic self-consistency info is included in it as of 11 April, 2024, but there is a PR on VASP's py4vasp GH to add OSZICAR info to vaspout.h5
Major changes:
pymatgen.io.vasp.outputs.Vaspout
. This subclassesVasprun
in the spirit that the two should contain roughly the same information now..from_str
method topymatgen.io.vasp.inputs.Potcar
(needed because vaspout.h5 stores the complete potcar as a str)store_potcar
, to enable/disable storing the full POTCAR or its just specionic_step
now hassite_properties
with the s, p, d,...-resolved andtot
charge / magnetization, if applicable. This is the same format asOutcar.charge
andOutcar.magnetization
, but added as a site property at each ionic step instead of a top-level attr for only the final structureSome related changes for VASP I/O
spec
attr toPotcarSingle
andPotcar
. This standardizes the POTCAR spec attr added to vasprun.xml and vaspout.h5 objectsfrom_spec
method toPotcar
, which attempts to generate a POTCAR with a consistent functional just from the spec. Note that multiple matches are possible, this only takes the first consistent match.Todos