neuraloperator: a PyTorch library for learning maps between function spaces
Learning in infinite dimension with neural operators.
At a glance
- What is it?
- neuraloperator packages Fourier Neural Operators and other operator architectures for PyTorch. It is aimed at researchers who need resolution-invariant surrogates for PDE solvers, and its main trade-offs are memory and data cost.
- Who is it for?
- Adopt neuraloperator if you already have paired input and output fields from a solver and need a surrogate that can be evaluated at resolutions other than the training grid. Do not adopt it if you only have observational data with no underlying operator, or if you need a solver that enforces conservation laws exactly.
- Can I use it commercially?
- Yes. MIT is a permissive licence: you can use, modify and sell software built on it, as long as you keep its copyright and licence notices.
- Is it still maintained?
- Yes. The repository last received commits 36 days ago.
- What is it written in?
- Mainly Python, according to GitHub's language statistics.
Answers come from the project's GitHub data, last synced on November 22, 2026, and from our analysis. They are not legal advice.
Star history
- neuraloperator/neuraloperator3,998 ★ · +83
| Repository | 2026-09-26 | 2026-11-22 |
|---|---|---|
| neuraloperator/neuraloperator | 3.9k | 4k |
83 Stars in the last 57 days, measured from the daily GitHub snapshot. Compare with other projects
Editorial analysis
What neuraloperator solves, and for whom
A conventional neural network maps a fixed-size vector to another fixed-size vector. A neural operator maps a function to another function. That distinction matters when the object you want to predict is a field: a temperature distribution, a velocity field, a stress tensor. The library's own description states that neural operators enable learning mapping between function spaces, and that they are resolution invariant, so your trained operator can be applied on data of any resolution. In practice this means you can train on a coarse grid and evaluate on a finer one without retraining.
The audience is narrow and identifiable. You are doing computational science or engineering, you have a numerical solver, and you can generate paired input and output fields by running it. The library is the official implementation of Fourier Neural Operators, so it is the reference codebase for that method rather than a wrapper around someone else's. The README also positions it as part of the PyTorch Ecosystem, which matters if your existing training loop, optimizer and distributed setup are already PyTorch.
How FNO and TFNO actually compute a forward pass
The core mechanism is a global convolution implemented as a multiplication in Fourier space. The README's quickstart constructs an FNO with n_modes=(64, 64), hidden_channels=64, in_channels=2 and out_channels=1. The n_modes tuple is the number of Fourier modes retained per spatial axis. The input field is transformed, the retained low-frequency modes are multiplied by learned complex weights, and the result is transformed back. Because the learned weights are indexed by mode rather than by grid position, the same operator applies to a different grid size at inference.
Truncating the mode set is what keeps the layer affordable. A dense spectral convolution would need a weight for every frequency the grid can represent. Keeping 64 modes per axis discards high frequencies, which is a modeling assumption, not an implementation detail. If your solution has sharp gradients or discontinuities, those live in the frequencies being cut.
TFNO attacks the parameter count from a different angle. The README states that a Tucker-factorized TFNO has 10% of the parameters of an equivalent dense Fourier Neural Operator. The constructor takes factorization='tucker', implementation='factorized' and rank=0.1. The README explains that the forward pass contracts the inputs directly with the factors of the decomposition. The trade-off is that factorized contraction is a different kernel from a dense matmul, and whether it is faster on your hardware depends on the contraction shapes rather than on the parameter count alone.
Installing neuraloperator from PyPI or from source
The README gives two routes. The first is a local editable install, which the README recommends so that changes in the code are immediately reflected without having to reinstall. The second is the stable release on PyPI.
pip install neuraloperatorFor development, the README's sequence clones the repository, enters it, installs the package in editable mode, then installs the requirements file. Note that this is two separate commands and the second one pulls the full requirements list, not just the package dependencies.
pip install -e .
pip install -r requirements.txtThe project metadata requires Python 3.9 or newer. Dependencies listed in pyproject.toml include wandb, ruamel-yaml, zencfg, configmypy, tensorly, tensorly-torch, matplotlib, numpy>=1.25, opt-einsum and h5py. The separate requirements.txt adds zarr and torch-harmonics. If you want the development extras, the pyproject.toml defines a dev extra containing pytest, flaky and black, installed with pip install -e ".[dev]".
Once installed, the smallest useful thing you can do is instantiate an operator and inspect its parameter count before you have any data.
from neuralop.models import FNO
operator = FNO(n_modes=(64, 64),
hidden_channels=64,
in_channels=2,
out_channels=1)
print(sum(p.numel() for p in operator.parameters()))That number is what you compare against the TFNO variant. Swapping the class to TFNO with factorization='tucker', implementation='factorized' and rank=0.1 is the only change the README shows for the factorized path.
If you want experiment tracking, the README says to create a file in neuraloperator/config called wandb_api_key.txt and paste your W&B API key there. That is a plaintext key on disk, which is worth knowing before you put the directory under version control.
Where neuraloperator is the wrong tool
The library assumes you can generate supervised pairs. If your only data is observational and you cannot run the underlying solver, you have no target fields to regress against, and the training loop has nothing to consume. A physics-informed approach that puts the residual of the PDE into the loss does not need paired data, and neuraloperator is not that.
The resolution-invariance claim is also weaker than it first sounds. The operator is resolution invariant in the sense that the same weights apply at any grid size, but the modes you kept were chosen for the training resolution. Evaluating far outside that band is extrapolation in frequency, and the README does not document any error behavior for that case.
Memory is the third constraint. The retained mode set grows with the number of spatial dimensions. A two-dimensional problem with n_modes=(64, 64) is already 4096 mode pairs per layer per channel pair, and the README's examples are all two-dimensional. The README does not document a memory budget or a recommended maximum for three-dimensional problems, so that limit has to be measured on your own hardware.
Finally, the library gives you a learned surrogate, not a solver. It does not enforce conservation laws, boundary conditions or any other physical invariant by construction. If your application cannot tolerate a small violation of those properties, a surrogate is the wrong layer to add.
neuraloperator compared with PINNs and with a plain surrogate network
The closest conceptual alternative is a physics-informed neural network. The difference is in what supervises training. A PINN typically optimizes a network to satisfy a differential equation residual at sampled collocation points, so it can be trained without any solver output. neuraloperator is supervised: it learns the map from input fields to output fields that your solver produced. A PINN gives you one solution per trained network; an operator gives you a map you can query with new inputs.
A second alternative is a plain convolutional surrogate trained on the same paired data. A CNN is tied to the grid it was trained on, because its kernels are defined in pixel space. To evaluate at a different resolution you resample, which changes the effective filter size in physical units. The FNO's spectral weights do not have that problem, which is the concrete reason to prefer an operator when your evaluation grid differs from your training grid.
The library also covers more than FNO. The repository's examples directory is organized into data, data_gen, layers, models and training, and the topics list includes tensor methods and tensorly, which reflects the factorized variants. The README's contribution section states the project's mission as providing implementations of neural operator methods from foundations to the cutting edge, including new architectures, meta-algorithms, training methods and benchmark datasets.
Maintenance, release cadence and licence
The repository is not archived, and the last push was on 2026-08-06. The most recent release is 2.0.0, published on 2025-10-22, described as a major release. Before that, 1.0.2 landed on 2024-12-30 and 1.0.1 on 2024-12-20. The gap between the 1.0.x line and 2.0.0 is roughly ten months, so the versioning is not a rapid patch cadence. A major version bump means you should read the release notes before upgrading a pinned environment, and the README does not document a deprecation policy or a rollback path.
The licence is MIT, declared in pyproject.toml as license = {text = "MIT"} and present as a LICENSE file at the repository root. MIT is permissive: it allows commercial use and modification provided the copyright notice and permission notice are retained. That is a statement about the licence text, not legal advice, and if you are shipping a product you should have your own counsel read the file rather than this paragraph.
One dependency detail is worth flagging for reproducibility. The doc and all extras pin torch_harmonics==0.7.4, while requirements.txt lists torch-harmonics without a version. If you install via the requirements file rather than the extra, you get whatever version resolves, which can differ from what the documentation build uses.
Version 2.0.0 and the practical upgrade question
The jump to 2.0.0 is the single most consequential fact for anyone already running this library. A major version in a research codebase usually means changed constructor signatures or moved modules, and no changelog is included with the README, so the specific breakages are not visible from the README alone. The constructor shown for FNO and TFNO is the current documented form, which is what you should compare your existing code against.
The safe path is to pin. If your training runs are reproducible and you depend on them for a paper or a production pipeline, pin the version you validated and upgrade deliberately after checking the release notes on the repository. The pyproject.toml uses dynamic versioning read from neuralop.__version__, so the installed version is queryable at runtime rather than only from package metadata.
There is also a citation obligation that is easy to miss. The README asks that academic users cite the library paper and consider citing the practical guide and the JMLR neural operator paper. If you publish results produced with this code, that is part of the cost of using it.
Editorial conclusion
Adopt neuraloperator if you already have paired input and output fields from a solver and need a surrogate that can be evaluated at resolutions other than the training grid. Do not adopt it if you only have observational data with no underlying operator, or if you need a solver that enforces conservation laws exactly. Before committing, verify that your data pipeline produces the tensor shapes the FNO constructor expects and check the disk and memory cost of the largest n_modes you plan to use, since the README gives no guidance on either.
Frequently asked questions
What is the key difference between a neural network and a neural operator?
A regular neural network learns a mapping between vectors of fixed size, while a neural operator learns a mapping between function spaces. The README states that neural operators are resolution invariant, so a trained operator can be applied to data of any resolution.
What is the architecture of a neural operator in neuraloperator?
The library's flagship architecture is the Fourier Neural Operator, constructed as FNO with parameters such as n_modes, hidden_channels, in_channels and out_channels. The n_modes tuple sets how many Fourier modes are retained per spatial axis, and a TFNO variant applies a Tucker factorization to the weights.
How do I install neuraloperator?
The README gives two routes: pip install neuraloperator for the stable PyPI release, or cloning the repository and running pip install -e . followed by pip install -r requirements.txt for a local editable install. The project requires Python 3.9 or newer.
Does neuraloperator support experiment tracking?
Yes. The README says that to use W&B logging features you create a file in neuraloperator/config called wandb_api_key.txt and paste your W&B API key there, and wandb is listed as a dependency in pyproject.toml.
What licence does neuraloperator use?
The licence is MIT, declared in pyproject.toml and present as a LICENSE file at the repository root. MIT permits commercial use and modification as long as the copyright and permission notices are retained.
Official sources
Add this badge to your README
If you maintain this project, the badge below links readers to this analysis and shows its maintenance status from the daily GitHub snapshot. Paste the markdown into your README; add ?metric=license or ?metric=stars to the image URL for a different field.
[](https://hysenlabs.com/projects/neuraloperator-neuraloperator)Star history chart for your README
[](https://hysenlabs.com/projects/neuraloperator-neuraloperator)Was this useful?