# Lettuce: PyTorch-based Lattice Boltzmann Framework

arXiv: https://arxiv.org/abs/2106.12929 · HTML: https://mlsanity.com/paper/2106.12929/

## Key facts

- Cited by 7 papers in the map (data through 14 Oct 2026).
- Builds on 6 of its 48 references that are in the map.
- First posted on arXiv 24 Jun 2021.

## Builds on (most cited first, 6 of 6)

- [PyTorch: An Imperative Style, High-Performance Deep Learning Library](https://mlsanity.com/paper/1912.01703/) (2019)
- [Machine learning accelerated computational fluid dynamics](https://mlsanity.com/paper/2102.01010/) (2021)
- [Machine Learning for Fluid Mechanics](https://mlsanity.com/paper/1905.11075/) (2019)
- [Solver-in-the-Loop: Learning from Differentiable Physics to Interact with Iterative PDE-Solvers](https://mlsanity.com/paper/2007.00016/) (2020)
- [Lat-Net: Compressing Lattice Boltzmann Flow Simulations using Deep Neural Networks](https://mlsanity.com/paper/1705.09036/) (2017)
- [waLBerla: A block-structured high-performance framework for multiphysics simulations](https://mlsanity.com/paper/1909.13772/) (2019)

## Built on by (most cited first, 7 of 7)

- [Controlled Latent Diffusion Models for 3D Porous Media Reconstruction](https://mlsanity.com/paper/2503.24083/) (2025)
- [Optimal Lattice Boltzmann Closures through Multi-Agent Reinforcement Learning](https://mlsanity.com/paper/2504.14422/) (2025)
- [Full Domain Analysis in Fluid Dynamics](https://mlsanity.com/paper/2505.22275/) (2025)
- [Enhancing lattice kinetic schemes for fluid dynamics with Lattice-Equivariant Neural Networks](https://mlsanity.com/paper/2405.13850/) (2024)
- [Beyond Blur: A Fluid Perspective on Generative Diffusion Models](https://mlsanity.com/paper/2506.16827/) (2025)
- [Efficient Quality Diversity Optimization of 3D Buildings through 2D Pre-optimization](https://mlsanity.com/paper/2303.15896/) (2023)
- [Fast-Forward Lattice Boltzmann: Learning Kinetic Behaviour with Physics-Informed Neural Operators](https://mlsanity.com/paper/2509.22411/) (2025)

## Abstract (arXiv)

The lattice Boltzmann method (LBM) is an efficient simulation technique for computational fluid mechanics and beyond. It is based on a simple stream-and-collide algorithm on Cartesian grids, which is easily compatible with modern machine learning architectures. While it is becoming increasingly clear that deep learning can provide a decisive stimulus for classical simulation techniques, recent studies have not addressed possible connections between machine learning and LBM. Here, we introduce Lettuce, a PyTorch-based LBM code with a threefold aim. Lettuce enables GPU accelerated calculations with minimal source code, facilitates rapid prototyping of LBM models, and enables integrating LBM simulations with PyTorch's deep learning and automatic differentiation facility. As a proof of concept for combining machine learning with the LBM, a neural collision model is developed, trained on a doubly periodic shear layer and then transferred to a different flow, a decaying turbulence. We also exemplify the added benefit of PyTorch's automatic differentiation framework in flow control and optimization. To this end, the spectrum of a forced isotropic turbulence is maintained without further constraining the velocity field. The source code is freely available from https://github.com/lettucecfd/lettuce.
