Skip to main content

PDE-Transformer: Efficient and Versatile Transformers for Physics Simulations

Project description

PDE-Transformer: Efficient and Versatile Transformers for Physics Simulations


Authors: Benjamin Holzschuh, Qiang Liu, Georg Kohl, Nils Thuerey

PDE-Transformer is a state-of-the-art neural architecture for physics simulations, specifically designed for partial differential equations (PDEs) on regular grids. This work will be presented at ICML 2025.

Key Highlights

  • Production Ready: Available as a pip package for easy installation and experimentation.
  • State-of-the-Art: Outperforms existing methods across 16 different types of PDEs and three challenging downstream tasks involving complex dynamics.
  • Transfer Learning: Improved performance when adapting pre-trained models to new physics problems with limited training data.
  • Open Source: Full implementation with pre-trained models and comprehensive documentation.

Quick Installation

# Install from Test PyPI
pip install pdetransformer

# Or install from source
git clone https://github.com/pde-transformer/pde-transformer.git
cd pde-transformer
pip install -e .

Model Description

PDE-Transformer is designed to efficiently process and predict the evolution of physical systems described by partial differential equations (PDEs). It can handle multiple types of PDEs, different resolutions, domain extents, boundary conditions, and includes deep conditioning mechanisms for PDE- and task-specific information.

Key features:

  • Multi-scale architecture with token down- and upsampling for efficient modeling.
  • Shifted window attention for improved scaling to high-resolution data.
  • Mixed Channel (MC) and Separate Channel (SC) representations for handling multiple physical quantities.
  • Flexible conditioning mechanism for PDE parameters, boundary conditions, and simulation metadata.
  • Pre-training and fine-tuning capabilities for transfer learning across different physics domains.

Training Objectives

The model supports both supervised and diffusion training:

  • Supervised Training: Direct MSE loss for deterministic, unique solutions. Fast training and inference.
  • Flow Matching: For probabilistic modeling and uncertainty quantification.

Supported PDE Types

PDE-Transformer has been trained and evaluated on 16 different types of PDEs including:

  • Linear PDEs: Diffusion
  • Nonlinear PDEs: Burgers, Korteweg-de-Vries, Kuramoto-Sivashinsky
  • Reaction-Diffusion: Fisher-KPP, Swift-Hohenberg, Gray-Scott
  • Fluid Dynamics: Navier-Stokes (Decaying Turbulence, Kolmogorov Flow)

Usage

Quick Start

from pdetransformer.core.mixed_channels import PDETransformer
import torch

# Load pre-trained model
model = PDETransformer.from_pretrained('thuerey-group/pde-transformer', subfolder='mc-s').cuda()

# For physics simulation
x = torch.randn((1,2,256,256), dtype=torch.float32).cuda()
predictions = model(x)

Documentation

For detailed documentation, visit tum-pbs.github.io/pde-transformer.

Citation

If you use PDE-Transformer in your research, please cite:

@article{holzschuh2024pde,
  title={PDE-Transformer: Efficient and Versatile Transformers for Physics Simulations},
  author={Holzschuh, Benjamin and Liu, Qiang and Kohl, Georg and Thuerey, Nils},
  booktitle={Forty-second International Conference on Machine Learning, {ICML} 2025, Vancouver, Canada, July 13-19, 2025},
  year={2025}
}

License

This project is licensed under the MIT License. See the LICENSE file for details.


Note: This is a research project from the Technical University of Munich (TUM) Physics-based Simulation Group. For questions and support, please refer to the GitHub repository or contact the authors.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pdetransformer-0.1.7.tar.gz (17.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

pdetransformer-0.1.7-py3-none-any.whl (15.1 kB view details)

Uploaded Python 3

File details

Details for the file pdetransformer-0.1.7.tar.gz.

File metadata

  • Download URL: pdetransformer-0.1.7.tar.gz
  • Upload date:
  • Size: 17.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.11.7

File hashes

Hashes for pdetransformer-0.1.7.tar.gz
Algorithm Hash digest
SHA256 220a85265281e2c980f0363c751964fa5793bfb64aba02828b357679051e6690
MD5 496aa6dde65a316a4deb67a4f5aa5ae9
BLAKE2b-256 1d491077b0c7cb89c33a8a189c9f9e3b21120657542ac1c1961d861eb26a513b

See more details on using hashes here.

File details

Details for the file pdetransformer-0.1.7-py3-none-any.whl.

File metadata

  • Download URL: pdetransformer-0.1.7-py3-none-any.whl
  • Upload date:
  • Size: 15.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.11.7

File hashes

Hashes for pdetransformer-0.1.7-py3-none-any.whl
Algorithm Hash digest
SHA256 948e35d9b956bfdfdf2f052454ff6bc07f4dc4542c1b8a485b7d0c72bd3684c5
MD5 c28b695b858eafa2f009695775a84873
BLAKE2b-256 4721a27f5b63aacbe77fec2ac4e215367cfc22bb0f4a3e4a7db4415b4fcefc25

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page