CPax
CPax is an open-source, JAX-based library for computational physics. It separates physical systems, problems, solvers and solutions in reusable workflows. The current implementation supports continuous-time initial-value problems and classical mechanics; additional physical domains are planned, not yet implemented.
Documentation · Source · Issues
Installation
Clone the repository, then run uv sync to create a reproducible
development environment. CPax currently requires Python 3.12 or newer.
Quickstart
import cpax
from cpax.mechanics import NewtonianSystem, PhaseSpaceState
system = NewtonianSystem(potential=lambda q: q**2 / 2, mass=1.0)
problem = cpax.IVP(system, PhaseSpaceState(1.0, 0.0), (0.0, 10.0))
solution = cpax.solve(problem, saveat=cpax.SaveAt.linspace(500))
print(solution.ys.q) # Position
print(solution.ys.p) # Canonical momentum
The same workflow supports the conservative Duffing oscillator, the
built-in cpax.dynamics.LorenzSystem, and multibody Newtonian gravity.
See the examples and documentation for complete scripts,
plots, and the animated Sun–Earth–Mars–Jupiter–comet showcase.
The default solver="auto" currently selects Diffrax Tsit5 for IVPs.
It does not infer stiffness or symplectic structure. A standalone
symplectic leapfrog integrator is preserved in cpax.ode.
Development
CPax uses uv, Ruff, and ty:
uv sync
uv run pytest
uv run ruff check .
uv run ruff format --check .
uv run ty check
uv run sphinx-build -W -b html docs/source docs/_build/html
Releases use calendar versions YYYY.M.N. The manual GitHub Actions
release workflow supports non-publishing previews and publishing from
main. See the workflow for its latest controls and validation. Publishing to PyPI\nis a separate, manually approved process described in\nthe release guide.
Metadata
Release files for CPax 2026.10.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | |
|---|---|---|---|---|
| cpax-2026.10.0.tar.gz | 28.0 kB | With provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| cpax-2026.10.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 48.7 kB
Release files / cpax-2026.10.0.tar.gz
| Download URL | cpax-2026.10.0.tar.gz |
|---|---|
| Size | 28.0 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
55d9b087204cf036f87a0a311f5e8bc88f31de43c3d4960a4146c9322fb82c09
|
|
BLAKE2b-256 checksum How to use checksums |
a3412a748c20674a6ae7e37582c9d7a63cc219c5e7a70c3eb3003a4c4b83c2bc
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Oct 21, 2026.
Transparency logRelease files / cpax-2026.10.0-py3-none-any.whl
| Download URL | cpax-2026.10.0-py3-none-any.whl |
|---|---|
| Size | 20.7 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
5edb6e5f7098bc4d0abb6daa1d3dbcb390d4e5e9bcedce7cfeb5edc2b07e2a87
|
|
BLAKE2b-256 checksum How to use checksums |
aba1c99c72f6596f3dbf6eb050fb2dc13fc472f7748c1f604b6d5a8349ba868e
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Oct 21, 2026.
Transparency logSecurity for CPax 2026.10.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
Full provenance
All 2 files in this release have been uploaded with provenance metadata.
Attestation for cpax-2026.10.0.tar.gz
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Oct 21, 2026.
Transparency logA note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.