aim2dat Documentation

The Automated Ab-Initio Materials Modeling and Data Analysis Toolkit (aim2dat) is an open-source python library aimed to facilitate high-throughput studies based on density functional theory calculations. As such this package includes functionality to assist and automatize every step of the overall procedure, ranging data-mining and workflow management to post-processing routines and plotting features:

high-throughput_general_workflow.svg

The workflow of a high-throughput project including the different steps and the related sub-packages and of this library.

The main functionalities related to each of the steps are the following:

  1. Create initial structure pool: The strct subpackage (more details) implements several classes to handle larger quantities of crystals, molecules or related atomic structures. It interfaces with online databases and has several analysis methods implemented.

  2. Run high-throughput workflow: The high-throughput capabilities are driven by the AiiDA python package. This library implements additional calculation jobs and work chains for CP2K, critic2, chargemol and enumlib. To enhance the modularity and easily retrieve calculated results the WorkflowBuilder and MultipleWorkflowBuilder classes take care of the workflow’s provenance and checks which properties have been already calculated (more details).

  3. Analyse output data: The output data of the workflow can be readily plotted using the different plot classes (more details). Two backends are implemented: The plotly package is used to visualize plots interactively and the matplotlib package is used for high-quality and publication-ready plots. The fct sub-package implements methods to compare and analyse 2-dimensional functions in a quantitative fashion (more details). Structural properties can be then be analysed using the infrastructure of the strct subpackage (more details).

  4. Train ML models: To exploit the produced data, a direct interface to the scikit learn package is given by the StructureTransformer classes that allow to extract features from crystalline or molecular structures and can be integrated in pipelines (more details).

Feature List

  • Managing and analysing sets of crystals and molecules.

  • Ab-initio high-throughput calculations based on aiida.

  • Plotting material’s properties such as electronic band structures, projected density of states or phase diagrams.

  • Interface to machine learning routines via sci-kit learn.

  • Function analysis: discretizing and comparing 2-dimensional functions.

  • Parsers for the DFT codes CP2K, FHI-aims, Quantum ESPRESSO as well as phonopy and critic2.

Contributing

Contributions are very welcome and are directly handled via the code’s github repository. Bug reports, feature requests or general discussions can be accomplished by filing an issue. Extensions or changes to the code can also be directly suggested by opening a pull request.

A few guidelines suggested for code contributions:

  • Please try to abide the python PEP-8 and google style guides for python.

  • Style checks are implemented using the python packages black and flake8. Before submitting the pull request the checks can be performed via the commands black --diff . and flake8 executed in the root folder of the library.

  • Tests are performed using the python package pytest. Additional tests for new features are very welcome, ideally each pull request should maintain or increase the test coverage of the code.

  • Please use doc-strings to describe the usage of the code. The doc-strings should be able to explain how the class/function is used, e.g. by showing code-snippets to highlight the most important features. We currently use NumPy-docstrings, examples can be found here.

  • Additional documentation, like a jupyter-notebook for the example section or a dedicated section explaining how to use the feature is very welcome as well.

The package pre-commit can be used to run style checks before every commit by executing the following commands the main folder of the repository:

pip install pre-commit
pre-commit install