Skip to main content

jax-morph

Differentiable particle-based physics for proliferating cells and active matter, built with JAX and Equinox.

  • Differentiable end-to-end — pathwise gradients through the continuous physics, score-function gradients through discrete events.
  • Composable physics steps — mechanics, diffusion, Brownian and active-Brownian dynamics, growth, division, and death.
  • Principled time-stepping — steps compose into one macro-step by Lie-Trotter operator splitting: each advances the shared state over dt, giving a consistent, first-order-accurate integrator of the coupled dynamics.
  • Continuous-time dynamics and control — neural-ODE and gene-network controllers that model cell decision making from local cues.
  • Core abstractions built for easy extension — add your own physics steps to the pipeline. Guides provided with the library for coding agents reference.
  • JAX and Equinox native — jit, vmap, Equinox filtered transformations and neural-network modules work throughout the pipeline; GPU support out of the box.

See Key Concepts and usage guides for more.


Installation

jax-morph requires Python 3.11 or later.

pip install jax-morph

Or with uv:

uv add jax-morph

The visualization API is an optional matplotlib-backed extra. Install it when using jxm.viz.draw, jxm.viz.animate, or jxm.viz.plot_timeseries:

pip install 'jax-morph[viz]'

Or with uv:

uv add 'jax-morph[viz]'

The base package does not install matplotlib; import jax_morph.viz remains available, and a rendering call explains how to add the extra if it is missing.


Quickstart

This model seeds a single cell that diffuses under a pairwise interaction and stochastically divides:

import jax

import jax_morph as jxm
from jax_morph.physics import BrownianDynamics, Division, SoftSphere

# Cells diffuses under a soft-sphere interaction and divide stochastically
model = jxm.Model([
    BrownianDynamics(SoftSphere(), n_space_dim=2, kT=0.05),
    Division(n_space_dim=2),
])

# Build state class and initialize with a single cell
StateClass = jxm.build_state_from_model(model)
state = StateClass.init_empty(capacity=32, n_space_dim=2, n_types=1)
state = state.update(
    alive=state.alive.at[0].set(True),
    radius=state.radius.at[0].set(0.5),
    celltype=state.celltype.at[0, 0].set(1.0),
    division_rate=state.division_rate.at[0].set(1.0),
)

# Simulate
sim_key = jax.random.PRNGKey(0)
final_state = jxm.simulate(model, state, n_steps=20, dt=0.1, key=sim_key)

See the documentation and example notebooks for more.


Installed usage guides

Usage guides ship with the library so they remain available with a PyPI installation and match the installed API version:

import jax_morph as jxm

jxm.guides.list_guides()
jxm.guides.guide('extending')
jxm.guides.guide('optimization/pathwise')

Reference

If you use Jax-Morph, please cite:

@article{deshpandemottes2025,
  title={Engineering morphogenesis of cell clusters with differentiable programming},
  author={Deshpande, Ramya and Mottes, Francesco and Vlad, Ariana-Dalia and Brenner, Michael P and Dal Co, Alma},
  journal   = {Nature Computational Science},
  year      = {2025},
  doi       = {10.1038/s43588-025-00851-4},
  url       = {https://doi.org/10.1038/s43588-025-00851-4}
}

The published paper can be read here.

Metadata

Release files for jax-morph 0.4.0

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

Source distribution (sdist)

Source distribution for jax-morph 0.4.0
File Size Uploaded Provenance Actions
jax_morph-0.4.0.tar.gz 11.5 MB With provenance Details for jax_morph-0.4.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for jax-morph 0.4.0
File Interpreter ABI Platform Actions
jax_morph-0.4.0-py3-none-any.whl Python 3 none any Details for jax_morph-0.4.0-py3-none-any.whl

Total release size: 11.6 MB

Release files / jax_morph-0.4.0.tar.gz

Download URL jax_morph-0.4.0.tar.gz
Size 11.5 MB
Tags Source
SHA-256 checksum
How to use checksums
696cb08184085ac832347622f6afb18a2016bbb34491a4b3faf9ee90bde0b369
BLAKE2b-256 checksum
How to use checksums
53323e385096f6aecaea61b1752c55e2fb008253e28f9a352f3a0bb03f454bea
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.12

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 Jul 17, 2026.

Transparency log

Release files / jax_morph-0.4.0-py3-none-any.whl

Download URL jax_morph-0.4.0-py3-none-any.whl
Size 118.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
93526c5ae3317b43746acb9f227884778055d26be2a3f9dda0d0eb89585b8853
BLAKE2b-256 checksum
How to use checksums
a4f9ee99ecaae4f76565efc2b96cc5b014dbd035ad106b4905794a565d25cf4f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.12

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 Jul 17, 2026.

Transparency log

Security for jax-morph 0.4.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

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

Select from 2 files

Attestation for jax_morph-0.4.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 Jul 17, 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.

Release history Release notifications | RSS feed

This release

0.4.0 This release

2 release files Full provenance

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