Machine-Learning assisted simulations

OtfMlacs

class mlacs.OtfMlacs(atoms, state, calc, mlip=None, prop=None, neq=10, confs_init=None, std_init=0.05, keep_tmp_mlip=True, workdir='', prefix='Trajectory', ncprefix='', ncformat='NETCDF3_CLASSIC')

A Learn on-the-fly simulation constructed in order to sample approximate distribution

Parameters:
  • atoms (ase.Atoms or list of ase.Atoms) – the atom object on which the simulation is run.

  • state (StateManager or list of StateManager) – Object determining the state to be sampled

  • calc (ase.calculators or CalcManager) – Class controlling the potential energy of the system to be approximated. If a ase.calculators is attached, the CalcManager is automatically created.

  • mlip (MlipManager (optional)) – Object managing the MLIP to approximate the real distribution Default is a LammpsMlip object with a snap descriptor, 5.0 angstrom rcut with 8 twojmax.

  • neq (int (optional)) – The number of equilibration iteration. Default 10.

  • workdir (str (optional)) – The directory in which to run the calculation.

  • confs_init (int or list of ase.Atoms (optional)) – If int, Number of configurations used to train a preliminary MLIP. The configurations are created by rattling the first structure. If list of ase.Atoms, The atoms that are to be computed in order to create the initial training configurations. Default None.

  • std_init (float (optional)) – Variance (in \(\mathring{a}^2\)) of the displacement when creating initial configurations. Default \(0.05 \mathring{a}^2\)

  • keep_tmp_mlip (Bool (optional)) – Keep every generated MLIP. If True and using MBAR, a restart will recalculate every previous MLIP.weight using the old coefficients. Default True.

  • prefix (str (optional)) – The prefix to prepend the name of the States files.

  • ncprefix (str (optional)) – The prefix to prepend the name of the *HIST.nc file. Script name format: ncprefix + scriptname + ‘_HIST.nc’. Default ‘’.

  • ncformat (str (optional)) – The format of the *HIST.nc file. One of the five flavors of netCDF files format available in netCDF4 python package: ‘NETCDF3_CLASSIC’, ‘NETCDF3_64BIT_OFFSET’, ‘NETCDF3_64BIT_DATA’,’NETCDF4_CLASSIC’, ‘NETCDF4’. Default NETCDF3_CLASSIC.

MlMinimizer

class mlacs.MlMinimizer(atoms, state, calc, mlip=None, etol=0.01, ftol=0.0001, stol=0.001, neq=10, confs_init=None, std_init=0.05, keep_tmp_mlip=False, workdir='', prefix='Trajectory', ncprefix='', ncformat='NETCDF3_CLASSIC')

Class to perform structure minimization assisted with machine-learning potential

Parameters:
  • atoms (ase.Atoms or list of ase.Atoms) – the atom object on which the simulation is run.

  • state (StateManager or list of StateManager) – Object determining the state to be sampled

  • calc (ase.calculators or CalcManager) – Class controlling the potential energy of the system to be approximated. If a ase.calculators is attached, the CalcManager is automatically created.

  • mlip (MlipManager (optional)) – Object managing the MLIP to approximate the real distribution Default is a LammpsMlip object with a snap descriptor, 5.0 angstrom rcut with 8 twojmax.

  • etol (float (optional)) – The tolerance for the energy, in eV/at. If the difference of energy of the true potential between two consecutive steps is lower than etol, the algorithm stops.

  • ftol (float (optional)) – The tolerance for the forces, in eV/angstrom. If the maximum absolute force of the true potential between two consecutive steps is lower than etol, the algorithm stops.

  • stol (float (optional)) – The tolerance for the stress, in GPa. If the difference in the stress tensor of the true potential between two consecutive steps is lower than etol, the algorithm stops.

  • neq (int (optional)) – The number of equilibration iteration. Default 10.

  • confs_init (int or list of ase.Atoms (optional)) – if int: Number of configuirations used to train a preliminary MLIP The configurations are created by rattling the first structure if list of ase.Atoms: The atoms that are to be computed in order to create the initial training configurations Default None.

  • std_init (float (optional)) – Variance (in \(\mathring{a}^2\)) of the displacement when creating initial configurations. Default \(0.05 \mathring{a}^2\)

  • keep_tmp_mlip (Bool (optional)) – Keep every generated MLIP. If True and using MBAR, a restart will recalculate every previous MLIP.weight using the old coefficients. Default False.

  • workdir (str (optional)) – The directory in which to run the calculation.

  • prefix (str (optional)) – The prefix to prepend the name of the States files.

  • ncprefix (str (optional)) – The prefix to prepend the name of the *HIST.nc file. Script name format: ncprefix + scriptname + ‘_HIST.nc’. Default ‘’.

  • ncformat (str (optional)) – The format of the *HIST.nc file. One of the five flavors of netCDF files format available in netCDF4 python package: ‘NETCDF3_CLASSIC’, ‘NETCDF3_64BIT_OFFSET’, ‘NETCDF3_64BIT_DATA’,’NETCDF4_CLASSIC’, ‘NETCDF4’. Default NETCDF3_CLASSIC.