Skip to main content
`Ctrl`+`K`

# Tersoff Calculator

The Tersoff potential is a three-body empirical potential that can model covalently bonded solids like silicon or carbon. This implementation provides a native ASE calculator that follows the LAMMPS-style Tersoff parameterization.

Note

The performance of the routines for this calculator have not been optimized for speed nor benchmarked with the LAMMPS implementation.

## Theory

The many-body interaction is based on bond-order concept that includes both two-body and three-body terms. The total energy is given by:

\[\begin{split}\begin{split} E & = \frac{1}{2} \sum_i \sum_{j \neq i} V_{ij} \\ V_{ij} & = f_C(r_{ij}) \left[ f_R(r_{ij}) + b_{ij} f_A(r_{ij}) \right] \end{split}\end{split}\]

where the repulsive and attractive pair terms are:

\[\begin{split}\begin{split} f_R(r) & = A \exp (-\lambda_1 r) \\ f_A(r) & = -B \exp (-\lambda_2 r) \end{split}\end{split}\]

The cutoff function \(f_C(r)\) ensures smooth decay of interactions:

\[\begin{split}f_C(r) = \begin{cases} 1 & r < R - D \\ \frac{1}{2} - \frac{1}{2} \sin \left( \frac{\pi}{2} \frac{r-R}{D} \right) & R-D < r < R + D \\ 0 & r > R + D \end{cases}\end{split}\]

The bond order term \(b_{ij}\) captures the short-range local atomic environment:

\[\begin{split}\begin{split} b_{ij} & = \left( 1 + \beta^n {\zeta_{ij}}^n \right)^{-\frac{1}{2n}} \\ \zeta_{ij} & = \sum_{k \neq i,j} f_C(r_{ik}) g(\theta_{ijk}) \exp \left[ {\lambda_3}^m (r_{ij} - r_{ik})^m \right] \end{split}\end{split}\]

where \(\theta_{ijk}\) is the angle between bonds \(ij\) and \(ik\). The angular function \(g(\theta)\) is:

\[g(\theta) = \gamma \left( 1 + \frac{c^2}{d^2} - \frac{c^2}{d^2 + (h - \cos \theta)^2} \right)\]

where \(h = \cos \theta_0\) defines the preferred angle \(\theta_0\).

The parameters \(A\), \(B\), \(\lambda_1\), \(\lambda_2\), \(\lambda_3\), \(\beta\), \(n\), \(c\), \(d\), \(h\), \(\gamma\), \(m\), \(R\), and \(D\) define the potential for each interaction type.

For a complete description of the functional forms and parameters, see the `ase.calculators.tersoff` module documentation.

## Parameters

The Tersoff potential is defined by 14 parameters for each three-body interaction:

Parameter | Description
--- | ---
A | Repulsive pair potential prefactor
B | Attractive pair potential prefactor
lambda1 | Decay length for repulsive term
lambda2 | Decay length for attractive term
lambda3 | Decay length for angular term
beta | Angular strength parameter
n | Angular exponent
c | Angular coefficient
d | Angular parameter
h | Cosine of angle parameter
gamma | Angular scaling
m | Bond order exponent
R | Cutoff distance
D | Cutoff width

See `ase.calculators.tersoff.TersoffParameters` for details.

## Examples

### Silicon Diamond Structure

Using calculator on silicon crystal in the diamond structure:

    from ase.build import bulk
    from ase.calculators.tersoff import Tersoff, TersoffParameters

    # Create silicon diamond structure
    si = bulk("Si", "diamond", a=5.43)

    # Define Tersoff parameters for Si
    si_params = {
        ("Si", "Si", "Si"): TersoffParameters(
            A=3264.7,
            B=95.373,
            lambda1=3.2394,
            lambda2=1.3258,
            lambda3=1.3258,
            beta=0.33675,
            gamma=1.00,
            m=3.00,
            n=22.956,
            c=4.8381,
            d=2.0417,
            h=0.0000,
            R=3.00,
            D=0.20,
        )
    }

    # Set up calculator
    calc = Tersoff(si_params)
    si.calc = calc

    # Calculate properties
    energy = si.get_potential_energy()
    forces = si.get_forces()
    stress = si.get_stress()

