Metadata-Version: 2.4
Name: twindex
Version: 0.3.0
Summary: Exact, replayable certificates that noisy PDE data cannot tell two parameter sets apart.
Author: Arnav Mittal
License-Expression: MIT
Project-URL: Homepage, https://github.com/Arnav-M10/Twindex
Project-URL: Documentation, https://arnav-m10.github.io/Twindex/
Project-URL: Source, https://github.com/Arnav-M10/Twindex
Project-URL: Issues, https://github.com/Arnav-M10/Twindex/issues
Keywords: inverse problems,identifiability,certified computation,computer-assisted proof,exact arithmetic,PDE,PINN,set inversion,optimal recovery
Classifier: Development Status :: 4 - Beta
Classifier: Intended Audience :: Science/Research
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3 :: Only
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Topic :: Scientific/Engineering :: Mathematics
Classifier: Topic :: Scientific/Engineering :: Physics
Requires-Python: >=3.10
Description-Content-Type: text/markdown
License-File: LICENSE
Provides-Extra: search
Requires-Dist: numpy>=1.24; extra == "search"
Provides-Extra: studies
Requires-Dist: numpy>=1.24; extra == "studies"
Requires-Dist: matplotlib>=3.7; extra == "studies"
Provides-Extra: docs
Requires-Dist: mkdocs-material>=9.5; extra == "docs"
Requires-Dist: mkdocstrings[python]>=0.26; extra == "docs"
Requires-Dist: numpy>=1.24; extra == "docs"
Provides-Extra: dev
Requires-Dist: numpy>=1.24; extra == "dev"
Requires-Dist: pytest>=7; extra == "dev"
Requires-Dist: hypothesis>=6; extra == "dev"
Requires-Dist: ruff>=0.4; extra == "dev"
Requires-Dist: build>=1; extra == "dev"
Requires-Dist: twine>=5; extra == "dev"
Requires-Dist: setuptools>=77; extra == "dev"
Requires-Dist: mypy>=1.10; extra == "dev"
Requires-Dist: pytest-cov>=5; extra == "dev"
Dynamic: license-file

# Twindex

**Your inverse solver returned a parameter. Twindex proves whether the data could have determined it.**

Least squares, Bayesian inference and physics-informed neural networks always
*return* a parameter. On their own, they do not give an independently checkable
proof of whether a very different parameter fits your measurements just as well.
Twindex finds such *twins* for
the boundary value problem

    -u''(x) + q(x; theta) f(u(x)) = g(x)  on (0, 1),   u(0) = alpha,  u(1) = beta,
    q(x; theta) = sum_j theta_j B_j(x)   (Bernstein basis, theta >= 0),
    f(u) = sum of a_m u^m over odd m, a_m >= 0,

and proves it: it writes a JSON certificate that a small exact checker
(standard-library Python, no floating point, type-checked with mypy --strict)
replays and verifies. A VALID pair certificate proves that **no method** can
recover the parameter from those data with worst-case error below half the
certified gap.

```console
$ pip install twindex              # exact checker + CLI, zero dependencies
$ pip install "twindex[search]"    # + numerical search, audits and fitting (numpy)

$ twindex example theta500_pair > pair.json
$ twindex check pair.json
pair.json: VALID: ... every estimator of theta_0 has worst-case error >= 500 on these data

$ twindex audit --data measurements.csv --epsilon 1/1000 --prior 0,1000 --target 1 --output audit/
```

* Certificates: witness, pair (twins), box, and paving (two-sided bounds).
* Your model: any coefficient degree, polynomial sources, odd-power
  nonlinearities, inhomogeneous boundary values.
* `twindex.fit`: check any callable (a PINN, scipy, FEM) as an exact candidate.
* Every step is proved: https://arnav-m10.github.io/Twindex/THEORY/

Documentation: https://arnav-m10.github.io/Twindex/ ·
Source: https://github.com/Arnav-M10/Twindex
