Crystal Space SMACT Generation Module#
Utility functions for SMACT generation of compositions.
- smact.utils.crystal_space.generate_composition_with_smact.convert_formula(combinations: list, num_elements: int, max_stoich: int) list[source]#
Convert combinations into chemical formula.
- Parameters:
combinations (list) – list of lists of smact.Element objects.
num_elements (int) – the number of elements in a compound.
max_stoich (int) – the maximum stoichiometric coefficient.
- Returns:
A list of chemical formula.
- Return type:
local_compounds (list)
- smact.utils.crystal_space.generate_composition_with_smact.generate_composition_with_smact(num_elements: int = 2, max_stoich: int = 8, max_atomic_num: int = 103, num_processes: int | None = None, save_path: str | None = None, oxidation_states_set: str = 'icsd24') DataFrame[source]#
Generate all possible compositions of a given number of elements and filter them with SMACT.
- Parameters:
num_elements (int) – the number of elements in a compound. Defaults to 2.
max_stoich (int) – the maximum stoichiometric coefficient. Defaults to 8.
max_atomic_num (int) – the maximum atomic number. Defaults to 103.
num_processes (int) – the number of processes to use. Defaults to None.
save_path (str) – the path to save the results. Defaults to None.
oxidation_states_set (str) – the oxidation states set to use. Options are “smact14”, “icsd16”, “icsd24”, “pymatgen_sp”. For reproducing the Faraday Discussions results, use “smact14”. For custom oxidation states lists check generate_composition_with_smact_custom below.
- Returns:
A DataFrame of SMACT-generated compositions with boolean smact_allowed column.
- Return type:
df (pd.DataFrame)
- smact.utils.crystal_space.generate_composition_with_smact.generate_composition_with_smact_custom(num_elements: int = 2, max_stoich: int = 8, max_atomic_num: int = 103, num_processes: int | None = None, save_path: str | None = None, oxidation_states_set: str = 'icsd24') DataFrame[source]#
Generate all possible compositions of a given number of elements and filter them with SMACT.
- Parameters:
num_elements (int) – the number of elements in a compound. Defaults to 2.
max_stoich (int) – the maximum stoichiometric coefficient. Defaults to 8.
max_atomic_num (int) – the maximum atomic number. Defaults to 103.
num_processes (int) – the number of processes to use. Defaults to None.
save_path (str) – the path to save the results. Defaults to None.
oxidation_states_set (str) – Named oxidation states set (“icsd24”, “icsd16”, “smact14”, “pymatgen_sp”) or path to a custom file. Defaults to “icsd24”.
- Returns:
A DataFrame of SMACT-generated compositions with boolean smact_allowed column.
- Return type:
df (pd.DataFrame)