### Parameter Updates

The calculator parameters can be updated after initialization:

    # Update single parameters
    calc.set_parameters(("Si", "Si", "Si"), R=2.9, D=0.25)

    # Or replace entire parameter set
    new_params = TersoffParameters(...)
    calc.set_parameters(("Si", "Si", "Si"), params=new_params)

### Interface to LAMMPS Files

Warning

This interface has only been tested with Si.tersoff and SiC.tersoff LAMMPS files so it is not necessarily guaranteed to parse all LAMMPS Tersoff files. Therefore, it is recommended to format the LAMMPS Tersoff file using similar to the Si.tersoff or SiC.tersoff files.

Read parameters from a LAMMPS-style Tersoff file:

    # Initialize from LAMMPS file
    calc = Tersoff.from_lammps("SiC.tersoff")

#### Tersoff Calculator Class

class ase.calculators.tersoff.TersoffParameters(m: float, gamma: float, lambda3: float, c: float, d: float, h: float, n: float, beta: float, lambda2: float, B: float, R: float, D: float, lambda1: float, A: float)

  Parameters for 3 element Tersoff potential interaction.

  Can be instantiated with either positional or keyword arguments:

    TersoffParameters(1.0, 2.0, …) or TersoffParameters(m=1.0, gamma=2.0, …)

class ase.calculators.tersoff.Tersoff(parameters: dict[tuple[str, str, str], TersoffParameters], skin: float = 0.3, **kwargs)

  ASE Calculator for Tersoff interatomic potential.

  Added in version 3.25.0.

  Parameters:

    - parameters (dict) –

      Mapping element combinations to TersoffParameters objects:

          {
              ('A', 'B', 'C'): TersoffParameters(
                  m, gamma, lambda3, c, d, h, n,
                  beta, lambda2, B, R, D, lambda1, A),
              ...
          }

      where (‘A’, ‘B’, ‘C’) are the elements involved in the interaction.

    - skin (float, default 0.3) – The skin distance for neighbor list calculations.

    - **kwargs (dict) – Additional parameters to be passed to `Calculator`.

  classmethod from_lammps(potential_file: str | Path, skin: float = 0.3, **kwargs) → Tersoff

    Make `Tersoff` from a LAMMPS-style Tersoff potential file.

    Parameters:

      - potential_file (str or Path) – The path to a LAMMPS-style Tersoff potential file.

      - skin (float, default 0.3) – The skin distance for neighbor list calculations.

      - **kwargs (dict) – Additional parameters to be passed to the ASE Calculator constructor.

    Returns:

      Initialized Tersoff calculator with parameters from the file.

    Return type:

      `Tersoff`

  static read_lammps_format(potential_file: str | Path) → dict[tuple[str, str, str], TersoffParameters]

    Read the Tersoff potential parameters from a LAMMPS-style file.

    Parameters:

      potential_file (str or Path) – Path to the LAMMPS-style Tersoff potential file

    Returns:

      Dictionary mapping element combinations to TersoffParameters objects

    Return type:

      dict

  set_parameters(key: tuple[str, str, str], params: TersoffParameters | None = None, **kwargs) → None

    Update parameters for a specific element combination.

    Parameters:

      - key (Tuple[str, str, str]) – The element combination key of the parameters to be updated

      - params (TersoffParameters, optional) – A TersoffParameters instance to completely replace the parameters

      - **kwargs – Individual parameter values to update, e.g. R=2.9

## References

1. 10. Tersoff, “New empirical approach for the structure and energy of covalent systems”, Phys. Rev. B 37, 6991 (1988)

2. 10. Tersoff, “Modeling solid-state chemistry: Interatomic potentials for multicomponent systems”, Phys. Rev. B 39, 5566(R) (1989)

3. 19. 10. Plimpton, A. Kohlmeyer, A. P. Thompson, et al., “LAMMPS: Large-scale Atomic/Molecular Massively Parallel Simulator”. Zenodo, Aug. 02, 2023. doi:10.5281/zenodo.10806852.