Spaces:
Running
Running
Yuan (Cyrus) Chiang
commited on
Commit
•
8396dce
1
Parent(s):
3a1f221
Add ORB v2 (#18)
Browse files* add orbv2 calculator
* add pbe datapoints
* add pbe json file; update pbe error metrics
* bump orb version
- mlip_arena/models/externals/orb.py +30 -0
- mlip_arena/models/registry.yaml +36 -1
- mlip_arena/tasks/diatomics/alignn/homonuclear-diatomics.json +2 -2
- mlip_arena/tasks/diatomics/chgnet/homonuclear-diatomics.json +2 -2
- mlip_arena/tasks/diatomics/equiformer/homonuclear-diatomics.json +2 -2
- mlip_arena/tasks/diatomics/escn/homonuclear-diatomics.json +2 -2
- mlip_arena/tasks/diatomics/fairchem/homonuclear-diatomics.json +2 -2
- mlip_arena/tasks/diatomics/mace-mp/homonuclear-diatomics.json +2 -2
- mlip_arena/tasks/diatomics/mace-off/homonuclear-diatomics.json +2 -2
- mlip_arena/tasks/diatomics/matgl/homonuclear-diatomics.json +2 -2
- mlip_arena/tasks/diatomics/orb/homonuclear-diatomics.json +2 -2
- mlip_arena/tasks/diatomics/run.ipynb +0 -0
- mlip_arena/tasks/diatomics/sevennet/homonuclear-diatomics.json +2 -2
- mlip_arena/tasks/diatomics/vasp/homonuclear-diatomics.json +3 -0
- pyproject.toml +2 -2
- serve/leaderboard.py +2 -0
- serve/ranks/homonuclear-diatomics.py +43 -23
- serve/ranks/thermal-conductivity.py +6 -6
- serve/tasks/homonuclear-diatomics.py +96 -48
- serve/tasks/thermal-conductivity.py +4 -4
- tests/test_external_calculators.py +3 -0
mlip_arena/models/externals/orb.py
CHANGED
@@ -41,3 +41,33 @@ class ORB(ORBCalculator):
|
|
41 |
|
42 |
orbff = pretrained.orb_v1(weights_path=ckpt_path, device=device)
|
43 |
super().__init__(orbff, device=device, **kwargs)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
41 |
|
42 |
orbff = pretrained.orb_v1(weights_path=ckpt_path, device=device)
|
43 |
super().__init__(orbff, device=device, **kwargs)
|
44 |
+
|
45 |
+
class ORBv2(ORBCalculator):
|
46 |
+
def __init__(
|
47 |
+
self,
|
48 |
+
checkpoint=REGISTRY["ORBv2"]["checkpoint"],
|
49 |
+
device=None,
|
50 |
+
**kwargs,
|
51 |
+
):
|
52 |
+
device = device or get_freer_device()
|
53 |
+
|
54 |
+
cache_dir = Path.home() / ".cache" / "orb"
|
55 |
+
cache_dir.mkdir(parents=True, exist_ok=True)
|
56 |
+
ckpt_path = cache_dir / checkpoint
|
57 |
+
|
58 |
+
url = f"https://storage.googleapis.com/orbitalmaterials-public-models/forcefields/{checkpoint}"
|
59 |
+
|
60 |
+
if not ckpt_path.exists():
|
61 |
+
print(f"Downloading ORB model from {url} to {ckpt_path}...")
|
62 |
+
try:
|
63 |
+
response = requests.get(url, stream=True, timeout=120)
|
64 |
+
response.raise_for_status()
|
65 |
+
with open(ckpt_path, "wb") as f:
|
66 |
+
for chunk in response.iter_content(chunk_size=8192):
|
67 |
+
f.write(chunk)
|
68 |
+
print("Download completed.")
|
69 |
+
except requests.exceptions.RequestException as e:
|
70 |
+
raise RuntimeError("Failed to download ORB model.") from e
|
71 |
+
|
72 |
+
orbff = pretrained.orb_v2(weights_path=ckpt_path, device=device)
|
73 |
+
super().__init__(orbff, device=device, **kwargs)
|
mlip_arena/models/registry.yaml
CHANGED
@@ -20,6 +20,7 @@ MACE-MP(M):
|
|
20 |
prediction: EFS
|
21 |
nvt: true
|
22 |
npt: true
|
|
|
23 |
|
24 |
CHGNet:
|
25 |
module: externals
|
@@ -42,6 +43,7 @@ CHGNet:
|
|
42 |
prediction: EFSM
|
43 |
nvt: true
|
44 |
npt: true
|
|
|
45 |
|
46 |
M3GNet:
|
47 |
module: externals
|
@@ -63,6 +65,7 @@ M3GNet:
|
|
63 |
prediction: EFS
|
64 |
nvt: true
|
65 |
npt: true
|
|
|
66 |
|
67 |
ORB:
|
68 |
module: externals
|
@@ -87,6 +90,7 @@ ORB:
|
|
87 |
prediction: EFS
|
88 |
nvt: true
|
89 |
npt: true
|
|
|
90 |
|
91 |
SevenNet:
|
92 |
module: externals
|
@@ -110,6 +114,7 @@ SevenNet:
|
|
110 |
prediction: EFS
|
111 |
nvt: true
|
112 |
npt: true
|
|
|
113 |
|
114 |
eqV2(OMat):
|
115 |
module: externals
|
@@ -132,6 +137,7 @@ eqV2(OMat):
|
|
132 |
date: 2024-10-18
|
133 |
github: https://github.com/FAIR-Chem/fairchem
|
134 |
doi: https://arxiv.org/abs/2410.12771
|
|
|
135 |
|
136 |
|
137 |
EquiformerV2(OC22):
|
@@ -154,6 +160,7 @@ EquiformerV2(OC22):
|
|
154 |
prediction: EF
|
155 |
nvt: true
|
156 |
npt: false
|
|
|
157 |
|
158 |
EquiformerV2(OC20):
|
159 |
module: externals
|
@@ -196,6 +203,7 @@ eSCN(OC20):
|
|
196 |
prediction: EF
|
197 |
nvt: true
|
198 |
npt: false
|
|
|
199 |
|
200 |
MACE-OFF(M):
|
201 |
module: externals
|
@@ -217,6 +225,7 @@ MACE-OFF(M):
|
|
217 |
prediction: EFS
|
218 |
nvt: true
|
219 |
npt: true
|
|
|
220 |
|
221 |
ALIGNN:
|
222 |
module: externals
|
@@ -238,6 +247,7 @@ ALIGNN:
|
|
238 |
github: https://github.com/usnistgov/alignn
|
239 |
doi: https://doi.org/10.1038/s41524-021-00650-1
|
240 |
date: 2021-11-15
|
|
|
241 |
|
242 |
DeepMD:
|
243 |
module: externals
|
@@ -256,6 +266,29 @@ DeepMD:
|
|
256 |
prediction: EFS
|
257 |
nvt: true
|
258 |
npt: true
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
259 |
|
260 |
ORBv2(MPTrj):
|
261 |
module: externals
|
@@ -274,6 +307,7 @@ ORBv2(MPTrj):
|
|
274 |
prediction: EFS
|
275 |
nvt: true
|
276 |
npt: true
|
|
|
277 |
|
278 |
eqV2(MPTrj-S):
|
279 |
module: externals
|
@@ -291,4 +325,5 @@ eqV2(MPTrj-S):
|
|
291 |
npt: true
|
292 |
date: 2024-10-18
|
293 |
github: https://github.com/FAIR-Chem/fairchem
|
294 |
-
doi: https://arxiv.org/abs/2410.12771
|
|
|
|
20 |
prediction: EFS
|
21 |
nvt: true
|
22 |
npt: true
|
23 |
+
license: MIT
|
24 |
|
25 |
CHGNet:
|
26 |
module: externals
|
|
|
43 |
prediction: EFSM
|
44 |
nvt: true
|
45 |
npt: true
|
46 |
+
license: BSD-3-Clause
|
47 |
|
48 |
M3GNet:
|
49 |
module: externals
|
|
|
65 |
prediction: EFS
|
66 |
nvt: true
|
67 |
npt: true
|
68 |
+
license: BSD-3-Clause
|
69 |
|
70 |
ORB:
|
71 |
module: externals
|
|
|
90 |
prediction: EFS
|
91 |
nvt: true
|
92 |
npt: true
|
93 |
+
license: Apache-2.0
|
94 |
|
95 |
SevenNet:
|
96 |
module: externals
|
|
|
114 |
prediction: EFS
|
115 |
nvt: true
|
116 |
npt: true
|
117 |
+
license: GPL-3.0-only
|
118 |
|
119 |
eqV2(OMat):
|
120 |
module: externals
|
|
|
137 |
date: 2024-10-18
|
138 |
github: https://github.com/FAIR-Chem/fairchem
|
139 |
doi: https://arxiv.org/abs/2410.12771
|
140 |
+
license: Modified Apache-2.0 (Meta)
|
141 |
|
142 |
|
143 |
EquiformerV2(OC22):
|
|
|
160 |
prediction: EF
|
161 |
nvt: true
|
162 |
npt: false
|
163 |
+
license:
|
164 |
|
165 |
EquiformerV2(OC20):
|
166 |
module: externals
|
|
|
203 |
prediction: EF
|
204 |
nvt: true
|
205 |
npt: false
|
206 |
+
license:
|
207 |
|
208 |
MACE-OFF(M):
|
209 |
module: externals
|
|
|
225 |
prediction: EFS
|
226 |
nvt: true
|
227 |
npt: true
|
228 |
+
license: ASL
|
229 |
|
230 |
ALIGNN:
|
231 |
module: externals
|
|
|
247 |
github: https://github.com/usnistgov/alignn
|
248 |
doi: https://doi.org/10.1038/s41524-021-00650-1
|
249 |
date: 2021-11-15
|
250 |
+
license:
|
251 |
|
252 |
DeepMD:
|
253 |
module: externals
|
|
|
266 |
prediction: EFS
|
267 |
nvt: true
|
268 |
npt: true
|
269 |
+
license:
|
270 |
+
|
271 |
+
ORBv2:
|
272 |
+
module: externals
|
273 |
+
class: ORBv2
|
274 |
+
family: orb
|
275 |
+
package: orb-models==0.4.0
|
276 |
+
checkpoint: orb-v2-20241011.ckpt
|
277 |
+
username:
|
278 |
+
last-update: 2024-10-29T00:00:00
|
279 |
+
datetime: 2024-10-29T00:00:00 # TODO: Fake datetime
|
280 |
+
datasets:
|
281 |
+
- MPTrj
|
282 |
+
- Alexandria
|
283 |
+
gpu-tasks:
|
284 |
+
- homonuclear-diatomics
|
285 |
+
github: https://github.com/orbital-materials/orb-models
|
286 |
+
doi:
|
287 |
+
date: 2024-10-15
|
288 |
+
prediction: EFS
|
289 |
+
nvt: true
|
290 |
+
npt: true
|
291 |
+
license: Apache-2.0
|
292 |
|
293 |
ORBv2(MPTrj):
|
294 |
module: externals
|
|
|
307 |
prediction: EFS
|
308 |
nvt: true
|
309 |
npt: true
|
310 |
+
license: Apache-2.0
|
311 |
|
312 |
eqV2(MPTrj-S):
|
313 |
module: externals
|
|
|
325 |
npt: true
|
326 |
date: 2024-10-18
|
327 |
github: https://github.com/FAIR-Chem/fairchem
|
328 |
+
doi: https://arxiv.org/abs/2410.12771
|
329 |
+
license: Modified Apache-2.0 (Meta)
|
mlip_arena/tasks/diatomics/alignn/homonuclear-diatomics.json
CHANGED
@@ -1,3 +1,3 @@
|
|
1 |
version https://git-lfs.github.com/spec/v1
|
2 |
-
oid sha256:
|
3 |
-
size
|
|
|
1 |
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:3f880af442288d79b925e96723fa07c5e31c1d46e2888ed64382c3828c8b6893
|
3 |
+
size 2383737
|
mlip_arena/tasks/diatomics/chgnet/homonuclear-diatomics.json
CHANGED
@@ -1,3 +1,3 @@
|
|
1 |
version https://git-lfs.github.com/spec/v1
|
2 |
-
oid sha256:
|
3 |
-
size
|
|
|
1 |
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:d3bec21876e97d0841afbebe3b9adc87e61c4b090917f46842ddfcc507b4870e
|
3 |
+
size 2003358
|
mlip_arena/tasks/diatomics/equiformer/homonuclear-diatomics.json
CHANGED
@@ -1,3 +1,3 @@
|
|
1 |
version https://git-lfs.github.com/spec/v1
|
2 |
-
oid sha256:
|
3 |
-
size
|
|
|
1 |
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:fa2354642db212a30b8779e1a9069c58834e690b5d3f8757177676a7236d9cff
|
3 |
+
size 3764416
|
mlip_arena/tasks/diatomics/escn/homonuclear-diatomics.json
CHANGED
@@ -1,3 +1,3 @@
|
|
1 |
version https://git-lfs.github.com/spec/v1
|
2 |
-
oid sha256:
|
3 |
-
size
|
|
|
1 |
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:f24fc8f74dc3e9cc77c2099aefe81226764056db3bcb4a9077d42db68ca821d8
|
3 |
+
size 1960014
|
mlip_arena/tasks/diatomics/fairchem/homonuclear-diatomics.json
CHANGED
@@ -1,3 +1,3 @@
|
|
1 |
version https://git-lfs.github.com/spec/v1
|
2 |
-
oid sha256:
|
3 |
-
size
|
|
|
1 |
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:65bb77b1dca8bddb5ae2ad13aa1e336a30dbefc95953074ccbe077009ab73e08
|
3 |
+
size 2136843
|
mlip_arena/tasks/diatomics/mace-mp/homonuclear-diatomics.json
CHANGED
@@ -1,3 +1,3 @@
|
|
1 |
version https://git-lfs.github.com/spec/v1
|
2 |
-
oid sha256:
|
3 |
-
size
|
|
|
1 |
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:f36170ebca7c2c2c876cad7ff9fc4ed5d5043df3da4000089465b31ca2b5544a
|
3 |
+
size 1915526
|
mlip_arena/tasks/diatomics/mace-off/homonuclear-diatomics.json
CHANGED
@@ -1,3 +1,3 @@
|
|
1 |
version https://git-lfs.github.com/spec/v1
|
2 |
-
oid sha256:
|
3 |
-
size
|
|
|
1 |
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:1202ad5dcf6434cefd25246deeb5785d58cb70ad83bc54577c9f2d711a6b3974
|
3 |
+
size 174038
|
mlip_arena/tasks/diatomics/matgl/homonuclear-diatomics.json
CHANGED
@@ -1,3 +1,3 @@
|
|
1 |
version https://git-lfs.github.com/spec/v1
|
2 |
-
oid sha256:
|
3 |
-
size
|
|
|
1 |
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:217346241aaa0509e95e5f0ec6eb6dafbcc9ef954fd1f3077a778f0ac420f3f2
|
3 |
+
size 1858366
|
mlip_arena/tasks/diatomics/orb/homonuclear-diatomics.json
CHANGED
@@ -1,3 +1,3 @@
|
|
1 |
version https://git-lfs.github.com/spec/v1
|
2 |
-
oid sha256:
|
3 |
-
size
|
|
|
1 |
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:b6e846339ca128f4e2a0463f057917b51764e36278f43bf218f1717a01f79692
|
3 |
+
size 5197369
|
mlip_arena/tasks/diatomics/run.ipynb
CHANGED
The diff for this file is too large to render.
See raw diff
|
|
mlip_arena/tasks/diatomics/sevennet/homonuclear-diatomics.json
CHANGED
@@ -1,3 +1,3 @@
|
|
1 |
version https://git-lfs.github.com/spec/v1
|
2 |
-
oid sha256:
|
3 |
-
size
|
|
|
1 |
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:29542777bafc7425e0de89e9d6fe45341c414da269420658033d6072864ed6e0
|
3 |
+
size 1859815
|
mlip_arena/tasks/diatomics/vasp/homonuclear-diatomics.json
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:b8588dc4d4e203bf8f77f7f1b9736ac3446185084c67a1ad1cfbf0ec4c08e4ed
|
3 |
+
size 11785
|
pyproject.toml
CHANGED
@@ -46,7 +46,7 @@ run = [
|
|
46 |
"chgnet==0.3.8",
|
47 |
"fairchem-core==1.2.0",
|
48 |
"sevenn==0.9.3.post1",
|
49 |
-
"orb-models==0.
|
50 |
"alignn==2024.5.27",
|
51 |
"prefect>=3.0.4",
|
52 |
"prefect-dask"
|
@@ -65,7 +65,7 @@ test = [
|
|
65 |
"chgnet==0.3.8",
|
66 |
"fairchem-core==1.2.0",
|
67 |
"sevenn==0.9.3.post1",
|
68 |
-
"orb-models==0.
|
69 |
"pynanoflann@git+https://github.com/dwastberg/pynanoflann#egg=af434039ae14bedcbb838a7808924d6689274168",
|
70 |
"alignn==2024.5.27",
|
71 |
"pytest",
|
|
|
46 |
"chgnet==0.3.8",
|
47 |
"fairchem-core==1.2.0",
|
48 |
"sevenn==0.9.3.post1",
|
49 |
+
"orb-models==0.4.0",
|
50 |
"alignn==2024.5.27",
|
51 |
"prefect>=3.0.4",
|
52 |
"prefect-dask"
|
|
|
65 |
"chgnet==0.3.8",
|
66 |
"fairchem-core==1.2.0",
|
67 |
"sevenn==0.9.3.post1",
|
68 |
+
"orb-models==0.4.0",
|
69 |
"pynanoflann@git+https://github.com/dwastberg/pynanoflann#egg=af434039ae14bedcbb838a7808924d6689274168",
|
70 |
"alignn==2024.5.27",
|
71 |
"pytest",
|
serve/leaderboard.py
CHANGED
@@ -31,6 +31,7 @@ table = pd.DataFrame(
|
|
31 |
"Paper",
|
32 |
"Checkpoint",
|
33 |
"First Release",
|
|
|
34 |
]
|
35 |
)
|
36 |
|
@@ -48,6 +49,7 @@ for model in MODELS:
|
|
48 |
"Paper": metadata.get("doi", None) if metadata else None,
|
49 |
"Checkpoint": metadata.get("checkpoint", None),
|
50 |
"First Release": metadata.get("date", None),
|
|
|
51 |
}
|
52 |
table = pd.concat([table, pd.DataFrame([new_row])], ignore_index=True)
|
53 |
|
|
|
31 |
"Paper",
|
32 |
"Checkpoint",
|
33 |
"First Release",
|
34 |
+
"License",
|
35 |
]
|
36 |
)
|
37 |
|
|
|
49 |
"Paper": metadata.get("doi", None) if metadata else None,
|
50 |
"Checkpoint": metadata.get("checkpoint", None),
|
51 |
"First Release": metadata.get("date", None),
|
52 |
+
"License": metadata.get("license", None),
|
53 |
}
|
54 |
table = pd.concat([table, pd.DataFrame([new_row])], ignore_index=True)
|
55 |
|
serve/ranks/homonuclear-diatomics.py
CHANGED
@@ -1,4 +1,5 @@
|
|
1 |
from pathlib import Path
|
|
|
2 |
|
3 |
import numpy as np
|
4 |
import pandas as pd
|
@@ -29,21 +30,23 @@ for model in valid_models:
|
|
29 |
new_row = {
|
30 |
"Model": model,
|
31 |
"Conservation deviation [eV/Å]": rows["conservation-deviation"].mean(),
|
32 |
-
"Spearman's coeff. (
|
33 |
"spearman-repulsion-energy"
|
34 |
].mean(),
|
35 |
-
"Spearman's coeff. (
|
36 |
"spearman-descending-force"
|
37 |
].mean(),
|
38 |
"Tortuosity": rows["tortuosity"].mean(),
|
39 |
"Energy jump [eV]": rows["energy-jump"].mean(),
|
40 |
"Force flips": rows["force-flip-times"].mean(),
|
41 |
-
"Spearman's coeff. (
|
42 |
"spearman-attraction-energy"
|
43 |
].mean(),
|
44 |
-
"Spearman's coeff. (
|
45 |
"spearman-ascending-force"
|
46 |
].mean(),
|
|
|
|
|
47 |
}
|
48 |
|
49 |
table = pd.concat([table, pd.DataFrame([new_row])], ignore_index=True)
|
@@ -54,14 +57,20 @@ table.sort_values("Conservation deviation [eV/Å]", ascending=True, inplace=Tru
|
|
54 |
table["Rank"] = np.argsort(table["Conservation deviation [eV/Å]"].to_numpy())
|
55 |
|
56 |
table.sort_values(
|
57 |
-
"Spearman's coeff. (
|
58 |
)
|
59 |
-
table["Rank"] += np.argsort(table["Spearman's coeff. (
|
60 |
|
61 |
table.sort_values(
|
62 |
-
"Spearman's coeff. (
|
63 |
)
|
64 |
-
table["Rank"] += np.argsort(table["Spearman's coeff. (
|
|
|
|
|
|
|
|
|
|
|
|
|
65 |
|
66 |
table.sort_values("Tortuosity", ascending=True, inplace=True)
|
67 |
table["Rank"] += np.argsort(table["Tortuosity"].to_numpy())
|
@@ -70,7 +79,7 @@ table.sort_values("Energy jump [eV]", ascending=True, inplace=True)
|
|
70 |
table["Rank"] += np.argsort(table["Energy jump [eV]"].to_numpy())
|
71 |
|
72 |
table.sort_values("Force flips", ascending=True, inplace=True)
|
73 |
-
table["Rank"] += np.argsort(table["Force flips"].to_numpy())
|
74 |
|
75 |
table["Rank"] += 1
|
76 |
|
@@ -84,13 +93,15 @@ table = table.reindex(
|
|
84 |
"Rank",
|
85 |
"Rank aggr.",
|
86 |
"Conservation deviation [eV/Å]",
|
87 |
-
"
|
88 |
-
"
|
89 |
-
"
|
|
|
90 |
"Energy jump [eV]",
|
91 |
"Force flips",
|
92 |
-
"
|
93 |
-
"Spearman's coeff. (
|
|
|
94 |
]
|
95 |
)
|
96 |
|
@@ -103,11 +114,18 @@ s = (
|
|
103 |
.background_gradient(
|
104 |
cmap="Reds",
|
105 |
subset=[
|
106 |
-
"Spearman's coeff. (
|
107 |
-
"Spearman's coeff. (
|
108 |
],
|
109 |
# vmin=-1, vmax=-0.5
|
110 |
)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
111 |
.background_gradient(
|
112 |
cmap="RdPu",
|
113 |
subset=["Tortuosity", "Energy jump [eV]", "Force flips"],
|
@@ -117,16 +135,18 @@ s = (
|
|
117 |
subset=["Rank", "Rank aggr."],
|
118 |
)
|
119 |
.format(
|
120 |
-
"{:.
|
121 |
subset=[
|
122 |
"Conservation deviation [eV/Å]",
|
123 |
-
"Spearman's coeff. (
|
124 |
-
"Spearman's coeff. (
|
125 |
"Tortuosity",
|
126 |
"Energy jump [eV]",
|
127 |
"Force flips",
|
128 |
-
"Spearman's coeff. (
|
129 |
-
"Spearman's coeff. (
|
|
|
|
|
130 |
]
|
131 |
)
|
132 |
)
|
@@ -146,8 +166,8 @@ def render():
|
|
146 |
\\text{Conservation deviation} = \\left\\langle\\left| \\mathbf{F}(\\mathbf{r})\\cdot\\frac{\\mathbf{r}}{\\|\\mathbf{r}\\|} + \\nabla_rE\\right|\\right\\rangle_{r = \\|\\mathbf{r}\\|}
|
147 |
$$
|
148 |
|
149 |
-
- **Spearman's coeff. (
|
150 |
-
- **Spearman's coeff. (
|
151 |
- **Tortuosity**: The ratio between total variation in energy and sum of absolute energy differences between $r_{min}$, $r_o$, and $r_{max}$.
|
152 |
- **Energy jump**: The sum of energy discontinuity.
|
153 |
- **Force flips**: The number of sign changes.
|
|
|
1 |
from pathlib import Path
|
2 |
+
from ase.data import chemical_symbols
|
3 |
|
4 |
import numpy as np
|
5 |
import pandas as pd
|
|
|
30 |
new_row = {
|
31 |
"Model": model,
|
32 |
"Conservation deviation [eV/Å]": rows["conservation-deviation"].mean(),
|
33 |
+
"Spearman's coeff. (E: repulsion)": rows[
|
34 |
"spearman-repulsion-energy"
|
35 |
].mean(),
|
36 |
+
"Spearman's coeff. (F: descending)": rows[
|
37 |
"spearman-descending-force"
|
38 |
].mean(),
|
39 |
"Tortuosity": rows["tortuosity"].mean(),
|
40 |
"Energy jump [eV]": rows["energy-jump"].mean(),
|
41 |
"Force flips": rows["force-flip-times"].mean(),
|
42 |
+
"Spearman's coeff. (E: attraction)": rows[
|
43 |
"spearman-attraction-energy"
|
44 |
].mean(),
|
45 |
+
"Spearman's coeff. (F: ascending)": rows[
|
46 |
"spearman-ascending-force"
|
47 |
].mean(),
|
48 |
+
"PBE energy MAE [eV]": rows["pbe-energy-mae"].mean(),
|
49 |
+
"PBE force MAE [eV/Å]": rows["pbe-force-mae"].mean(),
|
50 |
}
|
51 |
|
52 |
table = pd.concat([table, pd.DataFrame([new_row])], ignore_index=True)
|
|
|
57 |
table["Rank"] = np.argsort(table["Conservation deviation [eV/Å]"].to_numpy())
|
58 |
|
59 |
table.sort_values(
|
60 |
+
"Spearman's coeff. (E: repulsion)", ascending=True, inplace=True
|
61 |
)
|
62 |
+
table["Rank"] += np.argsort(table["Spearman's coeff. (E: repulsion)"].to_numpy())
|
63 |
|
64 |
table.sort_values(
|
65 |
+
"Spearman's coeff. (F: descending)", ascending=True, inplace=True
|
66 |
)
|
67 |
+
table["Rank"] += np.argsort(table["Spearman's coeff. (F: descending)"].to_numpy())
|
68 |
+
|
69 |
+
table.sort_values("PBE energy MAE [eV]", ascending=True, inplace=True)
|
70 |
+
table["Rank"] += np.argsort(table["PBE energy MAE [eV]"].to_numpy())
|
71 |
+
|
72 |
+
table.sort_values("PBE force MAE [eV/Å]", ascending=True, inplace=True)
|
73 |
+
table["Rank"] += np.argsort(table["PBE force MAE [eV/Å]"].to_numpy())
|
74 |
|
75 |
table.sort_values("Tortuosity", ascending=True, inplace=True)
|
76 |
table["Rank"] += np.argsort(table["Tortuosity"].to_numpy())
|
|
|
79 |
table["Rank"] += np.argsort(table["Energy jump [eV]"].to_numpy())
|
80 |
|
81 |
table.sort_values("Force flips", ascending=True, inplace=True)
|
82 |
+
table["Rank"] += np.argsort(np.abs(table["Force flips"].to_numpy() - 1))
|
83 |
|
84 |
table["Rank"] += 1
|
85 |
|
|
|
93 |
"Rank",
|
94 |
"Rank aggr.",
|
95 |
"Conservation deviation [eV/Å]",
|
96 |
+
"PBE energy MAE [eV]",
|
97 |
+
"PBE force MAE [eV/Å]",
|
98 |
+
"Spearman's coeff. (E: repulsion)",
|
99 |
+
"Spearman's coeff. (F: descending)",
|
100 |
"Energy jump [eV]",
|
101 |
"Force flips",
|
102 |
+
"Tortuosity",
|
103 |
+
"Spearman's coeff. (E: attraction)",
|
104 |
+
"Spearman's coeff. (F: ascending)",
|
105 |
]
|
106 |
)
|
107 |
|
|
|
114 |
.background_gradient(
|
115 |
cmap="Reds",
|
116 |
subset=[
|
117 |
+
"Spearman's coeff. (E: repulsion)",
|
118 |
+
"Spearman's coeff. (F: descending)",
|
119 |
],
|
120 |
# vmin=-1, vmax=-0.5
|
121 |
)
|
122 |
+
.background_gradient(
|
123 |
+
cmap="BuPu",
|
124 |
+
subset=[
|
125 |
+
"PBE energy MAE [eV]",
|
126 |
+
"PBE force MAE [eV/Å]",
|
127 |
+
],
|
128 |
+
)
|
129 |
.background_gradient(
|
130 |
cmap="RdPu",
|
131 |
subset=["Tortuosity", "Energy jump [eV]", "Force flips"],
|
|
|
135 |
subset=["Rank", "Rank aggr."],
|
136 |
)
|
137 |
.format(
|
138 |
+
"{:.3f}",
|
139 |
subset=[
|
140 |
"Conservation deviation [eV/Å]",
|
141 |
+
"Spearman's coeff. (E: repulsion)",
|
142 |
+
"Spearman's coeff. (F: descending)",
|
143 |
"Tortuosity",
|
144 |
"Energy jump [eV]",
|
145 |
"Force flips",
|
146 |
+
"Spearman's coeff. (E: attraction)",
|
147 |
+
"Spearman's coeff. (F: ascending)",
|
148 |
+
"PBE energy MAE [eV]",
|
149 |
+
"PBE force MAE [eV/Å]",
|
150 |
]
|
151 |
)
|
152 |
)
|
|
|
166 |
\\text{Conservation deviation} = \\left\\langle\\left| \\mathbf{F}(\\mathbf{r})\\cdot\\frac{\\mathbf{r}}{\\|\\mathbf{r}\\|} + \\nabla_rE\\right|\\right\\rangle_{r = \\|\\mathbf{r}\\|}
|
167 |
$$
|
168 |
|
169 |
+
- **Spearman's coeff. (E: repulsion)**: Spearman's correlation coefficient of energy prediction within equilibrium distance $r \\in (r_{min}, r_o = \\argmin_{r} E(r))$.
|
170 |
+
- **Spearman's coeff. (F: descending)**: Spearman's correlation coefficient of force prediction within equilibrium distance $r \\in (r_{min}, r_o = \\argmin_{r} E(r))$.
|
171 |
- **Tortuosity**: The ratio between total variation in energy and sum of absolute energy differences between $r_{min}$, $r_o$, and $r_{max}$.
|
172 |
- **Energy jump**: The sum of energy discontinuity.
|
173 |
- **Force flips**: The number of sign changes.
|
serve/ranks/thermal-conductivity.py
CHANGED
@@ -11,33 +11,33 @@ table = pd.read_csv(DATA_DIR / "wte.csv")
|
|
11 |
table.rename(
|
12 |
columns={
|
13 |
"method": "Model",
|
14 |
-
"srme": "SRME",
|
15 |
},
|
16 |
inplace=True,
|
17 |
)
|
18 |
|
19 |
table.set_index("Model", inplace=True)
|
20 |
|
21 |
-
table.sort_values(["SRME"], ascending=True, inplace=True)
|
22 |
|
23 |
-
table["Rank"] = table["SRME"].rank(method='min').astype(int)
|
24 |
|
25 |
table = table.reindex(
|
26 |
columns=[
|
27 |
"Rank",
|
28 |
-
"SRME",
|
29 |
]
|
30 |
)
|
31 |
|
32 |
s = (
|
33 |
table.style.background_gradient(
|
34 |
-
cmap="Reds", subset=["SRME"]
|
35 |
)
|
36 |
.background_gradient(
|
37 |
cmap="Blues",
|
38 |
subset=["Rank"],
|
39 |
)
|
40 |
-
.format("{:.3f}", subset=["SRME"])
|
41 |
)
|
42 |
|
43 |
|
|
|
11 |
table.rename(
|
12 |
columns={
|
13 |
"method": "Model",
|
14 |
+
"srme": "SRME[𝜅]",
|
15 |
},
|
16 |
inplace=True,
|
17 |
)
|
18 |
|
19 |
table.set_index("Model", inplace=True)
|
20 |
|
21 |
+
table.sort_values(["SRME[𝜅]"], ascending=True, inplace=True)
|
22 |
|
23 |
+
table["Rank"] = table["SRME[𝜅]"].rank(method='min').astype(int)
|
24 |
|
25 |
table = table.reindex(
|
26 |
columns=[
|
27 |
"Rank",
|
28 |
+
"SRME[𝜅]",
|
29 |
]
|
30 |
)
|
31 |
|
32 |
s = (
|
33 |
table.style.background_gradient(
|
34 |
+
cmap="Reds", subset=["SRME[𝜅]"]
|
35 |
)
|
36 |
.background_gradient(
|
37 |
cmap="Blues",
|
38 |
subset=["Rank"],
|
39 |
)
|
40 |
+
.format("{:.3f}", subset=["SRME[𝜅]"])
|
41 |
)
|
42 |
|
43 |
|
serve/tasks/homonuclear-diatomics.py
CHANGED
@@ -30,9 +30,9 @@ valid_models = [
|
|
30 |
mlip_methods = container.multiselect(
|
31 |
"MLIPs",
|
32 |
valid_models,
|
33 |
-
["
|
34 |
)
|
35 |
-
dft_methods = container.multiselect("DFT Methods", ["
|
36 |
|
37 |
st.markdown("### Settings")
|
38 |
vis = st.container(border=True)
|
@@ -71,8 +71,8 @@ def get_data(mlip_methods, dft_methods):
|
|
71 |
]
|
72 |
dfs.extend(
|
73 |
[
|
74 |
-
pd.read_json(DATA_DIR /
|
75 |
-
for method in dft_methods
|
76 |
]
|
77 |
)
|
78 |
df = pd.concat(dfs, ignore_index=True)
|
@@ -118,63 +118,110 @@ def get_plots(df, energy_plot: bool, force_plot: bool, method_color_mapping: dic
|
|
118 |
|
119 |
rs = rs[ind]
|
120 |
es = es[ind]
|
121 |
-
|
122 |
-
|
123 |
-
|
124 |
-
|
125 |
|
126 |
-
if "GPAW" not in method:
|
127 |
-
fs = fs[ind]
|
128 |
|
129 |
-
if
|
130 |
-
|
131 |
-
else:
|
132 |
-
|
133 |
|
134 |
if energy_plot:
|
135 |
-
if "GPAW" in method:
|
136 |
-
|
137 |
-
|
138 |
-
else:
|
139 |
-
|
140 |
|
141 |
elo = min(elo, max(ys.min() * 1.2, -15), -1)
|
142 |
-
|
143 |
-
|
144 |
-
|
145 |
-
|
146 |
-
|
147 |
-
|
148 |
-
|
149 |
-
|
150 |
-
|
151 |
-
|
|
|
|
|
152 |
),
|
153 |
-
|
154 |
-
)
|
155 |
-
|
156 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
157 |
|
158 |
-
if force_plot and
|
|
|
159 |
ys = fs
|
160 |
|
161 |
flo = min(flo, max(ys.min() * 1.2, -50))
|
162 |
|
163 |
-
|
164 |
-
|
165 |
-
|
166 |
-
|
167 |
-
|
168 |
-
|
169 |
-
|
170 |
-
|
171 |
-
|
|
|
|
|
|
|
|
|
172 |
),
|
173 |
-
|
174 |
-
|
175 |
-
|
176 |
-
|
177 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
178 |
|
179 |
name = f"{symbol}-{symbol}"
|
180 |
|
@@ -187,6 +234,7 @@ def get_plots(df, energy_plot: bool, force_plot: bool, method_color_mapping: dic
|
|
187 |
y=1,
|
188 |
yanchor="top",
|
189 |
bgcolor="rgba(0, 0, 0, 0)",
|
|
|
190 |
# entrywidth=0.3,
|
191 |
# entrywidthmode='fraction',
|
192 |
),
|
|
|
30 |
mlip_methods = container.multiselect(
|
31 |
"MLIPs",
|
32 |
valid_models,
|
33 |
+
["MACE-MP(M)", "CHGNet", "M3GNet", "SevenNet", "ORB", "ORBv2", "eqV2(OMat)"],
|
34 |
)
|
35 |
+
dft_methods = container.multiselect("DFT Methods", ["PBE"], ["PBE"])
|
36 |
|
37 |
st.markdown("### Settings")
|
38 |
vis = st.container(border=True)
|
|
|
71 |
]
|
72 |
dfs.extend(
|
73 |
[
|
74 |
+
pd.read_json(DATA_DIR / "vasp" / "homonuclear-diatomics.json")
|
75 |
+
# for method in dft_methods
|
76 |
]
|
77 |
)
|
78 |
df = pd.concat(dfs, ignore_index=True)
|
|
|
118 |
|
119 |
rs = rs[ind]
|
120 |
es = es[ind]
|
121 |
+
fs = fs[ind]
|
122 |
+
|
123 |
+
# if method not in ["PBE"]:
|
124 |
+
es = es - es[-1]
|
125 |
|
|
|
|
|
126 |
|
127 |
+
# if method in ["PBE"]:
|
128 |
+
# xs = np.linspace(rs.min() * 0.99, rs.max() * 1.01, int(5e2))
|
129 |
+
# else:
|
130 |
+
xs = rs
|
131 |
|
132 |
if energy_plot:
|
133 |
+
# if "GPAW" in method:
|
134 |
+
# cs = CubicSpline(rs, es)
|
135 |
+
# ys = cs(xs)
|
136 |
+
# else:
|
137 |
+
ys = es
|
138 |
|
139 |
elo = min(elo, max(ys.min() * 1.2, -15), -1)
|
140 |
+
|
141 |
+
if method in ["PBE"]:
|
142 |
+
fig.add_trace(
|
143 |
+
go.Scatter(
|
144 |
+
x=xs,
|
145 |
+
y=ys,
|
146 |
+
mode="markers",
|
147 |
+
line=dict(
|
148 |
+
color=method_color_mapping[method],
|
149 |
+
width=3,
|
150 |
+
),
|
151 |
+
name=method,
|
152 |
),
|
153 |
+
secondary_y=False,
|
154 |
+
)
|
155 |
+
# xs = np.linspace(rs.min() * 0.99, rs.max() * 1.01, int(5e2))
|
156 |
+
# cs = CubicSpline(rs, es)
|
157 |
+
# ys = cs(xs)
|
158 |
+
# fig.add_trace(
|
159 |
+
# go.Scatter(
|
160 |
+
# x=xs,
|
161 |
+
# y=ys,
|
162 |
+
# mode="lines",
|
163 |
+
# line=dict(
|
164 |
+
# color=method_color_mapping[method],
|
165 |
+
# width=3,
|
166 |
+
# ),
|
167 |
+
# name=method,
|
168 |
+
# showlegend=False,
|
169 |
+
# ),
|
170 |
+
# secondary_y=False,
|
171 |
+
# )
|
172 |
+
else:
|
173 |
+
fig.add_trace(
|
174 |
+
go.Scatter(
|
175 |
+
x=xs,
|
176 |
+
y=ys,
|
177 |
+
mode="lines",
|
178 |
+
line=dict(
|
179 |
+
color=method_color_mapping[method],
|
180 |
+
width=3,
|
181 |
+
),
|
182 |
+
name=method,
|
183 |
+
),
|
184 |
+
secondary_y=False,
|
185 |
+
)
|
186 |
|
187 |
+
# if force_plot and method not in ["PBE"]:
|
188 |
+
if force_plot:
|
189 |
ys = fs
|
190 |
|
191 |
flo = min(flo, max(ys.min() * 1.2, -50))
|
192 |
|
193 |
+
if method in ["PBE"]:
|
194 |
+
fig.add_trace(
|
195 |
+
go.Scatter(
|
196 |
+
x=xs,
|
197 |
+
y=ys,
|
198 |
+
mode="lines+markers",
|
199 |
+
line=dict(
|
200 |
+
color=method_color_mapping[method],
|
201 |
+
width=2,
|
202 |
+
dash="dashdot",
|
203 |
+
),
|
204 |
+
name=method,
|
205 |
+
showlegend=not energy_plot,
|
206 |
),
|
207 |
+
secondary_y=True,
|
208 |
+
)
|
209 |
+
else:
|
210 |
+
fig.add_trace(
|
211 |
+
go.Scatter(
|
212 |
+
x=xs,
|
213 |
+
y=ys,
|
214 |
+
mode="lines",
|
215 |
+
line=dict(
|
216 |
+
color=method_color_mapping[method],
|
217 |
+
width=2,
|
218 |
+
dash="dashdot",
|
219 |
+
),
|
220 |
+
name=method,
|
221 |
+
showlegend=not energy_plot,
|
222 |
+
),
|
223 |
+
secondary_y=True,
|
224 |
+
)
|
225 |
|
226 |
name = f"{symbol}-{symbol}"
|
227 |
|
|
|
234 |
y=1,
|
235 |
yanchor="top",
|
236 |
bgcolor="rgba(0, 0, 0, 0)",
|
237 |
+
# traceorder='reversed',
|
238 |
# entrywidth=0.3,
|
239 |
# entrywidthmode='fraction',
|
240 |
),
|
serve/tasks/thermal-conductivity.py
CHANGED
@@ -26,20 +26,20 @@ table = pd.read_csv(DATA_DIR / "wte.csv")
|
|
26 |
table.rename(
|
27 |
columns={
|
28 |
"method": "Model",
|
29 |
-
"srme": "SRME",
|
30 |
},
|
31 |
inplace=True,
|
32 |
)
|
33 |
|
34 |
table.set_index("Model", inplace=True)
|
35 |
|
36 |
-
table.sort_values(["SRME"], ascending=True, inplace=True)
|
37 |
|
38 |
s = (
|
39 |
table.style.background_gradient(
|
40 |
-
cmap="Reds", subset=["SRME"]
|
41 |
)
|
42 |
-
.format("{:.3f}", subset=["SRME"])
|
43 |
)
|
44 |
|
45 |
st.dataframe(
|
|
|
26 |
table.rename(
|
27 |
columns={
|
28 |
"method": "Model",
|
29 |
+
"srme": "SRME[𝜅]",
|
30 |
},
|
31 |
inplace=True,
|
32 |
)
|
33 |
|
34 |
table.set_index("Model", inplace=True)
|
35 |
|
36 |
+
table.sort_values(["SRME[𝜅]"], ascending=True, inplace=True)
|
37 |
|
38 |
s = (
|
39 |
table.style.background_gradient(
|
40 |
+
cmap="Reds", subset=["SRME[𝜅]"]
|
41 |
)
|
42 |
+
.format("{:.3f}", subset=["SRME[𝜅]"])
|
43 |
)
|
44 |
|
45 |
st.dataframe(
|
tests/test_external_calculators.py
CHANGED
@@ -12,6 +12,9 @@ def test_calculate(model: MLIPEnum):
|
|
12 |
if model.name == "ALIGNN":
|
13 |
pytest.xfail("ALIGNN has poor file download mechanism")
|
14 |
|
|
|
|
|
|
|
15 |
try:
|
16 |
calc = MLIPEnum[model.name].value()
|
17 |
|
|
|
12 |
if model.name == "ALIGNN":
|
13 |
pytest.xfail("ALIGNN has poor file download mechanism")
|
14 |
|
15 |
+
if model.name == "ORB":
|
16 |
+
pytest.xfail("Orbital Materials deprecated the model a month after its premature release in favor of ORBv2")
|
17 |
+
|
18 |
try:
|
19 |
calc = MLIPEnum[model.name].value()
|
20 |
|