From b2f33670dfdd1264e9e464077ad4a4a5ae6e3069 Mon Sep 17 00:00:00 2001 From: ElliottKasoar Date: Fri, 15 Mar 2024 18:18:10 +0000 Subject: [PATCH] Add examples to README --- README.md | 36 +++++++++++++++++++++++++++++++++++- 1 file changed, 35 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index b55575e1..1052c0ef 100644 --- a/README.md +++ b/README.md @@ -33,7 +33,6 @@ Tools for machine learnt interatomic potentials The code relies heavily on ASE, unless something else is mentioned. - ## Development 1. Install [poetry](https://python-poetry.org/docs/#installation) @@ -61,6 +60,41 @@ To prevent poetry downgrading ASE when installing in future, add the commit to p poetry add git+https://gitlab.com:ase/ase.git#b31569210d739bd12c8ad2b6ec0290108e049eea ``` +## Examples + +Perform a single point calcuation: +```shell +janus singlepoint --struct tests/data/NaCl.cif +``` + +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: + +```shell +janus singlepoint --struct tests/data/NaCl.cif --property energy --arch mace_mp --calc-kwargs "{'model' : './tests/models/mace_mp_small.model'}" --log './example.log' --write-kwargs "{'filename': './example.xyz'}" +``` + +This defines the MLIP architecture and path to the 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. + + +Perform geometry optimization: +```shell +janus geomopt --struct tests/data/H2O.cif +``` + +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: + +```shell +janus geomopt --struct tests/data/NaCl.cif --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. + ## License [BSD 3-Clause License](LICENSE)