Skip to content

Repository files navigation

neural_operators

CI Docs License: GPL-3.0 Python

Library implementing neural operators (DeepONet, PCANet, FNO) and the supporting infrastructure (PDE forward models, Gaussian priors, MCMC, plotting) used to apply them to parametric PDE problems.

Documentation: ceadpx.github.io/neural_operators

Applications (survey article, book chapter) live in a separate repo, applications_neural_operators. Each application there pins the commit or tag of this repo it was built against.

Installation

FEniCSx (dolfinx, ufl, petsc4py, mpi4py) and PyTorch are installed from conda-forge, not pip: they're native/threaded libraries (MPI, OpenMP, BLAS), and mixing a pip-built PyTorch wheel with conda-forge's FEniCSx stack loads two separate OpenMP runtimes into the same process — this is a real, silent-until-it-isn't failure mode (segfaults under load), not a style preference. neuralop.yml installs the whole environment, including this package (editable) and its pip-only dependencies, in one command:

conda env create -f neuralop.yml
conda activate neuralopv2

Developed and verified (fresh-environment install + full test suite) on Apple Silicon; also expected to work on Ubuntu 24.04.

To use a tagged version from another project:

pip install git+https://github.com/CEADpx/neural_operators.git@v1.0.0

(FEniCSx and PyTorch must already be present in that environment, from conda-forge, for the reason above.)

Testing

neuralop.yml includes the test and lint extras, so the environment above is ready to test as soon as it's created:

conda activate neuralopv2
pytest                                    # 44 tests, ~5-10s
pytest --cov=neural_operators --cov-report=term   # with coverage
ruff check src/                           # lint

CI (.github/workflows/ci.yml) runs all three on every push and PR, against the same pinned dolfinx/torch versions as neuralop.yml, and publishes a coverage report to the run summary.

Usage

from neural_operators.prior.priorSampler import PriorSampler
from neural_operators.pde.pdeModel import PDEModel
from neural_operators.nn.deeponet.torch_deeponet import DeepONet
from neural_operators.mcmc.mcmc import MCMC

Repository layout

Package Role
neural_operators.data Load/process FE and grid data for neural networks
neural_operators.pde Forward PDE models (FEniCSx finite elements)
neural_operators.prior Gaussian prior sampling via $C = L_\Delta^{-2}$ (PriorSampler)
neural_operators.nn DeepONet, PCANet, and FNO (PyTorch)
neural_operators.mcmc MCMC for Bayesian inversion
neural_operators.plotting Field and diagnostic plots

Citing this work

Jha, P. K. (2026). From theory to application: A practical introduction to neural operators in scientific computing. Mathematics, 14(13), 2421.

Article: Jha, P. K. (2026). From theory to application: A practical introduction to neural operators in scientific computing. Mathematics, 14(13), 2421. URL

Code: Jha, P. K. (2026). CEADpx: neural_operators (survey26_v2). Zenodo — https://doi.org/10.5281/zenodo.21197314

The snapshot of code used to prepare results for article: Git tag survey26_v2.

About

Implementations of three neural operators and application in Bayesian inference problems

Topics

Resources

Stars

20 stars

Watchers

1 watching

Forks

Releases

Packages

Used by

Contributors

Languages