mep

Classes

Functions and attributes

atomman.mep.create_path(coord: _SupportsArray[dtype[Any]] | _NestedSequence[_SupportsArray[dtype[Any]]] | bool | int | float | complex | str | bytes | _NestedSequence[bool | int | float | complex | str | bytes], energyfxn: Callable, style: str = 'ISM', gradientfxn: str = 'cdiff', gradientkwargs: dict | None = None, integratorfxn: str = 'rk') BasePath

Generic function call for initializing a Path object.

Parameters:
  • coord (array-like object) – The list of coordinates associated with the points along the path.

  • energyfxn (function) – The function that evaluates the energy associated with the different point coordinates.

  • style (str, optional) – The relaxation style to associate with the path. Determines the subclass to build. Default value is “ISM” for the improved string method.

  • gradientfxn (function, optional) – The function to use to estimate the gradient of the energy. Default value of ‘cdiff’ will use atomman.mep.gradient.central_difference

  • gradientkwargs (dict, optional) – The keyword arguments (i.e. settings) to use with the gradientfxn. Default is an empty dictionary, i.e. default settings of gradientfxn.

  • integratorfxn (str or function, optional) – The function to use to integrate relaxation steps. Default value of ‘rk’ will use atomman.mep.integrator.rungekutta.

Returns:

A Path object.

Return type:

BasePath

Raises:

ValueError – If the given style is invalid.

atomman.mep.gradient.central_difference(fxn: Callable, coord: _SupportsArray[dtype[Any]] | _NestedSequence[_SupportsArray[dtype[Any]]] | bool | int | float | complex | str | bytes | _NestedSequence[bool | int | float | complex | str | bytes], shift: float = 1e-05) ndarray

Computes the gradient of a function at a set of coordinates.

Parameters:
  • fxn (function) – The function to compute gradients for.

  • coord (array-like object) – The coordinates to evaluate the gradient at. The number of derivatives calculated will be based on the size of the coordinate’s final dimension, i.e. if coord is (10, 3), then three derivatives will be computed for each of the ten coordinates.

  • shift (float, optional) – The shift step size to use when evaluating the derivatives. Default value is 1e-5.

Returns:

gradient – The gradient array with the same shape as coord.

Return type:

numpy.ndarray

atomman.mep.integrator.euler(ratefxn: Callable, coord: _SupportsArray[dtype[Any]] | _NestedSequence[_SupportsArray[dtype[Any]]] | bool | int | float | complex | str | bytes | _NestedSequence[bool | int | float | complex | str | bytes], timestep: float, **kwargs) float | ndarray

Performs Euler ODE integration for a timestep.

Parameters:
  • ratefxn (function) – The rate function to use. Should be a function of coord.

  • coord (array-like object) – The coordinate(s) of the last timestep.

  • timestep (float) – The timestep value to use.

  • **kwargs (any) – Any extra keyword parameters to pass on to ratefxn.

Returns:

The coordinate(s) moved forward by timestep.

Return type:

float or numpy.ndarray

atomman.mep.integrator.rungekutta(ratefxn: Callable, coord: _SupportsArray[dtype[Any]] | _NestedSequence[_SupportsArray[dtype[Any]]] | bool | int | float | complex | str | bytes | _NestedSequence[bool | int | float | complex | str | bytes], timestep: float, **kwargs) float | ndarray

Performs Runge-Kutta ODE integration for a timestep.

Parameters:
  • ratefxn (function) – The rate function to use. Should be a function of coord.

  • coord (array-like object) – The coordinate(s) of the last timestep.

  • timestep (float) – The timestep value to use.

  • **kwargs (any) – Any extra keyword parameters to pass on to ratefxn.

Returns:

The coordinate(s) moved forward by timestep.

Return type:

float or numpy.ndarray