Metadata-Version: 2.4
Name: imci-landscape
Version: 1.0.0
Classifier: Development Status :: 5 - Production/Stable
Classifier: Programming Language :: Rust
Classifier: Topic :: Scientific/Engineering :: Mathematics
Requires-Dist: numpy>=1.26
Requires-Dist: scipy>=1.12 ; extra == 'benchmark'
Requires-Dist: numba ; extra == 'benchmark'
Requires-Dist: maturin>=1.9.3,<2 ; extra == 'dev'
Requires-Dist: pytest>=8 ; extra == 'dev'
Requires-Dist: scipy>=1.12 ; extra == 'dev'
Provides-Extra: benchmark
Provides-Extra: dev
License-File: LICENSE
License-File: THIRD_PARTY_NOTICES.txt
License-File: RUST_STANDARD_LIBRARY_NOTICES.html
Summary: Batch-oriented stationary-point discovery for mathematical landscapes
Home-Page: https://imci-research.org
Author: Domenic Merenda
License-Expression: LicenseRef-BNA-1.0
Requires-Python: >=3.10, <3.14
Description-Content-Type: text/markdown; charset=UTF-8; variant=GFM
Project-URL: Homepage, https://imci-research.org
Project-URL: Issues, https://github.com/imci-research/imci-scientific/issues
Project-URL: Repository, https://github.com/imci-research/imci-scientific

# IMCI Landscape

`imci-landscape` finds and classifies stationary points of real multivariate
potentials. It supports sparse polynomials, scalar expressions and Gaussian
quantum potentials, with parallel gradient-root searches and aggregation.

## Installation

CPython 3.10–3.13 is supported. After publication to PyPI:

```sh
python -m pip install imci-landscape
```

To install a downloaded wheel, use `python -m pip install` with the wheel
filename. A compatible prebuilt wheel requires no Rust toolchain.

## Build from source

Source builds require Rust and a platform C toolchain. From this directory
in a Python virtual environment with pip installed:

```sh
python -m pip install .
```

For an editable development installation with test and benchmark dependencies:

```sh
python -m pip install -e ".[dev,benchmark]"
```

See the [workspace development instructions](../CONTRIBUTING.md) for environment
setup and locked release builds.

## Usage

```python
import numpy as np
from imci.landscape import Polynomial, critical_points

f = Polynomial.from_terms({(4, 0): 1, (2, 0): -2,
                           (0, 4): 1, (0, 2): -2})
starts = np.random.default_rng(42).uniform(-2, 2, (1000, 2))
result = critical_points(f, starts, x_tol=1e-8)

for p in result.points:
    print(p.x, p.kind, p.residual, p.hits)
```

Select `method="dogleg"` or `method="regularized"` to use a trust-region method. The default is `method="newton"`.

`result.statuses` counts the outcomes of all searches. Each retained point includes its function value, gradient norm, Hessian eigenvalues, classification and number of assigned starts.

For a bounded distribution of starting points:

```python
from imci.landscape import discover_critical_points

result = discover_critical_points(f, [[-2, 2], [-2, 2]],
                                  budget=1000, seed=42, x_tol=1e-8)
```

The adaptive search allocates part of its budget to starts derived from previously discovered points. The bounds constrain starts, not returned roots. Adaptive sampling can improve discovery of closely spaced roots, but can be slower and recover fewer roots than uniform sampling on other landscapes. Explicit uniform starts passed to `critical_points` are a general-purpose starting strategy.

For nonpolynomial potentials:

```python
from imci.landscape import Expression

f = Expression("x*x + 2*exp(-x*x) + y*y", ["x", "y"])
result = critical_points(f, starts, x_tol=1e-8)
```

Expressions support arithmetic, integer powers, `exp`, `sin`, `cos` and `log`.
The Rust evaluator computes first and second derivatives by forward automatic
differentiation. Expressions use a user-supplied positive `scale` (default 1)
in normalized mode; this does not automatically infer a scale from the expression.

For equal-bandwidth Gaussian quantum potentials:

```python
from imci.landscape import QuantumPotential

f = QuantumPotential([[-1., 0.], [1., 0.]], sigma=1.)
result = critical_points(f, starts, x_tol=1e-8)
```

The evaluator uses relative Gaussian weights and analytic weighted moments.
The additive energy constant is omitted. Absolute derivative tolerances
apply without potential normalization; `x_tol` is a coordinate-space
tolerance.

## Tests

```sh
cargo test --locked -p imci-core -p imci-landscape
python -m pytest -q
```

See [methods](docs/methods.md) for numerical semantics and limitations,
[benchmarks](benchmarks/README.md) for experiment commands, and
[validation](docs/validation.md) for recorded results. The
[release procedure](docs/release.md) describes wheel validation and distribution.

## Scope

Models support 1–16 dimensions. Polynomials support up to 4096 monomials and integer exponents from 0 to 32; quantum potentials support up to 4096 centers. Expressions support at most 1024 instructions and nesting depth 64. Calculations use CPU double precision. Starting points are not domain bounds. Multistart search does not certify stationary points or establish completeness. `x_tol` is optional (disabled by default); use it to reject small-gradient candidates with large Newton corrections. It is not a certified location bound.

## Citation

See [CITATION.cff](CITATION.cff) for software citation metadata.

## License

Copyright 2026 Domenic Merenda. Distributed under the [But Not Amazon License, version 1.0](LICENSE) (`LicenseRef-BNA-1.0`), a custom source-available license. Section 10 excludes specified parties and uses. It is not the Apache License 2.0.

Third-party dependencies retain their respective licenses. See
[THIRD_PARTY_NOTICES.txt](THIRD_PARTY_NOTICES.txt) for the locked Rust
dependency inventory and upstream notices, and
[RUST_STANDARD_LIBRARY_NOTICES.html](RUST_STANDARD_LIBRARY_NOTICES.html)
for the Rust standard-library copyright notices.

