pack-mm 0.0.19__tar.gz → 0.0.20__tar.gz

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,246 @@
1
+ Metadata-Version: 2.1
2
+ Name: pack-mm
3
+ Version: 0.0.20
4
+ Summary: packing materials and molecules in boxes using for machine learnt interatomic potentials
5
+ Author: Alin M. Elena
6
+ Classifier: Programming Language :: Python
7
+ Classifier: Programming Language :: Python :: 3.10
8
+ Classifier: Programming Language :: Python :: 3.11
9
+ Classifier: Programming Language :: Python :: 3.12
10
+ Classifier: Intended Audience :: Science/Research
11
+ Classifier: License :: OSI Approved :: MIT License
12
+ Classifier: Natural Language :: English
13
+ Classifier: Development Status :: 3 - Alpha
14
+ Project-URL: Repository, https://github.com/ddmms/pack-mm/
15
+ Project-URL: Documentation, https://ddmms.github.io/pack-mm/
16
+ Requires-Python: >=3.10
17
+ Requires-Dist: janus-core>=0.7.2
18
+ Requires-Dist: typer<1.0.0,>=0.12.5
19
+ Requires-Dist: typer-config<2.0.0,>=1.4.2
20
+ Description-Content-Type: text/markdown
21
+
22
+ [![Python versions][python-badge]][python-link]
23
+ [![Build Status][ci-badge]][ci-link]
24
+ [![Coverage Status][cov-badge]][cov-link]
25
+ [![License][license-badge]][license-link]
26
+
27
+ # what is packmm
28
+
29
+ packmm is a simple python package that allows to build atomistic and molecular
30
+ systems which are of interest for materials and molecular modelling.
31
+
32
+ It tries to generate realistic starting configuration by employing machine learnt
33
+ interatomic potential for describing interactions between atoms and Monte Carlo,
34
+ Molecular Dynamics and hybrid Monte Carlo.
35
+
36
+ It provides both a cli and a python api, with some examples below.
37
+
38
+ ## Quick install
39
+
40
+ ```bash
41
+
42
+ uv pip install pack-mm
43
+
44
+ ```
45
+ or install the lates
46
+
47
+ ```bash
48
+
49
+ uv pip install git+https://github.com/ddmms/pack-mm.git
50
+
51
+ ```
52
+
53
+ ## CLI examples
54
+
55
+
56
+ ### MOF in spherical pocket
57
+
58
+ ```bash
59
+
60
+ packmm --system examples/data/UiO-66.cif --molecule H2O --nmols 10 --where sphere --centre 10.0,10.0,10.0 --radius 5.0 --geometry
61
+
62
+ ```
63
+
64
+ ![](examples/pics/UiO66water.png)
65
+
66
+ ### Zeolite in cylindrical channel
67
+
68
+
69
+ ```bash
70
+
71
+ packmm --system examples/data/MFI.cif --molecule H2O --nmols 30 --where cylinderY --centre 10.0,10.0,13.0 --radius 3.5 --height 19.00 --no-geometry
72
+
73
+ ```
74
+
75
+ ![](examples/pics/MFIwater.png)
76
+
77
+ ### NaCl on surface
78
+
79
+ ```bash
80
+ packmm --system examples/data/NaCl.cif --molecule H2O --nmols 30 --where box --centre 8.5,8.5,16.0 --a 16.9 --b 16.9 --c 7.5 --no-geometry
81
+
82
+ ```
83
+
84
+ ![](examples/pics/NaClwater.png)
85
+
86
+ ### MOF ellipsoid
87
+
88
+ first add a methanol
89
+
90
+ ```bash
91
+
92
+ packmm --system examples/data/Cu2L.cif --molecule examples/data/Ethanol.xyz --nmols 1 --where sphere --centre 5.18,8.15,25.25 --radius 1 --model small-0b2 --geometry
93
+
94
+ ```
95
+
96
+ !()[examples/pics/Cu2L-ethanol.png]
97
+
98
+ ``` bash
99
+
100
+ packmm --system Cu2L-ethanol.cif --molecule H2O --nmols 10 --where ellipsoid --centre 5.18,8.15,25.25 --a 5.18 --b 8.15 --c 8.25 --no-geometry --model small-0b2
101
+
102
+
103
+ ```
104
+
105
+ !()[examples/pics/Cu2l-ethanol-water.png]
106
+
107
+ ### Liquid water
108
+
109
+ ```bash
110
+
111
+ packmm --molecule H2O --nmols 33 --where anywhere --cell-a 10.0 --cell-b 10.0 --cell-c 10.0 --model small-0b2
112
+
113
+
114
+ ```
115
+
116
+ !()[examples/pics/water.png]
117
+ ### interstitials
118
+
119
+ ```bash
120
+
121
+ packmm --system Pd-super.cif --molecule H2 --nmols 50 --where anywhere --model small-0b2
122
+
123
+ ```
124
+
125
+ before optimisation
126
+
127
+ !()[examples/pics/Pd-H2-noopt.png]
128
+
129
+
130
+ after optimisation
131
+
132
+ !()[examples/pics/Pd-H2.png]
133
+
134
+
135
+
136
+ ### full list of options
137
+
138
+ ```bash
139
+
140
+ packmm --help
141
+
142
+ Usage: packmm [OPTIONS]
143
+
144
+ Pack molecules into a system based on the specified parameters.
145
+
146
+ ╭─ Options ────────────────────────────────────────────────────────────────────────────────────────╮
147
+ │ --system TEXT The original box in which │
148
+ │ you want to add particles. │
149
+ │ If not provided, an empty │
150
+ │ box will be created. │
151
+ │ [default: None] │
152
+ │ --molecule TEXT Name of the molecule to be │
153
+ │ processed, ASE-recognizable │
154
+ │ or ASE-readable file. │
155
+ │ [default: H2O] │
156
+ │ --nmols INTEGER Target number of molecules │
157
+ │ to insert. │
158
+ │ [default: -1] │
159
+ │ --ntries INTEGER Maximum number of attempts │
160
+ │ to insert each molecule. │
161
+ │ [default: 50] │
162
+ │ --seed INTEGER Random seed for │
163
+ │ reproducibility. │
164
+ │ [default: 2025] │
165
+ │ --where [anywhere|sphere|box|cylin Where to insert the │
166
+ │ derZ|cylinderY|cylinderX|e molecule. Choices: │
167
+ │ llipsoid] 'anywhere', 'sphere', │
168
+ │ 'box', 'cylinderZ', │
169
+ │ 'cylinderY', 'cylinderX', │
170
+ │ 'ellipsoid'. │
171
+ │ [default: anywhere] │
172
+ │ --centre TEXT Centre of the insertion │
173
+ │ zone, coordinates in Å, │
174
+ │ e.g., '5.0, 5.0, 5.0'. │
175
+ │ [default: None] │
176
+ │ --radius FLOAT Radius of the sphere or │
177
+ │ cylinder in Å, depending on │
178
+ │ the insertion volume. │
179
+ │ [default: None] │
180
+ │ --height FLOAT Height of the cylinder in │
181
+ │ Å. │
182
+ │ [default: None] │
183
+ │ --a FLOAT Side of the box or │
184
+ │ semi-axis of the ellipsoid, │
185
+ │ in Å, depends on the │
186
+ │ insertion method. │
187
+ │ [default: None] │
188
+ │ --b FLOAT Side of the box or │
189
+ │ semi-axis of the ellipsoid, │
190
+ │ in Å, depends on the │
191
+ │ insertion method. │
192
+ │ [default: None] │
193
+ │ --c FLOAT Side of the box or │
194
+ │ semi-axis of the ellipsoid, │
195
+ │ in Å, depends on the │
196
+ │ insertion method. │
197
+ │ [default: None] │
198
+ │ --device TEXT Device to run calculations │
199
+ │ on (e.g., 'cpu' or 'cuda'). │
200
+ │ [default: cpu] │
201
+ │ --model TEXT ML model to use. │
202
+ │ [default: medium-omat-0] │
203
+ │ --arch TEXT MLIP architecture to use. │
204
+ │ [default: mace_mp] │
205
+ │ --temperature FLOAT Temperature for the Monte │
206
+ │ Carlo acceptance rule. │
207
+ │ [default: 300.0] │
208
+ │ --cell-a FLOAT Side of the empty box along │
209
+ │ the x-axis in Å. │
210
+ │ [default: 20.0] │
211
+ │ --cell-b FLOAT Side of the empty box along │
212
+ │ the y-axis in Å. │
213
+ │ [default: 20.0] │
214
+ │ --cell-c FLOAT Side of the empty box along │
215
+ │ the z-axis in Å. │
216
+ │ [default: 20.0] │
217
+ │ --fmax FLOAT force tollerance for │
218
+ │ optimisation if needed. │
219
+ │ [default: 0.1] │
220
+ │ --geometry --no-geometry Perform geometry │
221
+ │ optimization at the end. │
222
+ │ [default: geometry] │
223
+ │ --out-path TEXT path to save various │
224
+ │ outputs. │
225
+ │ [default: .] │
226
+ │ --install-completion Install completion for the │
227
+ │ current shell. │
228
+ │ --show-completion Show completion for the │
229
+ │ current shell, to copy it │
230
+ │ or customize the │
231
+ │ installation. │
232
+ │ --help Show this message and exit. │
233
+ ╰──────────────────────────────────────────────────────────────────────────────────────────────────╯
234
+
235
+
236
+ ```
237
+
238
+
239
+ [python-badge]: https://img.shields.io/pypi/pyversions/pack-mm.svg
240
+ [python-link]: https://pypi.org/project/pack-mm/
241
+ [ci-badge]: https://github.com/ddmms/pack-mm/actions/workflows/build.yml/badge.svg?branch=main
242
+ [ci-link]: https://github.com/ddmms/pack-mm/actions
243
+ [cov-badge]: https://coveralls.io/repos/github/ddmms/pack-mm/badge.svg?branch=main
244
+ [cov-link]: https://coveralls.io/github/ddmms/pack-mm?branch=main
245
+ [license-badge]: https://img.shields.io/badge/License-MIT-yellow.svg
246
+ [license-link]: https://opensource.org/license/MIT
@@ -0,0 +1,225 @@
1
+ [![Python versions][python-badge]][python-link]
2
+ [![Build Status][ci-badge]][ci-link]
3
+ [![Coverage Status][cov-badge]][cov-link]
4
+ [![License][license-badge]][license-link]
5
+
6
+ # what is packmm
7
+
8
+ packmm is a simple python package that allows to build atomistic and molecular
9
+ systems which are of interest for materials and molecular modelling.
10
+
11
+ It tries to generate realistic starting configuration by employing machine learnt
12
+ interatomic potential for describing interactions between atoms and Monte Carlo,
13
+ Molecular Dynamics and hybrid Monte Carlo.
14
+
15
+ It provides both a cli and a python api, with some examples below.
16
+
17
+ ## Quick install
18
+
19
+ ```bash
20
+
21
+ uv pip install pack-mm
22
+
23
+ ```
24
+ or install the lates
25
+
26
+ ```bash
27
+
28
+ uv pip install git+https://github.com/ddmms/pack-mm.git
29
+
30
+ ```
31
+
32
+ ## CLI examples
33
+
34
+
35
+ ### MOF in spherical pocket
36
+
37
+ ```bash
38
+
39
+ packmm --system examples/data/UiO-66.cif --molecule H2O --nmols 10 --where sphere --centre 10.0,10.0,10.0 --radius 5.0 --geometry
40
+
41
+ ```
42
+
43
+ ![](examples/pics/UiO66water.png)
44
+
45
+ ### Zeolite in cylindrical channel
46
+
47
+
48
+ ```bash
49
+
50
+ packmm --system examples/data/MFI.cif --molecule H2O --nmols 30 --where cylinderY --centre 10.0,10.0,13.0 --radius 3.5 --height 19.00 --no-geometry
51
+
52
+ ```
53
+
54
+ ![](examples/pics/MFIwater.png)
55
+
56
+ ### NaCl on surface
57
+
58
+ ```bash
59
+ packmm --system examples/data/NaCl.cif --molecule H2O --nmols 30 --where box --centre 8.5,8.5,16.0 --a 16.9 --b 16.9 --c 7.5 --no-geometry
60
+
61
+ ```
62
+
63
+ ![](examples/pics/NaClwater.png)
64
+
65
+ ### MOF ellipsoid
66
+
67
+ first add a methanol
68
+
69
+ ```bash
70
+
71
+ packmm --system examples/data/Cu2L.cif --molecule examples/data/Ethanol.xyz --nmols 1 --where sphere --centre 5.18,8.15,25.25 --radius 1 --model small-0b2 --geometry
72
+
73
+ ```
74
+
75
+ !()[examples/pics/Cu2L-ethanol.png]
76
+
77
+ ``` bash
78
+
79
+ packmm --system Cu2L-ethanol.cif --molecule H2O --nmols 10 --where ellipsoid --centre 5.18,8.15,25.25 --a 5.18 --b 8.15 --c 8.25 --no-geometry --model small-0b2
80
+
81
+
82
+ ```
83
+
84
+ !()[examples/pics/Cu2l-ethanol-water.png]
85
+
86
+ ### Liquid water
87
+
88
+ ```bash
89
+
90
+ packmm --molecule H2O --nmols 33 --where anywhere --cell-a 10.0 --cell-b 10.0 --cell-c 10.0 --model small-0b2
91
+
92
+
93
+ ```
94
+
95
+ !()[examples/pics/water.png]
96
+ ### interstitials
97
+
98
+ ```bash
99
+
100
+ packmm --system Pd-super.cif --molecule H2 --nmols 50 --where anywhere --model small-0b2
101
+
102
+ ```
103
+
104
+ before optimisation
105
+
106
+ !()[examples/pics/Pd-H2-noopt.png]
107
+
108
+
109
+ after optimisation
110
+
111
+ !()[examples/pics/Pd-H2.png]
112
+
113
+
114
+
115
+ ### full list of options
116
+
117
+ ```bash
118
+
119
+ packmm --help
120
+
121
+ Usage: packmm [OPTIONS]
122
+
123
+ Pack molecules into a system based on the specified parameters.
124
+
125
+ ╭─ Options ────────────────────────────────────────────────────────────────────────────────────────╮
126
+ │ --system TEXT The original box in which │
127
+ │ you want to add particles. │
128
+ │ If not provided, an empty │
129
+ │ box will be created. │
130
+ │ [default: None] │
131
+ │ --molecule TEXT Name of the molecule to be │
132
+ │ processed, ASE-recognizable │
133
+ │ or ASE-readable file. │
134
+ │ [default: H2O] │
135
+ │ --nmols INTEGER Target number of molecules │
136
+ │ to insert. │
137
+ │ [default: -1] │
138
+ │ --ntries INTEGER Maximum number of attempts │
139
+ │ to insert each molecule. │
140
+ │ [default: 50] │
141
+ │ --seed INTEGER Random seed for │
142
+ │ reproducibility. │
143
+ │ [default: 2025] │
144
+ │ --where [anywhere|sphere|box|cylin Where to insert the │
145
+ │ derZ|cylinderY|cylinderX|e molecule. Choices: │
146
+ │ llipsoid] 'anywhere', 'sphere', │
147
+ │ 'box', 'cylinderZ', │
148
+ │ 'cylinderY', 'cylinderX', │
149
+ │ 'ellipsoid'. │
150
+ │ [default: anywhere] │
151
+ │ --centre TEXT Centre of the insertion │
152
+ │ zone, coordinates in Å, │
153
+ │ e.g., '5.0, 5.0, 5.0'. │
154
+ │ [default: None] │
155
+ │ --radius FLOAT Radius of the sphere or │
156
+ │ cylinder in Å, depending on │
157
+ │ the insertion volume. │
158
+ │ [default: None] │
159
+ │ --height FLOAT Height of the cylinder in │
160
+ │ Å. │
161
+ │ [default: None] │
162
+ │ --a FLOAT Side of the box or │
163
+ │ semi-axis of the ellipsoid, │
164
+ │ in Å, depends on the │
165
+ │ insertion method. │
166
+ │ [default: None] │
167
+ │ --b FLOAT Side of the box or │
168
+ │ semi-axis of the ellipsoid, │
169
+ │ in Å, depends on the │
170
+ │ insertion method. │
171
+ │ [default: None] │
172
+ │ --c FLOAT Side of the box or │
173
+ │ semi-axis of the ellipsoid, │
174
+ │ in Å, depends on the │
175
+ │ insertion method. │
176
+ │ [default: None] │
177
+ │ --device TEXT Device to run calculations │
178
+ │ on (e.g., 'cpu' or 'cuda'). │
179
+ │ [default: cpu] │
180
+ │ --model TEXT ML model to use. │
181
+ │ [default: medium-omat-0] │
182
+ │ --arch TEXT MLIP architecture to use. │
183
+ │ [default: mace_mp] │
184
+ │ --temperature FLOAT Temperature for the Monte │
185
+ │ Carlo acceptance rule. │
186
+ │ [default: 300.0] │
187
+ │ --cell-a FLOAT Side of the empty box along │
188
+ │ the x-axis in Å. │
189
+ │ [default: 20.0] │
190
+ │ --cell-b FLOAT Side of the empty box along │
191
+ │ the y-axis in Å. │
192
+ │ [default: 20.0] │
193
+ │ --cell-c FLOAT Side of the empty box along │
194
+ │ the z-axis in Å. │
195
+ │ [default: 20.0] │
196
+ │ --fmax FLOAT force tollerance for │
197
+ │ optimisation if needed. │
198
+ │ [default: 0.1] │
199
+ │ --geometry --no-geometry Perform geometry │
200
+ │ optimization at the end. │
201
+ │ [default: geometry] │
202
+ │ --out-path TEXT path to save various │
203
+ │ outputs. │
204
+ │ [default: .] │
205
+ │ --install-completion Install completion for the │
206
+ │ current shell. │
207
+ │ --show-completion Show completion for the │
208
+ │ current shell, to copy it │
209
+ │ or customize the │
210
+ │ installation. │
211
+ │ --help Show this message and exit. │
212
+ ╰──────────────────────────────────────────────────────────────────────────────────────────────────╯
213
+
214
+
215
+ ```
216
+
217
+
218
+ [python-badge]: https://img.shields.io/pypi/pyversions/pack-mm.svg
219
+ [python-link]: https://pypi.org/project/pack-mm/
220
+ [ci-badge]: https://github.com/ddmms/pack-mm/actions/workflows/build.yml/badge.svg?branch=main
221
+ [ci-link]: https://github.com/ddmms/pack-mm/actions
222
+ [cov-badge]: https://coveralls.io/repos/github/ddmms/pack-mm/badge.svg?branch=main
223
+ [cov-link]: https://coveralls.io/github/ddmms/pack-mm?branch=main
224
+ [license-badge]: https://img.shields.io/badge/License-MIT-yellow.svg
225
+ [license-link]: https://opensource.org/license/MIT
@@ -11,6 +11,7 @@ from pathlib import Path
11
11
  from ase import Atoms
