Prediction Module#
Prediction algorithm implementation. Wraps the structure prediction pipeline.
Structure prediction implementation.
Todo:#
Test with a fully populated database.
Implement n-ary substitution probabilities; at the moment, only zero- and single-species substitutions are considered.
- class smact.structure_prediction.prediction.StructurePredictor(mutator: CationMutator, struct_db: StructureDB, table: str)[source]#
Bases:
objectProvides structure prediction functionality.
Implements a statistically-based model for determining likely structures of a given composition, based on a database of known compositions and a lambda table of weights.
- Based on the algorithm presented in:
Hautier, G., Fischer, C., Ehrlacher, V., Jain, A., and Ceder, G. (2011) Data Mined Ionic Substitutions for the Discovery of New Compounds. Inorganic Chemistry, 50(2), 656-663. doi:10.1021/ic102031h
- nary_predict_structs(species: list[tuple[str, int]], n_ary: int | None = 2, thresh: float | None = 0.001, include_same: bool | None = True) Generator[tuple[SmactStructure, float, SmactStructure], None, None][source]#
Predicts structures for a combination of species.
Args:#
- species: A list of (element, charge). The constituent species
of the target compound.
thresh: The probability threshold, below which to discard predictions. n_ary: The number of species in a parent compound to replace. include_same: Whether to include unmodified structures from the database,
i.e. structures containing all the same species.
Yields:#
Potential structures, as tuples of (structure, probability, parent).
- predict_structs(species: list[tuple[str, int]], thresh: float | None = 0.001, include_same: bool | None = True) Generator[tuple[SmactStructure, float, SmactStructure], None, None][source]#
Predict structures for a combination of species.
Args:#
- species: A list of (element, charge). The constituent species
of the target compound.
- thresh: The probability threshold, below which to discard
predictions.
- include_same: Whether to include unmodified structures
from the database, i.e. structures containing all the same species. Defaults to True.
Yields:#
Potential structures, as tuples of (structure, probability, parent).