Skip to main content

Utilities for computational physics with PyTorch

Project description

φtorch: spark up your physics

utilities for computational physics based on PyTorch


pypi docs license


phytorch (φtorch) is a package for doing physics using PyTorch as the backend for computations, which allows parallelisation on GPUs and automatic differentiation. Check out the docs to see what's on offer!

Installation

φtorch consists of Python modules and a PyTorch extension written in C++/CUDA. Therefore, installation has two steps, but should otherwise be fully automatic.

  1. First, clone (or download) the source code, then cd into the root directory and run

    pip install -e .
    

    This will automatically install the few dependencies and the pure-Python code (in developer mode, which means that it won't be installed in the site-packages but will run out of the current directory). If you are not interested in special functions and differentiable cosmographic distances, you’re good to go!

    Note In that case, you can also now install the pure-Python components from PyPI using

    pip install phytorch
    
  2. Then, to compile the extensions,

    cd phytorch-extensions
    python setup.py build_ext
    

    Warning Building the extensions currently requires you to have a CUDA compiler, which, I realise, sucks. I’m working on making a cpu-only version possible.

    Finally, the extensions, which have now been built in a folder like phytorch-extensions/build/lib*, need to be linked to phytorch/extensions:

    cd ../phytorch/extensions
    ln -s ../../phytorch-extensions/build/lib*/* .
    

This program is free software and comes with no warranty except that which can be reasonably expected of computer logic. It is, however, licensed under the GNU General Public Licence v3.0, which disallows closed source re-distribution and any such foul nonsense.

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

phytorch-0.0.42.0.tar.gz (82.0 kB view details)

Uploaded Source

File details

Details for the file phytorch-0.0.42.0.tar.gz.

File metadata

  • Download URL: phytorch-0.0.42.0.tar.gz
  • Upload date:
  • Size: 82.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.10.8

File hashes

Hashes for phytorch-0.0.42.0.tar.gz
Algorithm Hash digest
SHA256 974e8a3b8a5abda26ca9d308fbf3037744d910a6e01c7ce3743aa7ac647da530
MD5 3b907e1bae4d6772c7a5c147a3df0b8d
BLAKE2b-256 f06f29fb161049294c45e48a9902ce951cfbc6cec87a261f929ad42ee5a2e16b

See more details on using hashes here.

Supported by

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