sunghjung3 commited on
Commit
77d73af
·
verified ·
1 Parent(s): adc2595

Drop 2 lemat triplets with broken forces; update metadata, docs, notebook, scripts

Browse files

- lemat/train/lemat_train_0213 and lemat_train_0479 hold 49,999 triplets each. The triplets with saddle ms_id 35584423 and 79800988 (max |F| at the saddle 4.78e11 and 1.02e8 eV/A) are left out. Every other row is byte-identical to its source row.
- metadata/triplets.parquet: 33,877,257 triplets.
- metadata/removed_duplicates.parquet: new column `reason` (duplicate or broken) and 2 rows for the broken triplets.
- README.md, DATASHEET.md: counts and text of this release, citation title.
- example.ipynb: lookup by ms_id; shards open read-only.
- scripts/dedup: the scripts write this release.

DATASHEET.md CHANGED
@@ -30,19 +30,18 @@ consecutive instances (rows) within an `.aselmdb` file form one
30
  transition-state event: reactant minimum → first-order saddle / transition
31
  state → product minimum, all at the
32
  [`uma-s-1p2`](https://github.com/facebookresearch/fairchem) ML-potential
33
- level. The dataset (v2) contains 33,877,259 such triplets
34
- (101,631,777 individual structures), after removing 258,338 duplicate
35
- triplets from the 34,135,597 of v1.
36
 
37
  **How many instances are there in total?**
38
 
39
- | Subset | Source | Method | # transition states (v2) | removed duplicates | # `.aselmdb` files |
40
- |-----------|----------------------------------------|----------|-------------------------:|-------------------:|-------------------:|
41
- | `lemat/` | LeMat-Bulk | Dimer | 31,322,917 | 23,502 | 628 |
42
- | `oc20/` | Open Catalyst 2020 | Dimer | 2,367,718 | 219,383 | 49 |
43
- | `oc22/` | Open Catalyst 2022 | Dimer | 152,593 | 14,742 | 5 |
44
- | `mp20bat/`| Materials Project battery structures | NEB-CI | 34,031 | 711 | 3 |
45
- | **Total** | | | **33,877,259** | **258,338** | **685** |
46
 
47
  **Does the dataset contain all possible instances or is it a sample
48
  (including a probabilistic sample) from a larger set?**
@@ -85,18 +84,12 @@ it themselves from the atomic geometry.
85
  **Are relationships between individual instances made explicit?**
86
  Within a single triplet, the three rows are stored consecutively (ASE row
87
  ids `3k+1`, `3k+2`, `3k+3` of a file; `ms_id`s `3m`, `3m+1`, `3m+2`) and share
88
- `src_index`. Since v2, duplicate triplets are removed: triplets whose saddle,
89
- reactant and product all agree within 0.2 Å max-atom distance (same
90
- composition and lattice; reactant/product in either orientation) are merged,
91
- keeping the lowest `ms_id`. `metadata/removed_duplicates.parquet` maps every
92
- removed triplet to the one kept. Triplets that share a saddle but connect
93
- different endpoints are distinct reactions and are kept; triplets that share
94
- an upstream input structure are related through `source_id` in
95
- `metadata/triplets.parquet`.
96
 
97
  **Are there recommended data splits (e.g., training, development/validation,
98
  testing)?**
99
- Yes — since v2 the data are stored already split, as `<subset>/train/`,
100
  `<subset>/val/` and `<subset>/test/`. Whole chemical systems (element sets)
101
  were assigned to train / val / test with probabilities 0.90 / 0.05 / 0.05
102
  (seed 0), globally across subsets, so no chemical system — and hence no
@@ -114,10 +107,8 @@ Custom splits should be chosen with care for the downstream task — see
114
  - *Convergence threshold residuals*: structures meet `max|F| < 0.05 eV/Å`
115
  (saddle) and `< 0.02 eV/Å` (endpoints) but are not strictly at zero force.
116
  - *Multiple saddle searches per input*: the same input structure is
117
- typically attempted with several initialization moves. Exact repeats
118
- (saddle and both endpoints within 0.2 Å) are removed in v2; saddles that
119
- are geometrically similar but further apart, or that connect different
120
- endpoints, remain.
121
  - *Eigenmode quality*: the eigenmode is the converged Dimer rotation
122
  direction (Dimer subset) or the NEB tangent at the climbing image
123
  (NEB subset). Both are good first-order approximations to the unstable
@@ -189,17 +180,16 @@ Yes. The release pipeline:
189
  (`is_reaction`, `n_formed_bonds`, `n_broken_bonds`, …) are recorded on
190
  dimer rows but are not the gating filter.
191
  4. Compute a `uma-s-1p2` single-point energy and forces for every row.
192
- 5. (v2) Remove duplicate triplets and write the chemical-system-disjoint
193
- split as `<subset>/<split>/<subset>_<split>_<NNNN>.aselmdb` files in
194
- `ms_id` order, copying every row byte-for-byte from v1.
195
 
196
  **Was the "raw" data saved in addition to the preprocessed data?**
197
  Internally yes; not part of this public release.
198
 
199
  **Is the software used to preprocess/clean/label the instances available?**
200
  Yes — [SaddleMill](https://github.com/SciLM-ai/SaddleMill) is open
201
- source. The scripts that produced v2 from v1 (deduplication, split, rewrite
202
- and verification) are included under `scripts/dedup/`.
203
 
204
  ## Uses
205
 
@@ -263,8 +253,8 @@ Yes — public release on Hugging Face at
263
 
264
  **How will the dataset be distributed?**
265
  Hugging Face Hub, as `.aselmdb` files in `<subset>/<split>/` directories,
266
- plus this `DATASHEET.md`, `README.md`, an example notebook, the `metadata/`
267
- tables and the `scripts/dedup/` reproduction scripts. ASE-LMDB lock
268
  artifacts (`*.aselmdb-lock`) are excluded via `.gitignore`.
269
 
270
  **When will the dataset be distributed?**
@@ -295,9 +285,7 @@ Ilgar Baghishov (<baghishov@utexas.edu>) and Sung Hoon Jung
295
  (<sunghjung3@utexas.edu>), or open a discussion on the Hugging Face Hub page.
296
 
297
  **Is there an erratum?**
298
- v2 supersedes v1: v1 contained 258,338 duplicate triplets (0.76 %; 8–9 % of
299
- `oc20`/`oc22`) and a random split in which most test chemistry also occurred
300
- in training. See the README changelog.
301
 
302
  **Will the dataset be updated?**
303
  Future releases may (a) add DFT single-point energies/forces on a
@@ -324,9 +312,6 @@ Open a discussion / pull request on the Hugging Face Hub repository.
324
  hold-out (e.g. by host material regardless of adsorbate, or by upstream
325
  structure), build it from `metadata/triplets.parquet`
326
  (`chemical_system`, `reduced_formula`, `source_id`).
327
- - **Near-duplicates beyond 0.2 Å remain.** v2 removes exact repeats only;
328
- closely related saddles from the same input structure can still occur
329
- within a split.
330
  - **Don't compare absolute barriers across subsets** without recomputing —
331
  the `barrier` field is stored only for the NEB (`mp20bat`) subset and
332
  is at the `uma-s-1p2` level, not DFT.
 
30
  transition-state event: reactant minimum → first-order saddle / transition
31
  state → product minimum, all at the
32
  [`uma-s-1p2`](https://github.com/facebookresearch/fairchem) ML-potential
33
+ level. The dataset contains 33,877,257 such triplets
34
+ (101,631,771 individual structures).
 
35
 
36
  **How many instances are there in total?**
37
 
38
+ | Subset | Source | Method | # transition states | # `.aselmdb` files |
39
+ |-----------|----------------------------------------|----------|-------------------------:|-------------------:|
40
+ | `lemat/` | LeMat-Bulk | Dimer | 31,322,915 | 628 |
41
+ | `oc20/` | Open Catalyst 2020 | Dimer | 2,367,718 | 49 |
42
+ | `oc22/` | Open Catalyst 2022 | Dimer | 152,593 | 5 |
43
+ | `mp20bat/`| Materials Project battery structures | NEB-CI | 34,031 | 3 |
44
+ | **Total** | | | **33,877,257** | **685** |
45
 
46
  **Does the dataset contain all possible instances or is it a sample
47
  (including a probabilistic sample) from a larger set?**
 
84
  **Are relationships between individual instances made explicit?**
85
  Within a single triplet, the three rows are stored consecutively (ASE row
86
  ids `3k+1`, `3k+2`, `3k+3` of a file; `ms_id`s `3m`, `3m+1`, `3m+2`) and share
87
+ `src_index`. Triplets that share an upstream input structure are related
88
+ through `source_id` in `metadata/triplets.parquet`.
 
 
 
 
 
 
89
 
90
  **Are there recommended data splits (e.g., training, development/validation,
91
  testing)?**
92
+ Yes — the data are stored already split, as `<subset>/train/`,
93
  `<subset>/val/` and `<subset>/test/`. Whole chemical systems (element sets)
94
  were assigned to train / val / test with probabilities 0.90 / 0.05 / 0.05
95
  (seed 0), globally across subsets, so no chemical system — and hence no
 
107
  - *Convergence threshold residuals*: structures meet `max|F| < 0.05 eV/Å`
108
  (saddle) and `< 0.02 eV/Å` (endpoints) but are not strictly at zero force.
109
  - *Multiple saddle searches per input*: the same input structure is
110
+ typically attempted with several initialization moves. The saddles from
111
+ one input can be geometrically similar or connect different endpoints.
 
 
112
  - *Eigenmode quality*: the eigenmode is the converged Dimer rotation
113
  direction (Dimer subset) or the NEB tangent at the climbing image
114
  (NEB subset). Both are good first-order approximations to the unstable
 
180
  (`is_reaction`, `n_formed_bonds`, `n_broken_bonds`, …) are recorded on
181
  dimer rows but are not the gating filter.
182
  4. Compute a `uma-s-1p2` single-point energy and forces for every row.
183
+ 5. Write the chemical-system-disjoint split as
184
+ `<subset>/<split>/<subset>_<split>_<NNNN>.aselmdb` files in `ms_id` order.
185
+ Copy every row byte-for-byte from the files of step 4.
186
 
187
  **Was the "raw" data saved in addition to the preprocessed data?**
188
  Internally yes; not part of this public release.
189
 
190
  **Is the software used to preprocess/clean/label the instances available?**
191
  Yes — [SaddleMill](https://github.com/SciLM-ai/SaddleMill) is open
192
+ source.
 
193
 
194
  ## Uses
195
 
 
253
 
254
  **How will the dataset be distributed?**
255
  Hugging Face Hub, as `.aselmdb` files in `<subset>/<split>/` directories,
256
+ plus this `DATASHEET.md`, `README.md`, an example notebook and the
257
+ `metadata/` tables. ASE-LMDB lock
258
  artifacts (`*.aselmdb-lock`) are excluded via `.gitignore`.
259
 
260
  **When will the dataset be distributed?**
 
285
  (<sunghjung3@utexas.edu>), or open a discussion on the Hugging Face Hub page.
286
 
287
  **Is there an erratum?**
288
+ No.
 
 
289
 
290
  **Will the dataset be updated?**
291
  Future releases may (a) add DFT single-point energies/forces on a
 
312
  hold-out (e.g. by host material regardless of adsorbate, or by upstream
313
  structure), build it from `metadata/triplets.parquet`
314
  (`chemical_system`, `reduced_formula`, `source_id`).
 
 
 
315
  - **Don't compare absolute barriers across subsets** without recomputing —
316
  the `barrier` field is stored only for the NEB (`mp20bat`) subset and
317
  is at the `uma-s-1p2` level, not DFT.
README.md CHANGED
@@ -26,7 +26,7 @@ tags:
26
  > Hub URL: <https://huggingface.co/datasets/SciLM/MaterialsSaddles>
27
  > Released by SciLM.ai: <https://www.scilm.ai>
28
 
29
- **33,877,259 unique, fully converged transition states** computed by
30
  massively-parallel saddle searches on top of public materials and catalysis
31
  datasets, using the [SaddleMill](https://github.com/SciLM-ai/SaddleMill)
32
  package and Meta's [`uma-s-1p2`](https://github.com/facebookresearch/fairchem)
@@ -39,10 +39,9 @@ saddles to 0.05 eV/Å. Every row stores its `uma-s-1p2` **energy and forces**,
39
  and each saddle row also stores its **eigenmode** — an `(N, 3)` per-atom
40
  displacement field giving the direction along which the saddle is unstable.
41
 
42
- **Version 2** (this version) removes duplicate transition states and ships the
43
- data already split into `train/`, `val/` and `test/` directories, with **no
44
- chemical system (element set) shared between the three splits**. See
45
- [What changed in v2](#what-changed-in-v2).
46
 
47
  ---
48
 
@@ -50,8 +49,7 @@ chemical system (element set) shared between the three splits**. See
50
 
51
  | | |
52
  |---|---|
53
- | Transition states (unique) | **33,877,259** |
54
- | Duplicates removed from v1 | 258,338 (0.76 %) |
55
  | Files (`.aselmdb`) | 685 (at most 50,000 transition states each) |
56
  | Rows per TS | 3 (reactant, saddle, product), in order |
57
  | Split | train / val / test ≈ 90 / 5 / 5, disjoint in chemical system |
@@ -65,40 +63,11 @@ chemical system (element set) shared between the three splits**. See
65
 
66
  | Subset | Source | Method | # transition states | train | val | test | Files |
67
  |-----------|---------------------------------------------|--------|--------------------:|-----------:|----------:|----------:|------:|
68
- | `lemat/` | LeMat-Bulk | Dimer | 31,322,917 | 28,223,516 | 1,533,392 | 1,566,009 | 628 |
69
  | `oc20/` | Open Catalyst 2020 (OC20) | Dimer | 2,367,718 | 2,133,114 | 123,751 | 110,853 | 49 |
70
  | `oc22/` | Open Catalyst 2022 (OC22) | Dimer | 152,593 | 139,175 | 6,557 | 6,861 | 5 |
71
  | `mp20bat/`| Materials Project battery structures | NEB-CI | 34,031 | 31,046 | 1,454 | 1,531 | 3 |
72
- | **Total** | | | **33,877,259** | **30,526,851** | **1,665,154** | **1,685,254** | **685** |
73
-
74
- ---
75
-
76
- ## What changed in v2
77
-
78
- 1. **Duplicates removed.** A transition state is a duplicate of another when
79
- they have the same composition and lattice and the saddle, the reactant and
80
- the product all agree to within 0.2 Å max-atom distance (reactant and product
81
- compared in either orientation). One representative per group is kept (the
82
- lowest `ms_id`); 258,338 triplets were removed — 23,502 from `lemat`
83
- (0.07 %), 219,383 from `oc20` (8.48 %), 14,742 from `oc22` (8.81 %) and 711
84
- from `mp20bat` (2.05 %). See [Deduplication](#deduplication).
85
- 2. **New split, disjoint in chemical system.** The v1 split was a random
86
- 90 / 5 / 5 split of triplets; 94–100 % of its test triplets had a chemical
87
- system also present in train, and 60–100 % had the exact same reduced
88
- formula. In v2 every chemical system is assigned as a whole to one split,
89
- globally across all four subsets. See [Train / val / test](#train--val--test).
90
- 3. **The split is physical.** Each subset directory holds `train/`, `val/` and
91
- `test/` subdirectories; no manifest lookup is needed to select a split.
92
- (v1's `splits/*.parquet` manifests are removed.)
93
- 4. **Files are in `ms_id` order.** Within each split directory, files and the
94
- rows inside them follow ascending `ms_id`; the three rows of a triplet are
95
- adjacent. File names are `<subset>_<split>_<NNNN>.aselmdb`.
96
- 5. **Rows are unchanged.** Every row is copied byte-for-byte from v1 (same
97
- geometry, energy, forces, `info`, and `ms_id`); only which rows are present
98
- and in which file changed. `ms_id`s of removed triplets are simply absent, so
99
- `ms_id` is no longer contiguous.
100
-
101
- v1 remains available in the repository's commit history.
102
 
103
  ---
104
 
@@ -145,15 +114,17 @@ jupyter notebook example.ipynb
145
  │ ├── train/ mp20bat_train_0000.aselmdb
146
  │ ├── val/ mp20bat_val_0000.aselmdb
147
  │ └── test/ mp20bat_test_0000.aselmdb
148
- ├── metadata/
149
- │ ├── triplets.parquet (one row per transition state: ms_id → file, row, split, chemistry, source)
150
- │ └── removed_duplicates.parquet (one row per removed triplet → the triplet kept in its place)
151
- └── scripts/
152
- └── dedup/ (the exact scripts that produced v2, with a README)
153
  ```
154
 
155
- Every file holds at most 50,000 transition states (150,000 rows); all but the
156
- last file of each split directory hold exactly 50,000.
 
 
 
 
 
157
 
158
  ---
159
 
@@ -204,7 +175,7 @@ target subset.
204
  | `is_ads_reaction`, `n_ads_*`, `ads_*_bonds` | dimer rows | adsorbate-restricted bond changes |
205
  | `parent_ts_index` | dimer endpoints | upstream SaddleMill identifier of the parent saddle (an internal pointer; the saddle in the same triplet is the immediately adjacent row in this `.aselmdb` file) |
206
  | `src_index` | all rows | SaddleMill internal ID (file-local in the production run) |
207
- | `ms_id` | all rows | global row identifier across the **entire dataset**, unchanged from v1 (0..102,406,790; the ids of removed duplicates are absent). Triplets occupy three consecutive `ms_id`s: `3k` (reactant), `3k+1` (saddle), `3k+2` (product). |
208
  | `task_name` | all rows | UMA task head used during the saddle search and for the stored energy/forces: `"omat"` for `lemat` and `mp20bat`, `"oc20"` for `oc20`, `"oc22"` for `oc22`. |
209
  | `status` | all rows | SaddleMill run status (always a `converged*` value here) |
210
  | `orig_info` | all rows | nested dict; carries the **source-dataset identifiers** (see below) |
@@ -360,39 +331,6 @@ The split lives in the directory layout: `<subset>/train/`, `<subset>/val/`,
360
  [Quick stats](#breakdown-by-source-dataset)); they deviate slightly because
361
  whole chemical systems are assigned together.
362
 
363
- For comparison, the v1 random split had 94–100 % of test transition states in
364
- a chemical system that also occurs in training, and 60–100 % with the exact
365
- same reduced formula.
366
-
367
- ---
368
-
369
- ## Deduplication
370
-
371
- Two transition states are duplicates when all of the following hold:
372
-
373
- - identical composition (same atoms, same counts);
374
- - the same lattice: cell lengths within 2 %, angles within 1°, and every
375
- cell-matrix entry within 2 % of the longest cell vector;
376
- - saddle max-atom distance < 0.2 Å;
377
- - reactant and product both < 0.2 Å max-atom distance, in the same or in the
378
- swapped (reactant ↔ product) orientation.
379
-
380
- The max-atom distance is the largest displacement of any atom after an optimal
381
- per-species atom matching (Hungarian assignment) under the minimum-image
382
- convention, with fractional coordinates mapped into the mean of the two cells.
383
- Candidates are compared across all four subsets. Within each composition,
384
- transition states are processed in `ms_id` order and each joins the first
385
- earlier kept transition state it duplicates (leader clustering); the kept
386
- representative of every group is its lowest `ms_id`.
387
-
388
- Audits of the result: all 2,992 removed triplets re-checked with an
389
- independent implementation match their representative; in 2,000 kept triplets
390
- compared against *every* transition state of the same composition, no missed
391
- duplicate was found. No duplicate group spans two subsets.
392
-
393
- [`metadata/removed_duplicates.parquet`](#metadata) lists every removed
394
- triplet and the triplet kept in its place, so v1 results can be mapped to v2.
395
-
396
  ---
397
 
398
  ## Metadata
@@ -410,21 +348,6 @@ sorted by `saddle_ms_id`:
410
  | `reduced_formula` | composition divided by its greatest common divisor |
411
  | `source_id` | upstream identifier: LeMat-Bulk `immutable_id`; OC20 `source_file`; OC22 `sid`; Materials Project `charge_id|discharge_id|working_ion` |
412
 
413
- `metadata/removed_duplicates.parquet` — one row per removed triplet:
414
- `removed_saddle_ms_id`, `removed_subset`, `kept_saddle_ms_id`, `kept_subset`.
415
-
416
- ---
417
-
418
- ## Reproducing v2
419
-
420
- [`scripts/dedup/`](./scripts/dedup/) contains the exact scripts, run in the
421
- order given in its README: duplicate detection (three passes), the split, the
422
- byte-for-byte rewrite of the v1 files into this layout, and the verification
423
- that every released row is identical to its v1 row, that each split directory
424
- holds exactly the transition states of its split, and that no removed
425
- duplicate is present. Paths inside the scripts are those of the original run
426
- and have to be adapted.
427
-
428
  ---
429
 
430
  ## How the data was produced
@@ -476,9 +399,6 @@ and forces of every row were then computed with a `uma-s-1p2` single point.
476
  guaranteed on every row. NEB-derived rows (e.g. `mp20bat`) have a
477
  different `info` schema than dimer rows (e.g. no `side`, but
478
  `image_type` / `image_idx` / `barrier` instead).
479
- - **Deduplication is geometric, at 0.2 Å.** Transition states closer than
480
- that in saddle *and* both endpoints are merged; pairs that share a saddle
481
- but connect different endpoints are distinct reactions and are kept.
482
 
483
  ---
484
 
@@ -488,7 +408,7 @@ If you use this dataset, please cite:
488
 
489
  ```bibtex
490
  @misc{materialssaddles2026,
491
- title = {{MaterialsSaddles}: [N] Million Transition States and a Flow-Matching
492
  Saddle-Point Predictor for Materials},
493
  author = {Baghishov, Ilgar and Jung, Sung Hoon and Henkelman, Graeme},
494
  year = {2026},
@@ -567,16 +487,6 @@ International (CC-BY-4.0)](https://creativecommons.org/licenses/by/4.0/).
567
  The upstream datasets retain their own licenses; consult them before any
568
  redistribution that combines this dataset with theirs.
569
 
570
- ## Changelog
571
-
572
- - **v2** — duplicates removed (258,338 triplets; 33,877,259 remain); new
573
- train / val / test split disjoint in chemical system, stored as
574
- `<subset>/{train,val,test}/` directories of files in `ms_id` order; every
575
- row carries `uma-s-1p2` energy and forces; `metadata/` tables and the
576
- reproduction scripts added. Row contents are byte-identical to v1.
577
- - **v1** — initial public release (34,135,597 transition states, random
578
- 90 / 5 / 5 split given as `ms_id` manifests).
579
-
580
  ## Contact
581
 
582
  Maintainers: Ilgar Baghishov (<baghishov@utexas.edu>) and Sung Hoon Jung
 
26
  > Hub URL: <https://huggingface.co/datasets/SciLM/MaterialsSaddles>
27
  > Released by SciLM.ai: <https://www.scilm.ai>
28
 
29
+ **33,877,257 fully converged transition states** computed by
30
  massively-parallel saddle searches on top of public materials and catalysis
31
  datasets, using the [SaddleMill](https://github.com/SciLM-ai/SaddleMill)
32
  package and Meta's [`uma-s-1p2`](https://github.com/facebookresearch/fairchem)
 
39
  and each saddle row also stores its **eigenmode** — an `(N, 3)` per-atom
40
  displacement field giving the direction along which the saddle is unstable.
41
 
42
+ The files are already divided into `train/`, `val/` and `test/` directories, with
43
+ **no chemical system (element set) shared between the three splits**. See
44
+ [Train / val / test](#train--val--test).
 
45
 
46
  ---
47
 
 
49
 
50
  | | |
51
  |---|---|
52
+ | Transition states | **33,877,257** |
 
53
  | Files (`.aselmdb`) | 685 (at most 50,000 transition states each) |
54
  | Rows per TS | 3 (reactant, saddle, product), in order |
55
  | Split | train / val / test ≈ 90 / 5 / 5, disjoint in chemical system |
 
63
 
64
  | Subset | Source | Method | # transition states | train | val | test | Files |
65
  |-----------|---------------------------------------------|--------|--------------------:|-----------:|----------:|----------:|------:|
66
+ | `lemat/` | LeMat-Bulk | Dimer | 31,322,915 | 28,223,514 | 1,533,392 | 1,566,009 | 628 |
67
  | `oc20/` | Open Catalyst 2020 (OC20) | Dimer | 2,367,718 | 2,133,114 | 123,751 | 110,853 | 49 |
68
  | `oc22/` | Open Catalyst 2022 (OC22) | Dimer | 152,593 | 139,175 | 6,557 | 6,861 | 5 |
69
  | `mp20bat/`| Materials Project battery structures | NEB-CI | 34,031 | 31,046 | 1,454 | 1,531 | 3 |
70
+ | **Total** | | | **33,877,257** | **30,526,849** | **1,665,154** | **1,685,254** | **685** |
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
71
 
72
  ---
73
 
 
114
  │ ├── train/ mp20bat_train_0000.aselmdb
115
  │ ├── val/ mp20bat_val_0000.aselmdb
116
  │ └── test/ mp20bat_test_0000.aselmdb
117
+ └── metadata/
118
+ └── triplets.parquet (one row per transition state: ms_id → file, row, split, chemistry, source)
 
 
 
119
  ```
120
 
121
+ Every file holds at most 50,000 transition states (150,000 rows). In each split
122
+ directory, every file but the last holds exactly 50,000. The exceptions are
123
+ `lemat/train/lemat_train_0213.aselmdb` and `lemat/train/lemat_train_0479.aselmdb`,
124
+ with 49,999 each.
125
+
126
+ Within each split directory, files and the rows inside them follow ascending
127
+ `ms_id`.
128
 
129
  ---
130
 
 
175
  | `is_ads_reaction`, `n_ads_*`, `ads_*_bonds` | dimer rows | adsorbate-restricted bond changes |
176
  | `parent_ts_index` | dimer endpoints | upstream SaddleMill identifier of the parent saddle (an internal pointer; the saddle in the same triplet is the immediately adjacent row in this `.aselmdb` file) |
177
  | `src_index` | all rows | SaddleMill internal ID (file-local in the production run) |
178
+ | `ms_id` | all rows | global row identifier across the **entire dataset** (0..102,406,790, with gaps). Triplets occupy three consecutive `ms_id`s: `3k` (reactant), `3k+1` (saddle), `3k+2` (product). |
179
  | `task_name` | all rows | UMA task head used during the saddle search and for the stored energy/forces: `"omat"` for `lemat` and `mp20bat`, `"oc20"` for `oc20`, `"oc22"` for `oc22`. |
180
  | `status` | all rows | SaddleMill run status (always a `converged*` value here) |
181
  | `orig_info` | all rows | nested dict; carries the **source-dataset identifiers** (see below) |
 
331
  [Quick stats](#breakdown-by-source-dataset)); they deviate slightly because
332
  whole chemical systems are assigned together.
333
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
334
  ---
335
 
336
  ## Metadata
 
348
  | `reduced_formula` | composition divided by its greatest common divisor |
349
  | `source_id` | upstream identifier: LeMat-Bulk `immutable_id`; OC20 `source_file`; OC22 `sid`; Materials Project `charge_id|discharge_id|working_ion` |
350
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
351
  ---
352
 
353
  ## How the data was produced
 
399
  guaranteed on every row. NEB-derived rows (e.g. `mp20bat`) have a
400
  different `info` schema than dimer rows (e.g. no `side`, but
401
  `image_type` / `image_idx` / `barrier` instead).
 
 
 
402
 
403
  ---
404
 
 
408
 
409
  ```bibtex
410
  @misc{materialssaddles2026,
411
+ title = {{MaterialsSaddles}: 33.9 Million Transition States and a Flow-Matching
412
  Saddle-Point Predictor for Materials},
413
  author = {Baghishov, Ilgar and Jung, Sung Hoon and Henkelman, Graeme},
414
  year = {2026},
 
487
  The upstream datasets retain their own licenses; consult them before any
488
  redistribution that combines this dataset with theirs.
489
 
 
 
 
 
 
 
 
 
 
 
490
  ## Contact
491
 
492
  Maintainers: Ilgar Baghishov (<baghishov@utexas.edu>) and Sung Hoon Jung
example.ipynb CHANGED
@@ -54,8 +54,10 @@
54
  "import os\n",
55
  "from pathlib import Path\n",
56
  "\n",
 
57
  "import numpy as np\n",
58
  "import matplotlib.pyplot as plt\n",
 
59
  "from ase.db import connect\n",
60
  "from ase.visualize.plot import plot_atoms\n",
61
  "from huggingface_hub import HfApi, hf_hub_download\n",
@@ -72,7 +74,20 @@
72
  " \"\"\"\n",
73
  " atoms = row.toatoms()\n",
74
  " atoms.info.update(row.data[\"info\"])\n",
75
- " return atoms\n"
 
 
 
 
 
 
 
 
 
 
 
 
 
76
  ]
77
  },
78
  {
@@ -119,9 +134,10 @@
119
  "metadata": {},
120
  "outputs": [],
121
  "source": [
122
- "dbs = {subset: connect(shard_paths[subset], type=\"aselmdb\") for subset in SHARD_FILES}\n",
123
  "for subset, db in dbs.items():\n",
124
- " print(f\" {subset:8s} file: {len(db):>7d} rows -> {len(db)//3:>6d} triplets\")\n"
 
125
  ]
126
  },
127
  {
@@ -167,6 +183,59 @@
167
  "print(f\"\\n saddle energy {row.energy:.4f} eV, max |F| {np.abs(row.forces).max():.4f} eV/A\")\n"
168
  ]
169
  },
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
170
  {
171
  "cell_type": "markdown",
172
  "id": "29e0a999",
@@ -289,4 +358,4 @@
289
  },
290
  "nbformat": 4,
291
  "nbformat_minor": 5
292
- }
 
54
  "import os\n",
55
  "from pathlib import Path\n",
56
  "\n",
57
+ "import fsspec\n",
58
  "import numpy as np\n",
59
  "import matplotlib.pyplot as plt\n",
60
+ "import pyarrow.parquet as pq\n",
61
  "from ase.db import connect\n",
62
  "from ase.visualize.plot import plot_atoms\n",
63
  "from huggingface_hub import HfApi, hf_hub_download\n",
 
74
  " \"\"\"\n",
75
  " atoms = row.toatoms()\n",
76
  " atoms.info.update(row.data[\"info\"])\n",
77
+ " return atoms\n",
78
+ "\n",
79
+ "_SHARDS = {}\n",
80
+ "\n",
81
+ "def open_shard(path):\n",
82
+ " \"\"\"\n",
83
+ " Open an .aselmdb file read-only, once per process. LMDB refuses a second open of\n",
84
+ " the same file, so the notebook cells share this one connection.\n",
85
+ " \"\"\"\n",
86
+ " path = os.path.realpath(path)\n",
87
+ " if path not in _SHARDS:\n",
88
+ " _SHARDS[path] = connect(path, type=\"aselmdb\", readonly=True)\n",
89
+ " return _SHARDS[path]\n",
90
+ ""
91
  ]
92
  },
93
  {
 
134
  "metadata": {},
135
  "outputs": [],
136
  "source": [
137
+ "dbs = {subset: open_shard(shard_paths[subset]) for subset in SHARD_FILES}\n",
138
  "for subset, db in dbs.items():\n",
139
+ " print(f\" {subset:8s} file: {len(db):>7d} rows -> {len(db)//3:>6d} triplets\")\n",
140
+ ""
141
  ]
142
  },
143
  {
 
183
  "print(f\"\\n saddle energy {row.energy:.4f} eV, max |F| {np.abs(row.forces).max():.4f} eV/A\")\n"
184
  ]
185
  },
186
+ {
187
+ "cell_type": "markdown",
188
+ "id": "9baae3af",
189
+ "metadata": {},
190
+ "source": [
191
+ "## Look up triplets by `ms_id`\n",
192
+ "\n",
193
+ "`lookup` returns the R, S and P `Atoms` of the requested triplets, keyed by saddle `ms_id`. It accepts the `ms_id` of any of the three rows, because R and P carry the saddle `ms_id` minus 1 and plus 1.\n",
194
+ "\n",
195
+ "The shard (`file`) and the row id of R (`reactant_row_id`) of each triplet are in `metadata/triplets.parquet`. `lookup` reads only these two columns and `saddle_ms_id` from Hugging Face, without a download of the whole 713 MB file. The file is sorted by `saddle_ms_id` in 33 row groups (blocks of about one million triplets), so the filter reads only the groups that can hold the requested ids, at most 119 MB. `lookup` downloads a shard that holds a requested triplet once into `DATA_DIR` (median 1.3 GB, at most 1.6 GB).\n",
196
+ "\n",
197
+ "With a local copy of the dataset, pass the local path of `triplets.parquet` as `triplets` and set `DATA_DIR` to the dataset root. An `ms_id` that is not in the dataset is absent from the result."
198
+ ]
199
+ },
200
+ {
201
+ "cell_type": "code",
202
+ "execution_count": null,
203
+ "id": "8ef5cf93",
204
+ "metadata": {},
205
+ "outputs": [],
206
+ "source": [
207
+ "def lookup(ms_ids, triplets=f\"hf://datasets/{REPO}@{REVISION}/metadata/triplets.parquet\"):\n",
208
+ " \"\"\"\n",
209
+ " Return {saddle ms_id: [R, S, P]} for the R, S or P ms_ids given.\n",
210
+ " `triplets` is the hf:// URL or a local path of metadata/triplets.parquet.\n",
211
+ " \"\"\"\n",
212
+ " saddle_ids = sorted({3 * (int(m) // 3) + 1 for m in ms_ids})\n",
213
+ " fs, path = fsspec.core.url_to_fs(triplets)\n",
214
+ " table = pq.read_table(path, filesystem=fs, columns=[\"saddle_ms_id\", \"file\", \"reactant_row_id\"],\n",
215
+ " filters=[(\"saddle_ms_id\", \"in\", saddle_ids)])\n",
216
+ " out = {}\n",
217
+ " for rec in table.to_pylist():\n",
218
+ " local = DATA_DIR / rec[\"file\"]\n",
219
+ " if not local.exists():\n",
220
+ " hf_hub_download(repo_id=REPO, repo_type=\"dataset\", revision=REVISION,\n",
221
+ " filename=rec[\"file\"], local_dir=str(DATA_DIR))\n",
222
+ " db = open_shard(local)\n",
223
+ " rows = [db.get(id=rec[\"reactant_row_id\"] + i) for i in range(3)]\n",
224
+ " out[rec[\"saddle_ms_id\"]] = [row_to_atoms(row) for row in rows]\n",
225
+ " return out\n",
226
+ "\n",
227
+ "# One id per subset from the test shards above, so no new shard is downloaded:\n",
228
+ "# a lemat S id, an oc20 R id, an oc22 P id and an mp20bat S id.\n",
229
+ "# 888577 is not in the dataset.\n",
230
+ "ids = [93563983, 101395944, 102040922, 102353293, 888577]\n",
231
+ "triplets = lookup(ids)\n",
232
+ "for s, (R, S, P) in triplets.items():\n",
233
+ " print(f\" saddle {s:>9} {S.get_chemical_formula():<18} ms_id (R, S, P) = \"\n",
234
+ " f\"({R.info['ms_id']}, {S.info['ms_id']}, {P.info['ms_id']}) \"\n",
235
+ " f\"E_S - E_R = {S.get_potential_energy() - R.get_potential_energy():.3f} eV\")\n",
236
+ "print(\" not found:\", sorted({3 * (m // 3) + 1 for m in ids} - set(triplets)))"
237
+ ]
238
+ },
239
  {
240
  "cell_type": "markdown",
241
  "id": "29e0a999",
 
358
  },
359
  "nbformat": 4,
360
  "nbformat_minor": 5
361
+ }
lemat/train/lemat_train_0213.aselmdb CHANGED
@@ -1,3 +1,3 @@
1
  version https://git-lfs.github.com/spec/v1
2
- oid sha256:a9f7ec598ae231458601702e60d940b4060adeead9326b4a31ebd73aed149064
3
- size 1303150592
 
1
  version https://git-lfs.github.com/spec/v1
2
+ oid sha256:f3efbbcb5e53908396420e3a90365854686167bcd6963b9b031e18a4f3f0813f
3
+ size 1233076224
lemat/train/lemat_train_0479.aselmdb CHANGED
@@ -1,3 +1,3 @@
1
  version https://git-lfs.github.com/spec/v1
2
- oid sha256:e4f6a1531b0577d0e8d305925566a3a245b77763ba209d884ae7246b4e80c785
3
- size 1286668288
 
1
  version https://git-lfs.github.com/spec/v1
2
+ oid sha256:d62a9ad5d0b9d76a0df38070a8f748d936b4794eefe9203b36ff2a68cac91fa4
3
+ size 1212084224
metadata/removed_duplicates.parquet CHANGED
@@ -1,3 +1,3 @@
1
  version https://git-lfs.github.com/spec/v1
2
- oid sha256:286158fee67642a7c7ec2c603e817b11ef61f95fea33e729853672438abaadcb
3
- size 1697477
 
1
  version https://git-lfs.github.com/spec/v1
2
+ oid sha256:b2351b305b4c4049cff9ecec1430537a9e5d63a89772e8863691eeb433c26fd2
3
+ size 1698605
metadata/triplets.parquet CHANGED
@@ -1,3 +1,3 @@
1
  version https://git-lfs.github.com/spec/v1
2
- oid sha256:fb554866d7ebd803f0fdb447e8dd080ea861edced51ff7f19c5b38df582b7a28
3
- size 712945644
 
1
  version https://git-lfs.github.com/spec/v1
2
+ oid sha256:5e7d7d08be79fa49d07552aee6dca50d803ca3af5f39768efe7f6b552523d3d3
3
+ size 712979888
scripts/dedup/README.md CHANGED
@@ -1,6 +1,8 @@
1
  # How MaterialsSaddles v2 was produced from v1
2
 
3
- These are the exact scripts that were run. Absolute paths inside them are those of the original run
 
 
4
  (`ROOT` = the v1 files, `OUT` = a work directory) and must be adapted. Dependencies: `numpy`, `scipy`,
5
  `pyarrow`, `ase`, `ase_db_backends`, `lmdb`, `huggingface_hub`; `fairchem-core` only for one check in
6
  `v2_verify.py`.
@@ -40,11 +42,18 @@ These are the exact scripts that were run. Absolute paths inside them are those
40
  7. `v2_write.py` — writes `<subset>/<split>/<subset>_<split>_<NNNN>.aselmdb`, at most 50,000 triplets per
41
  file, in ascending `ms_id` order. Rows are not re-serialised: the stored (compressed JSON) value of each
42
  row is copied unchanged under the new ASE row id, and `nextid` is written as `ase_db_backends` does.
 
 
 
43
  8. `v2_verify.py` — reads every row of every output file and checks: keys `1..N` + `nextid`; complete,
44
  adjacent R, S, P triplets in ascending `ms_id` order; every stored value byte-identical to the v1 row
45
- with the same `ms_id`; files of a split named consecutively, in `ms_id` order, all but the last full;
46
- each split directory holds exactly the `ms_id`s of its split; the union is exactly the kept set; no
47
- removed triplet present. It also compares a random sample of rows read through `ase.db` against the v1
 
 
48
  rows and opens files with fairchem's `AseDBDataset`.
49
  9. `v2_metadata.py` — builds `metadata/triplets.parquet` and `metadata/removed_duplicates.parquet` from
50
  what `v2_verify.py` observed in the written files (refuses to run if verification failed).
 
 
 
1
  # How MaterialsSaddles v2 was produced from v1
2
 
3
+ These are the scripts that were run, with one change. We removed the 2 broken triplets of step 7 in a separate
4
+ step after the write. Here, steps 7 to 9 do this removal. The scripts write the same rows and tables as the
5
+ release. Absolute paths inside them are those of the original run
6
  (`ROOT` = the v1 files, `OUT` = a work directory) and must be adapted. Dependencies: `numpy`, `scipy`,
7
  `pyarrow`, `ase`, `ase_db_backends`, `lmdb`, `huggingface_hub`; `fairchem-core` only for one check in
8
  `v2_verify.py`.
 
42
  7. `v2_write.py` — writes `<subset>/<split>/<subset>_<split>_<NNNN>.aselmdb`, at most 50,000 triplets per
43
  file, in ascending `ms_id` order. Rows are not re-serialised: the stored (compressed JSON) value of each
44
  row is copied unchanged under the new ASE row id, and `nextid` is written as `ase_db_backends` does.
45
+ `v2_write.py` cuts the files on the full split lists. Then it skips the 2 broken triplets (saddle `ms_id`
46
+ 35584423 and 79800988, forces at the saddle above 100 million eV/Å). As a result, `lemat_train_0213` and
47
+ `lemat_train_0479` hold 49,999 triplets each. The other files do not change.
48
  8. `v2_verify.py` — reads every row of every output file and checks: keys `1..N` + `nextid`; complete,
49
  adjacent R, S, P triplets in ascending `ms_id` order; every stored value byte-identical to the v1 row
50
+ with the same `ms_id`; files of a split named consecutively, in `ms_id` order, all but the last full
51
+ (except `lemat_train_0213` and `lemat_train_0479`, each one broken triplet short);
52
+ each split directory holds exactly the `ms_id`s of its split, less the 2 broken triplets; the union is
53
+ exactly the kept set, less the 2 broken triplets; no removed or broken triplet present. It also compares a
54
+ random sample of rows read through `ase.db` against the v1
55
  rows and opens files with fairchem's `AseDBDataset`.
56
  9. `v2_metadata.py` — builds `metadata/triplets.parquet` and `metadata/removed_duplicates.parquet` from
57
  what `v2_verify.py` observed in the written files (refuses to run if verification failed).
58
+ `removed_duplicates.parquet` lists each removed duplicate with its kept triplet (`reason` = `duplicate`)
59
+ and the 2 broken triplets with no kept triplet (`reason` = `broken`).
scripts/dedup/v2_claims.py CHANGED
@@ -16,7 +16,7 @@ print("split totals", {k: int((spl == k).sum()) for k in ("train", "val", "test"
16
  fold = defaultdict(set); fofold = defaultdict(set)
17
  for c_, f_, k_ in zip(cs, fo, spl): fold[c_].add(k_); fofold[f_].add(k_)
18
  print("chemical systems", len(fold), "in >1 split:", sum(len(v) > 1 for v in fold.values()), "| formulas in >1 split:", sum(len(v) > 1 for v in fofold.values()))
19
- R = pq.read_table(f"{out}/metadata/removed_duplicates.parquet").to_pydict()
20
  rs = np.array(R["removed_subset"]); print("removed", len(rs), {s: int((rs == s).sum()) for s in ["lemat", "oc20", "oc22", "mp20bat"]},
21
  "cross-subset", int((rs != np.array(R["kept_subset"])).sum()))
22
  print("removed ids in release:", int(np.isin(R["removed_saddle_ms_id"], T["saddle_ms_id"]).sum()), " kept ids all in release:", bool(np.isin(R["kept_saddle_ms_id"], T["saddle_ms_id"]).all()))
 
16
  fold = defaultdict(set); fofold = defaultdict(set)
17
  for c_, f_, k_ in zip(cs, fo, spl): fold[c_].add(k_); fofold[f_].add(k_)
18
  print("chemical systems", len(fold), "in >1 split:", sum(len(v) > 1 for v in fold.values()), "| formulas in >1 split:", sum(len(v) > 1 for v in fofold.values()))
19
+ R = pq.read_table(f"{out}/metadata/removed_duplicates.parquet", filters=[("reason", "==", "duplicate")]).to_pydict() # broken rows: no kept triplet
20
  rs = np.array(R["removed_subset"]); print("removed", len(rs), {s: int((rs == s).sum()) for s in ["lemat", "oc20", "oc22", "mp20bat"]},
21
  "cross-subset", int((rs != np.array(R["kept_subset"])).sum()))
22
  print("removed ids in release:", int(np.isin(R["removed_saddle_ms_id"], T["saddle_ms_id"]).sum()), " kept ids all in release:", bool(np.isin(R["kept_saddle_ms_id"], T["saddle_ms_id"]).all()))
scripts/dedup/v2_metadata.py CHANGED
@@ -3,13 +3,15 @@
3
  metadata/triplets.parquet one row per released triplet, sorted by saddle_ms_id:
4
  saddle_ms_id, subset, split, file, reactant_row_id (ASE id of the reactant row in `file`; saddle = +1,
5
  product = +2), chemical_system, reduced_formula, source_id
6
- metadata/removed_duplicates.parquet one row per removed triplet:
7
- removed_saddle_ms_id, removed_subset, kept_saddle_ms_id, kept_subset
 
8
  usage: v2_metadata.py <observed.npz> <meta_dir> <duplicates.parquet> <out_root>
9
  """
10
  import glob, os, sys
11
  import numpy as np, pyarrow as pa, pyarrow.parquet as pq
12
  obs, meta_dir, dup_file, out = sys.argv[1:5]; SUBS = ["lemat", "mp20bat", "oc20", "oc22"]
 
13
  O = np.load(obs); assert bool(O["passed"]), "verification did not pass - refusing to build metadata"
14
  files, n, ms = O["shard"], O["n"], O["ms"]
15
  fi = np.repeat(np.arange(len(files)), n); row = np.concatenate([np.arange(1, k + 1) for k in n])
@@ -29,9 +31,13 @@ assert (np.array([SUBS[x] for x in msub[p][t]]) == parts[s_fi[t], 0]).all(), "su
29
  os.makedirs(f"{out}/metadata", exist_ok=True)
30
  pq.write_table(tab, f"{out}/metadata/triplets.parquet", compression="zstd")
31
  D = pq.read_table(dup_file); dms = np.asarray(D.column(0)); drep = np.asarray(D.column(1)); r = dms != drep
32
- pd_ = np.searchsorted(mms, dms[r]); pk = np.searchsorted(mms, drep[r])
33
- pq.write_table(pa.table({"removed_saddle_ms_id": pa.array(dms[r], pa.int64()), "removed_subset": pa.array([SUBS[x] for x in msub[pd_]]),
34
- "kept_saddle_ms_id": pa.array(drep[r], pa.int64()), "kept_subset": pa.array([SUBS[x] for x in msub[pk]])}),
35
- f"{out}/metadata/removed_duplicates.parquet", compression="zstd")
36
- assert not np.isin(dms[r], s_ms).any() and np.isin(drep[r], s_ms).all(), "removed/kept inconsistent with the files"
37
- print(f"triplets.parquet: {tab.num_rows} rows; removed_duplicates.parquet: {int(r.sum())} rows")
 
 
 
 
 
3
  metadata/triplets.parquet one row per released triplet, sorted by saddle_ms_id:
4
  saddle_ms_id, subset, split, file, reactant_row_id (ASE id of the reactant row in `file`; saddle = +1,
5
  product = +2), chemical_system, reduced_formula, source_id
6
+ metadata/removed_duplicates.parquet one row per removed triplet, sorted by removed_saddle_ms_id:
7
+ removed_saddle_ms_id, removed_subset, kept_saddle_ms_id, kept_subset, reason ("duplicate", or "broken" for
8
+ the BROKEN triplets that v2_write.py leaves out, with null kept_saddle_ms_id and kept_subset)
9
  usage: v2_metadata.py <observed.npz> <meta_dir> <duplicates.parquet> <out_root>
10
  """
11
  import glob, os, sys
12
  import numpy as np, pyarrow as pa, pyarrow.parquet as pq
13
  obs, meta_dir, dup_file, out = sys.argv[1:5]; SUBS = ["lemat", "mp20bat", "oc20", "oc22"]
14
+ BROKEN = [35584423, 79800988] # saddle ms_ids of the 2 broken triplets that v2_write.py leaves out
15
  O = np.load(obs); assert bool(O["passed"]), "verification did not pass - refusing to build metadata"
16
  files, n, ms = O["shard"], O["n"], O["ms"]
17
  fi = np.repeat(np.arange(len(files)), n); row = np.concatenate([np.arange(1, k + 1) for k in n])
 
31
  os.makedirs(f"{out}/metadata", exist_ok=True)
32
  pq.write_table(tab, f"{out}/metadata/triplets.parquet", compression="zstd")
33
  D = pq.read_table(dup_file); dms = np.asarray(D.column(0)); drep = np.asarray(D.column(1)); r = dms != drep
34
+ pd_ = np.searchsorted(mms, dms[r]); pk = np.searchsorted(mms, drep[r]); pb = np.searchsorted(mms, BROKEN)
35
+ dup = pa.table({"removed_saddle_ms_id": pa.array(dms[r], pa.int64()), "removed_subset": pa.array([SUBS[x] for x in msub[pd_]]),
36
+ "kept_saddle_ms_id": pa.array(drep[r], pa.int64()), "kept_subset": pa.array([SUBS[x] for x in msub[pk]]),
37
+ "reason": pa.array(["duplicate"] * int(r.sum()), pa.string())})
38
+ brk = pa.table({"removed_saddle_ms_id": pa.array(BROKEN, pa.int64()), "removed_subset": pa.array([SUBS[x] for x in msub[pb]]),
39
+ "kept_saddle_ms_id": pa.array([None] * len(BROKEN), pa.int64()), "kept_subset": pa.array([None] * len(BROKEN), pa.string()),
40
+ "reason": pa.array(["broken"] * len(BROKEN), pa.string())})
41
+ pq.write_table(pa.concat_tables([dup, brk]).sort_by("removed_saddle_ms_id"), f"{out}/metadata/removed_duplicates.parquet", compression="zstd")
42
+ assert not np.isin(dms[r], s_ms).any() and np.isin(drep[r], s_ms).all() and not np.isin(BROKEN, s_ms).any(), "removed/kept inconsistent with the files"
43
+ print(f"triplets.parquet: {tab.num_rows} rows; removed_duplicates.parquet: {int(r.sum())} duplicate + {len(BROKEN)} broken rows")
scripts/dedup/v2_verify.py CHANGED
@@ -6,8 +6,10 @@ For EVERY output shard <out>/<subset>/<fold>/*.aselmdb:
6
  complete triplets (ms % 3 = 0, 1, 2 consecutive);
7
  * sha1 of every stored value equals the sha1 of the SciLM row with the same ms_id (byte-identical copy).
8
  Across shards:
9
- * every ms_id appears once; per subset/fold the ms_id set equals <split_dir>/<subset>/<fold>.parquet exactly;
10
- * the union equals the kept triplets of duplicates.parquet (representative == itself), no removed triplet appears.
 
 
11
  ASE-level spot check on a random sample: row read with ase.db equals the SciLM row read with ase.db
12
  (numbers, positions, cell, pbc, constraints, energy, forces, key_value_pairs, data), and every shard opens in
13
  fairchem's AseDBDataset.
@@ -21,6 +23,10 @@ from ase.io.jsonio import decode, encode
21
  out, src_root, idx_dir, split_dir, dup_file, meta_dir = sys.argv[1:7]
22
  per = int(sys.argv[7]) if len(sys.argv) > 7 else 50000; nw = int(sys.argv[8]) if len(sys.argv) > 8 else 48
23
  SUBS = sys.argv[9].split(",") if len(sys.argv) > 9 else ["lemat", "mp20bat", "oc20", "oc22"]; FOLDS = ["train", "val", "test"]
 
 
 
 
24
 
25
 
26
  def check_shard(path):
@@ -77,22 +83,24 @@ if __name__ == "__main__":
77
  ms = np.concatenate([res[p][0] for p in fs]) if fs else np.array([], np.int64)
78
  raw = np.concatenate([res[p][1] for p in fs]) if fs else np.array([], "S20")
79
  want = np.sort(np.asarray(pq.read_table(f"{split_dir}/{s}/{f}.parquet").column("ms_id")))
 
80
  same = np.array_equal(np.sort(ms), want)
81
  pos = np.searchsorted(ims, ms); okpos = (pos < len(ims)) & (ims[np.minimum(pos, len(ims) - 1)] == ms)
82
  bytes_ok = okpos.all() and bool((iraw[pos] == raw).all())
83
  # shards of a fold: named _0000.._NNNN, consecutive ms_id ranges in name order, all but the last full
 
84
  names_ok = [os.path.basename(p) for p in fs] == [f"{s}_{f}_{k:04d}.aselmdb" for k in range(len(fs))]
85
  order_ok = all(res[fs[k]][0][-1] < res[fs[k + 1]][0][0] for k in range(len(fs) - 1))
86
- full_ok = all(len(res[p][0]) == 3 * per for p in fs[:-1])
87
  print(f"{s}/{f}: {len(fs)} shards, {len(ms)//3} triplets; equals split file {same}; every row byte-identical to SciLM {bytes_ok}; "
88
  f"names consecutive {names_ok}, shards in ms_id order {order_ok}, all but last full {full_ok}", flush=True)
89
  tot_ok &= same and bytes_ok and names_ok and order_ok and full_ok; seen.append(ms)
90
  for p in fs: obs_file.append(os.path.relpath(p, out)); obs_n.append(len(res[p][0])); obs_ms.append(res[p][0])
91
  seen = np.concatenate(seen); sad = seen[seen % 3 == 1]
92
- kept = np.sort(np.array([m for m, r in zip(dms.tolist(), drep.tolist()) if m == r and ALL[sub_of[m]] == s], np.int64))
93
- rem = set(m for m, r in zip(dms.tolist(), drep.tolist()) if m != r and ALL[sub_of[m]] == s)
94
  u = len(np.unique(seen)) == len(seen); eqk = np.array_equal(np.sort(sad), kept); nrem = len(rem & set(sad.tolist()))
95
- print(f"{s}: every ms_id once {u}; saddles == kept set of duplicates.parquet {eqk} ({len(kept)}); removed triplets present {nrem}", flush=True)
96
  tot_ok &= u and eqk and nrem == 0
97
  # ASE-level spot check against the SciLM source
98
  from ase.db import connect
 
6
  complete triplets (ms % 3 = 0, 1, 2 consecutive);
7
  * sha1 of every stored value equals the sha1 of the SciLM row with the same ms_id (byte-identical copy).
8
  Across shards:
9
+ * every ms_id appears once; per subset/fold the ms_id set equals <split_dir>/<subset>/<fold>.parquet minus the
10
+ BROKEN triplets exactly;
11
+ * the union equals the kept triplets of duplicates.parquet (representative == itself) minus BROKEN, no removed or
12
+ BROKEN triplet appears.
13
  ASE-level spot check on a random sample: row read with ase.db equals the SciLM row read with ase.db
14
  (numbers, positions, cell, pbc, constraints, energy, forces, key_value_pairs, data), and every shard opens in
15
  fairchem's AseDBDataset.
 
23
  out, src_root, idx_dir, split_dir, dup_file, meta_dir = sys.argv[1:7]
24
  per = int(sys.argv[7]) if len(sys.argv) > 7 else 50000; nw = int(sys.argv[8]) if len(sys.argv) > 8 else 48
25
  SUBS = sys.argv[9].split(",") if len(sys.argv) > 9 else ["lemat", "mp20bat", "oc20", "oc22"]; FOLDS = ["train", "val", "test"]
26
+ # saddle ms_ids of the 2 broken triplets that v2_write.py leaves out, and the files that therefore hold fewer
27
+ # triplets (file name -> triplets left out)
28
+ BROKEN = [35584423, 79800988]
29
+ SHORT = {"lemat_train_0213.aselmdb": 1, "lemat_train_0479.aselmdb": 1}
30
 
31
 
32
  def check_shard(path):
 
83
  ms = np.concatenate([res[p][0] for p in fs]) if fs else np.array([], np.int64)
84
  raw = np.concatenate([res[p][1] for p in fs]) if fs else np.array([], "S20")
85
  want = np.sort(np.asarray(pq.read_table(f"{split_dir}/{s}/{f}.parquet").column("ms_id")))
86
+ want = want[~np.isin(want // 3, np.array(BROKEN) // 3)]
87
  same = np.array_equal(np.sort(ms), want)
88
  pos = np.searchsorted(ims, ms); okpos = (pos < len(ims)) & (ims[np.minimum(pos, len(ims) - 1)] == ms)
89
  bytes_ok = okpos.all() and bool((iraw[pos] == raw).all())
90
  # shards of a fold: named _0000.._NNNN, consecutive ms_id ranges in name order, all but the last full
91
+ # (a file in SHORT holds per minus its removed triplets)
92
  names_ok = [os.path.basename(p) for p in fs] == [f"{s}_{f}_{k:04d}.aselmdb" for k in range(len(fs))]
93
  order_ok = all(res[fs[k]][0][-1] < res[fs[k + 1]][0][0] for k in range(len(fs) - 1))
94
+ full_ok = all(len(res[p][0]) == 3 * (per - SHORT.get(os.path.basename(p), 0)) for p in fs[:-1])
95
  print(f"{s}/{f}: {len(fs)} shards, {len(ms)//3} triplets; equals split file {same}; every row byte-identical to SciLM {bytes_ok}; "
96
  f"names consecutive {names_ok}, shards in ms_id order {order_ok}, all but last full {full_ok}", flush=True)
97
  tot_ok &= same and bytes_ok and names_ok and order_ok and full_ok; seen.append(ms)
98
  for p in fs: obs_file.append(os.path.relpath(p, out)); obs_n.append(len(res[p][0])); obs_ms.append(res[p][0])
99
  seen = np.concatenate(seen); sad = seen[seen % 3 == 1]
100
+ kept = np.sort(np.array([m for m, r in zip(dms.tolist(), drep.tolist()) if m == r and m not in BROKEN and ALL[sub_of[m]] == s], np.int64))
101
+ rem = set(m for m, r in zip(dms.tolist(), drep.tolist()) if (m != r or m in BROKEN) and ALL[sub_of[m]] == s)
102
  u = len(np.unique(seen)) == len(seen); eqk = np.array_equal(np.sort(sad), kept); nrem = len(rem & set(sad.tolist()))
103
+ print(f"{s}: every ms_id once {u}; saddles == kept set of duplicates.parquet {eqk} ({len(kept)}); removed or broken triplets present {nrem}", flush=True)
104
  tot_ok &= u and eqk and nrem == 0
105
  # ASE-level spot check against the SciLM source
106
  from ase.db import connect
scripts/dedup/v2_write.py CHANGED
@@ -2,7 +2,9 @@
2
 
3
  Every kept triplet (fold from <split_dir>/<subset>/{train,val,test}.parquet) is written to
4
  <out>/<subset>/<fold>/<subset>_<fold>_<NNNN>.aselmdb
5
- in ascending ms_id order (R, S, P rows of a triplet adjacent), at most <per_shard> triplets per file. Rows are NOT
 
 
6
  re-serialised: the zlib-compressed JSON value stored in the SciLM shard is copied unchanged under a new LMDB key
7
  ("1".."3n"; the id is not part of the stored value), then "nextid" = 3n+1 is written exactly as ase_db_backends does.
8
  Each file is written as <name>.tmp and renamed only after its transaction committed.
@@ -17,6 +19,9 @@ FOLDS = ["train", "val", "test"]
17
  src_root, idx_dir, split_dir, out = sys.argv[1:5]
18
  per = int(sys.argv[5]) if len(sys.argv) > 5 else 50000; nw = int(sys.argv[6]) if len(sys.argv) > 6 else 48
19
  SUBS = sys.argv[7].split(",") if len(sys.argv) > 7 else ["lemat", "mp20bat", "oc20", "oc22"]
 
 
 
20
 
21
 
22
  def load_index(s):
@@ -41,6 +46,7 @@ def plan():
41
  n = (len(sad) + per - 1) // per
42
  for k in range(n):
43
  rows = pos[3 * k * per: 3 * (k + 1) * per]
 
44
  name = f"{s}/{f}/{s}_{f}_{k:04d}.aselmdb"
45
  jobs.append((name, [shards[i] for i in range(len(shards))], fi[rows], key[rows], ms[rows]))
46
  return jobs
 
2
 
3
  Every kept triplet (fold from <split_dir>/<subset>/{train,val,test}.parquet) is written to
4
  <out>/<subset>/<fold>/<subset>_<fold>_<NNNN>.aselmdb
5
+ in ascending ms_id order (R, S, P rows of a triplet adjacent), at most <per_shard> triplets per file. The files are
6
+ cut on the full split list, and then the BROKEN triplets are left out, so lemat_train_0213 and lemat_train_0479
7
+ hold per_shard - 1 triplets and the other files do not change. Rows are NOT
8
  re-serialised: the zlib-compressed JSON value stored in the SciLM shard is copied unchanged under a new LMDB key
9
  ("1".."3n"; the id is not part of the stored value), then "nextid" = 3n+1 is written exactly as ase_db_backends does.
10
  Each file is written as <name>.tmp and renamed only after its transaction committed.
 
19
  src_root, idx_dir, split_dir, out = sys.argv[1:5]
20
  per = int(sys.argv[5]) if len(sys.argv) > 5 else 50000; nw = int(sys.argv[6]) if len(sys.argv) > 6 else 48
21
  SUBS = sys.argv[7].split(",") if len(sys.argv) > 7 else ["lemat", "mp20bat", "oc20", "oc22"]
22
+ # saddle ms_ids of the 2 lemat triplets with broken forces (max |F| at the saddle 4.78e11 and 1.02e8 eV/A), found
23
+ # after the split was drawn. They stay in the split lists, so that the file cuts do not move, and are not written.
24
+ BROKEN = [35584423, 79800988]
25
 
26
 
27
  def load_index(s):
 
46
  n = (len(sad) + per - 1) // per
47
  for k in range(n):
48
  rows = pos[3 * k * per: 3 * (k + 1) * per]
49
+ rows = rows[~np.isin(ms[rows] // 3, np.array(BROKEN) // 3)] # leave out the 3 rows of a BROKEN triplet
50
  name = f"{s}/{f}/{s}_{f}_{k:04d}.aselmdb"
51
  jobs.append((name, [shards[i] for i in range(len(shards))], fi[rows], key[rows], ms[rows]))
52
  return jobs