SMACT 4.0.0__tar.gz → 4.0.2__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {smact-4.0.0 → smact-4.0.2}/LICENSE +3 -0
- {smact-4.0.0/SMACT.egg-info → smact-4.0.2}/PKG-INFO +151 -19
- {smact-4.0.0 → smact-4.0.2}/README.md +148 -16
- {smact-4.0.0 → smact-4.0.2/SMACT.egg-info}/PKG-INFO +151 -19
- {smact-4.0.0 → smact-4.0.2}/SMACT.egg-info/SOURCES.txt +2 -0
- {smact-4.0.0 → smact-4.0.2}/SMACT.egg-info/requires.txt +2 -2
- {smact-4.0.0 → smact-4.0.2}/pyproject.toml +8 -3
- {smact-4.0.0 → smact-4.0.2}/smact/__init__.py +8 -14
- {smact-4.0.0 → smact-4.0.2}/smact/builder.py +0 -4
- smact-4.0.2/smact/data/lambda.json +1 -0
- {smact-4.0.0 → smact-4.0.2}/smact/data_loader.py +14 -20
- {smact-4.0.0 → smact-4.0.2}/smact/distorter.py +0 -7
- {smact-4.0.0 → smact-4.0.2}/smact/dopant_prediction/doper.py +24 -11
- {smact-4.0.0 → smact-4.0.2}/smact/io/elementembeddings.py +0 -4
- {smact-4.0.0 → smact-4.0.2}/smact/lattice.py +0 -2
- {smact-4.0.0 → smact-4.0.2}/smact/lattice_parameters.py +1 -25
- {smact-4.0.0 → smact-4.0.2}/smact/oxidation_states.py +0 -7
- {smact-4.0.0 → smact-4.0.2}/smact/properties.py +0 -9
- {smact-4.0.0 → smact-4.0.2}/smact/property_prediction/tests/test_io.py +10 -1
- {smact-4.0.0 → smact-4.0.2}/smact/screening.py +6 -15
- {smact-4.0.0 → smact-4.0.2}/smact/structure_prediction/database.py +13 -22
- {smact-4.0.0 → smact-4.0.2}/smact/structure_prediction/mutation.py +9 -19
- {smact-4.0.0 → smact-4.0.2}/smact/structure_prediction/prediction.py +0 -6
- {smact-4.0.0 → smact-4.0.2}/smact/structure_prediction/probability_models.py +0 -7
- {smact-4.0.0 → smact-4.0.2}/smact/structure_prediction/structure.py +7 -30
- smact-4.0.2/smact/tests/test_packaging.py +173 -0
- {smact-4.0.0 → smact-4.0.2}/smact/tests/test_structure.py +86 -22
- {smact-4.0.0 → smact-4.0.2}/smact/tests/test_utils.py +1 -4
- {smact-4.0.0 → smact-4.0.2}/smact/utils/crystal_space/download_compounds_with_mp_api.py +0 -2
- {smact-4.0.0 → smact-4.0.2}/smact/utils/species.py +0 -4
- {smact-4.0.0 → smact-4.0.2}/MANIFEST.in +0 -0
- {smact-4.0.0 → smact-4.0.2}/SMACT.egg-info/dependency_links.txt +0 -0
- {smact-4.0.0 → smact-4.0.2}/SMACT.egg-info/top_level.txt +0 -0
- {smact-4.0.0 → smact-4.0.2}/setup.cfg +0 -0
- {smact-4.0.0 → smact-4.0.2}/smact/benchmarking/__init__.py +0 -0
- {smact-4.0.0 → smact-4.0.2}/smact/benchmarking/pymatgen_benchmark.py +0 -0
- {smact-4.0.0 → smact-4.0.2}/smact/benchmarking/smact_benchmark.py +0 -0
- {smact-4.0.0 → smact-4.0.2}/smact/benchmarking/utilities.py +0 -0
- {smact-4.0.0 → smact-4.0.2}/smact/data/Covalent_radii.csv +0 -0
- {smact-4.0.0 → smact-4.0.2}/smact/data/SSE.csv +0 -0
- {smact-4.0.0 → smact-4.0.2}/smact/data/SSE_2015.csv +0 -0
- {smact-4.0.0 → smact-4.0.2}/smact/data/SSE_Pauling.csv +0 -0
- {smact-4.0.0 → smact-4.0.2}/smact/data/element_data.txt +0 -0
- {smact-4.0.0 → smact-4.0.2}/smact/data/element_valence_modified.csv +0 -0
- {smact-4.0.0 → smact-4.0.2}/smact/data/hhi.txt +0 -0
- {smact-4.0.0 → smact-4.0.2}/smact/data/ionic_radii.csv +0 -0
- {smact-4.0.0 → smact-4.0.2}/smact/data/magpie.csv +0 -0
- {smact-4.0.0 → smact-4.0.2}/smact/data/ordered_periodic.txt +0 -0
- {smact-4.0.0 → smact-4.0.2}/smact/data/oxidation_state_probability_table.json +0 -0
- {smact-4.0.0 → smact-4.0.2}/smact/data/oxidation_states.txt +0 -0
- {smact-4.0.0 → smact-4.0.2}/smact/data/oxidation_states_SP.txt +0 -0
- {smact-4.0.0 → smact-4.0.2}/smact/data/oxidation_states_icsd.txt +0 -0
- {smact-4.0.0 → smact-4.0.2}/smact/data/oxidation_states_icsd24_common.txt +0 -0
- {smact-4.0.0 → smact-4.0.2}/smact/data/oxidation_states_icsd24_counts.json +0 -0
- {smact-4.0.0 → smact-4.0.2}/smact/data/oxidation_states_icsd24_filtered.txt +0 -0
- {smact-4.0.0 → smact-4.0.2}/smact/data/oxidation_states_icsd24_raw.txt +0 -0
- {smact-4.0.0 → smact-4.0.2}/smact/data/oxidation_states_pmg.txt +0 -0
- {smact-4.0.0 → smact-4.0.2}/smact/data/oxidation_states_wiki.txt +0 -0
- {smact-4.0.0 → smact-4.0.2}/smact/data/shannon_radii.csv +0 -0
- {smact-4.0.0 → smact-4.0.2}/smact/data/shannon_radii_ML_extended.csv +0 -0
- {smact-4.0.0 → smact-4.0.2}/smact/data/solid_properties.txt +0 -0
- {smact-4.0.0 → smact-4.0.2}/smact/data/solid_properties.xlsx +0 -0
- {smact-4.0.0 → smact-4.0.2}/smact/data/species_rep/ion_embedding_M3GNet-MP-2023.11.1-oxi-Eform_cosine_similarity.json +0 -0
- {smact-4.0.0 → smact-4.0.2}/smact/data/species_rep/ion_embedding_M3GNet-MP-2023.11.1-oxi-band_gap_cosine_similarity.json +0 -0
- {smact-4.0.0 → smact-4.0.2}/smact/data/species_rep/skipspecies_20221028_319ion_dim200_cosine_similarity.json +0 -0
- {smact-4.0.0 → smact-4.0.2}/smact/dopant_prediction/__init__.py +0 -0
- {smact-4.0.0 → smact-4.0.2}/smact/io/__init__.py +0 -0
- {smact-4.0.0 → smact-4.0.2}/smact/metallicity.py +0 -0
- {smact-4.0.0 → smact-4.0.2}/smact/property_prediction/__init__.py +0 -0
- {smact-4.0.0 → smact-4.0.2}/smact/property_prediction/base_predictor.py +0 -0
- {smact-4.0.0 → smact-4.0.2}/smact/property_prediction/config.py +0 -0
- {smact-4.0.0 → smact-4.0.2}/smact/property_prediction/convenience.py +0 -0
- {smact-4.0.0 → smact-4.0.2}/smact/property_prediction/io.py +0 -0
- {smact-4.0.0 → smact-4.0.2}/smact/property_prediction/registry.py +0 -0
- {smact-4.0.0 → smact-4.0.2}/smact/property_prediction/roost/__init__.py +0 -0
- {smact-4.0.0 → smact-4.0.2}/smact/property_prediction/roost/predictor.py +0 -0
- {smact-4.0.0 → smact-4.0.2}/smact/property_prediction/roost/train.py +0 -0
- {smact-4.0.0 → smact-4.0.2}/smact/property_prediction/scripts/__init__.py +0 -0
- {smact-4.0.0 → smact-4.0.2}/smact/property_prediction/scripts/convert_checkpoint.py +0 -0
- {smact-4.0.0 → smact-4.0.2}/smact/property_prediction/tests/__init__.py +0 -0
- {smact-4.0.0 → smact-4.0.2}/smact/property_prediction/tests/test_base_predictor.py +0 -0
- {smact-4.0.0 → smact-4.0.2}/smact/property_prediction/tests/test_registry.py +0 -0
- {smact-4.0.0 → smact-4.0.2}/smact/py.typed +0 -0
- {smact-4.0.0 → smact-4.0.2}/smact/structure_prediction/__init__.py +0 -0
- {smact-4.0.0 → smact-4.0.2}/smact/structure_prediction/utilities.py +0 -0
- {smact-4.0.0 → smact-4.0.2}/smact/tests/__init__.py +0 -0
- {smact-4.0.0 → smact-4.0.2}/smact/tests/conftest.py +0 -0
- {smact-4.0.0 → smact-4.0.2}/smact/tests/test_core.py +0 -0
- {smact-4.0.0 → smact-4.0.2}/smact/tests/test_doper.py +0 -0
- {smact-4.0.0 → smact-4.0.2}/smact/tests/test_elementembeddings.py +0 -0
- {smact-4.0.0 → smact-4.0.2}/smact/tests/test_lattice_parameters.py +0 -0
- {smact-4.0.0 → smact-4.0.2}/smact/tests/test_metallicity.py +0 -0
- {smact-4.0.0 → smact-4.0.2}/smact/tests/test_probability_models.py +0 -0
- {smact-4.0.0 → smact-4.0.2}/smact/utils/__init__.py +0 -0
- {smact-4.0.0 → smact-4.0.2}/smact/utils/band_gap_simple.py +0 -0
- {smact-4.0.0 → smact-4.0.2}/smact/utils/composition.py +0 -0
- {smact-4.0.0 → smact-4.0.2}/smact/utils/crystal_space/__init__.py +0 -0
- {smact-4.0.0 → smact-4.0.2}/smact/utils/crystal_space/generate_composition_with_smact.py +0 -0
- {smact-4.0.0 → smact-4.0.2}/smact/utils/crystal_space/plot_embedding.py +0 -0
- {smact-4.0.0 → smact-4.0.2}/smact/utils/oxidation.py +0 -0
|
@@ -19,3 +19,6 @@ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
|
19
19
|
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
20
|
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
21
|
SOFTWARE.
|
|
22
|
+
|
|
23
|
+
This project bundles third-party material under its own license terms;
|
|
24
|
+
see THIRD_PARTY_NOTICES.md.
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: SMACT
|
|
3
|
-
Version: 4.0.
|
|
3
|
+
Version: 4.0.2
|
|
4
4
|
Summary: Semiconducting Materials by Analogy and Chemical Theory
|
|
5
5
|
Author-email: The SMACT Developers <a.walsh@imperial.ac.uk>
|
|
6
6
|
Maintainer-email: "Kinga O. Mastej" <k.mastej24@imperial.ac.uk>
|
|
@@ -25,7 +25,7 @@ Description-Content-Type: text/markdown
|
|
|
25
25
|
License-File: LICENSE
|
|
26
26
|
Requires-Dist: ase
|
|
27
27
|
Requires-Dist: numpy<3
|
|
28
|
-
Requires-Dist: pandarallel
|
|
28
|
+
Requires-Dist: pandarallel>=1.6.5
|
|
29
29
|
Requires-Dist: pandas
|
|
30
30
|
Requires-Dist: pathos
|
|
31
31
|
Requires-Dist: pymatgen>=2024.2.20
|
|
@@ -70,7 +70,7 @@ Requires-Dist: smact[featurisers]; extra == "ml"
|
|
|
70
70
|
Provides-Extra: property-prediction
|
|
71
71
|
Requires-Dist: aviary-models>=1.2.1; extra == "property-prediction"
|
|
72
72
|
Requires-Dist: requests; extra == "property-prediction"
|
|
73
|
-
Requires-Dist: torch
|
|
73
|
+
Requires-Dist: torch<2.11,>=2.0.0; extra == "property-prediction"
|
|
74
74
|
Provides-Extra: optional
|
|
75
75
|
Requires-Dist: pydantic>=2.9.2; extra == "optional"
|
|
76
76
|
Requires-Dist: smact[mp]; extra == "optional"
|
|
@@ -103,8 +103,8 @@ Requires-Dist: tqdm==4.67.1; extra == "strict"
|
|
|
103
103
|
Dynamic: license-file
|
|
104
104
|
|
|
105
105
|
[](https://doi.org/10.21105/joss.01361)
|
|
106
|
-
[](
|
|
106
|
+
[](https://doi.org/10.5281/zenodo.595853)
|
|
107
|
+
[](https://smact.readthedocs.org/en/latest/?badge=latest)
|
|
108
108
|
[](https://opensource.org/licenses/MIT)
|
|
109
109
|

|
|
110
110
|
[](https://github.com/astral-sh/ruff)
|
|
@@ -118,7 +118,7 @@ Dynamic: license-file
|
|
|
118
118
|
|
|
119
119
|
# SMACT
|
|
120
120
|
|
|
121
|
-
**Semiconducting Materials
|
|
121
|
+
**Semiconducting Materials by Analogy and Chemical Theory** (SMACT) is a collection of rapid screening and informatics tools that uses data about chemical elements.
|
|
122
122
|
|
|
123
123
|
- **Documentation:** <https://smact.readthedocs.io/en/latest/>
|
|
124
124
|
- **Examples:** <https://smact.readthedocs.io/en/latest/examples.html>
|
|
@@ -155,6 +155,12 @@ Use cases are available in our [examples](https://smact.readthedocs.io/en/latest
|
|
|
155
155
|
|
|
156
156
|
- Compositions can be converted for use in Pymatgen or for representation to machine learning algorithms ([see this example](https://smact.readthedocs.io/en/latest/tutorials/smact_generation_of_solar_oxides.html)) and the related [ElementEmbeddings](https://github.com/WMD-group/ElementEmbeddings) package.
|
|
157
157
|
|
|
158
|
+
- Charge neutrality screening supports **mixed-valence compounds** via the `mixed_valence=True` flag in `smact_validity`, enabling correct handling of materials like Fe₃O₄ and Mn₃O₄.
|
|
159
|
+
|
|
160
|
+
- Oxidation state data is sourced from **ICSD 2024**, providing an updated and stricter set of experimentally observed oxidation states per element.
|
|
161
|
+
|
|
162
|
+
- The [property prediction module](https://smact.readthedocs.io/en/latest/smact.property_prediction.html) enables composition-to-property prediction using pretrained deep learning models, including a ROOST-based band gap predictor trained on the Materials Project database.
|
|
163
|
+
|
|
158
164
|
- The code also has tools for manipulating common crystal lattice types:
|
|
159
165
|
- Certain structure types can be built using the [builder module](https://smact.readthedocs.io/en/latest/smact.builder.html)
|
|
160
166
|
- Lattice parameters can be estimated using ionic radii of the elements for various common crystal structure types using the [lattice_parameters module](https://smact.readthedocs.io/en/latest/smact.lattice_parameters.html).
|
|
@@ -162,6 +168,88 @@ Use cases are available in our [examples](https://smact.readthedocs.io/en/latest
|
|
|
162
168
|
- The [structure prediction](https://smact.readthedocs.io/en/latest/smact.structure_prediction.html) module can be used to predict the structure of hypothetical compositions using species similarity measures.
|
|
163
169
|
- The [dopant prediction](https://smact.readthedocs.io/en/latest/smact.dopant_prediction.html) module can be used to facilitate high-throughput predictions of p-type and n-type dopants of multicomponent solids.
|
|
164
170
|
|
|
171
|
+
## Package structure
|
|
172
|
+
|
|
173
|
+
**Legend:** 🟢 new in v4 — 🟡 improved in v4
|
|
174
|
+
|
|
175
|
+
```mermaid
|
|
176
|
+
graph TD
|
|
177
|
+
classDef new fill:#c8e6c9,stroke:#388e3c,color:#000
|
|
178
|
+
classDef improved fill:#fff9c4,stroke:#f9a825,color:#000
|
|
179
|
+
|
|
180
|
+
SMACT(["smact"])
|
|
181
|
+
|
|
182
|
+
SMACT --> core["Core modules"]
|
|
183
|
+
SMACT --> SP["structure_prediction"]
|
|
184
|
+
SMACT --> DP["dopant_prediction"]
|
|
185
|
+
SMACT --> PP["🟢 property_prediction"]
|
|
186
|
+
SMACT --> IO["🟢 io"]
|
|
187
|
+
SMACT --> UT["utils"]
|
|
188
|
+
|
|
189
|
+
core --> init["init.py — Element, Species, neutral_ratios"]
|
|
190
|
+
core --> dl["data_loader.py — elemental and oxidation state data loading"]
|
|
191
|
+
core --> sc["🟡 screening.py — compositional screening"]
|
|
192
|
+
core --> pr["properties.py — band gap, electronegativity, valence electron count"]
|
|
193
|
+
core --> ox["oxidation_states.py — oxidation state combination likelihood"]
|
|
194
|
+
core --> mt["metallicity.py — metallic character scoring"]
|
|
195
|
+
core --> la["lattice.py — Site and Lattice representations"]
|
|
196
|
+
core --> bld["🟡 builder.py — perovskite and wurtzite structure builders"]
|
|
197
|
+
core --> lp["🟡 lattice_parameters.py — lattice parameter estimation from ionic radii"]
|
|
198
|
+
core --> di["distorter.py — inequivalent site enumeration and substitution"]
|
|
199
|
+
|
|
200
|
+
sc --> sc1["smact_validity — charge neutrality and Pauling electronegativity test"]
|
|
201
|
+
sc --> sc2["smact_filter — compositional search space generation"]
|
|
202
|
+
sc --> sc3["🟢 mixed_valence flag — correct handling of Fe3O4, Mn3O4"]
|
|
203
|
+
sc --> sc4["🟢 ICSD 2024 oxidation states — stricter, updated elemental data"]
|
|
204
|
+
|
|
205
|
+
bld --> bld1["cubic_perovskite — parameterized oxidation state tiling"]
|
|
206
|
+
bld --> bld2["wurtzite — corrected default cell parameters"]
|
|
207
|
+
|
|
208
|
+
lp --> lp1["corrected geometric formulae for all structure types"]
|
|
209
|
+
|
|
210
|
+
SP --> spst["structure.py — SmactStructure"]
|
|
211
|
+
SP --> spdb["database.py — StructureDB SQLite interface"]
|
|
212
|
+
SP --> spmu["mutation.py — CationMutator from lambda tables"]
|
|
213
|
+
SP --> sppd["🟡 prediction.py — StructurePredictor"]
|
|
214
|
+
|
|
215
|
+
spst --> spst1["from_file, from_mp, from_pymatgen constructors"]
|
|
216
|
+
sppd --> sppd1["ionic substitution-based crystal structure prediction"]
|
|
217
|
+
sppd --> sppd2["🟢 updated to mp_api.client.MPRester interface"]
|
|
218
|
+
|
|
219
|
+
DP --> doper["🟡 doper.py — Doper"]
|
|
220
|
+
doper --> doper1["get_dopants — p-type and n-type candidates"]
|
|
221
|
+
doper --> doper2["to_table — ranked candidates as a formatted table"]
|
|
222
|
+
doper --> doper3["plot_dopants — periodic table heatmap visualisation"]
|
|
223
|
+
|
|
224
|
+
PP --> base["base_predictor.py — BasePropertyPredictor, PredictionResult"]
|
|
225
|
+
PP --> roost["roost/ — RoostPropertyPredictor"]
|
|
226
|
+
PP --> conv["convenience.py — predict_band_gap"]
|
|
227
|
+
PP --> reg["registry.py — model discovery and resolution"]
|
|
228
|
+
|
|
229
|
+
roost --> roost1["pretrained ROOST model for band gap prediction"]
|
|
230
|
+
roost --> roost2["uncertainty estimates alongside predictions"]
|
|
231
|
+
roost --> roost3["trained on Materials Project 2024 database"]
|
|
232
|
+
base --> base1["PredictionResult — value, uncertainty, metadata"]
|
|
233
|
+
|
|
234
|
+
IO --> ee["🟢 elementembeddings.py — ElementEmbeddings interface"]
|
|
235
|
+
ee --> ee1["composition_featuriser — composition-level feature vectors"]
|
|
236
|
+
ee --> ee2["species_featuriser — species-level feature vectors"]
|
|
237
|
+
|
|
238
|
+
UT --> comp["composition.py — parse_formula, comp_maker, formula_maker"]
|
|
239
|
+
UT --> uox["🟢 oxidation.py — ICSD24OxStatesFilter"]
|
|
240
|
+
UT --> sp2["species.py — parse_spec, unparse_spec"]
|
|
241
|
+
UT --> cs["crystal_space/"]
|
|
242
|
+
|
|
243
|
+
uox --> uox1["consensus and commonality-based filtering of oxidation states"]
|
|
244
|
+
cs --> cs1["generate_composition_with_smact.py — SMACT-based composition generation"]
|
|
245
|
+
cs --> cs2["download_compounds_with_mp_api.py — Materials Project bulk download"]
|
|
246
|
+
cs --> cs3["plot_embedding.py — crystal space visualisation"]
|
|
247
|
+
|
|
248
|
+
class PP,IO new
|
|
249
|
+
class sc,bld,lp,sppd,doper,uox improved
|
|
250
|
+
class sc3,sc4,sppd2,ee,uox new
|
|
251
|
+
```
|
|
252
|
+
|
|
165
253
|
## List of modules
|
|
166
254
|
|
|
167
255
|
- **smact** library containing:
|
|
@@ -179,36 +267,73 @@ Use cases are available in our [examples](https://smact.readthedocs.io/en/latest
|
|
|
179
267
|
substituting on inequivalent sites of a sub-lattice.
|
|
180
268
|
- **oxidation_states.py**: Used for predicting the likelihood of species coexisting in a compound based on a statistical model.
|
|
181
269
|
- **structure_prediction**: A submodule which contains a collection of tools for facilitating crystal structure predictions via ionic substitutions
|
|
182
|
-
- **dopant_prediction**: A submodule which contains a
|
|
183
|
-
- **
|
|
270
|
+
- **dopant_prediction**: A submodule which contains a collection of tools for predicting dopants.
|
|
271
|
+
- **property_prediction**: A submodule for composition-to-property prediction using pretrained deep learning models (e.g. ROOST band gap predictor).
|
|
272
|
+
- **utils**: A submodule containing utility functions for composition parsing, species handling, oxidation state filtering, and crystal space generation and download.
|
|
184
273
|
|
|
185
274
|
## Requirements
|
|
186
275
|
|
|
187
276
|
The main language is Python 3 and has been tested using Python 3.11 - 3.13.
|
|
188
|
-
Core dependencies include NumPy, SciPy, pandas, [pymatgen](https://pymatgen.org), [ASE](https://wiki.fysik.dtu.dk/ase), and [spglib](
|
|
277
|
+
Core dependencies include NumPy, SciPy, pandas, [pymatgen](https://pymatgen.org), [ASE](https://wiki.fysik.dtu.dk/ase), and [spglib](https://spglib.readthedocs.io). A full list is in [`pyproject.toml`](pyproject.toml).
|
|
189
278
|
|
|
190
279
|
## Installation
|
|
191
280
|
|
|
192
281
|
The latest stable release can be installed via pip:
|
|
193
282
|
|
|
194
|
-
|
|
283
|
+
```bash
|
|
284
|
+
pip install smact
|
|
285
|
+
```
|
|
286
|
+
|
|
287
|
+
Optional dependencies, needed by most of the examples and tutorials:
|
|
288
|
+
|
|
289
|
+
```bash
|
|
290
|
+
pip install "smact[optional]"
|
|
291
|
+
```
|
|
195
292
|
|
|
196
|
-
|
|
293
|
+
The band-gap prediction example additionally needs the pre-trained ROOST models, which
|
|
294
|
+
bring in PyTorch. To run every example and tutorial:
|
|
197
295
|
|
|
198
|
-
|
|
296
|
+
```bash
|
|
297
|
+
pip install "smact[optional,property_prediction]"
|
|
298
|
+
```
|
|
199
299
|
|
|
200
300
|
SMACT is also available via conda-forge:
|
|
201
301
|
|
|
202
|
-
|
|
302
|
+
```bash
|
|
303
|
+
conda install -c conda-forge smact
|
|
304
|
+
```
|
|
305
|
+
|
|
306
|
+
The optional functionality is available as conda-forge feature packages. Install
|
|
307
|
+
only the feature you need; for example, the pre-trained property-prediction
|
|
308
|
+
models can be installed with:
|
|
309
|
+
|
|
310
|
+
```bash
|
|
311
|
+
conda install -c conda-forge smact-property-prediction
|
|
312
|
+
```
|
|
313
|
+
|
|
314
|
+
The other feature packages are `smact-mp`, `smact-crystal-space`,
|
|
315
|
+
`smact-featurisers`, `smact-visualisation`, `smact-ml`, and `smact-optional`.
|
|
316
|
+
`smact-optional` matches the `smact[optional]` pip extra. To install all
|
|
317
|
+
documented examples and tutorials, including property prediction:
|
|
318
|
+
|
|
319
|
+
```bash
|
|
320
|
+
conda install -c conda-forge smact-optional smact-property-prediction
|
|
321
|
+
```
|
|
322
|
+
|
|
323
|
+
Conda feature packages use conda-forge builds of compiled dependencies such as
|
|
324
|
+
`pytorch` (the package is named `torch` on PyPI). Select any GPU-specific
|
|
325
|
+
`pytorch` configuration separately for your platform.
|
|
203
326
|
|
|
204
327
|
### Developer installation
|
|
205
328
|
|
|
206
329
|
We use [uv](https://docs.astral.sh/uv/) for dependency management. To set up a development environment:
|
|
207
330
|
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
331
|
+
```bash
|
|
332
|
+
git clone https://github.com/wmd-group/smact.git
|
|
333
|
+
cd smact
|
|
334
|
+
uv sync --extra optional --extra property_prediction --dev
|
|
335
|
+
pre-commit install
|
|
336
|
+
```
|
|
212
337
|
|
|
213
338
|
This installs SMACT in editable mode with all optional and development dependencies, and sets up pre-commit hooks. See [CONTRIBUTING.md](CONTRIBUTING.md) for the full workflow.
|
|
214
339
|
|
|
@@ -237,14 +362,21 @@ We use [GitHub Actions](https://github.com/features/actions) for CI. Tests shoul
|
|
|
237
362
|
|
|
238
363
|
Run the tests locally:
|
|
239
364
|
|
|
240
|
-
|
|
365
|
+
```bash
|
|
366
|
+
make test
|
|
367
|
+
```
|
|
241
368
|
|
|
242
369
|
Or to run the full CI pipeline (pre-commit hooks and tests):
|
|
243
370
|
|
|
244
|
-
|
|
371
|
+
```bash
|
|
372
|
+
make ci-local
|
|
373
|
+
```
|
|
245
374
|
|
|
246
375
|
## References
|
|
247
376
|
|
|
377
|
+
[K. O. Mastej et al.,
|
|
378
|
+
"Chemical filters for ultra-high-throughput materials screening and generation" _arXiv_ (2026)](https://doi.org/10.48550/arXiv.2607.17910)
|
|
379
|
+
|
|
248
380
|
[H. Park et al.,
|
|
249
381
|
"Mapping inorganic crystal chemical space" _Faraday Discuss._ (2024)](https://pubs.rsc.org/en/content/articlelanding/2024/fd/d4fd00063c)
|
|
250
382
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
[](https://doi.org/10.21105/joss.01361)
|
|
2
|
-
[](
|
|
2
|
+
[](https://doi.org/10.5281/zenodo.595853)
|
|
3
|
+
[](https://smact.readthedocs.org/en/latest/?badge=latest)
|
|
4
4
|
[](https://opensource.org/licenses/MIT)
|
|
5
5
|

|
|
6
6
|
[](https://github.com/astral-sh/ruff)
|
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
|
|
15
15
|
# SMACT
|
|
16
16
|
|
|
17
|
-
**Semiconducting Materials
|
|
17
|
+
**Semiconducting Materials by Analogy and Chemical Theory** (SMACT) is a collection of rapid screening and informatics tools that uses data about chemical elements.
|
|
18
18
|
|
|
19
19
|
- **Documentation:** <https://smact.readthedocs.io/en/latest/>
|
|
20
20
|
- **Examples:** <https://smact.readthedocs.io/en/latest/examples.html>
|
|
@@ -51,6 +51,12 @@ Use cases are available in our [examples](https://smact.readthedocs.io/en/latest
|
|
|
51
51
|
|
|
52
52
|
- Compositions can be converted for use in Pymatgen or for representation to machine learning algorithms ([see this example](https://smact.readthedocs.io/en/latest/tutorials/smact_generation_of_solar_oxides.html)) and the related [ElementEmbeddings](https://github.com/WMD-group/ElementEmbeddings) package.
|
|
53
53
|
|
|
54
|
+
- Charge neutrality screening supports **mixed-valence compounds** via the `mixed_valence=True` flag in `smact_validity`, enabling correct handling of materials like Fe₃O₄ and Mn₃O₄.
|
|
55
|
+
|
|
56
|
+
- Oxidation state data is sourced from **ICSD 2024**, providing an updated and stricter set of experimentally observed oxidation states per element.
|
|
57
|
+
|
|
58
|
+
- The [property prediction module](https://smact.readthedocs.io/en/latest/smact.property_prediction.html) enables composition-to-property prediction using pretrained deep learning models, including a ROOST-based band gap predictor trained on the Materials Project database.
|
|
59
|
+
|
|
54
60
|
- The code also has tools for manipulating common crystal lattice types:
|
|
55
61
|
- Certain structure types can be built using the [builder module](https://smact.readthedocs.io/en/latest/smact.builder.html)
|
|
56
62
|
- Lattice parameters can be estimated using ionic radii of the elements for various common crystal structure types using the [lattice_parameters module](https://smact.readthedocs.io/en/latest/smact.lattice_parameters.html).
|
|
@@ -58,6 +64,88 @@ Use cases are available in our [examples](https://smact.readthedocs.io/en/latest
|
|
|
58
64
|
- The [structure prediction](https://smact.readthedocs.io/en/latest/smact.structure_prediction.html) module can be used to predict the structure of hypothetical compositions using species similarity measures.
|
|
59
65
|
- The [dopant prediction](https://smact.readthedocs.io/en/latest/smact.dopant_prediction.html) module can be used to facilitate high-throughput predictions of p-type and n-type dopants of multicomponent solids.
|
|
60
66
|
|
|
67
|
+
## Package structure
|
|
68
|
+
|
|
69
|
+
**Legend:** 🟢 new in v4 — 🟡 improved in v4
|
|
70
|
+
|
|
71
|
+
```mermaid
|
|
72
|
+
graph TD
|
|
73
|
+
classDef new fill:#c8e6c9,stroke:#388e3c,color:#000
|
|
74
|
+
classDef improved fill:#fff9c4,stroke:#f9a825,color:#000
|
|
75
|
+
|
|
76
|
+
SMACT(["smact"])
|
|
77
|
+
|
|
78
|
+
SMACT --> core["Core modules"]
|
|
79
|
+
SMACT --> SP["structure_prediction"]
|
|
80
|
+
SMACT --> DP["dopant_prediction"]
|
|
81
|
+
SMACT --> PP["🟢 property_prediction"]
|
|
82
|
+
SMACT --> IO["🟢 io"]
|
|
83
|
+
SMACT --> UT["utils"]
|
|
84
|
+
|
|
85
|
+
core --> init["init.py — Element, Species, neutral_ratios"]
|
|
86
|
+
core --> dl["data_loader.py — elemental and oxidation state data loading"]
|
|
87
|
+
core --> sc["🟡 screening.py — compositional screening"]
|
|
88
|
+
core --> pr["properties.py — band gap, electronegativity, valence electron count"]
|
|
89
|
+
core --> ox["oxidation_states.py — oxidation state combination likelihood"]
|
|
90
|
+
core --> mt["metallicity.py — metallic character scoring"]
|
|
91
|
+
core --> la["lattice.py — Site and Lattice representations"]
|
|
92
|
+
core --> bld["🟡 builder.py — perovskite and wurtzite structure builders"]
|
|
93
|
+
core --> lp["🟡 lattice_parameters.py — lattice parameter estimation from ionic radii"]
|
|
94
|
+
core --> di["distorter.py — inequivalent site enumeration and substitution"]
|
|
95
|
+
|
|
96
|
+
sc --> sc1["smact_validity — charge neutrality and Pauling electronegativity test"]
|
|
97
|
+
sc --> sc2["smact_filter — compositional search space generation"]
|
|
98
|
+
sc --> sc3["🟢 mixed_valence flag — correct handling of Fe3O4, Mn3O4"]
|
|
99
|
+
sc --> sc4["🟢 ICSD 2024 oxidation states — stricter, updated elemental data"]
|
|
100
|
+
|
|
101
|
+
bld --> bld1["cubic_perovskite — parameterized oxidation state tiling"]
|
|
102
|
+
bld --> bld2["wurtzite — corrected default cell parameters"]
|
|
103
|
+
|
|
104
|
+
lp --> lp1["corrected geometric formulae for all structure types"]
|
|
105
|
+
|
|
106
|
+
SP --> spst["structure.py — SmactStructure"]
|
|
107
|
+
SP --> spdb["database.py — StructureDB SQLite interface"]
|
|
108
|
+
SP --> spmu["mutation.py — CationMutator from lambda tables"]
|
|
109
|
+
SP --> sppd["🟡 prediction.py — StructurePredictor"]
|
|
110
|
+
|
|
111
|
+
spst --> spst1["from_file, from_mp, from_pymatgen constructors"]
|
|
112
|
+
sppd --> sppd1["ionic substitution-based crystal structure prediction"]
|
|
113
|
+
sppd --> sppd2["🟢 updated to mp_api.client.MPRester interface"]
|
|
114
|
+
|
|
115
|
+
DP --> doper["🟡 doper.py — Doper"]
|
|
116
|
+
doper --> doper1["get_dopants — p-type and n-type candidates"]
|
|
117
|
+
doper --> doper2["to_table — ranked candidates as a formatted table"]
|
|
118
|
+
doper --> doper3["plot_dopants — periodic table heatmap visualisation"]
|
|
119
|
+
|
|
120
|
+
PP --> base["base_predictor.py — BasePropertyPredictor, PredictionResult"]
|
|
121
|
+
PP --> roost["roost/ — RoostPropertyPredictor"]
|
|
122
|
+
PP --> conv["convenience.py — predict_band_gap"]
|
|
123
|
+
PP --> reg["registry.py — model discovery and resolution"]
|
|
124
|
+
|
|
125
|
+
roost --> roost1["pretrained ROOST model for band gap prediction"]
|
|
126
|
+
roost --> roost2["uncertainty estimates alongside predictions"]
|
|
127
|
+
roost --> roost3["trained on Materials Project 2024 database"]
|
|
128
|
+
base --> base1["PredictionResult — value, uncertainty, metadata"]
|
|
129
|
+
|
|
130
|
+
IO --> ee["🟢 elementembeddings.py — ElementEmbeddings interface"]
|
|
131
|
+
ee --> ee1["composition_featuriser — composition-level feature vectors"]
|
|
132
|
+
ee --> ee2["species_featuriser — species-level feature vectors"]
|
|
133
|
+
|
|
134
|
+
UT --> comp["composition.py — parse_formula, comp_maker, formula_maker"]
|
|
135
|
+
UT --> uox["🟢 oxidation.py — ICSD24OxStatesFilter"]
|
|
136
|
+
UT --> sp2["species.py — parse_spec, unparse_spec"]
|
|
137
|
+
UT --> cs["crystal_space/"]
|
|
138
|
+
|
|
139
|
+
uox --> uox1["consensus and commonality-based filtering of oxidation states"]
|
|
140
|
+
cs --> cs1["generate_composition_with_smact.py — SMACT-based composition generation"]
|
|
141
|
+
cs --> cs2["download_compounds_with_mp_api.py — Materials Project bulk download"]
|
|
142
|
+
cs --> cs3["plot_embedding.py — crystal space visualisation"]
|
|
143
|
+
|
|
144
|
+
class PP,IO new
|
|
145
|
+
class sc,bld,lp,sppd,doper,uox improved
|
|
146
|
+
class sc3,sc4,sppd2,ee,uox new
|
|
147
|
+
```
|
|
148
|
+
|
|
61
149
|
## List of modules
|
|
62
150
|
|
|
63
151
|
- **smact** library containing:
|
|
@@ -75,36 +163,73 @@ Use cases are available in our [examples](https://smact.readthedocs.io/en/latest
|
|
|
75
163
|
substituting on inequivalent sites of a sub-lattice.
|
|
76
164
|
- **oxidation_states.py**: Used for predicting the likelihood of species coexisting in a compound based on a statistical model.
|
|
77
165
|
- **structure_prediction**: A submodule which contains a collection of tools for facilitating crystal structure predictions via ionic substitutions
|
|
78
|
-
- **dopant_prediction**: A submodule which contains a
|
|
79
|
-
- **
|
|
166
|
+
- **dopant_prediction**: A submodule which contains a collection of tools for predicting dopants.
|
|
167
|
+
- **property_prediction**: A submodule for composition-to-property prediction using pretrained deep learning models (e.g. ROOST band gap predictor).
|
|
168
|
+
- **utils**: A submodule containing utility functions for composition parsing, species handling, oxidation state filtering, and crystal space generation and download.
|
|
80
169
|
|
|
81
170
|
## Requirements
|
|
82
171
|
|
|
83
172
|
The main language is Python 3 and has been tested using Python 3.11 - 3.13.
|
|
84
|
-
Core dependencies include NumPy, SciPy, pandas, [pymatgen](https://pymatgen.org), [ASE](https://wiki.fysik.dtu.dk/ase), and [spglib](
|
|
173
|
+
Core dependencies include NumPy, SciPy, pandas, [pymatgen](https://pymatgen.org), [ASE](https://wiki.fysik.dtu.dk/ase), and [spglib](https://spglib.readthedocs.io). A full list is in [`pyproject.toml`](pyproject.toml).
|
|
85
174
|
|
|
86
175
|
## Installation
|
|
87
176
|
|
|
88
177
|
The latest stable release can be installed via pip:
|
|
89
178
|
|
|
90
|
-
|
|
179
|
+
```bash
|
|
180
|
+
pip install smact
|
|
181
|
+
```
|
|
182
|
+
|
|
183
|
+
Optional dependencies, needed by most of the examples and tutorials:
|
|
184
|
+
|
|
185
|
+
```bash
|
|
186
|
+
pip install "smact[optional]"
|
|
187
|
+
```
|
|
91
188
|
|
|
92
|
-
|
|
189
|
+
The band-gap prediction example additionally needs the pre-trained ROOST models, which
|
|
190
|
+
bring in PyTorch. To run every example and tutorial:
|
|
93
191
|
|
|
94
|
-
|
|
192
|
+
```bash
|
|
193
|
+
pip install "smact[optional,property_prediction]"
|
|
194
|
+
```
|
|
95
195
|
|
|
96
196
|
SMACT is also available via conda-forge:
|
|
97
197
|
|
|
98
|
-
|
|
198
|
+
```bash
|
|
199
|
+
conda install -c conda-forge smact
|
|
200
|
+
```
|
|
201
|
+
|
|
202
|
+
The optional functionality is available as conda-forge feature packages. Install
|
|
203
|
+
only the feature you need; for example, the pre-trained property-prediction
|
|
204
|
+
models can be installed with:
|
|
205
|
+
|
|
206
|
+
```bash
|
|
207
|
+
conda install -c conda-forge smact-property-prediction
|
|
208
|
+
```
|
|
209
|
+
|
|
210
|
+
The other feature packages are `smact-mp`, `smact-crystal-space`,
|
|
211
|
+
`smact-featurisers`, `smact-visualisation`, `smact-ml`, and `smact-optional`.
|
|
212
|
+
`smact-optional` matches the `smact[optional]` pip extra. To install all
|
|
213
|
+
documented examples and tutorials, including property prediction:
|
|
214
|
+
|
|
215
|
+
```bash
|
|
216
|
+
conda install -c conda-forge smact-optional smact-property-prediction
|
|
217
|
+
```
|
|
218
|
+
|
|
219
|
+
Conda feature packages use conda-forge builds of compiled dependencies such as
|
|
220
|
+
`pytorch` (the package is named `torch` on PyPI). Select any GPU-specific
|
|
221
|
+
`pytorch` configuration separately for your platform.
|
|
99
222
|
|
|
100
223
|
### Developer installation
|
|
101
224
|
|
|
102
225
|
We use [uv](https://docs.astral.sh/uv/) for dependency management. To set up a development environment:
|
|
103
226
|
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
227
|
+
```bash
|
|
228
|
+
git clone https://github.com/wmd-group/smact.git
|
|
229
|
+
cd smact
|
|
230
|
+
uv sync --extra optional --extra property_prediction --dev
|
|
231
|
+
pre-commit install
|
|
232
|
+
```
|
|
108
233
|
|
|
109
234
|
This installs SMACT in editable mode with all optional and development dependencies, and sets up pre-commit hooks. See [CONTRIBUTING.md](CONTRIBUTING.md) for the full workflow.
|
|
110
235
|
|
|
@@ -133,14 +258,21 @@ We use [GitHub Actions](https://github.com/features/actions) for CI. Tests shoul
|
|
|
133
258
|
|
|
134
259
|
Run the tests locally:
|
|
135
260
|
|
|
136
|
-
|
|
261
|
+
```bash
|
|
262
|
+
make test
|
|
263
|
+
```
|
|
137
264
|
|
|
138
265
|
Or to run the full CI pipeline (pre-commit hooks and tests):
|
|
139
266
|
|
|
140
|
-
|
|
267
|
+
```bash
|
|
268
|
+
make ci-local
|
|
269
|
+
```
|
|
141
270
|
|
|
142
271
|
## References
|
|
143
272
|
|
|
273
|
+
[K. O. Mastej et al.,
|
|
274
|
+
"Chemical filters for ultra-high-throughput materials screening and generation" _arXiv_ (2026)](https://doi.org/10.48550/arXiv.2607.17910)
|
|
275
|
+
|
|
144
276
|
[H. Park et al.,
|
|
145
277
|
"Mapping inorganic crystal chemical space" _Faraday Discuss._ (2024)](https://pubs.rsc.org/en/content/articlelanding/2024/fd/d4fd00063c)
|
|
146
278
|
|