BondAngleMap

class atomman.cluster.BondAngleMap(model: Optional[Union[str, IOBase, DataModelDict]] = None, rmin: Optional[float] = None, rmax: Optional[float] = None, rnum: Optional[int] = None, thetamin: Optional[float] = None, thetamax: Optional[float] = None, thetanum: Optional[int] = None, r_ij: Optional[Union[int, float, complex, str, bytes, generic, Sequence[Union[int, float, complex, str, bytes, generic]], Sequence[Sequence[Any]], _SupportsArray]] = None, r_ik: Optional[Union[int, float, complex, str, bytes, generic, Sequence[Union[int, float, complex, str, bytes, generic]], Sequence[Sequence[Any]], _SupportsArray]] = None, theta: Optional[Union[int, float, complex, str, bytes, generic, Sequence[Union[int, float, complex, str, bytes, generic]], Sequence[Sequence[Any]], _SupportsArray]] = None, energy: Optional[Union[int, float, complex, str, bytes, generic, Sequence[Union[int, float, complex, str, bytes, generic]], Sequence[Sequence[Any]], _SupportsArray]] = None, symbols: Optional[Union[str, list]] = None)

Bases: object

Class for generating and analyzing energies of three atom clusters that explore a range of interatomic distances and bond angles. Can be used to characterize the 3 atom bond nature of interatomic potentials.

cumulative_pdf(nbins: int = 301, energymin: float = -15.0, energymax: float = 15.0) Tuple[ndarray, ndarray]

Returns the cumulative probability density function for the energy.

Parameters:
  • nbins (int, optional) – The number of histogram bins to use. Default value is 301.

  • energymin (float, optional) – The minimum energy bound to consider. Default value is -15.0.

  • energymax (float, optional) – The maximum energy bound to consider. Default value is 15.0.

Returns:

  • cum_pdf (numpy.NDArray) – The cumulative probability density function associated with each bin.

  • centers (numpy.NDArray) – The center values for each bin.

property df: DataFrame

The cluster coordinates and energies.

Type:

pandas.Dataframe

itercoords() Generator[Tuple[float, float, float, float], None, None]

Iterates through the three-body coordinates, which can be used as inputs for computing energies.

Yields:
  • r_ij (float) – The radial distance between atoms i and j.

  • r_ik (float) – The radial distance between atoms i and k.

  • r_jk (float) – The radial distance between atoms j and k.

  • theta (float) – The angle between i-j and i-k in degrees.

itersystem(symbols: Optional[Union[str, list]] = None, copy: bool = False) Generator[System, None, None]

Iterates through the three-body coordinates and returns a System for each. Useful for generating configuration files for simulators. The atom coordinates will be set such that atom 0 is at [0,0,0], atom 1 at [r_ij,0,0] and atom 2 is in the xy plane based on r_ik and theta.

Parameters:
  • symbols (str or list, optional) – The element model symbols to assign to the atoms. Can either be one value for all atoms, or three values for each atom individually. If not given here, will use the values set during class initialization.

  • copy (bool, optional) – If False (default), then the yielded system is the same object with the coordinates shifted. If True, each yielded system is a new object.

Yields:

atomman.System – The atomic system containing the three-body cluster.

load_table(filename: str, length_unit: str = 'angstrom', energy_unit: str = 'eV')

Loads a tabulated representation of the coordinates and energy values from a file.

Parameters:
  • filename (str) – The path to the file where the tabulated data is stored.

  • length_unit (str, optional) – The units of length used in the file. Default value is ‘angstrom’.

  • energy_unit (str, optional) – The units of energy used in the file. Default value is ‘eV’.

model(model: Optional[Union[str, IOBase, DataModelDict]] = None, length_unit: str = 'angstrom', energy_unit: str = 'eV') Optional[DataModelDict]

Loads or generates a bond angle map data model.

Note: Generating data models is currently limited to regular values, i.e. ones which the coordinates correspond to embedded loops with r_ij iterating in the outside loop, r_ik in the middle loop and theta in the inside loop.

Parameters:
  • model (str, file-like object or DataModelDict, optional) – The data model content or file containing the bond angle map data. If given, the content will be read in and set to the current object. If not given, then a data model will be returned for the object.

  • length_unit (str, optional) – The unit of length to save the rmin and max values in when generating a data model. Default is ‘angstrom’. value

  • energy_unit (str, optional) – The unit of energy to save the energy values in when generating a data model. Default value is ‘eV’.

Returns:

The data model containing the bond angle map coordinate information and measured energies. Only returned if model is not given as a parameter.

Return type:

DataModelDict.DataModelDict

Raises:

ValueError – If the data is irregular, i.e. coordinates do not conform to embedded loops with r_ij in the outer loop, r_ik in the middle loop and theta in the inside loop.

pdf(nbins: int = 301, energymin: float = -15.0, energymax: float = 15.0) Tuple[ndarray, ndarray]

Returns the probability density function for the energy

Parameters:
  • nbins (int, optional) – The number of histogram bins to use. Default value is 301.

  • energymin (float, optional) – The minimum energy bound to consider. Default value is -15.0.

  • energymax (float, optional) – The maximum energy bound to consider. Default value is 15.0.

Returns:

  • pdf (numpy.NDArray) – The probability density function associated with each bin.

  • centers (numpy.NDArray) – The center values for each bin.

