Installing NeuralOperator

The neuraloperator Python package provides all necessary tools for implementing operator learning. Once installed, you can import it as neuralop:

import neuralop

Basic Install

Pre-requisites

You will need to have Python 3 installed, as well as NumPy, Scipy, PyTorch, TensorLy and TensorLy-Torch. If you are starting with Python or generally want a pain-free experience, we recommend that you install the Anaconda distribution. It comes ready to use with all prerequisite packages.


Installing with pip

We periodically package neuraloperator for release on PyPI. This version is not guaranteed to be up-to-date with the latest changes to our code.

To install via pip, simply run, in your terminal:

pip install -U neuraloperator

(the -U is optional, use it if you want to update the package).


Building neuraloperator from source

First ensure that you are in an environment with Python 3, NumPy, SciPy, PyTorch, TensorLy and TensorLy-Torch. Then clone the repository and cd there:

git clone https://github.com/neuraloperator/neuraloperator
cd neuraloperator

Then, install the requirements

pip install -r requirements.txt

Then install the package (here in editable mode with -e, or equivalently –editable):

pip install -e .


Advanced dependencies

Fast 3D spatial computing with Open3D

To accelerate spatial computing for 3D applications, we include Open3D as an optional dependency. Open3D includes utilities for reading 3D mesh files and fast 3D neighbor search. To install:

pip install open3d

Note that Open3D is only compatible with specific builds of PyTorch and CUDA. Check the sub-package Open3D-ML documentation for more details.


Sparse computations with PyTorch-Scatter

We use the package torch_scatter (available on PyPI) to speed up neighborhood reductions during the final stage of the IntegralTransform layer, linked here: Graph convolutions and kernel integration.

torch_scatter uses compiled CUDA kernels to perform this reduction, providing both memory efficiency and speed advantages over a native PyTorch implementation.

However, since these kernels are precompiled, it is crucial to install the version of torch_scatter that is built for your specific combination of OS, PyTorch and CUDA. All available wheels can be found here.

Note

The latest PyTorch version for which torch_scatter is built is 2.5.1, so you should downgrade if you are using the latest (torch>=2.6.0) release:

To force-downgrade PyTorch, run

pip install -U torch==2.5.1