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

148 handle changing symmetries in vasp #150

Open
wants to merge 11 commits into
base: develop
Choose a base branch
from

Conversation

ndaelman-hu
Copy link
Contributor

Tackle changing symmetries (and k-point set) between ionic updates in newer VASP versions (about 6).
This solution packages kpoints into lists matching the no. calculations. The cases of single-point calculations and the older format are also handled (for vasprun.xml). No explicit information about the version is used.

Closes #148

@ndaelman-hu ndaelman-hu self-assigned this Aug 18, 2023
@ndaelman-hu
Copy link
Contributor Author

@ladinesa Should I add the test referenced in the original issue?

- Tie each `kpoints` to `eigenvalues` on a `n_calc` base
TODO: distinguish for the case of single-point calculations
@ndaelman-hu ndaelman-hu force-pushed the 148-handle-changing-symmetries-in-vasp branch from 5595e1f to 3906e81 Compare August 18, 2023 16:46
self._kpoints_info = []
for kpts_occs in self.parser.get('kpoints'):
if kpts_occs is not None:
self._kpoints_info.append({})
Copy link
Collaborator

@ladinesa ladinesa Aug 18, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

probably define info = {} then append this later. Is there no info about the iter #? I am just worried that the kpoint does not match the step. If there is none maybe put a check that len(kpoint_info) == len(calcs)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've only seen 2 cases up to now: the k-points are only updated once, or they are updated at each ionic update.
I am storing the index now, and will consider using it for safety checks.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Btw, in vasprun.xml, it's rather the eigenvalues that are out of sync with the no. steps.

Copy link
Contributor Author

@ndaelman-hu ndaelman-hu Aug 30, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pls, take a look at my comment below. Personally, I think we can go without any iteration index.
Or would you rather than a list, prefer a dict with a clearer index?

Instead, I'd rather have a way of moving k-points under calculation, but this isn't self-evident for OUTCAR.

@@ -1032,39 +1033,51 @@ def n_calculations(self):
'listgenerated': 'Line-path',
}

def _find_kpoints(self) -> list[str]:
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i do not see this used anywhere except in kpoints_info. I suggest not defining this.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could move it into kpoints_info().
While I get the rationale behind reserving functions only for abstractions that are used more than once, I split it here for readability. This happens in other places of the VASP parser too. You let me know what you think.

@ladinesa
Copy link
Collaborator

Thanks for the fix. Please also add a test for this, maybe one outcar and one vasprun, you can also use this for the atom positions fix.

@ndaelman-hu
Copy link
Contributor Author

ndaelman-hu commented Aug 30, 2023

Something to consider in the future, when we clean the VASP parser.
The VASP mainfiles have very different structures. Just considering the case of the frequency analysis:

  • OUTCAR: k-points and eigenvalues are repeated for each ionic update + k-points are repeated at the end
  • vasprun.xml: k-points (list) are repeated at each ionic update + at the beginning (under <incar>). The (electronic) eigenvalues are only printed in the last calculations step (maybe also for under the projected tag)

When it comes to eigenvalues, we mostly just need the no. irreducible k-points (at that step) to restructure the eigenvalues.
Atm, we are extracting all the k-points in full, at each step, and this might be overkill. Full extraction is only needed at the last step.

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

Successfully merging this pull request may close these issues.

Handle changing symmetries in VASP
2 participants