Physics in Parallel (PiP)
Write the physics. Reuse the numerical machinery.
Scientific software needs more than equations: numerical storage, random sampling, spatial bookkeeping, particle state, and parallel execution all take work. PiP supplies reusable Rust building blocks so you can spend more time on your model and less time rebuilding that infrastructure.
From numerical arrays to particle simulations
| Your project needs | PiP supplies |
|---|---|
| Numerical containers | Tensors, matrices, and lists of vectors with explicit dense or sparse storage. |
| Reproducible randomness | Explicit RNG methods and seeds, sampling, and indexed generation where supported. |
| Spatial structure | Boundaries, square lattices, pair generation, and neighbor lists. |
| Particle dynamics | Canonical attributes, spring and power-law networks, integrators, thermostats, and observations. |
| Parallel numerical work | Operations using your active Rayon pool, participation limits, and internal SIMD dispatch. |
| Data interchange | Validated Serde representations and an optional NumPy conversion helper. |
Use just the numerical foundations, add the ready-made particle models, or opt into advanced storage and generic engines. Your application owns its equations, units, time loop, configuration, and saved results.
See a complete simulation · Explore the API · Browse examples
Give your AI assistant a smaller job
Describe the model, its shapes, boundary conditions, seeds, and numerical constraints. An AI assistant can assemble documented PiP APIs instead of inventing storage, sampling, or particle infrastructure. Reusing those APIs can reduce generated code and the tokens spent explaining and repairing it. Scientific choices still need your review.
All AI assistants working with PiP must read docs/AGENTS.md before proposing or changing an integration. It records API boundaries, numerical invariants, reproducibility requirements, and validation expectations.
Migrating an existing project? The instructions are already available: the project migration procedure maps handwritten numerical infrastructure to PiP, preserves the physics, and explains how to validate the transition. Start with one bounded component and expand after its results agree with the baseline.
Start here
Install the published package with an exact alpha pin:
[]
= "=4.1.1-alpha"
Rust 1.97 or newer is required. The numbered guide takes you from installation to a working simulation, then into each numerical subsystem. Every chapter links to the next.
- Overview
- Installation
- Your first simulation
- Tensors, matrices, and vectors
- Randomness and sampling
- Spaces, lattices, and pairs
- Particle state
- Forces, integration, and thermostats
- Serialization and NumPy
- Parallelism and performance
- Advanced extensions
- AI-assisted integration
Performance you can inspect
PiP combines reusable output buffers, explicit storage choices, parallel work, and runtime SIMD selection. The performance guide, benchmark results, and independent correctness checks explain the measured behavior and numerical contracts. Choose settings against your actual workload.
Alpha compatibility
The 4.1 generation replaces the 3.x API. Public APIs and serialized formats may change between alpha releases; pin the exact version and review release migration notes before upgrading old code or data. Version 4.1.1-alpha is a documentation patch with unchanged runtime code, public API, and serialized formats from 4.1.0-alpha.