Skip to content

Commit

Permalink
Add support for MP GGA Workflows (#1719)
Browse files Browse the repository at this point in the history
## Summary of Changes

Adds the MP GGA workflows. Closes #1716.

### Checklist

- [X] I have read the ["Guidelines"
section](https://quantum-accelerators.github.io/quacc/dev/contributing.html#guidelines)
of the contributing guide. Don't lie! 😉
- [X] My PR is on a custom branch and is _not_ named `main`.
- [X] I have used `black`, `isort`, and `ruff` as described in the
[style
guide](https://quantum-accelerators.github.io/quacc/dev/contributing.html#style).
- [x] I have added relevant, comprehensive [unit
tests](https://quantum-accelerators.github.io/quacc/dev/contributing.html#unit-tests).

### Notes

- Your PR will likely not be merged without proper and thorough tests.
- If you are an external contributor, you will see a comment from
[@buildbot-princeton](https://github.com/buildbot-princeton). This is
solely for the maintainers.
- When your code is ready for review, ping one of the [active
maintainers](https://quantum-accelerators.github.io/quacc/about/contributors.html#active-maintainers).

---------

Co-authored-by: deepsource-autofix[bot] <62050782+deepsource-autofix[bot]@users.noreply.github.com>
  • Loading branch information
Andrew-S-Rosen and deepsource-autofix[bot] authored Feb 17, 2024
1 parent 12710a0 commit 6bfdc33
Show file tree
Hide file tree
Showing 10 changed files with 489 additions and 124 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,13 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
- Added a `store_intermediate_files` keyword option to `quacc.runners.ase.run_opt()` to allow for storing of the logfiles in intermediate geometry optimization steps.
- Added support for Pymatgen-based input sets in VASP jobs
- Added an MP meta-GGA VASP static job
- Added MP GGA relax job, MP GGA static job, and MP GGA relax flow
- Added a validity checker on CLI parameters

### Changed

- Changed the default ASE optimizer from `FIRE` to `BFGS` for most recipes
- Changed the VASP `DoubleRelaxSchema` to be consistent between flows

### Fixed

Expand Down
3 changes: 3 additions & 0 deletions docs/user/recipes/recipes_list.md
Original file line number Diff line number Diff line change
Expand Up @@ -238,6 +238,9 @@ The list of available quacc recipes is shown below. The "Req'd Extras" column sp
| VASP Slab Relax | `#!Python @job` | [quacc.recipes.vasp.slabs.relax_job][] | |
| VASP Bulk to Slabs | `#!Python @flow` | [quacc.recipes.vasp.slabs.bulk_to_slabs_flow][] | |
| VASP Slab to Adsorbates | `#!Python @flow` | [quacc.recipes.vasp.slabs.slab_to_ads_flow][] | |
| VASP MP GGA Relax | `#!Python @job` | [quacc.recipes.vasp.mp.mp_gga_relax_job][] | |
| VASP MP GGA Static | `#!Python @job` | [quacc.recipes.vasp.mp.mp_gga_static_job][] | |
| VASP MP GGA Relax Workflow | `#!Python @flow` | [quacc.recipes.vasp.mp.mp_gga_relax_flow][] | |
| VASP MP Meta-GGA Prerelax | `#!Python @job` | [quacc.recipes.vasp.mp.mp_metagga_relax_job][] | |
| VASP MP Meta-GGA Relax | `#!Python @job` | [quacc.recipes.vasp.mp.mp_metagga_relax_job][] | |
| VASP MP Meta-GGA Static | `#!Python @job` | [quacc.recipes.vasp.mp.mp_metagga_static_job][] | |
Expand Down
20 changes: 20 additions & 0 deletions src/quacc/calculators/vasp/params.py
Original file line number Diff line number Diff line change
Expand Up @@ -286,6 +286,26 @@ def remove_unused_flags(user_calc_params: dict[str, Any]) -> dict[str, Any]:
return user_calc_params


def normalize_params(user_calc_params: dict[str, Any]) -> dict[str, Any]:
"""
Normalizes the user-provided calculator parameters.
Parameters
-------
user_calc_params
The user-provided calculator parameters.
Returns
-------
dict
The updated user-provided calculator parameters.
"""
for k, v in user_calc_params.items():
if isinstance(v, str):
user_calc_params[k] = v.lower()
return user_calc_params


def set_auto_dipole(
user_calc_params: dict[str, Any], input_atoms: Atoms
) -> dict[str, Any]:
Expand Down
7 changes: 5 additions & 2 deletions src/quacc/calculators/vasp/vasp.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
from quacc.calculators.vasp.params import (
get_param_swaps,
get_pmg_input_set_params,
normalize_params,
remove_unused_flags,
set_auto_dipole,
set_pmg_kpts,
Expand Down Expand Up @@ -286,5 +287,7 @@ def _cleanup_params(self) -> None:
self.user_calc_params, self.pmg_kpts, self.input_atoms, self.incar_copilot
)

# Remove unused INCAR flags
self.user_calc_params = sort_dict(remove_unused_flags(self.user_calc_params))
# Clean up the user calc parameters
self.user_calc_params = sort_dict(
normalize_params(remove_unused_flags(self.user_calc_params))
)
3 changes: 1 addition & 2 deletions src/quacc/recipes/vasp/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -173,6 +173,5 @@ def double_relax_job(
copy_files=[Path(summary1["dir_name"]) / "WAVECAR"],
**relax2_kwargs,
)
summary2["relax1"] = summary1

return summary2
return {"relax1": summary1, "relax2": summary2}
Loading

0 comments on commit 6bfdc33

Please sign in to comment.