plot_cumulative_pdf(nbins: int = 301, energymin: float = -15.0, energymax: float = 15.0, matplotlib_axes: Optional[axes] = None, **kwargs) Optional[figure]

Generates a plot of the cumulative probability density function of the energy.

Parameters:
  • nbins (int, optional) – The number of histogram bins to use. Default value is 301.

  • energymin (float, optional) – The minimum energy bound to consider. Default value is -15.0.

  • energymax (float, optional) – The maximum energy bound to consider. Default value is 15.0.

  • matplotlib_axes (matplotlib.Axes.axes, optional, optional) – An existing plotting axis to add the pdf plot to. If not given, a new figure object will be generated.

  • **kwargs (any, optional) – Any additional key word arguments will be passed to matplotlib.pyplot.figure for generating a new figure object (if axis is not given).

Returns:

The generated figure. Not returned if matplotlib_axes is given.

Return type:

matplotlib.Figure

plot_pdf(nbins: int = 301, energymin: float = -15.0, energymax: float = 15.0, matplotlib_axes: Optional[axes] = None, **kwargs) Optional[figure]

Generates a plot of the probability density function of the energy.

Parameters:
  • nbins (int, optional) – The number of histogram bins to use. Default value is 301.

  • energymin (float, optional) – The minimum energy bound to consider. Default value is -15.0.

  • energymax (float, optional) – The maximum energy bound to consider. Default value is 15.0.

  • matplotlib_axes (matplotlib.Axes.axes, optional, optional) – An existing plotting axis to add the pdf plot to. If not given, a new figure object will be generated.

  • **kwargs (any, optional) – Any additional key word arguments will be passed to matplotlib.pyplot.figure for generating a new figure object (if axis is not given).

Returns:

The generated figure. Not returned if matplotlib_axes is given.

Return type:

matplotlib.Figure

property rmax: Optional[float]

The maximum value used for the r_ij and r_ik spacings.

Type:

float or None

property rmin: Optional[float]

The minimum value used for the r_ij and r_ik spacings.

Type:

float or None

property rnum: Optional[int]

The number of values used for the r_ij and r_ik spacings.

Type:

int or None

save_table(filename: str, include_header: bool = True)

Saves a tabulated representation of the coordinates and energy values to a file.

Parameters:
  • filename (str) – The path to the file where the table will be saved.

  • include_header (bool) – If True (default) then header comments will be listed at the top of the file.

set(rmin: Optional[float] = None, rmax: Optional[float] = None, rnum: Optional[int] = None, thetamin: Optional[float] = None, thetamax: Optional[float] = None, thetanum: Optional[int] = None, r_ij: Optional[Union[int, float, complex, str, bytes, generic, Sequence[Union[int, float, complex, str, bytes, generic]], Sequence[Sequence[Any]], _SupportsArray]] = None, r_ik: Optional[Union[int, float, complex, str, bytes, generic, Sequence[Union[int, float, complex, str, bytes, generic]], Sequence[Sequence[Any]], _SupportsArray]] = None, theta: Optional[Union[int, float, complex, str, bytes, generic, Sequence[Union[int, float, complex, str, bytes, generic]], Sequence[Sequence[Any]], _SupportsArray]] = None, energy: Optional[Union[int, float, complex, str, bytes, generic, Sequence[Union[int, float, complex, str, bytes, generic]], Sequence[Sequence[Any]], _SupportsArray]] = None)

Sets the bond angle coordinates and the associated energies, if given.

Parameters:
  • energy (array-like, optional) – All measured energies. If r_ij, r_ik and theta are given then all should be the same length. If the range parameters are given then the length should be thetanum*rnum*rnum. If not given, then a new array of nan values will be constructed.

  • rmin (float, optional) – The minimum value used for the r_ij and r_ik spacings.

  • rmax (float, optional) – The maximum value used for the r_ij and r_ik spacings.

  • rnum (float, optional) – The number of values used for the r_ij and r_ik spacings.

  • thetamin (float, optional) – The minimum value used for the theta angles.

  • thetamax (float, optional) – The maximum value used for the theta angles.

  • thetanum (float, optional) – The number of values used for the theta angles.

  • r_ij (array-like, optional) – All r_ij values used. If given, the lengths of r_ij, r_ik and theta need to be the same.

  • r_ik (array-like, optional) – All r_ik values used. If given, the lengths of r_ij, r_ik and theta need to be the same.

  • theta (array-like, optional) – All theta values used. If given, the lengths of r_ij, r_ik and theta need to be the same.

  • energy – All measured energies. If r_ij, r_ik and theta are given then all should be the same length. If the coordinate range parameters are given, then the energies should be of length rnum*rnum*thetanum and ordered to correspond to three embedded loops with r_ij iterating in the outside loop, r_ik in the middle and theta in the inside. If energy is not given, then all values will initially be set to np.nan.

property symbols: Optional[list]

the atomic symbols associated with the three atoms

Type:

list or None

property thetamax: Optional[float]

The maximum value used for the theta angles.

Type:

float or None

property thetamin: Optional[float]

The minimum value used for the theta angles.

Type:

float or None

property thetanum: Optional[int]

The number of values used for the theta angles.

Type:

int or None