<h1 align="center">
  <br>TorchFSM<br>
</h1>
<h4 align="center">Fourier Spectral Method with PyTorch</h4>
<p align="center">
  [<a href="https://qiauil.github.io/torchfsm/"> Documentation & Examples</a>]
</p>

## TL;DR
`TorchFSM` is a PyTorch-based library for solving PDEs using Fourier spectral method. It is designed for physics-based deep learning and differentiable simulations.

## Feature

* **Modular by design**: TorchFSM offers a modular architecture with essential mathematical operators—like divergence, gradient, and convection—so you can build custom solvers like stacking building blocks, quickly and intuitively.

* **GPU-accelerated**: TorchFSM leverages GPU computing to speed up simulations dramatically. Run complex 3D PDEs in minutes, not hours, with seamless hardware acceleration.

* **Batched simulation support**: Built on PyTorch, TorchFSM enables batched simulations with varied initial conditions—ideal for parameter sweeps, uncertainty quantification, or ensemble analysis.

* **Differentiable and ML-ready**: Fully differentiable by design, TorchFSM integrates naturally with machine learning workflows—for residual operators, differentiable physics, or dataset generation.

## Documentations

Check 👉 [here](https://qiauil.github.io/torchfsm/) for more details.
