Occupation

class ase2sprkkr.sprkkr.occupations.Occupation(dct, site_type=None, mesh=None)[source]

Occupation of an atomic site, mapping AtomicType to 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

Inheritance diagram of ase2sprkkr.sprkkr.occupations.Occupation


Constructor

Parameters:
__init__(dct, site_type=None, mesh=None)[source]
Parameters:
_occupation = {}

A bit hack for correct function of mesh property during the initialization

static for_atom_from_ase_atoms(atoms, i)[source]
Parameters:

i (numbers.Integral)

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:

ase2sprkkr.sprkkr.occupations.Occupation

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
items()[source]

dict.items() like enumeration

_update_atoms()[source]
_find_key(name)[source]
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:

ase2sprkkr.sprkkr.atomic_types.AtomicType | None

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:
clean()[source]

Remove all items with zero probability.

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”.

update_primary_atomic_number(number)[source]
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

add(name, value=None)[source]

Add atom to the site

_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:
to_dict(vacuum=False)[source]
property as_dict
property total_occupation
check()[source]
to_tuple()[source]
atomic_types()[source]

Returns the atomic types that can be present on the site.

Return type:

collections.abc.Iterable[ase2sprkkr.sprkkr.atomic_types.AtomicType]

remesh(mesh, map=None)[source]
_clear_data()[source]