Skip to main content

CAX: Cellular Automata Accelerated in JAX

logo
PyPI - Python Version PyPI - Version Paper X URL

CAX is a high-performance and flexible open-source library designed to accelerate artificial life research — cellular automata, particle systems, and other self-organizing complex systems, all in JAX. 🧬

Overview 🔎

Are you interested in emergence, self-organization, or open-endedness? Whether you're a researcher or just curious about the fascinating world of artificial life, CAX is your digital lab! 🔬

Designed for speed and flexibility, CAX allows you to easily experiment with self-organizing behaviors and emergent phenomena. 🧑‍🔬

Get started here Colab

Why CAX? 💡

CAX supports discrete and continuous systems, including neural cellular automata, across any number of dimensions. Beyond traditional cellular automata, it also handles particle systems and more, all unified under a single, intuitive API.

Rich 🎨

CAX provides a comprehensive collection of 20+ ready-to-use systems. From simulating one-dimensional elementary cellular automata to training three-dimensional self-autoencoding neural cellular automata, or even creating beautiful Lenia simulations, CAX provides a versatile platform for exploring the rich world of self-organizing systems.

Flexible 🧩

CAX makes it easy to extend existing systems or build custom ones from scratch for endless experimentation and discovery. Design your own experiments to probe the boundaries of artificial open-ended evolution and emergent complexity.

Fast 🚀

CAX is built on top of the JAX/Flax ecosystem for speed and scalability. The library benefits from vectorization and parallelization on various hardware accelerators such as CPU, GPU, and TPU. This allows you to scale your experiments from small prototypes to massive simulations with minimal code changes.

Tested & Documented 📚

The library is thoroughly tested and documented with numerous examples to get you started! Our comprehensive guides walk you through everything from basic cellular automata to advanced neural implementations.

Zoo 🦎

Complex System Reference Example
Elementary Cellular Automata Wolfram (2002) Colab
Conway's Game of Life Gardner (1970) Colab
Langton's Ant Langton (1986) Colab
Abelian Sandpile Bak et al. (1987) Colab
Lenia Chan (2020) Colab
Flow Lenia Plantec et al. (2022) Colab
Particle Lenia Mordvintsev et al. (2022) Colab
Reaction-Diffusion Gray & Scott (1984) Colab
Particle Life Mohr (2018) Colab
Boids Reynolds (1987) Colab
Growing Neural Cellular Automata Mordvintsev et al. (2020) Colab
Growing Conditional Neural Cellular Automata Sudhakaran et al. (2022) Colab
Growing Unsupervised Neural Cellular Automata Palm et al. (2021) Colab
Diffusing Neural Cellular Automata Faldor et al. (2024) Colab
Self-classifying MNIST Digits Randazzo et al. (2020) Colab
Self-autoencoding MNIST Digits Faldor et al. (2024) Colab
Texture Neural Cellular Automata Niklasson et al. (2021) Colab
1D-ARC Neural Cellular Automata Faldor et al. (2024) Colab
Attention-based Neural Cellular Automata Tesfaldet et al. (2022) Colab
Leniabreeder Faldor & Cully (2024) Colab

Getting Started 🚦

Here, you can see the basic CAX API usage with Conway's Game of Life:

import jax
import jax.numpy as jnp

from cax.cs.life import Life

seed = 0

num_steps = 128
spatial_dims = (32, 32)
channel_size = 1
rule_golly = "B3/S23"  # Conway's Game of Life

key = jax.random.key(seed)

birth, survival = Life.birth_survival_from_string(rule_golly)
cs = Life(birth=birth, survival=survival)

state_init = jax.random.bernoulli(key, p=0.5, shape=(*spatial_dims, channel_size)).astype(
	jnp.float32
)
state_final, states = cs(state_init, num_steps=num_steps, return_states=True)

For a more detailed overview, get started with this notebook Colab

Installation ⚙️

You will need Python 3.12 or later, and a working JAX installation installed in a virtual environment.

Then, install CAX from PyPi with uv:

uv pip install cax

or with pip:

pip install cax

Citing CAX 📝

If you use CAX in your research, please cite the following paper:

@inproceedings{cax,
	title = {{CAX}: {Cellular} {Automata} {Accelerated} in {JAX}},
	volume = {2025},
	url = {https://proceedings.iclr.cc/paper_files/paper/2025/file/19206a6ed5ed0aaeed440448dfc5cf7e-Paper-Conference.pdf},
	booktitle = {International {Conference} on {Representation} {Learning}},
	author = {Faldor, Maxence and Cully, Antoine},
	editor = {Yue, Y. and Garg, A. and Peng, N. and Sha, F. and Yu, R.},
	year = {2025},
	pages = {8947--8960},
	keywords = {artificial life, emergence, self-organization, open-endedness, cellular automata, neural cellular automata},
}

Contributing 👷

Contributions are welcome! If you find a bug or are missing your favorite self-organizing system, please open an issue or submit a pull request following our contribution guidelines 🤗.

Metadata

Release files for cax 0.4.1

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

Source distribution (sdist)

Source distribution for cax 0.4.1
File Size Uploaded
cax-0.4.1.tar.gz 645.0 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for cax 0.4.1
File Interpreter ABI Platform
cax-0.4.1-py3-none-any.whl Python 3 none any Details

Total release size: 747.1 kB

Release files / cax-0.4.1.tar.gz

Download URL cax-0.4.1.tar.gz
Size 645.0 kB
Tags Source
SHA-256 checksum
How to use checksums
1a40bdd3731519a9b7ef5003c1addf444986c342d9a1c342207b1c00c60ec51e
BLAKE2b-256 checksum
How to use checksums
02055847bd6ab51b01a53e2da33454b27e23e8433b87ff603bffe55f4a8e2c0a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.12.7 {"installer":{"name":"uv","version":"0.12.7","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Release files / cax-0.4.1-py3-none-any.whl

Download URL cax-0.4.1-py3-none-any.whl
Size 102.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
d27f5499f6c4dcd12af2807e57ed2ef12d70093e5911120ec32538bf76725eef
BLAKE2b-256 checksum
How to use checksums
198fe1a2c13a432504633e38fd33cfc8e65b69d85c3dc6c3fd3ad0e6e36137c9
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.12.7 {"installer":{"name":"uv","version":"0.12.7","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Release history Release notifications | RSS feed

0.4.4

2 release files

0.4.3

2 release files

0.4.2

2 release files

This release

0.4.1 This release

2 release files

0.4.0

2 release files

0.3.3

2 release files

0.3.2

2 release files

0.3.1

2 release files

0.3.0

2 release files

0.2.1

2 release files

0.2.0

2 release files

0.1.6

2 release files

0.1.5

2 release files

0.1.4

2 release files

0.1.3

2 release files

0.1.2

2 release files

0.1.1

2 release files

0.1.0

2 release files

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