REANN calculator
REANN (recursively embedded atom neural network) is a message-passing neural-network-based MLIP.
Below are the instructions on how to initialize the REANN calculator, to run dynamics simulations within NQCDynamics.jl using ASE interface.
The following instructions will include Julia-based code.
We start with importing NQCDynamics.jl packages and PyCall which allows importing Python-based packages.
using NQCDynamics
using PyCall
using NQCModels
# Importing Python modules with PyCall
io = pyimport("ase.io")
reann = pyimport("ase.calculators.reann")
Now, we specify the cutoff distance, paths to the model, and Atoms objects. Then we read the ASE atoms object and we convert it to NQCDynamics object.
pes_model_path = "path/to/reann/model/REANN_PES_DOUBLE.pt"
atoms_path = "path/to/atoms.xyz"
ase_atoms = io.read(atoms_path)
atoms, positions, cell = NQCDynamics.convert_from_ase_atoms(ase_atoms)
We then set up our REANN calculator and create NQCModels AdiabaticASEModel object that includes the model.
atomtype = ["Cu","H"]
period = [1,1,1]
calculator = reann.REANN(
device="cpu",
atomtype=atomtype,
period=period,
nn=pes_model_path)
ase_atoms.set_calculator(calculator)
pes_model = AdiabaticASEModel(ase_atoms)
Finally, we can use the model to e.g. initialize Simulation object that is employed to run MD simulations.
sim = Simulation{Classical}(atoms, pes_model, cell=cell)