lifatoolkit 0.1.0__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.
- lifatoolkit-0.1.0/.gitignore +11 -0
- lifatoolkit-0.1.0/LICENSE +21 -0
- lifatoolkit-0.1.0/PKG-INFO +97 -0
- lifatoolkit-0.1.0/README.md +73 -0
- lifatoolkit-0.1.0/examples/run_md.py +15 -0
- lifatoolkit-0.1.0/meson.build +24 -0
- lifatoolkit-0.1.0/pixi.lock +1466 -0
- lifatoolkit-0.1.0/pixi.toml +37 -0
- lifatoolkit-0.1.0/pyproject.toml +42 -0
- lifatoolkit-0.1.0/src/lifatoolkit/__init__.py +6 -0
- lifatoolkit-0.1.0/src/lifatoolkit/_fortran/__init__.py +7 -0
- lifatoolkit-0.1.0/src/lifatoolkit/_fortran/md_core.f90 +26 -0
- lifatoolkit-0.1.0/src/lifatoolkit/_fortran/meson.build +23 -0
- lifatoolkit-0.1.0/src/lifatoolkit/core/__init__.py +4 -0
- lifatoolkit-0.1.0/src/lifatoolkit/core/base.py +50 -0
- lifatoolkit-0.1.0/src/lifatoolkit/core/meson.build +1 -0
- lifatoolkit-0.1.0/src/lifatoolkit/core/registry.py +36 -0
- lifatoolkit-0.1.0/src/lifatoolkit/fluids/__init__.py +3 -0
- lifatoolkit-0.1.0/src/lifatoolkit/fluids/meson.build +1 -0
- lifatoolkit-0.1.0/src/lifatoolkit/fluids/sph.py +32 -0
- lifatoolkit-0.1.0/src/lifatoolkit/mc/__init__.py +4 -0
- lifatoolkit-0.1.0/src/lifatoolkit/mc/meson.build +1 -0
- lifatoolkit-0.1.0/src/lifatoolkit/mc/metropolis.py +33 -0
- lifatoolkit-0.1.0/src/lifatoolkit/mc/wang_landau.py +44 -0
- lifatoolkit-0.1.0/src/lifatoolkit/md/__init__.py +4 -0
- lifatoolkit-0.1.0/src/lifatoolkit/md/ensembles.py +47 -0
- lifatoolkit-0.1.0/src/lifatoolkit/md/integrators.py +40 -0
- lifatoolkit-0.1.0/src/lifatoolkit/md/meson.build +1 -0
- lifatoolkit-0.1.0/src/lifatoolkit/meson.build +15 -0
- lifatoolkit-0.1.0/src/lifatoolkit/potentials/__init__.py +4 -0
- lifatoolkit-0.1.0/src/lifatoolkit/potentials/base.py +20 -0
- lifatoolkit-0.1.0/src/lifatoolkit/potentials/lennard_jones.py +38 -0
- lifatoolkit-0.1.0/src/lifatoolkit/potentials/meson.build +1 -0
- lifatoolkit-0.1.0/src/lifatoolkit/quantum/__init__.py +4 -0
- lifatoolkit-0.1.0/src/lifatoolkit/quantum/closed.py +21 -0
- lifatoolkit-0.1.0/src/lifatoolkit/quantum/meson.build +1 -0
- lifatoolkit-0.1.0/src/lifatoolkit/quantum/open.py +26 -0
- lifatoolkit-0.1.0/src/lifatoolkit/spins/__init__.py +3 -0
- lifatoolkit-0.1.0/src/lifatoolkit/spins/heisenberg.py +24 -0
- lifatoolkit-0.1.0/src/lifatoolkit/spins/meson.build +1 -0
- lifatoolkit-0.1.0/src/lifatoolkit/viz/__init__.py +3 -0
- lifatoolkit-0.1.0/src/lifatoolkit/viz/blender.py +22 -0
- lifatoolkit-0.1.0/src/lifatoolkit/viz/meson.build +1 -0
- lifatoolkit-0.1.0/tests/test_registry.py +20 -0
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Rodrigo
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: lifatoolkit
|
|
3
|
+
Version: 0.1.0
|
|
4
|
+
Summary: Toolkit multifisica para simulacoes (MD, MC, quantica, fluidos, spins)
|
|
5
|
+
Author-Email: Rodrigo Alves Dias <diasrodri@gmail.com>
|
|
6
|
+
License-Expression: MIT
|
|
7
|
+
License-File: LICENSE
|
|
8
|
+
Classifier: Development Status :: 3 - Alpha
|
|
9
|
+
Classifier: Intended Audience :: Science/Research
|
|
10
|
+
Classifier: Programming Language :: Python :: 3
|
|
11
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
12
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
13
|
+
Classifier: Topic :: Scientific/Engineering :: Physics
|
|
14
|
+
Requires-Python: >=3.11
|
|
15
|
+
Requires-Dist: numpy>=2.0
|
|
16
|
+
Requires-Dist: scipy>=1.11
|
|
17
|
+
Provides-Extra: viz
|
|
18
|
+
Requires-Dist: bpy>=4.0; extra == "viz"
|
|
19
|
+
Provides-Extra: dev
|
|
20
|
+
Requires-Dist: pytest; extra == "dev"
|
|
21
|
+
Requires-Dist: ruff; extra == "dev"
|
|
22
|
+
Requires-Dist: mypy; extra == "dev"
|
|
23
|
+
Description-Content-Type: text/markdown
|
|
24
|
+
|
|
25
|
+
# lifatoolkit
|
|
26
|
+
|
|
27
|
+
Toolkit multifisica em Python para dinamica molecular, Monte Carlo, sistemas
|
|
28
|
+
quanticos, fluidos e dinamica de spins.
|
|
29
|
+
|
|
30
|
+
## Instalacao
|
|
31
|
+
|
|
32
|
+
```console
|
|
33
|
+
python -m pip install lifatoolkit
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
Se nao houver um wheel compativel com seu sistema, a instalacao a partir do
|
|
37
|
+
codigo-fonte requer compiladores C e Fortran.
|
|
38
|
+
|
|
39
|
+
## Exemplo
|
|
40
|
+
|
|
41
|
+
```python
|
|
42
|
+
import numpy as np
|
|
43
|
+
|
|
44
|
+
from lifatoolkit import State, create
|
|
45
|
+
|
|
46
|
+
state = State(
|
|
47
|
+
positions=np.random.rand(3, 20) * 5.0,
|
|
48
|
+
velocities=np.zeros((3, 20)),
|
|
49
|
+
)
|
|
50
|
+
simulation = create("md", state=state, box=[5.0, 5.0, 5.0])
|
|
51
|
+
simulation.run(10)
|
|
52
|
+
print(simulation.observables())
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
## Desenvolvimento
|
|
56
|
+
|
|
57
|
+
O ambiente de desenvolvimento e gerenciado com Pixi:
|
|
58
|
+
|
|
59
|
+
```console
|
|
60
|
+
pixi install
|
|
61
|
+
pixi run test
|
|
62
|
+
pixi run lint
|
|
63
|
+
pixi run python examples/run_md.py
|
|
64
|
+
```
|
|
65
|
+
|
|
66
|
+
## Build e publicacao
|
|
67
|
+
|
|
68
|
+
O build gera um wheel e um source distribution. Como o backend Meson usa o
|
|
69
|
+
controle de versao para montar o source distribution, execute os comandos em
|
|
70
|
+
um checkout Git com as alteracoes da versao commitadas.
|
|
71
|
+
|
|
72
|
+
```console
|
|
73
|
+
pixi run build
|
|
74
|
+
pixi run twine check dist/*
|
|
75
|
+
pixi run twine upload --repository testpypi dist/*
|
|
76
|
+
```
|
|
77
|
+
|
|
78
|
+
Depois de validar a instalacao pelo TestPyPI, publique no PyPI:
|
|
79
|
+
|
|
80
|
+
```console
|
|
81
|
+
pixi run twine upload dist/*
|
|
82
|
+
```
|
|
83
|
+
|
|
84
|
+
Uma versao publicada nao pode ser reenviada com o mesmo numero de versao.
|
|
85
|
+
Atualize `version` em `pyproject.toml` para cada nova release.
|
|
86
|
+
|
|
87
|
+
## Estrutura
|
|
88
|
+
|
|
89
|
+
- `src/lifatoolkit/core` - contratos base (`Simulation`, `State`) e registro
|
|
90
|
+
- `src/lifatoolkit/potentials` - potenciais de interacao
|
|
91
|
+
- `src/lifatoolkit/md` - dinamica molecular e integradores
|
|
92
|
+
- `src/lifatoolkit/mc` - Monte Carlo
|
|
93
|
+
- `src/lifatoolkit/quantum` - sistemas quanticos fechados e abertos
|
|
94
|
+
- `src/lifatoolkit/fluids` - SPH
|
|
95
|
+
- `src/lifatoolkit/spins` - dinamica de spins
|
|
96
|
+
- `src/lifatoolkit/viz` - ponte com Blender
|
|
97
|
+
- `src/lifatoolkit/_fortran` - codigo Fortran compilado via f2py
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
# lifatoolkit
|
|
2
|
+
|
|
3
|
+
Toolkit multifisica em Python para dinamica molecular, Monte Carlo, sistemas
|
|
4
|
+
quanticos, fluidos e dinamica de spins.
|
|
5
|
+
|
|
6
|
+
## Instalacao
|
|
7
|
+
|
|
8
|
+
```console
|
|
9
|
+
python -m pip install lifatoolkit
|
|
10
|
+
```
|
|
11
|
+
|
|
12
|
+
Se nao houver um wheel compativel com seu sistema, a instalacao a partir do
|
|
13
|
+
codigo-fonte requer compiladores C e Fortran.
|
|
14
|
+
|
|
15
|
+
## Exemplo
|
|
16
|
+
|
|
17
|
+
```python
|
|
18
|
+
import numpy as np
|
|
19
|
+
|
|
20
|
+
from lifatoolkit import State, create
|
|
21
|
+
|
|
22
|
+
state = State(
|
|
23
|
+
positions=np.random.rand(3, 20) * 5.0,
|
|
24
|
+
velocities=np.zeros((3, 20)),
|
|
25
|
+
)
|
|
26
|
+
simulation = create("md", state=state, box=[5.0, 5.0, 5.0])
|
|
27
|
+
simulation.run(10)
|
|
28
|
+
print(simulation.observables())
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
## Desenvolvimento
|
|
32
|
+
|
|
33
|
+
O ambiente de desenvolvimento e gerenciado com Pixi:
|
|
34
|
+
|
|
35
|
+
```console
|
|
36
|
+
pixi install
|
|
37
|
+
pixi run test
|
|
38
|
+
pixi run lint
|
|
39
|
+
pixi run python examples/run_md.py
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
## Build e publicacao
|
|
43
|
+
|
|
44
|
+
O build gera um wheel e um source distribution. Como o backend Meson usa o
|
|
45
|
+
controle de versao para montar o source distribution, execute os comandos em
|
|
46
|
+
um checkout Git com as alteracoes da versao commitadas.
|
|
47
|
+
|
|
48
|
+
```console
|
|
49
|
+
pixi run build
|
|
50
|
+
pixi run twine check dist/*
|
|
51
|
+
pixi run twine upload --repository testpypi dist/*
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
Depois de validar a instalacao pelo TestPyPI, publique no PyPI:
|
|
55
|
+
|
|
56
|
+
```console
|
|
57
|
+
pixi run twine upload dist/*
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
Uma versao publicada nao pode ser reenviada com o mesmo numero de versao.
|
|
61
|
+
Atualize `version` em `pyproject.toml` para cada nova release.
|
|
62
|
+
|
|
63
|
+
## Estrutura
|
|
64
|
+
|
|
65
|
+
- `src/lifatoolkit/core` - contratos base (`Simulation`, `State`) e registro
|
|
66
|
+
- `src/lifatoolkit/potentials` - potenciais de interacao
|
|
67
|
+
- `src/lifatoolkit/md` - dinamica molecular e integradores
|
|
68
|
+
- `src/lifatoolkit/mc` - Monte Carlo
|
|
69
|
+
- `src/lifatoolkit/quantum` - sistemas quanticos fechados e abertos
|
|
70
|
+
- `src/lifatoolkit/fluids` - SPH
|
|
71
|
+
- `src/lifatoolkit/spins` - dinamica de spins
|
|
72
|
+
- `src/lifatoolkit/viz` - ponte com Blender
|
|
73
|
+
- `src/lifatoolkit/_fortran` - codigo Fortran compilado via f2py
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
"""Exemplo: dinamica molecular com Lennard-Jones."""
|
|
2
|
+
import numpy as np
|
|
3
|
+
|
|
4
|
+
from lifatoolkit import State, available, create
|
|
5
|
+
|
|
6
|
+
print("Simulacoes disponiveis:", available())
|
|
7
|
+
|
|
8
|
+
state = State(
|
|
9
|
+
positions=np.random.rand(3, 100) * 10.0,
|
|
10
|
+
velocities=np.zeros((3, 100)),
|
|
11
|
+
)
|
|
12
|
+
|
|
13
|
+
sim = create("md", state=state, box=[10.0, 10.0, 10.0], ensemble="NVT")
|
|
14
|
+
sim.run(100)
|
|
15
|
+
print(sim.observables())
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
project(
|
|
2
|
+
'lifatoolkit',
|
|
3
|
+
'c', 'fortran',
|
|
4
|
+
version: '0.1.0',
|
|
5
|
+
meson_version: '>=1.3.0',
|
|
6
|
+
default_options: ['warning_level=1', 'buildtype=release'],
|
|
7
|
+
)
|
|
8
|
+
|
|
9
|
+
py = import('python').find_installation(pure: false)
|
|
10
|
+
py_dep = py.dependency()
|
|
11
|
+
|
|
12
|
+
incdir_numpy = run_command(
|
|
13
|
+
py, ['-c', 'import numpy; print(numpy.get_include())'],
|
|
14
|
+
check: true,
|
|
15
|
+
).stdout().strip()
|
|
16
|
+
|
|
17
|
+
incdir_f2py = run_command(
|
|
18
|
+
py, ['-c', 'import numpy.f2py; print(numpy.f2py.get_include())'],
|
|
19
|
+
check: true,
|
|
20
|
+
).stdout().strip()
|
|
21
|
+
|
|
22
|
+
fortranobject_c = incdir_f2py / 'fortranobject.c'
|
|
23
|
+
|
|
24
|
+
subdir('src/lifatoolkit')
|