atomate2
What this library is for
atomate2 is a workflow library for computational materials science. It provides
jobflow-based makers and flows for common calculations, with Materials Project
style task documents and integration points for VASP, force-field calculators,
phonons, defects, elastic constants, and related workflows.
When to use this vs. alternatives
- Use atomate2 when the user wants reusable workflows, makers, flows, task
documents, stores, or batch execution rather than a single calculator call.
- Use pymatgen for structure creation, transformations, and Materials Project
data access around the workflow.
- Use the execution/error-handling layer configured by atomate2 for calculations;
do not replace atomate2 workflow objects with a custom retry loop.
- Use raw jobflow only for custom orchestration when atomate2 has no suitable
maker.
- Do not answer with legacy atomate/FireWorks code unless the user explicitly
asks for the older stack.
Canonical workflow
Build a maker, create a job or flow from a pymatgen Structure, inspect the
flow, then run locally or submit through a configured jobflow manager.
from jobflow import run_locally
from pymatgen.core import Structure
from atomate2.forcefields.jobs import ForceFieldRelaxMaker
structure = Structure.from_file("POSCAR")
maker = ForceFieldRelaxMaker(
calculator="MACE",
relax_cell=True,
)
job = maker.make(structure)
print(job.name, job.uuid)
responses = run_locally(job, create_folders=True, ensure_success=True)
task_doc = list(responses.values())[0][1].output
print(task_doc.structure.composition.reduced_formula)
print(task_doc.output.energy)
print(task_doc.output.forces)
For VASP production workflows, use the atomate2 VASP makers documented in the
official user guide and configure VASP execution outside the skill.
Key conventions and gotchas
- atomate2 is jobflow-based. A maker's
.make(structure) returns a Job or
Flow; execution is a separate concern (run_locally, a manager, or a
queue-backed deployment).
- Task documents are part of the value proposition. Inspect and store the
output document rather than scraping stdout or
vasprun.xml by hand.
- Makers encode workflow defaults. Override settings through maker parameters
and documented input-set generators rather than mutating generated files after
the job is built.
- VASP workflows require external executables, pseudopotentials, and runtime
configuration. A valid Python flow is not proof the calculation can run.
- Record maker class, atomate2 version, jobflow version, calculator/code
version, input-set settings, database/store target, and execution manager.
- For force-field workflows, record calculator model, device, dtype, and model
provenance just as you would in direct ASE/MACE use.
Anti-patterns
- Do not use atomate1 FireWorks examples (
Workflow, LaunchPad, fireworks
YAML) for an atomate2 prompt unless explicitly requested.
- Do not write a loop of
subprocess.run(["vasp_std"]) jobs when atomate2
makers and jobflow integration are the requested abstraction.
- Do not treat a locally created
Job object as completed output; it must be
executed and the output task document checked.
- Do not ignore failed or missing task documents. Use jobflow responses/stores
and
ensure_success=True for local demos.
Diagnostic checks
Before trusting outputs, the agent should:
- Print the maker class, job/flow UUIDs, and number of jobs in the flow.
- Verify the input
Structure formula, charge/spin assumptions where relevant,
and whether the cell is being relaxed.
- Confirm required external executables and environment variables are present.
- Inspect task document status, final structure, energy, forces/stress, and
correction/error metadata.
- Confirm outputs landed in the intended jobflow store or local folders.
Pointers to deeper material
1---2name: atomate23description: Use when the user is constructing automated materials-science workflows with jobflow, especially VASP, force-field, phonon, defect, elastic, or equation of state workflows around pymatgen Structures. Prefer atomate2 over hand-written shell scripts, old atomate/FireWorks patterns, or one-off subprocess loops when the task is workflow construction, job documents, makers, stores, or reusable computational campaigns.4---56# atomate278## What this library is for910atomate2 is a workflow library for computational materials science. It provides11jobflow-based makers and flows for common calculations, with Materials Project12style task documents and integration points for VASP, force-field calculators,13phonons, defects, elastic constants, and related workflows.1415## When to use this vs. alternatives1617- Use atomate2 when the user wants reusable workflows, makers, flows, task18 documents, stores, or batch execution rather than a single calculator call.19- Use pymatgen for structure creation, transformations, and Materials Project20 data access around the workflow.21- Use the execution/error-handling layer configured by atomate2 for calculations;22 do not replace atomate2 workflow objects with a custom retry loop.23- Use raw jobflow only for custom orchestration when atomate2 has no suitable24 maker.25- Do not answer with legacy atomate/FireWorks code unless the user explicitly26 asks for the older stack.2728## Canonical workflow2930Build a maker, create a job or flow from a pymatgen `Structure`, inspect the31flow, then run locally or submit through a configured jobflow manager.3233```python34from jobflow import run_locally35from pymatgen.core import Structure36from atomate2.forcefields.jobs import ForceFieldRelaxMaker3738structure = Structure.from_file("POSCAR")3940maker = ForceFieldRelaxMaker(41 calculator="MACE",42 relax_cell=True,43)44job = maker.make(structure)45print(job.name, job.uuid)4647responses = run_locally(job, create_folders=True, ensure_success=True)48task_doc = list(responses.values())[0][1].output4950print(task_doc.structure.composition.reduced_formula)51print(task_doc.output.energy)52print(task_doc.output.forces)53```5455For VASP production workflows, use the atomate2 VASP makers documented in the56official user guide and configure VASP execution outside the skill.5758## Key conventions and gotchas5960- atomate2 is jobflow-based. A maker's `.make(structure)` returns a `Job` or61 `Flow`; execution is a separate concern (`run_locally`, a manager, or a62 queue-backed deployment).63- Task documents are part of the value proposition. Inspect and store the64 output document rather than scraping stdout or `vasprun.xml` by hand.65- Makers encode workflow defaults. Override settings through maker parameters66 and documented input-set generators rather than mutating generated files after67 the job is built.68- VASP workflows require external executables, pseudopotentials, and runtime69 configuration. A valid Python flow is not proof the calculation can run.70- Record maker class, atomate2 version, jobflow version, calculator/code71 version, input-set settings, database/store target, and execution manager.72- For force-field workflows, record calculator model, device, dtype, and model73 provenance just as you would in direct ASE/MACE use.7475## Anti-patterns7677- Do not use atomate1 FireWorks examples (`Workflow`, `LaunchPad`, fireworks78 YAML) for an atomate2 prompt unless explicitly requested.79- Do not write a loop of `subprocess.run(["vasp_std"])` jobs when atomate280 makers and jobflow integration are the requested abstraction.81- Do not treat a locally created `Job` object as completed output; it must be82 executed and the output task document checked.83- Do not ignore failed or missing task documents. Use jobflow responses/stores84 and `ensure_success=True` for local demos.8586## Diagnostic checks8788Before trusting outputs, the agent should:8990- Print the maker class, job/flow UUIDs, and number of jobs in the flow.91- Verify the input `Structure` formula, charge/spin assumptions where relevant,92 and whether the cell is being relaxed.93- Confirm required external executables and environment variables are present.94- Inspect task document status, final structure, energy, forces/stress, and95 correction/error metadata.96- Confirm outputs landed in the intended jobflow store or local folders.9798## Pointers to deeper material99100- Documentation: https://materialsproject.github.io/atomate2/101- User guide: https://materialsproject.github.io/atomate2/user/index.html102- jobflow docs: https://materialsproject.github.io/jobflow/103- Source repository: https://github.com/materialsproject/atomate2104- Materials Project software ecosystem: https://materialsproject.org/