Atomate2 Materials Science Workflows

0.1.1 · active · verified Thu Apr 16

Atomate2 is a Python library providing a comprehensive collection of materials science workflows built on top of the AiiDA infrastructure. It allows researchers to automate complex computational materials design tasks, from structural relaxations and property calculations using various density functional theory (DFT) codes (like VASP, Quantum ESPRESSO, FLEUR) to advanced analyses. It is a complete rewrite of the original atomate library, moving from FireWorks to AiiDA for workflow management. The current version is 0.1.1 and it follows a release cadence tied to feature development and bug fixes.

Common errors

Warnings

Install

Imports

Quickstart

This quickstart demonstrates how to define and submit a VASP double relaxation workflow for a silicon structure using atomate2. It requires an AiiDA installation, a configured AiiDA profile, and the `aiida-vasp` plugin along with a configured VASP code. The code primarily shows submission, not local execution setup, which is handled by AiiDA's daemon.

from pymatgen.core import Structure
from pymatgen.core.lattice import Lattice
from atomate2.vasp.flows.double_relax import DoubleRelaxFlow
from aiida import load_profile
from aiida.engine import submit
import os

# --- AiiDA Profile Setup (Crucial Pre-requisite) ---
# Before running, ensure you have an AiiDA profile configured:
# 1. Install aiida-core: `pip install aiida-core[psql]`
# 2. Setup a profile: `aiida-profile setup` and follow prompts.
# 3. Setup VASP code: `aiida-code setup vasp.vasp` (assuming 'vasp.vasp' is the plugin name)
#    and configure path to your VASP executable on a local or remote machine.

# Load the AiiDA profile
try:
    load_profile()
except Exception as e:
    print(f"Could not load AiiDA profile. Please run 'aiida-profile setup' and try again. Error: {e}")
    exit(1)

# Define a simple Silicon structure
lattice = Lattice.cubic(5.43)
structure = Structure(lattice, ["Si", "Si"], [[0, 0, 0], [0.25, 0.25, 0.25]])

# Create and submit a VASP DoubleRelaxFlow
try:
    flow = DoubleRelaxFlow.from_structure(structure)
    submitted_flow = submit(flow)
    print(f"Submitted DoubleRelaxFlow with PK: {submitted_flow.pk}")
    print("\nNote: This only submits the workflow to AiiDA. To execute it,")
    print("you need the AiiDA daemon running (`verdi daemon start`) ")
    print("and VASP (or other chosen calculator) properly configured as an AiiDA code.")
    print(f"You can monitor the workflow with: verdi process show {submitted_flow.pk}")
except Exception as e:
    print(f"Error submitting flow: {e}")
    print("Ensure 'aiida-vasp' is installed (`pip install aiida-vasp`) ")
    print("and VASP is configured as an AiiDA code (`aiida-code setup`).")

view raw JSON →