Occupation
- class ase2sprkkr.sprkkr.occupations.Occupation(dct, site_type=None, mesh=None)[source]
Occupation of an atomic site, mapping
AtomicTypeto its occupation fraction.Each fraction is the probability of finding that atomic type at the site, as used for example in alloy calculations.
Class hierarchy
Constructor
- Parameters:
dct (Dict[Union[atomic_types.AtomicType, str], float])
site_type (Optional[SiteType])
mesh (Optional[Mesh])
- __init__(dct, site_type=None, mesh=None)[source]
- Parameters:
dct (Dict[ase2sprkkr.sprkkr.atomic_types.AtomicType | str, float])
site_type (ase2sprkkr.sprkkr.sites.SiteType | None)
mesh (ase2sprkkr.sprkkr.radial_meshes.Mesh | None)
- _occupation = {}
A bit hack for correct function of mesh property during the initialization
- static to_occupation(occupation, site)[source]
Create an occupation object associated with the given sites object
- copy(site=None, for_mesh=None)[source]
Create a copy of the object, associated with a given site.
- Parameters:
site (ase2sprkkr.sprkkr.sites.SiteType | None)
- Return type:
- set(dct, for_mesh=None)[source]
Set (replace) the occupation data and synchronize the owning Atoms object.
- Parameters:
dct (Dict[ase2sprkkr.sprkkr.atomic_types.AtomicType | str, float] | List[Tuple[ase2sprkkr.sprkkr.atomic_types.AtomicType | str, float]])
- Return type:
None
- _set(dct, for_mesh=None)[source]
Set occupation data without synchronizing, for object initialization.
- Parameters:
dct (Dict[ase2sprkkr.sprkkr.atomic_types.AtomicType | str, float] | List[Tuple[ase2sprkkr.sprkkr.atomic_types.AtomicType | str, float]])
- Return type:
None
- property site
- property mesh
- atomic_type(name)[source]
Find the corresponding atomic type according to the provided argument.
- Parameters:
name (str | int | ase2sprkkr.sprkkr.atomic_types.AtomicType) – The identification of the atomic type. If it is integer, returns the n-th atomic type (according to the orderd supplied when the occupation is set). If it is a string, the first atomic type of given chemical element is returned If it is AtomicType, it is returned “as is”
- Return type:
- replace_type(name, to)[source]
Replace the given atomic type (see
atomic_type, how it can be identified) by the new one (given either by AtomicType or by its chemical symbol)- Parameters:
name (str | int | ase2sprkkr.sprkkr.atomic_types.AtomicType)
to (str | ase2sprkkr.sprkkr.atomic_types.AtomicType)
- property primary_atomic_type
Return the atomic type. If there are more atoms on the site, return the one with the largest occupation
- property primary_atomic_number
Return the atomic number of the atom at the site. If there are more atoms on the site, return the “main one”.
- property primary_symbol
Return the chemical symbol of the atom at the site. If there are more atoms on the site, return the one with the largest occupation
- _normalize(to=1.0, except_from=None)[source]
Normalizes occupation so the sum will be equal to the value ‘to’ (by default to 1.). If there are no None values, all the values are multiplied by the same number to make their sum equal to to. If there are None values, the remainder to the ‘to’ value is equally divided among them.
- Parameters:
value (float) – Desired value
except_from (ase2sprkkr.sprkkr.atomic_types.AtomicType) – Skip the given atom during normalizing
- property as_dict
- property total_occupation
- atomic_types()[source]
Returns the atomic types that can be present on the site.
- Return type:
collections.abc.Iterable[ase2sprkkr.sprkkr.atomic_types.AtomicType]