machine learning interatomic potentials aiida plugin
The code relies heavily on janus-core, which handles mlip calculations using ASE.
pip install aiida-mlip
verdi quicksetup # better to set up a new profile
verdi plugin list aiida.calculations
The last command should show a list of AiiDA pre-installed calculations and the aiida-mlip plugin calculations (mlip.opt, mlip.sp)
Registered entry points for aiida.calculations:
* core.arithmetic.add
* core.templatereplacer
* core.transfer
* mlip.opt
* mlip.sp
* mlip.md
* mlip.train
The example folder provides scripts to submit calculations in the calculations folder, and tutorials in jupyter notebook format in the tutorials folder.
A quick demo of how to submit a calculation using the provided example files:
verdi daemon start # make sure the daemon is running
cd examples/calculations
verdi run submit_singlepoint.py "janus@localhost" --struct "path/to/structure" --architecture mace --model "/path/to/model" # run singlepoint calculation
verdi run submit_geomopt.py "janus@localhost" --struct "path/to/structure" --model "path/to/model" --steps 5 --opt_cell_fully True # run geometry optimisation
verdi run submit_md.py "janus@localhost" --struct "path/to/structure" --model "path/to/model" --ensemble "nve" --md_dict_str "{'temp':300,'steps':4,'traj-every':3,'stats-every':1}" # run molecular dynamics
verdi process list -a # check record of calculation
Models can be trained by using the Train calcjob. In that case the needed inputs are a config file containig the path to train, test and validation xyz file and other optional parameters. Running
verdi run submit_train.py
a model will be trained using the provided example config file and xyz files (can be found in the tests folder)
aiida-mlip
with dependencies:git clone https://github.com/stfc/aiida-mlip
cd aiida-mlip
pip install --upgrade pip
poetry install --with pre-commit,dev,docs # install extra dependencies
pre-commit install # install pre-commit hooks
pytest -v # discover and run all tests
See the developer guide for more information.
.github/
: Github Actions configuration
ci.yml
: runs tests, checks test coverage and builds documentation at every new commitpublish-on-pypi.yml
: automatically deploy git tags to PyPI - just generate a PyPI API token for your PyPI account and add it to the pypi_token
secret of your github repositorydocs.yml
: builds and deploys the documentationaiida_mlip/
: The main source code of the plugin package
data/
: Plugin Data
classesmodel.py
ModelData
class to save mlip models as AiiDA data typescalculations/
: Plugin Calcjob
classesbase.py
: Base Calcjob
class for other calculationssinglepoint.py
: Calcjob
class to run single point calculations using mlipsgeomopt.py
: Calcjob
class to perform geometry optimization using mlipsmd.py
: Calcjob
class to perform molecular dynamics using mlipsparsers/
: Parsers
for the calculationsbase_parser.py
: Base Parser
for all calculations.sp_parser.py
: Parser
for Singlepoint
calculation.opt_parser.py
: Parser
for Geomopt
calculation.md_parser.py
: Parser
for MD
calculation.train_parser.py
: Parser
for Train
calculation.helpers/
: Helpers
to run calculations.docs/
: Code documentation
apidoc/
: API documentationdeveloper_guide/
: Documentation for developersuser_guide/
: Documentation for usersimages/
: Logos etc used in the documentationexamples/
: Examples for submitting calculations using this plugin
tutorials/
: Scripts for submitting calculationscalculations/
: Jupyter notebooks with tutorials for running calculations and other files that are used in the tutorialsubmit_singlepoint.py
: Script for submitting a singlepoint calculationsubmit_geomopt.py
: Script for submitting a geometry optimisation calculationsubmit_md.py
: Script for submitting a molecular dynamics calculationsubmit_train.py
: Script for submitting a train calculation.tests/
: Basic regression tests using the pytest framework (submitting a calculation, ...). Install pip install -e .[testing]
and run pytest
.
conftest.py
: Configuration of fixtures for pytestcalculations/
: Calculationstest_singlepoint.py
: Test SinglePoint
calculationtest_geomopt.py
: Test Geomopt
calculationtest_md.py
: Test MD
calculationtest_train.py
: Test Train
calculationdata/
: ModelData
test_model.py
: Test ModelData
typetest_config.py
: Test JanusConfigfile
type.gitignore
: Telling git which files to ignore.pre-commit-config.yaml
: Configuration of pre-commit hooks that sanitize coding style and check for syntax errors. Enable via pip install -e .[pre-commit] && pre-commit install
LICENSE
: License for the pluginREADME.md
: This filetox.ini
: File to set up toxpyproject.toml
: Python package metadata for registration on PyPI and the AiiDA plugin registry (including entry points)Contributors to this project were funded by