So3krates-torch 0.1__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- so3krates_torch-0.1/LICENSE.md +7 -0
- so3krates_torch-0.1/PKG-INFO +140 -0
- so3krates_torch-0.1/README.md +97 -0
- so3krates_torch-0.1/pyproject.toml +78 -0
- so3krates_torch-0.1/setup.cfg +4 -0
- so3krates_torch-0.1/src/So3krates_torch.egg-info/PKG-INFO +140 -0
- so3krates_torch-0.1/src/So3krates_torch.egg-info/SOURCES.txt +40 -0
- so3krates_torch-0.1/src/So3krates_torch.egg-info/dependency_links.txt +1 -0
- so3krates_torch-0.1/src/So3krates_torch.egg-info/entry_points.txt +5 -0
- so3krates_torch-0.1/src/So3krates_torch.egg-info/requires.txt +12 -0
- so3krates_torch-0.1/src/So3krates_torch.egg-info/top_level.txt +1 -0
- so3krates_torch-0.1/src/so3krates_torch/__init__.py +0 -0
- so3krates_torch-0.1/src/so3krates_torch/blocks/embedding.py +160 -0
- so3krates_torch-0.1/src/so3krates_torch/blocks/euclidean_transformer.py +509 -0
- so3krates_torch-0.1/src/so3krates_torch/blocks/output_block.py +272 -0
- so3krates_torch-0.1/src/so3krates_torch/blocks/physical_potentials.py +777 -0
- so3krates_torch-0.1/src/so3krates_torch/blocks/radial_basis.py +154 -0
- so3krates_torch-0.1/src/so3krates_torch/blocks/so3_conv_invariants.py +118 -0
- so3krates_torch-0.1/src/so3krates_torch/calculator/so3.py +463 -0
- so3krates_torch-0.1/src/so3krates_torch/cli/jax_to_torch.py +93 -0
- so3krates_torch-0.1/src/so3krates_torch/cli/run_eval.py +92 -0
- so3krates_torch-0.1/src/so3krates_torch/cli/run_metric.py +191 -0
- so3krates_torch-0.1/src/so3krates_torch/cli/run_train.py +0 -0
- so3krates_torch-0.1/src/so3krates_torch/cli/torch_to_jax.py +97 -0
- so3krates_torch-0.1/src/so3krates_torch/data/atomic_data.py +437 -0
- so3krates_torch-0.1/src/so3krates_torch/data/neighborhood.py +105 -0
- so3krates_torch-0.1/src/so3krates_torch/data/utils.py +201 -0
- so3krates_torch-0.1/src/so3krates_torch/modules/__init__.py +0 -0
- so3krates_torch-0.1/src/so3krates_torch/modules/cutoff.py +144 -0
- so3krates_torch-0.1/src/so3krates_torch/modules/loss.py +157 -0
- so3krates_torch-0.1/src/so3krates_torch/modules/models.py +602 -0
- so3krates_torch-0.1/src/so3krates_torch/modules/spherical_harmonics.py +94 -0
- so3krates_torch-0.1/src/so3krates_torch/pretrained/so3lr/so3lr.model +0 -0
- so3krates_torch-0.1/src/so3krates_torch/scripts/simple_md.py +134 -0
- so3krates_torch-0.1/src/so3krates_torch/scripts/transform_xyz_headers.py +28 -0
- so3krates_torch-0.1/src/so3krates_torch/tests/test_model.py +24 -0
- so3krates_torch-0.1/src/so3krates_torch/tools/compile.py +96 -0
- so3krates_torch-0.1/src/so3krates_torch/tools/eval.py +826 -0
- so3krates_torch-0.1/src/so3krates_torch/tools/jax_torch_conversion.py +1000 -0
- so3krates_torch-0.1/src/so3krates_torch/tools/scatter.py +115 -0
- so3krates_torch-0.1/src/so3krates_torch/tools/train.py +587 -0
- so3krates_torch-0.1/src/so3krates_torch/tools/utils.py +354 -0
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2022
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
|
6
|
+
|
|
7
|
+
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
|
|
@@ -0,0 +1,140 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: So3krates-torch
|
|
3
|
+
Version: 0.1
|
|
4
|
+
Summary: PyTorch implementation of So3krates neural network potential for atomistic simulations
|
|
5
|
+
Author-email: Tobias Henkes <tobias.henkes@uni.lu>
|
|
6
|
+
Maintainer-email: Tobias Henkes <tobias.henkes@uni.lu>
|
|
7
|
+
License: MIT
|
|
8
|
+
Project-URL: homepage, https://github.com/tohenkes/So3krates-torch
|
|
9
|
+
Project-URL: repository, https://github.com/tohenkes/So3krates-torch
|
|
10
|
+
Project-URL: documentation, https://github.com/tohenkes/So3krates-torch#readme
|
|
11
|
+
Project-URL: changelog, https://github.com/tohenkes/So3krates-torch/blob/main/CHANGELOG.md
|
|
12
|
+
Project-URL: issues, https://github.com/tohenkes/So3krates-torch/issues
|
|
13
|
+
Project-URL: Bug Reports, https://github.com/tohenkes/So3krates-torch/issues
|
|
14
|
+
Project-URL: Source Code, https://github.com/tohenkes/So3krates-torch
|
|
15
|
+
Keywords: machine-learning,molecular-dynamics,neural-networks,pytorch,atomistic-simulations,equivariant-networks,interatomic-potentials
|
|
16
|
+
Classifier: Development Status :: 3 - Alpha
|
|
17
|
+
Classifier: Intended Audience :: Science/Research
|
|
18
|
+
Classifier: License :: OSI Approved :: MIT License
|
|
19
|
+
Classifier: Programming Language :: Python :: 3
|
|
20
|
+
Classifier: Programming Language :: Python :: 3.10
|
|
21
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
22
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
23
|
+
Classifier: Topic :: Scientific/Engineering :: Chemistry
|
|
24
|
+
Classifier: Topic :: Scientific/Engineering :: Physics
|
|
25
|
+
Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
|
|
26
|
+
Classifier: Operating System :: POSIX :: Linux
|
|
27
|
+
Classifier: Environment :: GPU :: NVIDIA CUDA
|
|
28
|
+
Requires-Python: >=3.10
|
|
29
|
+
Description-Content-Type: text/markdown
|
|
30
|
+
License-File: LICENSE.md
|
|
31
|
+
Requires-Dist: ase>=3.26.0
|
|
32
|
+
Requires-Dist: h5py>=3.14.0
|
|
33
|
+
Requires-Dist: mace-torch>=0.3.14
|
|
34
|
+
Requires-Dist: numpy>=1.26.4
|
|
35
|
+
Requires-Dist: pyyaml>=6.0.2
|
|
36
|
+
Requires-Dist: torch>=2.8.0
|
|
37
|
+
Requires-Dist: torchvision>=0.23.0
|
|
38
|
+
Requires-Dist: torchaudio>=2.8.0
|
|
39
|
+
Provides-Extra: dev
|
|
40
|
+
Requires-Dist: pre-commit; extra == "dev"
|
|
41
|
+
Requires-Dist: pytest; extra == "dev"
|
|
42
|
+
Dynamic: license-file
|
|
43
|
+
|
|
44
|
+
# So3krates-torch
|
|
45
|
+
|
|
46
|
+
> [!IMPORTANT]
|
|
47
|
+
> The code is work in progress! There may be breaking changes!
|
|
48
|
+
|
|
49
|
+
Lightweight implementation of the So3krates model in pytorch. This package is mostly intended for [aims-PAX](https://github.com/tohenkes/aims-PAX) but is a functional implementation of [So3krates](https://github.com/thorben-frank/mlff) and [SO3LR](https://github.com/general-molecular-simulations/so3lr) in pytorch. For now it uses (modified) source code of the [MACE](https://github.com/ACEsuit/mace) package and follows its style, so many functions are actually compatible.
|
|
50
|
+
|
|
51
|
+
#### Installation
|
|
52
|
+
|
|
53
|
+
1. activate your environment
|
|
54
|
+
2. clone this repository
|
|
55
|
+
3. move to the clone repository
|
|
56
|
+
4. `pip install -r requirements.xt`
|
|
57
|
+
5. `pip install .`
|
|
58
|
+
|
|
59
|
+
#### Implemented features:
|
|
60
|
+
1. ASE calculator for MD (including pre-trained SO3LR)
|
|
61
|
+
2. Inference over ase readable datasets: `torchkrates-eval`
|
|
62
|
+
3. Error metrics over ase readable datasets: `torchkrates-test`
|
|
63
|
+
4. Transforming pyTorch and JAX parameter formates: `torchkrates-jax2torch` or `torchkrates-torch2jax`
|
|
64
|
+
5. Training is WIP but `train` in `tools.train` is already working so you can easily build your own script
|
|
65
|
+
|
|
66
|
+
|
|
67
|
+
> [!IMPORTANT]
|
|
68
|
+
> Number 4 means that you can transform the weights from this pytorch version into the JAX version and vice versa. Inference and training is much faster (*at least 1 order of magnitude*) in the JAX version. This implementation is mostly for prototyping and compatability with other packages.
|
|
69
|
+
|
|
70
|
+
|
|
71
|
+
|
|
72
|
+
## TODO
|
|
73
|
+
|
|
74
|
+
- [ ] training
|
|
75
|
+
- [x] hirshfeld loss
|
|
76
|
+
- [ ] load trainings params from yaml
|
|
77
|
+
- [ ] script
|
|
78
|
+
- [ ] finetuning
|
|
79
|
+
- [ ] save and load hyperparameter json from torchkrates
|
|
80
|
+
- [ ] enable torch.script (important for openmm)
|
|
81
|
+
|
|
82
|
+
|
|
83
|
+
## Cite
|
|
84
|
+
If you are using the models implemented here please cite:
|
|
85
|
+
|
|
86
|
+
```bibtex
|
|
87
|
+
@article{kabylda2024molecular,
|
|
88
|
+
title={Molecular Simulations with a Pretrained Neural Network and Universal Pairwise Force Fields},
|
|
89
|
+
author={Kabylda, A. and Frank, J. T. and Dou, S. S. and Khabibrakhmanov, A. and Sandonas, L. M.
|
|
90
|
+
and Unke, O. T. and Chmiela, S. and M{\"u}ller, K.R. and Tkatchenko, A.},
|
|
91
|
+
journal={ChemRxiv},
|
|
92
|
+
year={2024},
|
|
93
|
+
doi={10.26434/chemrxiv-2024-bdfr0-v2}
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
@article{frank2024euclidean,
|
|
97
|
+
title={A Euclidean transformer for fast and stable machine learned force fields},
|
|
98
|
+
author={Frank, Thorben and Unke, Oliver and M{\"u}ller, Klaus-Robert and Chmiela, Stefan},
|
|
99
|
+
journal={Nature Communications},
|
|
100
|
+
volume={15},
|
|
101
|
+
number={1},
|
|
102
|
+
pages={6539},
|
|
103
|
+
year={2024}
|
|
104
|
+
}
|
|
105
|
+
```
|
|
106
|
+
|
|
107
|
+
Also consider citing MACE, as this software heavlily leans on or uses its code:
|
|
108
|
+
|
|
109
|
+
|
|
110
|
+
```bibtex
|
|
111
|
+
@inproceedings{Batatia2022mace,
|
|
112
|
+
title={{MACE}: Higher Order Equivariant Message Passing Neural Networks for Fast and Accurate Force Fields},
|
|
113
|
+
author={Ilyes Batatia and David Peter Kovacs and Gregor N. C. Simm and Christoph Ortner and Gabor Csanyi},
|
|
114
|
+
booktitle={Advances in Neural Information Processing Systems},
|
|
115
|
+
editor={Alice H. Oh and Alekh Agarwal and Danielle Belgrave and Kyunghyun Cho},
|
|
116
|
+
year={2022},
|
|
117
|
+
url={https://openreview.net/forum?id=YPpSngE-ZU}
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
@misc{Batatia2022Design,
|
|
121
|
+
title = {The Design Space of E(3)-Equivariant Atom-Centered Interatomic Potentials},
|
|
122
|
+
author = {Batatia, Ilyes and Batzner, Simon and Kov{\'a}cs, D{\'a}vid P{\'e}ter and Musaelian, Albert and Simm, Gregor N. C. and Drautz, Ralf and Ortner, Christoph and Kozinsky, Boris and Cs{\'a}nyi, G{\'a}bor},
|
|
123
|
+
year = {2022},
|
|
124
|
+
number = {arXiv:2205.06643},
|
|
125
|
+
eprint = {2205.06643},
|
|
126
|
+
eprinttype = {arxiv},
|
|
127
|
+
doi = {10.48550/arXiv.2205.06643},
|
|
128
|
+
archiveprefix = {arXiv}
|
|
129
|
+
}
|
|
130
|
+
```
|
|
131
|
+
|
|
132
|
+
## Contact
|
|
133
|
+
|
|
134
|
+
If you have questions you can reach me at: tobias.henkes@uni.lu
|
|
135
|
+
|
|
136
|
+
For bugs or feature requests, please use [GitHub Issues](https://github.com/tohenkes/So3krates-torch/issues).
|
|
137
|
+
|
|
138
|
+
## License
|
|
139
|
+
|
|
140
|
+
The code is published and distributed under the [MIT License](MIT.md).
|
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
# So3krates-torch
|
|
2
|
+
|
|
3
|
+
> [!IMPORTANT]
|
|
4
|
+
> The code is work in progress! There may be breaking changes!
|
|
5
|
+
|
|
6
|
+
Lightweight implementation of the So3krates model in pytorch. This package is mostly intended for [aims-PAX](https://github.com/tohenkes/aims-PAX) but is a functional implementation of [So3krates](https://github.com/thorben-frank/mlff) and [SO3LR](https://github.com/general-molecular-simulations/so3lr) in pytorch. For now it uses (modified) source code of the [MACE](https://github.com/ACEsuit/mace) package and follows its style, so many functions are actually compatible.
|
|
7
|
+
|
|
8
|
+
#### Installation
|
|
9
|
+
|
|
10
|
+
1. activate your environment
|
|
11
|
+
2. clone this repository
|
|
12
|
+
3. move to the clone repository
|
|
13
|
+
4. `pip install -r requirements.xt`
|
|
14
|
+
5. `pip install .`
|
|
15
|
+
|
|
16
|
+
#### Implemented features:
|
|
17
|
+
1. ASE calculator for MD (including pre-trained SO3LR)
|
|
18
|
+
2. Inference over ase readable datasets: `torchkrates-eval`
|
|
19
|
+
3. Error metrics over ase readable datasets: `torchkrates-test`
|
|
20
|
+
4. Transforming pyTorch and JAX parameter formates: `torchkrates-jax2torch` or `torchkrates-torch2jax`
|
|
21
|
+
5. Training is WIP but `train` in `tools.train` is already working so you can easily build your own script
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
> [!IMPORTANT]
|
|
25
|
+
> Number 4 means that you can transform the weights from this pytorch version into the JAX version and vice versa. Inference and training is much faster (*at least 1 order of magnitude*) in the JAX version. This implementation is mostly for prototyping and compatability with other packages.
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
|
|
29
|
+
## TODO
|
|
30
|
+
|
|
31
|
+
- [ ] training
|
|
32
|
+
- [x] hirshfeld loss
|
|
33
|
+
- [ ] load trainings params from yaml
|
|
34
|
+
- [ ] script
|
|
35
|
+
- [ ] finetuning
|
|
36
|
+
- [ ] save and load hyperparameter json from torchkrates
|
|
37
|
+
- [ ] enable torch.script (important for openmm)
|
|
38
|
+
|
|
39
|
+
|
|
40
|
+
## Cite
|
|
41
|
+
If you are using the models implemented here please cite:
|
|
42
|
+
|
|
43
|
+
```bibtex
|
|
44
|
+
@article{kabylda2024molecular,
|
|
45
|
+
title={Molecular Simulations with a Pretrained Neural Network and Universal Pairwise Force Fields},
|
|
46
|
+
author={Kabylda, A. and Frank, J. T. and Dou, S. S. and Khabibrakhmanov, A. and Sandonas, L. M.
|
|
47
|
+
and Unke, O. T. and Chmiela, S. and M{\"u}ller, K.R. and Tkatchenko, A.},
|
|
48
|
+
journal={ChemRxiv},
|
|
49
|
+
year={2024},
|
|
50
|
+
doi={10.26434/chemrxiv-2024-bdfr0-v2}
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
@article{frank2024euclidean,
|
|
54
|
+
title={A Euclidean transformer for fast and stable machine learned force fields},
|
|
55
|
+
author={Frank, Thorben and Unke, Oliver and M{\"u}ller, Klaus-Robert and Chmiela, Stefan},
|
|
56
|
+
journal={Nature Communications},
|
|
57
|
+
volume={15},
|
|
58
|
+
number={1},
|
|
59
|
+
pages={6539},
|
|
60
|
+
year={2024}
|
|
61
|
+
}
|
|
62
|
+
```
|
|
63
|
+
|
|
64
|
+
Also consider citing MACE, as this software heavlily leans on or uses its code:
|
|
65
|
+
|
|
66
|
+
|
|
67
|
+
```bibtex
|
|
68
|
+
@inproceedings{Batatia2022mace,
|
|
69
|
+
title={{MACE}: Higher Order Equivariant Message Passing Neural Networks for Fast and Accurate Force Fields},
|
|
70
|
+
author={Ilyes Batatia and David Peter Kovacs and Gregor N. C. Simm and Christoph Ortner and Gabor Csanyi},
|
|
71
|
+
booktitle={Advances in Neural Information Processing Systems},
|
|
72
|
+
editor={Alice H. Oh and Alekh Agarwal and Danielle Belgrave and Kyunghyun Cho},
|
|
73
|
+
year={2022},
|
|
74
|
+
url={https://openreview.net/forum?id=YPpSngE-ZU}
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
@misc{Batatia2022Design,
|
|
78
|
+
title = {The Design Space of E(3)-Equivariant Atom-Centered Interatomic Potentials},
|
|
79
|
+
author = {Batatia, Ilyes and Batzner, Simon and Kov{\'a}cs, D{\'a}vid P{\'e}ter and Musaelian, Albert and Simm, Gregor N. C. and Drautz, Ralf and Ortner, Christoph and Kozinsky, Boris and Cs{\'a}nyi, G{\'a}bor},
|
|
80
|
+
year = {2022},
|
|
81
|
+
number = {arXiv:2205.06643},
|
|
82
|
+
eprint = {2205.06643},
|
|
83
|
+
eprinttype = {arxiv},
|
|
84
|
+
doi = {10.48550/arXiv.2205.06643},
|
|
85
|
+
archiveprefix = {arXiv}
|
|
86
|
+
}
|
|
87
|
+
```
|
|
88
|
+
|
|
89
|
+
## Contact
|
|
90
|
+
|
|
91
|
+
If you have questions you can reach me at: tobias.henkes@uni.lu
|
|
92
|
+
|
|
93
|
+
For bugs or feature requests, please use [GitHub Issues](https://github.com/tohenkes/So3krates-torch/issues).
|
|
94
|
+
|
|
95
|
+
## License
|
|
96
|
+
|
|
97
|
+
The code is published and distributed under the [MIT License](MIT.md).
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
[build-system]
|
|
2
|
+
requires = ["setuptools>=61.0"]
|
|
3
|
+
build-backend = "setuptools.build_meta"
|
|
4
|
+
|
|
5
|
+
[project]
|
|
6
|
+
name = "So3krates-torch"
|
|
7
|
+
version = "0.1"
|
|
8
|
+
description = "PyTorch implementation of So3krates neural network potential for atomistic simulations"
|
|
9
|
+
readme = "README.md"
|
|
10
|
+
requires-python = ">=3.10"
|
|
11
|
+
license = { text = "MIT" }
|
|
12
|
+
authors = [
|
|
13
|
+
{ name = "Tobias Henkes", email = "tobias.henkes@uni.lu" }
|
|
14
|
+
]
|
|
15
|
+
maintainers = [
|
|
16
|
+
{ name = "Tobias Henkes", email = "tobias.henkes@uni.lu" }
|
|
17
|
+
]
|
|
18
|
+
keywords = [
|
|
19
|
+
"machine-learning",
|
|
20
|
+
"molecular-dynamics",
|
|
21
|
+
"neural-networks",
|
|
22
|
+
"pytorch",
|
|
23
|
+
"atomistic-simulations",
|
|
24
|
+
"equivariant-networks",
|
|
25
|
+
"interatomic-potentials"
|
|
26
|
+
]
|
|
27
|
+
classifiers = [
|
|
28
|
+
"Development Status :: 3 - Alpha",
|
|
29
|
+
"Intended Audience :: Science/Research",
|
|
30
|
+
"License :: OSI Approved :: MIT License",
|
|
31
|
+
"Programming Language :: Python :: 3",
|
|
32
|
+
"Programming Language :: Python :: 3.10",
|
|
33
|
+
"Programming Language :: Python :: 3.11",
|
|
34
|
+
"Programming Language :: Python :: 3.12",
|
|
35
|
+
"Topic :: Scientific/Engineering :: Chemistry",
|
|
36
|
+
"Topic :: Scientific/Engineering :: Physics",
|
|
37
|
+
"Topic :: Scientific/Engineering :: Artificial Intelligence",
|
|
38
|
+
"Operating System :: POSIX :: Linux",
|
|
39
|
+
"Environment :: GPU :: NVIDIA CUDA",
|
|
40
|
+
]
|
|
41
|
+
dependencies = [
|
|
42
|
+
"ase>=3.26.0",
|
|
43
|
+
"h5py>=3.14.0",
|
|
44
|
+
"mace-torch>=0.3.14",
|
|
45
|
+
"numpy>=1.26.4",
|
|
46
|
+
"pyyaml>=6.0.2",
|
|
47
|
+
"torch>=2.8.0",
|
|
48
|
+
"torchvision>=0.23.0",
|
|
49
|
+
"torchaudio>=2.8.0",
|
|
50
|
+
]
|
|
51
|
+
|
|
52
|
+
[project.optional-dependencies]
|
|
53
|
+
dev = ["pre-commit", "pytest"]
|
|
54
|
+
|
|
55
|
+
[project.urls]
|
|
56
|
+
homepage = "https://github.com/tohenkes/So3krates-torch"
|
|
57
|
+
repository = "https://github.com/tohenkes/So3krates-torch"
|
|
58
|
+
documentation = "https://github.com/tohenkes/So3krates-torch#readme"
|
|
59
|
+
changelog = "https://github.com/tohenkes/So3krates-torch/blob/main/CHANGELOG.md"
|
|
60
|
+
issues = "https://github.com/tohenkes/So3krates-torch/issues"
|
|
61
|
+
"Bug Reports" = "https://github.com/tohenkes/So3krates-torch/issues"
|
|
62
|
+
"Source Code" = "https://github.com/tohenkes/So3krates-torch"
|
|
63
|
+
|
|
64
|
+
[tool.setuptools.packages.find]
|
|
65
|
+
where = ["src"]
|
|
66
|
+
|
|
67
|
+
[tool.setuptools.package-data]
|
|
68
|
+
so3krates_torch = ["pretrained/so3lr/so3lr.model"]
|
|
69
|
+
|
|
70
|
+
[tool.pytest.ini_options]
|
|
71
|
+
testpaths = ["src/so3krates_torch/tests"]
|
|
72
|
+
pythonpath = ["src"]
|
|
73
|
+
|
|
74
|
+
[project.scripts]
|
|
75
|
+
torchkrates-jax2torch = "so3krates_torch.cli.jax_to_torch:main"
|
|
76
|
+
torchkrates-torch2jax = "so3krates_torch.cli.torch_to_jax:main"
|
|
77
|
+
torchkrates-eval = "so3krates_torch.cli.run_eval:main"
|
|
78
|
+
torchkrates-metric = "so3krates_torch.cli.run_metric:main"
|
|
@@ -0,0 +1,140 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: So3krates-torch
|
|
3
|
+
Version: 0.1
|
|
4
|
+
Summary: PyTorch implementation of So3krates neural network potential for atomistic simulations
|
|
5
|
+
Author-email: Tobias Henkes <tobias.henkes@uni.lu>
|
|
6
|
+
Maintainer-email: Tobias Henkes <tobias.henkes@uni.lu>
|
|
7
|
+
License: MIT
|
|
8
|
+
Project-URL: homepage, https://github.com/tohenkes/So3krates-torch
|
|
9
|
+
Project-URL: repository, https://github.com/tohenkes/So3krates-torch
|
|
10
|
+
Project-URL: documentation, https://github.com/tohenkes/So3krates-torch#readme
|
|
11
|
+
Project-URL: changelog, https://github.com/tohenkes/So3krates-torch/blob/main/CHANGELOG.md
|
|
12
|
+
Project-URL: issues, https://github.com/tohenkes/So3krates-torch/issues
|
|
13
|
+
Project-URL: Bug Reports, https://github.com/tohenkes/So3krates-torch/issues
|
|
14
|
+
Project-URL: Source Code, https://github.com/tohenkes/So3krates-torch
|
|
15
|
+
Keywords: machine-learning,molecular-dynamics,neural-networks,pytorch,atomistic-simulations,equivariant-networks,interatomic-potentials
|
|
16
|
+
Classifier: Development Status :: 3 - Alpha
|
|
17
|
+
Classifier: Intended Audience :: Science/Research
|
|
18
|
+
Classifier: License :: OSI Approved :: MIT License
|
|
19
|
+
Classifier: Programming Language :: Python :: 3
|
|
20
|
+
Classifier: Programming Language :: Python :: 3.10
|
|
21
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
22
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
23
|
+
Classifier: Topic :: Scientific/Engineering :: Chemistry
|
|
24
|
+
Classifier: Topic :: Scientific/Engineering :: Physics
|
|
25
|
+
Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
|
|
26
|
+
Classifier: Operating System :: POSIX :: Linux
|
|
27
|
+
Classifier: Environment :: GPU :: NVIDIA CUDA
|
|
28
|
+
Requires-Python: >=3.10
|
|
29
|
+
Description-Content-Type: text/markdown
|
|
30
|
+
License-File: LICENSE.md
|
|
31
|
+
Requires-Dist: ase>=3.26.0
|
|
32
|
+
Requires-Dist: h5py>=3.14.0
|
|
33
|
+
Requires-Dist: mace-torch>=0.3.14
|
|
34
|
+
Requires-Dist: numpy>=1.26.4
|
|
35
|
+
Requires-Dist: pyyaml>=6.0.2
|
|
36
|
+
Requires-Dist: torch>=2.8.0
|
|
37
|
+
Requires-Dist: torchvision>=0.23.0
|
|
38
|
+
Requires-Dist: torchaudio>=2.8.0
|
|
39
|
+
Provides-Extra: dev
|
|
40
|
+
Requires-Dist: pre-commit; extra == "dev"
|
|
41
|
+
Requires-Dist: pytest; extra == "dev"
|
|
42
|
+
Dynamic: license-file
|
|
43
|
+
|
|
44
|
+
# So3krates-torch
|
|
45
|
+
|
|
46
|
+
> [!IMPORTANT]
|
|
47
|
+
> The code is work in progress! There may be breaking changes!
|
|
48
|
+
|
|
49
|
+
Lightweight implementation of the So3krates model in pytorch. This package is mostly intended for [aims-PAX](https://github.com/tohenkes/aims-PAX) but is a functional implementation of [So3krates](https://github.com/thorben-frank/mlff) and [SO3LR](https://github.com/general-molecular-simulations/so3lr) in pytorch. For now it uses (modified) source code of the [MACE](https://github.com/ACEsuit/mace) package and follows its style, so many functions are actually compatible.
|
|
50
|
+
|
|
51
|
+
#### Installation
|
|
52
|
+
|
|
53
|
+
1. activate your environment
|
|
54
|
+
2. clone this repository
|
|
55
|
+
3. move to the clone repository
|
|
56
|
+
4. `pip install -r requirements.xt`
|
|
57
|
+
5. `pip install .`
|
|
58
|
+
|
|
59
|
+
#### Implemented features:
|
|
60
|
+
1. ASE calculator for MD (including pre-trained SO3LR)
|
|
61
|
+
2. Inference over ase readable datasets: `torchkrates-eval`
|
|
62
|
+
3. Error metrics over ase readable datasets: `torchkrates-test`
|
|
63
|
+
4. Transforming pyTorch and JAX parameter formates: `torchkrates-jax2torch` or `torchkrates-torch2jax`
|
|
64
|
+
5. Training is WIP but `train` in `tools.train` is already working so you can easily build your own script
|
|
65
|
+
|
|
66
|
+
|
|
67
|
+
> [!IMPORTANT]
|
|
68
|
+
> Number 4 means that you can transform the weights from this pytorch version into the JAX version and vice versa. Inference and training is much faster (*at least 1 order of magnitude*) in the JAX version. This implementation is mostly for prototyping and compatability with other packages.
|
|
69
|
+
|
|
70
|
+
|
|
71
|
+
|
|
72
|
+
## TODO
|
|
73
|
+
|
|
74
|
+
- [ ] training
|
|
75
|
+
- [x] hirshfeld loss
|
|
76
|
+
- [ ] load trainings params from yaml
|
|
77
|
+
- [ ] script
|
|
78
|
+
- [ ] finetuning
|
|
79
|
+
- [ ] save and load hyperparameter json from torchkrates
|
|
80
|
+
- [ ] enable torch.script (important for openmm)
|
|
81
|
+
|
|
82
|
+
|
|
83
|
+
## Cite
|
|
84
|
+
If you are using the models implemented here please cite:
|
|
85
|
+
|
|
86
|
+
```bibtex
|
|
87
|
+
@article{kabylda2024molecular,
|
|
88
|
+
title={Molecular Simulations with a Pretrained Neural Network and Universal Pairwise Force Fields},
|
|
89
|
+
author={Kabylda, A. and Frank, J. T. and Dou, S. S. and Khabibrakhmanov, A. and Sandonas, L. M.
|
|
90
|
+
and Unke, O. T. and Chmiela, S. and M{\"u}ller, K.R. and Tkatchenko, A.},
|
|
91
|
+
journal={ChemRxiv},
|
|
92
|
+
year={2024},
|
|
93
|
+
doi={10.26434/chemrxiv-2024-bdfr0-v2}
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
@article{frank2024euclidean,
|
|
97
|
+
title={A Euclidean transformer for fast and stable machine learned force fields},
|
|
98
|
+
author={Frank, Thorben and Unke, Oliver and M{\"u}ller, Klaus-Robert and Chmiela, Stefan},
|
|
99
|
+
journal={Nature Communications},
|
|
100
|
+
volume={15},
|
|
101
|
+
number={1},
|
|
102
|
+
pages={6539},
|
|
103
|
+
year={2024}
|
|
104
|
+
}
|
|
105
|
+
```
|
|
106
|
+
|
|
107
|
+
Also consider citing MACE, as this software heavlily leans on or uses its code:
|
|
108
|
+
|
|
109
|
+
|
|
110
|
+
```bibtex
|
|
111
|
+
@inproceedings{Batatia2022mace,
|
|
112
|
+
title={{MACE}: Higher Order Equivariant Message Passing Neural Networks for Fast and Accurate Force Fields},
|
|
113
|
+
author={Ilyes Batatia and David Peter Kovacs and Gregor N. C. Simm and Christoph Ortner and Gabor Csanyi},
|
|
114
|
+
booktitle={Advances in Neural Information Processing Systems},
|
|
115
|
+
editor={Alice H. Oh and Alekh Agarwal and Danielle Belgrave and Kyunghyun Cho},
|
|
116
|
+
year={2022},
|
|
117
|
+
url={https://openreview.net/forum?id=YPpSngE-ZU}
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
@misc{Batatia2022Design,
|
|
121
|
+
title = {The Design Space of E(3)-Equivariant Atom-Centered Interatomic Potentials},
|
|
122
|
+
author = {Batatia, Ilyes and Batzner, Simon and Kov{\'a}cs, D{\'a}vid P{\'e}ter and Musaelian, Albert and Simm, Gregor N. C. and Drautz, Ralf and Ortner, Christoph and Kozinsky, Boris and Cs{\'a}nyi, G{\'a}bor},
|
|
123
|
+
year = {2022},
|
|
124
|
+
number = {arXiv:2205.06643},
|
|
125
|
+
eprint = {2205.06643},
|
|
126
|
+
eprinttype = {arxiv},
|
|
127
|
+
doi = {10.48550/arXiv.2205.06643},
|
|
128
|
+
archiveprefix = {arXiv}
|
|
129
|
+
}
|
|
130
|
+
```
|
|
131
|
+
|
|
132
|
+
## Contact
|
|
133
|
+
|
|
134
|
+
If you have questions you can reach me at: tobias.henkes@uni.lu
|
|
135
|
+
|
|
136
|
+
For bugs or feature requests, please use [GitHub Issues](https://github.com/tohenkes/So3krates-torch/issues).
|
|
137
|
+
|
|
138
|
+
## License
|
|
139
|
+
|
|
140
|
+
The code is published and distributed under the [MIT License](MIT.md).
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
LICENSE.md
|
|
2
|
+
README.md
|
|
3
|
+
pyproject.toml
|
|
4
|
+
src/So3krates_torch.egg-info/PKG-INFO
|
|
5
|
+
src/So3krates_torch.egg-info/SOURCES.txt
|
|
6
|
+
src/So3krates_torch.egg-info/dependency_links.txt
|
|
7
|
+
src/So3krates_torch.egg-info/entry_points.txt
|
|
8
|
+
src/So3krates_torch.egg-info/requires.txt
|
|
9
|
+
src/So3krates_torch.egg-info/top_level.txt
|
|
10
|
+
src/so3krates_torch/__init__.py
|
|
11
|
+
src/so3krates_torch/blocks/embedding.py
|
|
12
|
+
src/so3krates_torch/blocks/euclidean_transformer.py
|
|
13
|
+
src/so3krates_torch/blocks/output_block.py
|
|
14
|
+
src/so3krates_torch/blocks/physical_potentials.py
|
|
15
|
+
src/so3krates_torch/blocks/radial_basis.py
|
|
16
|
+
src/so3krates_torch/blocks/so3_conv_invariants.py
|
|
17
|
+
src/so3krates_torch/calculator/so3.py
|
|
18
|
+
src/so3krates_torch/cli/jax_to_torch.py
|
|
19
|
+
src/so3krates_torch/cli/run_eval.py
|
|
20
|
+
src/so3krates_torch/cli/run_metric.py
|
|
21
|
+
src/so3krates_torch/cli/run_train.py
|
|
22
|
+
src/so3krates_torch/cli/torch_to_jax.py
|
|
23
|
+
src/so3krates_torch/data/atomic_data.py
|
|
24
|
+
src/so3krates_torch/data/neighborhood.py
|
|
25
|
+
src/so3krates_torch/data/utils.py
|
|
26
|
+
src/so3krates_torch/modules/__init__.py
|
|
27
|
+
src/so3krates_torch/modules/cutoff.py
|
|
28
|
+
src/so3krates_torch/modules/loss.py
|
|
29
|
+
src/so3krates_torch/modules/models.py
|
|
30
|
+
src/so3krates_torch/modules/spherical_harmonics.py
|
|
31
|
+
src/so3krates_torch/pretrained/so3lr/so3lr.model
|
|
32
|
+
src/so3krates_torch/scripts/simple_md.py
|
|
33
|
+
src/so3krates_torch/scripts/transform_xyz_headers.py
|
|
34
|
+
src/so3krates_torch/tests/test_model.py
|
|
35
|
+
src/so3krates_torch/tools/compile.py
|
|
36
|
+
src/so3krates_torch/tools/eval.py
|
|
37
|
+
src/so3krates_torch/tools/jax_torch_conversion.py
|
|
38
|
+
src/so3krates_torch/tools/scatter.py
|
|
39
|
+
src/so3krates_torch/tools/train.py
|
|
40
|
+
src/so3krates_torch/tools/utils.py
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
so3krates_torch
|
|
File without changes
|