Skip to main content

physverify

tests PyPI Python DOI Docs

Checks that a simulation solves the equations it claims, at the order of accuracy it claims, not just that it runs.

physverify is actively evolving (v0.4.2), welcoming contributions and test cases from the computational physics community. Scope: numerical solutions of ODEs and PDEs (time integration, convergence, conservation), plus a few Monte Carlo checks. It needs only NumPy.

The check loop: your solver and an independent description of the physics go in; physverify runs the solver at several resolutions, measures the error and reports a verdict with a reason

pip install physverify
physverify demo

The demo checks a correct solver (all checks pass), then the same solver with the damping 10% too large (all fail):

Error against step size: the correct solver follows the slope-2 line, the broken one levels off

Use it on your own code

  • An ODE solver: physverify init verify_solver.py --solver mysolver --order 4 writes a spec; fill in the equations (from the physics, not from your code) and run physverify run verify_solver.py.
  • A Runge-Kutta table: check_tableau(A, b, c, claimed=3) from physverify.butcher checks its order, stage order and stability from the coefficients alone.
  • Errors you already have: check_order(hs, errors, expected=2) gives PASS, FAIL or INCONCLUSIVE with a reason.

Run it in CI

A failed check fails the job, like a broken unit test (CI guide: options, pre-commit, pytest):

      - uses: rcgiri-physics/physverify@v0.4.2
        with:
          specs: tests/verify_*.py

Getting started · Recipes · What a PASS means · Troubleshooting · API

Does it catch bugs?

Of 37 bugs seeded into five small solvers, it flagged 35 (plain "compare with one answer" tests: 27), with no false alarms. The bugs and checks were written by the same person, so this shows the tool works as designed, not how it does on other people's code. On public physics repositories it found real bugs, for example Runge-Kutta tables with a wrong order label; the counts are not a bug rate. Details: results, and results/README.md to regenerate every table.

Limits

Works best for ODEs; PDEs only in 1D so far. Your code needs a way to add a source term, or a small wrapper that can itself be wrong. A PASS means these checks found nothing wrong; it does not prove the simulation correct, and it is only as independent as the reference you wrote: see What a PASS means.

Contributing, citing, licence

Help is welcome: a trial report on your own solver, seeded bugs written by someone other than the author, adapters, documentation. See CONTRIBUTING.md. To cite, use doi:10.5281/zenodo.23534512 or CITATION.cff. Changes: CHANGELOG.md; plans: ROADMAP.md. MIT licence, copyright (c) 2026 Ram Chandra Giri.

Metadata

Release files for physverify 0.4.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for physverify 0.4.2
File Size Uploaded Provenance Actions
physverify-0.4.2.tar.gz 126.4 kB With provenance Details for physverify-0.4.2.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for physverify 0.4.2
File Interpreter ABI Platform Actions
physverify-0.4.2-py3-none-any.whl Python 3 none any Details for physverify-0.4.2-py3-none-any.whl

Total release size: 243.1 kB

Release files / physverify-0.4.2.tar.gz

Download URL physverify-0.4.2.tar.gz
Size 126.4 kB
Tags Source
SHA-256 checksum
How to use checksums
212db607c0fb7fcd836f965d6db0bc9beb2c85573a89af854ad7cd73e8c0dbaf
BLAKE2b-256 checksum
How to use checksums
e93c22b58953860998960c3106d734f8389ce2fa945992fbb79bbc5f4d52cdaa
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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 22, 2026.

Transparency log

Release files / physverify-0.4.2-py3-none-any.whl

Download URL physverify-0.4.2-py3-none-any.whl
Size 116.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
730ffa62fe4f5d84eb9742298e949c93802aa3c6ea9ff5e8c139851cc8e65029
BLAKE2b-256 checksum
How to use checksums
0f9441cdf175ce71e5300e15c907d3154b1c87dd458adc6542f979a520289319
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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 22, 2026.

Transparency log

Security for physverify 0.4.2

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

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for physverify-0.4.2.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 22, 2026.

Transparency log

A 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.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page