smact.screening module¶
-
smact.screening.
eneg_states_test
(ox_states, enegs)[source]¶ Internal function for checking electronegativity criterion
This implementation is fast as it ‘short-circuits’ as soon as it finds an invalid combination. However it may be that in some cases redundant comparisons are made. Performance is very close between this method and eneg_states_test_alternate.
Parameters: - ox_states (list) – oxidation states corresponding to species in compound
- enegs (list) – Electronegativities corresponding to species in compound
Returns: - True if cations have higher electronegativity than
anions, otherwise False
Return type: bool
-
smact.screening.
eneg_states_test_alternate
(ox_states, enegs)[source]¶ Internal function for checking electronegativity criterion
This implementation appears to be slightly slower than eneg_states_test, but further testing is needed.
Parameters: - ox_states (list) – oxidation states corresponding to species in compound
- enegs (list) – Electronegativities corresponding to species in compound
Returns: - True if cations have higher electronegativity than
anions, otherwise False
Return type: bool
-
smact.screening.
eneg_states_test_threshold
(ox_states, enegs, threshold=0)[source]¶ Internal function for checking electronegativity criterion
This implementation is fast as it ‘short-circuits’ as soon as it finds an invalid combination. However it may be that in some cases redundant comparisons are made. Performance is very close between this method and eneg_states_test_alternate.
A ‘threshold’ option is added so that this constraint may be relaxed somewhat.
Parameters: - ox_states (list) – oxidation states corresponding to species in compound
- enegs (list) – Electronegativities corresponding to species in compound
- threshold (Option(float)) – a tolerance for the allowed deviation from the Pauling criterion
Returns: - True if cations have higher electronegativity than
anions, otherwise False
Return type: bool
-
smact.screening.
ml_rep_generator
(composition, stoichs=None)[source]¶ Function to take a composition of Elements and return a list of values between 0 and 1 that describes the composition, useful for machine learning.
The list is of length 103 as there are 103 elements considered in total in SMACT.
e.g. Li2O –> [0, 0, 2/3, 0, 0, 0, 0, 1/3, 0 ….]
Inspired by the representation used by Legrain et al. DOI: 10.1021/acs.chemmater.7b00789
Parameters: - composition (list) – Element objects in composition OR symbols of elements in composition
- stoichs (list) – Corresponding stoichiometries in the composition
Returns: - List of floats representing the composition that sum
to one
Return type: norm (list)
-
smact.screening.
pauling_test
(oxidation_states, electronegativities, symbols=[], repeat_anions=True, repeat_cations=True, threshold=0.0)[source]¶ - Check if a combination of ions makes chemical sense,
- (i.e. positive ions should be of lower electronegativity).
Parameters: - ox (list) – oxidation states of elements in the compound
- paul (list) – the corresponding Pauling electronegativities of the elements in the compound
- symbols (list) – chemical symbols of each site
- threshold (float) – a tolerance for the allowed deviation from the Pauling criterion
- repeat_anions – boolean, allow an anion to repeat in different oxidation states in the same compound
- repeat_cations – as above, but for cations
Returns: True if positive ions have lower electronegativity than negative ions
Return type: bool
-
smact.screening.
pauling_test_old
(ox, paul, symbols, repeat_anions=True, repeat_cations=True, threshold=0.0)[source]¶ Check if a combination of ions makes chemical sense, (i.e. positive ions should be of lower Pauling electronegativity). This function should give the same results as pauling_test but is not optimised for speed.
Parameters: - ox (list) – oxidation states of the compound
- paul (list) – the corresponding Pauling electronegativities of the elements in the compound
- symbols (list) – chemical symbols of each site.
- threshold (float) – a tolerance for the allowed deviation from the Pauling criterion
- repeat_anions – boolean, allow an anion to repeat in different oxidation states in the same compound.
- repeat_cations – as above, but for cations.
Returns: True if positive ions have lower electronegativity than negative ions
Return type: (bool)
-
smact.screening.
smact_filter
(els, threshold=8, species_unique=True, oxidation_states_set='default')[source]¶ Function that applies the charge neutrality and electronegativity tests in one go for simple application in external scripts that wish to apply the general ‘smact test’.
Parameters: - els (tuple/list) – A list of smact.Element objects
- threshold (int) – Threshold for stoichiometry limit, default = 8
- species_unique (bool) – Whether or not to consider elements in different oxidation states as unique in the results.
- oxidation_states_set (string) – A string to choose which set of oxidation states should be chosen. Options are ‘default’, ‘icsd’, ‘pymatgen’ and ‘wiki’ for the default, icsd, pymatgen structure predictor and Wikipedia (https://en.wikipedia.org/wiki/Template:List_of_oxidation_states_of_the_elements) oxidation states.
Returns: Allowed compositions for that chemical system in the form [(elements), (oxidation states), (ratios)] if species_unique=True or in the form [(elements), (ratios)] if species_unique=False.
Return type: allowed_comps (list)