pantea.descriptors package#

Subpackages#

Submodules#

pantea.descriptors.scaler module#

class pantea.descriptors.scaler.DescriptorScaler(scale_range, transform)[source]#

Bases: object

Scale descriptor values between a given range.

Scaling parameters are calculated by fitting over the samples in the dataset. Available scaler information are as follows:

This descriptor scaler is also used to warn when setting out-of-distribution samples base on the fitted scaler parameters.

classmethod check_warnings(params, data, warnings)[source]#

Check whether the output scaler values exceed the predefined min/max range values or not.

If it’s the case, it keeps counting the number of warnings and raises an error when it exceeds the maximum number.

An out of range descriptor value is an indication of the descriptor extrapolation which has to be avoided.

Return type

ScalerWarnings

classmethod fit(data)[source]#
Return type

ScalerParams

classmethod from_type(scale_type, scale_min=0.0, scale_max=1.0)[source]#

Initialize scaler including scaler type and min/max values.

Return type

DescriptorScaler

classmethod initialize_warnings(number_of_warnings=0, max_number_of_warnings=-1)[source]#
Return type

ScalerWarnings

classmethod load(filename, integer_type_keys=('dimension', 'nsamples'))[source]#

Load scaler parameters from file.

Return type

ScalerParams

classmethod partial_fit(params, data)[source]#

Partial fit scaler parameters.

This is intended for cases when fit is not feasible due to very large number of samples (see this for more details).

Return type

ScalerParams

classmethod save(params, filename)[source]#

Save scaler parameters into file.

Return type

None

property scale_max: float#
Return type

float

property scale_min: float#
Return type

float

class pantea.descriptors.scaler.ScaleRange(min_value: Array, max_value: Array)[source]#

Bases: tuple

Expected range of scaled values.

Create new instance of ScaleRange(min_value, max_value)

max_value: ArrayImpl#

Alias for field number 1

min_value: ArrayImpl#

Alias for field number 0

class pantea.descriptors.scaler.ScalerParams(dimension: Array, nsamples: Array, mean: Array, sigma: Array, minval: Array, maxval: Array)[source]#

Bases: tuple

Scaler statistical parameters.

Create new instance of ScalerParams(dimension, nsamples, mean, sigma, minval, maxval)

dimension: ArrayImpl#

Alias for field number 0

maxval: ArrayImpl#

Alias for field number 5

mean: ArrayImpl#

Alias for field number 2

minval: ArrayImpl#

Alias for field number 4

nsamples: ArrayImpl#

Alias for field number 1

sigma: ArrayImpl#

Alias for field number 3

class pantea.descriptors.scaler.ScalerWarnings(number_of_warnings: int, max_number_of_warnings: int)[source]#

Bases: tuple

Outlier check based on number of warnings.

Create new instance of ScalerWarnings(number_of_warnings, max_number_of_warnings)

max_number_of_warnings: int#

Alias for field number 1

number_of_warnings: int#

Alias for field number 0

Module contents#

pantea.descriptors.ACSF#

alias of AtomCenteredSymmetryFunction

class pantea.descriptors.AtomCenteredSymmetryFunction(central_element, radial_symmetry_functions, angular_symmetry_functions)[source]#

Bases: BaseJaxPytreeDataClass

Atom-centered Symmetry Function (ACSF) descriptor captures information about the distribution of neighboring atoms around a central atom by considering both radial (two-body) and angular (three-body) symmetry functions within a cutoff distance. Radial symmetry functions describe the distances, while angular symmetry functions hold information about the angles formed by the central atom with pairs of neighboring atoms.

The ACSF represents a fingerprint of the local atomic environment and can be used in various machine learning potentials.

angular_symmetry_functions: Tuple[Tuple[AngularSymmetryFunction, NeighborElements], ...]#
central_element: str#
grad(structure, atom_index=None)[source]#

Compute gradient of the ACSF descriptor respect to the atom position.

Parameters
  • structure (Structure) – input Structure instance

  • atom_index (Optional[ArrayImpl]) – atom index in Structure [0, natoms)

Return type

ArrayImpl

Returns

gradient of the descriptor value respect to the atom position

Please note that grad_per_element method is way much faster than the current implementation of this method method.

property num_angular_symmetry_functions: int#

Return number of three-body (angular) symmetry functions.

Return type

int

property num_radial_symmetry_functions: int#

Return number of two-body (radial) symmetry functions.

Return type

int

property num_symmetry_functions: int#

Return the total (two-body and tree-body) number of symmetry functions.

Return type

int

property r_cutoff: float#

Return the maximum cutoff radius for list of the symmetry functions.

Return type

float

radial_symmetry_functions: Tuple[Tuple[RadialSymmetryFunction, NeighborElements], ...]#
class pantea.descriptors.DescriptorScaler(scale_range, transform)[source]#

Bases: object

Scale descriptor values between a given range.

Scaling parameters are calculated by fitting over the samples in the dataset. Available scaler information are as follows:

This descriptor scaler is also used to warn when setting out-of-distribution samples base on the fitted scaler parameters.

classmethod check_warnings(params, data, warnings)[source]#

Check whether the output scaler values exceed the predefined min/max range values or not.

If it’s the case, it keeps counting the number of warnings and raises an error when it exceeds the maximum number.

An out of range descriptor value is an indication of the descriptor extrapolation which has to be avoided.

Return type

ScalerWarnings

classmethod fit(data)[source]#
Return type

ScalerParams

classmethod from_type(scale_type, scale_min=0.0, scale_max=1.0)[source]#

Initialize scaler including scaler type and min/max values.

Return type

DescriptorScaler

classmethod initialize_warnings(number_of_warnings=0, max_number_of_warnings=-1)[source]#
Return type

ScalerWarnings

classmethod load(filename, integer_type_keys=('dimension', 'nsamples'))[source]#

Load scaler parameters from file.

Return type

ScalerParams

classmethod partial_fit(params, data)[source]#

Partial fit scaler parameters.

This is intended for cases when fit is not feasible due to very large number of samples (see this for more details).

Return type

ScalerParams

classmethod save(params, filename)[source]#

Save scaler parameters into file.

Return type

None

property scale_max: float#
Return type

float

property scale_min: float#
Return type

float

class pantea.descriptors.ScalerParams(dimension: Array, nsamples: Array, mean: Array, sigma: Array, minval: Array, maxval: Array)[source]#

Bases: tuple

Scaler statistical parameters.

Create new instance of ScalerParams(dimension, nsamples, mean, sigma, minval, maxval)

dimension: ArrayImpl#

Alias for field number 0

maxval: ArrayImpl#

Alias for field number 5

mean: ArrayImpl#

Alias for field number 2

minval: ArrayImpl#

Alias for field number 4

nsamples: ArrayImpl#

Alias for field number 1

sigma: ArrayImpl#

Alias for field number 3