libsymtorch 0.1.0__py3-none-any.whl
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.
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: libsymtorch
|
|
3
|
+
Version: 0.1.0
|
|
4
|
+
Summary: SymPy-to-Torch conversion and numerical integration
|
|
5
|
+
Author-email: "Ibrahim H.I. Abushawish" <ibrahim.hamed2701@gmail.com>
|
|
6
|
+
License-Expression: MIT
|
|
7
|
+
Project-URL: Homepage, https://github.com/ibeuler/symtorch
|
|
8
|
+
Classifier: Programming Language :: Python :: 3
|
|
9
|
+
Classifier: Operating System :: OS Independent
|
|
10
|
+
Classifier: Topic :: Scientific/Engineering :: Physics
|
|
11
|
+
Classifier: Topic :: Scientific/Engineering :: Mathematics
|
|
12
|
+
Requires-Python: >=3.8
|
|
13
|
+
Description-Content-Type: text/markdown
|
|
14
|
+
License-File: LICENSE
|
|
15
|
+
Requires-Dist: torch>=2.5.1
|
|
16
|
+
Requires-Dist: sympy>=1.13.1
|
|
17
|
+
Requires-Dist: torchquad>=0.5.0
|
|
18
|
+
Requires-Dist: numpy>=2.4.2
|
|
19
|
+
Requires-Dist: scipy>=1.17.0
|
|
20
|
+
Requires-Dist: loguru>=0.7.3
|
|
21
|
+
Provides-Extra: dev
|
|
22
|
+
Requires-Dist: pytest>=8; extra == "dev"
|
|
23
|
+
Requires-Dist: build>=1; extra == "dev"
|
|
24
|
+
Requires-Dist: twine>=5; extra == "dev"
|
|
25
|
+
Provides-Extra: examples
|
|
26
|
+
Requires-Dist: matplotlib>=3.8; extra == "examples"
|
|
27
|
+
Dynamic: license-file
|
|
28
|
+
|
|
29
|
+
# symtorch (distribution: libsymtorch)
|
|
30
|
+
|
|
31
|
+
SymPy-to-Torch conversion and numerical integration helpers.
|
|
32
|
+
|
|
33
|
+
Note: this module was first developed for libphysics (and remains compatible): https://github.com/ferhatpy/libphysics — then it was split out into a standalone library.
|
|
34
|
+
|
|
35
|
+
## Install (dev)
|
|
36
|
+
|
|
37
|
+
pip install -e .
|
|
38
|
+
|
|
39
|
+
## Install (PyPI/TestPyPI)
|
|
40
|
+
|
|
41
|
+
```bash
|
|
42
|
+
pip install libsymtorch
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
## Quick usage
|
|
46
|
+
|
|
47
|
+
```python
|
|
48
|
+
import symtorch
|
|
49
|
+
import sympy as sp
|
|
50
|
+
|
|
51
|
+
x = sp.Symbol("x", real=True)
|
|
52
|
+
expr = sp.Integral(sp.exp(-x**2), (x, -sp.oo, sp.oo))
|
|
53
|
+
|
|
54
|
+
lt = symtorch.SymTorch()
|
|
55
|
+
texpr = lt.torchify(expr)
|
|
56
|
+
re, im = texpr.torchquad_integrate(N=121)
|
|
57
|
+
print(re, im)
|
|
58
|
+
```
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
libsymtorch-0.1.0.dist-info/licenses/LICENSE,sha256=KycCrXGVIIW84jdbS0axUKKNuZQFIuTUXprNz4RS9Ps,1101
|
|
2
|
+
symtorch/__init__.py,sha256=EZh3AnVF1dy0LBqF-GzncUFI0LX53B-5oASb78U4ULk,841
|
|
3
|
+
symtorch/main.py,sha256=-ernpbiZrlucbvCCOK4oXuS5iK4KajFw0OMBfyBhbxc,52886
|
|
4
|
+
libsymtorch-0.1.0.dist-info/METADATA,sha256=7Nv6afYO_vsZtFCoAAMVYhh-xT4hKIe_wdyz7d7jka0,1673
|
|
5
|
+
libsymtorch-0.1.0.dist-info/WHEEL,sha256=aeYiig01lYGDzBgS8HxWXOg3uV61G9ijOsup-k9o1sk,91
|
|
6
|
+
libsymtorch-0.1.0.dist-info/top_level.txt,sha256=Br82qoMtqncOuodZtKU-LBlapoCQUGcDdvyV7mNtryo,9
|
|
7
|
+
libsymtorch-0.1.0.dist-info/RECORD,,
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Ibrahim H.I. Abushawish
|
|
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 @@
|
|
|
1
|
+
symtorch
|
symtorch/__init__.py
ADDED
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
"""symtorch package.
|
|
2
|
+
|
|
3
|
+
This package is intended to be used as a standalone library:
|
|
4
|
+
|
|
5
|
+
import symtorch
|
|
6
|
+
lt = symtorch.SymTorch()
|
|
7
|
+
|
|
8
|
+
The implementation lives in :mod:`symtorch.main` and is re-exported here for
|
|
9
|
+
convenient imports.
|
|
10
|
+
"""
|
|
11
|
+
|
|
12
|
+
from .main import (
|
|
13
|
+
SymTorch,
|
|
14
|
+
TorchExpr,
|
|
15
|
+
torchify,
|
|
16
|
+
torchquad_integrate,
|
|
17
|
+
torch_integrate_batched,
|
|
18
|
+
torch_integrate_batched_simpson,
|
|
19
|
+
)
|
|
20
|
+
|
|
21
|
+
try:
|
|
22
|
+
from importlib.metadata import version as _pkg_version
|
|
23
|
+
|
|
24
|
+
# Distribution name may differ from import package name.
|
|
25
|
+
try:
|
|
26
|
+
__version__ = _pkg_version("libsymtorch")
|
|
27
|
+
except Exception:
|
|
28
|
+
__version__ = _pkg_version("symtorch")
|
|
29
|
+
except Exception:
|
|
30
|
+
__version__ = "0.0.0"
|
|
31
|
+
|
|
32
|
+
__all__ = [
|
|
33
|
+
"SymTorch",
|
|
34
|
+
"TorchExpr",
|
|
35
|
+
"torchify",
|
|
36
|
+
"torchquad_integrate",
|
|
37
|
+
"torch_integrate_batched",
|
|
38
|
+
"torch_integrate_batched_simpson",
|
|
39
|
+
"__version__",
|
|
40
|
+
]
|
|
41
|
+
|