Skip to main content

Tools for machine learnt interatomic potentials

Project description

Build Status Coverage Status Docs status PyPI version License DOI

janus-core

Tools for machine learnt interatomic potentials

Features in development

  • Support for multiple MLIPs
    • MACE
    • M3GNET
    • CHGNET
  • Single point calculations
  • Geometry optimisation
  • Molecular Dynamics
    • NVE
    • NVT (Langevin(Eijnden/Ciccotti flavour) and Nosé-Hoover (Melchionna flavour))
    • NPT (Nosé-Hoover (Melchiona flavour))
  • Nudge Elastic Band
  • Phonons
    • vibroscopy
  • Training ML potentials
    • MACE
  • Fine tunning MLIPs
    • MACE
  • Rare events simulations
    • PLUMED

The code relies heavily on ASE, unless something else is mentioned.

Development

  1. Install poetry
  2. (Optional) Create a virtual environment
  3. Install janus-core with dependencies:
git clone https://github.com/stfc/janus-core
cd janus-core
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

Manually updating ASE via https://gitlab.com/ase/ase is strongly recommended, as tags are no longer regularly published. For example:

pip install git+https://gitlab.com/ase/ase.git@b31569210d739bd12c8ad2b6ec0290108e049eea

To prevent poetry downgrading ASE when installing in future, add the commit to pyproject.toml:

poetry add git+https://gitlab.com:ase/ase.git#b31569210d739bd12c8ad2b6ec0290108e049eea

Examples

Single Point Calculations

Perform a single point calcuation (using the MACE-MP "small" force-field):

janus singlepoint --struct tests/data/NaCl.cif --arch mace_mp --calc-kwargs "{'model' : 'small'}"

This will calculate the energy, stress and forces and save this in NaCl-results.xyz, in addition to generating a log file, singlepoint.log.

Additional options may be specified. For example:

janus singlepoint --struct tests/data/NaCl.cif --arch mace --calc-kwargs "{'model' : '/path/to/your/ml.model'}" --property energy --log './example.log' --write-kwargs "{'filename': './example.xyz'}"

This defines the MLIP architecture and path to your locally saved model, as well as changing where the log and results files are saved.

Note: the MACE calculator currently returns energy, forces and stress together, so in this case the choice of property will not change the output.

For all options, run janus singlepoint --help.

Geometry optimization

Perform geometry optimization (using the MACE-MP "small" force-field):

janus geomopt --struct tests/data/H2O.cif --arch mace_mp --calc-kwargs "{'model' : 'small'}"

This will calculate optimize the atomic positions and save the resulting structure in H2O-opt.xyz, in addition to generating a log file, geomopt.log.

Additional options may be specified. This shares most options with singlepoint, as well as a few additional options, such as:

janus geomopt --struct tests/data/NaCl.cif --arch mace_mp --calc-kwargs "{'model' : 'small'}" --fully-opt --vectors-only --traj 'NaCl-traj.xyz'

This allows the cell to be optimised, allowing only hydrostatic deformation, and saves the optimization trajector in addition to the final structure and log.

For all options, run janus geomopt --help.

License

BSD 3-Clause License

Funding

Contributors to this project were funded by

PSDI ALC CoSeC

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

janus_core-0.1.0b4.tar.gz (14.0 kB view hashes)

Uploaded Source

Built Distribution

janus_core-0.1.0b4-py3-none-any.whl (15.0 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page