libsymtorch 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.
@@ -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,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,30 @@
1
+ # symtorch (distribution: libsymtorch)
2
+
3
+ SymPy-to-Torch conversion and numerical integration helpers.
4
+
5
+ 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.
6
+
7
+ ## Install (dev)
8
+
9
+ pip install -e .
10
+
11
+ ## Install (PyPI/TestPyPI)
12
+
13
+ ```bash
14
+ pip install libsymtorch
15
+ ```
16
+
17
+ ## Quick usage
18
+
19
+ ```python
20
+ import symtorch
21
+ import sympy as sp
22
+
23
+ x = sp.Symbol("x", real=True)
24
+ expr = sp.Integral(sp.exp(-x**2), (x, -sp.oo, sp.oo))
25
+
26
+ lt = symtorch.SymTorch()
27
+ texpr = lt.torchify(expr)
28
+ re, im = texpr.torchquad_integrate(N=121)
29
+ print(re, im)
30
+ ```
@@ -0,0 +1,49 @@
1
+ [build-system]
2
+ requires = ["setuptools>=61.0"]
3
+ build-backend = "setuptools.build_meta"
4
+
5
+ [tool.setuptools]
6
+ package-dir = {"" = "src"}
7
+
8
+ [tool.setuptools.packages.find]
9
+ where = ["src"]
10
+
11
+ [project]
12
+ name = "libsymtorch"
13
+ version = "0.1.0"
14
+ authors = [
15
+ { name="Ibrahim H.I. Abushawish", email="ibrahim.hamed2701@gmail.com" },
16
+ ]
17
+ description = "SymPy-to-Torch conversion and numerical integration"
18
+ readme = "README.md"
19
+ requires-python = ">=3.8"
20
+ license = "MIT"
21
+ license-files = ["LICENSE"]
22
+ dependencies = [
23
+ "torch>=2.5.1",
24
+ "sympy>=1.13.1",
25
+ "torchquad>=0.5.0",
26
+ "numpy>=2.4.2",
27
+ "scipy>=1.17.0",
28
+ "loguru>=0.7.3",
29
+ ]
30
+
31
+ classifiers = [
32
+ "Programming Language :: Python :: 3",
33
+ "Operating System :: OS Independent",
34
+ "Topic :: Scientific/Engineering :: Physics",
35
+ "Topic :: Scientific/Engineering :: Mathematics",
36
+ ]
37
+
38
+ [project.optional-dependencies]
39
+ dev = [
40
+ "pytest>=8",
41
+ "build>=1",
42
+ "twine>=5",
43
+ ]
44
+ examples = [
45
+ "matplotlib>=3.8",
46
+ ]
47
+
48
+ [project.urls]
49
+ "Homepage" = "https://github.com/ibeuler/symtorch"
@@ -0,0 +1,4 @@
1
+ [egg_info]
2
+ tag_build =
3
+ tag_date = 0
4
+
@@ -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,13 @@
1
+ LICENSE
2
+ README.md
3
+ pyproject.toml
4
+ src/libsymtorch.egg-info/PKG-INFO
5
+ src/libsymtorch.egg-info/SOURCES.txt
6
+ src/libsymtorch.egg-info/dependency_links.txt
7
+ src/libsymtorch.egg-info/requires.txt
8
+ src/libsymtorch.egg-info/top_level.txt
9
+ src/symtorch/__init__.py
10
+ src/symtorch/main.py
11
+ tests/test_batching.py
12
+ tests/test_conversion.py
13
+ tests/test_numerical.py
@@ -0,0 +1,14 @@
1
+ torch>=2.5.1
2
+ sympy>=1.13.1
3
+ torchquad>=0.5.0
4
+ numpy>=2.4.2
5
+ scipy>=1.17.0
6
+ loguru>=0.7.3
7
+
8
+ [dev]
9
+ pytest>=8
10
+ build>=1
11
+ twine>=5
12
+
13
+ [examples]
14
+ matplotlib>=3.8
@@ -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
+