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.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 cax 0.4.0
File Size Uploaded
cax-0.4.0.tar.gz 44.4 MB Details

Built distribution (wheel)

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

Total release size: 44.5 MB

Release files / cax-0.4.0.tar.gz

Download URL cax-0.4.0.tar.gz
Size 44.4 MB
Tags Source
SHA-256 checksum
How to use checksums
401e6a98439eee149bfabaddf65785f15a8b0a5265c51460025f5581d7b5c9ee
BLAKE2b-256 checksum
How to use checksums
81fb824500f00deea696d1739e5ef6cd6b31b0cdfce3eb4677285f28aedf24fe
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.12.6 {"installer":{"name":"uv","version":"0.12.6","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.0-py3-none-any.whl

Download URL cax-0.4.0-py3-none-any.whl
Size 102.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
22dbed22aceb40b23debdfe34a6d538aa57f4d66d9e439b159753253701329e6
BLAKE2b-256 checksum
How to use checksums
97f6fc9ca70bd56f7e51cf037f8c26d778a92e6c2b9870802ea2309457b726ec
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.12.6 {"installer":{"name":"uv","version":"0.12.6","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

0.4.1

2 release files

This release

0.4.0 This release

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