Physics-Informed Neural networks for Advanced modeling
News & Announcements
Want the full history? See the Releases page.
What's PINA
PINA provides an intuitive framework for defining, experimenting with, and solving complex problems using Neural Networks, Physics-Informed Neural Networks (PINNs), Neural Operators, and more.
Modular Architecture: Designed with modularity in mind and relying on powerful yet composable abstractions, PINA allows users to easily plug, replace, or extend components, making experimentation and customization straightforward.
Scalable Performance: With native support for multi-device training, PINA handles large datasets efficiently, offering performance close to hand-crafted implementations with minimal overhead.
Highly Flexible: Whether you're looking for full automation or granular control, PINA adapts to your workflow. High-level abstractions simplify model definition, while expert users can dive deep to fine-tune every aspect of the training and inference process.
Installation
Install a stable release
pip install "pina-mathlab"
Install from source
git clone https://github.com/pina-org/PINA cd PINA git checkout master pip install .
Install with extra dependencies
To install additional packages required for development, tests, docs, or tutorials:
pip install "pina-mathlab[extras]"
Available extras:
dev for development purposes
test for running tests locally
doc for building documentation locally
tutorial for running tutorials
Getting started with PINA
Solving a differential problem in PINA follows a clean four-step pipeline:
Define the problem and constraints using the
Problem API.
Design your model using PyTorch, PyTorch Geometric, or import from the
Model API.
Select or build a Solver using the
Solver API.
Train with the
Trainer API,
powered by PyTorch Lightning.flowchart LR
STEP1["
Problem and Data
Define the mathematical problem
Identify constraints or import data"]
STEP2["
Model Design
Build a PyTorch module Choose or customize a model"]
STEP3["
Solver Selection
Use available solvers or define your own strategy"]
STEP4["
Training
Optimize the model with PyTorch Lightning"]
STEP1 e1@--> STEP2
STEP2 e2@--> STEP3
STEP3 e3@--> STEP4
e1@{ animate: true }
e2@{ animate: true }
e3@{ animate: true }Want to dive deeper? Check out the official Tutorials.
PINA by Examples
Data-Driven Modeling Example
…Physics-Informed Example
Consider the following differential problem:
$$ \begin{cases} \frac{d}{dx}u(x) &= u(x) \quad x \in(0,1)\ u(x=0) &= 1 \end{cases} $$
In PINA, this can be implemented as:
…AI-Assisted Development
This repository includes AI agent skills (guides for opencode, Claude Code, Cursor) that walk you through the full PINA workflow — from problem definition to trained solver — through natural conversation.
Skills are located at .opencode/skills/<name>/SKILL.md and cover:
pina-workflow — Orchestrates a complete session (entry point)
create-problem — Setting up physics-driven or data-driven problems
define-domains — Creating and discretising domains
define-equations — Writing PDEs/ODEs and using the equation zoo
condition-setup — Binding equations to domains
select-model, select-solver, select-trainer — Architecture and training
Just open the project in a compatible agent and start describing your problem — the agent will guide you step by step.
Or type /pina-agentic (in opencode or Claude Code) to launch an interactive session that walks you through the full workflow end-to-end.
Contributing & Community
We would love to develop PINA together with the community. A great place to start is the list of
good-first-issue
issues.
If you would like to contribute, please read the Contributing Guide.
Made with contrib.rocks.
Citation
If PINA has been significant in your research and you would like to acknowledge it, please cite:
Coscia, D., Ivagnes, A., Demo, N., & Rozza, G. (2023). Physics-Informed Neural networks for Advanced modeling. Journal of Open Source Software, 8(87), 5352.
Or in BibTeX format:
@article{coscia2023physics, title={Physics-Informed Neural networks for Advanced modeling}, author={Coscia, Dario and Ivagnes, Anna and Demo, Nicola and Rozza, Gianluigi}, journal={Journal of Open Source Software}, volume={8}, number={87}, pages={5352}, year={2023} }
No open issues yet, or sync has not completed.