TorchPhysics is an open source software and requires only a Python environment for installation.
We recommend to use Anaconda for managing the software. Follow the guide on the offcial conda-page, if you need to create a Python environment.
Once your environment is set up, we recommend the following steps to install TorchPhysics:
Open a terminal or the Anaconda Prompt (Windows) and create a new conda environment by running:
conda create --name torchphysics python=3.9
Activate the new environment by:
conda activate torchphysics
Install pip:
conda install pip
Install TorchPhysics via:
pip install torchphysics[all]
The above procedure will automatically install all required packages and dependencies, notably:
- Python ≥ 3.8
- PyTorch ≥ 2.0.0
- PyTorch-Lightning ≥ 2.0.0
- Numpy ≥ 1.20.2
- Matplotlib ≥ 3.0.0
- Scipy ≥ 1.6.3
To check if the installation was successful follow the first the steps in the Tutorial.
Developer Installtion
If you desire the add functionalities or modify the library, the source code is freely available on GitHub.
Copying and installing TorchPhysics can be achieved with the following commands:
git clone https://github.com/boschresearch/torchphysics cd path_to_torchphysics_folder pip install .[all]
Legacy Version (PyTorch Version < 2.0)
Older versions of TorchPhysics, that use PyTorch versions < 2.0, can be installed by
pip install torchphysics==1.0.2
Note, this version is no longer mentained.