soprano.properties.map.map#

Classes

Remap([name])

Returns a structure remapped to the one given as reference.

RemapIndices([name])

Returns a list of the indices which will remap a given structure to the one given as reference.

class soprano.properties.map.map.Remap(name=None, **params)[source]#

Bases: AtomsProperty

Returns a structure remapped to the one given as reference. Remapping means creating a one-to-one correspondence between atoms based on their distances (which may include the periodic boundaries).

Parameters:
reference (ase.Atoms): Reference structure to map to. Required
mic (bool): If True, take into account periodic boundaries
via the minimum image convention. We use the general method
from ASE. It’s slow but robust.
Default is True.
check_species (bool): If True, only compare atoms of the same species.
Default is True.
tolerance (float): Tolerance for the distance comparison.
Default is 0.1 Angstrom.
Returns:
remap_indices ([int]): List of indices for the structure in the order
in which they will make it map to the reference
best

Initialize an AtomsProperty and set its parameters. The AtomsProperty instance can then be called with a structure as its only argument to get the property with the given parameters.

Args:
name (str): a name to give to this specific instance of the
property (will be used to store it as array if
requested)
params: named arguments specific to this type of property
__call__(s, store_array=False)#

Calling the AtomsProperty returns the value of the property as extracted with the parameters of this specific instance.

Args:
s (ase.Atoms or AtomsCollection): the structure or collection
from which to extract the
property
store_array (bool): if s is a collection, whether to store the
resulting data as an array in the collection
using the given name for this instance

Returns:
property: the value of the property for the given structure or
a list of values if a collection has been passed

static extract(s, reference, mic, check_species, tolerance)[source]#

Extract the given property with given parameters from an Atoms object.

Args:
s (ase.Atoms): the structure from which to extract the property
params: named arguments specific to this type of property

Returns:
property: the value of the property for the given structure and
parameters

classmethod get(s, store_array=False, **kwargs)#

Extract the given property using the default parameters on an Atoms object s

Args:
s (ase.Atoms or AtomsCollection): the structure or collection
from which to extract the
property
store_array (bool): if s is a collection, whether to store the
resulting data as an array in the collection
using the default name for this property

Returns:
property: the value of the property for the given structure or
a list of values if a collection has been passed

class soprano.properties.map.map.RemapIndices(name=None, **params)[source]#

Bases: AtomsProperty

Returns a list of the indices which will remap a given structure to the one given as reference. Remapping means creating a one-to-one correspondence between atoms based on their distances (which may include the periodic boundaries).

Parameters:
reference (ase.Atoms): Reference structure to map to. Required
mic (bool): If True, take into account periodic boundaries
via the minimum image convention. We use the general method
from ASE. It’s slow in some cases but robust.
Default is True.
check_species (bool): If True, only compare atoms of the same species.
Default is True.
tolerance (float): Tolerance (in Angstroms) for the distance comparison. If no atom
is found within this distance, an error is raised.
Default is 0.1 Angstrom.
Returns:
remap_indices ([int]): List of indices for the structure in the order
in which they will make it map to the reference
best

Initialize an AtomsProperty and set its parameters. The AtomsProperty instance can then be called with a structure as its only argument to get the property with the given parameters.

Args:
name (str): a name to give to this specific instance of the
property (will be used to store it as array if
requested)
params: named arguments specific to this type of property
__call__(s, store_array=False)#

Calling the AtomsProperty returns the value of the property as extracted with the parameters of this specific instance.

Args:
s (ase.Atoms or AtomsCollection): the structure or collection
from which to extract the
property
store_array (bool): if s is a collection, whether to store the
resulting data as an array in the collection
using the given name for this instance

Returns:
property: the value of the property for the given structure or
a list of values if a collection has been passed

static extract(s, reference, mic, check_species, tolerance)[source]#

Extract the given property with given parameters from an Atoms object.

Args:
s (ase.Atoms): the structure from which to extract the property
params: named arguments specific to this type of property

Returns:
property: the value of the property for the given structure and
parameters

classmethod get(s, store_array=False, **kwargs)#

Extract the given property using the default parameters on an Atoms object s

Args:
s (ase.Atoms or AtomsCollection): the structure or collection
from which to extract the
property
store_array (bool): if s is a collection, whether to store the
resulting data as an array in the collection
using the default name for this property

Returns:
property: the value of the property for the given structure or
a list of values if a collection has been passed