# DeepXDE: A Python Library for Physics-Informed Neural Networks and Operator Learning

> DeepXDE is a Python library for scientific machine learning that implements physics-informed neural networks (PINNs), deep operator networks (DeepONet), and multifidelity neural networks. It is aimed at researchers in computational science and engineering who want to solve forward and inverse differential equation problems without writing a full neural network training pipeline from scratch.

**lululxvi/deepxde** — A library for scientific machine learning and physics-informed learning

- Repository: https://github.com/lululxvi/deepxde
- Website: https://deepxde.readthedocs.io
- Stars: 4,449 · Forks: 997
- Language: Python
- License: LGPL-2.1
- Published: 2026-09-10 · Updated: 2026-09-10 · Language: en
- Canonical page: https://hysenlabs.com/projects/lululxvi-deepxde

## What DeepXDE Addresses and Its Intended Audience

Traditional numerical methods for solving partial differential equations (PDEs) require generating a mesh over the problem domain, which is difficult and time-consuming for complex geometries. Physics-informed neural networks sidestep meshing by embedding the PDE residual as a loss term during neural network training. DeepXDE implements this approach and several related algorithms, allowing a researcher to specify a differential equation and boundary conditions in code and train a network to approximate the solution.

The library targets scientific researchers who understand differential equations and want to apply machine learning to solve them or learn operators from data. It is not an introduction to neural networks, and the README's documentation assumes familiarity with the mathematical problem formulations it supports.

## Implemented Algorithms: PINNs, DeepONet, and Multifidelity Networks

DeepXDE implements three families of algorithms. Physics-informed neural networks (PINNs) solve forward and inverse ordinary and partial differential equations, including fractional PDEs (fPINN), stochastic PDEs (NN-aPC), integro-differential equations, and topology optimization problems (hPINN with hard constraints). Several techniques for improving PINN accuracy are included: residual-based adaptive sampling, gradient-enhanced PINNs (gPINN), and multi-scale Fourier feature networks.

Deep operator networks (DeepONet) learn mappings between function spaces rather than solving a fixed PDE. DeepXDE includes DeepONet, POD-DeepONet, MIONet for multiple-input operators, Fourier-DeepONet, physics-informed DeepONet, multifidelity DeepONet, and the DeepM&Mnet variant for multiphysics problems.

Multifidelity neural networks (MFNN) combine data from low-fidelity and high-fidelity sources. The library also supports uncertainty quantification through dropout. All components are loosely coupled, as stated in the README, making it possible to substitute sampling strategies, optimizers, or neural network architectures without rewriting unrelated parts.

## Installing DeepXDE and Running the First Example

DeepXDE requires one of five backend frameworks to be installed before the library itself. The backends are TensorFlow 1.x (via tensorflow.compat.v1), TensorFlow 2.x with TensorFlow Probability, PyTorch 2.0 or later, JAX with Flax and Optax, or PaddlePaddle 2.6 or later. Install the chosen backend first according to its own instructions, then install DeepXDE with pip:

```sh
pip install deepxde
```

Alternatively, install from conda-forge:

```sh
conda install -c conda-forge deepxde
```

Developers who want to modify the library can clone the repository and place it alongside their project scripts:

```sh
git clone https://github.com/lululxvi/deepxde.git
```

The documentation at deepxde.readthedocs.io describes how to select a backend using the DDE_BACKEND environment variable and provides worked examples for function approximation, PDE solving, and operator learning. The examples/ directory in the repository is organized by problem type: pinn_forward/, pinn_inverse/, operator/, and function/.

## Geometry Support and Boundary Condition Handling

One of DeepXDE's practical advantages over manually written PINNs is its domain geometry system. Primitive shapes available include the interval, triangle, rectangle, polygon, disk, ellipse, star-shaped domain, cuboid, sphere, hypercube, and hypersphere. Complex domains can be assembled from these primitives using constructive solid geometry operations: union, difference, and intersection. A geometry can also be defined from a point cloud.

The library supports five types of boundary conditions: Dirichlet, Neumann, Robin, periodic, and a general user-defined BC. Each can be applied to an arbitrary domain or to a specific point set. For problems that require hard enforcement of constraints rather than soft penalty terms, DeepXDE includes approximate distance functions.

Sampling of collocation points supports uniform, pseudorandom, Latin hypercube, Halton, Hammersley, and Sobol sequences. Training points can be kept fixed throughout training or resampled adaptively at intervals.

