Occupation

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

Occupation of the atomic site, given by AtomicType : value

The value determine the probability, that a given atomic type will be found on a given place (which can be used e.g. for computing alloys).

Class hierarchy

Inheritance diagram of ase2sprkkr.sprkkr.occupations.Occupation

Constructor

Parameters:
__init__(dct, site=None, mesh=None, update_atoms=False)[source]
Parameters:
_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 (SiteType | None)

Return type:

Occupation

set(dct, update_atoms=True, for_mesh=None)[source]

Set (replace) the occupation data.

The method automatically updates the symbols, atomic numbers and the occupancy property (if exists) of the underlying Atoms object.

Parameters:

dct (Dict[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 | 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:

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

property primary_symbol

Return the chemical symbol of the atom at the site. If there are more atoms on the site, return the “main one”.

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:
  • value (float) – Desired value

  • except_from (AtomicType) – Skip the given atom during normalizing

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:

Iterable[AtomicType]

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