Metadata-Version: 2.4
Name: jaxcont
Version: 0.1.0
Summary: High-performance continuation and bifurcation analysis in JAX
Author-email: Abolfazl Ziaeemehr <a.ziaeemehr@gmail.com>
License-Expression: MIT
Project-URL: Homepage, https://github.com/Ziaeemehr/JaxCont
Project-URL: Documentation, https://jaxcont.readthedocs.io
Project-URL: Repository, https://github.com/Ziaeemehr/JaxCont
Project-URL: Bug Tracker, https://github.com/Ziaeemehr/JaxCont/issues
Project-URL: Changelog, https://jaxcont.readthedocs.io/en/latest/changelog.html
Keywords: bifurcation,continuation,dynamical-systems,jax,numerical-analysis
Classifier: Development Status :: 3 - Alpha
Classifier: Intended Audience :: Science/Research
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Topic :: Scientific/Engineering :: Mathematics
Classifier: Topic :: Scientific/Engineering :: Physics
Requires-Python: >=3.9
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: jax>=0.3.0
Requires-Dist: jaxlib>=0.3.0
Requires-Dist: numpy>=1.21.0
Requires-Dist: scipy>=1.7.0
Requires-Dist: matplotlib>=3.5.0
Provides-Extra: dev
Requires-Dist: pytest>=7.4.0; extra == "dev"
Requires-Dist: pytest-cov>=4.1.0; extra == "dev"
Requires-Dist: black>=23.0.0; extra == "dev"
Requires-Dist: flake8>=6.0.0; extra == "dev"
Requires-Dist: mypy>=1.5.0; extra == "dev"
Requires-Dist: isort>=5.12.0; extra == "dev"
Requires-Dist: sphinx>=7.0.0; extra == "dev"
Requires-Dist: sphinx-book-theme>=1.1.0; extra == "dev"
Requires-Dist: sphinx-gallery>=0.19.0; extra == "dev"
Requires-Dist: jupyter>=1.0.0; extra == "dev"
Requires-Dist: ipython>=8.12.0; extra == "dev"
Requires-Dist: build>=1.2.0; extra == "dev"
Requires-Dist: twine>=5.0.0; extra == "dev"
Provides-Extra: docs
Requires-Dist: sphinx>=7.0.0; extra == "docs"
Requires-Dist: sphinx-book-theme>=1.1.0; extra == "docs"
Requires-Dist: sphinx-gallery>=0.19.0; extra == "docs"
Requires-Dist: myst-parser>=2.0.0; extra == "docs"
Dynamic: license-file

# JaxCont

**Vectorize whole continuation sweeps with `jax.vmap`, and differentiate
bifurcation locations with `jax.grad`.**

[![Test](https://github.com/Ziaeemehr/JaxCont/actions/workflows/tests.yml/badge.svg)](https://github.com/Ziaeemehr/JaxCont/actions/workflows/tests.yml)
[![Documentation Status](https://readthedocs.org/projects/jaxcont/badge/?version=latest)](https://jaxcont.readthedocs.io/latest/)
[![PyPI version](https://img.shields.io/pypi/v/jaxcont.svg)](https://pypi.org/project/jaxcont/)
[![License: MIT](https://img.shields.io/badge/License-MIT-blue.svg)](LICENSE)

JaxCont is an equilibrium continuation and bifurcation-analysis library built
around JAX transformations. Its whole-loop pseudo-arclength engine is a pure,
compiled computation: use `vmap` to compute ensembles of branches in one
batched kernel, `jacfwd` to differentiate through a sweep, or the implicit
`fold_parameter` solver for reverse-mode gradients of a fold location.

```python
# One compiled kernel computes a branch for every design value.
branches = jax.vmap(run_branch)(design_values)

# A fold location can participate in gradient-based inverse design.
dp_dtheta = jax.grad(
    lambda theta: jc.fold_parameter(f, u_guess, p_guess, theta)
)(theta)
```

The v0.1 series deliberately focuses on equilibria: natural and
pseudo-arclength continuation, fold and Hopf detection with refinement,
linear stability, and bifurcation diagrams. Periodic orbits, Floquet
multipliers, boundary-value problems, branch switching, and two-parameter
continuation are not part of the supported v0.1 API.

## Installation

JaxCont requires Python 3.9 or newer.

```bash
pip install jaxcont
```

For a development checkout:

```bash
git clone https://github.com/Ziaeemehr/JaxCont.git
cd JaxCont
python -m pip install -e ".[dev]"
```

JAX's platform-specific accelerator installation is documented in the
[JAX installation guide](https://docs.jax.dev/en/latest/installation.html).

## Quick start

Continue the positive branch of `u² + p = 0` through its fold at `p = 0`:

```python
import jax.numpy as jnp
import jaxcont as jc

def saddle_node(u, p, args):
    return u**2 + p

problem = jc.bif_problem(saddle_node, u0=jnp.array([1.0]), p0=-1.0)
result = jc.continuation(
    problem,
    p_span=(-1.0, 0.2),
    settings=jc.ContinuationPar(ds=0.03, max_steps=200),
    events=[jc.Fold()],
)

print(result.branch.params)
print([(event.kind, event.p) for event in result.events])
```

`PseudoArclength(engine="scan")` is the default algorithm. It uses the
whole-loop compiled engine, computes stability in a vectorized post-pass, and
refines requested fold/Hopf events. Use `jc.Natural()` for natural-parameter
continuation or `jc.PseudoArclength(engine="legacy")` only when comparing with
the compatibility implementation.

See the [quickstart](https://jaxcont.readthedocs.io/en/latest/quickstart.html),
[Sphinx-Gallery examples](https://jaxcont.readthedocs.io/en/latest/auto_examples/index.html),
[`example_06_vmap_sweep.py`](examples/example_06_vmap_sweep.py), and
[`example_07_differentiable.py`](examples/example_07_differentiable.py) for the
full `vmap`, `jacfwd`, and inverse-design stories.

## Development

```bash
python -m pytest
make docs
python -m build
python -m twine check dist/*
```

Contributions are welcome; see [CONTRIBUTING.md](CONTRIBUTING.md). The project
roadmap and supported scope live in [notes/ROADMAP.md](notes/ROADMAP.md).

## Citation

If JaxCont supports your research, cite the archived release using the DOI in
the GitHub/Zenodo release record. Citation metadata is also provided in
[`CITATION.cff`](CITATION.cff). Until the first archive is minted:

```bibtex
@software{ziaeemehr_jaxcont_2026,
  author  = {Ziaeemehr, Abolfazl},
  title   = {JaxCont: Differentiable Continuation and Bifurcation Analysis in JAX},
  year    = {2026},
  version = {0.1.0},
  url     = {https://github.com/Ziaeemehr/JaxCont}
}
```

JaxCont is distributed under the [MIT License](LICENSE).
