Structures

StructureContainer

class icet.StructureContainer(cluster_space, list_of_atoms=None, list_of_properties=None, allow_duplicate=True)

This class serves as a container for structure objects, their fit properties and their cluster vectors.

Parameters:
  • cluster_space (ClusterSpace) – cluster space used for evaluating the cluster vectors
  • list_of_atoms (list, tuple or list of tuples) – list of atoms. If list contains tuples, second element of the tuple will be used as a tag of the structure
  • list_of_properties (list of dicts) – list of properties, which are provided in dicts
add_properties(structure_indices=None, properties=None)

This method allows you to add properties and/or modify the values of existing properties

Parameters:
  • structure_indices (Optional[List[int]]) – list of structure indices. By default (None) the method will add the properties to all structures.
  • properties (Optional[List[dict]]) – list of scalar properties
add_structure(atoms, user_tag=None, properties=None, allow_duplicate=True)

Adds a structure to the structure container.

Parameters:
  • atoms (Atoms) – the atomic structure to be added
  • user_tag (Optional[str]) – custom user tag to label structure
  • properties (Optional[dict]) – scalar properties. If properties are not specified the atoms object are required to have an attached ASE calculator object with a calculated potential energy
  • allow_duplicate (bool) – whether or not to add the structure if there already exists a structure with identical cluster-vector
available_properties

List of the available properties.

Return type:List[str]
cluster_space

Cluster space used to calculate the cluster vectors.

Return type:ClusterSpace
fit_structures

List of the fit structures.

get_fit_data(structure_indices=None, key='energy')

Returns fit data for all structures. The cluster vectors and target properties for all structures are stacked into NumPy arrays.

Parameters:
  • structure_indices (Optional[List[int]]) – list of structure indices. By default (None) the method will return all fit data available.
  • key (str) – key of properties dictionary
Returns:

Return type:

cluster vectors and target properties for desired structures

get_properties(structure_indices=None, key='energy')

Returns a list with the value of properties with key=’key’ for a desired set of structures

Parameters:
  • structures_indices – list of structure indices. Default to None and in that case returns properties of all structures
  • key (str) – key of properties dictionary. Default to ‘energy’
Return type:

List[float]

get_structure_indices(user_tag=None)

Get structure indices via user_tag

Parameters:user_tag (Optional[str]) – user_tag used for selecting structures
Returns:List of structure’s indices
Return type:list of integers
get_structures(structure_indices=None)

Returns a list of structures in the form of ASE Atoms

Parameters:structure_indices (Optional[List[int]]) – list of structure indices. By default (None) the method will return all structures listed in the container
Return type:List[Atoms]
get_user_tags(structure_indices=None)

Return a list of user tags for the structures in the structure container

Parameters:structure_indices (Optional[List[int]]) – list of structure indices. By default (None) the method will return all user tags listed in the container
Return type:List[str]
print_overview(print_threshold=None, print_minimum=10)

Prints a list of structures in the structure container.

Parameters:
  • print_threshold (Optional[int]) – if the number of orbits exceeds this number print dots
  • print_minimum (int) – number of lines printed from the top and the bottom of the orbit list if print_threshold is exceeded
static read(infile)

Reads StructureContainer object from file.

Parameters:infile (Union[str, Binaryio, Textio]) – file from which to read
write(outfile)

Writes structure container to a file.

Parameters:outfile (Union[str, Binaryio, Textio]) – output file name or file object

Structure

class icet.Structure

This class stores the cell metric, positions, chemical symbols, and periodic boundary conditions that describe a structure. It also holds information pertaining to the components that are allowed on each site and provides functionality for computing distances between sites.

Parameters:
  • positions (list of vectors) – list of positions in Cartesian coordinates
  • chemical_symbols (list of strings) – chemical symbol of each case
  • cell (3x3 array) – cell metric
  • pbc (list of booleans) – periodic boundary conditions
  • tolerance (float) – numerical tolerance imposed when testing for equality of positions and distances
atomic_numbers

list of ints – atomic numbers of species on each site

cell

3x3 array – cell metric

chemical_symbols

list of strings – chemical symbols of species on each site

find_lattice_site_by_position()

Returns the lattice site that matches the position.

Parameters:position (list/NumPy array) – position in Cartesian coordinates
Returns:lattice site
Return type:LatticeSite object
find_lattice_sites_by_positions()

Returns the lattice sites that match the positions.

Parameters:positions (list of lists/NumPy arrays) – list of positions in Cartesian coordinates
Returns:list of lattice sites
Return type:list of LatticeSite object
find_site_by_position()

Returns the index of the site that matches the position.

Parameters:position (list/NumPy array) – position in Cartesian coordinates
Returns:site index
Return type:int
classmethod from_atoms(conf)

Creates an icet Structure object from an ASE Atoms object.

Parameters:conf (ASE Atoms object) – input configuration
Returns:output configuration
Return type:icet Structure object
get_atomic_numbers()

Returns a list of the species occupying each site by atomic number.

get_cell()

Returns the cell metric.

get_chemical_symbols()

Returns a list of the species occupying each site by chemical symbol.

get_distance()

Returns the distance between two sites

Parameters:
  • index1 (int) – index of the first site
  • index2 (int) – index of the second site
  • offset1 (vector) – offset to be applied to the first site
  • offset2 (vector) – offset to be applied to the second site
Returns:

distance in length units

Return type:

float

get_pbc()

Returns the periodic boundary conditions.

get_position()

Returns the position of a specified site

Parameters:site (LatticeSite object) – site of interest
Returns:position in Cartesian coordinates
Return type:vector
get_positions()

Returns the positions in Cartesian coordinates.

Returns:
Return type:list of NumPy arrays
get_unique_site()

Returns the unique site.

Parameters:index (int) – index of site of interest
Returns:index of unique site
Return type:int
get_unique_sites()

Returns the unique sites.

Returns:
Return type:list of ints
pbc

3-dimensional vector – periodic boundary conditions

positions

list of lists – atomic positions in Cartesian coordinates

set_atomic_numbers()

Sets the species occupying each site by atomic number.

Parameters:atomic_numbers (list of ints) – new species by atomic number
set_cell()

Sets the cell metric.

set_chemical_symbols()

Sets the species occupying each site by chemical symbol.

Parameters:chemical_symbols (list of strings) – new species by chemical symbol
set_number_of_allowed_species()

Sets the number of allowed species on each site.

This method allows one to specify for each site in the structure the number of species allowed on that site.

Parameters:numbersOfAllowedSpecies (list of int) –

Sets the number of allowed species on each site.

This method allows one to specify for each site in the structure the number of species allowed on that site.

Parameters:numbersOfAllowedSpecies (int) –
set_pbc()

Sets the periodic boundary conditions.

set_positions()

Sets the positions in Cartesian coordinates.

Parameters:positions (list of NumPy arrays) – new positions in Cartesian coordinates
set_unique_sites()

Sets the unique sites.

This method allows one to specify for each site in the structure the unique site it is related to.

Parameters:unique_sites (list of ints) – site of interest
to_atoms()

Returns the structure as an ASE Atoms object.

Returns:atomic configuration
Return type:ASE Atoms object
unique_sites

list of ints – unique sites