meidnet 2.2.0__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.
- meidnet-2.2.0/LICENSE +21 -0
- meidnet-2.2.0/PKG-INFO +222 -0
- meidnet-2.2.0/README.md +174 -0
- meidnet-2.2.0/meidnet/__init__.py +20 -0
- meidnet-2.2.0/meidnet/benchmark.py +545 -0
- meidnet-2.2.0/meidnet/checkpoint.py +167 -0
- meidnet-2.2.0/meidnet/chem.py +46 -0
- meidnet-2.2.0/meidnet/cli.py +394 -0
- meidnet-2.2.0/meidnet/config.py +302 -0
- meidnet-2.2.0/meidnet/constraints.py +346 -0
- meidnet-2.2.0/meidnet/data.py +369 -0
- meidnet-2.2.0/meidnet/designspace.py +114 -0
- meidnet-2.2.0/meidnet/families/double_perovskite_a2bbx6.yaml +100 -0
- meidnet-2.2.0/meidnet/families/perovskite_abx3.yaml +175 -0
- meidnet-2.2.0/meidnet/family.py +229 -0
- meidnet-2.2.0/meidnet/generate.py +556 -0
- meidnet-2.2.0/meidnet/model.py +176 -0
- meidnet-2.2.0/meidnet/pipeline.py +186 -0
- meidnet-2.2.0/meidnet/registry.py +49 -0
- meidnet-2.2.0/meidnet/report.py +427 -0
- meidnet-2.2.0/meidnet/screen.py +182 -0
- meidnet-2.2.0/meidnet/studio/__init__.py +1 -0
- meidnet-2.2.0/meidnet/studio/ask_prism.js +340 -0
- meidnet-2.2.0/meidnet/studio/chemiscope.py +232 -0
- meidnet-2.2.0/meidnet/studio/landing.html +244 -0
- meidnet-2.2.0/meidnet/studio/server.py +1355 -0
- meidnet-2.2.0/meidnet/studio/studio.html +1585 -0
- meidnet-2.2.0/meidnet/svg.py +215 -0
- meidnet-2.2.0/meidnet/terms.py +265 -0
- meidnet-2.2.0/meidnet/train.py +212 -0
- meidnet-2.2.0/meidnet.egg-info/PKG-INFO +222 -0
- meidnet-2.2.0/meidnet.egg-info/SOURCES.txt +44 -0
- meidnet-2.2.0/meidnet.egg-info/dependency_links.txt +1 -0
- meidnet-2.2.0/meidnet.egg-info/entry_points.txt +2 -0
- meidnet-2.2.0/meidnet.egg-info/requires.txt +26 -0
- meidnet-2.2.0/meidnet.egg-info/top_level.txt +1 -0
- meidnet-2.2.0/pyproject.toml +68 -0
- meidnet-2.2.0/setup.cfg +4 -0
- meidnet-2.2.0/tests/test_benchmarks.py +196 -0
- meidnet-2.2.0/tests/test_config_family.py +131 -0
- meidnet-2.2.0/tests/test_constraints_space.py +134 -0
- meidnet-2.2.0/tests/test_deploy.py +86 -0
- meidnet-2.2.0/tests/test_notebooks.py +140 -0
- meidnet-2.2.0/tests/test_pipeline.py +96 -0
- meidnet-2.2.0/tests/test_studio.py +966 -0
- meidnet-2.2.0/tests/test_v1_regression.py +121 -0
meidnet-2.2.0/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Anand Babu
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
meidnet-2.2.0/PKG-INFO
ADDED
|
@@ -0,0 +1,222 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: meidnet
|
|
3
|
+
Version: 2.2.0
|
|
4
|
+
Summary: MEIDNet: multimodal structure-property latent space and constrained inverse design of crystalline materials
|
|
5
|
+
Author: Anand Babu
|
|
6
|
+
License-Expression: MIT
|
|
7
|
+
Project-URL: Homepage, https://babu09-meidnet.hf.space/
|
|
8
|
+
Project-URL: Documentation, https://babu09-meidnet.hf.space/docs/
|
|
9
|
+
Project-URL: Source, https://github.com/ABnano/MEIDNet
|
|
10
|
+
Project-URL: Issues, https://github.com/ABnano/MEIDNet/issues
|
|
11
|
+
Project-URL: Paper, https://doi.org/10.1038/s41524-026-02153-3
|
|
12
|
+
Project-URL: Models, https://huggingface.co/Babu09/MEIDNet
|
|
13
|
+
Keywords: materials,inverse design,generative model,perovskite,contrastive learning
|
|
14
|
+
Classifier: Development Status :: 4 - Beta
|
|
15
|
+
Classifier: Intended Audience :: Science/Research
|
|
16
|
+
Classifier: Operating System :: OS Independent
|
|
17
|
+
Classifier: Programming Language :: Python :: 3
|
|
18
|
+
Classifier: Programming Language :: Python :: 3.10
|
|
19
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
20
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
21
|
+
Classifier: Topic :: Scientific/Engineering :: Chemistry
|
|
22
|
+
Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
|
|
23
|
+
Requires-Python: >=3.10
|
|
24
|
+
Description-Content-Type: text/markdown
|
|
25
|
+
License-File: LICENSE
|
|
26
|
+
Requires-Dist: torch>=2.1
|
|
27
|
+
Requires-Dist: numpy>=1.24
|
|
28
|
+
Requires-Dist: pandas>=2.0
|
|
29
|
+
Requires-Dist: pymatgen>=2024.1.1
|
|
30
|
+
Requires-Dist: scikit-learn>=1.3
|
|
31
|
+
Requires-Dist: matplotlib>=3.7
|
|
32
|
+
Requires-Dist: pyyaml>=6.0
|
|
33
|
+
Requires-Dist: pydantic>=2.5
|
|
34
|
+
Requires-Dist: openpyxl>=3.1
|
|
35
|
+
Provides-Extra: parquet
|
|
36
|
+
Requires-Dist: pyarrow>=14; extra == "parquet"
|
|
37
|
+
Provides-Extra: stability
|
|
38
|
+
Requires-Dist: ase>=3.22; extra == "stability"
|
|
39
|
+
Requires-Dist: mace-torch>=0.3.6; extra == "stability"
|
|
40
|
+
Provides-Extra: app
|
|
41
|
+
Requires-Dist: gradio>=4.0; extra == "app"
|
|
42
|
+
Provides-Extra: docs
|
|
43
|
+
Requires-Dist: mkdocs-material>=9.5; extra == "docs"
|
|
44
|
+
Requires-Dist: mkdocstrings[python]>=0.24; extra == "docs"
|
|
45
|
+
Provides-Extra: dev
|
|
46
|
+
Requires-Dist: pytest>=7.4; extra == "dev"
|
|
47
|
+
Dynamic: license-file
|
|
48
|
+
|
|
49
|
+
<p align="center">
|
|
50
|
+
<img src="https://raw.githubusercontent.com/ABnano/MEIDNet/main/docs/assets/meidnet_prism_logo.png" alt="MEIDNet Prism — Multimodal materials representation and inverse design" width="640"/>
|
|
51
|
+
</p>
|
|
52
|
+
|
|
53
|
+
<p align="center"><em>Inverse design of crystalline materials from target properties, with your own data and rules.</em><br/>
|
|
54
|
+
<b>MEIDNet Prism</b>: learn, build and benchmark multimodal AI for materials discovery, with MEIDNet as the reference implementation.<br/>
|
|
55
|
+
<a href="https://babu09-meidnet.hf.space/">home</a> · <a href="https://babu09-meidnet.hf.space/docs/learn/index.html">learn</a> · <a href="https://babu09-meidnet.hf.space/docs/learn/architectures.html">architectures</a> · <a href="https://babu09-meidnet.hf.space/studio/">build (Studio)</a> · <a href="https://babu09-meidnet.hf.space/docs/explore/datasets.html">datasets</a> · <a href="https://babu09-meidnet.hf.space/docs/benchmarks/index.html">benchmarks</a> · <a href="https://babu09-meidnet.hf.space/docs/community/contribute.html">community</a></p>
|
|
56
|
+
|
|
57
|
+
<p align="center">
|
|
58
|
+
<a href="https://doi.org/10.1038/s41524-026-02153-3"><img alt="Paper" src="https://img.shields.io/badge/npj%20Comput.%20Mater.-2026-1c5cab"></a>
|
|
59
|
+
<a href="https://babu09-meidnet.hf.space/"><img alt="MEIDNet Prism" src="https://img.shields.io/badge/MEIDNet%20Prism-live-4f46e5"></a>
|
|
60
|
+
<a href="https://huggingface.co/Babu09/MEIDNet"><img alt="Model on Hugging Face" src="https://img.shields.io/badge/%F0%9F%A4%97%20model-Babu09%2FMEIDNet-ffcc4d"></a>
|
|
61
|
+
<a href="https://github.com/ABnano/MEIDNet/actions"><img alt="CI" src="https://github.com/ABnano/MEIDNet/actions/workflows/ci.yml/badge.svg"></a>
|
|
62
|
+
<a href="https://github.com/ABnano/MEIDNet/blob/main/LICENSE"><img alt="MIT" src="https://img.shields.io/badge/licence-MIT-0a7d0a"></a>
|
|
63
|
+
</p>
|
|
64
|
+
|
|
65
|
+
<p align="center">
|
|
66
|
+
<a href="https://babu09-meidnet.hf.space/docs/"><b>Documentation</b></a> ·
|
|
67
|
+
<a href="https://babu09-meidnet.hf.space/studio/"><b>Try it in your browser</b></a> ·
|
|
68
|
+
<a href="https://www.nature.com/articles/s41524-026-02153-3">Paper</a> ·
|
|
69
|
+
<a href="https://github.com/ABnano/MEIDNet/releases/tag/v1.0.0-paper">v1.0 code as published</a>
|
|
70
|
+
</p>
|
|
71
|
+
|
|
72
|
+
<p align="center">
|
|
73
|
+
<a href="https://babu09-meidnet.hf.space/"><img src="https://raw.githubusercontent.com/ABnano/MEIDNet/main/docs/assets/meidnet_tour_poster.png" alt="MEIDNet: from concept to demonstration" width="720"/></a><br/>
|
|
74
|
+
<sub><a href="https://babu09-meidnet.hf.space/"><b>▶ MEIDNet: from concept to demonstration</b></a>, the live 3D tour on the home page (<a href="https://github.com/ABnano/MEIDNet/releases/download/v2.1.0/meidnet_tour.webm">video version</a>)</sub>
|
|
75
|
+
</p>
|
|
76
|
+
|
|
77
|
+
---
|
|
78
|
+
|
|
79
|
+
MEIDNet learns one latent space shared by **crystal structures** and their **properties**
|
|
80
|
+
(contrastive alignment of an equivariant graph encoder and a property encoder), then
|
|
81
|
+
searches that space for new materials that hit property targets while obeying the
|
|
82
|
+
chemical and structural rules of a **material family**.
|
|
83
|
+
|
|
84
|
+
MEIDNet 2.0 turns the published perovskite code into a framework:
|
|
85
|
+
|
|
86
|
+
| You want to… | You do… |
|
|
87
|
+
|---|---|
|
|
88
|
+
| try it | `meidnet demo` or the [browser demo](https://babu09-meidnet.hf.space/studio/) |
|
|
89
|
+
| use **your** structures + properties | put them in a table, run `meidnet init / check / train / generate` |
|
|
90
|
+
| change targets, elements, rules | edit `meidnet.yaml` — or move sliders in **MEIDNet Studio** and export it |
|
|
91
|
+
| a different material family | copy a family `.yaml` (prototype + site groups + rules) |
|
|
92
|
+
| your own rule | a 5-line Python function registered as a constraint |
|
|
93
|
+
| understand every decision | each step writes a plain-language HTML report (data check, training, generation) |
|
|
94
|
+
|
|
95
|
+
The published cubic-ABX₃ perovskite model (band gap + formation enthalpy, Perov-5) is
|
|
96
|
+
**example application #1**; it runs unchanged and bit-identically (tests prove it).
|
|
97
|
+
|
|
98
|
+
## Install
|
|
99
|
+
|
|
100
|
+
```bash
|
|
101
|
+
pip install meidnet # core (PyTorch CPU wheels work; CUDA optional)
|
|
102
|
+
pip install "meidnet[stability]" # + MACE stability screening
|
|
103
|
+
```
|
|
104
|
+
|
|
105
|
+
From source: `git clone https://github.com/ABnano/MEIDNet && cd MEIDNet && pip install -e ".[dev]"`.
|
|
106
|
+
|
|
107
|
+
## Try it (2 minutes, CPU is fine)
|
|
108
|
+
|
|
109
|
+
```bash
|
|
110
|
+
meidnet demo # halide perovskites, band gap 2.0 eV → CIFs + report
|
|
111
|
+
meidnet studio # interactive workbench with the published model
|
|
112
|
+
```
|
|
113
|
+
|
|
114
|
+
## Use your own data (the main path)
|
|
115
|
+
|
|
116
|
+
Your data is a table with one row per material plus the structures as CIF text (a `cif`
|
|
117
|
+
column) or files (`structures/<id>.cif`):
|
|
118
|
+
|
|
119
|
+
```
|
|
120
|
+
material_id cif band_gap dielectric
|
|
121
|
+
mat_001 data_mat_001 ... 1.42 18.3
|
|
122
|
+
mat_002 data_mat_001 ... 2.16 11.7
|
|
123
|
+
```
|
|
124
|
+
|
|
125
|
+
```bash
|
|
126
|
+
meidnet init --table materials.csv --properties band_gap dielectric --family perovskite_abx3 --variant oxide
|
|
127
|
+
meidnet check meidnet.yaml # → check_report.html: what is usable, what was skipped and why
|
|
128
|
+
meidnet train meidnet.yaml # → model.pt + training_report.html: how accurate, did modalities align
|
|
129
|
+
meidnet generate meidnet.yaml # → CIFs + generation_report.html: every candidate and why it passed
|
|
130
|
+
```
|
|
131
|
+
|
|
132
|
+
Everything you can change is in `meidnet.yaml`, with a one-line explanation per setting
|
|
133
|
+
([reference](https://babu09-meidnet.hf.space/docs/reference/config.html)). No Python needed.
|
|
134
|
+
|
|
135
|
+
## MEIDNet Studio — see the effect of every change
|
|
136
|
+
|
|
137
|
+
```bash
|
|
138
|
+
meidnet studio meidnet.yaml
|
|
139
|
+
```
|
|
140
|
+
|
|
141
|
+
A local web page shows the workflow as a strip of colour-coded blocks **Data → Model →
|
|
142
|
+
Family → Rules → Targets → Search → Candidates**. Move a rule's limit or a target and watch
|
|
143
|
+
the change flow through every later block, with a short explanation: how many compositions
|
|
144
|
+
still pass, which are predicted closest, which of your earlier candidates would now be
|
|
145
|
+
rejected. Beginner mode shows the input, logic and output of each block, and *Behind the
|
|
146
|
+
scenes* shows the YAML and Python that do the same thing.
|
|
147
|
+
|
|
148
|
+
- **Your data in the browser:** upload a table (CSV / Excel / JSON) with CIF structures, map
|
|
149
|
+
the columns, check it and train a model — every block then uses your properties.
|
|
150
|
+
- **Edit as text:** the configuration as YAML; errors name the exact setting.
|
|
151
|
+
- **Explore in 3D:** the design space, your data or the candidates as a property map linked
|
|
152
|
+
to a crystal viewer ([chemiscope](https://chemiscope.org)).
|
|
153
|
+
- "Run search" runs the paper's latent optimisation live; every candidate comes with its
|
|
154
|
+
checklist and a rotatable cell. Export `meidnet.yaml` to repeat the run from the command line.
|
|
155
|
+
|
|
156
|
+
No installation needed to try it: the [hosted Studio](https://huggingface.co/spaces/Babu09/MEIDNet)
|
|
157
|
+
runs on Hugging Face ([direct link](https://babu09-meidnet.hf.space/studio/)).
|
|
158
|
+
|
|
159
|
+
## What is in the box
|
|
160
|
+
|
|
161
|
+
```
|
|
162
|
+
meidnet/
|
|
163
|
+
config.py the meidnet.yaml schema (pydantic) — single source of truth for CLI, docs, Studio
|
|
164
|
+
data.py tables + CIFs → prototype-aligned feature vectors, with a skip report
|
|
165
|
+
model.py SE(3)-equivariant crystal autoencoder + property autoencoder, shared latent
|
|
166
|
+
train.py the five-term objective of the paper, validation metrics in physical units
|
|
167
|
+
family.py material families from YAML: prototype, site groups, charges, lattice rule, variants
|
|
168
|
+
constraints.py hard rules (charge balance, tolerance factor, …) — each returns value, window, sentence
|
|
169
|
+
terms.py soft search terms and logit transforms used during the latent optimisation
|
|
170
|
+
generate.py the inverse-design loop (latent search → decode → rules → rank → save), with a funnel log
|
|
171
|
+
designspace.py every composition a family can make, with rule descriptors and model predictions
|
|
172
|
+
report.py plain-language HTML reports; svg.py: dependency-free charts
|
|
173
|
+
studio/ the interactive workbench (stdlib HTTP server + one HTML page)
|
|
174
|
+
families/ perovskite_abx3.yaml, double_perovskite_a2bbx6.yaml
|
|
175
|
+
tests/ incl. byte-level regression against the published v1 code (tests/legacy_v1/)
|
|
176
|
+
examples/ Perov-5 reproduction, custom-rule plugin, the paper's generated CIFs
|
|
177
|
+
docs/ the website (MkDocs) notebooks/ Colab tutorials app/ Hugging Face demo
|
|
178
|
+
```
|
|
179
|
+
|
|
180
|
+
## Scope
|
|
181
|
+
|
|
182
|
+
* Generation works for **prototype families**: a fixed arrangement of sites whose
|
|
183
|
+
occupants and cell size are chosen (ABX₃, A₂BB′X₆, and anything you describe the same
|
|
184
|
+
way, up to `max_sites` atoms). It does **not** invent new atomic arrangements.
|
|
185
|
+
* Properties: any number of scalar columns. Spectra/images as modalities are on the
|
|
186
|
+
[roadmap](https://babu09-meidnet.hf.space/docs/understand/limits.html), not in this release.
|
|
187
|
+
* Predicted properties are **model estimates**. Confirm candidates with DFT or experiment;
|
|
188
|
+
`meidnet screen` (MACE) is a first filter.
|
|
189
|
+
|
|
190
|
+
## Reproducing the paper
|
|
191
|
+
|
|
192
|
+
```bash
|
|
193
|
+
meidnet download-data # Perov-5 (CDVAE split) → data/perov5/
|
|
194
|
+
meidnet init --template perov5 -o examples/perov5/meidnet.yaml
|
|
195
|
+
meidnet train examples/perov5/meidnet.yaml # ~1 h on a laptop GPU for 200 epochs
|
|
196
|
+
meidnet generate examples/perov5/meidnet.yaml --model checkpoints/dual_autoencoder_clip_earlyfusion_propertyaware_2k.pth
|
|
197
|
+
```
|
|
198
|
+
|
|
199
|
+
`pytest -m slow` re-runs the frozen v1 generation code (`tests/legacy_v1/`) and checks that
|
|
200
|
+
MEIDNet 2 produces the same CIFs, predictions and file names.
|
|
201
|
+
|
|
202
|
+
## Citation
|
|
203
|
+
|
|
204
|
+
```bibtex
|
|
205
|
+
@article{meidnet2026,
|
|
206
|
+
title = {MEIDNet: Multimodal generative AI framework for inverse materials design},
|
|
207
|
+
author = {Anand Babu and Rog{\'e}rio Almeida Gouv{\^e}a and Pierre Vandergheynst and Gian-Marco Rignanese},
|
|
208
|
+
journal = {npj Computational Materials},
|
|
209
|
+
year = {2026},
|
|
210
|
+
doi = {10.1038/s41524-026-02153-3}
|
|
211
|
+
}
|
|
212
|
+
```
|
|
213
|
+
|
|
214
|
+
MIT licence. Perov-5 data: Xie et al., CDVAE (ICLR 2022); Castelli et al. (2012).
|
|
215
|
+
|
|
216
|
+
## Further reading
|
|
217
|
+
|
|
218
|
+
- A. Babu, R. Almeida Gouvêa, G.-M. Rignanese, *Toward automated discovery with generative models multimodal
|
|
219
|
+
learning and closed loop workflows in inverse materials design*, Cell Reports Physical Science **7**, 103561
|
|
220
|
+
(2026). [doi:10.1016/j.xcrp.2026.103561](https://doi.org/10.1016/j.xcrp.2026.103561)
|
|
221
|
+
- A. Babu, N. M. A. Krishnan, *Multimodal and cross-modal learning techniques*, APL Machine Learning **4**, 030901
|
|
222
|
+
(2026). [doi:10.1063/5.0346744](https://doi.org/10.1063/5.0346744)
|
meidnet-2.2.0/README.md
ADDED
|
@@ -0,0 +1,174 @@
|
|
|
1
|
+
<p align="center">
|
|
2
|
+
<img src="https://raw.githubusercontent.com/ABnano/MEIDNet/main/docs/assets/meidnet_prism_logo.png" alt="MEIDNet Prism — Multimodal materials representation and inverse design" width="640"/>
|
|
3
|
+
</p>
|
|
4
|
+
|
|
5
|
+
<p align="center"><em>Inverse design of crystalline materials from target properties, with your own data and rules.</em><br/>
|
|
6
|
+
<b>MEIDNet Prism</b>: learn, build and benchmark multimodal AI for materials discovery, with MEIDNet as the reference implementation.<br/>
|
|
7
|
+
<a href="https://babu09-meidnet.hf.space/">home</a> · <a href="https://babu09-meidnet.hf.space/docs/learn/index.html">learn</a> · <a href="https://babu09-meidnet.hf.space/docs/learn/architectures.html">architectures</a> · <a href="https://babu09-meidnet.hf.space/studio/">build (Studio)</a> · <a href="https://babu09-meidnet.hf.space/docs/explore/datasets.html">datasets</a> · <a href="https://babu09-meidnet.hf.space/docs/benchmarks/index.html">benchmarks</a> · <a href="https://babu09-meidnet.hf.space/docs/community/contribute.html">community</a></p>
|
|
8
|
+
|
|
9
|
+
<p align="center">
|
|
10
|
+
<a href="https://doi.org/10.1038/s41524-026-02153-3"><img alt="Paper" src="https://img.shields.io/badge/npj%20Comput.%20Mater.-2026-1c5cab"></a>
|
|
11
|
+
<a href="https://babu09-meidnet.hf.space/"><img alt="MEIDNet Prism" src="https://img.shields.io/badge/MEIDNet%20Prism-live-4f46e5"></a>
|
|
12
|
+
<a href="https://huggingface.co/Babu09/MEIDNet"><img alt="Model on Hugging Face" src="https://img.shields.io/badge/%F0%9F%A4%97%20model-Babu09%2FMEIDNet-ffcc4d"></a>
|
|
13
|
+
<a href="https://github.com/ABnano/MEIDNet/actions"><img alt="CI" src="https://github.com/ABnano/MEIDNet/actions/workflows/ci.yml/badge.svg"></a>
|
|
14
|
+
<a href="https://github.com/ABnano/MEIDNet/blob/main/LICENSE"><img alt="MIT" src="https://img.shields.io/badge/licence-MIT-0a7d0a"></a>
|
|
15
|
+
</p>
|
|
16
|
+
|
|
17
|
+
<p align="center">
|
|
18
|
+
<a href="https://babu09-meidnet.hf.space/docs/"><b>Documentation</b></a> ·
|
|
19
|
+
<a href="https://babu09-meidnet.hf.space/studio/"><b>Try it in your browser</b></a> ·
|
|
20
|
+
<a href="https://www.nature.com/articles/s41524-026-02153-3">Paper</a> ·
|
|
21
|
+
<a href="https://github.com/ABnano/MEIDNet/releases/tag/v1.0.0-paper">v1.0 code as published</a>
|
|
22
|
+
</p>
|
|
23
|
+
|
|
24
|
+
<p align="center">
|
|
25
|
+
<a href="https://babu09-meidnet.hf.space/"><img src="https://raw.githubusercontent.com/ABnano/MEIDNet/main/docs/assets/meidnet_tour_poster.png" alt="MEIDNet: from concept to demonstration" width="720"/></a><br/>
|
|
26
|
+
<sub><a href="https://babu09-meidnet.hf.space/"><b>▶ MEIDNet: from concept to demonstration</b></a>, the live 3D tour on the home page (<a href="https://github.com/ABnano/MEIDNet/releases/download/v2.1.0/meidnet_tour.webm">video version</a>)</sub>
|
|
27
|
+
</p>
|
|
28
|
+
|
|
29
|
+
---
|
|
30
|
+
|
|
31
|
+
MEIDNet learns one latent space shared by **crystal structures** and their **properties**
|
|
32
|
+
(contrastive alignment of an equivariant graph encoder and a property encoder), then
|
|
33
|
+
searches that space for new materials that hit property targets while obeying the
|
|
34
|
+
chemical and structural rules of a **material family**.
|
|
35
|
+
|
|
36
|
+
MEIDNet 2.0 turns the published perovskite code into a framework:
|
|
37
|
+
|
|
38
|
+
| You want to… | You do… |
|
|
39
|
+
|---|---|
|
|
40
|
+
| try it | `meidnet demo` or the [browser demo](https://babu09-meidnet.hf.space/studio/) |
|
|
41
|
+
| use **your** structures + properties | put them in a table, run `meidnet init / check / train / generate` |
|
|
42
|
+
| change targets, elements, rules | edit `meidnet.yaml` — or move sliders in **MEIDNet Studio** and export it |
|
|
43
|
+
| a different material family | copy a family `.yaml` (prototype + site groups + rules) |
|
|
44
|
+
| your own rule | a 5-line Python function registered as a constraint |
|
|
45
|
+
| understand every decision | each step writes a plain-language HTML report (data check, training, generation) |
|
|
46
|
+
|
|
47
|
+
The published cubic-ABX₃ perovskite model (band gap + formation enthalpy, Perov-5) is
|
|
48
|
+
**example application #1**; it runs unchanged and bit-identically (tests prove it).
|
|
49
|
+
|
|
50
|
+
## Install
|
|
51
|
+
|
|
52
|
+
```bash
|
|
53
|
+
pip install meidnet # core (PyTorch CPU wheels work; CUDA optional)
|
|
54
|
+
pip install "meidnet[stability]" # + MACE stability screening
|
|
55
|
+
```
|
|
56
|
+
|
|
57
|
+
From source: `git clone https://github.com/ABnano/MEIDNet && cd MEIDNet && pip install -e ".[dev]"`.
|
|
58
|
+
|
|
59
|
+
## Try it (2 minutes, CPU is fine)
|
|
60
|
+
|
|
61
|
+
```bash
|
|
62
|
+
meidnet demo # halide perovskites, band gap 2.0 eV → CIFs + report
|
|
63
|
+
meidnet studio # interactive workbench with the published model
|
|
64
|
+
```
|
|
65
|
+
|
|
66
|
+
## Use your own data (the main path)
|
|
67
|
+
|
|
68
|
+
Your data is a table with one row per material plus the structures as CIF text (a `cif`
|
|
69
|
+
column) or files (`structures/<id>.cif`):
|
|
70
|
+
|
|
71
|
+
```
|
|
72
|
+
material_id cif band_gap dielectric
|
|
73
|
+
mat_001 data_mat_001 ... 1.42 18.3
|
|
74
|
+
mat_002 data_mat_001 ... 2.16 11.7
|
|
75
|
+
```
|
|
76
|
+
|
|
77
|
+
```bash
|
|
78
|
+
meidnet init --table materials.csv --properties band_gap dielectric --family perovskite_abx3 --variant oxide
|
|
79
|
+
meidnet check meidnet.yaml # → check_report.html: what is usable, what was skipped and why
|
|
80
|
+
meidnet train meidnet.yaml # → model.pt + training_report.html: how accurate, did modalities align
|
|
81
|
+
meidnet generate meidnet.yaml # → CIFs + generation_report.html: every candidate and why it passed
|
|
82
|
+
```
|
|
83
|
+
|
|
84
|
+
Everything you can change is in `meidnet.yaml`, with a one-line explanation per setting
|
|
85
|
+
([reference](https://babu09-meidnet.hf.space/docs/reference/config.html)). No Python needed.
|
|
86
|
+
|
|
87
|
+
## MEIDNet Studio — see the effect of every change
|
|
88
|
+
|
|
89
|
+
```bash
|
|
90
|
+
meidnet studio meidnet.yaml
|
|
91
|
+
```
|
|
92
|
+
|
|
93
|
+
A local web page shows the workflow as a strip of colour-coded blocks **Data → Model →
|
|
94
|
+
Family → Rules → Targets → Search → Candidates**. Move a rule's limit or a target and watch
|
|
95
|
+
the change flow through every later block, with a short explanation: how many compositions
|
|
96
|
+
still pass, which are predicted closest, which of your earlier candidates would now be
|
|
97
|
+
rejected. Beginner mode shows the input, logic and output of each block, and *Behind the
|
|
98
|
+
scenes* shows the YAML and Python that do the same thing.
|
|
99
|
+
|
|
100
|
+
- **Your data in the browser:** upload a table (CSV / Excel / JSON) with CIF structures, map
|
|
101
|
+
the columns, check it and train a model — every block then uses your properties.
|
|
102
|
+
- **Edit as text:** the configuration as YAML; errors name the exact setting.
|
|
103
|
+
- **Explore in 3D:** the design space, your data or the candidates as a property map linked
|
|
104
|
+
to a crystal viewer ([chemiscope](https://chemiscope.org)).
|
|
105
|
+
- "Run search" runs the paper's latent optimisation live; every candidate comes with its
|
|
106
|
+
checklist and a rotatable cell. Export `meidnet.yaml` to repeat the run from the command line.
|
|
107
|
+
|
|
108
|
+
No installation needed to try it: the [hosted Studio](https://huggingface.co/spaces/Babu09/MEIDNet)
|
|
109
|
+
runs on Hugging Face ([direct link](https://babu09-meidnet.hf.space/studio/)).
|
|
110
|
+
|
|
111
|
+
## What is in the box
|
|
112
|
+
|
|
113
|
+
```
|
|
114
|
+
meidnet/
|
|
115
|
+
config.py the meidnet.yaml schema (pydantic) — single source of truth for CLI, docs, Studio
|
|
116
|
+
data.py tables + CIFs → prototype-aligned feature vectors, with a skip report
|
|
117
|
+
model.py SE(3)-equivariant crystal autoencoder + property autoencoder, shared latent
|
|
118
|
+
train.py the five-term objective of the paper, validation metrics in physical units
|
|
119
|
+
family.py material families from YAML: prototype, site groups, charges, lattice rule, variants
|
|
120
|
+
constraints.py hard rules (charge balance, tolerance factor, …) — each returns value, window, sentence
|
|
121
|
+
terms.py soft search terms and logit transforms used during the latent optimisation
|
|
122
|
+
generate.py the inverse-design loop (latent search → decode → rules → rank → save), with a funnel log
|
|
123
|
+
designspace.py every composition a family can make, with rule descriptors and model predictions
|
|
124
|
+
report.py plain-language HTML reports; svg.py: dependency-free charts
|
|
125
|
+
studio/ the interactive workbench (stdlib HTTP server + one HTML page)
|
|
126
|
+
families/ perovskite_abx3.yaml, double_perovskite_a2bbx6.yaml
|
|
127
|
+
tests/ incl. byte-level regression against the published v1 code (tests/legacy_v1/)
|
|
128
|
+
examples/ Perov-5 reproduction, custom-rule plugin, the paper's generated CIFs
|
|
129
|
+
docs/ the website (MkDocs) notebooks/ Colab tutorials app/ Hugging Face demo
|
|
130
|
+
```
|
|
131
|
+
|
|
132
|
+
## Scope
|
|
133
|
+
|
|
134
|
+
* Generation works for **prototype families**: a fixed arrangement of sites whose
|
|
135
|
+
occupants and cell size are chosen (ABX₃, A₂BB′X₆, and anything you describe the same
|
|
136
|
+
way, up to `max_sites` atoms). It does **not** invent new atomic arrangements.
|
|
137
|
+
* Properties: any number of scalar columns. Spectra/images as modalities are on the
|
|
138
|
+
[roadmap](https://babu09-meidnet.hf.space/docs/understand/limits.html), not in this release.
|
|
139
|
+
* Predicted properties are **model estimates**. Confirm candidates with DFT or experiment;
|
|
140
|
+
`meidnet screen` (MACE) is a first filter.
|
|
141
|
+
|
|
142
|
+
## Reproducing the paper
|
|
143
|
+
|
|
144
|
+
```bash
|
|
145
|
+
meidnet download-data # Perov-5 (CDVAE split) → data/perov5/
|
|
146
|
+
meidnet init --template perov5 -o examples/perov5/meidnet.yaml
|
|
147
|
+
meidnet train examples/perov5/meidnet.yaml # ~1 h on a laptop GPU for 200 epochs
|
|
148
|
+
meidnet generate examples/perov5/meidnet.yaml --model checkpoints/dual_autoencoder_clip_earlyfusion_propertyaware_2k.pth
|
|
149
|
+
```
|
|
150
|
+
|
|
151
|
+
`pytest -m slow` re-runs the frozen v1 generation code (`tests/legacy_v1/`) and checks that
|
|
152
|
+
MEIDNet 2 produces the same CIFs, predictions and file names.
|
|
153
|
+
|
|
154
|
+
## Citation
|
|
155
|
+
|
|
156
|
+
```bibtex
|
|
157
|
+
@article{meidnet2026,
|
|
158
|
+
title = {MEIDNet: Multimodal generative AI framework for inverse materials design},
|
|
159
|
+
author = {Anand Babu and Rog{\'e}rio Almeida Gouv{\^e}a and Pierre Vandergheynst and Gian-Marco Rignanese},
|
|
160
|
+
journal = {npj Computational Materials},
|
|
161
|
+
year = {2026},
|
|
162
|
+
doi = {10.1038/s41524-026-02153-3}
|
|
163
|
+
}
|
|
164
|
+
```
|
|
165
|
+
|
|
166
|
+
MIT licence. Perov-5 data: Xie et al., CDVAE (ICLR 2022); Castelli et al. (2012).
|
|
167
|
+
|
|
168
|
+
## Further reading
|
|
169
|
+
|
|
170
|
+
- A. Babu, R. Almeida Gouvêa, G.-M. Rignanese, *Toward automated discovery with generative models multimodal
|
|
171
|
+
learning and closed loop workflows in inverse materials design*, Cell Reports Physical Science **7**, 103561
|
|
172
|
+
(2026). [doi:10.1016/j.xcrp.2026.103561](https://doi.org/10.1016/j.xcrp.2026.103561)
|
|
173
|
+
- A. Babu, N. M. A. Krishnan, *Multimodal and cross-modal learning techniques*, APL Machine Learning **4**, 030901
|
|
174
|
+
(2026). [doi:10.1063/5.0346744](https://doi.org/10.1063/5.0346744)
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
"""
|
|
2
|
+
MEIDNet — Multimodal Equivariant Inverse Design Network
|
|
3
|
+
=======================================================
|
|
4
|
+
|
|
5
|
+
Learn a shared latent space between crystal structures and their properties,
|
|
6
|
+
then search it for new materials that hit property targets while obeying the
|
|
7
|
+
chemical and structural rules of a material family.
|
|
8
|
+
|
|
9
|
+
Typical use (the same steps the ``meidnet`` command runs)::
|
|
10
|
+
|
|
11
|
+
from meidnet.config import load_config
|
|
12
|
+
from meidnet.pipeline import check, train, generate
|
|
13
|
+
|
|
14
|
+
cfg = load_config("meidnet.yaml")
|
|
15
|
+
check(cfg) # is my data usable? (writes check_report.html)
|
|
16
|
+
train(cfg) # learn the latent space (writes model.pt + training_report.html)
|
|
17
|
+
generate(cfg) # design candidates (writes CIFs + generation_report.html)
|
|
18
|
+
"""
|
|
19
|
+
|
|
20
|
+
__version__ = "2.2.0"
|