Structures

StructureContainer

class icet.StructureContainer(cluster_space, list_of_atoms=None, list_of_properties=None)
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 (list of integers) – list of structure indices. By default (None) the method will add the properties to all structures.
  • properties (list of dict) – list of properties
add_structure(atoms, user_tag=None, properties=None, allow_duplicate=True)

Add a structure to the structure list.

Parameters:
  • atoms (ASE Atoms object) – the structure to be added
  • user_tag (str) – custom user tag to label structure
  • properties (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 – List of the available properties.

cluster_space

Returns the icet ClusterSpace object.

fit_structures

Return the fit structures.

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

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

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

cluster vectors and target properties for desired structures

Return type:

NumPy array, NumPy array

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

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

Parameters:
  • structures_indices (list of integers) – list of structure indices. Default to None and in that case returns properties of all structures
  • key (string) – key of properties dictionary. Default to ‘energy’
get_structure_indices(user_tag=None)

Get structure indices via user_tag

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

Return a list of structures in the form of ASE Atoms

Parameters:structure_indices (list of integers) – list of structure indices. By default (None) the method will return all structures listed in the container
get_user_tags(structure_indices=None)

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

Parameters:structure_indices (list of integers) – list of structure indices. By default (None) the method will return all user tags listed in the container
print_overview(print_threshold=None, print_minimum=10)

Print a list of structures in the structure container.

Parameters:
  • print_threshold (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(filename)

Read structure container from file.

write(filename)

Write structure container to a file.

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.

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_pbc()

Sets the periodic boundary conditions.

set_positions()

Set the positions in Cartesian coordinates.

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

Set 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