12
12
  from ase.build import molecule as build_molecule
13
13
  from ase.io import read, write
14
+ from ase.units import kB
14
15
  from janus_core.calculations.geom_opt import GeomOpt
15
16
  from janus_core.helpers.mlip_calculators import choose_calculator
16
17
  from numpy import cos, exp, pi, random, sin, sqrt
@@ -185,7 +186,7 @@ def pack_molecules(
185
186
  cell_a, cell_b, cell_c (float): Cell dimensions if system is empty.
186
187
  out_path (str): path to save various outputs
187
188
  """
188
- kbt = temperature * 8.6173303e-5 # Boltzmann constant in eV/K
189
+ kbt = temperature * kB
189
190
  validate_value("temperature", temperature)
190
191
  validate_value("radius", radius)
191
192
  validate_value("height", height)
@@ -358,5 +359,5 @@ def optimize_geometry(
358
359
  filter_kwargs={"hydrostatic_strain": True},
359
360
  )
360
361
  geo.run()
361
- write(Path(out_path) / f"{struct_path}-opt.cif", geo.struct)
362
+ write(Path(out_path) / f"{Path(struct_path).stem}-opt.cif", geo.struct)
362
363
  return geo.struct.get_potential_energy()
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = "pack-mm"
3
- version = "0.0.19"
3
+ version = "0.0.20"
4
4
  description = "packing materials and molecules in boxes using for machine learnt interatomic potentials"
5
5
  authors = [
6
6
  { name = "Alin M. Elena" },
pack_mm-0.0.19/PKG-INFO DELETED
@@ -1,36 +0,0 @@
1
- Metadata-Version: 2.1
2
- Name: pack-mm
3
- Version: 0.0.19
4
- Summary: packing materials and molecules in boxes using for machine learnt interatomic potentials
5
- Author: Alin M. Elena
6
- Classifier: Programming Language :: Python
7
- Classifier: Programming Language :: Python :: 3.10
8
- Classifier: Programming Language :: Python :: 3.11
9
- Classifier: Programming Language :: Python :: 3.12
10
- Classifier: Intended Audience :: Science/Research
11
- Classifier: License :: OSI Approved :: MIT License
12
- Classifier: Natural Language :: English
13
- Classifier: Development Status :: 3 - Alpha
14
- Project-URL: Repository, https://github.com/ddmms/pack-mm/
15
- Project-URL: Documentation, https://ddmms.github.io/pack-mm/
16
- Requires-Python: >=3.10
17
- Requires-Dist: janus-core>=0.7.2
18
- Requires-Dist: typer<1.0.0,>=0.12.5
19
- Requires-Dist: typer-config<2.0.0,>=1.4.2
20
- Description-Content-Type: text/markdown
21
-
22
- # pack materials and molecules
23
-
24
- [![Python versions][python-badge]][python-link]
25
- [![Build Status][ci-badge]][ci-link]
26
- [![Coverage Status][cov-badge]][cov-link]
27
- [![License][license-badge]][license-link]
28
-
29
- [python-badge]: https://img.shields.io/pypi/pyversions/pack-mm.svg
30
- [python-link]: https://pypi.org/project/pack-mm/
31
- [ci-badge]: https://github.com/ddmms/pack-mm/actions/workflows/build.yml/badge.svg?branch=main
32
- [ci-link]: https://github.com/ddmms/pack-mm/actions
33
- [cov-badge]: https://coveralls.io/repos/github/ddmms/pack-mm/badge.svg?branch=main
34
- [cov-link]: https://coveralls.io/github/ddmms/pack-mm?branch=main
35
- [license-badge]: https://img.shields.io/badge/License-MIT-yellow.svg
36
- [license-link]: https://opensource.org/license/MIT
pack_mm-0.0.19/README.md DELETED
@@ -1,15 +0,0 @@
1
- # pack materials and molecules
2
-
3
- [![Python versions][python-badge]][python-link]
4
- [![Build Status][ci-badge]][ci-link]
5
- [![Coverage Status][cov-badge]][cov-link]
6
- [![License][license-badge]][license-link]
7
-
8
- [python-badge]: https://img.shields.io/pypi/pyversions/pack-mm.svg
9
- [python-link]: https://pypi.org/project/pack-mm/
10
- [ci-badge]: https://github.com/ddmms/pack-mm/actions/workflows/build.yml/badge.svg?branch=main
11
- [ci-link]: https://github.com/ddmms/pack-mm/actions
12
- [cov-badge]: https://coveralls.io/repos/github/ddmms/pack-mm/badge.svg?branch=main
13
- [cov-link]: https://coveralls.io/github/ddmms/pack-mm?branch=main
14
- [license-badge]: https://img.shields.io/badge/License-MIT-yellow.svg
15
- [license-link]: https://opensource.org/license/MIT
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes