Skip to main content

SymPy-to-Torch conversion and numerical integration

Project description

symtorch (distribution: libsymtorch)

SymPy-to-Torch conversion and numerical integration helpers.

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.

Install (dev)

pip install -e .

Install (PyPI/TestPyPI)

pip install libsymtorch

Quick usage

import symtorch
import sympy as sp

x = sp.Symbol("x", real=True)
expr = sp.Integral(sp.exp(-x**2), (x, -sp.oo, sp.oo))

lt = symtorch.SymTorch()
texpr = lt.torchify(expr)
re, im = texpr.torchquad_integrate(N=121)
print(re, im)

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

libsymtorch-0.1.0.tar.gz (16.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

libsymtorch-0.1.0-py3-none-any.whl (15.5 kB view details)

Uploaded Python 3

File details

Details for the file libsymtorch-0.1.0.tar.gz.

File metadata

  • Download URL: libsymtorch-0.1.0.tar.gz
  • Upload date:
  • Size: 16.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.0

File hashes

Hashes for libsymtorch-0.1.0.tar.gz
Algorithm Hash digest
SHA256 0c43b1244150e51fd3b4cc929676ce8489ece82c2e3a8e29a3a3c1d46cddc52f
MD5 e3053e10edb247306c8d69bc57c72fdf
BLAKE2b-256 c54e7946c0beeb20ffa39407f0678ca810da2aa64b5ff0e9cba388d268653487

See more details on using hashes here.

File details

Details for the file libsymtorch-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: libsymtorch-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 15.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.0

File hashes

Hashes for libsymtorch-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 476c1848a26d13aeca44116a5e600b0fb4cd7eb76dc9d1db975ffef17cf11053
MD5 8710c3e7d5265ca4ac4c2a4ff46fb9a4
BLAKE2b-256 b05f3c6c814915613738eb84a083a509e8e484dde89ba30a5eb462b7dc48b74d

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page