Core components#
Sublattices#
- class icet.core.sublattices.Sublattices(allowed_species, primitive_structure, structure, fractional_position_tolerance)[source]#
This class stores and provides information about the sublattices of a structure.
Note
As a user you will usually not interact directly with objects of this type.
- Parameters:
allowed_species (
List
[List
[str
]]) – List of the allowed species on each site of the primitve structure. For example this can be the chemical_symbols from a cluster space.primitive_structure (
Atoms
) – The primitive structure the allowed species reference to.structure (
Atoms
) – The structure that the sublattices will be based on.fractional_position_tolerance (
float
) – Tolerance applied when comparing positions in fractional coordinates.
- property active_sublattices: List[Sublattice]#
List of the active sublattices.
- property allowed_species: List[List[str]]#
Lists of the allowed species on each sublattice in order.
- assert_occupation_is_allowed(chemical_symbols)[source]#
Asserts that the current occupation obeys the sublattices.
- get_allowed_numbers_on_site(index)[source]#
Returns the allowed atomic numbers on the site.
- Parameters:
index (
int
) – Lattice site index.- Return type:
List
[int
]
- get_allowed_symbols_on_site(index)[source]#
Returns the allowed symbols on the site.
- Parameters:
index (
int
) – Lattice site index.- Return type:
List
[str
]
- get_sublattice_index_from_site_index(index)[source]#
Returns the index of the sublattice the index in the structure belongs to.
- Parameters:
index (
int
) – Index of site in the structure.- Return type:
int
- get_sublattice_sites(index)[source]#
Returns the sites that belong to the sublattice with the corresponding index.
- Parameters:
index (
int
) – Index of the sublattice.- Return type:
List
[int
]
- property inactive_sublattices: List[Sublattice]#
List of the active sublattices.
- class icet.core.sublattices.Sublattice(chemical_symbols, indices, symbol)[source]#
This class stores and provides information about a specific sublattice. A sublattice is always supercell specific since it contains lattice indices.
Note
As a user you will usually not interact directly with objects of this type.
- Parameters:
chemical_symbols (
List
[str
]) – The allowed species on this sublattice.indices (
List
[int
]) – The lattice indices the sublattice consists of.symbol (
str
) – String used to mark the sublattice.
- property symbol#
Symbol representation of sublattice, i.e. A, B, C, etc.
Variable transformations#
- icet.tools.variable_transformation.get_transformation_matrix(structure, full_orbit_list)[source]#
Determines the matrix that transforms the cluster functions in the form of spin variables, \(\sigma_i\in\{-1,1\}\), to their binary equivalents, \(x_i\in\{0,1\}\). The form is obtained by performing the substitution (\(\sigma_i=1-2x_i\)) in the cluster expansion expression of the predicted property (commonly the energy).
- icet.tools.variable_transformation.transform_parameters(structure, full_orbit_list, parameters)[source]#
Transforms the list of parameters, obtained using cluster functions in the form of of spin variables, \(\sigma_i\in\{-1,1\}\), to their equivalents for the case of binary variables, \(x_i\in\{0,1\}\).
Constituent strain#
- class icet.tools.constituent_strain.KPoint(kpt, multiplicity, structure_factor, strain_energy_function, damping)[source]#
Class for handling each k point in a supercell separately.
- Parameters:
kpt (
ndarray
) – k-point coordinates.multiplicity (
float
) – Multiplicity of this k-point.structure_factor (
float
) – Current structure associated with this k-point.strain_energy_function (
Callable
[[float
,List
[float
]],float
]) – Function that takes a concentration and a list of parameters and returns strain energy.damping (
float
) – Damping at this k-point in units of Ångstrom.
- icet.tools.constituent_strain_helper_functions.redlich_kister(x, *coeffs)[source]#
Evaluate Redlich-Kister polynomial with coefficients
coeff
at point(s)x
.- Parameters:
x (
float
) – Point in interval [0, 1] where polynomial should be evaluated.coeffs (
float
) – Redlich-Kister coefficients,coeffs[0] (1 - 2x)^0 x (1 - x) + coeffs[1] * (1 - 2x)^1 x (1 - x) + ...
- Return type:
float
- icet.tools.constituent_strain_helper_functions.redlich_kister_vector(x, *coeffs)[source]#
Evaluate Redlich-Kister polynomial with coefficients
coeff
at points(s)x
.- Parameters:
x (
ndarray
) – Array of points in interval [0, 1] where polynomial should be evaluated.coeffs (
float
) – Redlich-Kister coefficients,coeffs[0] (1 - 2x)^0 x (1 - x) + coeffs[1] * (1 - 2x)^1 x (1 - x) + ...
- Return type:
float
Configuration manager#
- class mchammer.ConfigurationManager(structure, sublattices)[source]#
The ConfigurationManager owns and handles information pertaining to a configuration being sampled in a Monte Carlo simulation.
Note
As a user you will usually not interact directly with objects of this type.
- Parameters:
structure (Atoms) – Configuration to be handled.
sublattices (
Sublattices
) – Sublattices used to define allowed occupations and handle related information.
- get_flip_state(sublattice_index, allowed_species=None, allowed_sites=None)[source]#
Returns a site index and a new species for the site.
- Parameters:
sublattice_index (
int
) – Index of sublattice from which to pick a site.allowed_species (
Optional
[List
[int
]]) – List of atomic numbers for allowed species.allowed_sites (
Optional
[List
[int
]]) – List of indices for allowed sites.
- Return type:
Tuple
[int
,int
]
- get_occupations_on_sublattice(sublattice_index)[source]#
Returns the occupations on one sublattice.
- Parameters:
sublattice_index (
int
) – Sublattice by index for which the occupations should be returned.- Return type:
List
[int
]
- get_swapped_state(sublattice_index, allowed_species=None, allowed_sites=None)[source]#
Returns two random sites (first element of tuple) and their occupation after a swap (second element of tuple). The new configuration will obey the occupation constraints associated with the
ConfigurationManager
object.- Parameters:
sublattice_index (
int
) – Sublattice by index from which to pick sites.allowed_species (
Optional
[List
[int
]]) – List of atomic numbers for allowed species.allowed_sites (
Optional
[List
[int
]]) – List of indices for allowed sites.
- Return type:
Tuple
[List
[int
],List
[int
]]
- is_swap_possible(sublattice_index, allowed_species=None)[source]#
Checks if a swap trial move is possible on a specific sublattice.
- Parameters:
sublattice_index (
int
) – Index of sublattice to be checked.allowed_species (
Optional
[List
[int
]]) – List of atomic numbers for allowed species.
- Return type:
bool
- property sublattices: Sublattices#
Sublattices of the configuration.
- update_occupations(sites, species)[source]#
Updates the occupation vector of the configuration being sampled. This will change the state in both the configuration in the calculator and the configuration manager.
- Parameters:
sites (
List
[int
]) – Indices of sites of the configuration to change.species (
List
[int
]) – New occupations by atomic number.
- Return type:
None