{"id":8845,"library":"atomate2","title":"Atomate2 Materials Science Workflows","description":"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.","status":"active","version":"0.1.1","language":"en","source_language":"en","source_url":"https://github.com/materialscloud-org/atomate2","tags":["materials science","workflow","AiiDA","DFT","VASP","Quantum ESPRESSO","simulation automation"],"install":[{"cmd":"pip install atomate2","lang":"bash","label":"Base Installation"},{"cmd":"pip install 'atomate2[vasp]' # For VASP workflows","lang":"bash","label":"With VASP Support"},{"cmd":"pip install 'atomate2[quantum_espresso]' # For Quantum ESPRESSO workflows","lang":"bash","label":"With Quantum ESPRESSO Support"}],"dependencies":[{"reason":"Required workflow engine for atomate2.","package":"aiida-core","optional":false},{"reason":"Used for materials structure representation and manipulation.","package":"pymatgen","optional":false},{"reason":"AiiDA plugin for VASP calculations, necessary for VASP-based workflows.","package":"aiida-vasp","optional":true},{"reason":"AiiDA plugin for Quantum ESPRESSO calculations, necessary for QE-based workflows.","package":"aiida-quantumespresso","optional":true}],"imports":[{"note":"atomate2 is a complete rewrite and uses AiiDA; original `atomate` imports are incompatible.","wrong":"from atomate.vasp.flows.double_relax import DoubleRelaxFlow","symbol":"DoubleRelaxFlow","correct":"from atomate2.vasp.flows.double_relax import DoubleRelaxFlow"},{"symbol":"EnergyMaker","correct":"from atomate2.common.jobs.energy import EnergyMaker"},{"note":"Structures are handled by pymatgen, a core dependency.","symbol":"Structure","correct":"from pymatgen.core import Structure"}],"quickstart":{"code":"from pymatgen.core import Structure\nfrom pymatgen.core.lattice import Lattice\nfrom atomate2.vasp.flows.double_relax import DoubleRelaxFlow\nfrom aiida import load_profile\nfrom aiida.engine import submit\nimport os\n\n# --- AiiDA Profile Setup (Crucial Pre-requisite) ---\n# Before running, ensure you have an AiiDA profile configured:\n# 1. Install aiida-core: `pip install aiida-core[psql]`\n# 2. Setup a profile: `aiida-profile setup` and follow prompts.\n# 3. Setup VASP code: `aiida-code setup vasp.vasp` (assuming 'vasp.vasp' is the plugin name)\n#    and configure path to your VASP executable on a local or remote machine.\n\n# Load the AiiDA profile\ntry:\n    load_profile()\nexcept Exception as e:\n    print(f\"Could not load AiiDA profile. Please run 'aiida-profile setup' and try again. Error: {e}\")\n    exit(1)\n\n# Define a simple Silicon structure\nlattice = Lattice.cubic(5.43)\nstructure = Structure(lattice, [\"Si\", \"Si\"], [[0, 0, 0], [0.25, 0.25, 0.25]])\n\n# Create and submit a VASP DoubleRelaxFlow\ntry:\n    flow = DoubleRelaxFlow.from_structure(structure)\n    submitted_flow = submit(flow)\n    print(f\"Submitted DoubleRelaxFlow with PK: {submitted_flow.pk}\")\n    print(\"\\nNote: This only submits the workflow to AiiDA. To execute it,\")\n    print(\"you need the AiiDA daemon running (`verdi daemon start`) \")\n    print(\"and VASP (or other chosen calculator) properly configured as an AiiDA code.\")\n    print(f\"You can monitor the workflow with: verdi process show {submitted_flow.pk}\")\nexcept Exception as e:\n    print(f\"Error submitting flow: {e}\")\n    print(\"Ensure 'aiida-vasp' is installed (`pip install aiida-vasp`) \")\n    print(\"and VASP is configured as an AiiDA code (`aiida-code setup`).\")","lang":"python","description":"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."},"warnings":[{"fix":"Rewrite workflows using atomate2's AiiDA-based API. Consult the atomate2 documentation for migration guidance and new API patterns.","message":"Atomate2 is a complete rewrite of the original `atomate` library. It uses AiiDA as its workflow engine instead of FireWorks. There is no direct upgrade path or backward compatibility; code written for `atomate` will not run with `atomate2`.","severity":"breaking","affected_versions":"< 0.1.0 (atomate) to >= 0.1.0 (atomate2)"},{"fix":"Follow AiiDA's installation and setup guide (`pip install aiida-core`, `aiida-profile setup`, `aiida-code setup`) prior to using atomate2 workflows.","message":"Atomate2 strictly depends on AiiDA for workflow management. Users must have AiiDA installed and a profile configured (`aiida-profile setup`) before atomate2 can be used. Furthermore, computational codes (e.g., VASP, Quantum ESPRESSO) must also be configured within AiiDA.","severity":"gotcha","affected_versions":"All versions"},{"fix":"Install the necessary plugins: `pip install 'atomate2[vasp]'` or `pip install aiida-vasp`.","message":"To run workflows for specific calculators (e.g., VASP, Quantum ESPRESSO), the corresponding AiiDA plugin (e.g., `aiida-vasp`, `aiida-quantumespresso`) must be explicitly installed, in addition to atomate2 itself.","severity":"gotcha","affected_versions":"All versions"},{"fix":"Ensure your Python environment is 3.11 or newer.","message":"Atomate2 requires Python 3.11 or higher. Using older Python versions will lead to installation or runtime errors.","severity":"gotcha","affected_versions":"< 3.11"}],"env_vars":null,"last_verified":"2026-04-16T00:00:00.000Z","next_check":"2026-07-15T00:00:00.000Z","problems":[{"fix":"Run `aiida-profile setup` to create a new profile, then ensure `aiida.load_profile()` is called in your script, or set a default profile with `aiida-profile setdefault <profile_name>`.","cause":"AiiDA profile has not been set up or loaded before attempting to submit an atomate2 workflow.","error":"No profile specified. Please set a default profile using 'aiida-profile setdefault <name>' or specify it explicitly."},{"fix":"Install the required AiiDA calculator plugin: `pip install aiida-vasp` (or for other calculators, e.g., `aiida-quantumespresso`).","cause":"The AiiDA plugin for VASP calculations is not installed, but a VASP-related workflow was attempted.","error":"ModuleNotFoundError: No module named 'aiida_vasp'"},{"fix":"Configure the code using the AiiDA CLI: `aiida-code setup` and follow the prompts to register your computational executable.","cause":"The specific computational code (e.g., VASP) required by the atomate2 workflow has not been configured in AiiDA.","error":"aiida.common.exceptions.NotExistent: Code with label 'vasp-std@cluster' (or similar) does not exist."},{"fix":"Run `aiida-code setup` to configure a VASP code on your AiiDA computer. Make sure the code is associated with the correct computer and is set up to use the `vasp.vasp` entry point.","cause":"Even if the `aiida-vasp` plugin is installed, no VASP code is configured on the target computer within AiiDA.","error":"RuntimeError: No valid codes for entry point 'vasp.vasp' found in database for computer 'local_computer'."}]}