physics_in_parallel 4.2.0-alpha

High-performance infrastructure for numerical simulations in physics
Documentation
# 2. Installation

**Outcome:** create a Rust application that consumes the published PiP package.
You need Rust 1.97 or newer and Cargo. Python is optional and used only for the
external NumPy helper introduced in chapter 9.

## Create an application

```sh
rustc --version
cargo new pip-simulation
cd pip-simulation
cargo add physics_in_parallel@=4.2.0-alpha
cargo add rayon@1.12
```

Use the exact alpha pin. The package name is `physics_in_parallel`, and Rust
imports use the same spelling. `Physics in Parallel` and `PiP` are its display
names. Cargo's package name and the title in documentation are separate concerns.

If you prefer editing the manifest, the next chapter supplies a complete one.
`rayon` is a direct application dependency because that example creates its own
pool; PiP does not create or resize one. Applications already running inside a
framework-owned pool should use that pool instead.

Commit the application's `Cargo.lock`. Cargo downloads the online PiP version;
do not substitute unpublished source or a path override for a public dependency.

## Use release builds for numerical workloads

```sh
cargo build --release
cargo run --release
```

Put performance profiles in the application's workspace-root `Cargo.toml`.
Dependency profiles do not configure your application. The complete recommended
profile and its tradeoffs are in [performance](../PERFORMANCE.md#release-builds).
Start with ordinary release settings; add CPU-specific build flags only for an
explicit deployment target and measured need.

## Run the repository examples

For a checkout used to explore PiP or contribute documentation:

```sh
git clone https://github.com/dingyisun0101/Physics-in-Parallel.git
cd Physics-in-Parallel
cargo run --release --example basic_particle
```

This runs the repository's own example. An external application should continue
to consume the published crate. The source repository includes the numerical
reference tests, benchmarks, and the optional Python helper.

## Checkpoint

You should have a Rust application and a resolved published dependency. If a
method or import from old code no longer exists, consult [release migration](../RELEASES.md)
instead of adding guessed compatibility wrappers. General project adoption has
its own [migration procedure](../AGENTS.md#migrate-an-existing-project-to-pip).

---

**Previous:** [1. Overview](1-overview.md) ยท **Guide index:** [Documentation](../README.md)

**Next:** [3. Your first simulation](3-first-simulation.md)