Registry / ai-ml / jaxley

jaxley

JSON →
library0.13.0pypypi✓ verified 84d ago

Jaxley is a Python library for differentiable neuron simulations built on JAX. Current version is 0.13.0, released with monthly cadence. It enables automatic differentiation through neuron models, supporting multi-compartment simulations, channel dynamics, and synaptic connections.

pip install jaxley
INSTALL
IMPORT
SIG · JAXLEY
J
jaxley
ai-mlpythonv0.13.0
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

jx
import jaxley as jx
import jaxley
Common practice is to import as jx for brevity, but direct import works. However, many examples use jx.
Module
from jaxley import Module
from jaxley.base import Module
Module class used to be in a private submodule; now it's at the top level.

Quickstart: create a single-compartment neuron, apply a step current, record membrane potential, and run simulation.

import jaxley as jx import jax.numpy as jnp # Create a single compartment cell cell = jx.Module() cell.add('compartment') # Configure stimuli and record cell.stimulate(jx.step_current(amplitude=0.1, duration=10.0)) cell.record() # Simulate for 20 ms voltage = cell.integrate(dt=0.025, t_max=20.0) print(voltage.shape) # (1, 800) - one compartment, 800 time steps
Debug
Known issues
breakingBetween v0.2 and v0.3, the API for creating compartments was overhauled. `jx.Module` replaces the older `jx.single_compartment()`.
fix
Use `jx.Module()` and call `.add('compartment')` instead of `jx.single_compartment()`.
affects: 0.2.x -> 0.3+
breakingThe `integrate()` method now returns JAX arrays, not NumPy arrays. Direct indexing or conversion may be needed.
fix
Convert with `np.asarray(voltage)` if NumPy operations are required.
affects: all
gotchaJaxley requires JAX and defaults to float32. For simulations requiring double precision, you must set JAX configuration: `jax.config.update('jax_enable_x64', True)` before importing jaxley.
fix
Set `jax.config.update('jax_enable_x64', True)` before importing jaxley.
affects: all
Errors
Common errors & fixes
AttributeError: module 'jaxley' has no attribute 'single_compartment'
Removed in v0.3; the API changed to use `Module`.
fix
Use `jx.Module()` and add compartments via `.add('compartment')`.
JaxleyError: Cannot automatically differentiate this channel mechanism. Consider using jaxley.channels instead of custom functions.
Custom ion channel dynamics not supported for autodiff if not implemented as a Jaxley channel.
fix
Rewrite custom channel models using `jx.channels.HHChannel` or other built-in channel classes.
Upgrade
Version history
0.13.0latest on PyPI · released Dec 18, 2025
Audit
Dependencies
jaxrequiredCore backend for automatic differentiation and GPU acceleration.
jaxlibrequiredRequired by JAX for hardware acceleration.
Agent activity
11 hits · last 30 days
node
10
Amazon
1
Resources

No resource links recorded.

jaxley — pip install jaxley · libregistry