MTPPotential

class MTPPotential(file, suppress_intercept=False, group_name='')

Constructor of the potential

Parameters:
  • file (str) – The name of a file containing the data for a fitted moment tensor potential.

  • suppress_intercept (Bool) – Suppress the intercept of the linear model. This will cause the energy to deviate from the reference by some system-independent additive constant, but will ensure that the energy of the empty system is 0.

  • group_name (str) – Optional name of a hdf5-group in file containing the data for a fitted moment tensor potential, if the data is not in the root-group of file

classmethod getAllParameterNames()

Return the names of all used parameters as a list.

getAllParameters()

Return all parameters of this potential and their current values as a <parameterName / parameterValue> dictionary.

static getDefaults()

Get the default parameters of this potential and return them in form of a dictionary of <parameter name, default value> key-value pairs.

getParameter(parameterName)

Get the current value of the parameter parameterName.

setParameter(parameterName, value)

Set the parameter parameterName to the given value.

Parameters:
  • parameterName (str) – The name of the parameter that will be modified.

  • value – The new value that will be assigned to the parameter parameterName.

Usage Examples

Create a calculator for use in calculations on SiC. The parameters for the MTP are contained in the file SiC_MTP_Parameters.mtp.

# Create the TremoloX potential set
potential_set = TremoloXPotentialSet(name='SiC MTP Potential')

# Add the silicon particle type to the potential set
potential_set.addParticleType(ParticleType(
    symbol='Si',
    mass=28.0855*atomic_mass_unit,
    charge=None,
    atomicNumber=14,
))

# Add the carbon particle type to the potential set
potential_set.addParticleType(ParticleType(
    symbol='C',
    mass=12.0107*atomic_mass_unit,
    charge=None,
    atomicNumber=6,
))

# Add the MTP potential parameters contained in the SiC_MTP_Parameters.mtp file.
mtp_potential = MTPPotential(
    file='SiC_MTP_Parameters.mtp',
    suppress_intercept=False,
    group_name='',
)
potential_set.addPotential(mtp_potential)

# Create the Forcefield calculator and add it to the configuration.
calculator = TremoloXCalculator(parameters=potential_set)

mtp_calculator_example.py

Notes

This class implements the moment tensor potential (MTP) framework [1]. Moment tensor potentials are a class of systematically improvable machine learning (ML) potentials. They require a parameter file, which has been trained on a suitable set of ab-initio calculations of configurations containing representative atomic environments.

A Forcefield calculator that uses an MTP can be created using a potential set that contains a MTPPotential object. When added to a potential set the MTPPotential class takes as an argument the file name of the file that contains the parameters for the MTP. These files typically have the extention .mtp. Parameter files can be created using MTP training tools such as the MomentTensorPotentialTraining class. In addition to the MTP parameters, the potential set must also include a particle type definition for each element contained within the MTP.

The above example shows how to create a Forcefield calculator for calculations on SiC. Here the MTP contains parameters for both Si and C in the file SiC_MTP_Parameters.mtp file.