atomate: Materials Science Workflows with FireWorks

1.1.0 · active · verified Fri Apr 17

atomate provides pre-built, robust workflows for computational materials science, primarily leveraging the VASP code and integrating with the FireWorks workflow management system. It builds upon pymatgen, custodian, and maggma for comprehensive materials data handling and job execution. The current version is 1.1.0, with releases occurring a few times a year to add features and fix bugs.

Common errors

Warnings

Install

Imports

Quickstart

This quickstart demonstrates how to define a basic VASP static energy workflow using atomate. It requires `pymatgen` for structure definition and outputs a `FireWorks.Workflow` object. To actually execute this workflow, you will need a properly configured FireWorks environment, a running MongoDB instance, and the VASP executable accessible on your system. The `vasp_cmd` and `db_file` parameters are critical for job execution and result storage.

import os
from atomate.vasp.workflows.base import wf_static
from pymatgen.core import Structure

# Define a simple structure for a quick example
structure = Structure(
    lattice=[[3, 0, 0], [0, 3, 0], [0, 0, 3]],
    species=["Fe", "O"],
    coords=[[0, 0, 0], [0.5, 0.5, 0.5]]
)

# Set VASP command and database file path from environment variables if available
# These are crucial for running actual simulations.
vasp_cmd = os.environ.get('VASP_CMD', 'vasp_std') # Default to 'vasp_std' if not set
db_file = os.environ.get('ATOMATE_DB_FILE', None) # If None, atomate looks for default FireWorks config

# Create a static energy workflow for this structure
# Note: This code *defines* the workflow; running it requires FireWorks setup,
# a VASP executable, and a MongoDB database.
workflow = wf_static(
    structure=structure,
    vasp_cmd=vasp_cmd,
    db_file=db_file
)

print(f"Successfully created atomate workflow: {workflow.name}")
print(f"This workflow contains {len(workflow.fws)} FireWorks.")
print("To run, ensure FireWorks is configured (FW_CONFIG_FILE), MongoDB is running, and VASP is accessible.")
# Example of how you would submit (requires FireWorks LaunchPad setup):
# from fireworks import LaunchPad
# lpad = LaunchPad.auto_load()
# lpad.add_wf(workflow)
# print("Workflow added to LaunchPad. Use 'lpad_launch --nlaunches 1' to start.")

view raw JSON →