File size: 13,152 Bytes
42eb8fd
9a34adb
 
 
83ee281
 
 
 
 
9a34adb
42eb8fd
83ee281
 
27f7350
 
 
9a34adb
27f7350
 
9a34adb
27f7350
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
---
language: 
- eng
pretty_name: "LiTraj"
tags:
- uMLIPs
- chemistry
- DFT
- GNN
- structure-to-property
license: "mit"
---

![toc](https://github.com/AIRI-Institute/LiTraj/raw/main/figures/toc.png)

### LiTraj: A Dataset for Benchmarking Machine Learning Models for Predicting Lithium Ion Migration

[![GitHub](https://img.shields.io/badge/-Github-181717?logo=github&logoColor=white)](https://github.com/AIRI-Institute/LiTraj)
[![Custom Badge Text](https://img.shields.io/badge/MACE_uMLIP_benchmark_example-Colab_Notebook-orange?logo=googlecolab&color=orange)](https://colab.research.google.com/drive/1vkF8doorp58hKE0a_W2kVOAMWHPGOjzd#sandboxMode=true&scrollTo=s1TnrzPzoyDb)
![License](https://img.shields.io/badge/License-MIT-darkred.svg)


This repository contains links to datasets for benchmarking machine learning models for predicting Li-ion migration, as described in our paper ["Benchmarking machine learning models for predicting lithium ion migration"](https://www.nature.com/articles/s41524-025-01571-z), along with the description of Python utilities for handling the datasets.


## Contents
- [About](#about)
- [Source links](#available-datasets-and-source-links)
- [Python tools](#installation)
- [Datasets in detail](#datasets-in-detail)
    - [nebDFT2k](#nebdft2k-dataset)
    - [MPLiTrj](#mplitrj-dataset)
    - [BVEL13k](#bvel13k-dataset)
    - [nebBVSE122k](#nebbvse122k-dataset)
- [Notebooks](#notebooks)
- [Citation](#how-to-cite)



## About

Modern electrochemical devices like Li-ion batteries require materials with fast ion transport. While traditional quantum chemistry methods for predicting ion mobility are computationally intensive, machine learning offers a faster alternative but depends on high-quality data. We introduce the LiTraj dataset, which provides 13,000 percolation barriers, 122,000 migration barriers, and 1,700 migration trajectories β€” key metrics for evaluating Li-ion mobility in crystals.

The datasets are calculated using density functional theory (DFT) and bond valence site energy (BVSE) methods. For the calculations, we used crystal structures collected from [the Materials Project database](https://next-gen.materialsproject.org/) (see [license](https://creativecommons.org/licenses/by/4.0/)). The data is stored in the extended .xyz format, which can be read by the [Atomistic Simulation Environment](https://wiki.fysik.dtu.dk/ase/) (ASE) Python library.


## Available datasets and source links

We provide training, validation, and test data splits for each dataset. See the [Python Tools](#python-tools) and [Datasets in Detail](#datasets-in-detail) sections to learn how to work with the datasets. 

<table style="font-size: 12px;">
  <tr>
    <th>Dataset</th>
    <th>Theory level</th>
    <th>Specs</th>
    <th>File</th>
    <th>Size</th>
  </tr>
  <tr>
    <td><a href="#nebdft2k-dataset">nebDFT2k</a></td>
    <td>DFT(PBE)</td>
    <td>target: migration barrier, geometry <br/> # of samples: 1,681</td>
    <td><a href="https://bs3u.obs.ru-moscow-1.hc.sbercloud.ru/litraj/nebDFT2k.zip">zip</a> (65 MB)</td>
    <td>0.7 GB</td>
  </tr>
  <tr>
    <td><a href="#nebdft2k-dataset">nebDFT2k_U</a></td>
    <td>DFT(PBE+U)</td>
    <td>target: migration barrier, geometry <br/> # of samples: in progress</td>
    <td>in progress</td>
    <td></td>
  </tr>
  <tr>
    <td><a href="#mplitrj-dataset">MPLiTrj</a></td>
    <td>DFT(PBE)</td>
    <td>target: energy, forces, stress tensor <br/> # of samples: 929,066</td>
    <td><a href="https://bs3u.obs.ru-moscow-1.hc.sbercloud.ru/litraj/MPLiTrj.zip">zip</a> (3.8 GB)</td>
    <td>16 GB</td>
  </tr>
  <tr>
    <td><a href="#mplitrj-dataset">MPLiTrj_subsample</a></td>
    <td>DFT(PBE)</td>
    <td>target: energy, forces, stress tensor <br/> # of samples: 118,024</td>
    <td><a href="https://bs3u.obs.ru-moscow-1.hc.sbercloud.ru/litraj/MPLiTrj_subsample.zip">zip</a> (0.5 GB)</td>
    <td>2.1 GB</td>
  </tr>
  <tr>
    <td><a href="#bvel13k-dataset">BVEL13k</a></td>
    <td>BVSE</td>
    <td>target: 1-3D percolation barrier <br/> # of samples: 12,807</td>
    <td><a href="https://bs3u.obs.ru-moscow-1.hc.sbercloud.ru/litraj/BVEL13k.zip">zip</a> (11 MB)</td>
    <td>35 MB</td>
  </tr>
  <tr>
    <td><a href="#nebbvse122k-dataset">nebBVSE122k</a></td>
    <td>BVSE</td>
    <td>target: migration barrier <br/> # of samples: 122,421</td>
    <td><a href="https://bs3u.obs.ru-moscow-1.hc.sbercloud.ru/litraj/nebBVSE122k.zip">zip</a> (0.2 GB)</td>
    <td>0.9 GB</td>
  </tr>
</table>


## Python tools
### Installation

```
pip install litraj
```

or

```python
git clone https://github.com/AIRI-Institute/LiTraj
cd LiTraj
pip install .
```
### Download a specific dataset
```python
from litraj.data import download_dataset
download_dataset('BVEL13k', '.', unzip = True) # save to the current directory and unzip
```

### Read the downloaded dataset 
```python
from litraj.data import load_data
train, val, text, index = load_data('BVEL13k', '.')

for atoms in train:
    mp_id =  atoms.info['material_id']
    e1d = atoms.info['E_1D']
    e2d = atoms.info['E_2D']
    e3d = atoms.info['E_3D']
    # do stuff
    pass
```

For more details see [Datasets basics](notebooks/datasets.ipynb) in the [notebooks](#notebooks)

## Datasets in detail
### nebDFT2k dataset

![benchmark](https://github.com/AIRI-Institute/LiTraj/raw/main/figures/benchmark.png)

The nebDFT2k dataset includes Li-ion migration trajectories and corresponding **migration barriers** for 1,681 vacancy hops between initial and final equilibrium sites. The trajectories are optimized using the climbing image nudged elastic band (NEB) method with DFT for force and energy calculations. Initial trajectories were generated via linear interpolation between start and end positions, followed by preconditioning using the BVSE-NEB method from the [ions](https://github.com/dembart/ions) library.


For benchmarking universal machine learning interatomic potentials (uMLIPs), the BVSE-NEB optimized initial trajectories serve as the starting point for uMLIP-NEB optimization. The resulting trajectories are compared to the DFT ground truth. See an [example](notebooks/nebDFT2k_benchmark_MACE_MP_small.ipynb) to learn how to benchmark the pre-trained [MACE_MP](https://github.com/ACEsuit/mace-mp) model.


As an input for graph neural network (GNN) models for structure-to-property prediction of Li-ion migration barriers, we use the supercells with a centroid, marked as 'X' chemical element, added between the starting and final positions of the migrating ion. 


**Structure of the nebDFT2k dataset**

    nebDFT2k/
    β”œβ”€β”€ nebDFT2k_index.csv              # Table with material_id, edge_id, chemsys, _split, .., columns
    β”œβ”€β”€ edge-id1_init.xyz               # Initial (BVSE-NEB optimized) trajectory file, edge_id1 = mp-id1_source_target_offsetx_offsety_offsetz
    β”œβ”€β”€ edge-id1_relaxed.xyz            # Final (DFT-NEB optimized) trajectory file 
    β”œβ”€β”€ ...
    └── nebDFT2k_centroids.xyz          # File with centroid supercells

**Usage example**

```python
from litraj.data import download_dataset, load_data

# download the dataset to the selected folder
download_dataset('nebDFT2k', 'path/to/save/data') 

# read the dataset from the folder
data = load_data('nebDFT2k', 'path/to/save/data') 

data_train = data[data._split == 'train']
for atoms in data_train.centroid:
    edge_id = atoms.info['edge_id']
    mp_id = atoms.info['material_id']
    em = atoms.info['em']
    # do stuff


for traj_init, traj_relaxed in zip(data.trajectory_init, data.trajectory_relaxed):
    # do stuff
    pass

```


### MPLiTrj dataset

The MPLiTrj dataset contains 929,066 configurations with calculated energies, forces and stress tensors obtained during the DFT-NEB optimization of 2,698 Li-ion migration pathways. Its subsample comprises 118,024 configurations. Each dataset has three .xyz files corresponding to the training, validation, and test data splits.

**Structure of the MPLiTrj dataset**

    MPLiTraj/
    β”œβ”€β”€ MPLiTrj_train.xyz               # Training file
    β”œβ”€β”€ MPLiTrj_val.xyz                 # Validation file
    └── MPLiTrj_test.xyz                # Test file 

**Usage example**

```python
from litraj.data import download_dataset, load_data

# download the dataset to the selected folder
download_dataset('MPLiTrj_subsample', 'path/to/save/data') 

train, val, test = load_data('MPLiTrj_subsample', 'path/to/save/data') 

structures, energies, forces, stresses = [], [], [], []
for atoms in train:
    structures.append(atoms)
    energies.append(atoms.calc.get_potential_energy())
    forces.append(atoms.calc.get_forces().tolist())
    stresses.append(atoms.calc.get_stress().tolist())
```

### BVEL13k dataset

![BVEL13k_stats_figure](https://github.com/AIRI-Institute/LiTraj/raw/main/figures/bvel.png)


The BVEL13k dataset contains Li-ion 1-3D percolation barriers calculated for 12,807 Li-containing ionic crystal structures. The percolation barriers are calculated using BVEL method as implemented in the [BVlain](https://github.com/dembart/BVlain) python package. There are 73 chemical elements (species), each structure contains at most 160 atoms and has a unit cell volume smaller than 1500 Γ…<sup>3</sup>. 


**Structure of the BVEL13k dataset**

    BVEL13k/
    β”œβ”€β”€ BVEL13k_index.csv                # Table with material_id, chemsys, _split, E_1D, E_2D, E_3D columns
    β”œβ”€β”€ BVEL13k_train.xyz                # Training file 
    β”œβ”€β”€ BVEL13k_val.xyz                  # Validation file 
    └── BVEL13k_test.xyz                 # Test file 

**Usage example**

```python
from litraj.data import download_dataset, load_data

# download the dataset to the selected folder
download_dataset('BVEL13k', 'path/to/save/data') 

# get train, val, test split of the dataset and the index dataframe
atoms_list_train, atoms_list_val, atoms_list_test, index = load_data('BVEL13k', 'path/to/save/data') 

# the data is stored in the Ase's Atoms object
for atoms in atoms_list_train: 

    mp_id = atoms.info['material_id']
    e1d = atoms.info['E_1D']
    e2d = atoms.info['E_2D']
    e3d = atoms.info['E_3D']
    # do stuff
```

### nebBVSE122k dataset
![nebBVSE_stats_figure](https://github.com/AIRI-Institute/LiTraj/raw/main/figures/bvse.png)
The nebBVSE122k dataset contains Li-ion migration barriers calculated for 122,421 Li-ion vacancy hops from its starting to final equilibrium positions. The migration barriers are calculated using the NEB method employing BVSE approach as implemented in the [ions](https://github.com/dembart/ions) python package. 

As an input for GNN models for structure-to-property prediction, we use the supercells with a centroid, marked as 'X' chemical element, added between the starting and final positions of the migrating ion. 

**Structure of the nebBVSE122k dataset**

    nebBVSE122k/
    β”œβ”€β”€ nebBVSE122k_index.csv            # Table with material_id, chemsys, _split, em columns
    β”œβ”€β”€ nebBVSE122k_train.xyz            # Training file 
    β”œβ”€β”€ nebBVSE122k_val.xyz              # Validation file 
    └── nebBVSE122k_test.xyz             # Test file 


**Usage example**

```python
from litraj.data import download_dataset, load_data

# download the dataset to the selected folder
download_dataset('nebBVSE122k', 'path/to/save/data') 

# get train, val, test split of the dataset and the index dataframe
atoms_list_train, atoms_list_val, atoms_list_test, index = load_data('nebBVSE122k', 'path/to/save/data')

for atoms_with_centroid in atoms_list_train:
    edge_id = atoms_with_centroid.info['edge_id']   # mp-id_source_target_offsetx_offsety_offsetz
    mp_id = atoms_with_centroid.info['material_id']
    em = atoms_with_centroid.info['em']
    centroid_index = np.argwhere(atoms_with_centroid.symbols =='X')
    # do stuff
```

### Notebooks

- [Datasets basics](https://github.com/AIRI-Institute/LiTraj/tree/main/notebooks/datasets.ipynb)
- [Benchmarking uMLIPs on nebDFT2k](notebooks/nebDFT2k_benchmark_MACE_MP_small.ipynb)
- [M3GNet training on centroids from nebDFT2k](https://github.com/AIRI-Institute/LiTraj/tree/main/notebooks/m3gnet_nebDFT2k_centroids.ipynb)
- [Allegro training on BVEL13k](https://github.com/AIRI-Institute/LiTraj/tree/main/notebooks/allegro_BVEL13k.ipynb)
- [BVEL calculations](https://github.com/AIRI-Institute/LiTraj/tree/main/notebooks/bvel.ipynb)
- [BVSE-NEB calculations](https://github.com/AIRI-Institute/LiTraj/tree/main/notebooks/bvse_neb.ipynb)
- [Featurizers](https://github.com/AIRI-Institute/LiTraj/tree/main/notebooks/featurizers.ipynb)



### How to cite
If you use the LiTraj dataset, please, consider citing our paper 

```
@article{dembitskiy2025benchmarking,
	title = {{Benchmarking machine learning models for predicting lithium ion migration}},
	author = {Dembitskiy, Artem D. and Humonen, Innokentiy S. and Eremin, Roman A. and Aksyonov, Dmitry A. and Fedotov, Stanislav S. and Budennyy, Semen A.},
	journal = {npj Comput. Mater.},
	volume = {11},
	number = {131},
	year = {2025},
	publisher = {Nature Publishing Group},
	doi = {10.1038/s41524-025-01571-z}
}
```