## Limitations and Cases Where DeepXDE Is the Wrong Tool

PINNs are known to be difficult to train on problems with sharp gradients, multiscale phenomena, or very high-dimensional domains. DeepXDE provides techniques such as residual-based adaptive sampling and gradient-enhanced training to mitigate some of these issues, but the README does not claim they eliminate them. The library implements the algorithms; whether any given PDE is tractable with PINNs depends on the problem.

DeepXDE is licensed under the GNU Lesser General Public License version 2.1 (LGPL-2.1). The LGPL-2.1 allows linking the library in proprietary software without the copyleft requirement applying to the containing application, but modifying DeepXDE itself requires sharing those modifications under the same license. Projects that cannot accept any LGPL dependency need a different tool.

The library requires one of five specific backend versions. Environments with a fixed or older version of TensorFlow or PyTorch may find the version constraints in requirements.txt incompatible without upgrading the framework.

## FEniCS: A Verified Finite-Element Alternative

FEniCS is a mature finite-element library for solving PDEs using the traditional variational formulation and mesh-based discretization. It solves the same class of problems (differential equations on complex domains) but through a fundamentally different mechanism: FEniCS generates and solves a linear system derived from the weak form of the PDE, while DeepXDE trains a neural network to approximate the solution.

The practical differences are substantial. FEniCS solutions come with well-understood error bounds tied to mesh resolution, which makes them easier to validate for engineering applications. DeepXDE solutions are approximations whose accuracy depends on the network architecture, training convergence, and the difficulty of the specific PDE, making error quantification harder. FEniCS is the more appropriate tool when a verifiable, mesh-based solution is required. DeepXDE has an advantage for inverse problems, operator learning from data, or domains where mesh generation is prohibitively expensive.

## Maintenance Status and License

The last push to the repository was on 2026-08-18. The repository is not archived. The project follows a versioned release model: recent releases include v1.15.0 in December 2025, v1.14.0 in May 2025, and v1.13.2 in March 2025, showing a cadence of two to four releases per year.

DeepXDE is licensed under the GNU Lesser General Public License version 2.1 (LGPL-2.1). The library is classified as Production/Stable in its PyPI metadata and targets Python 3.9 through 3.12. Citation instructions for academic use are provided in the CITATION.cff file at the repository root.

## Conclusion

DeepXDE is the right tool for researchers in applied mathematics, computational physics, or engineering who need to solve forward or inverse differential equation problems using neural networks and want a library that abstracts away the training loop, geometry meshing, and boundary condition handling. Researchers who need a verified finite-element solver or who cannot accept LGPL-2.1 licensing in their project should look elsewhere. Before using it, choose the backend (PyTorch, JAX, TensorFlow, or PaddlePaddle) and verify that the required version is installed, since DeepXDE does not bundle a backend.

## FAQ

### What is DeepXDE?

DeepXDE is a Python library for scientific machine learning that implements physics-informed neural networks (PINNs), deep operator networks (DeepONet), and multifidelity neural networks for solving forward and inverse differential equation problems.

### How do you install DeepXDE?

Install a supported backend (TensorFlow, PyTorch, JAX, or PaddlePaddle) first, then run pip install deepxde or conda install -c conda-forge deepxde. The README does not specify a minimum GPU requirement beyond what the chosen backend needs.

### How do you use DeepXDE?

You define the differential equation residual, the problem domain geometry, and the boundary conditions using DeepXDE's API, then call the solver to train a neural network approximation. The examples/ directory in the repository provides worked examples organized by problem type.

### How does DeepXDE compare to plain PyTorch?

DeepXDE uses PyTorch as one of five optional backends for tensor operations and automatic differentiation, but it provides a higher-level API specific to differential equations: geometry definitions, boundary condition handling, adaptive sampling, and a training loop that minimizes PDE residuals. Writing the same PINN from scratch in plain PyTorch would require implementing all of that infrastructure manually.

## Sources

- [License: LGPL-2.1](https://github.com/lululxvi/deepxde/blob/master/LICENSE)
- [lululxvi/deepxde on GitHub](https://github.com/lululxvi/deepxde)
- [Project website](https://deepxde.readthedocs.io)
- [README](https://github.com/lululxvi/deepxde/blob/master/README.md)
- [Releases](https://github.com/lululxvi/deepxde/releases)

---

Hysen Labs editorial analysis, written from the project's own repository and release notes. Cite the canonical page: https://hysenlabs.com/projects/lululxvi-deepxde
