BasePath

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

Bases: object

Generic class representing an energy path.

property arccoord: ndarray

The arc length coordinates for each point along the path.

Type:

numpy.NDArray

property coord: ndarray

The coordinates for each point along the path.

Type:

numpy.NDArray

energy(coord: _SupportsArray[dtype[Any]] | _NestedSequence[_SupportsArray[dtype[Any]]] | bool | int | float | complex | str | bytes | _NestedSequence[bool | int | float | complex | str | bytes] | None = None) ndarray

Evaluates energy values associated with either the path points or given coordinates.

Parameters:

coord (array-like object, optional) – Coordinates to evaluate the energies at. If not given, will use the object’s coord values.

Returns:

The evaluated energies.

Return type:

np.NDArray

property energyfxn: Callable

The function for evaluating the energy

Type:

function

property force: ndarray

The computed force associated with moving along the path at each point.

Type:

numpy.NDArray

grad_energy(coord: _SupportsArray[dtype[Any]] | _NestedSequence[_SupportsArray[dtype[Any]]] | bool | int | float | complex | str | bytes | _NestedSequence[bool | int | float | complex | str | bytes] | None = None) ndarray

Evaluates the gradient of the energy associated with either the path points or given coordinates.

Parameters:

coord (array-like object, optional) – Coordinates to evaluate the energy gradients at. If not given, will use the object’s coord values.

Returns:

The evaluated energies.

Return type:

np.NDArray

property gradientfxn: Callable

The function for evaluating the energy gradients

Type:

function

property gradientkwargs: dict

The keyword arguments to use when calling gradientfxn

Type:

dict

property integratorfxn: Callable

The function to use for integrating minimization steps

Type:

function

plot_energy(energy_unit: str | None = None, length_unit: str | None = None, ax: axes | None = None, **kwargs) figure | None

Creates a plot of the energies along the path as a function of the arc coordinates.

Parameters:
  • energy_unit (str or None, optional) – If given, the energy values will be converted from atomman’s working units to the specified units. Default value of None will do no conversions, which is useful if the energyfxn is not reporting in atomman’s working units.

  • length_unit (str or None, optional) – If given, the arc coordinates will be converted from atomman’s working units to the specified units. Default value of None will do no conversions, which is useful if the coords are not given in atomman’s working units.

  • ax (matplotlib.pyplot.axis) – A pre-existing plotting axis. Allows for more control and the use of subplots.

  • **kwargs (any, optional) – All additional keyword arguments will be passed to matplotlib.pyplot.figure().

Returns:

The generated figure allowing for further modifications. Returned if ax is None.

Return type:

matplotlib.pyplot.figure

plot_force(force_unit: str | None = None, length_unit: str | None = None, ax: axes | None = None, **kwargs) figure | None

Creates a plot of the force to move along the path as a function of the arc coordinates.

Parameters:
  • force_unit (str or None, optional) – If given, the force values will be converted from atomman’s working units to the specified units. Default value of None will do no conversions, which is useful if the energyfxn is not reporting in atomman’s working units.

  • length_unit (str or None, optional) – If given, the arc coordinates will be converted from atomman’s working units to the specified units. Default value of None will do no conversions, which is useful if the coords are not given in atomman’s working units.

  • ax (matplotlib.pyplot.axis) – A pre-existing plotting axis. Allows for more control and the use of subplots.

  • **kwargs (any, optional) – All additional keyword arguments will be passed to matplotlib.pyplot.figure().

Returns:

The generated figure allowing for further modifications. Returned if ax is None.

Return type:

matplotlib.pyplot.figure

relax(*args, **kwargs) BasePath

Perform multiple relaxation and/or climb steps until either the maximum coordinate displacement per step drops below a tolerance or the maximum number of steps is reached.

Returns:

newpath – A Path with coordinates evolved forward from the relaxation.

Return type:

BasePath

step(*args, **kwargs) BasePath

Performs a single relaxation step.

Returns:

newpath – A Path with coordinates evolved forward by one timestep.

Return type:

BasePath

property unittangent: ndarray

The tangent vectors along the path at each point.

Type:

numpy.NDArray