-
Notifications
You must be signed in to change notification settings - Fork 133
Add NEB, ApproxNEB jobs / workflows #1007
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
Merged
esoteric-ephemera
merged 111 commits into
materialsproject:main
from
esoteric-ephemera:neb
Aug 11, 2025
Merged
Changes from 99 commits
Commits
Show all changes
111 commits
Select commit
Hold shift + click to select a range
73b28bf
add basic neb set and jobs
esoteric-ephemera 4ed1cd1
correct parsing of neb
esoteric-ephemera 8ac3f36
remove vasprun xml validator from NEB jobs - non-trivial to correct
esoteric-ephemera 420fa0d
fix automatic validator assignment
esoteric-ephemera 5527b26
fix syntax of VaspNebFilesValidator
esoteric-ephemera 27b44f4
gzip image dirs
esoteric-ephemera e19956b
first draft neb jobs for vasp + analysis
esoteric-ephemera 4501739
Merge remote-tracking branch 'origin/main' into approx_neb
hmlli 592e82f
[WIP] added ApproxNEB flow and jobs
hmlli 29359f4
Merge remote-tracking branch 'origin/main' into approx_neb
hmlli 84aea7d
[WIP] variable name change
hmlli 8847f49
redraft neb, better schemas dependent on emmet pr
esoteric-ephemera 63c266f
precommit
esoteric-ephemera 6b690a3
consistent capitalization / remove symlink
esoteric-ephemera 50cf12e
Merge branch 'materialsproject:main' into neb
esoteric-ephemera 83962fd
linting
esoteric-ephemera 3e75265
Add approxNEB workflows from @hmlli
esoteric-ephemera 85a02dd
precommit
esoteric-ephemera 42c158f
Merge branch 'main' into neb
esoteric-ephemera cde4ffb
add temporary emmet-core install for new doc schemas
esoteric-ephemera 31f5139
fix emmet-core git temp install
esoteric-ephemera 53703c8
fix emmet-core git temp install
esoteric-ephemera 9b88863
refactor approx neb
esoteric-ephemera aca40c6
partial precommit
esoteric-ephemera 10a3f9b
small fix
hmlli 0437c41
output.energy --> output.output.energy
esoteric-ephemera 44364bd
add option to get charge density just from chgcar, consistent with or…
esoteric-ephemera 505ceb5
move around charge density parsing to avoid needing to store in blob
esoteric-ephemera ca05afe
fix some typos in aneb
esoteric-ephemera 7bee40b
temp name change ep_output --> ep_structures
esoteric-ephemera e7b9390
string dict keys rather than ints ; move pydantic typing out of type_…
esoteric-ephemera 2ca71d5
try to get optional job logic working / better naming
esoteric-ephemera 9b496d5
partial lint
esoteric-ephemera a99d482
fix typing import
esoteric-ephemera 9aad2ec
fix typing import
esoteric-ephemera ff864cc
change image relax maker to use custodian double relax
esoteric-ephemera 105f7aa
partial lint
esoteric-ephemera 7a9fb93
ensure no vasp_gam cmd sent to custodian doublerelaxation job
esoteric-ephemera 2adb9cf
patch neb from endpoints job
esoteric-ephemera 433918f
fix document collation
esoteric-ephemera 3056ef9
tweak approx neb, ensure neb interpolation is enum
esoteric-ephemera 491795e
strip hostname in vasp neb postproces
esoteric-ephemera c55b2cd
tweak output parsing
esoteric-ephemera f69edbb
add VASP NEB tests
esoteric-ephemera c2978c1
partial lint
esoteric-ephemera f370324
add working approx neb test
esoteric-ephemera 29f5df7
partial lint
esoteric-ephemera fe16c70
move some vasp schemas to emmet; modify approx neb to allow for minim…
esoteric-ephemera 3bd358f
ruff
esoteric-ephemera 04c6dad
flesh out ase neb jobs, add option to ApproxNeb to start from migrati…
esoteric-ephemera c743c60
ApproxNEB --> ApproxNeb for consistent naming
esoteric-ephemera 68a87b0
ruff ruff ruff
esoteric-ephemera adec024
merge main / resolve conflicts
esoteric-ephemera 6980a49
default min_hop_distance for approxneb to be twice ionic radius
esoteric-ephemera d40b733
Merge remote-tracking branch 'upstream/main' into neb
esoteric-ephemera cb23484
unset host structure magmoms in approx neb endpoint calcs
esoteric-ephemera 225ed68
Merge remote-tracking branch 'upstream/main' into neb
esoteric-ephemera 0df629d
unset magmoms in image calcs - debugging to see where old and new app…
esoteric-ephemera 9fb978b
linting
esoteric-ephemera 88a03f9
add initial structures to approxneb output
esoteric-ephemera a7898c2
pcmt
esoteric-ephemera 9390942
Merge remote-tracking branch 'upstream/main' into neb
esoteric-ephemera 329fa00
refactor, add more output to collate results, add notes about failure…
esoteric-ephemera 3b0e5a2
precommit
esoteric-ephemera 8168097
Merge remote-tracking branch 'upstream/main' into neb
esoteric-ephemera fe38bde
Merge remote-tracking branch 'upstream/main' into neb
esoteric-ephemera 59c892b
first pass genericizing approx neb flows
esoteric-ephemera 3f1653e
precommit
esoteric-ephemera eed728b
add default option not to remap hops atomate style
esoteric-ephemera a63add9
fix approx neb from migration doc
esoteric-ephemera bed1a24
Merge remote-tracking branch 'upstream/main' into neb
esoteric-ephemera bda9c3c
cleanup/fix ApproxNeb single hop maker
esoteric-ephemera 66190d7
add missing names to single hop aneb flows
esoteric-ephemera fe2fa44
Merge remote-tracking branch 'upstream/main' into neb
esoteric-ephemera 1cc7888
Merge remote-tracking branch 'upstream/main' into neb
esoteric-ephemera a0faac7
add forcefield approx neb
esoteric-ephemera 1a8990f
precommit
esoteric-ephemera 46bf7d8
Merge remote-tracking branch 'upstream/main' into neb
esoteric-ephemera 89e4ba1
refactor aneb to be common
esoteric-ephemera 28592aa
correct from_migration_graph method on aneb flow
esoteric-ephemera 7943086
move neb base schemas to emmet-core
esoteric-ephemera 8d8d3d8
precommit
esoteric-ephemera ec936fc
add option to approx neb common maker to specify different endpoint r…
esoteric-ephemera 42fc0f5
Merge remote-tracking branch 'upstream/main' into neb
esoteric-ephemera 34f46e7
remove metadata in favor of top-level failure_reasons field
esoteric-ephemera 97014ed
fix trajectory observer and file naming
esoteric-ephemera 5d4c011
update test data to reflect emmet schema changes
esoteric-ephemera b156e70
resolve merge conflicts
esoteric-ephemera 6a66546
merge conflicts
esoteric-ephemera f89f149
resolve merge conflicts
esoteric-ephemera 4743403
bump emmet-core to use new neb schemas
esoteric-ephemera 29870ce
Merge remote-tracking branch 'upstream/main' into neb
esoteric-ephemera 49f8a7b
bump emmet-core in strict
esoteric-ephemera ff94128
incl pmg analysis diffusion dependency and bump down pmg
esoteric-ephemera 5b984a3
update automerge / dependencies
esoteric-ephemera 458e064
update automerge / dependencies
esoteric-ephemera e3e337f
have neb tests use pre-generated initial endpoints
esoteric-ephemera 0742aa6
the mac file system lack of case sensitivity does me in yet again
esoteric-ephemera 116d6af
add forcefield approx/neb tests
esoteric-ephemera 5a11460
add ase neb from endpoints + num images
esoteric-ephemera 2a32d5c
review changes 1/
esoteric-ephemera 2a0cd3a
modify vasp flows / tests post emmet refactor
esoteric-ephemera daefef5
Merge remote-tracking branch 'upstream/main' into neb
esoteric-ephemera b539c37
full draft ase neb + tests + forcefield implementation
esoteric-ephemera 5d9bf51
remove unnecessary ff file
esoteric-ephemera 4f743ca
merge conflict / bump emmet for newer neb schemas
a210f8b
missing emmet bump
df51160
lingering ase npt issues
bfd01ae
ensure mace calculator uses dispersion when explicit model path speci…
3e806b7
d3 for mace test
b34c43c
fix torch dft-d3 kwargs + test
esoteric-ephemera File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,100 @@ | ||
| """Create NEB jobs with ASE.""" | ||
|
|
||
| from __future__ import annotations | ||
|
|
||
| from dataclasses import dataclass, field | ||
| from typing import TYPE_CHECKING | ||
|
|
||
| from emmet.core.neb import NebResult | ||
| from jobflow import job | ||
|
|
||
| from atomate2.ase.jobs import _ASE_DATA_OBJECTS, AseMaker | ||
| from atomate2.ase.utils import AseNebInterface | ||
|
|
||
| if TYPE_CHECKING: | ||
| from pathlib import Path | ||
| from typing import Literal | ||
|
|
||
| from ase.calculators.calculator import Calculator | ||
| from pymatgen.core import Molecule, Structure | ||
|
|
||
|
|
||
| @dataclass | ||
| class AseNebMaker(AseMaker): | ||
| """Define scheme for performing ASE NEB calculations.""" | ||
|
|
||
| name: str = "ASE NEB maker" | ||
| neb_kwargs: dict = field(default_factory=dict) | ||
| fix_symmetry: bool = False | ||
| symprec: float | None = 1e-2 | ||
| steps: int = 500 | ||
| relax_kwargs: dict = field(default_factory=dict) | ||
| optimizer_kwargs: dict = field(default_factory=dict) | ||
| traj_file: str | None = None | ||
| traj_file_fmt: Literal["pmg", "ase", "xdatcar"] = "ase" | ||
| traj_interval: int = 1 | ||
| neb_doc_kwargs: dict = field(default_factory=dict) | ||
|
|
||
| def run_ase( | ||
| self, | ||
| images: list[Structure | Molecule], | ||
| prev_dir: str | Path | None = None, | ||
| ) -> NebResult: | ||
| """ | ||
| Run an ASE NEB job from a list of images. | ||
|
|
||
| Parameters | ||
| ---------- | ||
| images: list of pymatgen .Molecule or .Structure | ||
| pymatgen molecule or structure images | ||
| prev_dir : str or Path or None | ||
| A previous calculation directory to copy output files from. Unused, just | ||
| added to match the method signature of other makers. | ||
| """ | ||
| return AseNebInterface( | ||
| calculator=self.calculator, | ||
| fix_symmetry=self.fix_symmetry, | ||
| symprec=self.symprec, | ||
| ).run_neb( | ||
| images, | ||
| steps=self.steps, | ||
| traj_file=self.traj_file, | ||
| traj_file_fmt=self.traj_file_fmt, | ||
| interval=self.traj_interval, | ||
| neb_doc_kwargs=self.neb_doc_kwargs, | ||
| neb_kwargs=self.neb_kwargs, | ||
| optimizer_kwargs=self.optimizer_kwargs, | ||
| **self.relax_kwargs, | ||
| ) | ||
|
|
||
| @job(data=_ASE_DATA_OBJECTS, schema=NebResult) | ||
| def make( | ||
| self, | ||
| images: list[Structure | Molecule], | ||
| prev_dir: str | Path | None = None, | ||
| ) -> NebResult: | ||
| """ | ||
| Run an ASE NEB job from a list of images. | ||
|
|
||
| Parameters | ||
| ---------- | ||
| images: list of pymatgen .Molecule or .Structure | ||
| pymatgen molecule or structure images | ||
| prev_dir : str or Path or None | ||
| A previous calculation directory to copy output files from. Unused, just | ||
| added to match the method signature of other makers. | ||
| """ | ||
| return self.run_ase(images, prev_dir=prev_dir) | ||
|
|
||
|
|
||
| class LennardJonesNebMaker(AseNebMaker): | ||
| """Lennard-Jones NEB maker, primarily for testing/debugging.""" | ||
|
|
||
| name: str = "Lennard-Jones 6-12 NEB" | ||
|
|
||
| @property | ||
| def calculator(self) -> Calculator: | ||
| """Lennard-Jones calculator.""" | ||
| from ase.calculators.lj import LennardJones | ||
|
|
||
| return LennardJones(**self.calculator_kwargs) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
I did not try to do the math myself to see what the problem could be with this point, but in one of my tests I had an issue. The optimizer considered the forces converged and stopped the optimization after few loops, but this check was False and thus the task was marked as
failed.More in general, is there a need for this check specifically?
optimize.runalready returns aboolto specify if the optimization converged or not, why not using that?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.
Probably has to do with the difference in NEB forces (interatomic + spring) vs plain interatomic forces. I'll take this out - I like the idea of using
optimize.runto determine the task state, I'll update the other jobs as well